File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
packages/components/all/src/container Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2,25 +2,31 @@ import React from "react";
22import styles from "./index.module.scss" ;
33import classNames from "classnames" ;
44
5- type ContainerVariation = "horizontal" | "vertical" | " small";
5+ type ContainerVariation = "small" ;
66
7- interface ContainerProps extends React . HTMLAttributes < HTMLDivElement > {
7+ export interface ContainerProps extends React . HTMLAttributes < HTMLDivElement > {
88 variation ?: ContainerVariation | ContainerVariation [ ] ;
9+ spacingX ?: boolean ;
10+ spacingY ?: boolean ;
911}
1012
1113export const Container = ( {
12- variation = "horizontal" ,
14+ variation,
15+ spacingX = true ,
16+ spacingY,
1317 className,
1418 ...otherProps
1519} : Readonly < ContainerProps > ) : React . ReactElement => {
16- const computedVariations = Array . isArray ( variation ) ? variation : [ variation ] ;
20+ const computedVariations =
21+ Array . isArray ( variation ) || variation === undefined ? variation : [ variation ] ;
1722
1823 return (
1924 < div
2025 className = { classNames (
2126 styles . root ,
27+ { [ `${ styles . horizontal } ` ] : spacingX , [ `${ styles . vertical } ` ] : spacingY } ,
28+ computedVariations ?. map ( ( i ) => styles [ i ] ) ,
2229 className ,
23- computedVariations . map ( ( i ) => styles [ i ] ) ,
2430 ) }
2531 { ...otherProps }
2632 />
You can’t perform that action at this time.
0 commit comments