@salt-ds/core 1.47.0 → 1.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/css/salt-core.css +225 -213
  3. package/dist-cjs/accordion/Accordion.css.js +1 -1
  4. package/dist-cjs/accordion/AccordionGroup.css.js +1 -1
  5. package/dist-cjs/accordion/AccordionHeader.css.js +1 -1
  6. package/dist-cjs/banner/Banner.css.js +1 -1
  7. package/dist-cjs/border-item/BorderItem.js +33 -32
  8. package/dist-cjs/border-item/BorderItem.js.map +1 -1
  9. package/dist-cjs/border-layout/BorderLayout.js +3 -1
  10. package/dist-cjs/border-layout/BorderLayout.js.map +1 -1
  11. package/dist-cjs/button/Button.css.js +1 -1
  12. package/dist-cjs/button/Button.js +2 -1
  13. package/dist-cjs/button/Button.js.map +1 -1
  14. package/dist-cjs/card/Card.css.js +1 -1
  15. package/dist-cjs/checkbox/Checkbox.css.js +1 -1
  16. package/dist-cjs/checkbox/CheckboxIcon.css.js +1 -1
  17. package/dist-cjs/dialog/Dialog.css.js +1 -1
  18. package/dist-cjs/dialog/DialogContent.css.js +1 -1
  19. package/dist-cjs/divider/Divider.css.js +1 -1
  20. package/dist-cjs/dropdown/Dropdown.css.js +1 -1
  21. package/dist-cjs/file-drop-zone/FileDropZone.css.js +1 -1
  22. package/dist-cjs/flex-item/FlexItem.js +46 -48
  23. package/dist-cjs/flex-item/FlexItem.js.map +1 -1
  24. package/dist-cjs/flex-layout/FlexLayout.css.js +1 -1
  25. package/dist-cjs/flex-layout/FlexLayout.js +60 -62
  26. package/dist-cjs/flex-layout/FlexLayout.js.map +1 -1
  27. package/dist-cjs/flow-layout/FlowLayout.js +3 -5
  28. package/dist-cjs/flow-layout/FlowLayout.js.map +1 -1
  29. package/dist-cjs/grid-item/GridItem.js +51 -53
  30. package/dist-cjs/grid-item/GridItem.js.map +1 -1
  31. package/dist-cjs/grid-layout/GridLayout.js +49 -51
  32. package/dist-cjs/grid-layout/GridLayout.js.map +1 -1
  33. package/dist-cjs/input/Input.css.js +1 -1
  34. package/dist-cjs/interactable-card/InteractableCard.css.js +1 -1
  35. package/dist-cjs/link-card/LinkCard.css.js +1 -1
  36. package/dist-cjs/list-box/ListBox.css.js +1 -1
  37. package/dist-cjs/list-box/ListBox.js +5 -0
  38. package/dist-cjs/list-box/ListBox.js.map +1 -1
  39. package/dist-cjs/menu/MenuBase.js +1 -1
  40. package/dist-cjs/menu/MenuBase.js.map +1 -1
  41. package/dist-cjs/menu/MenuGroup.css.js +1 -1
  42. package/dist-cjs/menu/MenuItem.css.js +1 -1
  43. package/dist-cjs/menu/MenuPanel.css.js +1 -1
  44. package/dist-cjs/menu/MenuTrigger.js +32 -29
  45. package/dist-cjs/menu/MenuTrigger.js.map +1 -1
  46. package/dist-cjs/multiline-input/MultilineInput.css.js +1 -1
  47. package/dist-cjs/navigation-item/NavigationItem.css.js +1 -1
  48. package/dist-cjs/option/Option.css.js +1 -1
  49. package/dist-cjs/option/Option.js +1 -0
  50. package/dist-cjs/option/Option.js.map +1 -1
  51. package/dist-cjs/option/OptionGroup.css.js +1 -1
  52. package/dist-cjs/option/OptionList.css.js +1 -1
  53. package/dist-cjs/overlay/OverlayPanel.css.js +1 -1
  54. package/dist-cjs/overlay/OverlayPanelContent.css.js +1 -1
  55. package/dist-cjs/overlay/OverlayPanelContent.js +1 -1
  56. package/dist-cjs/overlay/OverlayPanelContent.js.map +1 -1
  57. package/dist-cjs/overlay/OverlayTrigger.js +17 -11
  58. package/dist-cjs/overlay/OverlayTrigger.js.map +1 -1
  59. package/dist-cjs/pagination/PageButton.css.js +1 -1
  60. package/dist-cjs/pill/Pill.css.js +1 -1
  61. package/dist-cjs/pill-input/PillInput.css.js +1 -1
  62. package/dist-cjs/pill-input/PillInput.js +5 -3
  63. package/dist-cjs/pill-input/PillInput.js.map +1 -1
  64. package/dist-cjs/progress/CircularProgress/CircularProgress.css.js +1 -1
  65. package/dist-cjs/progress/LinearProgress/LinearProgress.css.js +1 -1
  66. package/dist-cjs/radio-button/RadioButton.css.js +1 -1
  67. package/dist-cjs/radio-button/RadioButtonIcon.css.js +1 -1
  68. package/dist-cjs/segmented-button-group/SegmentedButtonGroup.css.js +1 -1
  69. package/dist-cjs/slider/internal/SliderThumb.css.js +1 -1
  70. package/dist-cjs/slider/internal/SliderTooltip.css.js +1 -1
  71. package/dist-cjs/slider/internal/SliderTrack.css.js +1 -1
  72. package/dist-cjs/spinner/Spinner.css.js +1 -1
  73. package/dist-cjs/split-layout/SplitLayout.js +2 -1
  74. package/dist-cjs/split-layout/SplitLayout.js.map +1 -1
  75. package/dist-cjs/stack-layout/StackLayout.css.js +1 -1
  76. package/dist-cjs/stack-layout/StackLayout.js +4 -2
  77. package/dist-cjs/stack-layout/StackLayout.js.map +1 -1
  78. package/dist-cjs/stepper/internal/StepConnector.css.js +1 -1
  79. package/dist-cjs/switch/Switch.css.js +1 -1
  80. package/dist-cjs/tag/Tag.css.js +1 -1
  81. package/dist-cjs/text/Text.js.map +1 -1
  82. package/dist-cjs/theme/Theme.js.map +1 -1
  83. package/dist-cjs/toast/Toast.css.js +1 -1
  84. package/dist-cjs/toggle-button/ToggleButton.css.js +1 -1
  85. package/dist-cjs/toggle-button-group/ToggleButtonGroup.css.js +1 -1
  86. package/dist-cjs/tooltip/Tooltip.css.js +1 -1
  87. package/dist-cjs/tooltip/Tooltip.js.map +1 -1
  88. package/dist-es/accordion/Accordion.css.js +1 -1
  89. package/dist-es/accordion/AccordionGroup.css.js +1 -1
  90. package/dist-es/accordion/AccordionHeader.css.js +1 -1
  91. package/dist-es/banner/Banner.css.js +1 -1
  92. package/dist-es/border-item/BorderItem.js +33 -32
  93. package/dist-es/border-item/BorderItem.js.map +1 -1
  94. package/dist-es/border-layout/BorderLayout.js +3 -1
  95. package/dist-es/border-layout/BorderLayout.js.map +1 -1
  96. package/dist-es/button/Button.css.js +1 -1
  97. package/dist-es/button/Button.js +2 -1
  98. package/dist-es/button/Button.js.map +1 -1
  99. package/dist-es/card/Card.css.js +1 -1
  100. package/dist-es/checkbox/Checkbox.css.js +1 -1
  101. package/dist-es/checkbox/CheckboxIcon.css.js +1 -1
  102. package/dist-es/dialog/Dialog.css.js +1 -1
  103. package/dist-es/dialog/DialogContent.css.js +1 -1
  104. package/dist-es/divider/Divider.css.js +1 -1
  105. package/dist-es/dropdown/Dropdown.css.js +1 -1
  106. package/dist-es/file-drop-zone/FileDropZone.css.js +1 -1
  107. package/dist-es/flex-item/FlexItem.js +46 -48
  108. package/dist-es/flex-item/FlexItem.js.map +1 -1
  109. package/dist-es/flex-layout/FlexLayout.css.js +1 -1
  110. package/dist-es/flex-layout/FlexLayout.js +60 -62
  111. package/dist-es/flex-layout/FlexLayout.js.map +1 -1
  112. package/dist-es/flow-layout/FlowLayout.js +3 -5
  113. package/dist-es/flow-layout/FlowLayout.js.map +1 -1
  114. package/dist-es/grid-item/GridItem.js +51 -53
  115. package/dist-es/grid-item/GridItem.js.map +1 -1
  116. package/dist-es/grid-layout/GridLayout.js +49 -51
  117. package/dist-es/grid-layout/GridLayout.js.map +1 -1
  118. package/dist-es/input/Input.css.js +1 -1
  119. package/dist-es/interactable-card/InteractableCard.css.js +1 -1
  120. package/dist-es/link-card/LinkCard.css.js +1 -1
  121. package/dist-es/list-box/ListBox.css.js +1 -1
  122. package/dist-es/list-box/ListBox.js +5 -0
  123. package/dist-es/list-box/ListBox.js.map +1 -1
  124. package/dist-es/menu/MenuBase.js +1 -1
  125. package/dist-es/menu/MenuBase.js.map +1 -1
  126. package/dist-es/menu/MenuGroup.css.js +1 -1
  127. package/dist-es/menu/MenuItem.css.js +1 -1
  128. package/dist-es/menu/MenuPanel.css.js +1 -1
  129. package/dist-es/menu/MenuTrigger.js +33 -30
  130. package/dist-es/menu/MenuTrigger.js.map +1 -1
  131. package/dist-es/multiline-input/MultilineInput.css.js +1 -1
  132. package/dist-es/navigation-item/NavigationItem.css.js +1 -1
  133. package/dist-es/option/Option.css.js +1 -1
  134. package/dist-es/option/Option.js +1 -0
  135. package/dist-es/option/Option.js.map +1 -1
  136. package/dist-es/option/OptionGroup.css.js +1 -1
  137. package/dist-es/option/OptionList.css.js +1 -1
  138. package/dist-es/overlay/OverlayPanel.css.js +1 -1
  139. package/dist-es/overlay/OverlayPanelContent.css.js +1 -1
  140. package/dist-es/overlay/OverlayPanelContent.js +1 -1
  141. package/dist-es/overlay/OverlayPanelContent.js.map +1 -1
  142. package/dist-es/overlay/OverlayTrigger.js +18 -12
  143. package/dist-es/overlay/OverlayTrigger.js.map +1 -1
  144. package/dist-es/pagination/PageButton.css.js +1 -1
  145. package/dist-es/pill/Pill.css.js +1 -1
  146. package/dist-es/pill-input/PillInput.css.js +1 -1
  147. package/dist-es/pill-input/PillInput.js +5 -3
  148. package/dist-es/pill-input/PillInput.js.map +1 -1
  149. package/dist-es/progress/CircularProgress/CircularProgress.css.js +1 -1
  150. package/dist-es/progress/LinearProgress/LinearProgress.css.js +1 -1
  151. package/dist-es/radio-button/RadioButton.css.js +1 -1
  152. package/dist-es/radio-button/RadioButtonIcon.css.js +1 -1
  153. package/dist-es/segmented-button-group/SegmentedButtonGroup.css.js +1 -1
  154. package/dist-es/slider/internal/SliderThumb.css.js +1 -1
  155. package/dist-es/slider/internal/SliderTooltip.css.js +1 -1
  156. package/dist-es/slider/internal/SliderTrack.css.js +1 -1
  157. package/dist-es/spinner/Spinner.css.js +1 -1
  158. package/dist-es/split-layout/SplitLayout.js +2 -1
  159. package/dist-es/split-layout/SplitLayout.js.map +1 -1
  160. package/dist-es/stack-layout/StackLayout.css.js +1 -1
  161. package/dist-es/stack-layout/StackLayout.js +4 -2
  162. package/dist-es/stack-layout/StackLayout.js.map +1 -1
  163. package/dist-es/stepper/internal/StepConnector.css.js +1 -1
  164. package/dist-es/switch/Switch.css.js +1 -1
  165. package/dist-es/tag/Tag.css.js +1 -1
  166. package/dist-es/text/Text.js.map +1 -1
  167. package/dist-es/theme/Theme.js.map +1 -1
  168. package/dist-es/toast/Toast.css.js +1 -1
  169. package/dist-es/toggle-button/ToggleButton.css.js +1 -1
  170. package/dist-es/toggle-button-group/ToggleButtonGroup.css.js +1 -1
  171. package/dist-es/tooltip/Tooltip.css.js +1 -1
  172. package/dist-es/tooltip/Tooltip.js.map +1 -1
  173. package/dist-types/aria-announcer/AriaAnnouncerContext.d.ts +2 -2
  174. package/dist-types/aria-announcer/useAriaAnnouncer.d.ts +2 -2
  175. package/dist-types/avatar/Avatar.d.ts +1 -1
  176. package/dist-types/border-item/BorderItem.d.ts +4 -4
  177. package/dist-types/border-layout/BorderLayout.d.ts +3 -3
  178. package/dist-types/breakpoints/BreakpointProvider.d.ts +1 -1
  179. package/dist-types/button/Button.d.ts +3 -3
  180. package/dist-types/combo-box/ComboBox.d.ts +3 -12
  181. package/dist-types/combo-box/useComboBox.d.ts +3 -3
  182. package/dist-types/dialog/DialogContext.d.ts +3 -2
  183. package/dist-types/dropdown/Dropdown.d.ts +3 -52
  184. package/dist-types/flex-item/FlexItem.d.ts +4 -4
  185. package/dist-types/flex-layout/FlexLayout.d.ts +7 -7
  186. package/dist-types/flow-layout/FlowLayout.d.ts +3 -3
  187. package/dist-types/form-field/FormField.d.ts +1 -1
  188. package/dist-types/form-field-context/FormFieldContext.d.ts +1 -1
  189. package/dist-types/grid-item/GridItem.d.ts +5 -5
  190. package/dist-types/grid-layout/GridLayout.d.ts +3 -3
  191. package/dist-types/interactable-card/InteractableCardGroupContext.d.ts +1 -1
  192. package/dist-types/list-box/ListBox.d.ts +3 -20
  193. package/dist-types/list-control/ListControlContext.d.ts +1 -1
  194. package/dist-types/list-control/ListControlState.d.ts +5 -5
  195. package/dist-types/menu/MenuContext.d.ts +1 -1
  196. package/dist-types/menu/MenuTrigger.d.ts +1 -1
  197. package/dist-types/overlay/OverlayContext.d.ts +1 -1
  198. package/dist-types/overlay/OverlayTrigger.d.ts +1 -1
  199. package/dist-types/pagination/usePagination.d.ts +1 -1
  200. package/dist-types/salt-provider/SaltProvider.d.ts +4 -4
  201. package/dist-types/semantic-icon-provider/SemanticIconProvider.d.ts +1 -1
  202. package/dist-types/slider/internal/useRangeSliderThumb.d.ts +1 -1
  203. package/dist-types/slider/internal/useSliderThumb.d.ts +1 -1
  204. package/dist-types/slider/internal/utils.d.ts +5 -5
  205. package/dist-types/spinner/Spinner.d.ts +2 -2
  206. package/dist-types/split-layout/SplitLayout.d.ts +3 -3
  207. package/dist-types/stack-layout/StackLayout.d.ts +3 -3
  208. package/dist-types/status-adornment/ErrorAdornment.d.ts +1 -1
  209. package/dist-types/status-adornment/StatusAdornment.d.ts +1 -1
  210. package/dist-types/status-adornment/SuccessAdornment.d.ts +1 -1
  211. package/dist-types/status-adornment/WarningAdornment.d.ts +1 -1
  212. package/dist-types/status-indicator/ValidationStatus.d.ts +1 -1
  213. package/dist-types/stepper/Step.d.ts +4 -4
  214. package/dist-types/stepper/Stepper.d.ts +1 -1
  215. package/dist-types/text/Text.d.ts +3 -3
  216. package/dist-types/theme/Accent.d.ts +2 -2
  217. package/dist-types/theme/ActionFont.d.ts +2 -2
  218. package/dist-types/theme/Corner.d.ts +2 -2
  219. package/dist-types/theme/Density.d.ts +1 -1
  220. package/dist-types/theme/HeadingFont.d.ts +2 -2
  221. package/dist-types/theme/Mode.d.ts +1 -1
  222. package/dist-types/theme/Theme.d.ts +3 -3
  223. package/dist-types/toggle-button-group/ToggleButtonGroupContext.d.ts +1 -1
  224. package/dist-types/tooltip/useAriaAnnounce.d.ts +1 -1
  225. package/dist-types/tooltip/useTooltip.d.ts +3 -3
  226. package/dist-types/types.d.ts +1 -1
  227. package/dist-types/utils/createChainedFunction.d.ts +1 -1
  228. package/dist-types/utils/inferElementType.d.ts +1 -1
  229. package/dist-types/utils/makePrefixer.d.ts +1 -1
  230. package/dist-types/utils/polymorphicTypes.d.ts +5 -5
  231. package/dist-types/utils/useFloatingUI/useFloatingUI.d.ts +3 -13
  232. package/dist-types/utils/useResponsiveProp.d.ts +2 -2
  233. package/dist-types/utils/useValueEffect.d.ts +1 -1
  234. package/dist-types/viewport/ViewportProvider.d.ts +1 -1
  235. package/package.json +1 -1
