22
33import { useStylesheet } from '@ui5/webcomponents-react-base' ;
44import { clsx } from 'clsx' ;
5- import type { ElementType , ReactNode } from 'react' ;
5+ import type { CSSProperties , ElementType , ReactNode } from 'react' ;
66import { forwardRef } from 'react' ;
77import { FlexBoxAlignItems , FlexBoxDirection , FlexBoxJustifyContent , FlexBoxWrap } from '../../enums/index.js' ;
88import type { CommonProps } from '../../types/index.js' ;
99import { classNames , styleData } from './FlexBox.module.css.js' ;
1010
1111export interface FlexBoxPropTypes extends CommonProps {
1212 /**
13- * Controls the alignment of items on the Cross Axis.<br />
14- * <b>Note:</b> Corresponds to `align-items`.
13+ * Controls the alignment of items on the Cross Axis.
14+ *
15+ * __Note:__ Corresponds to `align-items`.
1516 */
1617 alignItems ?: FlexBoxAlignItems | keyof typeof FlexBoxAlignItems ;
1718 /**
18- * Controls how the items are placed in the `FlexBox`.<br />
19- * <b>Note:</b> Corresponds to `flex-direction`.
19+ * Controls how the items are placed in the `FlexBox`.
20+ *
21+ * __Note:__ Corresponds to `flex-direction`.
2022 */
2123 direction ?: FlexBoxDirection | keyof typeof FlexBoxDirection ;
2224 /**
@@ -30,15 +32,23 @@ export interface FlexBoxPropTypes extends CommonProps {
3032 */
3133 fitContainer ?: boolean ;
3234 /**
33- * Defines how the browser distributes space between and around items along the main-axis.<br />
34- * <b>Note:</b> Corresponds to `justify-content`.
35+ * Defines how the browser distributes space between and around items along the main-axis.
36+ *
37+ * __Note:__ Corresponds to `justify-content`.
3538 */
3639 justifyContent ?: FlexBoxJustifyContent | keyof typeof FlexBoxJustifyContent ;
3740 /**
38- * Determines whether the `FlexBox` should wrap, when there is not enough space to display all items in one line.<br />
39- * <b>Note:</b> Corresponds to `flex-wrap`.
41+ * Determines whether the `FlexBox` should wrap, when there is not enough space to display all items in one line.
42+ *
43+ * __Note:__ Corresponds to `flex-wrap`.
4044 */
4145 wrap ?: FlexBoxWrap | keyof typeof FlexBoxWrap ;
46+ /**
47+ * Define the gap (gutters) between flex items and flex lines.
48+ *
49+ * __Note:__ Corresponds to the `gap` CSS Property.
50+ */
51+ gap ?: CSSProperties [ 'gap' ] ;
4252 /**
4353 * Content of the `FlexBox`.
4454 */
@@ -64,7 +74,9 @@ const FlexBox = forwardRef<HTMLDivElement, FlexBoxPropTypes>((props, ref) => {
6474 wrap = FlexBoxWrap . NoWrap ,
6575 className,
6676 fitContainer,
77+ gap,
6778 as = 'div' ,
79+ style,
6880 ...rest
6981 } = props ;
7082
@@ -82,7 +94,7 @@ const FlexBox = forwardRef<HTMLDivElement, FlexBoxPropTypes>((props, ref) => {
8294
8395 const CustomTag = as as ElementType ;
8496 return (
85- < CustomTag ref = { ref } className = { flexBoxClasses } { ...rest } >
97+ < CustomTag ref = { ref } className = { flexBoxClasses } style = { { gap , ... style } } { ...rest } >
8698 { children }
8799 </ CustomTag >
88100 ) ;
0 commit comments