Skip to content

Commit

Permalink
Merge pull request #4549 from GeekyAnts/release/3.3.3-rc.0
Browse files Browse the repository at this point in the history
release 3.3.3-rc.0
  • Loading branch information
surajahmed authored Jan 18, 2022
2 parents 0da7ae5 + f29bc14 commit e116a74
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
5 changes: 3 additions & 2 deletions next-example/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ const Home: NextPage = () => {
return (
<Stack
// space={[10, 20, 32]}
space={10}
direction={['row', 'row-reverse', 'column']}
space={[10, 20, 24]}
// space={'10'}
direction={['row', 'column', 'row']}
// direction={'column'}
// flexWrap={'wrap'}
>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"prettier --write"
]
},
"version": "3.3.3-alpha.2",
"version": "3.3.3-rc.0",
"license": "MIT",
"private": false,
"main": "lib/commonjs/index",
Expand Down
1 change: 1 addition & 0 deletions src/components/primitives/Box/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ export interface IBoxProps<T = null>
backgroundColor?: ResponsiveValue<
ColorType | (string & {}) | ILinearGradientProps
>;
// gap?: ResponsiveValue<number | string>;
}
28 changes: 15 additions & 13 deletions src/components/primitives/Stack/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,45 @@ export interface IStackProps extends IBoxProps<IStackProps> {
>;
}

const Stack = ({ space, ...props }: IStackProps, ref?: any) => {
const Stack = (props: IStackProps, ref?: any) => {
const dir = props.direction;
const {
children,
direction,
reversed,
divider,
size,
space,
...resolvedProps
}: any = usePropsResolution(
'Stack',
{ ...props, size: space },
props,
{},
{ resolveResponsively: [] }
{ resolveResponsively: ['direction', 'space'] }
);

//TODO: refactor for responsive prop
if (useHasResponsiveProps(props)) {
return null;
}

// eslint-disable-next-line react-hooks/rules-of-hooks
const responsiveQueryContext = React.useContext(ResponsiveQueryContext);
const disableCSSMediaQueries = responsiveQueryContext.disableCSSMediaQueries;

// eslint-disable-next-line react-hooks/rules-of-hooks
const resolvedGap = useToken('space', size);
const resolvedGap = useToken('space', space);

//TODO: refactor for responsive prop
if (useHasResponsiveProps(props)) {
return null;
}

return (
<Box
flexDirection={direction}
flexDirection={dir}
{...resolvedProps}
ref={ref}
style={disableCSSMediaQueries ? {} : { gap: resolvedGap }}
// @ts-ignore
gap={disableCSSMediaQueries ? undefined : resolvedGap}
>
{getSpacedChildren(
children,
size,
space,
direction === 'row' ? 'X' : 'Y',
reversed ? 'reverse' : 'normal',
divider
Expand Down
4 changes: 4 additions & 0 deletions src/theme/styled-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ export const space = {
properties: ['paddingTop', 'paddingBottom'],
scale: 'space',
},
gap: {
property: 'gap',
scale: 'space',
},
} as const;

export const typography = {
Expand Down

1 comment on commit e116a74

@vercel
Copy link

@vercel vercel bot commented on e116a74 Jan 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.