@@ -18,54 +18,52 @@ const FLEX_ITEM_ALIGNMENTS = [
18
18
  "center",
19
19
  "stretch"
20
20
  ];
21
- const FlexItem = forwardRef(
22
- ({
23
- as,
24
- align,
25
- children,
26
- className,
27
- margin = 0,
28
- padding = 0,
29
- shrink,
30
- grow,
31
- basis,
32
- style,
33
- ...rest
34
- }, ref) => {
35
- const targetWindow = useWindow();
36
- useComponentCssInjection({
37
- testId: "salt-flex-item",
38
- css: css_248z,
39
- window: targetWindow
40
- });
41
- const { matchedBreakpoints } = useBreakpoint();
42
- const Component = as || "div";
43
- const flexItemShrink = resolveResponsiveValue(shrink, matchedBreakpoints);
44
- const flexItemGrow = resolveResponsiveValue(grow, matchedBreakpoints);
45
- const flexItemBasis = resolveResponsiveValue(basis, matchedBreakpoints);
46
- const flexItemMargin = resolveResponsiveValue(margin, matchedBreakpoints);
47
- const flexItemPadding = resolveResponsiveValue(padding, matchedBreakpoints);
48
- const itemStyle = {
49
- "--flexItem-margin": parseSpacing(flexItemMargin),
50
- "--flexItem-padding": parseSpacing(flexItemPadding),
51
- "--saltFlexItem-alignment": align,
52
- "--saltFlexItem-shrink": flexItemShrink,
53
- "--saltFlexItem-grow": flexItemGrow,
54
- "--saltFlexItem-basis": flexItemBasis,
55
- ...style
56
- };
57
- return /* @__PURE__ */ jsx(
58
- Component,
59
- {
60
- className: clsx(withBaseName(), className),
61
- ref,
62
- style: itemStyle,
63
- ...rest,
64
- children
65
- }
66
- );
67
- }
68
- );
21
+ const FlexItem = forwardRef(function FlexItem2({
22
+ as,
23
+ align,
24
+ children,
25
+ className,
26
+ margin = 0,
27
+ padding = 0,
28
+ shrink,
29
+ grow,
30
+ basis,
31
+ style,
32
+ ...rest
33
+ }, ref) {
34
+ const targetWindow = useWindow();
35
+ useComponentCssInjection({
36
+ testId: "salt-flex-item",
37
+ css: css_248z,
38
+ window: targetWindow
39
+ });
40
+ const { matchedBreakpoints } = useBreakpoint();
41
+ const Component = as || "div";
42
+ const flexItemShrink = resolveResponsiveValue(shrink, matchedBreakpoints);
43
+ const flexItemGrow = resolveResponsiveValue(grow, matchedBreakpoints);
44
+ const flexItemBasis = resolveResponsiveValue(basis, matchedBreakpoints);
45
+ const flexItemMargin = resolveResponsiveValue(margin, matchedBreakpoints);
46
+ const flexItemPadding = resolveResponsiveValue(padding, matchedBreakpoints);
47
+ const itemStyle = {
48
+ "--flexItem-margin": parseSpacing(flexItemMargin),
49
+ "--flexItem-padding": parseSpacing(flexItemPadding),
50
+ "--saltFlexItem-alignment": align,
51
+ "--saltFlexItem-shrink": flexItemShrink,
52
+ "--saltFlexItem-grow": flexItemGrow,
53
+ "--saltFlexItem-basis": flexItemBasis,
54
+ ...style
55
+ };
56
+ return /* @__PURE__ */ jsx(
57
+ Component,
58
+ {
59
+ className: clsx(withBaseName(), className),
60
+ ref,
61
+ style: itemStyle,
62
+ ...rest,
63
+ children
64
+ }
65
+ );
66
+ });
69
67
 
