@flikk/ui 1.0.0-beta.27 → 1.0.0-beta.29

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 (319) hide show
  1. package/dist/bg/1.webp +0 -0
  2. package/dist/bg/10.webp +0 -0
  3. package/dist/bg/11.webp +0 -0
  4. package/dist/bg/12.webp +0 -0
  5. package/dist/bg/13.webp +0 -0
  6. package/dist/bg/14.webp +0 -0
  7. package/dist/bg/15.webp +0 -0
  8. package/dist/bg/16.webp +0 -0
  9. package/dist/bg/17.webp +0 -0
  10. package/dist/bg/18.webp +0 -0
  11. package/dist/bg/19.webp +0 -0
  12. package/dist/bg/2.webp +0 -0
  13. package/dist/bg/20.webp +0 -0
  14. package/dist/bg/21.webp +0 -0
  15. package/dist/bg/22.webp +0 -0
  16. package/dist/bg/3.webp +0 -0
  17. package/dist/bg/4.webp +0 -0
  18. package/dist/bg/5.webp +0 -0
  19. package/dist/bg/6.webp +0 -0
  20. package/dist/bg/7.webp +0 -0
  21. package/dist/bg/8.webp +0 -0
  22. package/dist/bg/9.webp +0 -0
  23. package/dist/components/ai/CodeBlock/CodeBlock.theme.js +1 -1
  24. package/dist/components/ai/PromptInput/PromptInput.js +7 -143
  25. package/dist/components/ai/PromptInput/VoiceRecorder.js +0 -88
  26. package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
  27. package/dist/components/canvas/Background.d.ts +19 -0
  28. package/dist/components/canvas/Background.js +23 -0
  29. package/dist/components/canvas/BaseNode.d.ts +15 -0
  30. package/dist/components/canvas/BaseNode.js +20 -0
  31. package/dist/components/canvas/CanvasToolbar.d.ts +34 -0
  32. package/dist/components/canvas/CanvasToolbar.js +34 -0
  33. package/dist/components/canvas/Edge.d.ts +35 -0
  34. package/dist/components/canvas/Edge.js +97 -0
  35. package/dist/components/canvas/EdgeLayer.d.ts +18 -0
  36. package/dist/components/canvas/EdgeLayer.js +111 -0
  37. package/dist/components/canvas/Handle.d.ts +11 -0
  38. package/dist/components/canvas/Handle.js +63 -0
  39. package/dist/components/canvas/MiniMap.d.ts +22 -0
  40. package/dist/components/canvas/MiniMap.js +105 -0
  41. package/dist/components/canvas/NodeCanvas.d.ts +10 -0
  42. package/dist/components/canvas/NodeCanvas.js +477 -0
  43. package/dist/components/canvas/NodeCanvas.theme.d.ts +7 -0
  44. package/dist/components/canvas/NodeCanvas.theme.js +9 -0
  45. package/dist/components/canvas/NodeCanvas.types.d.ts +187 -0
  46. package/dist/components/canvas/NodeControls.d.ts +25 -0
  47. package/dist/components/canvas/NodeControls.js +40 -0
  48. package/dist/components/canvas/NodeRenderer.d.ts +19 -0
  49. package/dist/components/canvas/NodeRenderer.js +117 -0
  50. package/dist/components/canvas/changes.d.ts +11 -0
  51. package/dist/components/canvas/changes.js +76 -0
  52. package/dist/components/canvas/context/CanvasContext.d.ts +32 -0
  53. package/dist/components/canvas/context/CanvasContext.js +14 -0
  54. package/dist/components/canvas/context/ConnectionContext.d.ts +33 -0
  55. package/dist/components/canvas/context/ConnectionContext.js +13 -0
  56. package/dist/components/canvas/context/HandleRegistry.d.ts +24 -0
  57. package/dist/components/canvas/context/HandleRegistry.js +15 -0
  58. package/dist/components/canvas/context/InteractionContext.d.ts +18 -0
  59. package/dist/components/canvas/context/InteractionContext.js +14 -0
  60. package/dist/components/canvas/context/NodeIdContext.d.ts +3 -0
  61. package/dist/components/canvas/context/NodeIdContext.js +15 -0
  62. package/dist/components/canvas/hooks/useConnection.d.ts +17 -0
  63. package/dist/components/canvas/hooks/useConnection.js +29 -0
  64. package/dist/components/canvas/hooks/useMarquee.d.ts +25 -0
  65. package/dist/components/canvas/hooks/useMarquee.js +91 -0
  66. package/dist/components/canvas/hooks/useNodeDrag.d.ts +23 -0
  67. package/dist/components/canvas/hooks/useNodeDrag.js +110 -0
  68. package/dist/components/canvas/hooks/usePanZoom.d.ts +30 -0
  69. package/dist/components/canvas/hooks/usePanZoom.js +189 -0
  70. package/dist/components/canvas/hooks/useViewport.d.ts +21 -0
  71. package/dist/components/canvas/hooks/useViewport.js +35 -0
  72. package/dist/components/canvas/index.d.ts +14 -0
  73. package/dist/components/canvas/index.js +12 -0
  74. package/dist/components/canvas/layout.d.ts +22 -0
  75. package/dist/components/canvas/layout.js +67 -0
  76. package/dist/components/canvas/utils.d.ts +4 -0
  77. package/dist/components/canvas/utils.js +16 -0
  78. package/dist/components/charts/AreaChart/AreaChart.js +136 -101
  79. package/dist/components/charts/AreaChart/AreaChart.types.d.ts +5 -5
  80. package/dist/components/charts/AreaChart/AreaChart.types.js +1 -0
  81. package/dist/components/charts/BarChart/BarChart.js +207 -143
  82. package/dist/components/charts/BarChart/BarChart.types.d.ts +4 -4
  83. package/dist/components/charts/BarChart/BarChart.types.js +1 -0
  84. package/dist/components/charts/ComboChart/ComboChart.types.d.ts +2 -2
  85. package/dist/components/charts/LineChart/LineChart.js +88 -72
  86. package/dist/components/charts/LineChart/LineChart.types.d.ts +3 -3
  87. package/dist/components/charts/RadarChart/RadarChart.js +1 -1
  88. package/dist/components/charts/RadarChart/RadarChart.theme.js +5 -2
  89. package/dist/components/charts/ScatterPlot/ScatterPlot.js +62 -72
  90. package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +10 -1
  91. package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +3 -9
  92. package/dist/components/charts/StackedBarChart/StackedBarChart.js +33 -33
  93. package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +2 -2
  94. package/dist/components/charts/hooks/index.d.ts +2 -0
  95. package/dist/components/charts/hooks/useChartDimensions.d.ts +29 -0
  96. package/dist/components/charts/hooks/useChartDimensions.js +42 -0
  97. package/dist/components/charts/shared/ChartTooltip/ChartTooltip.theme.js +1 -1
  98. package/dist/components/charts/types/chart.types.d.ts +11 -2
  99. package/dist/components/charts/types/chart.types.js +10 -3
  100. package/dist/components/core/Avatar/Avatar.js +5 -1
  101. package/dist/components/core/AvatarGroup/AvatarGroup.js +5 -1
  102. package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +4 -2
  103. package/dist/components/core/Badge/Badge.js +1 -1
  104. package/dist/components/core/Badge/Badge.theme.js +16 -15
  105. package/dist/components/core/Button/Button.js +1 -1
  106. package/dist/components/core/Button/Button.theme.js +2 -2
  107. package/dist/components/core/Calendar/Calendar.theme.js +1 -1
  108. package/dist/components/core/Card/Card.js +7 -3
  109. package/dist/components/core/Card/Card.theme.js +3 -3
  110. package/dist/components/core/Card/Card.types.d.ts +27 -2
  111. package/dist/components/core/CommandPalette/CommandPalette.theme.js +2 -2
  112. package/dist/components/core/ContextMenu/ContextMenu.theme.js +2 -2
  113. package/dist/components/core/ContextMenu/ContextMenuItem.js +1 -1
  114. package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +1 -1
  115. package/dist/components/core/Dropdown/Dropdown.theme.js +3 -3
  116. package/dist/components/core/Dropdown/DropdownMenu.js +57 -29
  117. package/dist/components/core/HeroCard/HeroCard.d.ts +5 -0
  118. package/dist/components/core/HeroCard/HeroCard.js +99 -0
  119. package/dist/components/core/HeroCard/HeroCard.theme.d.ts +3 -0
  120. package/dist/components/core/HeroCard/HeroCard.theme.js +8 -0
  121. package/dist/components/core/HeroCard/HeroCard.types.d.ts +70 -0
  122. package/dist/components/core/HeroCard/index.d.ts +4 -0
  123. package/dist/components/core/Kbd/Kbd.theme.js +1 -1
  124. package/dist/components/core/Modal/Modal.d.ts +1 -1
  125. package/dist/components/core/Modal/Modal.js +2 -7
  126. package/dist/components/core/Modal/Modal.theme.js +4 -8
  127. package/dist/components/core/Modal/Modal.types.d.ts +0 -10
  128. package/dist/components/core/Modal/index.d.ts +1 -1
  129. package/dist/components/core/ModalStack/ModalStack.d.ts +1 -1
  130. package/dist/components/core/ModalStack/ModalStack.types.d.ts +1 -2
  131. package/dist/components/core/ModalStack/ModalStackModal.d.ts +1 -1
  132. package/dist/components/core/ModalStack/ModalStackModal.js +2 -7
  133. package/dist/components/core/PageHeading/PageHeading.theme.js +2 -2
  134. package/dist/components/core/Popover/Popover.theme.js +1 -1
  135. package/dist/components/core/ScrollArea/ScrollArea.js +242 -4
  136. package/dist/components/core/ScrollArea/ScrollArea.types.d.ts +12 -1
  137. package/dist/components/core/ScrollArea/smooth/SmoothScrollEngine.d.ts +4 -0
  138. package/dist/components/core/ScrollArea/smooth/SmoothScrollEngine.js +23 -0
  139. package/dist/components/core/ScrollArea/smooth/useSmoothScroll.js +4 -0
  140. package/dist/components/core/ScrollArea/smooth/useSmoothScroll.types.d.ts +5 -0
  141. package/dist/components/core/Segmented/Segmented.theme.js +2 -2
  142. package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
  143. package/dist/components/core/index.d.ts +1 -0
  144. package/dist/components/core/index.js +2 -0
  145. package/dist/components/data-display/DescriptionList/DescriptionList.js +23 -7
  146. package/dist/components/data-display/DescriptionList/DescriptionList.theme.js +10 -3
  147. package/dist/components/data-display/DescriptionList/DescriptionList.types.d.ts +49 -10
  148. package/dist/components/data-display/DescriptionList/index.d.ts +1 -1
  149. package/dist/components/data-display/Feed/Feed.js +28 -5
  150. package/dist/components/data-display/Feed/Feed.theme.js +1 -1
  151. package/dist/components/data-display/Feed/Feed.types.d.ts +32 -1
  152. package/dist/components/data-display/Feed/index.d.ts +1 -1
  153. package/dist/components/data-display/Metric/Metric.js +8 -8
  154. package/dist/components/data-display/Metric/Metric.theme.d.ts +3 -2
  155. package/dist/components/data-display/Metric/Metric.theme.js +50 -68
  156. package/dist/components/data-display/Metric/Metric.types.d.ts +19 -21
  157. package/dist/components/data-display/Table/Table.js +2 -2
  158. package/dist/components/data-display/Table/Table.theme.js +24 -4
  159. package/dist/components/data-display/Table/Table.types.d.ts +8 -0
  160. package/dist/components/data-display/Table/TableBody.js +2 -2
  161. package/dist/components/data-display/Table/TableCell.js +1 -1
  162. package/dist/components/data-display/Table/TableRow.d.ts +1 -1
  163. package/dist/components/data-display/Table/TableRow.js +9 -2
  164. package/dist/components/data-display/Timeline/Timeline.js +27 -5
  165. package/dist/components/data-display/Timeline/Timeline.theme.d.ts +10 -2
  166. package/dist/components/data-display/Timeline/Timeline.theme.js +14 -8
  167. package/dist/components/data-display/Timeline/Timeline.types.d.ts +48 -16
  168. package/dist/components/data-display/Timeline/Timeline.utils.d.ts +6 -0
  169. package/dist/components/data-display/Timeline/Timeline.utils.js +11 -0
  170. package/dist/components/data-display/Timeline/TimelineItem.js +13 -20
  171. package/dist/components/data-display/Timeline/TimelineMarker.js +10 -8
  172. package/dist/components/data-display/Timeline/index.d.ts +2 -2
  173. package/dist/components/effects/3d/index.d.ts +0 -2
  174. package/dist/components/effects/3d/index.js +0 -1
  175. package/dist/components/effects/DotPattern/DotPattern.js +1 -1
  176. package/dist/components/effects/Overlay/Overlay.theme.js +1 -2
  177. package/dist/components/effects/Preloader/Preloader.animations.d.ts +23 -0
  178. package/dist/components/effects/Preloader/Preloader.animations.js +150 -0
  179. package/dist/components/effects/Preloader/Preloader.d.ts +3 -0
  180. package/dist/components/effects/Preloader/Preloader.js +119 -0
  181. package/dist/components/effects/Preloader/Preloader.types.d.ts +63 -0
  182. package/dist/components/effects/Preloader/index.d.ts +2 -0
  183. package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.js +25 -14
  184. package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.types.d.ts +2 -0
  185. package/dist/components/effects/TiltCard/TiltCard.d.ts +12 -0
  186. package/dist/components/effects/TiltCard/TiltCard.glow.d.ts +28 -0
  187. package/dist/components/effects/TiltCard/TiltCard.glow.js +114 -0
  188. package/dist/components/effects/TiltCard/TiltCard.js +177 -0
  189. package/dist/components/effects/{SpotlightBorder/SpotlightBorder.shaders.d.ts → TiltCard/TiltCard.shaders.d.ts} +1 -1
  190. package/dist/components/effects/{SpotlightBorder/SpotlightBorder.shaders.js → TiltCard/TiltCard.shaders.js} +1 -1
  191. package/dist/components/effects/TiltCard/TiltCard.types.d.ts +88 -0
  192. package/dist/components/effects/TiltCard/index.d.ts +2 -0
  193. package/dist/components/effects/index.d.ts +4 -12
  194. package/dist/components/effects/index.js +2 -6
  195. package/dist/components/forms/Checkbox/Checkbox.js +7 -1
  196. package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
  197. package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +1 -1
  198. package/dist/components/forms/FileUpload/FileUpload.js +1 -89
  199. package/dist/components/forms/FormLabel/FormLabel.theme.js +1 -1
  200. package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +2 -2
  201. package/dist/components/forms/Slider/Slider.theme.js +1 -1
  202. package/dist/components/forms/Switch/Switch.js +27 -15
  203. package/dist/components/forms/Switch/Switch.theme.d.ts +36 -6
  204. package/dist/components/forms/Switch/Switch.theme.js +33 -4
  205. package/dist/components/forms/Switch/Switch.types.d.ts +12 -2
  206. package/dist/components/forms/TimePicker/TimePicker.theme.js +1 -2
  207. package/dist/components/forms/TimePicker/TimePickerContent.js +1 -90
  208. package/dist/components/forms/forms.theme.js +1 -1
  209. package/dist/components/forms/index.d.ts +0 -4
  210. package/dist/components/forms/index.js +0 -92
  211. package/dist/components/generative/GenerativeView.d.ts +21 -0
  212. package/dist/components/generative/GenerativeView.js +116 -0
  213. package/dist/components/generative/actions.d.ts +26 -0
  214. package/dist/components/generative/actions.js +51 -0
  215. package/dist/components/generative/index.d.ts +11 -0
  216. package/dist/components/generative/index.js +9 -0
  217. package/dist/components/generative/registry.d.ts +43 -0
  218. package/dist/components/generative/registry.js +114 -0
  219. package/dist/components/generative/resolvers.d.ts +35 -0
  220. package/dist/components/generative/resolvers.js +93 -0
  221. package/dist/components/generative/schema.generated.d.ts +2 -0
  222. package/dist/components/generative/schema.generated.js +1639 -0
  223. package/dist/components/generative/schemaTypes.d.ts +30 -0
  224. package/dist/components/generative/streaming.d.ts +39 -0
  225. package/dist/components/generative/streaming.js +283 -0
  226. package/dist/components/generative/tools.d.ts +21 -0
  227. package/dist/components/generative/tools.js +54 -0
  228. package/dist/components/generative/types.d.ts +41 -0
  229. package/dist/components/generative/useGenerativeStream.d.ts +37 -0
  230. package/dist/components/generative/useGenerativeStream.js +36 -0
  231. package/dist/components/generative/validate.d.ts +24 -0
  232. package/dist/components/generative/validate.js +259 -0
  233. package/dist/components/layout/AppShell/AppShell.theme.js +2 -2
  234. package/dist/components/layout/FormLayout/FormLayout.js +1 -90
  235. package/dist/components/layout/Grid/Grid.d.ts +3 -0
  236. package/dist/components/layout/Grid/Grid.js +50 -0
  237. package/dist/components/layout/Grid/Grid.theme.d.ts +2 -0
  238. package/dist/components/layout/Grid/Grid.theme.js +35 -0
  239. package/dist/components/layout/Grid/Grid.types.d.ts +57 -0
  240. package/dist/components/layout/Grid/index.d.ts +3 -0
  241. package/dist/components/layout/Section/Section.d.ts +3 -0
  242. package/dist/components/layout/Section/Section.js +18 -0
  243. package/dist/components/layout/Section/Section.theme.d.ts +2 -0
  244. package/dist/components/layout/Section/Section.theme.js +10 -0
  245. package/dist/components/layout/Section/Section.types.d.ts +34 -0
  246. package/dist/components/layout/Section/index.d.ts +3 -0
  247. package/dist/components/layout/Stack/Stack.d.ts +3 -0
  248. package/dist/components/layout/Stack/Stack.js +19 -0
  249. package/dist/components/layout/Stack/Stack.theme.d.ts +2 -0
  250. package/dist/components/layout/Stack/Stack.theme.js +10 -0
  251. package/dist/components/layout/Stack/Stack.types.d.ts +39 -0
  252. package/dist/components/layout/Stack/index.d.ts +3 -0
  253. package/dist/components/layout/index.d.ts +3 -0
  254. package/dist/components/layout/index.js +6 -0
  255. package/dist/generative.schema.json +1637 -0
  256. package/dist/index.js +180 -180
  257. package/dist/registry.json +648 -464
  258. package/dist/styles.css +1 -1
  259. package/dist/tools.json +1731 -0
  260. package/package.json +17 -4
  261. package/src/global.scss +53 -101
  262. package/src/styles/theme.css +687 -493
  263. package/dist/bg/1.jpg +0 -0
  264. package/dist/bg/10.jpg +0 -0
  265. package/dist/bg/11.jpg +0 -0
  266. package/dist/bg/14.jpg +0 -0
  267. package/dist/bg/15.jpg +0 -0
  268. package/dist/bg/16.jpg +0 -0
  269. package/dist/bg/17.jpg +0 -0
  270. package/dist/bg/18.jpg +0 -0
  271. package/dist/bg/19.jpg +0 -0
  272. package/dist/bg/2.jpg +0 -0
  273. package/dist/bg/20.jpg +0 -0
  274. package/dist/bg/21.jpg +0 -0
  275. package/dist/bg/22.jpg +0 -0
  276. package/dist/bg/23.jpg +0 -0
  277. package/dist/bg/24.jpg +0 -0
  278. package/dist/bg/3.jpg +0 -0
  279. package/dist/bg/4.jpg +0 -0
  280. package/dist/bg/5.jpg +0 -0
  281. package/dist/bg/6.jpg +0 -0
  282. package/dist/bg/7.jpg +0 -0
  283. package/dist/bg/8.jpg +0 -0
  284. package/dist/bg/9.jpg +0 -0
  285. package/dist/components/effects/MorphingText/MorphingText.d.ts +0 -17
  286. package/dist/components/effects/MorphingText/MorphingText.js +0 -125
  287. package/dist/components/effects/MorphingText/MorphingText.types.d.ts +0 -18
  288. package/dist/components/effects/MorphingText/index.d.ts +0 -2
  289. package/dist/components/effects/PageTransition/PageTransition.animations.d.ts +0 -8
  290. package/dist/components/effects/PageTransition/PageTransition.animations.js +0 -53
  291. package/dist/components/effects/PageTransition/PageTransition.d.ts +0 -3
  292. package/dist/components/effects/PageTransition/PageTransition.js +0 -82
  293. package/dist/components/effects/PageTransition/PageTransition.types.d.ts +0 -15
  294. package/dist/components/effects/PageTransition/index.d.ts +0 -2
  295. package/dist/components/effects/ParallaxSection/ParallaxSection.d.ts +0 -26
  296. package/dist/components/effects/ParallaxSection/ParallaxSection.js +0 -71
  297. package/dist/components/effects/ParallaxSection/ParallaxSection.types.d.ts +0 -11
  298. package/dist/components/effects/ParallaxSection/index.d.ts +0 -2
  299. package/dist/components/effects/Spotlight/Spotlight.d.ts +0 -36
  300. package/dist/components/effects/Spotlight/Spotlight.js +0 -112
  301. package/dist/components/effects/Spotlight/Spotlight.types.d.ts +0 -29
  302. package/dist/components/effects/Spotlight/index.d.ts +0 -2
  303. package/dist/components/effects/SpotlightBorder/SpotlightBorder.d.ts +0 -18
  304. package/dist/components/effects/SpotlightBorder/SpotlightBorder.js +0 -213
  305. package/dist/components/effects/SpotlightBorder/SpotlightBorder.types.d.ts +0 -61
  306. package/dist/components/effects/SpotlightBorder/index.d.ts +0 -2
  307. package/dist/components/effects/StickyScroll/StickyScroll.d.ts +0 -30
  308. package/dist/components/effects/StickyScroll/StickyScroll.js +0 -128
  309. package/dist/components/effects/StickyScroll/StickyScroll.types.d.ts +0 -19
  310. package/dist/components/effects/StickyScroll/index.d.ts +0 -2
  311. package/dist/components/forms/CronInput/CronInput.d.ts +0 -3
  312. package/dist/components/forms/CronInput/CronInput.js +0 -113
  313. package/dist/components/forms/CronInput/CronInput.theme.d.ts +0 -6
  314. package/dist/components/forms/CronInput/CronInput.theme.js +0 -75
  315. package/dist/components/forms/CronInput/CronInput.types.d.ts +0 -109
  316. package/dist/components/forms/CronInput/CronInput.utils.d.ts +0 -67
  317. package/dist/components/forms/CronInput/CronInput.utils.js +0 -505
  318. package/dist/components/forms/CronInput/index.d.ts +0 -4
  319. /package/dist/components/effects/{SpotlightBorder/SpotlightBorder.types.js → TiltCard/TiltCard.types.js} +0 -0
