@jiwambe/components 0.2.0

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 (179) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +367 -0
  3. package/dist/client.d.ts +40 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +46 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/components/Accordion/Accordion.d.ts +74 -0
  8. package/dist/components/Accordion/Accordion.d.ts.map +1 -0
  9. package/dist/components/Accordion/Accordion.js +297 -0
  10. package/dist/components/Accordion/Accordion.js.map +1 -0
  11. package/dist/components/Box/Box.d.ts +56 -0
  12. package/dist/components/Box/Box.d.ts.map +1 -0
  13. package/dist/components/Box/Box.js +51 -0
  14. package/dist/components/Box/Box.js.map +1 -0
  15. package/dist/components/Breadcrumb/Breadcrumb.d.ts +66 -0
  16. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
  17. package/dist/components/Button/Button.d.ts +54 -0
  18. package/dist/components/Button/Button.d.ts.map +1 -0
  19. package/dist/components/Button/Button.js +92 -0
  20. package/dist/components/Button/Button.js.map +1 -0
  21. package/dist/components/Card/Card.d.ts +54 -0
  22. package/dist/components/Card/Card.d.ts.map +1 -0
  23. package/dist/components/Card/Card.js +98 -0
  24. package/dist/components/Card/Card.js.map +1 -0
  25. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +61 -0
  26. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -0
  27. package/dist/components/CheckboxGroup/CheckboxGroup.js +205 -0
  28. package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
  29. package/dist/components/Container/Container.d.ts +72 -0
  30. package/dist/components/Container/Container.d.ts.map +1 -0
  31. package/dist/components/Container/Container.js +69 -0
  32. package/dist/components/Container/Container.js.map +1 -0
  33. package/dist/components/DateInput/DateInput.d.ts +61 -0
  34. package/dist/components/DateInput/DateInput.d.ts.map +1 -0
  35. package/dist/components/DateInput/DateInput.js +234 -0
  36. package/dist/components/DateInput/DateInput.js.map +1 -0
  37. package/dist/components/Divider/Divider.d.ts +44 -0
  38. package/dist/components/Divider/Divider.d.ts.map +1 -0
  39. package/dist/components/Divider/Divider.js +35 -0
  40. package/dist/components/Divider/Divider.js.map +1 -0
  41. package/dist/components/Drawer/Drawer.d.ts +35 -0
  42. package/dist/components/Drawer/Drawer.d.ts.map +1 -0
  43. package/dist/components/Drawer/Drawer.js +37 -0
  44. package/dist/components/Drawer/Drawer.js.map +1 -0
  45. package/dist/components/FAQ/FAQ.d.ts +40 -0
  46. package/dist/components/FAQ/FAQ.d.ts.map +1 -0
  47. package/dist/components/FAQ/FAQ.js +161 -0
  48. package/dist/components/FAQ/FAQ.js.map +1 -0
  49. package/dist/components/Grid/Grid.d.ts +61 -0
  50. package/dist/components/Grid/Grid.d.ts.map +1 -0
  51. package/dist/components/Grid/Grid.js +95 -0
  52. package/dist/components/Grid/Grid.js.map +1 -0
  53. package/dist/components/Icon/Icon.d.ts +21 -0
  54. package/dist/components/Icon/Icon.d.ts.map +1 -0
  55. package/dist/components/Icon/Icon.js +167 -0
  56. package/dist/components/Icon/Icon.js.map +1 -0
  57. package/dist/components/Link/Link.d.ts +49 -0
  58. package/dist/components/Link/Link.d.ts.map +1 -0
  59. package/dist/components/Link/Link.js +70 -0
  60. package/dist/components/Link/Link.js.map +1 -0
  61. package/dist/components/List/List.d.ts +36 -0
  62. package/dist/components/List/List.d.ts.map +1 -0
  63. package/dist/components/List/List.js +42 -0
  64. package/dist/components/List/List.js.map +1 -0
  65. package/dist/components/List/index.d.ts +3 -0
  66. package/dist/components/List/index.d.ts.map +1 -0
  67. package/dist/components/Overlay/Overlay.d.ts +35 -0
  68. package/dist/components/Overlay/Overlay.d.ts.map +1 -0
  69. package/dist/components/Overlay/Overlay.js +51 -0
  70. package/dist/components/Overlay/Overlay.js.map +1 -0
  71. package/dist/components/PhoneInput/PhoneInput.d.ts +55 -0
  72. package/dist/components/PhoneInput/PhoneInput.d.ts.map +1 -0
  73. package/dist/components/PhoneInput/PhoneInput.js +255 -0
  74. package/dist/components/PhoneInput/PhoneInput.js.map +1 -0
  75. package/dist/components/Popover/Popover.d.ts +46 -0
  76. package/dist/components/Popover/Popover.d.ts.map +1 -0
  77. package/dist/components/Popover/Popover.js +57 -0
  78. package/dist/components/Popover/Popover.js.map +1 -0
  79. package/dist/components/ProductImage/ProductImage.d.ts +78 -0
  80. package/dist/components/ProductImage/ProductImage.d.ts.map +1 -0
  81. package/dist/components/ProductImage/ProductImage.js +220 -0
  82. package/dist/components/ProductImage/ProductImage.js.map +1 -0
  83. package/dist/components/RadioGroup/RadioGroup.d.ts +63 -0
  84. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -0
  85. package/dist/components/RadioGroup/RadioGroup.js +233 -0
  86. package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
  87. package/dist/components/Section/Section.d.ts +44 -0
  88. package/dist/components/Section/Section.d.ts.map +1 -0
  89. package/dist/components/Section/Section.js +48 -0
  90. package/dist/components/Section/Section.js.map +1 -0
  91. package/dist/components/Select/Select.d.ts +47 -0
  92. package/dist/components/Select/Select.d.ts.map +1 -0
  93. package/dist/components/Select/Select.js +153 -0
  94. package/dist/components/Select/Select.js.map +1 -0
  95. package/dist/components/SelectTab/SelectTab.d.ts +62 -0
  96. package/dist/components/SelectTab/SelectTab.d.ts.map +1 -0
  97. package/dist/components/SelectTab/SelectTab.js +192 -0
  98. package/dist/components/SelectTab/SelectTab.js.map +1 -0
  99. package/dist/components/Skeleton/Skeleton.d.ts +87 -0
  100. package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
  101. package/dist/components/Skeleton/Skeleton.js +97 -0
  102. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  103. package/dist/components/Skeleton/index.d.ts +3 -0
  104. package/dist/components/Skeleton/index.d.ts.map +1 -0
  105. package/dist/components/Slider/Slider.d.ts +47 -0
  106. package/dist/components/Slider/Slider.d.ts.map +1 -0
  107. package/dist/components/Slider/Slider.js +147 -0
  108. package/dist/components/Slider/Slider.js.map +1 -0
  109. package/dist/components/Stack/Stack.d.ts +145 -0
  110. package/dist/components/Stack/Stack.d.ts.map +1 -0
  111. package/dist/components/Stack/Stack.js +80 -0
  112. package/dist/components/Stack/Stack.js.map +1 -0
  113. package/dist/components/Tab/Tab.d.ts +38 -0
  114. package/dist/components/Tab/Tab.d.ts.map +1 -0
  115. package/dist/components/Tab/Tab.js +146 -0
  116. package/dist/components/Tab/Tab.js.map +1 -0
  117. package/dist/components/TextArea/TextArea.d.ts +32 -0
  118. package/dist/components/TextArea/TextArea.d.ts.map +1 -0
  119. package/dist/components/TextArea/TextArea.js +118 -0
  120. package/dist/components/TextArea/TextArea.js.map +1 -0
  121. package/dist/components/TextInput/TextInput.d.ts +35 -0
  122. package/dist/components/TextInput/TextInput.d.ts.map +1 -0
  123. package/dist/components/TextInput/TextInput.js +128 -0
  124. package/dist/components/TextInput/TextInput.js.map +1 -0
  125. package/dist/components/Toggle/Toggle.d.ts +83 -0
  126. package/dist/components/Toggle/Toggle.d.ts.map +1 -0
  127. package/dist/components/Toggle/Toggle.js +121 -0
  128. package/dist/components/Toggle/Toggle.js.map +1 -0
  129. package/dist/components/Typography/Typography.d.ts +321 -0
  130. package/dist/components/Typography/Typography.d.ts.map +1 -0
  131. package/dist/components/Typography/Typography.js +21 -0
  132. package/dist/components/Typography/Typography.js.map +1 -0
  133. package/dist/components/UploadInput/UploadInput.d.ts +39 -0
  134. package/dist/components/UploadInput/UploadInput.d.ts.map +1 -0
  135. package/dist/components/UploadInput/UploadInput.js +297 -0
  136. package/dist/components/UploadInput/UploadInput.js.map +1 -0
  137. package/dist/components/index.d.ts +65 -0
  138. package/dist/components/index.d.ts.map +1 -0
  139. package/dist/index.d.ts +7 -0
  140. package/dist/index.d.ts.map +1 -0
  141. package/dist/index.js +69 -0
  142. package/dist/index.js.map +1 -0
  143. package/dist/plugin/jiwambe-plugin.d.ts +37 -0
  144. package/dist/plugin/jiwambe-plugin.d.ts.map +1 -0
  145. package/dist/plugin/jiwambe-plugin.js +640 -0
  146. package/dist/plugin/jiwambe-plugin.js.map +1 -0
  147. package/dist/server.d.ts +22 -0
  148. package/dist/server.d.ts.map +1 -0
  149. package/dist/server.js +23 -0
  150. package/dist/server.js.map +1 -0
  151. package/dist/types/index.d.ts +103 -0
  152. package/dist/types/index.d.ts.map +1 -0
  153. package/dist/types/layout.d.ts +138 -0
  154. package/dist/types/layout.d.ts.map +1 -0
  155. package/dist/types/list.d.ts +69 -0
  156. package/dist/types/list.d.ts.map +1 -0
  157. package/dist/types/list.js +9 -0
  158. package/dist/types/list.js.map +1 -0
  159. package/dist/types/skeleton.d.ts +38 -0
  160. package/dist/types/skeleton.d.ts.map +1 -0
  161. package/dist/types/skeleton.js +13 -0
  162. package/dist/types/skeleton.js.map +1 -0
  163. package/dist/types/spacing.d.ts +105 -0
  164. package/dist/types/spacing.d.ts.map +1 -0
  165. package/dist/utils/layoutClasses.d.ts +44 -0
  166. package/dist/utils/layoutClasses.d.ts.map +1 -0
  167. package/dist/utils/layoutClasses.js +88 -0
  168. package/dist/utils/layoutClasses.js.map +1 -0
  169. package/dist/utils/responsive-props.d.ts +60 -0
  170. package/dist/utils/responsive-props.d.ts.map +1 -0
  171. package/dist/utils/responsive-props.js +184 -0
  172. package/dist/utils/responsive-props.js.map +1 -0
  173. package/dist/utils/spacing.d.ts +52 -0
  174. package/dist/utils/spacing.d.ts.map +1 -0
  175. package/dist/utils/spacing.js +625 -0
  176. package/dist/utils/spacing.js.map +1 -0
  177. package/package.json +96 -0
  178. package/tailwind.preset.d.ts +3 -0
  179. package/tailwind.preset.ts +21 -0