70
68
  export { FLEX_ITEM_ALIGNMENTS, FlexItem };
71
69
  //# sourceMappingURL=FlexItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlexItem.js","sources":["../src/flex-item/FlexItem.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport {\n type CSSProperties,\n type ElementType,\n type ReactElement,\n forwardRef,\n} from \"react\";\nimport { useBreakpoint } from \"../breakpoints\";\nimport { parseSpacing } from \"../flex-layout/parseSpacing\";\nimport {\n type PolymorphicComponentPropWithRef,\n type PolymorphicRef,\n type ResponsiveProp,\n makePrefixer,\n resolveResponsiveValue,\n} from \"../utils\";\nimport flexItemCss from \"./FlexItem.css\";\n\nconst withBaseName = makePrefixer(\"saltFlexItem\");\nexport const FLEX_ITEM_ALIGNMENTS = [\n \"start\",\n \"end\",\n \"center\",\n \"stretch\",\n] as const;\n\nexport type flexItemAlignment = (typeof FLEX_ITEM_ALIGNMENTS)[number];\n\nexport type FlexItemProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Allows the alignment specified by parent to be overridden for individual items, default is \"start\".\n */\n align?: flexItemAlignment;\n /**\n * Defines the ability for an item to shrink x times more compared to its siblings, default is 1.\n */\n shrink?: ResponsiveProp<number>;\n /**\n * Defines the ability for an item to grow x times more compared to its siblings, default is 0.\n */\n grow?: ResponsiveProp<number>;\n /**\n * Sets the initial main size of a flex item, default is \"auto\".\n */\n basis?: ResponsiveProp<CSSProperties[\"flexBasis\"]>;\n /**\n * Defines the margin around the component. It can be specified as a number (which acts as a multiplier) or a string representing the margin value. Default is `0`.\n */\n margin?: ResponsiveProp<number | string>;\n /**\n * Defines the padding within the component. It can be specified as a number (which acts as a multiplier) or a string representing the padding value. Default is `0`.\n */\n padding?: ResponsiveProp<number | string>;\n }\n >;\n\ntype FlexItemComponent = <T extends ElementType = \"div\">(\n props: FlexItemProps<T>,\n) => ReactElement | null;\n\nexport const FlexItem: FlexItemComponent = forwardRef(\n <T extends ElementType = \"div\">(\n {\n as,\n align,\n children,\n className,\n margin = 0,\n padding = 0,\n shrink,\n grow,\n basis,\n style,\n ...rest\n }: FlexItemProps<T>,\n ref?: PolymorphicRef<T>,\n ) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-flex-item\",\n css: flexItemCss,\n window: targetWindow,\n });\n const { matchedBreakpoints } = useBreakpoint();\n\n const Component = as || \"div\";\n const flexItemShrink = resolveResponsiveValue(shrink, matchedBreakpoints);\n const flexItemGrow = resolveResponsiveValue(grow, matchedBreakpoints);\n const flexItemBasis = resolveResponsiveValue(basis, matchedBreakpoints);\n const flexItemMargin = resolveResponsiveValue(margin, matchedBreakpoints);\n const flexItemPadding = resolveResponsiveValue(padding, matchedBreakpoints);\n\n const itemStyle = {\n \"--flexItem-margin\": parseSpacing(flexItemMargin),\n \"--flexItem-padding\": parseSpacing(flexItemPadding),\n \"--saltFlexItem-alignment\": align,\n \"--saltFlexItem-shrink\": flexItemShrink,\n \"--saltFlexItem-grow\": flexItemGrow,\n \"--saltFlexItem-basis\": flexItemBasis,\n ...style,\n };\n return (\n <Component\n className={clsx(withBaseName(), className)}\n ref={ref}\n style={itemStyle}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":["flexItemCss"],"mappings":";;;;;;;;;;;;;AAoBA,MAAM,YAAA,GAAe,aAAa,cAAc,CAAA;AACzC,MAAM,oBAAuB,GAAA;AAAA,EAClC,OAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AAuCO,MAAM,QAA8B,GAAA,UAAA;AAAA,EACzC,CACE;AAAA,IACE,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAS,GAAA,CAAA;AAAA,IACT,OAAU,GAAA,CAAA;AAAA,IACV,MAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA;AAAA,IACA,GAAG;AAAA,KAEL,GACG,KAAA;AACH,IAAA,MAAM,eAAe,SAAU,EAAA;AAC/B,IAAyB,wBAAA,CAAA;AAAA,MACvB,MAAQ,EAAA,gBAAA;AAAA,MACR,GAAK,EAAAA,QAAA;AAAA,MACL,MAAQ,EAAA;AAAA,KACT,CAAA;AACD,IAAM,MAAA,EAAE,kBAAmB,EAAA,GAAI,aAAc,EAAA;AAE7C,IAAA,MAAM,YAAY,EAAM,IAAA,KAAA;AACxB,IAAM,MAAA,cAAA,GAAiB,sBAAuB,CAAA,MAAA,EAAQ,kBAAkB,CAAA;AACxE,IAAM,MAAA,YAAA,GAAe,sBAAuB,CAAA,IAAA,EAAM,kBAAkB,CAAA;AACpE,IAAM,MAAA,aAAA,GAAgB,sBAAuB,CAAA,KAAA,EAAO,kBAAkB,CAAA;AACtE,IAAM,MAAA,cAAA,GAAiB,sBAAuB,CAAA,MAAA,EAAQ,kBAAkB,CAAA;AACxE,IAAM,MAAA,eAAA,GAAkB,sBAAuB,CAAA,OAAA,EAAS,kBAAkB,CAAA;AAE1E,IAAA,MAAM,SAAY,GAAA;AAAA,MAChB,mBAAA,EAAqB,aAAa,cAAc,CAAA;AAAA,MAChD,oBAAA,EAAsB,aAAa,eAAe,CAAA;AAAA,MAClD,0BAA4B,EAAA,KAAA;AAAA,MAC5B,uBAAyB,EAAA,cAAA;AAAA,MACzB,qBAAuB,EAAA,YAAA;AAAA,MACvB,sBAAwB,EAAA,aAAA;AAAA,MACxB,GAAG;AAAA,KACL;AACA,IACE,uBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,SAAW,EAAA,IAAA,CAAK,YAAa,EAAA,EAAG,SAAS,CAAA;AAAA,QACzC,GAAA;AAAA,QACA,KAAO,EAAA,SAAA;AAAA,QACN,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA;AAGN;;;;"}