@@ -0,0 +1,259 @@
1
+ import { GENERATIVE_SCHEMA } from './schema.generated.js';
2
+
3
+ /** Props that are NEVER accepted from a spec, regardless of schema. */
4
+ const BLOCKED_PROPS = new Set(["className", "style", "ref", "key", "theme", "dangerouslySetInnerHTML"]);
5
+ const isHandler = (key) => /^on[A-Z]/.test(key);
6
+ /**
7
+ * Validate + repair a model-emitted spec against the generated schema.
8
+ * Never throws; never mutates the input. Every repair is recorded in `issues`.
9
+ * Unknown components are kept (GenerativeView renders its safe placeholder)
10
+ * but their props/children are stripped.
11
+ */
12
+ function validate(spec, options = {}) {
13
+ var _a;
14
+ const schema = (_a = options.schema) !== null && _a !== void 0 ? _a : GENERATIVE_SCHEMA;
15
+ const issues = [];
16
+ if (Array.isArray(spec)) {
17
+ return { spec: spec.map((n, i) => validateNode(n, schema, `$[${i}]`, issues)), issues };
18
+ }
19
+ return { spec: validateNode(spec, schema, "$", issues), issues };
20
+ }
21
+ function validateNode(node, schema, path, issues) {
22
+ if (!node || typeof node !== "object" || typeof node.component !== "string") {
23
+ issues.push({ path, code: "invalid-node", severity: "error", message: "Node is not an object with a string `component`" });
24
+ return { component: "__invalid__" };
25
+ }
26
+ const raw = node;
27
+ const comp = schema.components[raw.component];
28
+ if (!comp) {
29
+ issues.push({
30
+ path,
31
+ code: "unknown-component",
32
+ severity: "error",
33
+ message: `Unknown component "${raw.component}" — props/children stripped; renders as placeholder`,
34
+ });
35
+ return { component: raw.component, ...(raw.id ? { id: raw.id } : {}) };
36
+ }
37
+ const props = sanitizeProps(raw.props, comp, schema, path, issues);
38
+ // Fill required props that have a schema default; flag the rest.
39
+ for (const [name, ps] of Object.entries(comp.props)) {
40
+ if (!ps.required || props[name] !== undefined)
41
+ continue;
42
+ if (ps.default !== undefined) {
43
+ props[name] = ps.default;
44
+ issues.push({
45
+ path: `${path}.props.${name}`,
46
+ code: "applied-default",
47
+ severity: "warning",
48
+ message: `Required prop "${name}" missing — applied default ${JSON.stringify(ps.default)}`,
49
+ });
50
+ }
51
+ else {
52
+ issues.push({
53
+ path: `${path}.props.${name}`,
54
+ code: "missing-required",
55
+ severity: "error",
56
+ message: `Required prop "${name}" is missing`,
57
+ });
58
+ }
59
+ }
60
+ let children;
61
+ if (Array.isArray(raw.children) && raw.children.length) {
62
+ if (comp.role !== "container") {
63
+ issues.push({
64
+ path: `${path}.children`,
65
+ code: "children-ignored",
66
+ severity: "warning",
67
+ message: `"${raw.component}" is not a container — children removed`,
68
+ });
69
+ }
70
+ else {
71
+ children = raw.children.map((c, i) => validateNode(c, schema, `${path}.children[${i}]`, issues));
72
+ }
73
+ }
74
+ let actions;
75
+ if (raw.actions && typeof raw.actions === "object") {
76
+ for (const [key, descriptor] of Object.entries(raw.actions)) {
77
+ if (descriptor && typeof descriptor === "object" && typeof descriptor.type === "string") {
78
+ (actions !== null && actions !== void 0 ? actions : (actions = {}))[key] = {
79
+ type: descriptor.type,
80
+ ...(descriptor.payload !== undefined ? { payload: descriptor.payload } : {}),
81
+ };
82
+ }
83
+ else {
84
+ issues.push({
85
+ path: `${path}.actions.${key}`,
86
+ code: "invalid-action",
87
+ severity: "warning",
88
+ message: `Action "${key}" must be { type: string, payload? } — removed`,
89
+ });
90
+ }
91
+ }
92
+ }
93
+ return {
94
+ component: raw.component,
95
+ ...(raw.id ? { id: raw.id } : {}),
96
+ ...(raw.sizeHint ? { sizeHint: raw.sizeHint } : {}),
97
+ ...(Object.keys(props).length ? { props } : {}),
98
+ ...(children ? { children } : {}),
99
+ ...(actions ? { actions } : {}),
100
+ };
101
+ }
102
+ function sanitizeProps(rawProps, comp, schema, path, issues) {
103
+ const out = {};
104
+ for (const [key, value] of Object.entries(rawProps !== null && rawProps !== void 0 ? rawProps : {})) {
105
+ const propPath = `${path}.props.${key}`;
106
+ if (BLOCKED_PROPS.has(key) || isHandler(key)) {
107
+ issues.push({
108
+ path: propPath,
109
+ code: "blocked-prop",
110
+ severity: "warning",
111
+ message: `"${key}" is not accepted from a spec (injection guard) — removed`,
112
+ });
113
+ continue;
114
+ }
115
+ const ps = comp.props[key];
116
+ if (!ps) {
117
+ issues.push({
118
+ path: propPath,
119
+ code: "unknown-prop",
120
+ severity: "warning",
121
+ message: `"${key}" is not in the contract — removed (allow-list)`,
122
+ });
123
+ continue;
124
+ }
125
+ const checked = checkValue(key, value, ps, schema, propPath, issues);
126
+ if (checked !== undefined)
127
+ out[key] = checked;
128
+ }
129
+ return out;
130
+ }
131
+ function checkValue(key, value, ps, schema, path, issues) {
132
+ var _a, _b;
133
+ const drop = (message, code = "invalid-value") => {
134
+ if (ps.default !== undefined) {
135
+ issues.push({ path, code, severity: "warning", message: `${message} — replaced with default ${JSON.stringify(ps.default)}` });
136
+ return ps.default;
137
+ }
138
+ issues.push({ path, code, severity: "warning", message: `${message} — removed` });
139
+ return undefined;
140
+ };
141
+ switch (ps.kind) {
142
+ case "enum": {
143
+ const options = (_a = ps.options) !== null && _a !== void 0 ? _a : [];
144
+ if (options.includes(value))
145
+ return value;
146
+ if (typeof value === "string") {
147
+ const ci = options.find((o) => typeof o === "string" && o.toLowerCase() === value.toLowerCase());
148
+ if (ci !== undefined) {
149
+ issues.push({ path, code: "coerced-value", severity: "warning", message: `"${value}" coerced to "${ci}"` });
150
+ return ci;
151
+ }
152
+ const num = Number(value);
153
+ if (!Number.isNaN(num) && options.includes(num)) {
154
+ issues.push({ path, code: "coerced-value", severity: "warning", message: `"${value}" coerced to ${num}` });
155
+ return num;
156
+ }
157
+ }
158
+ return drop(`${JSON.stringify(value)} is not one of ${JSON.stringify(options)}`, "invalid-enum");
159
+ }
160
+ case "boolean": {
161
+ if (typeof value === "boolean")
162
+ return value;
163
+ if (value === "true" || value === "false") {
164
+ issues.push({ path, code: "coerced-value", severity: "warning", message: `"${value}" coerced to boolean` });
165
+ return value === "true";
166
+ }
167
+ return drop(`Expected boolean, got ${JSON.stringify(value)}`);
168
+ }
169
+ case "number": {
170
+ if (typeof value === "number")
171
+ return value;
172
+ if (typeof value === "string" && value.trim() !== "" && !Number.isNaN(Number(value))) {
173
+ issues.push({ path, code: "coerced-value", severity: "warning", message: `"${value}" coerced to number` });
174
+ return Number(value);
175
+ }
176
+ return drop(`Expected number, got ${JSON.stringify(value)}`);
177
+ }
178
+ case "string":
179
+ case "text": {
180
+ if (typeof value === "string")
181
+ return value;
182
+ if (typeof value === "number" || typeof value === "boolean") {
183
+ issues.push({ path, code: "coerced-value", severity: "warning", message: `${JSON.stringify(value)} coerced to string` });
184
+ return String(value);
185
+ }
186
+ return drop(`Expected string, got ${JSON.stringify(value)}`);
187
+ }
188
+ case "union": {
189
+ const types = (_b = ps.types) !== null && _b !== void 0 ? _b : [];
190
+ if (types.includes(typeof value))
191
+ return value;
192
+ if (types.includes("number") && typeof value === "string" && value.trim() !== "" && !Number.isNaN(Number(value))) {
193
+ issues.push({ path, code: "coerced-value", severity: "warning", message: `"${value}" coerced to number` });
194
+ return Number(value);
195
+ }
196
+ if (types.includes("string") && (typeof value === "number" || typeof value === "boolean")) {
197
+ issues.push({ path, code: "coerced-value", severity: "warning", message: `${JSON.stringify(value)} coerced to string` });
198
+ return String(value);
199
+ }
200
+ return drop(`Expected ${types.join(" | ")}, got ${JSON.stringify(value)}`);
201
+ }
202
+ case "icon": {
203
+ if (typeof value !== "string")
204
+ return drop(`Icon must be a NAME string, got ${JSON.stringify(value)}`);
205
+ if (schema.icons.includes(value))
206
+ return value;
207
+ const ci = schema.icons.find((n) => n.toLowerCase() === value.toLowerCase());
208
+ if (ci) {
209
+ issues.push({ path, code: "coerced-value", severity: "warning", message: `Icon "${value}" coerced to "${ci}"` });
210
+ return ci;
211
+ }
212
+ return drop(`Unknown icon "${value}" (closed set of ${schema.icons.length})`, "invalid-enum");
213
+ }
214
+ case "shape": {
215
+ if (ps.shape === "gridCols") {
216
+ if (typeof value === "number" || (value !== null && typeof value === "object" && !Array.isArray(value)))
217
+ return value;
218
+ return drop(`Expected a number or breakpoint map, got ${JSON.stringify(value)}`, "invalid-shape");
219
+ }
220
+ if (ps.shape === "chartConfig" || ps.shape === "donutColors") {
221
+ if (value !== null && typeof value === "object" && !Array.isArray(value))
222
+ return value;
223
+ return drop(`Expected an object, got ${JSON.stringify(value)}`, "invalid-shape");
224
+ }
225
+ // every other shape is an array of objects
226
+ if (!Array.isArray(value))
227
+ return drop(`Expected an array, got ${JSON.stringify(value)}`, "invalid-shape");
228
+ const cleaned = value.filter((item) => item !== null && typeof item === "object" && !Array.isArray(item));
229
+ if (cleaned.length !== value.length) {
230
+ issues.push({
231
+ path,
232
+ code: "invalid-shape",
233
+ severity: "warning",
234
+ message: `${value.length - cleaned.length} non-object item(s) removed from "${key}"`,
235
+ });
236
+ }
237
+ // strip blocked/handler keys inside structured items (injection guard at depth)
238
+ return cleaned.map((item) => {
239
+ const obj = item;
240
+ const next = {};
241
+ for (const [k, v] of Object.entries(obj)) {
242
+ if (BLOCKED_PROPS.has(k) || isHandler(k)) {
243
+ issues.push({
244
+ path: `${path}.${k}`,
245
+ code: "blocked-prop",
246
+ severity: "warning",
247
+ message: `"${k}" inside "${key}" removed (injection guard)`,
248
+ });
249
+ continue;
250
+ }
251
+ next[k] = v;
252
+ }
253
+ return next;
254
+ });
255
+ }
256
+ }
257
+ }
258
+
259
+ export { validate };
@@ -4,14 +4,14 @@ const appShellTheme = {
4
4
  shell: "flex flex-1 min-h-0 min-w-0",
5
5
  mainColumn: "flex flex-col flex-1 min-h-0 min-w-0",
6
6
  topbar: "shrink-0 border-b border-[var(--color-border)] bg-[var(--color-background)]/90 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/75",
7
- sidebar: "flex flex-col shrink-0 overflow-hidden border-r border-[var(--color-border)] bg-[var(--color-background)]/95 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/85",
7
+ sidebar: "flex flex-col shrink-0 overflow-hidden",
8
8
  sidebarScroll: "min-h-0 flex-1",
9
9
  sidebarCollapsed: "hidden lg:flex",
10
10
  header: "shrink-0 border-b border-[var(--color-border)] bg-[var(--color-background)]/90 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/75",
11
11
  main: "flex flex-col flex-1 min-h-0 min-w-0",
12
12
  mainScroll: "min-h-0 flex-1",
13
13
  mainInner: "mx-auto w-full",
14
- rightPanel: "flex flex-col shrink-0 overflow-hidden border-l border-[var(--color-border)] bg-[var(--color-background)]/95 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/85",
14
+ rightPanel: "flex flex-col shrink-0 overflow-hidden border-l border-[var(--color-border)]",
15
15
  rightPanelScroll: "min-h-0 flex-1",
16
16
  footer: "shrink-0 border-t border-[var(--color-border)] bg-[var(--color-background)]/90 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/75",
17
17
  contentPadding: {
@@ -1,99 +1,10 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import React__default from 'react';
3
3
  import { cn } from '../../../utils/cn.js';
4
- import '../../core/Accordion/Accordion.js';
5
- import '../../core/AlertDialog/AlertDialog.js';
6
- import '../../core/AspectRatio/AspectRatio.js';
7
- import '../../core/Avatar/Avatar.js';
8
- import '../../core/AvatarGroup/AvatarGroup.js';
9
- import '../../core/Badge/Badge.js';
10
- import '../../core/Breadcrumbs/Breadcrumbs.js';
11
- import '../../core/Breadcrumbs/Breadcrumbs.theme.js';
12
- import '../../core/Button/Button.js';
13
- import '../../core/ButtonGroup/ButtonGroup.js';
14
- import '../../core/ButtonGroup/ButtonGroupSeparator.js';
15
- import '../../core/ButtonGroup/ButtonGroupText.js';
16
- import '../../core/Calendar/Calendar.js';
17
- import '../../core/Calendar/CalendarMini/CalendarMini.js';
18
- import '../../core/Card/Card.js';
19
- import '../../core/CardStack/CardStack.js';
20
- import '../../core/Carousel/Carousel.js';
21
- import '../../core/Carousel/CarouselBody.js';
22
- import '../../core/CommandPalette/CommandPalette.js';
23
- import { Separator } from '../../core/Separator/Separator.js';
24
- import '../../core/Drawer/Drawer.js';
25
- import '../../core/Drawer/DrawerBody.js';
26
- import '../../core/Dropdown/Dropdown.js';
27
- import '../../core/Dropdown/DropdownTrigger.js';
28
- import '../../core/Dropdown/DropdownMenu.js';
29
- import '../../core/Dropdown/DropdownItem.js';
30
- import '../../core/Dropdown/DropdownSection.js';
31
- import '../../core/Dropdown/DropdownSeparator.js';
32
- import '../../core/Dropdown/Dropdown.theme.js';
33
- import '../../core/DotSeparator/DotSeparator.js';
34
- import '../../core/Kbd/Kbd.js';
35
- import '../../core/MenuItem/MenuItem.js';
36
- import '../../core/Link/Link.js';
37
- import '../../core/Modal/Modal.js';
38
- import '../../core/ModalStack/ModalStack.js';
39
- import '../../core/PageHeading/PageHeading.js';
40
- import '../../core/Pagination/Pagination.js';
41
- import '../../core/Popover/Popover.js';
42
- import '../../core/Popover/PopoverContext.js';
43
- import '../../core/Popover/PopoverBody.js';
44
- import '../../core/Progress/Progress.js';
45
- import '../../core/Rating/Rating.js';
46
- import '../../core/ScrollArea/ScrollArea.js';
47
- import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
48
- import '../../core/Segmented/Segmented.js';
49
- import '../../core/Skeleton/Skeleton.js';
50
- import '../../core/SlidingNumber/SlidingNumber.js';
51
- import '../../core/Tabs/Tabs.js';
52
- import '../../core/Tabs/TabsList.js';
53
- import '../../core/Tabs/TabsTrigger.js';
54
- import '../../core/Tabs/TabsBody.js';
55
- import '../../core/Tabs/TabsContext.js';
56
- import '../../core/Tooltip/Tooltip.js';
57
- import '../../core/Tooltip/Tooltip.animations.js';
58
- import '../../core/Tree/Tree.js';
59
- import '../../core/Tag/Tag.js';
60
- import '../../core/Alert/Alert.js';
61
- import '../../core/Toast/Toast.js';
62
- import '../../core/Toast/ToastProvider.js';
63
- import '@heroicons/react/24/solid';
64
- import '../../core/Spinner/Spinner.js';
65
- import '../../core/Message/Message.js';
66
- import '../../core/Message/TypeWriter.js';
67
- import '../../core/Message/MessageBody.js';
68
- import '@heroicons/react/16/solid';
69
- import '@heroicons/react/24/outline';
70
- import '../../core/Empty/Empty.js';
71
- import '../../core/Masonry/Masonry.js';
72
- import '../../core/DragDrop/DragDrop.js';
73
- import '../../core/Sortable/Sortable.js';
74
- import '../../core/NavItem/NavItem.js';
75
- import '../../core/Sidebar/Sidebar.js';
76
- import '../../core/Sidebar/SidebarHeader.js';
77
- import '../../core/Sidebar/SidebarContent.js';
78
- import '../../core/Sidebar/SidebarFooter.js';
79
- import '../../core/Sidebar/SidebarNav.js';
80
- import '../../core/Sidebar/SidebarNavGroup.js';
81
- import '../../core/Sidebar/SidebarToggle.js';
82
- import '../../core/Sidebar/SidebarMobileTrigger.js';
83
- import '../../core/Sidebar/SidebarUserProfile.js';
84
- import '../../core/Sidebar/SidebarLogo.js';
85
- import '../../core/Sidebar/SidebarSearch.js';
86
- import '../../core/Sidebar/SidebarCard.js';
87
- import '../../core/Sidebar/SidebarContext.js';
88
- import '../../core/OfflineIndicator/OfflineIndicator.js';
89
- import '../../core/ContextMenu/ContextMenu.js';
90
- import '../../core/ContextMenu/ContextMenu.theme.js';
91
- import '../../core/Pill/Pill.js';
92
- import '../../core/Icon/Icon.js';
93
- import '../../core/ImagePlaceholder/ImagePlaceholder.js';
94
4
  import { formLayoutTheme } from './FormLayout.theme.js';
95
5
  import { FormLayoutSection } from './FormLayoutSection.js';
96
6
  import { FormLayoutFooter } from './FormLayoutFooter.js';
7
+ import { Separator } from '../../core/Separator/Separator.js';
97
8
 
98
9
  const isFooter = (child) => React__default.isValidElement(child) && child.type === FormLayoutFooter;
99
10
  const FormLayoutRoot = React__default.forwardRef(({ className, theme: customTheme, children, ...props }, ref) => {
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { GridProps } from "./Grid.types";
3
+ export declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,50 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import React__default, { useMemo } from 'react';
3
+ import { cn } from '../../../utils/cn.js';
4
+ import { gridTheme } from './Grid.theme.js';
5
+
6
+ const clampCols = (n) => Math.min(12, Math.max(1, Math.round(n)));
7
+ /** Turn a `cols` value into a space-separated literal class string. */
8
+ function resolveCols(cols, theme) {
9
+ var _a;
10
+ if (typeof cols === "number") {
11
+ return (_a = theme.colsRamp[clampCols(cols)]) !== null && _a !== void 0 ? _a : theme.colsRamp[1];
12
+ }
13
+ const parts = [];
14
+ Object.keys(cols).forEach((bp) => {
15
+ var _a;
16
+ const n = cols[bp];
17
+ if (typeof n === "number") {
18
+ const cls = (_a = theme.cols[bp]) === null || _a === void 0 ? void 0 : _a[clampCols(n)];
19
+ if (cls)
20
+ parts.push(cls);
21
+ }
22
+ });
23
+ return parts.join(" ");
24
+ }
25
+ const Grid = React__default.forwardRef(({ cols = 1, gap = 4, flow, align, justify, className, theme: customTheme = {}, ...props }, ref) => {
26
+ const theme = useMemo(() => {
27
+ var _a, _b, _c, _d, _e, _f;
28
+ return ({
29
+ ...gridTheme,
30
+ ...customTheme,
31
+ colsRamp: { ...gridTheme.colsRamp, ...customTheme.colsRamp },
32
+ cols: {
33
+ base: { ...gridTheme.cols.base, ...(_a = customTheme.cols) === null || _a === void 0 ? void 0 : _a.base },
34
+ sm: { ...gridTheme.cols.sm, ...(_b = customTheme.cols) === null || _b === void 0 ? void 0 : _b.sm },
35
+ md: { ...gridTheme.cols.md, ...(_c = customTheme.cols) === null || _c === void 0 ? void 0 : _c.md },
36
+ lg: { ...gridTheme.cols.lg, ...(_d = customTheme.cols) === null || _d === void 0 ? void 0 : _d.lg },
37
+ xl: { ...gridTheme.cols.xl, ...(_e = customTheme.cols) === null || _e === void 0 ? void 0 : _e.xl },
38
+ "2xl": { ...gridTheme.cols["2xl"], ...(_f = customTheme.cols) === null || _f === void 0 ? void 0 : _f["2xl"] },
39
+ },
40
+ gaps: { ...gridTheme.gaps, ...customTheme.gaps },
41
+ flow: { ...gridTheme.flow, ...customTheme.flow },
42
+ align: { ...gridTheme.align, ...customTheme.align },
43
+ justify: { ...gridTheme.justify, ...customTheme.justify },
44
+ });
45
+ }, [customTheme]);
46
+ return (jsx("div", { ref: ref, className: cn(theme.baseStyle, resolveCols(cols, theme), theme.gaps[gap], flow && theme.flow[flow], align && theme.align[align], justify && theme.justify[justify], className), ...props }));
47
+ });
48
+ Grid.displayName = "Grid";
49
+
50
+ export { Grid };
@@ -0,0 +1,2 @@
1
+ import { GridTheme } from "./Grid.types";
2
+ export declare const gridTheme: GridTheme;
@@ -0,0 +1,35 @@
1
+ // ⚠️ PURGE-SAFETY: every class below MUST stay a verbatim literal string.
2
+ // Tailwind v4 scans this file's source text to decide which classes to emit —
3
+ // it cannot see runtime-built strings. Do NOT "simplify" these tables into a
4
+ // generated/interpolated form (e.g. `${bp}grid-cols-${n}`): that drops the
5
+ // literals from the scan and silently breaks the grid in production CSS.
6
+ const COLS_BASE = { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4", 5: "grid-cols-5", 6: "grid-cols-6", 7: "grid-cols-7", 8: "grid-cols-8", 9: "grid-cols-9", 10: "grid-cols-10", 11: "grid-cols-11", 12: "grid-cols-12" };
7
+ const COLS_SM = { 1: "sm:grid-cols-1", 2: "sm:grid-cols-2", 3: "sm:grid-cols-3", 4: "sm:grid-cols-4", 5: "sm:grid-cols-5", 6: "sm:grid-cols-6", 7: "sm:grid-cols-7", 8: "sm:grid-cols-8", 9: "sm:grid-cols-9", 10: "sm:grid-cols-10", 11: "sm:grid-cols-11", 12: "sm:grid-cols-12" };
8
+ const COLS_MD = { 1: "md:grid-cols-1", 2: "md:grid-cols-2", 3: "md:grid-cols-3", 4: "md:grid-cols-4", 5: "md:grid-cols-5", 6: "md:grid-cols-6", 7: "md:grid-cols-7", 8: "md:grid-cols-8", 9: "md:grid-cols-9", 10: "md:grid-cols-10", 11: "md:grid-cols-11", 12: "md:grid-cols-12" };
9
+ const COLS_LG = { 1: "lg:grid-cols-1", 2: "lg:grid-cols-2", 3: "lg:grid-cols-3", 4: "lg:grid-cols-4", 5: "lg:grid-cols-5", 6: "lg:grid-cols-6", 7: "lg:grid-cols-7", 8: "lg:grid-cols-8", 9: "lg:grid-cols-9", 10: "lg:grid-cols-10", 11: "lg:grid-cols-11", 12: "lg:grid-cols-12" };
10
+ const COLS_XL = { 1: "xl:grid-cols-1", 2: "xl:grid-cols-2", 3: "xl:grid-cols-3", 4: "xl:grid-cols-4", 5: "xl:grid-cols-5", 6: "xl:grid-cols-6", 7: "xl:grid-cols-7", 8: "xl:grid-cols-8", 9: "xl:grid-cols-9", 10: "xl:grid-cols-10", 11: "xl:grid-cols-11", 12: "xl:grid-cols-12" };
11
+ const COLS_2XL = { 1: "2xl:grid-cols-1", 2: "2xl:grid-cols-2", 3: "2xl:grid-cols-3", 4: "2xl:grid-cols-4", 5: "2xl:grid-cols-5", 6: "2xl:grid-cols-6", 7: "2xl:grid-cols-7", 8: "2xl:grid-cols-8", 9: "2xl:grid-cols-9", 10: "2xl:grid-cols-10", 11: "2xl:grid-cols-11", 12: "2xl:grid-cols-12" };
12
+ const gridTheme = {
13
+ baseStyle: "grid",
14
+ colsRamp: {
15
+ 1: "grid-cols-1",
16
+ 2: "grid-cols-1 sm:grid-cols-2",
17
+ 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
18
+ 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",
19
+ 5: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-5",
20
+ 6: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-6",
21
+ 7: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 xl:grid-cols-7",
22
+ 8: "grid-cols-2 sm:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8",
23
+ 9: "grid-cols-3 sm:grid-cols-4 lg:grid-cols-6 xl:grid-cols-9",
24
+ 10: "grid-cols-3 sm:grid-cols-5 lg:grid-cols-6 xl:grid-cols-10",
25
+ 11: "grid-cols-3 sm:grid-cols-5 lg:grid-cols-6 xl:grid-cols-11",
26
+ 12: "grid-cols-3 sm:grid-cols-6 lg:grid-cols-6 xl:grid-cols-12",
27
+ },
28
+ cols: { base: COLS_BASE, sm: COLS_SM, md: COLS_MD, lg: COLS_LG, xl: COLS_XL, "2xl": COLS_2XL },
29
+ gaps: { 0: "gap-0", 1: "gap-1", 2: "gap-2", 3: "gap-3", 4: "gap-4", 5: "gap-5", 6: "gap-6", 8: "gap-8", 10: "gap-10", 12: "gap-12" },
30
+ flow: { row: "grid-flow-row", col: "grid-flow-col", dense: "grid-flow-row-dense" },
31
+ align: { start: "items-start", center: "items-center", end: "items-end", stretch: "items-stretch" },
32
+ justify: { start: "justify-start", center: "justify-center", end: "justify-end", between: "justify-between" },
33
+ };
34
+
35
+ export { gridTheme };
@@ -0,0 +1,57 @@
1
+ import { HTMLAttributes } from "react";
2
+ /** Tailwind v4 default breakpoints; "base" = unprefixed (mobile-first). */
3
+ export type Breakpoint = "base" | "sm" | "md" | "lg" | "xl" | "2xl";
4
+ /** Tailwind spacing scale → gap-0 … gap-12. Use className for exotic values. */
5
+ export type GridGap = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12;
6
+ export type GridFlow = "row" | "col" | "dense";
7
+ export type GridAlign = "start" | "center" | "end" | "stretch";
8
+ export type GridJustify = "start" | "center" | "end" | "between";
9
+ /** A single column count (mobile-safe auto-ramp) OR an explicit per-breakpoint map. */
10
+ export type GridCols = number | Partial<Record<Breakpoint, number>>;
11
+ export interface GridTheme {
12
+ baseStyle: string;
13
+ /** cols={n} → a full responsive class string (mobile-first ramp). */
14
+ colsRamp: Record<number, string>;
15
+ /** cols={{ md: 2 }} → per-breakpoint literal class tables. */
16
+ cols: Record<Breakpoint, Record<number, string>>;
17
+ gaps: Record<GridGap, string>;
18
+ flow: Record<GridFlow, string>;
19
+ align: Record<GridAlign, string>;
20
+ justify: Record<GridJustify, string>;
21
+ }
22
+ export interface GridThemeOverrides {
23
+ baseStyle?: string;
24
+ colsRamp?: Partial<Record<number, string>>;
25
+ cols?: Partial<Record<Breakpoint, Record<number, string>>>;
26
+ gaps?: Partial<Record<GridGap, string>>;
27
+ flow?: Partial<Record<GridFlow, string>>;
28
+ align?: Partial<Record<GridAlign, string>>;
29
+ justify?: Partial<Record<GridJustify, string>>;
30
+ }
31
+ export interface GridProps extends HTMLAttributes<HTMLDivElement> {
32
+ /**
33
+ * Columns: a number (mobile-safe auto-ramp) or a per-breakpoint map.
34
+ *
35
+ * A number is NOT a literal column count on every screen — it expands through
36
+ * a mobile-first responsive ramp, e.g. `cols={3}` renders 1 column on mobile,
37
+ * 2 from `sm`, and 3 from `lg`. Use a per-breakpoint map
38
+ * (`cols={{ base: 3 }}` or `{ base: 1, md: 2, lg: 3 }`) for explicit control.
39
+ * @default 1
40
+ */
41
+ cols?: GridCols;
42
+ /**
43
+ * Gap between grid cells (Tailwind spacing scale → gap-N).
44
+ * @default 4
45
+ */
46
+ gap?: GridGap;
47
+ /** Grid auto-flow direction. */
48
+ flow?: GridFlow;
49
+ /** align-items within cells. */
50
+ align?: GridAlign;
51
+ /** justify-content of tracks. */
52
+ justify?: GridJustify;
53
+ /** Custom class name (always wins). */
54
+ className?: string;
55
+ /** Component-level theme overrides. */
56
+ theme?: GridThemeOverrides;
57
+ }
@@ -0,0 +1,3 @@
1
+ export { Grid } from "./Grid";
2
+ export type { GridProps, GridTheme, GridThemeOverrides, GridCols, GridGap, GridFlow, GridAlign, GridJustify, Breakpoint, } from "./Grid.types";
3
+ export { gridTheme } from "./Grid.theme";
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { SectionProps } from "./Section.types";
3
+ export declare const Section: React.ForwardRefExoticComponent<SectionProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,18 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import React__default, { useMemo } from 'react';
3
+ import { cn } from '../../../utils/cn.js';
4
+ import { sectionTheme } from './Section.theme.js';
5
+
6
+ const Section = React__default.forwardRef(({ title, subtitle, actions, gap = 4, className, theme: customTheme = {}, children, ...props }, ref) => {
7
+ const headingId = React__default.useId();
8
+ const theme = useMemo(() => ({
9
+ ...sectionTheme,
10
+ ...customTheme,
11
+ bodyGaps: { ...sectionTheme.bodyGaps, ...customTheme.bodyGaps },
12
+ }), [customTheme]);
13
+ const hasHeader = Boolean(title || subtitle || actions);
14
+ return (jsxs("section", { ref: ref, className: cn(theme.baseStyle, className), "aria-labelledby": title ? headingId : undefined, ...props, children: [hasHeader && (jsxs("div", { className: theme.header, children: [jsxs("div", { children: [title && jsx("h2", { id: headingId, className: theme.title, children: title }), subtitle && jsx("p", { className: theme.subtitle, children: subtitle })] }), actions && jsx("div", { className: theme.actions, children: actions })] })), children != null && (jsx("div", { className: cn(hasHeader && theme.bodyGaps[gap]), children: children }))] }));
15
+ });
16
+ Section.displayName = "Section";
17
+
18
+ export { Section };
@@ -0,0 +1,2 @@
1
+ import { SectionTheme } from "./Section.types";
2
+ export declare const sectionTheme: SectionTheme;
@@ -0,0 +1,10 @@
1
+ const sectionTheme = {
2
+ baseStyle: "block",
3
+ header: "flex items-start justify-between gap-4",
4
+ title: "text-base font-semibold text-[var(--color-text-primary)]",
5
+ subtitle: "mt-0.5 text-sm text-[var(--color-text-secondary)]",
6
+ actions: "flex shrink-0 items-center gap-2",
7
+ bodyGaps: { 0: "mt-0", 1: "mt-1", 2: "mt-2", 3: "mt-3", 4: "mt-4", 5: "mt-5", 6: "mt-6", 8: "mt-8", 10: "mt-10", 12: "mt-12" },
8
+ };
9
+
10
+ export { sectionTheme };
@@ -0,0 +1,34 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ import { GridGap } from "../Grid/Grid.types";
3
+ export interface SectionTheme {
4
+ baseStyle: string;
5
+ header: string;
6
+ title: string;
7
+ subtitle: string;
8
+ actions: string;
9
+ /** Spacing (margin-top) between the header and the body. */
10
+ bodyGaps: Record<GridGap, string>;
11
+ }
12
+ export interface SectionThemeOverrides {
13
+ baseStyle?: string;
14
+ header?: string;
15
+ title?: string;
16
+ subtitle?: string;
17
+ actions?: string;
18
+ bodyGaps?: Partial<Record<GridGap, string>>;
19
+ }
20
+ export interface SectionProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
21
+ /** Section heading. */
22
+ title?: ReactNode;
23
+ /** Secondary line under the title. */
24
+ subtitle?: ReactNode;
25
+ /** Right-aligned actions in the header row. */
26
+ actions?: ReactNode;
27
+ /**
28
+ * Spacing between the header and the body (Tailwind spacing scale → mt-N).
29
+ * @default 4
30
+ */
31
+ gap?: GridGap;
32
+ className?: string;
33
+ theme?: SectionThemeOverrides;
34
+ }
@@ -0,0 +1,3 @@
1
+ export { Section } from "./Section";
2
+ export type { SectionProps, SectionTheme, SectionThemeOverrides } from "./Section.types";
3
+ export { sectionTheme } from "./Section.theme";
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { StackProps } from "./Stack.types";
3
+ export declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,19 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import React__default, { useMemo } from 'react';
3
+ import { cn } from '../../../utils/cn.js';
4
+ import { stackTheme } from './Stack.theme.js';
5
+
6
+ const Stack = React__default.forwardRef(({ direction = "col", gap = 4, align, justify, wrap = false, className, theme: customTheme = {}, ...props }, ref) => {
7
+ const theme = useMemo(() => ({
8
+ ...stackTheme,
9
+ ...customTheme,
10
+ direction: { ...stackTheme.direction, ...customTheme.direction },
11
+ gaps: { ...stackTheme.gaps, ...customTheme.gaps },
12
+ align: { ...stackTheme.align, ...customTheme.align },
13
+ justify: { ...stackTheme.justify, ...customTheme.justify },
14
+ }), [customTheme]);
15
+ return (jsx("div", { ref: ref, className: cn(theme.baseStyle, theme.direction[direction], theme.gaps[gap], align && theme.align[align], justify && theme.justify[justify], wrap && theme.wrap, className), ...props }));
16
+ });
17
+ Stack.displayName = "Stack";
18
+
19
+ export { Stack };
@@ -0,0 +1,2 @@
1
+ import { StackTheme } from "./Stack.types";
2
+ export declare const stackTheme: StackTheme;