@cloudraker/reki 2.6.1 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +1 -1
  3. package/ai/component-registry.json +1271 -41
  4. package/ai/component-registry.md +1310 -34
  5. package/ai/schemas.ts +226 -2
  6. package/dist/.build-complete +1 -1
  7. package/dist/ai/schemas.d.ts +554 -5
  8. package/dist/ai/schemas.d.ts.map +1 -1
  9. package/dist/ai/schemas.js +1699 -1405
  10. package/dist/ai/schemas.js.map +1 -1
  11. package/dist/chunks/{SankeyChart-jwwpwps4npqzbrvn.js → SankeyChart-gogf860o4u387kjn.js} +2 -2
  12. package/dist/chunks/{SankeyChart-jwwpwps4npqzbrvn.js.map → SankeyChart-gogf860o4u387kjn.js.map} +1 -1
  13. package/dist/chunks/actor-display-izds1bhw0yswurqm.js +35 -0
  14. package/dist/chunks/actor-display-izds1bhw0yswurqm.js.map +1 -0
  15. package/dist/chunks/address-input-g1la0xqrpg8ic6ak.js +80 -0
  16. package/dist/chunks/address-input-g1la0xqrpg8ic6ak.js.map +1 -0
  17. package/dist/chunks/array-display-lu1259ap3qrl847e.js +12 -0
  18. package/dist/chunks/array-display-lu1259ap3qrl847e.js.map +1 -0
  19. package/dist/chunks/{autocomplete-f4vetako14h2aqsw.js → autocomplete-htuy5t9ag29qhuwa.js} +4 -4
  20. package/dist/chunks/{autocomplete-f4vetako14h2aqsw.js.map → autocomplete-htuy5t9ag29qhuwa.js.map} +1 -1
  21. package/dist/chunks/avatar-g40cun6cn17fcxd4.js +57 -0
  22. package/dist/chunks/avatar-g40cun6cn17fcxd4.js.map +1 -0
  23. package/dist/chunks/avatar-group-fpcaziey1yu7226v.js +23 -0
  24. package/dist/chunks/avatar-group-fpcaziey1yu7226v.js.map +1 -0
  25. package/dist/chunks/{breadcrumbs-d6149hyct4puz3x4.js → breadcrumbs-mq1utzm0q4u2r5v5.js} +2 -2
  26. package/dist/chunks/{breadcrumbs-d6149hyct4puz3x4.js.map → breadcrumbs-mq1utzm0q4u2r5v5.js.map} +1 -1
  27. package/dist/chunks/{button-nc5p1h28cwes0tjw.js → button-fvlz1rzc3s1hpyxs.js} +14 -14
  28. package/dist/chunks/button-fvlz1rzc3s1hpyxs.js.map +1 -0
  29. package/dist/chunks/{checkbox-g2661n3eodgoispq.js → checkbox-h3kfhlron3b6sfhv.js} +3 -3
  30. package/dist/chunks/{checkbox-g2661n3eodgoispq.js.map → checkbox-h3kfhlron3b6sfhv.js.map} +1 -1
  31. package/dist/chunks/chip-iu7movvthovdurgb.js +69 -0
  32. package/dist/chunks/chip-iu7movvthovdurgb.js.map +1 -0
  33. package/dist/chunks/circular-progress-bar-ofg0ps2axad1wsr6.js +60 -0
  34. package/dist/chunks/circular-progress-bar-ofg0ps2axad1wsr6.js.map +1 -0
  35. package/dist/chunks/{clipboard-text-g3659lejx2d7i93e.js → clipboard-text-ogue8iq06n1z7q7v.js} +4 -4
  36. package/dist/chunks/{clipboard-text-g3659lejx2d7i93e.js.map → clipboard-text-ogue8iq06n1z7q7v.js.map} +1 -1
  37. package/dist/chunks/{collapsible-ndvmgo29s5iqfcor.js → collapsible-ivqat099ene9z3bv.js} +2 -2
  38. package/dist/chunks/{collapsible-ndvmgo29s5iqfcor.js.map → collapsible-ivqat099ene9z3bv.js.map} +1 -1
  39. package/dist/chunks/color-sample-h7hspma3rb91go3z.js +32 -0
  40. package/dist/chunks/color-sample-h7hspma3rb91go3z.js.map +1 -0
  41. package/dist/chunks/{combobox-i38w67netm8ukw4f.js → combobox-iytvpzp5poljxgek.js} +4 -4
  42. package/dist/chunks/{combobox-i38w67netm8ukw4f.js.map → combobox-iytvpzp5poljxgek.js.map} +1 -1
  43. package/dist/chunks/{command-palette-fe5cjfdgsg3t17vq.js → command-palette-k6vrx8ely8rmf4a5.js} +4 -4
  44. package/dist/chunks/command-palette-k6vrx8ely8rmf4a5.js.map +1 -0
  45. package/dist/chunks/data-grid-i7kfgm7zr5tj0e0a.js +3110 -0
  46. package/dist/chunks/data-grid-i7kfgm7zr5tj0e0a.js.map +1 -0
  47. package/dist/chunks/{dialog-m4go8xof25fospqo.js → dialog-ggx34i6k4eulfvgk.js} +3 -3
  48. package/dist/chunks/{dialog-m4go8xof25fospqo.js.map → dialog-ggx34i6k4eulfvgk.js.map} +1 -1
  49. package/dist/chunks/double-text-input-k0i5xnfq6khv01wu.js +39 -0
  50. package/dist/chunks/double-text-input-k0i5xnfq6khv01wu.js.map +1 -0
  51. package/dist/chunks/{dropdown-j5uht8mn4z7xc9fc.js → dropdown-bt1lfs2jli0khnex.js} +2 -2
  52. package/dist/chunks/{dropdown-j5uht8mn4z7xc9fc.js.map → dropdown-bt1lfs2jli0khnex.js.map} +1 -1
  53. package/dist/chunks/emails-display-nsbqzscr0f9bqimg.js +12 -0
  54. package/dist/chunks/emails-display-nsbqzscr0f9bqimg.js.map +1 -0
  55. package/dist/chunks/{empty-kazxr0248zjemw6n.js → empty-dxy8jti5bsxxh905.js} +2 -2
  56. package/dist/chunks/{empty-kazxr0248zjemw6n.js.map → empty-dxy8jti5bsxxh905.js.map} +1 -1
  57. package/dist/chunks/expandable-list-bjceh467ocazog53.js +26 -0
  58. package/dist/chunks/expandable-list-bjceh467ocazog53.js.map +1 -0
  59. package/dist/chunks/{field-fe5m8z3vbpvtctbe.js → field-b0aywboxuss4rpu7.js} +3 -3
  60. package/dist/chunks/{field-fe5m8z3vbpvtctbe.js.map → field-b0aywboxuss4rpu7.js.map} +1 -1
  61. package/dist/chunks/{input-area-ciw85g3fno06t4tw.js → input-area-cuijpofpark5w5qq.js} +4 -4
  62. package/dist/chunks/{input-area-ciw85g3fno06t4tw.js.map → input-area-cuijpofpark5w5qq.js.map} +1 -1
  63. package/dist/chunks/{input-i5nefqk213n4z7pr.js → input-eno4q26x68rx3i8q.js} +3 -3
  64. package/dist/chunks/{input-i5nefqk213n4z7pr.js.map → input-eno4q26x68rx3i8q.js.map} +1 -1
  65. package/dist/chunks/{input-group-mo7tq7jr19hmgor5.js → input-group-dl9htnza7kq4om4c.js} +5 -5
  66. package/dist/chunks/{input-group-mo7tq7jr19hmgor5.js.map → input-group-dl9htnza7kq4om4c.js.map} +1 -1
  67. package/dist/chunks/json-display-fy0t2khc4itn130p.js +31 -0
  68. package/dist/chunks/json-display-fy0t2khc4itn130p.js.map +1 -0
  69. package/dist/chunks/{label-fcho4757rbdess0c.js → label-ld57mr4ocdxsf06p.js} +3 -3
  70. package/dist/chunks/{label-fcho4757rbdess0c.js.map → label-ld57mr4ocdxsf06p.js.map} +1 -1
  71. package/dist/chunks/{layer-card-kzu48dhzxm3e9p4u.js → layer-card-iuquuc1w3116umfw.js} +2 -2
  72. package/dist/chunks/{layer-card-kzu48dhzxm3e9p4u.js.map → layer-card-iuquuc1w3116umfw.js.map} +1 -1
  73. package/dist/chunks/{link-j2gu5dr3nr4i4yf0.js → link-8pn6y27h3m3ud8fl.js} +2 -2
  74. package/dist/chunks/{link-j2gu5dr3nr4i4yf0.js.map → link-8pn6y27h3m3ud8fl.js.map} +1 -1
  75. package/dist/chunks/link-chip-cz5v6lw9icmcndzl.js +58 -0
  76. package/dist/chunks/link-chip-cz5v6lw9icmcndzl.js.map +1 -0
  77. package/dist/chunks/links-display-dfaehepz86s2wxx1.js +20 -0
  78. package/dist/chunks/links-display-dfaehepz86s2wxx1.js.map +1 -0
  79. package/dist/chunks/menu-item-kyqq7o2krghxbpw5.js +178 -0
  80. package/dist/chunks/menu-item-kyqq7o2krghxbpw5.js.map +1 -0
  81. package/dist/chunks/{menubar-ir5gbjmsizsddz7g.js → menubar-56kqktsa5a28xyzj.js} +2 -2
  82. package/dist/chunks/{menubar-ir5gbjmsizsddz7g.js.map → menubar-56kqktsa5a28xyzj.js.map} +1 -1
  83. package/dist/chunks/{meter-o5yd7ctjf80vvyjx.js → meter-b5rnmibceu4z8i6a.js} +2 -2
  84. package/dist/chunks/{meter-o5yd7ctjf80vvyjx.js.map → meter-b5rnmibceu4z8i6a.js.map} +1 -1
  85. package/dist/chunks/notification-counter-hiq85elmcydnhzoo.js +30 -0
  86. package/dist/chunks/notification-counter-hiq85elmcydnhzoo.js.map +1 -0
  87. package/dist/chunks/overflowing-text-mm8bkx7voc6h8ra4.js +49 -0
  88. package/dist/chunks/overflowing-text-mm8bkx7voc6h8ra4.js.map +1 -0
  89. package/dist/chunks/{pagination-bryw6rohfr7mm3km.js → pagination-iczb9ooenevbxslx.js} +3 -3
  90. package/dist/chunks/{pagination-bryw6rohfr7mm3km.js.map → pagination-iczb9ooenevbxslx.js.map} +1 -1
  91. package/dist/chunks/phones-display-cdsrl07dv6obf4eg.js +19 -0
  92. package/dist/chunks/phones-display-cdsrl07dv6obf4eg.js.map +1 -0
  93. package/dist/chunks/pill-pfpvgbcnqhtyksz5.js +22 -0
  94. package/dist/chunks/pill-pfpvgbcnqhtyksz5.js.map +1 -0
  95. package/dist/chunks/{popover-elxcmvv7mu7m7uk4.js → popover-ldqdlpv6sqvkjume.js} +2 -2
  96. package/dist/chunks/{popover-elxcmvv7mu7m7uk4.js.map → popover-ldqdlpv6sqvkjume.js.map} +1 -1
  97. package/dist/chunks/{radio-newyq331uk4lltr6.js → radio-lyeniil3x20cyb8z.js} +2 -2
  98. package/dist/chunks/{radio-newyq331uk4lltr6.js.map → radio-lyeniil3x20cyb8z.js.map} +1 -1
  99. package/dist/chunks/rating-yyd4t8e62ast4obo.js +48 -0
  100. package/dist/chunks/rating-yyd4t8e62ast4obo.js.map +1 -0
  101. package/dist/chunks/record-board-iapx3cw5rusehrta.js +3395 -0
  102. package/dist/chunks/record-board-iapx3cw5rusehrta.js.map +1 -0
  103. package/dist/chunks/{select-h5480mbro0ypxu0b.js → select-hmoccee4zagd34tq.js} +6 -6
  104. package/dist/chunks/{select-h5480mbro0ypxu0b.js.map → select-hmoccee4zagd34tq.js.map} +1 -1
  105. package/dist/chunks/{sensitive-input-lqugq6uvx0lkpu0u.js → sensitive-input-nkfx72rduc7aijaf.js} +4 -4
  106. package/dist/chunks/{sensitive-input-lqugq6uvx0lkpu0u.js.map → sensitive-input-nkfx72rduc7aijaf.js.map} +1 -1
  107. package/dist/chunks/{sidebar-noz668nhdu2gso12.js → sidebar-gwfibai76tw069d4.js} +34 -33
  108. package/dist/chunks/sidebar-gwfibai76tw069d4.js.map +1 -0
  109. package/dist/chunks/status-ot0itdwxloqgahi0.js +29 -0
  110. package/dist/chunks/status-ot0itdwxloqgahi0.js.map +1 -0
  111. package/dist/chunks/{surface-cyxme7mlr49l33f8.js → surface-fqmma34ju0agh5pe.js} +2 -2
  112. package/dist/chunks/{surface-cyxme7mlr49l33f8.js.map → surface-fqmma34ju0agh5pe.js.map} +1 -1
  113. package/dist/chunks/{switch-bigo96fyjlh7ivbi.js → switch-nhtmn65n5s7gg6vb.js} +3 -3
  114. package/dist/chunks/{switch-bigo96fyjlh7ivbi.js.map → switch-nhtmn65n5s7gg6vb.js.map} +1 -1
  115. package/dist/chunks/{table-mwcmwp6a80zvyrxw.js → table-cjj894o3niouq4tg.js} +2 -2
  116. package/dist/chunks/{table-mwcmwp6a80zvyrxw.js.map → table-cjj894o3niouq4tg.js.map} +1 -1
  117. package/dist/chunks/{tabs-e4pcjkw94kpe35x0.js → tabs-klj6wapad6fpd9at.js} +14 -16
  118. package/dist/chunks/tabs-klj6wapad6fpd9at.js.map +1 -0
  119. package/dist/chunks/tag-h5kwf5eh7dyyvc2c.js +58 -0
  120. package/dist/chunks/tag-h5kwf5eh7dyyvc2c.js.map +1 -0
  121. package/dist/chunks/timeline-lqurr2lcxkayomk2.js +109 -0
  122. package/dist/chunks/timeline-lqurr2lcxkayomk2.js.map +1 -0
  123. package/dist/chunks/{toast-ivr4097bstjcjotf.js → toast-j47dl441zpxa1yw3.js} +3 -3
  124. package/dist/chunks/{toast-ivr4097bstjcjotf.js.map → toast-j47dl441zpxa1yw3.js.map} +1 -1
  125. package/dist/chunks/{tooltip-ncaia8n1lavkyw8n.js → tooltip-bkgxuz77xzg5fooc.js} +2 -2
  126. package/dist/chunks/{tooltip-ncaia8n1lavkyw8n.js.map → tooltip-bkgxuz77xzg5fooc.js.map} +1 -1
  127. package/dist/chunks/{vendor-base-ui-bgl9g5nkvqy3tn36.js → vendor-base-ui-djdjrfuoxlb1lubi.js} +2358 -2358
  128. package/dist/chunks/{vendor-base-ui-bgl9g5nkvqy3tn36.js.map → vendor-base-ui-djdjrfuoxlb1lubi.js.map} +1 -1
  129. package/dist/code.js +1 -1
  130. package/dist/components/actor-display.js +6 -0
  131. package/dist/components/actor-display.js.map +1 -0
  132. package/dist/components/address-input.js +6 -0
  133. package/dist/components/address-input.js.map +1 -0
  134. package/dist/components/array-display.js +6 -0
  135. package/dist/components/array-display.js.map +1 -0
  136. package/dist/components/autocomplete.js +1 -1
  137. package/dist/components/avatar-group.js +6 -0
  138. package/dist/components/avatar-group.js.map +1 -0
  139. package/dist/components/avatar.js +6 -0
  140. package/dist/components/avatar.js.map +1 -0
  141. package/dist/components/breadcrumbs.js +1 -1
  142. package/dist/components/button.js +1 -1
  143. package/dist/components/chart.js +1 -1
  144. package/dist/components/checkbox.js +1 -1
  145. package/dist/components/chip.js +8 -0
  146. package/dist/components/chip.js.map +1 -0
  147. package/dist/components/circular-progress-bar.js +6 -0
  148. package/dist/components/circular-progress-bar.js.map +1 -0
  149. package/dist/components/clipboard-text.js +1 -1
  150. package/dist/components/collapsible.js +1 -1
  151. package/dist/components/color-sample.js +6 -0
  152. package/dist/components/color-sample.js.map +1 -0
  153. package/dist/components/combobox.js +1 -1
  154. package/dist/components/command-palette.js +1 -1
  155. package/dist/components/data-grid.js +8 -0
  156. package/dist/components/data-grid.js.map +1 -0
  157. package/dist/components/dialog.js +1 -1
  158. package/dist/components/double-text-input.js +6 -0
  159. package/dist/components/double-text-input.js.map +1 -0
  160. package/dist/components/dropdown.js +1 -1
  161. package/dist/components/emails-display.js +6 -0
  162. package/dist/components/emails-display.js.map +1 -0
  163. package/dist/components/empty.js +1 -1
  164. package/dist/components/expandable-list.js +6 -0
  165. package/dist/components/expandable-list.js.map +1 -0
  166. package/dist/components/field.js +1 -1
  167. package/dist/components/input-group.js +1 -1
  168. package/dist/components/input.js +3 -3
  169. package/dist/components/json-display.js +6 -0
  170. package/dist/components/json-display.js.map +1 -0
  171. package/dist/components/label.js +1 -1
  172. package/dist/components/layer-card.js +1 -1
  173. package/dist/components/link-chip.js +6 -0
  174. package/dist/components/link-chip.js.map +1 -0
  175. package/dist/components/link.js +1 -1
  176. package/dist/components/links-display.js +6 -0
  177. package/dist/components/links-display.js.map +1 -0
  178. package/dist/components/menu-item.js +11 -0
  179. package/dist/components/menu-item.js.map +1 -0
  180. package/dist/components/menubar.js +1 -1
  181. package/dist/components/meter.js +1 -1
  182. package/dist/components/notification-counter.js +6 -0
  183. package/dist/components/notification-counter.js.map +1 -0
  184. package/dist/components/overflowing-text.js +6 -0
  185. package/dist/components/overflowing-text.js.map +1 -0
  186. package/dist/components/pagination.js +1 -1
  187. package/dist/components/phones-display.js +6 -0
  188. package/dist/components/phones-display.js.map +1 -0
  189. package/dist/components/pill.js +6 -0
  190. package/dist/components/pill.js.map +1 -0
  191. package/dist/components/popover.js +1 -1
  192. package/dist/components/radio.js +1 -1
  193. package/dist/components/rating.js +6 -0
  194. package/dist/components/rating.js.map +1 -0
  195. package/dist/components/record-board.js +8 -0
  196. package/dist/components/record-board.js.map +1 -0
  197. package/dist/components/select.js +1 -1
  198. package/dist/components/sensitive-input.js +1 -1
  199. package/dist/components/sidebar.js +1 -1
  200. package/dist/components/status.js +6 -0
  201. package/dist/components/status.js.map +1 -0
  202. package/dist/components/surface.js +1 -1
  203. package/dist/components/switch.js +1 -1
  204. package/dist/components/table.js +1 -1
  205. package/dist/components/tabs.js +1 -1
  206. package/dist/components/tag.js +10 -0
  207. package/dist/components/tag.js.map +1 -0
  208. package/dist/components/timeline.js +8 -0
  209. package/dist/components/timeline.js.map +1 -0
  210. package/dist/components/toast.js +2 -2
  211. package/dist/components/tooltip.js +1 -1
  212. package/dist/index.js +380 -251
  213. package/dist/index.js.map +1 -1
  214. package/dist/primitives/accordion.js +1 -1
  215. package/dist/primitives/alert-dialog.js +1 -1
  216. package/dist/primitives/autocomplete.js +1 -1
  217. package/dist/primitives/avatar.js +1 -1
  218. package/dist/primitives/button.js +1 -1
  219. package/dist/primitives/checkbox-group.js +1 -1
  220. package/dist/primitives/checkbox.js +1 -1
  221. package/dist/primitives/collapsible.js +1 -1
  222. package/dist/primitives/combobox.js +1 -1
  223. package/dist/primitives/context-menu.js +1 -1
  224. package/dist/primitives/csp-provider.js +1 -1
  225. package/dist/primitives/dialog.js +1 -1
  226. package/dist/primitives/direction-provider.js +1 -1
  227. package/dist/primitives/drawer.js +1 -1
  228. package/dist/primitives/field.js +1 -1
  229. package/dist/primitives/fieldset.js +1 -1
  230. package/dist/primitives/form.js +1 -1
  231. package/dist/primitives/input.js +1 -1
  232. package/dist/primitives/menu.js +1 -1
  233. package/dist/primitives/menubar.js +1 -1
  234. package/dist/primitives/meter.js +1 -1
  235. package/dist/primitives/navigation-menu.js +1 -1
  236. package/dist/primitives/number-field.js +1 -1
  237. package/dist/primitives/otp-field.js +1 -1
  238. package/dist/primitives/popover.js +1 -1
  239. package/dist/primitives/preview-card.js +1 -1
  240. package/dist/primitives/progress.js +1 -1
  241. package/dist/primitives/radio-group.js +1 -1
  242. package/dist/primitives/radio.js +1 -1
  243. package/dist/primitives/scroll-area.js +1 -1
  244. package/dist/primitives/select.js +1 -1
  245. package/dist/primitives/separator.js +1 -1
  246. package/dist/primitives/slider.js +1 -1
  247. package/dist/primitives/switch.js +1 -1
  248. package/dist/primitives/tabs.js +1 -1
  249. package/dist/primitives/toast.js +1 -1
  250. package/dist/primitives/toggle-group.js +1 -1
  251. package/dist/primitives/toggle.js +1 -1
  252. package/dist/primitives/toolbar.js +1 -1
  253. package/dist/primitives/tooltip.js +1 -1
  254. package/dist/primitives.js +1 -1
  255. package/dist/scripts/theme-generator/config.d.ts.map +1 -1
  256. package/dist/scripts/theme-generator/config.js +229 -5
  257. package/dist/scripts/theme-generator/config.js.map +1 -1
  258. package/dist/src/components/actor-display/actor-display.d.ts +33 -0
  259. package/dist/src/components/actor-display/actor-display.d.ts.map +1 -0
  260. package/dist/src/components/actor-display/index.d.ts +2 -0
  261. package/dist/src/components/actor-display/index.d.ts.map +1 -0
  262. package/dist/src/components/address-input/address-input.d.ts +42 -0
  263. package/dist/src/components/address-input/address-input.d.ts.map +1 -0
  264. package/dist/src/components/address-input/index.d.ts +2 -0
  265. package/dist/src/components/address-input/index.d.ts.map +1 -0
  266. package/dist/src/components/array-display/array-display.d.ts +30 -0
  267. package/dist/src/components/array-display/array-display.d.ts.map +1 -0
  268. package/dist/src/components/array-display/index.d.ts +2 -0
  269. package/dist/src/components/array-display/index.d.ts.map +1 -0
  270. package/dist/src/components/avatar/avatar.d.ts +80 -0
  271. package/dist/src/components/avatar/avatar.d.ts.map +1 -0
  272. package/dist/src/components/avatar/index.d.ts +2 -0
  273. package/dist/src/components/avatar/index.d.ts.map +1 -0
  274. package/dist/src/components/avatar-group/avatar-group.d.ts +35 -0
  275. package/dist/src/components/avatar-group/avatar-group.d.ts.map +1 -0
  276. package/dist/src/components/avatar-group/index.d.ts +2 -0
  277. package/dist/src/components/avatar-group/index.d.ts.map +1 -0
  278. package/dist/src/components/button/button.d.ts +4 -4
  279. package/dist/src/components/chip/chip.d.ts +78 -0
  280. package/dist/src/components/chip/chip.d.ts.map +1 -0
  281. package/dist/src/components/chip/index.d.ts +2 -0
  282. package/dist/src/components/chip/index.d.ts.map +1 -0
  283. package/dist/src/components/circular-progress-bar/circular-progress-bar.d.ts +35 -0
  284. package/dist/src/components/circular-progress-bar/circular-progress-bar.d.ts.map +1 -0
  285. package/dist/src/components/circular-progress-bar/index.d.ts +2 -0
  286. package/dist/src/components/circular-progress-bar/index.d.ts.map +1 -0
  287. package/dist/src/components/color-sample/color-sample.d.ts +56 -0
  288. package/dist/src/components/color-sample/color-sample.d.ts.map +1 -0
  289. package/dist/src/components/color-sample/index.d.ts +2 -0
  290. package/dist/src/components/color-sample/index.d.ts.map +1 -0
  291. package/dist/src/components/data-grid/data-grid.d.ts +25 -0
  292. package/dist/src/components/data-grid/data-grid.d.ts.map +1 -0
  293. package/dist/src/components/data-grid/index.d.ts +3 -0
  294. package/dist/src/components/data-grid/index.d.ts.map +1 -0
  295. package/dist/src/components/data-grid/types.d.ts +103 -0
  296. package/dist/src/components/data-grid/types.d.ts.map +1 -0
  297. package/dist/src/components/data-grid/use-data-grid-edit.d.ts +34 -0
  298. package/dist/src/components/data-grid/use-data-grid-edit.d.ts.map +1 -0
  299. package/dist/src/components/double-text-input/double-text-input.d.ts +47 -0
  300. package/dist/src/components/double-text-input/double-text-input.d.ts.map +1 -0
  301. package/dist/src/components/double-text-input/index.d.ts +2 -0
  302. package/dist/src/components/double-text-input/index.d.ts.map +1 -0
  303. package/dist/src/components/emails-display/emails-display.d.ts +30 -0
  304. package/dist/src/components/emails-display/emails-display.d.ts.map +1 -0
  305. package/dist/src/components/emails-display/index.d.ts +2 -0
  306. package/dist/src/components/emails-display/index.d.ts.map +1 -0
  307. package/dist/src/components/expandable-list/expandable-list.d.ts +41 -0
  308. package/dist/src/components/expandable-list/expandable-list.d.ts.map +1 -0
  309. package/dist/src/components/expandable-list/index.d.ts +2 -0
  310. package/dist/src/components/expandable-list/index.d.ts.map +1 -0
  311. package/dist/src/components/json-display/index.d.ts +2 -0
  312. package/dist/src/components/json-display/index.d.ts.map +1 -0
  313. package/dist/src/components/json-display/json-display.d.ts +29 -0
  314. package/dist/src/components/json-display/json-display.d.ts.map +1 -0
  315. package/dist/src/components/link-chip/index.d.ts +2 -0
  316. package/dist/src/components/link-chip/index.d.ts.map +1 -0
  317. package/dist/src/components/link-chip/link-chip.d.ts +50 -0
  318. package/dist/src/components/link-chip/link-chip.d.ts.map +1 -0
  319. package/dist/src/components/links-display/index.d.ts +2 -0
  320. package/dist/src/components/links-display/index.d.ts.map +1 -0
  321. package/dist/src/components/links-display/links-display.d.ts +37 -0
  322. package/dist/src/components/links-display/links-display.d.ts.map +1 -0
  323. package/dist/src/components/menu-item/index.d.ts +2 -0
  324. package/dist/src/components/menu-item/index.d.ts.map +1 -0
  325. package/dist/src/components/menu-item/menu-item.d.ts +104 -0
  326. package/dist/src/components/menu-item/menu-item.d.ts.map +1 -0
  327. package/dist/src/components/notification-counter/index.d.ts +2 -0
  328. package/dist/src/components/notification-counter/index.d.ts.map +1 -0
  329. package/dist/src/components/notification-counter/notification-counter.d.ts +51 -0
  330. package/dist/src/components/notification-counter/notification-counter.d.ts.map +1 -0
  331. package/dist/src/components/overflowing-text/index.d.ts +2 -0
  332. package/dist/src/components/overflowing-text/index.d.ts.map +1 -0
  333. package/dist/src/components/overflowing-text/overflowing-text.d.ts +48 -0
  334. package/dist/src/components/overflowing-text/overflowing-text.d.ts.map +1 -0
  335. package/dist/src/components/phones-display/index.d.ts +2 -0
  336. package/dist/src/components/phones-display/index.d.ts.map +1 -0
  337. package/dist/src/components/phones-display/phones-display.d.ts +31 -0
  338. package/dist/src/components/phones-display/phones-display.d.ts.map +1 -0
  339. package/dist/src/components/pill/index.d.ts +2 -0
  340. package/dist/src/components/pill/index.d.ts.map +1 -0
  341. package/dist/src/components/pill/pill.d.ts +31 -0
  342. package/dist/src/components/pill/pill.d.ts.map +1 -0
  343. package/dist/src/components/rating/index.d.ts +2 -0
  344. package/dist/src/components/rating/index.d.ts.map +1 -0
  345. package/dist/src/components/rating/rating.d.ts +37 -0
  346. package/dist/src/components/rating/rating.d.ts.map +1 -0
  347. package/dist/src/components/record-board/index.d.ts +2 -0
  348. package/dist/src/components/record-board/index.d.ts.map +1 -0
  349. package/dist/src/components/record-board/record-board.d.ts +75 -0
  350. package/dist/src/components/record-board/record-board.d.ts.map +1 -0
  351. package/dist/src/components/sidebar/sidebar.d.ts.map +1 -1
  352. package/dist/src/components/status/index.d.ts +2 -0
  353. package/dist/src/components/status/index.d.ts.map +1 -0
  354. package/dist/src/components/status/status.d.ts +52 -0
  355. package/dist/src/components/status/status.d.ts.map +1 -0
  356. package/dist/src/components/tabs/tabs.d.ts.map +1 -1
  357. package/dist/src/components/tag/index.d.ts +2 -0
  358. package/dist/src/components/tag/index.d.ts.map +1 -0
  359. package/dist/src/components/tag/tag.d.ts +153 -0
  360. package/dist/src/components/tag/tag.d.ts.map +1 -0
  361. package/dist/src/components/timeline/index.d.ts +2 -0
  362. package/dist/src/components/timeline/index.d.ts.map +1 -0
  363. package/dist/src/components/timeline/timeline.d.ts +155 -0
  364. package/dist/src/components/timeline/timeline.d.ts.map +1 -0
  365. package/dist/src/index.d.ts +26 -0
  366. package/dist/src/index.d.ts.map +1 -1
  367. package/dist/src/utils/use-is-dark-mode.d.ts +18 -0
  368. package/dist/src/utils/use-is-dark-mode.d.ts.map +1 -0
  369. package/dist/styles/reki-standalone.css +1 -1
  370. package/dist/styles/reki.css +19 -0
  371. package/dist/styles/theme-fedramp.css +6 -0
  372. package/dist/styles/theme-reki.css +164 -10
  373. package/package.json +118 -4
  374. package/scripts/component-registry/index.ts +6 -11
  375. package/scripts/extract-demo-examples.ts +323 -0
  376. package/scripts/generate-stories.ts +205 -0
  377. package/scripts/theme-generator/config.ts +230 -5
  378. package/dist/chunks/button-nc5p1h28cwes0tjw.js.map +0 -1
  379. package/dist/chunks/command-palette-fe5cjfdgsg3t17vq.js.map +0 -1
  380. package/dist/chunks/sidebar-noz668nhdu2gso12.js.map +0 -1
  381. package/dist/chunks/tabs-e4pcjkw94kpe35x0.js.map +0 -1