1
+ {"version":3,"file":"FlexItem.js","sources":["../src/flex-item/FlexItem.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport {\n type CSSProperties,\n type ElementType,\n type ForwardedRef,\n type FunctionComponent,\n forwardRef,\n} from \"react\";\nimport { useBreakpoint } from \"../breakpoints\";\nimport { parseSpacing } from \"../flex-layout/parseSpacing\";\nimport {\n type PolymorphicComponentPropWithRef,\n type PolymorphicRef,\n type ResponsiveProp,\n makePrefixer,\n resolveResponsiveValue,\n} from \"../utils\";\nimport flexItemCss from \"./FlexItem.css\";\n\nconst withBaseName = makePrefixer(\"saltFlexItem\");\nexport const FLEX_ITEM_ALIGNMENTS = [\n \"start\",\n \"end\",\n \"center\",\n \"stretch\",\n] as const;\n\nexport type flexItemAlignment = (typeof FLEX_ITEM_ALIGNMENTS)[number];\n\nexport type FlexItemProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Allows the alignment specified by parent to be overridden for individual items, default is \"start\".\n */\n align?: flexItemAlignment;\n /**\n * Defines the ability for an item to shrink x times more compared to its siblings, default is 1.\n */\n shrink?: ResponsiveProp<number>;\n /**\n * Defines the ability for an item to grow x times more compared to its siblings, default is 0.\n */\n grow?: ResponsiveProp<number>;\n /**\n * Sets the initial main size of a flex item, default is \"auto\".\n */\n basis?: ResponsiveProp<CSSProperties[\"flexBasis\"]>;\n /**\n * Defines the margin around the component. It can be specified as a number (which acts as a multiplier) or a string representing the margin value. Default is `0`.\n */\n margin?: ResponsiveProp<number | string>;\n /**\n * Defines the padding within the component. It can be specified as a number (which acts as a multiplier) or a string representing the padding value. Default is `0`.\n */\n padding?: ResponsiveProp<number | string>;\n }\n >;\n\ntype FlexItemComponent = <T extends ElementType = \"div\">(\n props: FlexItemProps<T>,\n) => ReturnType<FunctionComponent>;\n\nexport const FlexItem: FlexItemComponent = forwardRef(function FlexItem<\n T extends ElementType = \"div\",\n>(\n {\n as,\n align,\n children,\n className,\n margin = 0,\n padding = 0,\n shrink,\n grow,\n basis,\n style,\n ...rest\n }: FlexItemProps<T>,\n ref?: ForwardedRef<unknown>,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-flex-item\",\n css: flexItemCss,\n window: targetWindow,\n });\n const { matchedBreakpoints } = useBreakpoint();\n\n const Component = as || \"div\";\n const flexItemShrink = resolveResponsiveValue(shrink, matchedBreakpoints);\n const flexItemGrow = resolveResponsiveValue(grow, matchedBreakpoints);\n const flexItemBasis = resolveResponsiveValue(basis, matchedBreakpoints);\n const flexItemMargin = resolveResponsiveValue(margin, matchedBreakpoints);\n const flexItemPadding = resolveResponsiveValue(padding, matchedBreakpoints);\n\n const itemStyle = {\n \"--flexItem-margin\": parseSpacing(flexItemMargin),\n \"--flexItem-padding\": parseSpacing(flexItemPadding),\n \"--saltFlexItem-alignment\": align,\n \"--saltFlexItem-shrink\": flexItemShrink,\n \"--saltFlexItem-grow\": flexItemGrow,\n \"--saltFlexItem-basis\": flexItemBasis,\n ...style,\n };\n return (\n <Component\n className={clsx(withBaseName(), className)}\n ref={ref as PolymorphicRef<T>}\n style={itemStyle}\n {...rest}\n >\n {children}\n </Component>\n );\n});\n"],"names":["FlexItem","flexItemCss"],"mappings":";;;;;;;;;;;;;AAqBA,MAAM,YAAA,GAAe,aAAa,cAAc,CAAA;AACzC,MAAM,oBAAuB,GAAA;AAAA,EAClC,OAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AAuCa,MAAA,QAAA,GAA8B,UAAW,CAAA,SAASA,SAG7D,CAAA;AAAA,EACE,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAS,GAAA,CAAA;AAAA,EACT,OAAU,GAAA,CAAA;AAAA,EACV,MAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAG;AACL,CAAA,EACA,GACA,EAAA;AACA,EAAA,MAAM,eAAe,SAAU,EAAA;AAC/B,EAAyB,wBAAA,CAAA;AAAA,IACvB,MAAQ,EAAA,gBAAA;AAAA,IACR,GAAK,EAAAC,QAAA;AAAA,IACL,MAAQ,EAAA;AAAA,GACT,CAAA;AACD,EAAM,MAAA,EAAE,kBAAmB,EAAA,GAAI,aAAc,EAAA;AAE7C,EAAA,MAAM,YAAY,EAAM,IAAA,KAAA;AACxB,EAAM,MAAA,cAAA,GAAiB,sBAAuB,CAAA,MAAA,EAAQ,kBAAkB,CAAA;AACxE,EAAM,MAAA,YAAA,GAAe,sBAAuB,CAAA,IAAA,EAAM,kBAAkB,CAAA;AACpE,EAAM,MAAA,aAAA,GAAgB,sBAAuB,CAAA,KAAA,EAAO,kBAAkB,CAAA;AACtE,EAAM,MAAA,cAAA,GAAiB,sBAAuB,CAAA,MAAA,EAAQ,kBAAkB,CAAA;AACxE,EAAM,MAAA,eAAA,GAAkB,sBAAuB,CAAA,OAAA,EAAS,kBAAkB,CAAA;AAE1E,EAAA,MAAM,SAAY,GAAA;AAAA,IAChB,mBAAA,EAAqB,aAAa,cAAc,CAAA;AAAA,IAChD,oBAAA,EAAsB,aAAa,eAAe,CAAA;AAAA,IAClD,0BAA4B,EAAA,KAAA;AAAA,IAC5B,uBAAyB,EAAA,cAAA;AAAA,IACzB,qBAAuB,EAAA,YAAA;AAAA,IACvB,sBAAwB,EAAA,aAAA;AAAA,IACxB,GAAG;AAAA,GACL;AACA,EACE,uBAAA,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,IAAA,CAAK,YAAa,EAAA,EAAG,SAAS,CAAA;AAAA,MACzC,GAAA;AAAA,MACA,KAAO,EAAA,SAAA;AAAA,MACN,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- var css_248z = "/* Default variables applied to the root element */\n.saltFlexLayout {\n --flexLayout-layout-display: flex;\n --flexLayout-direction: row;\n --flexLayout-wrap: nowrap;\n --flexLayout-justify: flex-start;\n --flexLayout-align: stretch;\n --flexLayout-separator: var(--salt-size-border);\n}\n\n/* Style applied to the root element */\n.saltFlexLayout {\n gap: var(--flexLayout-gap);\n margin: var(--flexLayout-margin);\n padding: var(--flexLayout-padding);\n display: var(--flexLayout-layout-display);\n flex-direction: var(--flexLayout-direction);\n flex-wrap: var(--flexLayout-wrap);\n justify-content: var(--flexLayout-justify);\n align-items: var(--flexLayout-align);\n box-sizing: border-box;\n}\n\n.saltFlexLayout-separator {\n gap: calc(var(--flexLayout-gap) * 2);\n}\n\n.saltFlexLayout-separator > * {\n position: relative;\n}\n.saltFlexLayout-separator > *:not(:last-child)::after {\n position: absolute;\n display: block;\n content: \"\";\n background-color: var(--salt-separable-secondary-borderColor);\n}\n\n/* Row separator */\n\n.saltFlexLayout-separator-row > *:not(:last-child)::after {\n height: 100%;\n}\n\n.saltFlexLayout-separator-row > *:not(:last-child)::after {\n width: var(--flexLayout-separator);\n top: 0;\n}\n.saltFlexLayout-separator-row-start > *:not(:last-child)::after {\n right: 0;\n}\n.saltFlexLayout-separator-row-center > *:not(:last-child)::after {\n right: calc(var(--flexLayout-gap) * -1);\n}\n.saltFlexLayout-separator-row-end > *:not(:last-child)::after {\n right: calc(var(--flexLayout-gap) * -2);\n}\n\n/* Column separator */\n.saltFlexLayout-separator-column > *:not(:last-child)::after {\n width: 100%;\n}\n\n.saltFlexLayout-separator-column > *:not(:last-child)::after {\n height: var(--flexLayout-separator);\n left: 0;\n width: 100%;\n}\n.saltFlexLayout-separator-column-start > *:not(:last-child)::after {\n bottom: 0;\n}\n.saltFlexLayout-separator-column-center > *:not(:last-child)::after {\n bottom: calc(var(--flexLayout-gap) * -1);\n}\n.saltFlexLayout-separator-column-end > *:not(:last-child)::after {\n bottom: calc(var(--flexLayout-gap) * -2);\n}\n";
1
+ var css_248z = "/* Default variables applied to the root element */\n.saltFlexLayout {\n --flexLayout-layout-display: flex;\n --flexLayout-direction: row;\n --flexLayout-wrap: nowrap;\n --flexLayout-justify: flex-start;\n --flexLayout-align: stretch;\n --flexLayout-separator: var(--salt-size-fixed-100);\n}\n\n/* Style applied to the root element */\n.saltFlexLayout {\n gap: var(--flexLayout-gap);\n margin: var(--flexLayout-margin);\n padding: var(--flexLayout-padding);\n display: var(--flexLayout-layout-display);\n flex-direction: var(--flexLayout-direction);\n flex-wrap: var(--flexLayout-wrap);\n justify-content: var(--flexLayout-justify);\n align-items: var(--flexLayout-align);\n box-sizing: border-box;\n}\n\n.saltFlexLayout-separator {\n gap: calc(var(--flexLayout-gap) * 2);\n}\n\n.saltFlexLayout-separator > * {\n position: relative;\n}\n.saltFlexLayout-separator > *:not(:last-child)::after {\n position: absolute;\n display: block;\n content: \"\";\n background-color: var(--salt-separable-secondary-borderColor);\n}\n\n/* Row separator */\n\n.saltFlexLayout-separator-row > *:not(:last-child)::after {\n height: 100%;\n}\n\n.saltFlexLayout-separator-row > *:not(:last-child)::after {\n width: var(--flexLayout-separator);\n top: 0;\n}\n.saltFlexLayout-separator-row-start > *:not(:last-child)::after {\n right: 0;\n}\n.saltFlexLayout-separator-row-center > *:not(:last-child)::after {\n right: calc(var(--flexLayout-gap) * -1);\n}\n.saltFlexLayout-separator-row-end > *:not(:last-child)::after {\n right: calc(var(--flexLayout-gap) * -2);\n}\n\n/* Column separator */\n.saltFlexLayout-separator-column > *:not(:last-child)::after {\n width: 100%;\n}\n\n.saltFlexLayout-separator-column > *:not(:last-child)::after {\n height: var(--flexLayout-separator);\n left: 0;\n width: 100%;\n}\n.saltFlexLayout-separator-column-start > *:not(:last-child)::after {\n bottom: 0;\n}\n.saltFlexLayout-separator-column-center > *:not(:last-child)::after {\n bottom: calc(var(--flexLayout-gap) * -1);\n}\n.saltFlexLayout-separator-column-end > *:not(:last-child)::after {\n bottom: calc(var(--flexLayout-gap) * -2);\n}\n";
2
2
 
3
3
  export { css_248z as default };
4
4
  //# sourceMappingURL=FlexLayout.css.js.map
@@ -22,68 +22,66 @@ const FLEX_CONTENT_ALIGNMENT_BASE = [
22
22
  function parseAlignment(style) {
23
23
  return style === "start" || style === "end" ? `flex-${style}` : style;
24
24
  }
25
- const FlexLayout = forwardRef(
26
- ({
27
- as,
28
- align,
29
- children,
30
- className,
31
- direction = "row",
32
- gap = 3,
33
- margin = 0,
34
- padding = 0,
35
- justify,
36
- separators,
37
- style,
38
- wrap = false,
39
- ...rest
40
- }, ref) => {
41
- const targetWindow = useWindow();
42
- useComponentCssInjection({
43
- testId: "salt-flex-layout",
44
- css: css_248z,
45
- window: targetWindow
46
- });
47
- const Component = as || "div";
48
- const separatorAlignment = separators === true ? "center" : separators;
49
- const { matchedBreakpoints } = useBreakpoint();
50
- const flexGap = resolveResponsiveValue(gap, matchedBreakpoints);
51
- const flexMargin = resolveResponsiveValue(margin, matchedBreakpoints);
52
- const flexPadding = resolveResponsiveValue(padding, matchedBreakpoints);
53
- const flexDirection = resolveResponsiveValue(direction, matchedBreakpoints);
54
- const flexWrap = resolveResponsiveValue(wrap, matchedBreakpoints);
55
- const flexLayoutStyles = {
56
- ...style,
57
- "--flexLayout-align": parseAlignment(align),
58
- "--flexLayout-direction": flexDirection,
59
- "--flexLayout-gap": parseSpacing(flexGap),
60
- "--flexLayout-margin": parseSpacing(flexMargin),
61
- "--flexLayout-padding": parseSpacing(flexPadding),
62
- "--flexLayout-justify": parseAlignment(justify),
63
- "--flexLayout-wrap": flexWrap ? "wrap" : "nowrap"
64
- };
65
- return /* @__PURE__ */ jsx(
66
- Component,
67
- {
68
- className: clsx(
69
- withBaseName(),
70
- {
71
- [withBaseName("separator")]: separatorAlignment && !wrap,
72
- [withBaseName(
73
- `separator-${flexDirection ?? "row"}-${separatorAlignment ?? "center"}`
74
- )]: separatorAlignment && !wrap,
75
- [withBaseName(`separator-${flexDirection ?? "row"}`)]: separatorAlignment && !wrap
76
- },
77
- className
78
- ),
79
- ref,
80
- style: flexLayoutStyles,
81
- ...rest,
82
- children
83
- }
84
- );
85
- }
86
- );
25
+ const FlexLayout = forwardRef(function FlexLayout2({
26
+ as,
27
+ align,
28
+ children,
29
+ className,
30
+ direction = "row",
31
+ gap = 3,
32
+ margin = 0,
33
+ padding = 0,
34
+ justify,
35
+ separators,
36
+ style,
37
+ wrap = false,
38
+ ...rest
39
+ }, ref) {
40
+ const targetWindow = useWindow();
41
+ useComponentCssInjection({
42
+ testId: "salt-flex-layout",
43
+ css: css_248z,
44
+ window: targetWindow
45
+ });
46
+ const Component = as || "div";
47
+ const separatorAlignment = separators === true ? "center" : separators;
48
+ const { matchedBreakpoints } = useBreakpoint();
49
+ const flexGap = resolveResponsiveValue(gap, matchedBreakpoints);
50
+ const flexMargin = resolveResponsiveValue(margin, matchedBreakpoints);
51
+ const flexPadding = resolveResponsiveValue(padding, matchedBreakpoints);
52
+ const flexDirection = resolveResponsiveValue(direction, matchedBreakpoints);
53
+ const flexWrap = resolveResponsiveValue(wrap, matchedBreakpoints);
54
+ const flexLayoutStyles = {
55
+ ...style,
56
+ "--flexLayout-align": parseAlignment(align),
57
+ "--flexLayout-direction": flexDirection,
58
+ "--flexLayout-gap": parseSpacing(flexGap),
59
+ "--flexLayout-margin": parseSpacing(flexMargin),
60
+ "--flexLayout-padding": parseSpacing(flexPadding),
61
+ "--flexLayout-justify": parseAlignment(justify),
62
+ "--flexLayout-wrap": flexWrap ? "wrap" : "nowrap"
63
+ };
64
+ return /* @__PURE__ */ jsx(
65
+ Component,
66
+ {
67
+ className: clsx(
68
+ withBaseName(),
69
+ {
70
+ [withBaseName("separator")]: separatorAlignment && !wrap,
71
+ [withBaseName(
72
+ `separator-${flexDirection ?? "row"}-${separatorAlignment ?? "center"}`
73
+ )]: separatorAlignment && !wrap,
74
+ [withBaseName(`separator-${flexDirection ?? "row"}`)]: separatorAlignment && !wrap
75
+ },
76
+ className
77
+ ),
78
+ ref,
79
+ style: flexLayoutStyles,
80
+ ...rest,
81
+ children
82
+ }
83
+ );
84
+ });
87
85
 
88
86
  export { FLEX_ALIGNMENT_BASE, FLEX_CONTENT_ALIGNMENT_BASE, FlexLayout };
89
87
  //# sourceMappingURL=FlexLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlexLayout.js","sources":["../src/flex-layout/FlexLayout.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ElementType, type ReactElement, forwardRef } from \"react\";\nimport { useBreakpoint } from \"../breakpoints\";\nimport {\n type PolymorphicComponentPropWithRef,\n type PolymorphicRef,\n type ResponsiveProp,\n makePrefixer,\n resolveResponsiveValue,\n} from \"../utils\";\nimport flexLayoutCss from \"./FlexLayout.css\";\nimport { parseSpacing } from \"./parseSpacing\";\n\nconst withBaseName = makePrefixer(\"saltFlexLayout\");\n\nexport type LayoutSeparator = \"start\" | \"center\" | \"end\";\nexport type LayoutDirection = \"row\" | \"column\";\n\nexport const FLEX_ALIGNMENT_BASE = [\"start\", \"end\", \"center\"] as const;\nexport const FLEX_CONTENT_ALIGNMENT_BASE = [\n ...FLEX_ALIGNMENT_BASE,\n \"space-between\",\n \"space-around\",\n \"space-evenly\",\n] as const;\n\nexport type FlexAlignment = (typeof FLEX_ALIGNMENT_BASE)[number];\nexport type FlexContentAlignment = (typeof FLEX_CONTENT_ALIGNMENT_BASE)[number];\n\nexport type FlexLayoutProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Defines the default behavior for how flex items are laid out along the cross axis on the current line, default is \"stretch\".\n */\n align?: FlexAlignment | \"stretch\" | \"baseline\";\n /**\n * Establishes the main-axis, defining the direction children are placed. Default is \"row\".\n */\n direction?: ResponsiveProp<LayoutDirection>;\n /**\n * Controls the space between items, default is 3.\n */\n gap?: ResponsiveProp<number | string>;\n /**\n * Defines the alignment along the main axis, default is \"start\".\n */\n justify?: FlexContentAlignment;\n /**\n * **Deprecated:** For separators see `StackLayout` component instead.\n *\n * Adds a separator between elements if wrap is not active, default is false.\n */\n separators?: LayoutSeparator | true;\n /**\n * Allow the items to wrap as needed, default is false.\n */\n wrap?: ResponsiveProp<boolean>;\n /**\n * Defines the margin around the component. It can be specified as a number (which acts as a multiplier) or a string representing the margin value. Default is `0`.\n */\n margin?: ResponsiveProp<number | string>;\n /**\n * Defines the padding within the component. It can be specified as a number (which acts as a multiplier) or a string representing the padding value. Default is `0`.\n */\n padding?: ResponsiveProp<number | string>;\n }\n >;\n\ntype FlexLayoutComponent = <T extends ElementType = \"div\">(\n props: FlexLayoutProps<T>,\n) => ReactElement | null;\n\nfunction parseAlignment(style: string | undefined) {\n return style === \"start\" || style === \"end\" ? `flex-${style}` : style;\n}\n\nexport const FlexLayout: FlexLayoutComponent = forwardRef(\n <T extends ElementType = \"div\">(\n {\n as,\n align,\n children,\n className,\n direction = \"row\",\n gap = 3,\n margin = 0,\n padding = 0,\n justify,\n separators,\n style,\n wrap = false,\n ...rest\n }: FlexLayoutProps<T>,\n ref?: PolymorphicRef<T>,\n ) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-flex-layout\",\n css: flexLayoutCss,\n window: targetWindow,\n });\n\n const Component = as || \"div\";\n const separatorAlignment = separators === true ? \"center\" : separators;\n\n const { matchedBreakpoints } = useBreakpoint();\n const flexGap = resolveResponsiveValue(gap, matchedBreakpoints);\n const flexMargin = resolveResponsiveValue(margin, matchedBreakpoints);\n const flexPadding = resolveResponsiveValue(padding, matchedBreakpoints);\n const flexDirection = resolveResponsiveValue(direction, matchedBreakpoints);\n const flexWrap = resolveResponsiveValue(wrap, matchedBreakpoints);\n const flexLayoutStyles = {\n ...style,\n \"--flexLayout-align\": parseAlignment(align),\n \"--flexLayout-direction\": flexDirection,\n \"--flexLayout-gap\": parseSpacing(flexGap),\n \"--flexLayout-margin\": parseSpacing(flexMargin),\n \"--flexLayout-padding\": parseSpacing(flexPadding),\n \"--flexLayout-justify\": parseAlignment(justify),\n \"--flexLayout-wrap\": flexWrap ? \"wrap\" : \"nowrap\",\n };\n\n return (\n <Component\n className={clsx(\n withBaseName(),\n {\n [withBaseName(\"separator\")]: separatorAlignment && !wrap,\n [withBaseName(\n `separator-${flexDirection ?? \"row\"}-${\n separatorAlignment ?? \"center\"\n }`,\n )]: separatorAlignment && !wrap,\n [withBaseName(`separator-${flexDirection ?? \"row\"}`)]:\n separatorAlignment && !wrap,\n },\n className,\n )}\n ref={ref}\n style={flexLayoutStyles}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":["flexLayoutCss"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,YAAA,GAAe,aAAa,gBAAgB,CAAA;AAK3C,MAAM,mBAAsB,GAAA,CAAC,OAAS,EAAA,KAAA,EAAO,QAAQ;AACrD,MAAM,2BAA8B,GAAA;AAAA,EACzC,GAAG,mBAAA;AAAA,EACH,eAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF;AAkDA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A,MACvB,GAAG,KAAA;AAAA,MACH,oBAAA,EAAsB,eAAe,KAAK,CAAA;AAAA,MAC1C,wBAA0B,EAAA,aAAA;AAAA,MAC1B,kBAAA,EAAoB,aAAa,OAAO,CAAA;AAAA,MACxC,qBAAA,EAAuB,aAAa,UAAU,CAAA;AAAA,MAC9C,sBAAA,EAAwB,aAAa,WAAW,CAAA;AAAA,MAChD,sBAAA,EAAwB,eAAe,OAAO,CAAA;AAAA,MAC9C,mBAAA,EAAqB,WAAW,MAAS,GAAA;AAAA,KAC3C;AAEA,IACE,uBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,SAAW,EAAA,IAAA;AAAA,UACT,YAAa,EAAA;AAAA,UACb;AAAA,YACE,CAAC,YAAa,CAAA,WAAW,CAAC,GAAG,sBAAsB,CAAC,IAAA;AAAA,YACpD,CAAC,YAAA;AAAA,cACC,CAAa,UAAA,EAAA,aAAA,IAAiB,KAAK,CAAA,CAAA,EACjC,sBAAsB,QACxB,CAAA;AAAA,aACD,GAAG,kBAAA,IAAsB,CAAC,IAAA;AAAA,YAC3B,CAAC,aAAa,CAAa,UAAA,EAAA,aAAA,IAAiB,KAAK,CAAE,CAAA,CAAC,GAClD,kBAAA,IAAsB,CAAC;AAAA,WAC3B;AAAA,UACA;AAAA,SACF;AAAA,QACA,GAAA;AAAA,QACA,KAAO,EAAA,gBAAA;AAAA,QACN,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA;AAGN;;;;"}
1
+ {"version":3,"file":"FlexLayout.js","sources":["../src/flex-layout/FlexLayout.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport {\n type ElementType,\n type ForwardedRef,\n type FunctionComponent,\n forwardRef,\n} from \"react\";\nimport { useBreakpoint } from \"../breakpoints\";\nimport {\n type PolymorphicComponentPropWithRef,\n type PolymorphicRef,\n type ResponsiveProp,\n makePrefixer,\n resolveResponsiveValue,\n} from \"../utils\";\nimport flexLayoutCss from \"./FlexLayout.css\";\nimport { parseSpacing } from \"./parseSpacing\";\n\nconst withBaseName = makePrefixer(\"saltFlexLayout\");\n\nexport type LayoutSeparator = \"start\" | \"center\" | \"end\";\nexport type LayoutDirection = \"row\" | \"column\";\n\nexport const FLEX_ALIGNMENT_BASE = [\"start\", \"end\", \"center\"] as const;\nexport const FLEX_CONTENT_ALIGNMENT_BASE = [\n ...FLEX_ALIGNMENT_BASE,\n \"space-between\",\n \"space-around\",\n \"space-evenly\",\n] as const;\n\nexport type FlexAlignment = (typeof FLEX_ALIGNMENT_BASE)[number];\nexport type FlexContentAlignment = (typeof FLEX_CONTENT_ALIGNMENT_BASE)[number];\n\nexport type FlexLayoutProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Defines the default behavior for how flex items are laid out along the cross axis on the current line, default is \"stretch\".\n */\n align?: FlexAlignment | \"stretch\" | \"baseline\";\n /**\n * Establishes the main-axis, defining the direction children are placed. Default is \"row\".\n */\n direction?: ResponsiveProp<LayoutDirection>;\n /**\n * Controls the space between items, default is 3.\n */\n gap?: ResponsiveProp<number | string>;\n /**\n * Defines the alignment along the main axis, default is \"start\".\n */\n justify?: FlexContentAlignment;\n /**\n * **Deprecated:** For separators see `StackLayout` component instead.\n *\n * Adds a separator between elements if wrap is not active, default is false.\n */\n separators?: LayoutSeparator | true;\n /**\n * Allow the items to wrap as needed, default is false.\n */\n wrap?: ResponsiveProp<boolean>;\n /**\n * Defines the margin around the component. It can be specified as a number (which acts as a multiplier) or a string representing the margin value. Default is `0`.\n */\n margin?: ResponsiveProp<number | string>;\n /**\n * Defines the padding within the component. It can be specified as a number (which acts as a multiplier) or a string representing the padding value. Default is `0`.\n */\n padding?: ResponsiveProp<number | string>;\n }\n >;\n\ntype FlexLayoutComponent = <T extends ElementType = \"div\">(\n props: FlexLayoutProps<T>,\n) => ReturnType<FunctionComponent>;\n\nfunction parseAlignment(style: string | undefined) {\n return style === \"start\" || style === \"end\" ? `flex-${style}` : style;\n}\n\nexport const FlexLayout: FlexLayoutComponent = forwardRef(function FlexLayout<\n T extends ElementType = \"div\",\n>(\n {\n as,\n align,\n children,\n className,\n direction = \"row\",\n gap = 3,\n margin = 0,\n padding = 0,\n justify,\n separators,\n style,\n wrap = false,\n ...rest\n }: FlexLayoutProps<T>,\n ref?: ForwardedRef<unknown>,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-flex-layout\",\n css: flexLayoutCss,\n window: targetWindow,\n });\n\n const Component = as || \"div\";\n const separatorAlignment = separators === true ? \"center\" : separators;\n\n const { matchedBreakpoints } = useBreakpoint();\n const flexGap = resolveResponsiveValue(gap, matchedBreakpoints);\n const flexMargin = resolveResponsiveValue(margin, matchedBreakpoints);\n const flexPadding = resolveResponsiveValue(padding, matchedBreakpoints);\n const flexDirection = resolveResponsiveValue(direction, matchedBreakpoints);\n const flexWrap = resolveResponsiveValue(wrap, matchedBreakpoints);\n const flexLayoutStyles = {\n ...style,\n \"--flexLayout-align\": parseAlignment(align),\n \"--flexLayout-direction\": flexDirection,\n \"--flexLayout-gap\": parseSpacing(flexGap),\n \"--flexLayout-margin\": parseSpacing(flexMargin),\n \"--flexLayout-padding\": parseSpacing(flexPadding),\n \"--flexLayout-justify\": parseAlignment(justify),\n \"--flexLayout-wrap\": flexWrap ? \"wrap\" : \"nowrap\",\n };\n\n return (\n <Component\n className={clsx(\n withBaseName(),\n {\n [withBaseName(\"separator\")]: separatorAlignment && !wrap,\n [withBaseName(\n `separator-${flexDirection ?? \"row\"}-${\n separatorAlignment ?? \"center\"\n }`,\n )]: separatorAlignment && !wrap,\n [withBaseName(`separator-${flexDirection ?? \"row\"}`)]:\n separatorAlignment && !wrap,\n },\n className,\n )}\n ref={ref as PolymorphicRef<T>}\n style={flexLayoutStyles}\n {...rest}\n >\n {children}\n </Component>\n );\n});\n"],"names":["FlexLayout","flexLayoutCss"],"mapp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import { forwardRef } from 'react';
3
3
  import { FlexLayout } from '../flex-layout/FlexLayout.js';
4
4
 
5
- const FlowLayout = forwardRef(
6
- ({ children, ...rest }, ref) => {
7
- return /* @__PURE__ */ jsx(FlexLayout, { direction: "row", ref, wrap: true, ...rest, children });
8
- }
9
- );
5
+ const FlowLayout = forwardRef(function FlowLayout2({ as, children, ...rest }, ref) {
6
+ return /* @__PURE__ */ jsx(FlexLayout, { as, direction: "row", ref, wrap: true, ...rest, children });
7
+ });
10
8
 
11
9
  export { FlowLayout };
12
10
  //# sourceMappingURL=FlowLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlowLayout.js","sources":["../src/flow-layout/FlowLayout.tsx"],"sourcesContent":["import { type ElementType, type ReactElement, forwardRef } from \"react\";\nimport { FlexLayout, type FlexLayoutProps } from \"../flex-layout\";\nimport type { PolymorphicComponentPropWithRef, PolymorphicRef } from \"../utils\";\n\nexport type FlowLayoutProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Defines the default behavior for how flex items are laid out along the cross axis on the current line, default is \"stretch\".\n */\n align?: FlexLayoutProps<ElementType>[\"align\"];\n /**\n * Controls the space between items, default is 3.\n */\n gap?: FlexLayoutProps<ElementType>[\"gap\"];\n /**\n * Defines the alignment along the main axis, default is \"start\"\n */\n justify?: FlexLayoutProps<ElementType>[\"justify\"];\n /**\n * Defines the margin around the component. It can be specified as a number (which acts as a multiplier) or a string representing the margin value. Default is `0`.\n */\n margin?: FlexLayoutProps<ElementType>[\"margin\"];\n /**\n * Defines the padding within the component. It can be specified as a number (which acts as a multiplier) or a string representing the padding value. Default is `0`.\n */\n padding?: FlexLayoutProps<ElementType>[\"padding\"];\n }\n >;\n\ntype FlowLayoutComponent = <T extends ElementType = \"div\">(\n props: FlowLayoutProps<T>,\n) => ReactElement | null;\n\nexport const FlowLayout: FlowLayoutComponent = forwardRef(\n <T extends ElementType = \"div\">(\n { children, ...rest }: FlowLayoutProps<T>,\n ref?: PolymorphicRef<T>,\n ) => {\n return (\n <FlexLayout direction=\"row\" ref={ref} wrap {...rest}>\n {children}\n </FlexLayout>\n );\n },\n);\n"],"names":[],"mappings":";;;;AAmCO,MAAM,UAAkC,GAAA,UAAA;AAAA,EAC7C,CACE,EAAE,QAAA,EAAU,GAAG,IAAA,IACf,GACG,KAAA;AACH,IACE,uBAAA,GAAA,CAAC,cAAW,SAAU,EAAA,KAAA,EAAM,KAAU,IAAI,EAAA,IAAA,EAAE,GAAG,IAAA,EAC5C,QACH,EAAA,CAAA;AAAA;AAGN;;;;"}
1
+ {"version":3,"file":"FlowLayout.js","sources":["../src/flow-layout/FlowLayout.tsx"],"sourcesContent":["import {\n type ElementType,\n type ForwardedRef,\n type FunctionComponent,\n forwardRef,\n} from \"react\";\nimport { FlexLayout, type FlexLayoutProps } from \"../flex-layout\";\nimport type { PolymorphicComponentPropWithRef } from \"../utils\";\n\nexport type FlowLayoutProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Defines the default behavior for how flex items are laid out along the cross axis on the current line, default is \"stretch\".\n */\n align?: FlexLayoutProps<ElementType>[\"align\"];\n /**\n * Controls the space between items, default is 3.\n */\n gap?: FlexLayoutProps<ElementType>[\"gap\"];\n /**\n * Defines the alignment along the main axis, default is \"start\"\n */\n justify?: FlexLayoutProps<ElementType>[\"justify\"];\n /**\n * Defines the margin around the component. It can be specified as a number (which acts as a multiplier) or a string representing the margin value. Default is `0`.\n */\n margin?: FlexLayoutProps<ElementType>[\"margin\"];\n /**\n * Defines the padding within the component. It can be specified as a number (which acts as a multiplier) or a string representing the padding value. Default is `0`.\n */\n padding?: FlexLayoutProps<ElementType>[\"padding\"];\n }\n >;\n\ntype FlowLayoutComponent = <T extends ElementType = \"div\">(\n props: FlowLayoutProps<T>,\n) => ReturnType<FunctionComponent>;\n\nexport const FlowLayout: FlowLayoutComponent = forwardRef(function FlowLayout<\n T extends ElementType = \"div\",\n>({ as, children, ...rest }: FlowLayoutProps<T>, ref?: ForwardedRef<unknown>) {\n return (\n <FlexLayout as={as as ElementType} direction=\"row\" ref={ref} wrap {...rest}>\n {children}\n </FlexLayout>\n );\n});\n"],"names":["FlowLayout"],"mappings":";;;;AAwCa,MAAA,UAAA,GAAkC,UAAW,CAAA,SAASA,WAEjE,CAAA,EAAE,IAAI,QAAU,EAAA,GAAG,IAAK,EAAA,EAAuB,GAA6B,EAAA;AAC5E,EACE,uBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,EAAA,EAAuB,SAAU,EAAA,KAAA,EAAM,KAAU,IAAI,EAAA,IAAA,EAAE,GAAG,IAAA,EACnE,QACH,EAAA,CAAA;AAEJ,CAAC;;;;"}
@@ -22,59 +22,57 @@ const colStart = "auto";
22
22
  const colEnd = "auto";
23
23
  const rowStart = "auto";
24
24
  const rowEnd = "auto";
25
- const GridItem = forwardRef(
26
- ({
27
- as,
28
- children,
29
- className,
30
- margin = 0,
31
- padding = 0,
32
- colSpan = "auto",
33
- rowSpan = "auto",
34
- horizontalAlignment = "stretch",
35
- verticalAlignment = "stretch",
36
- style,
37
- ...rest
38
- }, ref) => {
39
- const targetWindow = useWindow();
40
- useComponentCssInjection({
41
- testId: "salt-grid-item",
42
- css: css_248z,
43
- window: targetWindow
44
- });
45
- const { matchedBreakpoints } = useBreakpoint();
46
- const Component = as || "div";
47
- const gridItemColSpan = resolveResponsiveValue(colSpan, matchedBreakpoints);
48
- const gridItemRowSpan = resolveResponsiveValue(rowSpan, matchedBreakpoints);
49
- const gridItemMargin = resolveResponsiveValue(margin, matchedBreakpoints);
50
- const gridItemPadding = resolveResponsiveValue(padding, matchedBreakpoints);
51
- const gridColumnStart = gridItemColSpan ? `span ${gridItemColSpan}` : colStart;
52
- const gridColumnEnd = gridItemColSpan ? `span ${gridItemColSpan}` : colEnd;
53
- const gridRowStart = gridItemRowSpan ? `span ${gridItemRowSpan}` : rowStart;
54
- const gridRowEnd = gridItemRowSpan ? `span ${gridItemRowSpan}` : rowEnd;
55
- const gridStyles = {
56
- "--gridItem-margin": parseSpacing(gridItemMargin),
57
- "--gridItem-padding": parseSpacing(gridItemPadding),
58
- ...style,
59
- "--gridItem-justifySelf": horizontalAlignment,
60
- "--gridItem-alignSelf": verticalAlignment,
61
- "--gridItem-gridRowStart": gridRowStart,
62
- "--gridItem-gridColumnStart": gridColumnStart,
63
- "--gridItem-gridRowEnd": gridRowEnd,
64
- "--gridItem-gridColumnEnd": gridColumnEnd
65
- };
66
- return /* @__PURE__ */ jsx(
67
- Component,
68
- {
69
- className: clsx(withBaseName(), className),
70
- style: gridStyles,
71
- ref,
72
- ...rest,
73
- children
74
- }
75
- );
76
- }
77
- );
25
+ const GridItem = forwardRef(function GridItem2({
26
+ as,
27
+ children,
28
+ className,
29
+ margin = 0,
30
+ padding = 0,
31
+ colSpan = "auto",
32
+ rowSpan = "auto",
33
+ horizontalAlignment = "stretch",
34
+ verticalAlignment = "stretch",
35
+ style,
36
+ ...rest
37
+ }, ref) {
38
+ const targetWindow = useWindow();
39
+ useComponentCssInjection({
40
+ testId: "salt-grid-item",
41
+ css: css_248z,
42
+ window: targetWindow
43
+ });
44
+ const { matchedBreakpoints } = useBreakpoint();
45
+ const Component = as || "div";
46
+ const gridItemColSpan = resolveResponsiveValue(colSpan, matchedBreakpoints);
47
+ const gridItemRowSpan = resolveResponsiveValue(rowSpan, matchedBreakpoints);
48
+ const gridItemMargin = resolveResponsiveValue(margin, matchedBreakpoints);
49
+ const gridItemPadding = resolveResponsiveValue(padding, matchedBreakpoints);
50
+ const gridColumnStart = gridItemColSpan ? `span ${gridItemColSpan}` : colStart;
51
+ const gridColumnEnd = gridItemColSpan ? `span ${gridItemColSpan}` : colEnd;
52
+ const gridRowStart = gridItemRowSpan ? `span ${gridItemRowSpan}` : rowStart;
53
+ const gridRowEnd = gridItemRowSpan ? `span ${gridItemRowSpan}` : rowEnd;
54
+ const gridStyles = {
55
+ "--gridItem-margin": parseSpacing(gridItemMargin),
56
+ "--gridItem-padding": parseSpacing(gridItemPadding),
57
+ ...style,
58
+ "--gridItem-justifySelf": horizontalAlignment,
59
+ "--gridItem-alignSelf": verticalAlignment,
60
+ "--gridItem-gridRowStart": gridRowStart,
61
+ "--gridItem-gridColumnStart": gridColumnStart,
62
+ "--gridItem-gridRowEnd": gridRowEnd,
63
+ "--gridItem-gridColumnEnd": gridColumnEnd
64
+ };
65
+ return /* @__PURE__ */ jsx(
66
+ Component,
67
+ {
68
+ className: clsx(withBaseName(), className),
69
+ style: gridStyles,
70
+ ref,
71
+ ...rest,
72
+ children
73
+ }
74
+ );
75
+ });
78
76
 
79
77
  export { GRID_ALIGNMENT_BASE, GridItem };
80
78
  //# sourceMappingURL=GridItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GridItem.js","sources":["../src/grid-item/GridItem.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { type ElementType, type ReactElement, forwardRef } from \"react\";\n\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useBreakpoint } from \"../breakpoints\";\nimport { parseSpacing } from \"../flex-layout/parseSpacing\";\nimport {\n type PolymorphicComponentPropWithRef,\n type PolymorphicRef,\n type ResponsiveProp,\n makePrefixer,\n resolveResponsiveValue,\n} from \"../utils\";\nimport gridItemCss from \"./GridItem.css\";\n\nexport const GRID_ALIGNMENT_BASE = [\n \"start\",\n \"end\",\n \"center\",\n \"stretch\",\n] as const;\n\ntype GridAlignment = (typeof GRID_ALIGNMENT_BASE)[number];\n\ntype GridProperty = number | \"auto\";\nexport type GridItemProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * The item will span across the provided number of grid columns. Defaults to \"auto\"\n */\n colSpan?: ResponsiveProp<GridProperty>;\n /**\n * The item will span across the provided number of grid rows. Defaults to \"auto\"\n */\n rowSpan?: ResponsiveProp<GridProperty>;\n /**\n * Aligns a grid item inside a cell along the inline (row) axis. Defaults to \"stretch\"\n */\n horizontalAlignment?: GridAlignment;\n /**\n * Aligns a grid item inside a cell along the block (column) axis. Defaults to \"stretch\"\n */\n verticalAlignment?: GridAlignment;\n /**\n * Defines the margin around the component. It can be specified as a number (which acts as a multiplier) or a string representing the margin value. Default is `0`.\n */\n margin?: ResponsiveProp<number | string>;\n /**\n * Defines the padding within the component. It can be specified as a number (which acts as a multiplier) or a string representing the padding value. Default is `0`.\n */\n padding?: ResponsiveProp<number | string>;\n }\n >;\n\nconst withBaseName = makePrefixer(\"saltGridItem\");\n\nconst colStart = \"auto\";\nconst colEnd = \"auto\";\nconst rowStart = \"auto\";\nconst rowEnd = \"auto\";\n\ntype GridItemComponent = <T extends ElementType = \"div\">(\n props: GridItemProps<T>,\n) => ReactElement | null;\n\nexport const GridItem: GridItemComponent = forwardRef(\n <T extends ElementType = \"div\">(\n {\n as,\n children,\n className,\n margin = 0,\n padding = 0,\n colSpan = \"auto\",\n rowSpan = \"auto\",\n horizontalAlignment = \"stretch\",\n verticalAlignment = \"stretch\",\n style,\n ...rest\n }: GridItemProps<T>,\n ref?: PolymorphicRef<T>,\n ) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-grid-item\",\n css: gridItemCss,\n window: targetWindow,\n });\n\n const { matchedBreakpoints } = useBreakpoint();\n\n const Component = as || \"div\";\n const gridItemColSpan = resolveResponsiveValue(colSpan, matchedBreakpoints);\n\n const gridItemRowSpan = resolveResponsiveValue(rowSpan, matchedBreakpoints);\n const gridItemMargin = resolveResponsiveValue(margin, matchedBreakpoints);\n const gridItemPadding = resolveResponsiveValue(padding, matchedBreakpoints);\n const gridColumnStart = gridItemColSpan\n ? `span ${gridItemColSpan}`\n : colStart;\n\n const gridColumnEnd = gridItemColSpan ? `span ${gridItemColSpan}` : colEnd;\n\n const gridRowStart = gridItemRowSpan ? `span ${gridItemRowSpan}` : rowStart;\n\n const gridRowEnd = gridItemRowSpan ? `span ${gridItemRowSpan}` : rowEnd;\n\n const gridStyles = {\n \"--gridItem-margin\": parseSpacing(gridItemMargin),\n \"--gridItem-padding\": parseSpacing(gridItemPadding),\n ...style,\n \"--gridItem-justifySelf\": horizontalAlignment,\n \"--gridItem-alignSelf\": verticalAlignment,\n \"--gridItem-gridRowStart\": gridRowStart,\n \"--gridItem-gridColumnStart\": gridColumnStart,\n \"--gridItem-gridRowEnd\": gridRowEnd,\n \"--gridItem-gridColumnEnd\": gridColumnEnd,\n };\n\n return (\n <Component\n className={clsx(withBaseName(), className)}\n style={gridStyles}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":["gridItemCss"],"mappings":";;;;;;;;;;;;;AAgBO,MAAM,mBAAsB,GAAA;AAAA,EACjC,OAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AAoCA,MAAM,YAAA,GAAe,aAAa,cAAc,CAAA;AAEhD,MAAM,QAAW,GAAA,MAAA;AACjB,MAAM,MAAS,GAAA,MAAA;AACf,MAAM,QAAW,GAAA,MAAA;AACjB,MAAM,MAAS,GAAA,MAAA;AAMR,MAAM,QAA8B,GAAA,UAAA;AAAA,EACzC,CACE;AAAA,IACE,EAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAS,GAAA,CAAA;AAAA,IACT,OAAU,GAAA,CAAA;AAAA,IACV,OAAU,GAAA,MAAA;AAAA,IACV,OAAU,GAAA,MAAA;AAAA,IACV,mBAAsB,GAAA,SAAA;AAAA,IACtB,iBAAoB,GAAA,SAAA;AAAA,IACpB,KAAA;AAAA,IACA,GAAG;AAAA,KAEL,GACG,KAAA;AACH,IAAA,MAAM,eAAe,SAAU,EAAA;AAC/B,IAAyB,wBAAA,CAAA;AAAA,MACvB,MAAQ,EAAA,gBAAA;AAAA,MACR,GAAK,EAAAA,QAAA;AAAA,MACL,MAAQ,EAAA;AAAA,KACT,CAAA;AAED,IAAM,MAAA,EAAE,kBAAmB,EAAA,GAAI,aAAc,EAAA;AAE7C,IAAA,MAAM,YAAY,EAAM,IAAA,KAAA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A,KACH;AAAA;AAGN;;;;"}
1
+ {"version":3,"file":"GridItem.js","sources":["../src/grid-item/GridItem.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport {\n type ElementType,\n type ForwardedRef,\n type FunctionComponent,\n forwardRef,\n} from \"react\";\n\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useBreakpoint } from \"../breakpoints\";\nimport { parseSpacing } from \"../flex-layout/parseSpacing\";\nimport {\n type PolymorphicComponentPropWithRef,\n type PolymorphicRef,\n type ResponsiveProp,\n makePrefixer,\n resolveResponsiveValue,\n} from \"../utils\";\nimport gridItemCss from \"./GridItem.css\";\n\nexport const GRID_ALIGNMENT_BASE = [\n \"start\",\n \"end\",\n \"center\",\n \"stretch\",\n] as const;\n\ntype GridAlignment = (typeof GRID_ALIGNMENT_BASE)[number];\n\ntype GridProperty = number | \"auto\";\nexport type GridItemProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * The item will span across the provided number of grid columns. Defaults to \"auto\"\n */\n colSpan?: ResponsiveProp<GridProperty>;\n /**\n * The item will span across the provided number of grid rows. Defaults to \"auto\"\n */\n rowSpan?: ResponsiveProp<GridProperty>;\n /**\n * Aligns a grid item inside a cell along the inline (row) axis. Defaults to \"stretch\"\n */\n horizontalAlignment?: GridAlignment;\n /**\n * Aligns a grid item inside a cell along the block (column) axis. Defaults to \"stretch\"\n */\n verticalAlignment?: GridAlignment;\n /**\n * Defines the margin around the component. It can be specified as a number (which acts as a multiplier) or a string representing the margin value. Default is `0`.\n */\n margin?: ResponsiveProp<number | string>;\n /**\n * Defines the padding within the component. It can be specified as a number (which acts as a multiplier) or a string representing the padding value. Default is `0`.\n */\n padding?: ResponsiveProp<number | string>;\n }\n >;\n\nconst withBaseName = makePrefixer(\"saltGridItem\");\n\nconst colStart = \"auto\";\nconst colEnd = \"auto\";\nconst rowStart = \"auto\";\nconst rowEnd = \"auto\";\n\ntype GridItemComponent = <T extends ElementType = \"div\">(\n props: GridItemProps<T>,\n) => ReturnType<FunctionComponent>;\n\nexport const GridItem: GridItemComponent = forwardRef(function GridItem<\n T extends ElementType = \"div\",\n>(\n {\n as,\n children,\n className,\n margin = 0,\n padding = 0,\n colSpan = \"auto\",\n rowSpan = \"auto\",\n horizontalAlignment = \"stretch\",\n verticalAlignment = \"stretch\",\n style,\n ...rest\n }: GridItemProps<T>,\n ref?: ForwardedRef<unknown>,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-grid-item\",\n css: gridItemCss,\n window: targetWindow,\n });\n\n const { matchedBreakpoints } = useBreakpoint();\n\n const Component = as || \"div\";\n const gridItemColSpan = resolveResponsiveValue(colSpan, matchedBreakpoints);\n\n const gridItemRowSpan = resolveResponsiveValue(rowSpan, matchedBreakpoints);\n const gridItemMargin = resolveResponsiveValue(margin, matchedBreakpoints);\n const gridItemPadding = resolveResponsiveValue(padding, matchedBreakpoints);\n const gridColumnStart = gridItemColSpan\n ? `span ${gridItemColSpan}`\n : colStart;\n\n const gridColumnEnd = gridItemColSpan ? `span ${gridItemColSpan}` : colEnd;\n\n const gridRowStart = gridItemRowSpan ? `span ${gridItemRowSpan}` : rowStart;\n\n const gridRowEnd = gridItemRowSpan ? `span ${gridItemRowSpan}` : rowEnd;\n\n const gridStyles = {\n \"--gridItem-margin\": parseSpacing(gridItemMargin),\n \"--gridItem-padding\": parseSpacing(gridItemPadding),\n ...style,\n \"--gridItem-justifySelf\": horizontalAlignment,\n \"--gridItem-alignSelf\": verticalAlignment,\n \"--gridItem-gridRowStart\": gridRowStart,\n \"--gridItem-gridColumnStart\": gridColumnStart,\n \"--gridItem-gridRowEnd\": gridRowEnd,\n \"--gridItem-gridColumnEnd\": gridColumnEnd,\n };\n\n return (\n <Component\n className={clsx(withBaseName(), className)}\n style={gridStyles}\n ref={ref as PolymorphicRef<T>}\n {...rest}\n >\n {children}\n </Component>\n );\n});\n"],"names":["GridItem","gridItemCss"],"mappings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KAAA,EAAA,eAAe,CACvB,CAAA,GAAA,QAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA,eAAA,GAAkB,CAAQ,KAAA,EAAA,eAAe,CAAK,CAAA,GAAA,MAAA;AAEpE,EAAA,MAAM,YAAe,GAAA,eAAA,GAAkB,CAAQ,KAAA,EAAA,eAAe,CAAK,CAAA,GAAA,QAAA;AAEnE,EAAA,MAAM,UAAa,GAAA,eAAA,GAAkB,CAAQ,KAAA,EAAA,eAAe,CAAK,CAAA,GAAA,MAAA;AAEjE,EAAA,MAAM,UAAa,GAAA;AAAA,IACjB,mBAAA,EAAqB,aAAa,cAAc,CAAA;AAAA,IAChD,oBAAA,EAAsB,aAAa,eAAe,CAAA;AAAA,IAClD,GAAG,KAAA;AAAA,IACH,wBAA0B,EAAA,mBAAA;AAAA,IAC1B,sBAAwB,EAAA,iBAAA;AAAA,IACxB,yBAA2B,EAAA,YAAA;AAAA,IAC3B,4BAA8B,EAAA,eAAA;AAAA,IAC9B,uBAAyB,EAAA,UAAA;AAAA,IACzB,0BAA4B,EAAA;AAAA,GAC9B;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,IAAA,CAAK,YAAa,EAAA,EAAG,SAAS,CAAA;AAAA,MACzC,KAAO,EAAA,UAAA;AAAA,MACP,GAAA;AAAA,MACC,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;;;;"}
@@ -18,57 +18,55 @@ function parseGridValue(value) {
18
18
  }
19
19
  return `repeat(${value}, 1fr)`;
20
20
  }
21
- const GridLayout = forwardRef(
22
- ({
23
- as,
24
- children,
25
- className,
26
- columns = 12,
27
- rows = 1,
28
- gap = 3,
29
- margin = 0,
30
- padding = 0,
31
- columnGap,
32
- rowGap,
33
- style,
34
- ...rest
35
- }, ref) => {
36
- const targetWindow = useWindow();
37
- useComponentCssInjection({
38
- testId: "salt-grid-layout",
39
- css: css_248z,
40
- window: targetWindow
41
- });
42
- const Component = as || "div";
43
- const { matchedBreakpoints } = useBreakpoint();
44
- const gridColumns = resolveResponsiveValue(columns, matchedBreakpoints);
45
- const gridRows = resolveResponsiveValue(rows, matchedBreakpoints);
46
- const gridGap = resolveResponsiveValue(gap, matchedBreakpoints);
47
- const gridColumnGap = resolveResponsiveValue(columnGap, matchedBreakpoints);
48
- const gridRowGap = resolveResponsiveValue(rowGap, matchedBreakpoints);
49
- const gridMargin = resolveResponsiveValue(margin, matchedBreakpoints);
50
- const gridPadding = resolveResponsiveValue(padding, matchedBreakpoints);
51
- const gridLayoutStyles = {
52
- "--gridLayout-margin": parseSpacing(gridMargin),
53
- "--gridLayout-padding": parseSpacing(gridPadding),
54
- ...style,
55
- "--gridLayout-columns": parseGridValue(gridColumns),
56
- "--gridLayout-rows": parseGridValue(gridRows),
57
- "--gridLayout-columnGap": parseSpacing(gridColumnGap ?? gridGap),
58
- "--gridLayout-rowGap": parseSpacing(gridRowGap ?? gridGap)
59
- };
60
- return /* @__PURE__ */ jsx(
61
- Component,
62
- {
63
- className: clsx(withBaseName(), className),
64
- style: gridLayoutStyles,
65
- ref,
66
- ...rest,
67
- children
68
- }
69
- );
70
- }
71
- );
21
+ const GridLayout = forwardRef(function GridLayout2({
22
+ as,
23
+ children,
24
+ className,
25
+ columns = 12,
26
+ rows = 1,
27
+ gap = 3,
28
+ margin = 0,
29
+ padding = 0,
30
+ columnGap,
31
+ rowGap,
32
+ style,
33
+ ...rest
34
+ }, ref) {
35
+ const targetWindow = useWindow();
36
+ useComponentCssInjection({
37
+ testId: "salt-grid-layout",
38
+ css: css_248z,
39
+ window: targetWindow
40
+ });
41
+ const Component = as || "div";
42
+ const { matchedBreakpoints } = useBreakpoint();
43
+ const gridColumns = resolveResponsiveValue(columns, matchedBreakpoints);
44
+ const gridRows = resolveResponsiveValue(rows, matchedBreakpoints);
45
+ const gridGap = resolveResponsiveValue(gap, matchedBreakpoints);
46
+ const gridColumnGap = resolveResponsiveValue(columnGap, matchedBreakpoints);
47
+ const gridRowGap = resolveResponsiveValue(rowGap, matchedBreakpoints);
48
+ const gridMargin = resolveResponsiveValue(margin, matchedBreakpoints);
49
+ const gridPadding = resolveResponsiveValue(padding, matchedBreakpoints);
50
+ const gridLayoutStyles = {
51
+ "--gridLayout-margin": parseSpacing(gridMargin),
52
+ "--gridLayout-padding": parseSpacing(gridPadding),
53
+ ...style,
54
+ "--gridLayout-columns": parseGridValue(gridColumns),
55
+ "--gridLayout-rows": parseGridValue(gridRows),
56
+ "--gridLayout-columnGap": parseSpacing(gridColumnGap ?? gridGap),
57
+ "--gridLayout-rowGap": parseSpacing(gridRowGap ?? gridGap)
58
+ };
59
+ return /* @__PURE__ */ jsx(
60
+ Component,
61
+ {
62
+ className: clsx(withBaseName(), className),
63
+ style: gridLayoutStyles,
64
+ ref,
65
+ ...rest,
66
+ children
67
+ }
68
+ );
69
+ });
72
70
 
73
71
  export { GridLayout };
74
72
  //# sourceMappingURL=GridLayout.js.map