Skip to content

Commit

Permalink
updating Box and Stack api
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmguo committed Aug 9, 2023
1 parent 484f296 commit 5c353b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions packages/libs/react-ui/src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface IBoxProps
extends Partial<
Pick<
Sprinkles,
| 'display'
| 'margin'
| 'marginX'
| 'marginY'
Expand All @@ -14,12 +15,13 @@ export interface IBoxProps
| 'marginRight'
>
> {
component?: ElementType;
as?: ElementType;
children?: React.ReactNode;
}

export const Box = ({
component = 'div',
as = 'div',
display = 'block',
margin = undefined,
marginX = undefined,
marginY = undefined,
Expand All @@ -30,9 +32,10 @@ export const Box = ({
children,
}: IBoxProps): React.ReactElement => {
return createElement(
component,
as,
{
className: sprinkles({
display,
margin,
marginX,
marginY,
Expand Down
6 changes: 3 additions & 3 deletions packages/libs/react-ui/src/components/Stack/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export interface IStackProps
direction?: Sprinkles['flexDirection'];
wrap?: Sprinkles['flexWrap'];
spacing?: Sprinkles['gap'];
component?: ElementType;
as?: ElementType;
children?: React.ReactNode;
}

export const Stack = ({
component = 'div',
as = 'div',
margin = undefined,
marginX = undefined,
marginY = undefined,
Expand All @@ -54,7 +54,7 @@ export const Stack = ({
children,
}: IStackProps): React.ReactElement => {
return createElement(
component,
as,
{
className: sprinkles({
display: 'flex',
Expand Down

0 comments on commit 5c353b1

Please sign in to comment.