@@ -0,0 +1,323 @@
1
+ #!/usr/bin/env npx tsx
2
+ /**
3
+ * Extract Demo Examples for AI/Agent Consumption
4
+ *
5
+ * This script parses *Demo.tsx files in `src/demos/` and extracts usable code
6
+ * examples for the component registry and the Storybook story generator. Demo
7
+ * files contain clean, production-ready examples suitable for AI consumption.
8
+ *
9
+ * Run: pnpm codegen:demos
10
+ * Output: .cache/demo-metadata.json
11
+ * (consumed by scripts/component-registry and scripts/generate-stories)
12
+ *
13
+ * Demo file naming convention:
14
+ * {Component}Demo.tsx -> exports functions like {Component}{Variant}Demo
15
+ * e.g., ButtonDemo.tsx -> ButtonBasicDemo, ButtonPrimaryDemo, etc.
16
+ */
17
+
18
+ import {
19
+ readFileSync,
20
+ writeFileSync,
21
+ readdirSync,
22
+ mkdirSync,
23
+ statSync,
24
+ } from "node:fs";
25
+ import { dirname, join, basename, sep } from "node:path";
26
+ import { fileURLToPath } from "node:url";
27
+ import * as ts from "typescript";
28
+
29
+ const __dirname = dirname(fileURLToPath(import.meta.url));
30
+ const demosDir = join(__dirname, "../src/demos");
31
+ const outputDir = join(__dirname, "../.cache");
32
+
33
+ // =============================================================================
34
+ // Types
35
+ // =============================================================================
36
+
37
+ interface ExtractedDemo {
38
+ /** Function name (e.g., "ButtonPrimaryDemo") */
39
+ name: string;
40
+ /** The JSX code extracted from the return statement */
41
+ code: string;
42
+ /** Description extracted from JSDoc if present */
43
+ description?: string;
44
+ }
45
+
46
+ interface ComponentDemos {
47
+ /** Component name (e.g., "Button") */
48
+ componentName: string;
49
+ /** Source file name (e.g., "ButtonDemo.tsx") */
50
+ sourceFile: string;
51
+ /**
52
+ * Path relative to src/demos without extension, posix-style
53
+ * (e.g. "ButtonDemo" or "Chart/ChartDemo"). Used by the story generator to
54
+ * resolve the demo module import.
55
+ */
56
+ relativePath: string;
57
+ /** Extracted demo examples */
58
+ demos: ExtractedDemo[];
59
+ }
60
+
61
+ export interface DemoMetadata {
62
+ /** ISO timestamp of generation */
63
+ generatedAt: string;
64
+ /** Version for cache invalidation */
65
+ version: string;
66
+ /** Map of component name to its demos */
67
+ components: Record<string, ComponentDemos>;
68
+ }
69
+
70
+ // =============================================================================
71
+ // AST Helpers
72
+ // =============================================================================
73
+
74
+ function getNodeText(node: ts.Node, sourceFile: ts.SourceFile): string {
75
+ return node.getText(sourceFile);
76
+ }
77
+
78
+ /**
79
+ * Extract JSDoc description from a function declaration
80
+ */
81
+ function extractJSDocDescription(
82
+ node: ts.FunctionDeclaration,
83
+ sourceFile: ts.SourceFile,
84
+ ): string | undefined {
85
+ const fullText = sourceFile.getFullText();
86
+ const nodeStart = node.getFullStart();
87
+
88
+ // Look for JSDoc comment before the function
89
+ const textBefore = fullText.slice(0, nodeStart);
90
+ const jsdocMatch = textBefore.match(/\/\*\*\s*\n([^]*?)\*\/\s*$/);
91
+
92
+ if (jsdocMatch) {
93
+ const jsdocContent = jsdocMatch[1];
94
+ const lines = jsdocContent
95
+ .split("\n")
96
+ .map((line) => line.replace(/^\s*\*\s?/, "").trim())
97
+ .filter((line) => line.length > 0 && !line.startsWith("@"));
98
+
99
+ if (lines.length > 0) {
100
+ return lines.join(" ");
101
+ }
102
+ }
103
+
104
+ return undefined;
105
+ }
106
+
107
+ /**
108
+ * Clean up extracted JSX code for readability
109
+ */
110
+ function cleanupJSX(jsx: string): string {
111
+ jsx = jsx.trim();
112
+
113
+ // Remove wrapping parentheses (common in return statements)
114
+ if (jsx.startsWith("(") && jsx.endsWith(")")) {
115
+ jsx = jsx.slice(1, -1).trim();
116
+ }
117
+
118
+ return jsx;
119
+ }
120
+
121
+ /**
122
+ * Extract the return JSX from a function body
123
+ */
124
+ function extractReturnJSX(
125
+ body: ts.Block,
126
+ sourceFile: ts.SourceFile,
127
+ ): string | null {
128
+ let returnJSX: string | null = null;
129
+
130
+ ts.forEachChild(body, (child) => {
131
+ if (ts.isReturnStatement(child) && child.expression) {
132
+ returnJSX = cleanupJSX(getNodeText(child.expression, sourceFile));
133
+ }
134
+ });
135
+
136
+ return returnJSX;
137
+ }
138
+
139
+ /**
140
+ * Extract the return JSX from an arrow function
141
+ */
142
+ function extractArrowFunctionJSX(
143
+ node: ts.ArrowFunction,
144
+ sourceFile: ts.SourceFile,
145
+ ): string | null {
146
+ // Block body: () => { return <JSX /> }
147
+ if (ts.isBlock(node.body)) {
148
+ return extractReturnJSX(node.body, sourceFile);
149
+ }
150
+
151
+ // Expression body: () => <JSX />
152
+ return cleanupJSX(getNodeText(node.body, sourceFile));
153
+ }
154
+
155
+ // =============================================================================
156
+ // Demo File Parser
157
+ // =============================================================================
158
+
159
+ /**
160
+ * Parse a demo file and extract all exported demo functions
161
+ */
162
+ function parseDemoFile(filePath: string): ComponentDemos | null {
163
+ const relativePath = filePath
164
+ .slice(demosDir.length + 1)
165
+ .replace(/\.tsx$/, "")
166
+ .split(sep)
167
+ .join("/");
168
+ const content = readFileSync(filePath, "utf-8");
169
+ const sourceFile = ts.createSourceFile(
170
+ filePath,
171
+ content,
172
+ ts.ScriptTarget.Latest,
173
+ true,
174
+ ts.ScriptKind.TSX,
175
+ );
176
+
177
+ // Extract component name from file path (e.g., ButtonDemo.tsx -> Button)
178
+ const fileName = basename(filePath, ".tsx");
179
+ const componentMatch = fileName.match(/^(.+)Demo$/);
180
+ if (!componentMatch) {
181
+ console.warn(`Skipping ${fileName}: doesn't match *Demo.tsx pattern`);
182
+ return null;
183
+ }
184
+
185
+ const componentName = componentMatch[1];
186
+ const demos: ExtractedDemo[] = [];
187
+
188
+ // Find all exported function declarations
189
+ ts.forEachChild(sourceFile, (node) => {
190
+ // Handle: export function FooDemo() { ... }
191
+ if (
192
+ ts.isFunctionDeclaration(node) &&
193
+ node.modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword) &&
194
+ node.name &&
195
+ node.body
196
+ ) {
197
+ const funcName = node.name.text;
198
+
199
+ // Only include functions that end with "Demo"
200
+ if (!funcName.endsWith("Demo")) {
201
+ return;
202
+ }
203
+
204
+ const jsx = extractReturnJSX(node.body, sourceFile);
205
+ if (jsx) {
206
+ demos.push({
207
+ name: funcName,
208
+ code: jsx,
209
+ description: extractJSDocDescription(node, sourceFile),
210
+ });
211
+ }
212
+ }
213
+
214
+ // Handle: export const FooDemo = () => { ... }
215
+ if (
216
+ ts.isVariableStatement(node) &&
217
+ node.modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)
218
+ ) {
219
+ for (const decl of node.declarationList.declarations) {
220
+ if (
221
+ ts.isIdentifier(decl.name) &&
222
+ decl.initializer &&
223
+ ts.isArrowFunction(decl.initializer)
224
+ ) {
225
+ const funcName = decl.name.text;
226
+
227
+ // Only include functions that end with "Demo"
228
+ if (!funcName.endsWith("Demo")) {
229
+ continue;
230
+ }
231
+
232
+ const jsx = extractArrowFunctionJSX(decl.initializer, sourceFile);
233
+ if (jsx) {
234
+ demos.push({
235
+ name: funcName,
236
+ code: jsx,
237
+ });
238
+ }
239
+ }
240
+ }
241
+ }
242
+ });
243
+
244
+ if (demos.length === 0) {
245
+ console.warn(`No demos found in ${fileName}`);
246
+ return null;
247
+ }
248
+
249
+ return {
250
+ componentName,
251
+ sourceFile: basename(filePath),
252
+ relativePath,
253
+ demos,
254
+ };
255
+ }
256
+
257
+ // =============================================================================
258
+ // Main
259
+ // =============================================================================
260
+
261
+ /**
262
+ * Recursively find all *Demo.tsx files in a directory
263
+ */
264
+ function findDemoFiles(dir: string, baseDir: string = dir): string[] {
265
+ const entries = readdirSync(dir);
266
+ const files: string[] = [];
267
+
268
+ for (const entry of entries) {
269
+ if (entry.startsWith("_")) continue;
270
+
271
+ const fullPath = join(dir, entry);
272
+ const stat = statSync(fullPath);
273
+
274
+ if (stat.isDirectory()) {
275
+ files.push(...findDemoFiles(fullPath, baseDir));
276
+ } else if (entry.endsWith("Demo.tsx")) {
277
+ files.push(fullPath);
278
+ }
279
+ }
280
+
281
+ return files;
282
+ }
283
+
284
+ function main() {
285
+ console.log("Extracting demo examples from src/demos...\n");
286
+
287
+ // Find all demo files recursively
288
+ const files = findDemoFiles(demosDir);
289
+
290
+ console.log(`Found ${files.length} demo files\n`);
291
+
292
+ const metadata: DemoMetadata = {
293
+ generatedAt: new Date().toISOString(),
294
+ version: "1.0.0",
295
+ components: {},
296
+ };
297
+
298
+ let totalDemos = 0;
299
+
300
+ for (const filePath of files) {
301
+ const result = parseDemoFile(filePath);
302
+
303
+ if (result) {
304
+ metadata.components[result.componentName] = result;
305
+ totalDemos += result.demos.length;
306
+ console.log(
307
+ ` ${result.componentName}: ${result.demos.length} demos extracted`,
308
+ );
309
+ }
310
+ }
311
+
312
+ // Ensure output directory exists
313
+ mkdirSync(outputDir, { recursive: true });
314
+
315
+ // Write metadata file
316
+ const outputPath = join(outputDir, "demo-metadata.json");
317
+ writeFileSync(outputPath, JSON.stringify(metadata, null, 2));
318
+
319
+ console.log(`\n✓ Extracted ${totalDemos} demos from ${files.length} files`);
320
+ console.log(`✓ Wrote ${outputPath}`);
321
+ }
322
+
323
+ main();
@@ -0,0 +1,205 @@
1
+ #!/usr/bin/env npx tsx
2
+ /**
3
+ * Generate Storybook stories from demo metadata.
4
+ *
5
+ * Reads `.cache/demo-metadata.json` (produced by `extract-demo-examples.ts`)
6
+ * and emits one colocated `<name>.stories.tsx` next to every demo file under
7
+ * `src/demos/`. Each exported `*Demo` function becomes a single story that
8
+ * renders the demo. Demos remain the single source of truth — never edit the
9
+ * generated stories by hand; edit the demo and re-run `pnpm codegen:stories`.
10
+ *
11
+ * Run: pnpm codegen:stories
12
+ */
13
+
14
+ import {
15
+ readFileSync,
16
+ writeFileSync,
17
+ existsSync,
18
+ readdirSync,
19
+ unlinkSync,
20
+ } from "node:fs";
21
+ import { dirname, join, basename } from "node:path";
22
+ import { fileURLToPath } from "node:url";
23
+
24
+ const __dirname = dirname(fileURLToPath(import.meta.url));
25
+ const demosDir = join(__dirname, "../src/demos");
26
+ const indexPath = join(__dirname, "../src/index.ts");
27
+ const metadataPath = join(__dirname, "../.cache/demo-metadata.json");
28
+
29
+ interface ExtractedDemo {
30
+ name: string;
31
+ code: string;
32
+ description?: string;
33
+ }
34
+ interface ComponentDemos {
35
+ componentName: string;
36
+ sourceFile: string;
37
+ relativePath: string;
38
+ demos: ExtractedDemo[];
39
+ }
40
+ interface DemoMetadata {
41
+ generatedAt: string;
42
+ version: string;
43
+ components: Record<string, ComponentDemos>;
44
+ }
45
+
46
+ /**
47
+ * Collect the value (non-type) identifiers re-exported from the package
48
+ * barrel, so we only wire `component` + autodocs prop tables for demos whose
49
+ * component is actually exported.
50
+ */
51
+ function loadExportedSymbols(): Set<string> {
52
+ const src = readFileSync(indexPath, "utf-8");
53
+ const symbols = new Set<string>();
54
+ const blockRe = /export\s*\{([^}]*)\}/g;
55
+ let m: RegExpExecArray | null;
56
+ while ((m = blockRe.exec(src))) {
57
+ for (const raw of m[1].split(",")) {
58
+ const part = raw.trim();
59
+ if (!part || part.startsWith("type ")) continue;
60
+ // Handle `Foo as Bar` -> exported name is the alias.
61
+ const name = part.includes(" as ")
62
+ ? part.split(" as ")[1].trim()
63
+ : part;
64
+ if (/^[A-Za-z_$][\w$]*$/.test(name)) symbols.add(name);
65
+ }
66
+ }
67
+ return symbols;
68
+ }
69
+
70
+ /**
71
+ * Components exported as a compound "parts" namespace (e.g. `Toast.Provider`,
72
+ * `Toast.Root`) rather than a single renderable component. `satisfies
73
+ * Meta<typeof X>` rejects these, so we generate them render-only (no autodocs
74
+ * `component`, hence no prop table).
75
+ */
76
+ const COMPOUND_NAMESPACE_EXPORTS = new Set<string>([
77
+ "Toast",
78
+ "CommandPalette",
79
+ ]);
80
+
81
+ /** Turn a demo function name into a readable, unique story label/identifier. */
82
+ function storyLabel(demoName: string, componentName: string): string {
83
+ let base = demoName.replace(/Demo$/, "");
84
+ if (base.startsWith(componentName)) base = base.slice(componentName.length);
85
+ if (!base) base = "Default";
86
+ return base;
87
+ }
88
+
89
+ /** Split a PascalCase identifier into spaced words for the sidebar name. */
90
+ function humanize(label: string): string {
91
+ return (
92
+ label
93
+ .replace(/([a-z0-9])([A-Z])/g, "$1 $2")
94
+ .replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2")
95
+ .trim() || label
96
+ );
97
+ }
98
+
99
+ function escapeForTemplate(text: string): string {
100
+ return text.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
101
+ }
102
+
103
+ function generateStoryFile(
104
+ comp: ComponentDemos,
105
+ exported: Set<string>,
106
+ ): string {
107
+ const { componentName, relativePath, demos } = comp;
108
+ const demoModule = `./${basename(relativePath)}`;
109
+ const hasComponent =
110
+ exported.has(componentName) &&
111
+ !COMPOUND_NAMESPACE_EXPORTS.has(componentName);
112
+
113
+ const lines: string[] = [];
114
+ lines.push(
115
+ "// AUTO-GENERATED by scripts/generate-stories.ts — do not edit.",
116
+ `// Source of truth: src/demos/${relativePath}.tsx`,
117
+ "// Edit the demo, then run \`pnpm codegen:stories\`.",
118
+ 'import type { Meta, StoryObj } from "@storybook/react-vite";',
119
+ `import * as demos from "${demoModule}";`,
120
+ );
121
+ if (hasComponent) {
122
+ lines.push(`import { ${componentName} } from "@cloudraker/reki";`);
123
+ }
124
+ lines.push("");
125
+
126
+ // Explicit `: Meta` annotation (not `satisfies Meta<typeof X>`): keeps the
127
+ // exported `meta` type portable so compound components with attached
128
+ // subcomponents (e.g. `Autocomplete.Item`) don't leak private names into the
129
+ // emitted declarations, while still wiring `component` for autodocs.
130
+ lines.push("const meta: Meta = {", ` title: "Components/${componentName}",`);
131
+ if (hasComponent) lines.push(` component: ${componentName},`);
132
+ lines.push(' tags: ["autodocs"],', "};");
133
+ // Plain `StoryObj` (not bound to `typeof meta`) so render-only stories don't
134
+ // trip the "args required" rule for components with required props.
135
+ lines.push("", "export default meta;", "type Story = StoryObj;", "");
136
+
137
+ const usedIdents = new Set<string>();
138
+ for (const demo of demos) {
139
+ let ident = storyLabel(demo.name, componentName);
140
+ // Ensure a valid, unique export identifier.
141
+ if (!/^[A-Za-z_$]/.test(ident)) ident = `Story${ident}`;
142
+ let unique = ident;
143
+ let n = 2;
144
+ while (usedIdents.has(unique)) unique = `${ident}${n++}`;
145
+ usedIdents.add(unique);
146
+
147
+ const name = humanize(storyLabel(demo.name, componentName));
148
+ lines.push(`export const ${unique}: Story = {`);
149
+ lines.push(` name: "${escapeForTemplate(name)}",`);
150
+ lines.push(` render: () => <demos.${demo.name} />,`);
151
+ if (demo.description) {
152
+ lines.push(" parameters: {");
153
+ lines.push(" docs: {");
154
+ lines.push(
155
+ ` description: { story: "${escapeForTemplate(demo.description)}" },`,
156
+ );
157
+ lines.push(" },");
158
+ lines.push(" },");
159
+ }
160
+ lines.push("};", "");
161
+ }
162
+
163
+ return lines.join("\n");
164
+ }
165
+
166
+ /** Remove previously generated story files so deletions/renames don't linger. */
167
+ function cleanExistingStories(dir: string): void {
168
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
169
+ const full = join(dir, entry.name);
170
+ if (entry.isDirectory()) {
171
+ cleanExistingStories(full);
172
+ } else if (entry.name.endsWith(".stories.tsx")) {
173
+ unlinkSync(full);
174
+ }
175
+ }
176
+ }
177
+
178
+ function main() {
179
+ if (!existsSync(metadataPath)) {
180
+ console.error(
181
+ `demo-metadata.json not found at ${metadataPath}. Run 'pnpm codegen:demos' first.`,
182
+ );
183
+ process.exit(1);
184
+ }
185
+
186
+ const metadata: DemoMetadata = JSON.parse(readFileSync(metadataPath, "utf-8"));
187
+ const exported = loadExportedSymbols();
188
+
189
+ cleanExistingStories(demosDir);
190
+
191
+ let count = 0;
192
+ let withComponent = 0;
193
+ for (const comp of Object.values(metadata.components)) {
194
+ const outPath = join(demosDir, `${comp.relativePath}.stories.tsx`);
195
+ writeFileSync(outPath, generateStoryFile(comp, exported));
196
+ count++;
197
+ if (exported.has(comp.componentName)) withComponent++;
198
+ }
199
+
200
+ console.log(
201
+ `✓ Generated ${count} story files (${withComponent} with autodocs component, ${count - withComponent} render-only).`,
202
+ );
203
+ }
204
+
205
+ main();