@@ -0,0 +1,105 @@
1
+ /**
2
+ * All valid fixed spacing token keys in the Jiwambe design system.
3
+ * Each key corresponds to a --space-* CSS custom property injected by
4
+ * jiwambe-plugin. Example: 'space-4' → var(--space-4) → 1rem.
5
+ *
6
+ * Use these as values for any spacing prop (p, px, mt, gap etc.) on
7
+ * Box, Stack, Grid, Container, and List.
8
+ */
9
+ export type FixedSpacingToken = 'space-0' | 'space-0-25' | 'space-1' | 'space-2' | 'space-3' | 'space-4' | 'space-5' | 'space-6' | 'space-8' | 'space-9' | 'space-12' | 'space-16' | 'space-18' | 'space-24' | 'space-30' | 'space-36' | 'space-48' | 'space-72';
10
+ /**
11
+ * All valid fluid spacing token keys in the Jiwambe design system.
12
+ * Each key corresponds to a --space-fluid-* CSS custom property injected
13
+ * by jiwambe-plugin. Fluid tokens use clamp() to scale smoothly between
14
+ * a minimum and maximum value across viewport widths.
15
+ *
16
+ * Example: 'fluid-4-9' → var(--space-fluid-4-9)
17
+ * → clamp(1rem, 0.6032rem + 1.9841vw, 2.25rem)
18
+ *
19
+ * Prefer fluid tokens for horizontal padding on page-level containers
20
+ * and section wrappers where breathing room should scale with the viewport.
21
+ */
22
+ export type FluidSpacingToken = 'fluid-1-2' | 'fluid-2-4' | 'fluid-4-5' | 'fluid-4-6' | 'fluid-4-8' | 'fluid-4-9' | 'fluid-5-6' | 'fluid-6-9' | 'fluid-8-16' | 'fluid-16-18' | 'fluid-30-36' | 'fluid-48-72';
23
+ /**
24
+ * Union of all valid spacing token keys — both fixed and fluid.
25
+ * This is the accepted type for all spacing props across layout components.
26
+ *
27
+ * @see FixedSpacingToken
28
+ * @see FluidSpacingToken
29
+ */
30
+ export type SpacingToken = FixedSpacingToken | FluidSpacingToken;
31
+ /**
32
+ * SpacingToken plus 'auto'. 'auto' is valid only for margin props (m, mx, my,
33
+ * mt, mb, ml, mr) — not for padding or gap. Use mx="auto" on a Box with a
34
+ * defined width to centre it horizontally.
35
+ */
36
+ export type MarginToken = SpacingToken | 'auto';
37
+ /**
38
+ * Box-model spacing props accepted by Box, Container, Stack, and Grid.
39
+ * All values must be Jiwambe design token strings — not raw CSS values,
40
+ * not numbers, not Tailwind class names.
41
+ *
42
+ * Token strings map to CSS custom properties injected by jiwambe-plugin:
43
+ * p="space-4" → padding: var(--space-4) → 1rem
44
+ * px="fluid-4-9" → padding-inline: var(--space-fluid-4-9) → clamp(...)
45
+ *
46
+ * More specific props override shorthand: pt overrides py which overrides p
47
+ * for the top side; px overrides p for horizontal axis. Prefer explicit props
48
+ * over shorthands where possible.
49
+ *
50
+ * @example
51
+ * <Box p="space-4" />
52
+ * @example
53
+ * <Box px="fluid-4-9" py="space-6" />
54
+ * @example
55
+ * <Box mt="space-8" mx="auto" />
56
+ */
57
+ export interface SpacingProps {
58
+ /** Padding on all four sides. @default undefined */
59
+ p?: SpacingToken;
60
+ /** Horizontal padding (left and right). Overrides p for horizontal axis. @default undefined */
61
+ px?: SpacingToken;
62
+ /** Vertical padding (top and bottom). Overrides p for vertical axis. @default undefined */
63
+ py?: SpacingToken;
64
+ /** Padding top only. Overrides p and py for the top side. @default undefined */
65
+ pt?: SpacingToken;
66
+ /** Padding bottom only. Overrides p and py for the bottom side. @default undefined */
67
+ pb?: SpacingToken;
68
+ /** Padding left only. Overrides p and px for the left side. @default undefined */
69
+ pl?: SpacingToken;
70
+ /** Padding right only. Overrides p and px for the right side. @default undefined */
71
+ pr?: SpacingToken;
72
+ /** Margin on all four sides. @default undefined */
73
+ m?: MarginToken;
74
+ /** Horizontal margin (left and right). Overrides m for horizontal axis. Use "auto" to centre. @default undefined */
75
+ mx?: MarginToken;
76
+ /** Vertical margin (top and bottom). Overrides m for vertical axis. @default undefined */
77
+ my?: MarginToken;
78
+ /** Margin top only. Overrides m and my for the top side. @default undefined */
79
+ mt?: SpacingToken;
80
+ /** Margin bottom only. Overrides m and my for the bottom side. @default undefined */
81
+ mb?: SpacingToken;
82
+ /** Margin left only. Overrides m and mx for the left side. @default undefined */
83
+ ml?: MarginToken;
84
+ /** Margin right only. Overrides m and mx for the right side. @default undefined */
85
+ mr?: MarginToken;
86
+ }
87
+ /**
88
+ * Gap props for Grid and Stack only. Controls spacing between direct children
89
+ * using CSS gap — not padding and not margin on children. All values must be
90
+ * Jiwambe spacing token strings. Do not use for list or container padding.
91
+ *
92
+ * @example
93
+ * <Grid gap="space-4" />
94
+ * @example
95
+ * <Grid rowGap="space-6" columnGap="space-4" />
96
+ */
97
+ export interface GapProps {
98
+ /** Spacing between all grid/flex children (row and column). @default undefined */
99
+ gap?: SpacingToken;
100
+ /** Spacing between rows only. Overrides gap for row axis. @default undefined */
101
+ rowGap?: SpacingToken;
102
+ /** Spacing between columns only. Overrides gap for column axis. @default undefined */
103
+ columnGap?: SpacingToken;
104
+ }
105
+ //# sourceMappingURL=spacing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spacing.d.ts","sourceRoot":"","sources":["../../src/types/spacing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,YAAY,GACZ,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAEf;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,YAAY,GACZ,aAAa,GACb,aAAa,GACb,aAAa,CAAC;AAElB;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,MAAM,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,YAAY;IAC3B,oDAAoD;IACpD,CAAC,CAAC,EAAE,YAAY,CAAC;IACjB,+FAA+F;IAC/F,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,2FAA2F;IAC3F,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,gFAAgF;IAChF,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,sFAAsF;IACtF,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,kFAAkF;IAClF,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,oFAAoF;IACpF,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,mDAAmD;IACnD,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,oHAAoH;IACpH,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,0FAA0F;IAC1F,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,+EAA+E;IAC/E,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,qFAAqF;IACrF,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,iFAAiF;IACjF,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,mFAAmF;IACnF,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,QAAQ;IACvB,kFAAkF;IAClF,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB,gFAAgF;IAChF,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,sFAAsF;IACtF,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B"}
@@ -0,0 +1,44 @@
1
+ import { DisplayValue, AlignItemsValue, JustifyContentValue, FlexDirectionValue, FlexWrapValue, AlignSelfValue, LayoutProps, StackLayoutProps } from '../types/layout';
2
+ export declare const displayMap: Record<DisplayValue, string>;
3
+ export declare const alignItemsMap: Record<AlignItemsValue, string>;
4
+ export declare const justifyContentMap: Record<JustifyContentValue, string>;
5
+ export declare const flexDirectionMap: Record<FlexDirectionValue, string>;
6
+ export declare const flexWrapMap: Record<FlexWrapValue, string>;
7
+ export declare const alignSelfMap: Record<AlignSelfValue, string>;
8
+ export declare const flexGrowMap: Record<0 | 1, string>;
9
+ export declare const flexShrinkMap: Record<0 | 1, string>;
10
+ /**
11
+ * Converts a LayoutProps object into a space-separated string of Tailwind
12
+ * utility classes for display and alignment properties. Each prop value (a
13
+ * CSS value string) is looked up in a static class map and resolved to the
14
+ * corresponding Tailwind utility class. Returns an empty string if no layout
15
+ * props are provided.
16
+ *
17
+ * @param props - An object containing any LayoutProps keys.
18
+ * @returns A space-separated Tailwind class string or empty string.
19
+ *
20
+ * @example
21
+ * resolveLayout({ display: 'inline-flex', alignItems: 'center' })
22
+ * // → 'inline-flex items-center'
23
+ *
24
+ * @example
25
+ * resolveLayout({ flexGrow: 1, alignSelf: 'flex-end' })
26
+ * // → 'grow self-end'
27
+ */
28
+ export declare function resolveLayout(props: LayoutProps): string;
29
+ /**
30
+ * Converts a StackLayoutProps object into a space-separated Tailwind class string.
31
+ * Handles only the alignItems and justifyContent subset used by Stack (CSS-value
32
+ * aliases for align/justify). Same pattern as resolveLayout but for the Stack
33
+ * alignment subset only.
34
+ *
35
+ * @param props - An object containing StackLayoutProps keys (alignItems, justifyContent).
36
+ * @returns A space-separated Tailwind class string or empty string.
37
+ *
38
+ * @example
39
+ * resolveStackLayout({ alignItems: 'center', justifyContent: 'space-between' })
40
+ * // → 'items-center justify-between'
41
+ */
42
+ export declare function resolveStackLayout(props: StackLayoutProps): string;
43
+ export declare const LAYOUT_PROP_KEYS: Set<string>;
44
+ //# sourceMappingURL=layoutClasses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutClasses.d.ts","sourceRoot":"","sources":["../../src/utils/layoutClasses.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,WAAW,EACX,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAUnD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAMzD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAOjE,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAK/D,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAIrD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAOvD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,CAG7C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,CAG/C,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAaxD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAOlE;AAED,eAAO,MAAM,gBAAgB,aAS3B,CAAC"}
@@ -0,0 +1,88 @@
1
+ const displayMap = {
2
+ block: "block",
3
+ "inline-block": "inline-block",
4
+ inline: "inline",
5
+ flex: "flex",
6
+ "inline-flex": "inline-flex",
7
+ grid: "grid",
8
+ "inline-grid": "inline-grid",
9
+ none: "hidden",
10
+ contents: "contents"
11
+ };
12
+ const alignItemsMap = {
13
+ "flex-start": "items-start",
14
+ "flex-end": "items-end",
15
+ center: "items-center",
16
+ baseline: "items-baseline",
17
+ stretch: "items-stretch"
18
+ };
19
+ const justifyContentMap = {
20
+ "flex-start": "justify-start",
21
+ "flex-end": "justify-end",
22
+ center: "justify-center",
23
+ "space-between": "justify-between",
24
+ "space-around": "justify-around",
25
+ "space-evenly": "justify-evenly"
26
+ };
27
+ const flexDirectionMap = {
28
+ row: "flex-row",
29
+ "row-reverse": "flex-row-reverse",
30
+ column: "flex-col",
31
+ "column-reverse": "flex-col-reverse"
32
+ };
33
+ const flexWrapMap = {
34
+ nowrap: "flex-nowrap",
35
+ wrap: "flex-wrap",
36
+ "wrap-reverse": "flex-wrap-reverse"
37
+ };
38
+ const alignSelfMap = {
39
+ auto: "self-auto",
40
+ "flex-start": "self-start",
41
+ "flex-end": "self-end",
42
+ center: "self-center",
43
+ baseline: "self-baseline",
44
+ stretch: "self-stretch"
45
+ };
46
+ const flexGrowMap = {
47
+ 0: "grow-0",
48
+ 1: "grow"
49
+ };
50
+ const flexShrinkMap = {
51
+ 0: "shrink-0",
52
+ 1: "shrink"
53
+ };
54
+ function resolveLayout(props) {
55
+ const classes = [];
56
+ if (props.display !== void 0) classes.push(displayMap[props.display]);
57
+ if (props.alignItems !== void 0) classes.push(alignItemsMap[props.alignItems]);
58
+ if (props.justifyContent !== void 0) classes.push(justifyContentMap[props.justifyContent]);
59
+ if (props.flexDirection !== void 0) classes.push(flexDirectionMap[props.flexDirection]);
60
+ if (props.flexWrap !== void 0) classes.push(flexWrapMap[props.flexWrap]);
61
+ if (props.alignSelf !== void 0) classes.push(alignSelfMap[props.alignSelf]);
62
+ if (props.flexGrow !== void 0) classes.push(flexGrowMap[props.flexGrow]);
63
+ if (props.flexShrink !== void 0) classes.push(flexShrinkMap[props.flexShrink]);
64
+ return classes.filter(Boolean).join(" ");
65
+ }
66
+ const LAYOUT_PROP_KEYS = /* @__PURE__ */ new Set([
67
+ "display",
68
+ "alignItems",
69
+ "justifyContent",
70
+ "flexDirection",
71
+ "flexWrap",
72
+ "alignSelf",
73
+ "flexGrow",
74
+ "flexShrink"
75
+ ]);
76
+ export {
77
+ LAYOUT_PROP_KEYS,
78
+ alignItemsMap,
79
+ alignSelfMap,
80
+ displayMap,
81
+ flexDirectionMap,
82
+ flexGrowMap,
83
+ flexShrinkMap,
84
+ flexWrapMap,
85
+ justifyContentMap,
86
+ resolveLayout
87
+ };
88
+ //# sourceMappingURL=layoutClasses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutClasses.js","sources":["../../src/utils/layoutClasses.ts"],"sourcesContent":["/**\n * Static Tailwind class maps for layout/alignment props.\n * No template literals — every class is a complete string literal for Tailwind's content scanner.\n */\nimport type {\n DisplayValue,\n AlignItemsValue,\n JustifyContentValue,\n FlexDirectionValue,\n FlexWrapValue,\n AlignSelfValue,\n LayoutProps,\n StackLayoutProps,\n} from '../types/layout';\n\nexport const displayMap: Record<DisplayValue, string> = {\n block: 'block',\n 'inline-block': 'inline-block',\n inline: 'inline',\n flex: 'flex',\n 'inline-flex': 'inline-flex',\n grid: 'grid',\n 'inline-grid': 'inline-grid',\n none: 'hidden',\n contents: 'contents',\n};\n\nexport const alignItemsMap: Record<AlignItemsValue, string> = {\n 'flex-start': 'items-start',\n 'flex-end': 'items-end',\n center: 'items-center',\n baseline: 'items-baseline',\n stretch: 'items-stretch',\n};\n\nexport const justifyContentMap: Record<JustifyContentValue, string> = {\n 'flex-start': 'justify-start',\n 'flex-end': 'justify-end',\n center: 'justify-center',\n 'space-between': 'justify-between',\n 'space-around': 'justify-around',\n 'space-evenly': 'justify-evenly',\n};\n\nexport const flexDirectionMap: Record<FlexDirectionValue, string> = {\n row: 'flex-row',\n 'row-reverse': 'flex-row-reverse',\n column: 'flex-col',\n 'column-reverse': 'flex-col-reverse',\n};\n\nexport const flexWrapMap: Record<FlexWrapValue, string> = {\n nowrap: 'flex-nowrap',\n wrap: 'flex-wrap',\n 'wrap-reverse': 'flex-wrap-reverse',\n};\n\nexport const alignSelfMap: Record<AlignSelfValue, string> = {\n auto: 'self-auto',\n 'flex-start': 'self-start',\n 'flex-end': 'self-end',\n center: 'self-center',\n baseline: 'self-baseline',\n stretch: 'self-stretch',\n};\n\nexport const flexGrowMap: Record<0 | 1, string> = {\n 0: 'grow-0',\n 1: 'grow',\n};\n\nexport const flexShrinkMap: Record<0 | 1, string> = {\n 0: 'shrink-0',\n 1: 'shrink',\n};\n\n/**\n * Converts a LayoutProps object into a space-separated string of Tailwind\n * utility classes for display and alignment properties. Each prop value (a\n * CSS value string) is looked up in a static class map and resolved to the\n * corresponding Tailwind utility class. Returns an empty string if no layout\n * props are provided.\n *\n * @param props - An object containing any LayoutProps keys.\n * @returns A space-separated Tailwind class string or empty string.\n *\n * @example\n * resolveLayout({ display: 'inline-flex', alignItems: 'center' })\n * // → 'inline-flex items-center'\n *\n * @example\n * resolveLayout({ flexGrow: 1, alignSelf: 'flex-end' })\n * // → 'grow self-end'\n */\nexport function resolveLayout(props: LayoutProps): string {\n const classes: string[] = [];\n\n if (props.display !== undefined) classes.push(displayMap[props.display]);\n if (props.alignItems !== undefined) classes.push(alignItemsMap[props.alignItems]);\n if (props.justifyContent !== undefined) classes.push(justifyContentMap[props.justifyContent]);\n if (props.flexDirection !== undefined) classes.push(flexDirectionMap[props.flexDirection]);\n if (props.flexWrap !== undefined) classes.push(flexWrapMap[props.flexWrap]);\n if (props.alignSelf !== undefined) classes.push(alignSelfMap[props.alignSelf]);\n if (props.flexGrow !== undefined) classes.push(flexGrowMap[props.flexGrow]);\n if (props.flexShrink !== undefined) classes.push(flexShrinkMap[props.flexShrink]);\n\n return classes.filter(Boolean).join(' ');\n}\n\n/**\n * Converts a StackLayoutProps object into a space-separated Tailwind class string.\n * Handles only the alignItems and justifyContent subset used by Stack (CSS-value\n * aliases for align/justify). Same pattern as resolveLayout but for the Stack\n * alignment subset only.\n *\n * @param props - An object containing StackLayoutProps keys (alignItems, justifyContent).\n * @returns A space-separated Tailwind class string or empty string.\n *\n * @example\n * resolveStackLayout({ alignItems: 'center', justifyContent: 'space-between' })\n * // → 'items-center justify-between'\n */\nexport function resolveStackLayout(props: StackLayoutProps): string {\n const classes: string[] = [];\n\n if (props.alignItems !== undefined) classes.push(alignItemsMap[props.alignItems]);\n if (props.justifyContent !== undefined) classes.push(justifyContentMap[props.justifyContent]);\n\n return classes.filter(Boolean).join(' ');\n}\n\nexport const LAYOUT_PROP_KEYS = new Set<string>([\n 'display',\n 'alignItems',\n 'justifyContent',\n 'flexDirection',\n 'flexWrap',\n 'alignSelf',\n 'flexGr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AAC;AACzF,MAAI,MAAM,aAAa,OAAW,SAAQ,KAAK,YAAY,MAAM,QAAQ,CAAC;AAC1E,MAAI,MAAM,cAAc,OAAW,SAAQ,KAAK,aAAa,MAAM,SAAS,CAAC;AAC7E,MAAI,MAAM,aAAa,OAAW,SAAQ,KAAK,YAAY,MAAM,QAAQ,CAAC;AAC1E,MAAI,MAAM,eAAe,OAAW,SAAQ,KAAK,cAAc,MAAM,UAAU,CAAC;AAEhF,SAAO,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAwBO,MAAM,uCAAuB,IAAY;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;"}
@@ -0,0 +1,60 @@
1
+ import { default as React } from 'react';
2
+ declare const BREAKPOINTS: {
3
+ readonly sm: "600px";
4
+ readonly md: "800px";
5
+ readonly lg: "940px";
6
+ readonly xl: "1440px";
7
+ };
8
+ export type Breakpoint = keyof typeof BREAKPOINTS;
9
+ export { BREAKPOINTS };
10
+ export type ResponsiveValue<T> = T | Partial<Record<'base' | Breakpoint, T>>;
11
+ export declare function isResponsiveObject<T>(val: ResponsiveValue<T>): val is Partial<Record<'base' | Breakpoint, T>>;
12
+ export declare function resolveToken(value: string | undefined): string | undefined;
13
+ export interface SpacingProps {
14
+ p?: ResponsiveValue<string>;
15
+ px?: ResponsiveValue<string>;
16
+ py?: ResponsiveValue<string>;
17
+ pt?: ResponsiveValue<string>;
18
+ pb?: ResponsiveValue<string>;
19
+ pl?: ResponsiveValue<string>;
20
+ pr?: ResponsiveValue<string>;
21
+ m?: ResponsiveValue<string>;
22
+ mx?: ResponsiveValue<string>;
23
+ my?: ResponsiveValue<string>;
24
+ mt?: ResponsiveValue<string>;
25
+ mb?: ResponsiveValue<string>;
26
+ ml?: ResponsiveValue<string>;
27
+ mr?: ResponsiveValue<string>;
28
+ }
29
+ export interface DimensionProps {
30
+ width?: ResponsiveValue<string>;
31
+ height?: ResponsiveValue<string>;
32
+ minWidth?: ResponsiveValue<string>;
33
+ minHeight?: ResponsiveValue<string>;
34
+ maxWidth?: ResponsiveValue<string>;
35
+ maxHeight?: ResponsiveValue<string>;
36
+ }
37
+ export interface LayoutProps {
38
+ display?: ResponsiveValue<'block' | 'flex' | 'grid' | 'inline' | 'inline-flex' | 'inline-block' | 'none'>;
39
+ position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
40
+ flex?: string;
41
+ }
42
+ export type SystemProps = SpacingProps & DimensionProps & LayoutProps;
43
+ export declare const SYSTEM_PROP_KEYS: Set<string>;
44
+ export declare function generateScopeId(cssContent: string, prefix?: string): string;
45
+ export declare function buildMediaCSS(mediaRules: Record<string, Record<string, string>>): string;
46
+ export interface ResolvedStyles {
47
+ baseStyle: React.CSSProperties;
48
+ mediaCSS: string;
49
+ needsId: boolean;
50
+ }
51
+ export declare function resolveSystemProps(props: SystemProps, existingStyle?: React.CSSProperties): ResolvedStyles;
52
+ export interface SystemPropsRenderResult {
53
+ style: React.CSSProperties;
54
+ styleTag: React.ReactNode;
55
+ dataId?: string;
56
+ }
57
+ export declare function renderSystemProps(systemProps: SystemProps, existingStyle?: React.CSSProperties): SystemPropsRenderResult;
58
+ export declare function stripSystemProps<T extends Record<string, unknown>>(props: T): Omit<T, keyof SystemProps>;
59
+ export declare function renderScopedStyle(mediaCSS: string, scopeId: string): React.ReactNode;
60
+ //# sourceMappingURL=responsive-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsive-props.d.ts","sourceRoot":"","sources":["../../src/utils/responsive-props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,QAAA,MAAM,WAAW;;;;;CAKP,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,WAAW,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,CAAC;AAMvB,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CA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AAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,EACxB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,GAClC,uBAAuB,CAmBzB;AAMD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,KAAK,EAAE,CAAC,GACP,IAAI,CAAC,CAAC,EAAE,MAAM,WAAW,CAAC,CAM5B;AAMD,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,KAAK,CAAC,SAAS,CAKjB"}
@@ -0,0 +1,184 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const BREAKPOINTS = {
3
+ sm: "600px",
4
+ md: "800px",
5
+ lg: "940px",
6
+ xl: "1440px"
7
+ };
8
+ function isResponsiveObject(val) {
9
+ return typeof val === "object" && val !== null && !Array.isArray(val);
10
+ }
11
+ function resolveToken(value) {
12
+ if (value === void 0) return void 0;
13
+ return value.startsWith("space-") ? `var(--${value})` : value;
14
+ }
15
+ const SPACING_MAP = {
16
+ p: "padding",
17
+ px: ["paddingLeft", "paddingRight"],
18
+ py: ["paddingTop", "paddingBottom"],
19
+ pt: "paddingTop",
20
+ pb: "paddingBottom",
21
+ pl: "paddingLeft",
22
+ pr: "paddingRight",
23
+ m: "margin",
24
+ mx: ["marginLeft", "marginRight"],
25
+ my: ["marginTop", "marginBottom"],
26
+ mt: "marginTop",
27
+ mb: "marginBottom",
28
+ ml: "marginLeft",
29
+ mr: "marginRight"
30
+ };
31
+ const DIMENSION_MAP = {
32
+ width: "width",
33
+ height: "height",
34
+ minWidth: "minWidth",
35
+ minHeight: "minHeight",
36
+ maxWidth: "maxWidth",
37
+ maxHeight: "maxHeight"
38
+ };
39
+ const ALL_MAPPINGS = { ...SPACING_MAP, ...DIMENSION_MAP };
40
+ const SYSTEM_PROP_KEYS = /* @__PURE__ */ new Set([
41
+ ...Object.keys(SPACING_MAP),
42
+ ...Object.keys(DIMENSION_MAP),
43
+ "display",
44
+ "position",
45
+ "flex"
46
+ ]);
47
+ function hashString(str) {
48
+ let h = 2166136261;
49
+ for (let i = 0; i < str.length; i++) {
50
+ h ^= str.charCodeAt(i);
51
+ h = Math.imul(h, 16777619);
52
+ }
53
+ return (h >>> 0).toString(36);
54
+ }
55
+ function generateScopeId(cssContent, prefix = "jds") {
56
+ return `${prefix}${hashString(cssContent)}`;
57
+ }
58
+ function assignCss(target, cssProp, value) {
59
+ const resolved = resolveToken(value) ?? value;
60
+ if (Array.isArray(cssProp)) {
61
+ for (const p of cssProp) {
62
+ target[p] = resolved;
63
+ }
64
+ } else {
65
+ target[cssProp] = resolved;
66
+ }
67
+ }
68
+ function camelToKebab(str) {
69
+ return str.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
70
+ }
71
+ const ORDERED_BREAKPOINTS = ["sm", "md", "lg", "xl"];
72
+ function buildMediaCSS(mediaRules) {
73
+ let css = "";
74
+ for (const bp of ORDERED_BREAKPOINTS) {
75
+ const rules = mediaRules[bp];
76
+ if (!rules) continue;
77
+ const declarations = Object.entries(rules).map(([prop, val]) => `${prop}:${val} !important`).join(";");
78
+ css += `@media(min-width:${BREAKPOINTS[bp]}){__SEL__{${declarations}}}`;
79
+ }
80
+ return css;
81
+ }
82
+ function resolveSystemProps(props, existingStyle) {
83
+ const base = {};
84
+ const mediaRules = {};
85
+ let needsId = false;
86
+ for (const [propName, mapping] of Object.entries(ALL_MAPPINGS)) {
87
+ const value = props[propName];
88
+ if (value === void 0) continue;
89
+ if (isResponsiveObject(value)) {
90
+ needsId = true;
91
+ for (const [bp, val] of Object.entries(value)) {
92
+ if (val === void 0) continue;
93
+ if (bp === "base") {
94
+ assignCss(base, mapping, val);
95
+ } else {
96
+ if (!mediaRules[bp]) mediaRules[bp] = {};
97
+ assignCss(mediaRules[bp], mapping, val);
98
+ }
99
+ }
100
+ } else {
101
+ assignCss(base, mapping, value);
102
+ }
103
+ }
104
+ if (props.display !== void 0) {
105
+ if (isResponsiveObject(props.display)) {
106
+ needsId = true;
107
+ for (const [bp, val] of Object.entries(props.display)) {
108
+ if (val === void 0) continue;
109
+ if (bp === "base") {
110
+ base.display = val;
111
+ } else {
112
+ if (!mediaRules[bp]) mediaRules[bp] = {};
113
+ mediaRules[bp].display = val;
114
+ }
115
+ }
116
+ } else {
117
+ base.display = props.display;
118
+ }
119
+ }
120
+ if (props.position !== void 0) {
121
+ base.position = props.position;
122
+ }
123
+ if (props.flex !== void 0) {
124
+ base.flex = props.flex;
125
+ }
126
+ const mediaCSS = buildMediaCSS(
127
+ Object.fromEntries(
128
+ Object.entries(mediaRules).map(([bp, rules]) => [
129
+ bp,
130
+ Object.fromEntries(
131
+ Object.entries(rules).map(([prop, val]) => [camelToKebab(prop), val])
132
+ )
133
+ ])
134
+ )
135
+ );
136
+ const baseStyle = {
137
+ ...base,
138
+ ...existingStyle
139
+ };
140
+ return { baseStyle, mediaCSS, needsId };
141
+ }
142
+ function renderSystemProps(systemProps, existingStyle) {
143
+ const { baseStyle, mediaCSS, needsId } = resolveSystemProps(
144
+ systemProps,
145
+ existingStyle
146
+ );
147
+ if (!needsId || !mediaCSS) {
148
+ return { style: baseStyle, styleTag: null };
149
+ }
150
+ const scopeId = generateScopeId(mediaCSS);
151
+ const selector = `[data-jds="${scopeId}"]`;
152
+ const scoped = mediaCSS.replace(/__SEL__/g, selector);
153
+ return {
154
+ style: baseStyle,
155
+ styleTag: /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: scoped } }),
156
+ dataId: scopeId
157
+ };
158
+ }
159
+ function stripSystemProps(props) {
160
+ const result = { ...props };
161
+ for (const key of SYSTEM_PROP_KEYS) {
162
+ delete result[key];
163
+ }
164
+ return result;
165
+ }
166
+ function renderScopedStyle(mediaCSS, scopeId) {
167
+ if (!mediaCSS) return null;
168
+ const selector = `[data-jds="${scopeId}"]`;
169
+ const scoped = mediaCSS.replace(/__SEL__/g, selector);
170
+ return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: scoped } });
171
+ }
172
+ export {
173
+ BREAKPOINTS,
174
+ SYSTEM_PROP_KEYS,
175
+ buildMediaCSS,
176
+ generateScopeId,
177
+ isResponsiveObject,
178
+ renderScopedStyle,
179
+ renderSystemProps,
180
+ resolveSystemProps,
181
+ resolveToken,
182
+ stripSystemProps
183
+ };
184
+ //# sourceMappingURL=responsive-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsive-props.js","sources":["../../src/utils/responsive-props.tsx"],"sourcesContent":["import React from 'react';\n\n// ---------------------------------------------------------------------------\n// Breakpoints — must match the plugin's `screens` config\n// ---------------------------------------------------------------------------\n\nconst BREAKPOINTS = {\n sm: '600px',\n md: '800px',\n lg: '940px',\n xl: '1440px',\n} as const;\n\nexport type Breakpoint = keyof typeof BREAKPOINTS;\nexport { BREAKPOINTS };\n\n// ---------------------------------------------------------------------------\n// Responsive value type\n// ---------------------------------------------------------------------------\n\nexport type ResponsiveValue<T> = T | Partial<Record<'base' | Breakpoint, T>>;\n\nexport function isResponsiveObject<T>(val: ResponsiveValue<T>): val is Partial<Record<'base' | Breakpoint, T>> {\n return typeof val === 'object' && val !== null && !Array.isArray(val);\n}\n\n// ---------------------------------------------------------------------------\n// Token resolution\n// ---------------------------------------------------------------------------\n\nexport function resolveToken(value: string | undefined): string | undefined {\n if (value === undefined) return undefined;\n return value.startsWith('space-') ? `var(--${value})` : value;\n}\n\n// ---------------------------------------------------------------------------\n// System prop definitions — maps prop names to CSS properties\n// ---------------------------------------------------------------------------\n\ntype CSSPropMapping = Record<string, string | string[]>;\n\nconst SPACING_MAP: CSSPropMapping = {\n p: 'padding',\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n pt: 'paddingTop',\n pb: 'paddingBottom',\n pl: 'paddingLeft',\n pr: 'paddingRight',\n m: 'margin',\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n mt: 'marginTop',\n mb: 'marginBottom',\n ml: 'marginLeft',\n mr: 'marginRight',\n};\n\nconst DIMENSION_MAP: CSSPropMapping = {\n width: 'width',\n height: 'height',\n minWidth: 'minWidth',\n minHeight: 'minHeight',\n maxWidth: 'maxWidth',\n maxHeight: 'maxHeight',\n};\n\nconst ALL_MAPPINGS: CSSPropMapping = { ...SPACING_MAP, ...DIMENSION_MAP };\n\n// ---------------------------------------------------------------------------\n// Spacing prop types\n// ---------------------------------------------------------------------------\n\nexport interface SpacingProps {\n p?: ResponsiveValue<string>;\n px?: ResponsiveValue<string>;\n py?: ResponsiveValue<string>;\n pt?: ResponsiveValue<string>;\n pb?: ResponsiveValue<string>;\n pl?: ResponsiveValue<string>;\n pr?: ResponsiveValue<string>;\n m?: ResponsiveValue<string>;\n mx?: ResponsiveValue<string>;\n my?: ResponsiveValue<string>;\n mt?: ResponsiveValue<string>;\n mb?: ResponsiveValue<string>;\n ml?: ResponsiveValue<string>;\n mr?: ResponsiveValue<string>;\n}\n\nexport interface DimensionProps {\n width?: ResponsiveValue<string>;\n height?: ResponsiveValue<string>;\n minWidth?: ResponsiveValue<string>;\n minHeight?: ResponsiveValue<string>;\n maxWidth?: ResponsiveValue<string>;\n maxHeight?: ResponsiveValue<string>;\n}\n\nexport interface LayoutProps {\n display?: ResponsiveValue<\n 'block' | 'flex' | 'grid' | 'inline' | 'inline-flex' | 'inline-block' | 'none'\n >;\n position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';\n flex?: string;\n}\n\nexport type SystemProps = SpacingProps & DimensionProps & LayoutProps;\n\nexport const SYSTEM_PROP_KEYS = new Set<string>([\n ...Object.keys(SPACING_MAP),\n ...Object.keys(DIMENSION_MAP),\n 'display',\n 'position',\n 'flex',\n]);\n\n// ---------------------------------------------------------------------------\n// Scoped ID generation — deterministic content-hash, SSR-safe\n// ---------------------------------------------------------------------------\n\nfunction hashString(str: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < str.length; i++) {\n h ^= str.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return (h >>> 0).toString(36);\n}\n\nexport function generateScopeId(cssContent: string, prefix = 'jds'): string {\n return `${prefix}${hashString(cssContent)}`;\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction assignCss(\n target: Record<string, string>,\n cssProp: string | string[],\n value: string,\n) {\n const resolved = resolveToken(value) ?? value;\n if (Array.isArray(cssProp)) {\n for (const p of cssProp) {\n target[p] = resolved;\n }\n } else {\n target[cssProp] = resolved;\n }\n}\n\nfunction camelToKebab(str: string): string {\n return str.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);\n}\n\n// ---------------------------------------------------------------------------\n// Ordered breakpoints for consistent media query output\n// ---------------------------------------------------------------------------\n\nconst ORDERED_BREAKPOINTS: Breakpoint[] = ['sm', 'md', 'lg', 'xl'];\n\nexport function buildMediaCSS(\n mediaRules: Record<string, Record<string, string>>,\n): string {\n let css = '';\n for (const bp of ORDERED_BREAKPOINTS) {\n const rules = mediaRules[bp];\n if (!rules) continue;\n const declarations = Object.entries(rules)\n .map(([prop, val]) => `${prop}:${val} !important`)\n .join(';');\n css += `@media(min-width:${BREAKPOINTS[bp]}){__SEL__{${declarations}}}`;\n }\n return css;\n}\n\n// ---------------------------------------------------------------------------\n// Core: resolve system props into base styles + media-query CSS (pure function)\n// ---------------------------------------------------------------------------\n\nexport interface ResolvedStyles {\n baseStyle: React.CSSProperties;\n mediaCSS: string;\n needsId: boolean;\n}\n\nexport function resolveSystemProps(\n props: SystemProps,\n existingStyle?: React.CSSProperties,\n): ResolvedStyles {\n const base: Record<string, string> = {};\n const mediaRules: Record<string, Record<string, string>> = {};\n let needsId = false;\n\n for (const [propName, mapping] of Object.entries(ALL_MAPPINGS)) {\n const value = (props as Record<string, unknown>)[propName] as\n | ResponsiveValue<string>\n | undefined;\n if (value === undefined) continue;\n\n if (isResponsiveObject(value)) {\n needsId = true;\n for (const [bp, val] of Object.entries(value)) {\n if (val === undefined) continue;\n if (bp === 'base') {\n assignCss(base, mapping, val);\n } else {\n if (!mediaRules[bp]) mediaRules[bp] = {};\n assignCss(mediaRules[bp], mapping, val);\n }\n }\n } else {\n assignCss(base, mapping, value);\n }\n }\n\n if (props.display !== undefined) {\n if (isResponsiveObject(props.display)) {\n needsId = true;\n for (const [bp, val] of Object.entries(props.display)) {\n if (val === undefined) continue;\n if (bp === 'base') {\n base.display = val;\n } else {\n if (!mediaRules[bp]) mediaRules[bp] = {};\n mediaRules[bp].display = val;\n }\n }\n } else {\n base.display = props.display;\n }\n }\n\n if (props.position !== undefined) {\n base.position = props.position;\n }\n if (props.flex !== undefined) {\n base.flex = props.flex;\n }\n\n const mediaCSS = buildMediaCSS(\n Object.fromEntries(\n Object.entries(mediaRules).map(([bp, rules]) => [\n bp,\n Object.fromEntries(\n Object.entries(rules).map(([prop, val]) => [camelToKebab(prop), val]),\n ),\n ]),\n ),\n );\n\n const baseStyle: React.CSSProperties = {\n ...(base as unknown as React.CSSProperties),\n ...existingStyle,\n };\n\n return { baseStyle, mediaCSS, needsId };\n}\n\n// ---------------------------------------------------------------------------\n// renderSystemProps — returns everything needed to render a system-prop element\n// Pure function, no hooks. SSR-safe.\n// ---------------------------------------------------------------------------\n\nexport interface SystemPropsRenderResult {\n style: React.CSSProperties;\n styleTag: React.ReactNode;\n dataId?: string;\n}\n\nexport function renderSystemProps(\n systemProps: SystemProps,\n existingStyle?: React.CSSProperties,\n): SystemPropsRenderResult {\n const { baseStyle, mediaCSS, needsId } = resolveSystemProps(\n systemProps,\n existingStyle,\n );\n\n if (!needsId || !mediaCSS) {\n return { style: baseStyle, styleTag: null };\n }\n\n const scopeId = generateScopeId(mediaCSS);\n const selector = `[data-jds=\"${scopeId}\"]`;\n const scoped = mediaCSS.replace(/__SEL__/g, selector);\n\n return {\n style: baseStyle,\n styleTag: <style dangerouslySetInnerHTML={{ __html: scoped }} />,\n dataId: scopeId,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Utility: strip system props from a rest-props object\n// ---------------------------------------------------------------------------\n\nexport function stripSystemProps<T extends Record<string, unknown>>(\n props: T,\n): Omit<T, keyof SystemProps> {\n const result = { ...props };\n for (const key of SYSTEM_PROP_KEYS) {\n delete result[key];\n }\n return result as Omit<T, keyof SystemProps>;\n}\n\n// ---------------------------------------------------------------------------\n// Utility: scope and render media CSS as a <style> tag\n// ---------------------------------------------------------------------------\n\nexport function renderScopedStyle(\n mediaCSS: string,\n scopeId: string,\n): React.ReactNode {\n if (!mediaCSS) return null;\n const selector = `[data-jds=\"${scopeId}\"]`;\n const scoped = mediaCSS.replace(/__SEL__/g, selector);\n return <style dangerouslySetInnerHTML={{ __html: scoped }} />;\n}\n"],"names":[],"mappings":";AAMA,MAAM,cAAc;AAAA,EAClB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAWO,SAAS,mBAAsB,KAAyE;AAC7G,SAAO,OAAO,QAAQ,YAAY,QAAQ,QAAQ,CAAC,MAAM,QAAQ,GAAG;AACtE;AAMO,SAAS,aAAa,OAA+C;AAC1E,MAAI,UAAU,OAAW,QAAO;AAChC,SAAO,MAAM,WAAW,QAAQ,IAAI,SAAS,KAAK,MAAM;AAC1D;AAQA,MAAM,cAA8B;AAAA,EAClC,GAAG;AAAA,EACH,IAAI,CAAC,eAAe,cAAc;AAAA,EAClC,IAAI,CAAC,cAAc,eAAe;AAAA,EAClC,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,GAAG;AAAA,EACH,IAAI,CAAC,cAAc,aAAa;AAAA,EAChC,IAAI,CAAC,aAAa,cAAc;AAAA,EAChC,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,gBAAgC;AAAA,EACpC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AAAA,EAC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ap: Record<SpacingToken, string>;
3
+ export declare const pxMap: Record<SpacingToken, string>;
4
+ export declare const pyMap: Record<SpacingToken, string>;
5
+ export declare const ptMap: Record<SpacingToken, string>;
6
+ export declare const pbMap: Record<SpacingToken, string>;
7
+ export declare const plMap: Record<SpacingToken, string>;
8
+ export declare const prMap: Record<SpacingToken, string>;
9
+ export declare const mMap: Record<MarginToken, string>;
10
+ export declare const mxMap: Record<MarginToken, string>;
11
+ export declare const myMap: Record<MarginToken, string>;
12
+ export declare const mtMap: Record<MarginToken, string>;
13
+ export declare const mbMap: Record<MarginToken, string>;
14
+ export declare const mlMap: Record<MarginToken, string>;
15
+ export declare const mrMap: Record<MarginToken, string>;
16
+ export declare const gapMap: Record<SpacingToken, string>;
17
+ export declare const rowGapMap: Record<SpacingToken, string>;
18
+ export declare const colGapMap: Record<SpacingToken, string>;
19
+ /** Shorthand values for Stack's align prop (cross-axis alignment). */
20
+ export type StackAlign = 'start' | 'center' | 'end' | 'stretch';
21
+ /** Shorthand values for Stack's justify prop (main-axis distribution). */
22
+ export type StackJustify = 'start' | 'center' | 'end' | 'between' | 'around';
23
+ export declare const alignMap: Record<StackAlign, string>;
24
+ export declare const justifyMap: Record<StackJustify, string>;
25
+ export declare const SPACING_PROP_KEYS: (keyof SpacingProps)[];
26
+ /**
27
+ * Converts a SpacingProps (and optional GapProps) object into a space-separated
28
+ * string of Tailwind utility classes. Each prop value (a SpacingToken string)
29
+ * is looked up in a static class map and resolved to the corresponding Tailwind
30
+ * utility class generated by jiwambe-plugin's spacing theme extension.
31
+ *
32
+ * Returns an empty string if no spacing props are provided. Safe to pass
33
+ * directly to a className prop.
34
+ *
35
+ * @param props - An object containing any SpacingProps or GapProps keys.
36
+ * Non-spacing keys are ignored.
37
+ * @returns A space-separated Tailwind class string or empty string.
38
+ *
39
+ * @example
40
+ * resolveSpacing({ p: 'space-4', mt: 'space-8' })
41
+ * // → 'p-space-4 mt-space-8'
42
+ *
43
+ * @example
44
+ * resolveSpacing({ px: 'fluid-4-9', mx: 'auto' })
45
+ * // → 'px-fluid-4-9 mx-auto'
46
+ *
47
+ * @example
48
+ * resolveSpacing({})
49
+ * // → ''
50
+ */
51
+ export declare function resolveSpacing(props: SpacingProps & Partial<GapProps>): string;
52
+ //# sourceMappingURL=spacing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spacing.d.ts","sourceRoot":"","sources":["../../src/utils/spacing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAM1F,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CA+B7C,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CA+B9C,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CA+B9C,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CA+B9C,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CA+B9C,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CA+B9C,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CA+B9C,CAAC;AAMF,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAgC5C,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAgC7C,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAgC7C,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAgC7C,CAAC;AAEF,eAAO,MAAM,KAAK,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