@nori-ui/core 0.0.5 → 1.0.2

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 (387) hide show
  1. package/dist/animation/animated-view.cjs +13 -0
  2. package/dist/animation/animated-view.cjs.map +1 -0
  3. package/dist/animation/animated-view.d.cts +6 -0
  4. package/dist/animation/animated-view.d.ts +6 -0
  5. package/dist/animation/animated-view.js +4 -0
  6. package/dist/animation/animated-view.js.map +1 -0
  7. package/dist/animation/animated-view.web.cjs +9 -0
  8. package/dist/animation/animated-view.web.cjs.map +1 -0
  9. package/dist/animation/animated-view.web.d.cts +5 -0
  10. package/dist/animation/animated-view.web.d.ts +5 -0
  11. package/dist/animation/animated-view.web.js +8 -0
  12. package/dist/animation/animated-view.web.js.map +1 -0
  13. package/dist/animation/use-animated-number.cjs +80 -0
  14. package/dist/animation/use-animated-number.cjs.map +1 -0
  15. package/dist/animation/use-animated-number.d.cts +8 -0
  16. package/dist/animation/use-animated-number.d.ts +8 -0
  17. package/dist/animation/use-animated-number.js +4 -0
  18. package/dist/animation/use-animated-number.js.map +1 -0
  19. package/dist/animation/use-animated-number.web.cjs +28 -0
  20. package/dist/animation/use-animated-number.web.cjs.map +1 -0
  21. package/dist/animation/use-animated-number.web.d.cts +8 -0
  22. package/dist/animation/use-animated-number.web.d.ts +8 -0
  23. package/dist/animation/use-animated-number.web.js +25 -0
  24. package/dist/animation/use-animated-number.web.js.map +1 -0
  25. package/dist/{chunk-RX7UULY3.js → chunk-33S7ADWM.js} +3 -3
  26. package/dist/{chunk-RX7UULY3.js.map → chunk-33S7ADWM.js.map} +1 -1
  27. package/dist/chunk-3BDDPFCI.js +108 -0
  28. package/dist/chunk-3BDDPFCI.js.map +1 -0
  29. package/dist/chunk-3F4TXKDY.js +314 -0
  30. package/dist/chunk-3F4TXKDY.js.map +1 -0
  31. package/dist/chunk-5A2QOOVN.js +15 -0
  32. package/dist/chunk-5A2QOOVN.js.map +1 -0
  33. package/dist/chunk-5XEGZFG5.js +208 -0
  34. package/dist/chunk-5XEGZFG5.js.map +1 -0
  35. package/dist/chunk-6AD6KCVB.js +178 -0
  36. package/dist/chunk-6AD6KCVB.js.map +1 -0
  37. package/dist/chunk-7GPDNQSX.js +967 -0
  38. package/dist/chunk-7GPDNQSX.js.map +1 -0
  39. package/dist/chunk-7UKRN73P.js +42 -0
  40. package/dist/chunk-7UKRN73P.js.map +1 -0
  41. package/dist/chunk-7Z4NMNX6.js +64 -0
  42. package/dist/chunk-7Z4NMNX6.js.map +1 -0
  43. package/dist/chunk-ACLHDHX3.js +29 -0
  44. package/dist/chunk-ACLHDHX3.js.map +1 -0
  45. package/dist/chunk-BZLT6R62.js +80 -0
  46. package/dist/chunk-BZLT6R62.js.map +1 -0
  47. package/dist/chunk-CCUXO2HN.js +450 -0
  48. package/dist/chunk-CCUXO2HN.js.map +1 -0
  49. package/dist/chunk-CHXHRJNZ.js +43 -0
  50. package/dist/chunk-CHXHRJNZ.js.map +1 -0
  51. package/dist/chunk-DDGMLLS3.js +188 -0
  52. package/dist/chunk-DDGMLLS3.js.map +1 -0
  53. package/dist/chunk-EWWQQ5DB.js +654 -0
  54. package/dist/chunk-EWWQQ5DB.js.map +1 -0
  55. package/dist/chunk-FEPTH5RV.js +169 -0
  56. package/dist/chunk-FEPTH5RV.js.map +1 -0
  57. package/dist/{chunk-SSTXLK5I.js → chunk-FT2XBBQJ.js} +42 -6
  58. package/dist/chunk-FT2XBBQJ.js.map +1 -0
  59. package/dist/chunk-IKLA2CVQ.js +260 -0
  60. package/dist/chunk-IKLA2CVQ.js.map +1 -0
  61. package/dist/chunk-JQQ3FBN7.js +18 -0
  62. package/dist/chunk-JQQ3FBN7.js.map +1 -0
  63. package/dist/chunk-JSAG5YO7.js +69 -0
  64. package/dist/chunk-JSAG5YO7.js.map +1 -0
  65. package/dist/chunk-JZ774T7U.js +76 -0
  66. package/dist/chunk-JZ774T7U.js.map +1 -0
  67. package/dist/chunk-KWRDJPP3.js +10 -0
  68. package/dist/chunk-KWRDJPP3.js.map +1 -0
  69. package/dist/chunk-LVWNMQGR.js +1106 -0
  70. package/dist/chunk-LVWNMQGR.js.map +1 -0
  71. package/dist/chunk-LWLK6HSW.js +143 -0
  72. package/dist/chunk-LWLK6HSW.js.map +1 -0
  73. package/dist/chunk-MDOZGILD.js +134 -0
  74. package/dist/chunk-MDOZGILD.js.map +1 -0
  75. package/dist/chunk-MKSDYRWQ.js +446 -0
  76. package/dist/chunk-MKSDYRWQ.js.map +1 -0
  77. package/dist/chunk-MRJWPRCX.js +80 -0
  78. package/dist/chunk-MRJWPRCX.js.map +1 -0
  79. package/dist/chunk-NRYWNOG5.js +410 -0
  80. package/dist/chunk-NRYWNOG5.js.map +1 -0
  81. package/dist/chunk-OMU4R4Y5.js +144 -0
  82. package/dist/chunk-OMU4R4Y5.js.map +1 -0
  83. package/dist/chunk-PNP7L4TA.js +103 -0
  84. package/dist/chunk-PNP7L4TA.js.map +1 -0
  85. package/dist/chunk-QI6646JZ.js +3 -0
  86. package/dist/{chunk-UAKFCMWK.js.map → chunk-QI6646JZ.js.map} +1 -1
  87. package/dist/chunk-QJNV7YQP.js +138 -0
  88. package/dist/chunk-QJNV7YQP.js.map +1 -0
  89. package/dist/chunk-R5JMDDCB.js +292 -0
  90. package/dist/chunk-R5JMDDCB.js.map +1 -0
  91. package/dist/chunk-RB3YBWQ4.js +77 -0
  92. package/dist/chunk-RB3YBWQ4.js.map +1 -0
  93. package/dist/chunk-RFW5SRZA.js +23 -0
  94. package/dist/chunk-RFW5SRZA.js.map +1 -0
  95. package/dist/chunk-RGJ3NBKE.js +8 -0
  96. package/dist/chunk-RGJ3NBKE.js.map +1 -0
  97. package/dist/chunk-SFNDR6DI.js +485 -0
  98. package/dist/chunk-SFNDR6DI.js.map +1 -0
  99. package/dist/chunk-SWC5CNKE.js +13 -0
  100. package/dist/chunk-SWC5CNKE.js.map +1 -0
  101. package/dist/chunk-TLS54G6Y.js +15 -0
  102. package/dist/chunk-TLS54G6Y.js.map +1 -0
  103. package/dist/chunk-WCQVDF3K.js +12 -0
  104. package/dist/{chunk-7QVYU63E.js.map → chunk-WCQVDF3K.js.map} +1 -1
  105. package/dist/chunk-WGT345SV.js +427 -0
  106. package/dist/chunk-WGT345SV.js.map +1 -0
  107. package/dist/chunk-X7APG7G2.js +1566 -0
  108. package/dist/chunk-X7APG7G2.js.map +1 -0
  109. package/dist/chunk-XALU6LOT.js +306 -0
  110. package/dist/chunk-XALU6LOT.js.map +1 -0
  111. package/dist/chunk-YNKKEO2A.js +336 -0
  112. package/dist/chunk-YNKKEO2A.js.map +1 -0
  113. package/dist/chunk-ZBW3BA5R.js +148 -0
  114. package/dist/chunk-ZBW3BA5R.js.map +1 -0
  115. package/dist/{chunk-FXKIWONG.js → chunk-ZIBNLXIV.js} +12 -6
  116. package/dist/chunk-ZIBNLXIV.js.map +1 -0
  117. package/dist/chunk-ZMSIYLSI.js +563 -0
  118. package/dist/chunk-ZMSIYLSI.js.map +1 -0
  119. package/dist/chunk-ZQMNGPLE.js +981 -0
  120. package/dist/chunk-ZQMNGPLE.js.map +1 -0
  121. package/dist/chunk-ZRD4FQBT.js +153 -0
  122. package/dist/chunk-ZRD4FQBT.js.map +1 -0
  123. package/dist/client.cjs +11289 -439
  124. package/dist/client.cjs.map +1 -1
  125. package/dist/client.d.cts +68 -117
  126. package/dist/client.d.ts +68 -117
  127. package/dist/client.js +58 -40
  128. package/dist/client.js.map +1 -1
  129. package/dist/components/Accordion/index.cjs +900 -0
  130. package/dist/components/Accordion/index.cjs.map +1 -0
  131. package/dist/components/Accordion/index.d.cts +72 -0
  132. package/dist/components/Accordion/index.d.ts +72 -0
  133. package/dist/components/Accordion/index.js +10 -0
  134. package/dist/components/Accordion/index.js.map +1 -0
  135. package/dist/components/Alert/index.cjs +567 -0
  136. package/dist/components/Alert/index.cjs.map +1 -0
  137. package/dist/components/Alert/index.d.cts +41 -0
  138. package/dist/components/Alert/index.d.ts +41 -0
  139. package/dist/components/Alert/index.js +8 -0
  140. package/dist/components/Alert/index.js.map +1 -0
  141. package/dist/components/AlertDialog/index.cjs +892 -0
  142. package/dist/components/AlertDialog/index.cjs.map +1 -0
  143. package/dist/components/AlertDialog/index.d.cts +68 -0
  144. package/dist/components/AlertDialog/index.d.ts +68 -0
  145. package/dist/components/AlertDialog/index.js +9 -0
  146. package/dist/components/AlertDialog/index.js.map +1 -0
  147. package/dist/components/Avatar/index.cjs +427 -0
  148. package/dist/components/Avatar/index.cjs.map +1 -0
  149. package/dist/components/Avatar/index.d.cts +40 -0
  150. package/dist/components/Avatar/index.d.ts +40 -0
  151. package/dist/components/Avatar/index.js +7 -0
  152. package/dist/components/Avatar/index.js.map +1 -0
  153. package/dist/components/Badge/index.cjs +433 -0
  154. package/dist/components/Badge/index.cjs.map +1 -0
  155. package/dist/components/Badge/index.d.cts +35 -0
  156. package/dist/components/Badge/index.d.ts +35 -0
  157. package/dist/components/Badge/index.js +7 -0
  158. package/dist/components/Badge/index.js.map +1 -0
  159. package/dist/components/Box/index.cjs +415 -0
  160. package/dist/components/Box/index.cjs.map +1 -0
  161. package/dist/components/Box/index.d.cts +24 -0
  162. package/dist/components/Box/index.d.ts +24 -0
  163. package/dist/components/Box/index.js +9 -0
  164. package/dist/components/Box/index.js.map +1 -0
  165. package/dist/components/Breadcrumb/index.cjs +1939 -0
  166. package/dist/components/Breadcrumb/index.cjs.map +1 -0
  167. package/dist/components/Breadcrumb/index.d.cts +186 -0
  168. package/dist/components/Breadcrumb/index.d.ts +186 -0
  169. package/dist/components/Breadcrumb/index.js +11 -0
  170. package/dist/components/Breadcrumb/index.js.map +1 -0
  171. package/dist/components/Button/index.cjs +631 -0
  172. package/dist/components/Button/index.cjs.map +1 -0
  173. package/dist/components/Button/index.d.cts +27 -0
  174. package/dist/components/Button/index.d.ts +27 -0
  175. package/dist/components/Button/index.js +9 -0
  176. package/dist/components/Button/index.js.map +1 -0
  177. package/dist/components/Calendar/index.cjs +3017 -0
  178. package/dist/components/Calendar/index.cjs.map +1 -0
  179. package/dist/components/Calendar/index.d.cts +169 -0
  180. package/dist/components/Calendar/index.d.ts +169 -0
  181. package/dist/components/Calendar/index.js +11 -0
  182. package/dist/components/Calendar/index.js.map +1 -0
  183. package/dist/components/Card/index.cjs +469 -0
  184. package/dist/components/Card/index.cjs.map +1 -0
  185. package/dist/components/Card/index.d.cts +33 -0
  186. package/dist/components/Card/index.d.ts +33 -0
  187. package/dist/components/Card/index.js +7 -0
  188. package/dist/components/Card/index.js.map +1 -0
  189. package/dist/components/Checkbox/index.cjs +590 -0
  190. package/dist/components/Checkbox/index.cjs.map +1 -0
  191. package/dist/components/Checkbox/index.d.cts +22 -0
  192. package/dist/components/Checkbox/index.d.ts +22 -0
  193. package/dist/components/Checkbox/index.js +9 -0
  194. package/dist/components/Checkbox/index.js.map +1 -0
  195. package/dist/components/Dialog/index.cjs +888 -0
  196. package/dist/components/Dialog/index.cjs.map +1 -0
  197. package/dist/components/Dialog/index.d.cts +56 -0
  198. package/dist/components/Dialog/index.d.ts +56 -0
  199. package/dist/components/Dialog/index.js +10 -0
  200. package/dist/components/Dialog/index.js.map +1 -0
  201. package/dist/components/FloatButton/index.cjs +1254 -0
  202. package/dist/components/FloatButton/index.cjs.map +1 -0
  203. package/dist/components/FloatButton/index.d.cts +133 -0
  204. package/dist/components/FloatButton/index.d.ts +133 -0
  205. package/dist/components/FloatButton/index.js +11 -0
  206. package/dist/components/FloatButton/index.js.map +1 -0
  207. package/dist/components/HStack/index.cjs +480 -0
  208. package/dist/components/HStack/index.cjs.map +1 -0
  209. package/dist/components/HStack/index.d.cts +24 -0
  210. package/dist/components/HStack/index.d.ts +24 -0
  211. package/dist/components/HStack/index.js +9 -0
  212. package/dist/components/HStack/index.js.map +1 -0
  213. package/dist/components/InputGroup/index.cjs +638 -0
  214. package/dist/components/InputGroup/index.cjs.map +1 -0
  215. package/dist/components/InputGroup/index.d.cts +33 -0
  216. package/dist/components/InputGroup/index.d.ts +33 -0
  217. package/dist/components/InputGroup/index.js +7 -0
  218. package/dist/components/InputGroup/index.js.map +1 -0
  219. package/dist/components/Pagination/index.cjs +2501 -0
  220. package/dist/components/Pagination/index.cjs.map +1 -0
  221. package/dist/components/Pagination/index.d.cts +164 -0
  222. package/dist/components/Pagination/index.d.ts +164 -0
  223. package/dist/components/Pagination/index.js +12 -0
  224. package/dist/components/Pagination/index.js.map +1 -0
  225. package/dist/components/Popover/index.cjs +739 -0
  226. package/dist/components/Popover/index.cjs.map +1 -0
  227. package/dist/components/Popover/index.d.cts +44 -0
  228. package/dist/components/Popover/index.d.ts +44 -0
  229. package/dist/components/Popover/index.js +8 -0
  230. package/dist/components/Popover/index.js.map +1 -0
  231. package/dist/components/Progress/index.cjs +493 -0
  232. package/dist/components/Progress/index.cjs.map +1 -0
  233. package/dist/components/Progress/index.d.cts +63 -0
  234. package/dist/components/Progress/index.d.ts +63 -0
  235. package/dist/components/Progress/index.js +7 -0
  236. package/dist/components/Progress/index.js.map +1 -0
  237. package/dist/components/Radio/index.cjs +584 -0
  238. package/dist/components/Radio/index.cjs.map +1 -0
  239. package/dist/components/Radio/index.d.cts +51 -0
  240. package/dist/components/Radio/index.d.ts +51 -0
  241. package/dist/components/Radio/index.js +7 -0
  242. package/dist/components/Radio/index.js.map +1 -0
  243. package/dist/components/SegmentedControl/index.cjs +502 -0
  244. package/dist/components/SegmentedControl/index.cjs.map +1 -0
  245. package/dist/components/SegmentedControl/index.d.cts +45 -0
  246. package/dist/components/SegmentedControl/index.d.ts +45 -0
  247. package/dist/components/SegmentedControl/index.js +7 -0
  248. package/dist/components/SegmentedControl/index.js.map +1 -0
  249. package/dist/components/Select/index.cjs +1359 -0
  250. package/dist/components/Select/index.cjs.map +1 -0
  251. package/dist/components/Select/index.d.cts +140 -0
  252. package/dist/components/Select/index.d.ts +140 -0
  253. package/dist/components/Select/index.js +8 -0
  254. package/dist/components/Select/index.js.map +1 -0
  255. package/dist/components/Separator/index.cjs +358 -0
  256. package/dist/components/Separator/index.cjs.map +1 -0
  257. package/dist/components/Separator/index.d.cts +28 -0
  258. package/dist/components/Separator/index.d.ts +28 -0
  259. package/dist/components/Separator/index.js +6 -0
  260. package/dist/components/Separator/index.js.map +1 -0
  261. package/dist/components/Skeleton/index.cjs +384 -0
  262. package/dist/components/Skeleton/index.cjs.map +1 -0
  263. package/dist/components/Skeleton/index.d.cts +30 -0
  264. package/dist/components/Skeleton/index.d.ts +30 -0
  265. package/dist/components/Skeleton/index.js +6 -0
  266. package/dist/components/Skeleton/index.js.map +1 -0
  267. package/dist/components/Slider/index.cjs +880 -0
  268. package/dist/components/Slider/index.cjs.map +1 -0
  269. package/dist/components/Slider/index.d.cts +84 -0
  270. package/dist/components/Slider/index.d.ts +84 -0
  271. package/dist/components/Slider/index.js +6 -0
  272. package/dist/components/Slider/index.js.map +1 -0
  273. package/dist/components/Spinner/index.cjs +32 -0
  274. package/dist/components/Spinner/index.cjs.map +1 -0
  275. package/dist/components/Spinner/index.d.cts +25 -0
  276. package/dist/components/Spinner/index.d.ts +25 -0
  277. package/dist/components/Spinner/index.js +4 -0
  278. package/dist/components/Spinner/index.js.map +1 -0
  279. package/dist/components/Switch/index.cjs +623 -0
  280. package/dist/components/Switch/index.cjs.map +1 -0
  281. package/dist/components/Switch/index.d.cts +22 -0
  282. package/dist/components/Switch/index.d.ts +22 -0
  283. package/dist/components/Switch/index.js +10 -0
  284. package/dist/components/Switch/index.js.map +1 -0
  285. package/dist/components/Tabs/index.cjs +630 -0
  286. package/dist/components/Tabs/index.cjs.map +1 -0
  287. package/dist/components/Tabs/index.d.cts +63 -0
  288. package/dist/components/Tabs/index.d.ts +63 -0
  289. package/dist/components/Tabs/index.js +7 -0
  290. package/dist/components/Tabs/index.js.map +1 -0
  291. package/dist/components/Text/index.cjs +401 -0
  292. package/dist/components/Text/index.cjs.map +1 -0
  293. package/dist/components/Text/index.d.cts +24 -0
  294. package/dist/components/Text/index.d.ts +24 -0
  295. package/dist/components/Text/index.js +7 -0
  296. package/dist/components/Text/index.js.map +1 -0
  297. package/dist/components/TextArea/index.cjs +482 -0
  298. package/dist/components/TextArea/index.cjs.map +1 -0
  299. package/dist/components/TextArea/index.d.cts +25 -0
  300. package/dist/components/TextArea/index.d.ts +25 -0
  301. package/dist/components/TextArea/index.js +8 -0
  302. package/dist/components/TextArea/index.js.map +1 -0
  303. package/dist/components/TextInput/index.cjs +477 -0
  304. package/dist/components/TextInput/index.cjs.map +1 -0
  305. package/dist/components/TextInput/index.d.cts +33 -0
  306. package/dist/components/TextInput/index.d.ts +33 -0
  307. package/dist/components/TextInput/index.js +7 -0
  308. package/dist/components/TextInput/index.js.map +1 -0
  309. package/dist/components/Toast/index.cjs +167 -0
  310. package/dist/components/Toast/index.cjs.map +1 -0
  311. package/dist/components/Toast/index.d.cts +143 -0
  312. package/dist/components/Toast/index.d.ts +143 -0
  313. package/dist/components/Toast/index.js +4 -0
  314. package/dist/components/Toast/index.js.map +1 -0
  315. package/dist/components/Toggle/index.cjs +770 -0
  316. package/dist/components/Toggle/index.cjs.map +1 -0
  317. package/dist/components/Toggle/index.d.cts +83 -0
  318. package/dist/components/Toggle/index.d.ts +83 -0
  319. package/dist/components/Toggle/index.js +7 -0
  320. package/dist/components/Toggle/index.js.map +1 -0
  321. package/dist/components/Tooltip/index.cjs +813 -0
  322. package/dist/components/Tooltip/index.cjs.map +1 -0
  323. package/dist/components/Tooltip/index.d.cts +55 -0
  324. package/dist/components/Tooltip/index.d.ts +55 -0
  325. package/dist/components/Tooltip/index.js +8 -0
  326. package/dist/components/Tooltip/index.js.map +1 -0
  327. package/dist/components/VStack/index.cjs +480 -0
  328. package/dist/components/VStack/index.cjs.map +1 -0
  329. package/dist/components/VStack/index.d.cts +19 -0
  330. package/dist/components/VStack/index.d.ts +19 -0
  331. package/dist/components/VStack/index.js +9 -0
  332. package/dist/components/VStack/index.js.map +1 -0
  333. package/dist/i18n/index.cjs +39 -3
  334. package/dist/i18n/index.cjs.map +1 -1
  335. package/dist/i18n/index.d.cts +4 -60
  336. package/dist/i18n/index.d.ts +4 -60
  337. package/dist/i18n/index.js +3 -2
  338. package/dist/icons/index.cjs +326 -26
  339. package/dist/icons/index.cjs.map +1 -1
  340. package/dist/icons/index.js +4 -3
  341. package/dist/index-D3_M3G6U.d.ts +19 -0
  342. package/dist/index-uXPK_Rg8.d.cts +19 -0
  343. package/dist/index.cjs +11176 -463
  344. package/dist/index.cjs.map +1 -1
  345. package/dist/index.d.cts +39 -183
  346. package/dist/index.d.ts +39 -183
  347. package/dist/index.js +49 -9
  348. package/dist/resolve-D-GOaxZy.d.cts +60 -0
  349. package/dist/resolve-D-GOaxZy.d.ts +60 -0
  350. package/dist/slot/index.cjs +9 -3
  351. package/dist/slot/index.cjs.map +1 -1
  352. package/dist/slot/index.js +2 -2
  353. package/dist/stories/index.cjs +108 -0
  354. package/dist/stories/index.cjs.map +1 -0
  355. package/dist/stories/index.d.cts +46 -0
  356. package/dist/stories/index.d.ts +46 -0
  357. package/dist/stories/index.js +94 -0
  358. package/dist/stories/index.js.map +1 -0
  359. package/dist/theme/index.cjs +259 -26
  360. package/dist/theme/index.cjs.map +1 -1
  361. package/dist/theme/index.d.cts +26 -0
  362. package/dist/theme/index.d.ts +26 -0
  363. package/dist/theme/index.js +4 -3
  364. package/dist/use-theme-CoqfnvRs.d.cts +112 -0
  365. package/dist/use-theme-CoqfnvRs.d.ts +112 -0
  366. package/dist/utils/cn.cjs +18 -6
  367. package/dist/utils/cn.cjs.map +1 -1
  368. package/dist/utils/cn.js +2 -2
  369. package/package.json +41 -10
  370. package/dist/chunk-6OABNXBY.js +0 -213
  371. package/dist/chunk-6OABNXBY.js.map +0 -1
  372. package/dist/chunk-7QVYU63E.js +0 -6
  373. package/dist/chunk-FXKIWONG.js.map +0 -1
  374. package/dist/chunk-NDEDMCHT.js +0 -40
  375. package/dist/chunk-NDEDMCHT.js.map +0 -1
  376. package/dist/chunk-SSTXLK5I.js.map +0 -1
  377. package/dist/chunk-UAKFCMWK.js +0 -3
  378. package/dist/chunk-X3AJNNF6.js +0 -539
  379. package/dist/chunk-X3AJNNF6.js.map +0 -1
  380. package/dist/chunk-XGM2K4TT.js +0 -31
  381. package/dist/chunk-XGM2K4TT.js.map +0 -1
  382. package/dist/stories/story-registry.cjs +0 -776
  383. package/dist/stories/story-registry.cjs.map +0 -1
  384. package/dist/stories/story-registry.d.cts +0 -13
  385. package/dist/stories/story-registry.d.ts +0 -13
  386. package/dist/stories/story-registry.js +0 -106
  387. package/dist/stories/story-registry.js.map +0 -1
@@ -9,7 +9,9 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
9
9
  function composeRefs(...refs) {
10
10
  return (node) => {
11
11
  for (const ref of refs) {
12
- if (ref == null) continue;
12
+ if (ref == null) {
13
+ continue;
14
+ }
13
15
  if (typeof ref === "function") {
14
16
  ref(node);
15
17
  } else {
@@ -66,8 +68,12 @@ function joinClass(outer, inner) {
66
68
  }
67
69
  __name(joinClass, "joinClass");
68
70
  function isEventHandler(key, outer, inner) {
69
- if (!key.startsWith("on") || key.length < 3) return false;
70
- if (key[2] !== key[2]?.toUpperCase()) return false;
71
+ if (!key.startsWith("on") || key.length < 3) {
72
+ return false;
73
+ }
74
+ if (key[2] !== key[2]?.toUpperCase()) {
75
+ return false;
76
+ }
71
77
  return typeof outer === "function" && typeof inner === "function";
72
78
  }
73
79
  __name(isEventHandler, "isEventHandler");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/slot/compose-refs.ts","../../src/slot/slot.tsx"],"names":["forwardRef","Slot","isValidElement","Children","cloneElement"],"mappings":";;;;;;;;AAOO,SAAS,eAAkB,IAAA,EAA6C;AAC3E,EAAA,OAAO,CAAC,IAAA,KAAmB;AACvB,IAAA,KAAA,MAAW,OAAO,IAAA,EAAM;AACpB,MAAA,IAAI,OAAO,IAAA,EAAM;AACjB,MAAA,IAAI,OAAO,QAAQ,UAAA,EAAY;AAC3B,QAAA,GAAA,CAAI,IAAI,CAAA;AAAA,MACZ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,OAAO,OAAO,KAAA,KAAU,UAAA,IAAc,OAAO,KAAA,KAAU,UAAA;AAC3D;AAJS,MAAA,CAAA,cAAA,EAAA,gBAAA,CAAA;AAMT,SAAS,eAAA,CAAgB,OAAW,KAAA,EAAe;AAC/C,EAAA,OAAO,IAAI,IAAA,KAAoB;AAC3B,IAAA,KAAA,CAAM,GAAG,IAAI,CAAA;AACb,IAAA,KAAA,CAAM,GAAG,IAAI,CAAA;AAAA,EACjB,CAAA;AACJ;AALS,MAAA,CAAA,eAAA,EAAA,iBAAA,CAAA","file":"index.cjs","sourcesContent":["// composeRefs — merges multiple React refs (callback or object) into a single callback.\n// Derived from Radix UI's approach; reimplemented here so we don't take a Radix dependency.\n\nimport type { MutableRefObject, Ref, RefCallback } from 'react';\n\ntype PossibleRef<T> = Ref<T> | undefined;\n\nexport function composeRefs<T>(...refs: Array<PossibleRef<T>>): RefCallback<T> {\n return (node: T | null) => {\n for (const ref of refs) {\n if (ref == null) continue;\n if (typeof ref === 'function') {\n ref(node);\n } else {\n // React's MutableRefObject typing — we assign .current directly.\n (ref as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n","import type { CSSProperties, ReactElement, Ref } from 'react';\nimport { Children, cloneElement, forwardRef, isValidElement } from 'react';\nimport { composeRefs } from './compose-refs';\n\ntype AnyProps = Record<string, unknown>;\n\nexport type SlotProps = {\n children?: React.ReactNode;\n} & AnyProps;\n\nexport const Slot = forwardRef<unknown, SlotProps>(function Slot(props, forwardedRef) {\n const { children, ...slotProps } = props;\n\n if (!isValidElement(children)) {\n return null;\n }\n\n // Assert that children is a single React element with props — we've narrowed above.\n const child = Children.only(children) as ReactElement<AnyProps> & { ref?: Ref<unknown> };\n const merged = mergeProps(slotProps, child.props);\n\n // Merge refs: Slot's forwarded ref + the child's own ref (if any).\n const childRef = (child as unknown as { ref?: Ref<unknown> }).ref;\n if (forwardedRef || childRef) {\n (merged as AnyProps).ref = composeRefs(forwardedRef, childRef);\n }\n\n return cloneElement(child, merged);\n});\nSlot.displayName = 'Slot';\n\nfunction mergeProps(outer: AnyProps, inner: AnyProps): AnyProps {\n // Inner (child) wins for everything except: className (concatenated), style (merged), and\n // event handlers (composed — outer runs first, then inner).\n const merged: AnyProps = { ...outer };\n\n for (const key of Object.keys(inner)) {\n const outerValue = outer[key];\n const innerValue = inner[key];\n\n if (key === 'className' || key === 'class') {\n merged[key] = joinClass(outerValue, innerValue);\n continue;\n }\n\n if (key === 'style') {\n merged[key] = {\n ...(outerValue as CSSProperties | undefined),\n ...(innerValue as CSSProperties | undefined),\n };\n continue;\n }\n\n if (isEventHandler(key, outerValue, innerValue)) {\n merged[key] = composeHandlers(outerValue as Fn, innerValue as Fn);\n continue;\n }\n\n merged[key] = innerValue;\n }\n\n return merged;\n}\n\nfunction joinClass(outer: unknown, inner: unknown): string | undefined {\n const a = typeof outer === 'string' ? outer : '';\n const b = typeof inner === 'string' ? inner : '';\n const joined = [a, b].filter(Boolean).join(' ');\n return joined.length > 0 ? joined : undefined;\n}\n\ntype Fn = (...args: unknown[]) => unknown;\n\nfunction isEventHandler(key: string, outer: unknown, inner: unknown): boolean {\n if (!key.startsWith('on') || key.length < 3) return false;\n if (key[2] !== key[2]?.toUpperCase()) return false;\n return typeof outer === 'function' && typeof inner === 'function';\n}\n\nfunction composeHandlers(outer: Fn, inner: Fn): Fn {\n return (...args: unknown[]) => {\n outer(...args);\n inner(...args);\n };\n}\n"]}
1
+ {"version":3,"sources":["../../src/slot/compose-refs.ts","../../src/slot/slot.tsx"],"names":["forwardRef","Slot","isValidElement","Children","cloneElement"],"mappings":";;;;;;;;AAOO,SAAS,eAAkB,IAAA,EAA6C;AAC3E,EAAA,OAAO,CAAC,IAAA,KAAmB;AACvB,IAAA,KAAA,MAAW,OAAO,IAAA,EAAM;AACpB,MAAA,IAAI,OAAO,IAAA,EAAM;AACb,QAAA;AAAA,MACJ;AACA,MAAA,IAAI,OAAO,QAAQ,UAAA,EAAY;AAC3B,QAAA,GAAA,CAAI,IAA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AAG,aAAY,EAAG;AAClC,IAAA,OAAO,KAAA;AAAA,EACX;AACA,EAAA,OAAO,OAAO,KAAA,KAAU,UAAA,IAAc,OAAO,KAAA,KAAU,UAAA;AAC3D;AARS,MAAA,CAAA,cAAA,EAAA,gBAAA,CAAA;AAUT,SAAS,eAAA,CAAgB,OAAW,KAAA,EAAe;AAC/C,EAAA,OAAO,IAAI,IAAA,KAAoB;AAC3B,IAAA,KAAA,CAAM,GAAG,IAAI,CAAA;AACb,IAAA,KAAA,CAAM,GAAG,IAAI,CAAA;AAAA,EACjB,CAAA;AACJ;AALS,MAAA,CAAA,eAAA,EAAA,iBAAA,CAAA","file":"index.cjs","sourcesContent":["// composeRefs — merges multiple React refs (callback or object) into a single callback.\n// Derived from Radix UI's approach; reimplemented here so we don't take a Radix dependency.\n\nimport type { MutableRefObject, Ref, RefCallback } from 'react';\n\ntype PossibleRef<T> = Ref<T> | undefined;\n\nexport function composeRefs<T>(...refs: Array<PossibleRef<T>>): RefCallback<T> {\n return (node: T | null) => {\n for (const ref of refs) {\n if (ref == null) {\n continue;\n }\n if (typeof ref === 'function') {\n ref(node);\n } else {\n // React's MutableRefObject typing — we assign .current directly.\n (ref as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n","import type { CSSProperties, ReactElement, Ref } from 'react';\nimport { Children, cloneElement, forwardRef, isValidElement } from 'react';\nimport { composeRefs } from './compose-refs';\n\ntype AnyProps = Record<string, unknown>;\n\nexport type SlotProps = {\n children?: React.ReactNode;\n} & AnyProps;\n\nexport const Slot = forwardRef<unknown, SlotProps>(function Slot(props, forwardedRef) {\n const { children, ...slotProps } = props;\n\n if (!isValidElement(children)) {\n return null;\n }\n\n // Assert that children is a single React element with props — we've narrowed above.\n const child = Children.only(children) as ReactElement<AnyProps> & { ref?: Ref<unknown> };\n const merged = mergeProps(slotProps, child.props);\n\n // Merge refs: Slot's forwarded ref + the child's own ref (if any).\n const childRef = (child as unknown as { ref?: Ref<unknown> }).ref;\n if (forwardedRef || childRef) {\n (merged as AnyProps).ref = composeRefs(forwardedRef, childRef);\n }\n\n return cloneElement(child, merged);\n});\nSlot.displayName = 'Slot';\n\nfunction mergeProps(outer: AnyProps, inner: AnyProps): AnyProps {\n // Inner (child) wins for everything except: className (concatenated), style (merged), and\n // event handlers (composed — outer runs first, then inner).\n const merged: AnyProps = { ...outer };\n\n for (const key of Object.keys(inner)) {\n const outerValue = outer[key];\n const innerValue = inner[key];\n\n if (key === 'className' || key === 'class') {\n merged[key] = joinClass(outerValue, innerValue);\n continue;\n }\n\n if (key === 'style') {\n merged[key] = {\n ...(outerValue as CSSProperties | undefined),\n ...(innerValue as CSSProperties | undefined),\n };\n continue;\n }\n\n if (isEventHandler(key, outerValue, innerValue)) {\n merged[key] = composeHandlers(outerValue as Fn, innerValue as Fn);\n continue;\n }\n\n merged[key] = innerValue;\n }\n\n return merged;\n}\n\nfunction joinClass(outer: unknown, inner: unknown): string | undefined {\n const a = typeof outer === 'string' ? outer : '';\n const b = typeof inner === 'string' ? inner : '';\n const joined = [a, b].filter(Boolean).join(' ');\n return joined.length > 0 ? joined : undefined;\n}\n\ntype Fn = (...args: unknown[]) => unknown;\n\nfunction isEventHandler(key: string, outer: unknown, inner: unknown): boolean {\n if (!key.startsWith('on') || key.length < 3) {\n return false;\n }\n if (key[2] !== key[2]?.toUpperCase()) {\n return false;\n }\n return typeof outer === 'function' && typeof inner === 'function';\n}\n\nfunction composeHandlers(outer: Fn, inner: Fn): Fn {\n return (...args: unknown[]) => {\n outer(...args);\n inner(...args);\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- export { Slot, composeRefs } from '../chunk-FXKIWONG.js';
2
- import '../chunk-7QVYU63E.js';
1
+ export { Slot, composeRefs } from '../chunk-ZIBNLXIV.js';
2
+ import '../chunk-WCQVDF3K.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,108 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+
5
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
6
+ var __defProp = Object.defineProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
+ });
14
+
15
+ // src/stories/csf-helpers.ts
16
+ function pascalToKebab(s) {
17
+ return s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
18
+ }
19
+ __name(pascalToKebab, "pascalToKebab");
20
+ function humanise(s) {
21
+ const spaced = s.replace(/([a-z0-9])([A-Z])/g, "$1 $2");
22
+ return spaced.charAt(0).toUpperCase() + spaced.slice(1);
23
+ }
24
+ __name(humanise, "humanise");
25
+
26
+ // src/stories/csf-loader-bundler.ts
27
+ function discoverCsfModules() {
28
+ try {
29
+ const meta = ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) });
30
+ if (meta && typeof meta.glob === "function") {
31
+ const modules = undefined("../components/**/*.stories.tsx", { eager: true });
32
+ if (modules && Object.keys(modules).length > 0) {
33
+ return modules;
34
+ }
35
+ }
36
+ } catch {
37
+ }
38
+ try {
39
+ if (typeof __require === "function" && typeof __require.context === "function") {
40
+ const ctx = __require.context("../components", true, /\.stories\.tsx$/);
41
+ const out = {};
42
+ for (const key of ctx.keys()) {
43
+ out[key] = ctx(key);
44
+ }
45
+ return out;
46
+ }
47
+ } catch {
48
+ }
49
+ return {};
50
+ }
51
+ __name(discoverCsfModules, "discoverCsfModules");
52
+
53
+ // src/stories/csf-loader.tsx
54
+ var CURRENT_PLATFORM = typeof document !== "undefined" ? "web" : "native";
55
+ function readModules() {
56
+ return discoverCsfModules();
57
+ }
58
+ __name(readModules, "readModules");
59
+ function buildComponents(modules) {
60
+ const entries = [];
61
+ for (const path of Object.keys(modules)) {
62
+ const mod = modules[path];
63
+ const meta = mod?.default;
64
+ if (!meta || typeof meta.title !== "string") {
65
+ continue;
66
+ }
67
+ const titleLast = meta.title.split("/").pop() ?? meta.title;
68
+ const slug = pascalToKebab(titleLast);
69
+ const stories = [];
70
+ for (const key of Object.keys(mod)) {
71
+ if (key === "default") {
72
+ continue;
73
+ }
74
+ const story = mod[key];
75
+ if (!story || typeof story !== "object") {
76
+ continue;
77
+ }
78
+ const platforms = story.parameters?.platforms;
79
+ if (platforms && !platforms.includes(CURRENT_PLATFORM)) {
80
+ continue;
81
+ }
82
+ const mergedArgs = { ...meta.args ?? {}, ...story.args ?? {} };
83
+ const renderFn = story.render ?? meta.render;
84
+ const Component = meta.component;
85
+ const Render = renderFn ? () => renderFn(mergedArgs) : Component ? () => react.createElement(Component, mergedArgs) : () => null;
86
+ stories.push({
87
+ id: pascalToKebab(key),
88
+ title: humanise(key),
89
+ render: Render
90
+ });
91
+ }
92
+ if (stories.length === 0) {
93
+ continue;
94
+ }
95
+ entries.push({ slug, name: titleLast, stories });
96
+ }
97
+ entries.sort((a, b) => a.slug.localeCompare(b.slug));
98
+ return entries;
99
+ }
100
+ __name(buildComponents, "buildComponents");
101
+ var components = buildComponents(readModules());
102
+
103
+ exports.buildComponents = buildComponents;
104
+ exports.components = components;
105
+ exports.humanise = humanise;
106
+ exports.pascalToKebab = pascalToKebab;
107
+ //# sourceMappingURL=index.cjs.map
108
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/stories/csf-helpers.ts","../../src/stories/csf-loader-bundler.ts","../../src/stories/csf-loader.tsx"],"names":["createElement"],"mappings":";;;;;;;;;;;;;;;AAWO,SAAS,cAAc,CAAA,EAAmB;AAC7C,EAAA,OAAO,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AA,MAAM,UAAA,GAAsC,EAAE,GAAI,IAAA,CAAK,IAAA,IAAQ,EAAC,EAAI,GAAI,KAAA,CAAM,IAAA,IAAQ,EAAC,EAAG;AAC1F,MAAA,MAAM,QAAA,GAAW,KAAA,CAAM,MAAA,IAAU,IAAA,CAAK,MAAA;AACtC,MAAA,MAAM,YAAY,IAAA,CAAK,SAAA;AAEvB,MAAA,MAAM,MAAA,GAA+C,QAAA,GAC/C,MAAM,QAAA,CAAS,UAAU,CAAA,GACzB,SAAA,GACE,MAAMA,mBAAA,CAAc,SAAA,EAAqD,UAAU,CAAA,GACnF,MAAM,IAAA;AAEd,MAAA,OAAA,CAAQ,IAAA,CAAK;AAAA,QACT,EAAA,EAAI,cAAc,GAAG,CAAA;AAAA,QACrB,KAAA,EAAO,SAAS,GAAG,CAAA;AAAA,QACnB,MAAA,EAAQ;AAAA,OACX,CAAA;AAAA,IACL;AAEA,IAAA,IAAI,OAAA,CAAQ,WAAW,CAAA,EAAG;AACtB,MAAA;AAAA,IACJ;AAEA,IAAA,OAAA,CAAQ,KAAK,EAAE,IAAA,EAAM,IAAA,EAAM,SAAA,EAAW,SAAS,CAAA;AAAA,EACnD;AAEA,EAAA,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,EAAG,CAAA,KAAM,EAAE,IAAA,CAAK,aAAA,CAAc,CAAA,CAAE,IAAI,CAAC,CAAA;AACnD,EAAA,OAAO,OAAA;AACX;AA9DgB,MAAA,CAAA,eAAA,EAAA,iBAAA,CAAA;AAiET,IAAM,UAAA,GAA+B,eAAA,CAAgB,WAAA,EAAa","file":"index.cjs","sourcesContent":["// Pure string helpers shared between the runtime CSF loader and the\n// Node-only `csf-slugs` helper. Kept dependency-free so the Node helper\n// never pulls in `csf-loader.tsx` (which depends on `csf-loader-bundler`,\n// which uses `import.meta`).\n\n/**\n * Convert PascalCase → kebab-case using only lowercase→uppercase\n * boundaries so leading acronyms stay intact: `'HStack'` → `'hstack'`,\n * `'AlertDialog'` → `'alert-dialog'`. Matches the docs MDX filename\n * convention (`hstack.mdx`, not `h-stack.mdx`).\n */\nexport function pascalToKebab(s: string): string {\n return s.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\n/**\n * Convert PascalCase → \"With Gap\" for display. Same boundary rule as\n * `pascalToKebab` (only lowercase→uppercase splits).\n */\nexport function humanise(s: string): string {\n const spaced = s.replace(/([a-z0-9])([A-Z])/g, '$1 $2');\n return spaced.charAt(0).toUpperCase() + spaced.slice(1);\n}\n","// Bundler-specific CSF discovery — kept in its own file because\n// `import.meta` cannot be compiled to CommonJS, which ts-jest's default\n// transform produces. The Jest config redirects this module to a stub\n// during tests so the parser never sees `import.meta`.\n//\n// Production callers come from Metro (require.context) or Vite\n// (import.meta.glob). Both static-string call sites must remain verbatim\n// — each bundler's static analyser matches the AST shape literally and\n// rewrites it at build time.\n\nimport type { CsfModule, RequireContext } from './csf-loader';\n\ndeclare const require: {\n (id: string): unknown;\n context?: (directory: string, useSubdirectories: boolean, regExp: RegExp) => RequireContext;\n};\n\nexport function discoverCsfModules(): Record<string, CsfModule> {\n // Vite / Rollup — `import.meta.glob` statically transformed at build time.\n try {\n // biome-ignore lint/suspicious/noExplicitAny: `glob` is a Vite extension to ImportMeta\n const meta = import.meta as any;\n if (meta && typeof meta.glob === 'function') {\n // biome-ignore lint/suspicious/noExplicitAny: Vite types live in `vite/client` which we don't pull in\n const modules = (import.meta as any).glob('../components/**/*.stories.tsx', { eager: true }) as Record<\n string,\n CsfModule\n >;\n if (modules && Object.keys(modules).length > 0) {\n return modules;\n }\n }\n } catch {\n // import.meta access can throw in non-ESM contexts — fall through.\n }\n\n // Metro / webpack — `require.context` static call rewritten at bundle time.\n try {\n if (typeof require === 'function' && typeof require.context === 'function') {\n const ctx = require.context('../components', true, /\\.stories\\.tsx$/);\n const out: Record<string, CsfModule> = {};\n for (const key of ctx.keys()) {\n out[key] = ctx(key);\n }\n return out;\n }\n } catch {\n // require may be undefined under pure ESM — fall through.\n }\n\n return {};\n}\n","// CSF loader — discovers every `*.stories.tsx` file under `../components`\n// at bundle time via Metro's `require.context`, normalises the CSF default\n// export + named story exports into the `ComponentEntry` shape consumed by\n// the native playground.\n//\n// This is the runtime side of the \"CSF as the single source of truth\"\n// architecture (see `docs/superpowers/specs/2026-04-28-playground-showcase-design.md`).\n// It deliberately handles only the CSF surface the existing stories use:\n// - default.title (string)\n// - default.component (component)\n// - default.args (object, optional)\n// - default.render (function, optional)\n// - named exports: each with optional `args`, optional `render`, and\n// optional `parameters.platforms` (filters the story out when the\n// current platform is not in the list — used for demos that only\n// make sense on a resizable web canvas, etc.)\n// `decorators`, `loaders`, and `play` are ignored.\n\nimport { type ComponentType, createElement, type ReactNode } from 'react';\nimport { humanise, pascalToKebab } from './csf-helpers';\nimport { discoverCsfModules } from './csf-loader-bundler';\n\ntype StoryPlatform = 'web' | 'native';\n// We can't `import { Platform } from 'react-native'` here — Jest's CJS\n// transform chokes on RN's flow-typed entry. The DOM probe is a reliable\n// proxy: only RN's JSC/Hermes runtime lacks `document`. Tests (jsdom)\n// and Storybook see `document` and resolve to `'web'`, which matches\n// where they actually run.\nconst CURRENT_PLATFORM: StoryPlatform = typeof document !== 'undefined' ? 'web' : 'native';\n\nexport type Story = {\n /** kebab-case story id (export name, kebab-cased) */\n id: string;\n /** Humanised story title (export name, spaced) */\n title: string;\n /** Component that renders this story with its merged args */\n render: ComponentType<Record<string, never>>;\n};\n\nexport type ComponentEntry = {\n /** kebab-case slug (last segment of CSF title, kebab-cased) */\n slug: string;\n /** Display name (last segment of CSF title) */\n name: string;\n /** Stories in CSF declaration order */\n stories: Story[];\n};\n\nexport { humanise, pascalToKebab } from './csf-helpers';\n\nexport type CsfModule = {\n default: {\n title: string;\n component?: ComponentType<unknown>;\n args?: Record<string, unknown>;\n render?: (args: Record<string, unknown>) => unknown;\n };\n [key: string]: unknown;\n};\n\nexport type RequireContext = {\n keys(): string[];\n (path: string): CsfModule;\n};\n\n// Tests stub the discovery via `__setCsfModules` below.\nlet testModules: Record<string, CsfModule> | null = null;\n\n/** Test-only: inject CSF modules so Jest can exercise the loader logic. */\nexport function __setCsfModules(modules: Record<string, CsfModule> | null): void {\n testModules = modules;\n}\n\nfunction readModules(): Record<string, CsfModule> {\n if (testModules) {\n return testModules;\n }\n // Bundler-specific discovery (Metro require.context / Vite import.meta.glob)\n // is isolated in csf-loader-bundler.ts because import.meta is a syntax\n // error under ts-jest's CJS target. Jest stubs that module to a no-op.\n return discoverCsfModules();\n}\n\nexport function buildComponents(modules: Record<string, CsfModule>): ComponentEntry[] {\n const entries: ComponentEntry[] = [];\n for (const path of Object.keys(modules)) {\n const mod = modules[path];\n const meta = mod?.default;\n if (!meta || typeof meta.title !== 'string') {\n continue;\n }\n\n const titleLast = meta.title.split('/').pop() ?? meta.title;\n const slug = pascalToKebab(titleLast);\n\n const stories: Story[] = [];\n // Object.keys preserves declaration order for own string keys\n // (per ECMAScript spec). We rely on this for \"stories in CSF\n // declaration order\".\n for (const key of Object.keys(mod)) {\n if (key === 'default') {\n continue;\n }\n const story = mod[key] as\n | {\n args?: Record<string, unknown>;\n render?: (a: Record<string, unknown>) => unknown;\n parameters?: { platforms?: ReadonlyArray<StoryPlatform> };\n }\n | undefined;\n if (!story || typeof story !== 'object') {\n continue;\n }\n\n const platforms = story.parameters?.platforms;\n if (platforms && !platforms.includes(CURRENT_PLATFORM)) {\n continue;\n }\n\n const mergedArgs: Record<string, unknown> = { ...(meta.args ?? {}), ...(story.args ?? {}) };\n const renderFn = story.render ?? meta.render;\n const Component = meta.component;\n\n const Render: ComponentType<Record<string, never>> = renderFn\n ? () => renderFn(mergedArgs) as ReactNode\n : Component\n ? () => createElement(Component as ComponentType<Record<string, unknown>>, mergedArgs)\n : () => null;\n\n stories.push({\n id: pascalToKebab(key),\n title: humanise(key),\n render: Render,\n });\n }\n\n if (stories.length === 0) {\n continue;\n }\n\n entries.push({ slug, name: titleLast, stories });\n }\n\n entries.sort((a, b) => a.slug.localeCompare(b.slug));\n return entries;\n}\n\n/** Native playground's source of truth for components + stories. */\nexport const components: ComponentEntry[] = buildComponents(readModules());\n"]}
@@ -0,0 +1,46 @@
1
+ import { ComponentType } from 'react';
2
+
3
+ /**
4
+ * Convert PascalCase → kebab-case using only lowercase→uppercase
5
+ * boundaries so leading acronyms stay intact: `'HStack'` → `'hstack'`,
6
+ * `'AlertDialog'` → `'alert-dialog'`. Matches the docs MDX filename
7
+ * convention (`hstack.mdx`, not `h-stack.mdx`).
8
+ */
9
+ declare function pascalToKebab(s: string): string;
10
+ /**
11
+ * Convert PascalCase → "With Gap" for display. Same boundary rule as
12
+ * `pascalToKebab` (only lowercase→uppercase splits).
13
+ */
14
+ declare function humanise(s: string): string;
15
+
16
+ type Story = {
17
+ /** kebab-case story id (export name, kebab-cased) */
18
+ id: string;
19
+ /** Humanised story title (export name, spaced) */
20
+ title: string;
21
+ /** Component that renders this story with its merged args */
22
+ render: ComponentType<Record<string, never>>;
23
+ };
24
+ type ComponentEntry = {
25
+ /** kebab-case slug (last segment of CSF title, kebab-cased) */
26
+ slug: string;
27
+ /** Display name (last segment of CSF title) */
28
+ name: string;
29
+ /** Stories in CSF declaration order */
30
+ stories: Story[];
31
+ };
32
+
33
+ type CsfModule = {
34
+ default: {
35
+ title: string;
36
+ component?: ComponentType<unknown>;
37
+ args?: Record<string, unknown>;
38
+ render?: (args: Record<string, unknown>) => unknown;
39
+ };
40
+ [key: string]: unknown;
41
+ };
42
+ declare function buildComponents(modules: Record<string, CsfModule>): ComponentEntry[];
43
+ /** Native playground's source of truth for components + stories. */
44
+ declare const components: ComponentEntry[];
45
+
46
+ export { type ComponentEntry, type Story, buildComponents, components, humanise, pascalToKebab };
@@ -0,0 +1,46 @@
1
+ import { ComponentType } from 'react';
2
+
3
+ /**
4
+ * Convert PascalCase → kebab-case using only lowercase→uppercase
5
+ * boundaries so leading acronyms stay intact: `'HStack'` → `'hstack'`,
6
+ * `'AlertDialog'` → `'alert-dialog'`. Matches the docs MDX filename
7
+ * convention (`hstack.mdx`, not `h-stack.mdx`).
8
+ */
9
+ declare function pascalToKebab(s: string): string;
10
+ /**
11
+ * Convert PascalCase → "With Gap" for display. Same boundary rule as
12
+ * `pascalToKebab` (only lowercase→uppercase splits).
13
+ */
14
+ declare function humanise(s: string): string;
15
+
16
+ type Story = {
17
+ /** kebab-case story id (export name, kebab-cased) */
18
+ id: string;
19
+ /** Humanised story title (export name, spaced) */
20
+ title: string;
21
+ /** Component that renders this story with its merged args */
22
+ render: ComponentType<Record<string, never>>;
23
+ };
24
+ type ComponentEntry = {
25
+ /** kebab-case slug (last segment of CSF title, kebab-cased) */
26
+ slug: string;
27
+ /** Display name (last segment of CSF title) */
28
+ name: string;
29
+ /** Stories in CSF declaration order */
30
+ stories: Story[];
31
+ };
32
+
33
+ type CsfModule = {
34
+ default: {
35
+ title: string;
36
+ component?: ComponentType<unknown>;
37
+ args?: Record<string, unknown>;
38
+ render?: (args: Record<string, unknown>) => unknown;
39
+ };
40
+ [key: string]: unknown;
41
+ };
42
+ declare function buildComponents(modules: Record<string, CsfModule>): ComponentEntry[];
43
+ /** Native playground's source of truth for components + stories. */
44
+ declare const components: ComponentEntry[];
45
+
46
+ export { type ComponentEntry, type Story, buildComponents, components, humanise, pascalToKebab };
@@ -0,0 +1,94 @@
1
+ import { __name, __require } from '../chunk-WCQVDF3K.js';
2
+ import { createElement } from 'react';
3
+
4
+ // src/stories/csf-helpers.ts
5
+ function pascalToKebab(s) {
6
+ return s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
7
+ }
8
+ __name(pascalToKebab, "pascalToKebab");
9
+ function humanise(s) {
10
+ const spaced = s.replace(/([a-z0-9])([A-Z])/g, "$1 $2");
11
+ return spaced.charAt(0).toUpperCase() + spaced.slice(1);
12
+ }
13
+ __name(humanise, "humanise");
14
+
15
+ // src/stories/csf-loader-bundler.ts
16
+ function discoverCsfModules() {
17
+ try {
18
+ const meta = import.meta;
19
+ if (meta && typeof meta.glob === "function") {
20
+ const modules = import.meta.glob("../components/**/*.stories.tsx", { eager: true });
21
+ if (modules && Object.keys(modules).length > 0) {
22
+ return modules;
23
+ }
24
+ }
25
+ } catch {
26
+ }
27
+ try {
28
+ if (typeof __require === "function" && typeof __require.context === "function") {
29
+ const ctx = __require.context("../components", true, /\.stories\.tsx$/);
30
+ const out = {};
31
+ for (const key of ctx.keys()) {
32
+ out[key] = ctx(key);
33
+ }
34
+ return out;
35
+ }
36
+ } catch {
37
+ }
38
+ return {};
39
+ }
40
+ __name(discoverCsfModules, "discoverCsfModules");
41
+
42
+ // src/stories/csf-loader.tsx
43
+ var CURRENT_PLATFORM = typeof document !== "undefined" ? "web" : "native";
44
+ function readModules() {
45
+ return discoverCsfModules();
46
+ }
47
+ __name(readModules, "readModules");
48
+ function buildComponents(modules) {
49
+ const entries = [];
50
+ for (const path of Object.keys(modules)) {
51
+ const mod = modules[path];
52
+ const meta = mod?.default;
53
+ if (!meta || typeof meta.title !== "string") {
54
+ continue;
55
+ }
56
+ const titleLast = meta.title.split("/").pop() ?? meta.title;
57
+ const slug = pascalToKebab(titleLast);
58
+ const stories = [];
59
+ for (const key of Object.keys(mod)) {
60
+ if (key === "default") {
61
+ continue;
62
+ }
63
+ const story = mod[key];
64
+ if (!story || typeof story !== "object") {
65
+ continue;
66
+ }
67
+ const platforms = story.parameters?.platforms;
68
+ if (platforms && !platforms.includes(CURRENT_PLATFORM)) {
69
+ continue;
70
+ }
71
+ const mergedArgs = { ...meta.args ?? {}, ...story.args ?? {} };
72
+ const renderFn = story.render ?? meta.render;
73
+ const Component = meta.component;
74
+ const Render = renderFn ? () => renderFn(mergedArgs) : Component ? () => createElement(Component, mergedArgs) : () => null;
75
+ stories.push({
76
+ id: pascalToKebab(key),
77
+ title: humanise(key),
78
+ render: Render
79
+ });
80
+ }
81
+ if (stories.length === 0) {
82
+ continue;
83
+ }
84
+ entries.push({ slug, name: titleLast, stories });
85
+ }
86
+ entries.sort((a, b) => a.slug.localeCompare(b.slug));
87
+ return entries;
88
+ }
89
+ __name(buildComponents, "buildComponents");
90
+ var components = buildComponents(readModules());
91
+
92
+ export { buildComponents, components, humanise, pascalToKebab };
93
+ //# sourceMappingURL=index.js.map
94
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/stories/csf-helpers.ts","../../src/stories/csf-loader-bundler.ts","../../src/stories/csf-loader.tsx"],"names":[],"mappings":";;;;AAWO,SAAS,cAAc,CAAA,EAAmB;AAC7C,EAAA,OAAO,CAAA,CAAE,OAAA,CAAQ,oBAAA,EAAsB,OAAO,EAAE,WAAA,EAAY;AAChE;AAFgB,MAAA,CAAA,aAAA,EAAA,eAAA,CAAA;AAQT,SAAS,SAAS,CAAA,EAAmB;AACxC,EAAA,MAAM,MAAA,GAAS,CAAA,CAAE,OAAA,CAAQ,oBAAA,EAAsB,OAAO,CAAA;AACtD,EAAA,OAAO,MAAA,CAAO,OAAO,CAAC,CAAA,CAAE,aAAY,GAAI,MAAA,CAAO,MAAM,CAAC,CAAA;AAC1D;AAHgB,MAAA,CAAA,QAAA,EAAA,UAAA,CAAA;;;ACFT,SAAS,kBAAA,GAAgD;AAE5D,EAAA,IAAI;AAEA,IAAA,MAAM,IAAA,GAAO,MAAA,CAAA,IAAA;AACb,IAAA,IAAI,IAAA,IAAQ,OAAO,IAAA,CAAK,IAAA,KAAS,UAAA,EAAY;AAEzC,MAAA,MAAM,UAAW,MAAA,CAAA,IAAA,CAAoB,IAAA,CAAK,kCAAkC,EAAE,KAAA,EAAO,MAAM,CAAA;AAI3F,MAAA,IAAI,WAAW,MAAA,CAAO,IAAA,CAAK,OAAO,CAAA,CAAE,SAAS,CAAA,EAAG;AAC5C,QAAA,OAAO,OAAA;AAAA,MACX;AAAA,IACJ;AAAA,EACJ,CAAA,CAAA,MAAQ;AAAA,EAER;AAGA,EAAA,IAAI;AACA,IAAA,IAAI,OAAO,SAAA,KAAY,UAAA,IAAc,OAAO,SAAA,CAAQ,YA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AAO,OAAA;AACX;AA9DgB,MAAA,CAAA,eAAA,EAAA,iBAAA,CAAA;AAiET,IAAM,UAAA,GAA+B,eAAA,CAAgB,WAAA,EAAa","file":"index.js","sourcesContent":["// Pure string helpers shared between the runtime CSF loader and the\n// Node-only `csf-slugs` helper. Kept dependency-free so the Node helper\n// never pulls in `csf-loader.tsx` (which depends on `csf-loader-bundler`,\n// which uses `import.meta`).\n\n/**\n * Convert PascalCase → kebab-case using only lowercase→uppercase\n * boundaries so leading acronyms stay intact: `'HStack'` → `'hstack'`,\n * `'AlertDialog'` → `'alert-dialog'`. Matches the docs MDX filename\n * convention (`hstack.mdx`, not `h-stack.mdx`).\n */\nexport function pascalToKebab(s: string): string {\n return s.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\n/**\n * Convert PascalCase → \"With Gap\" for display. Same boundary rule as\n * `pascalToKebab` (only lowercase→uppercase splits).\n */\nexport function humanise(s: string): string {\n const spaced = s.replace(/([a-z0-9])([A-Z])/g, '$1 $2');\n return spaced.charAt(0).toUpperCase() + spaced.slice(1);\n}\n","// Bundler-specific CSF discovery — kept in its own file because\n// `import.meta` cannot be compiled to CommonJS, which ts-jest's default\n// transform produces. The Jest config redirects this module to a stub\n// during tests so the parser never sees `import.meta`.\n//\n// Production callers come from Metro (require.context) or Vite\n// (import.meta.glob). Both static-string call sites must remain verbatim\n// — each bundler's static analyser matches the AST shape literally and\n// rewrites it at build time.\n\nimport type { CsfModule, RequireContext } from './csf-loader';\n\ndeclare const require: {\n (id: string): unknown;\n context?: (directory: string, useSubdirectories: boolean, regExp: RegExp) => RequireContext;\n};\n\nexport function discoverCsfModules(): Record<string, CsfModule> {\n // Vite / Rollup — `import.meta.glob` statically transformed at build time.\n try {\n // biome-ignore lint/suspicious/noExplicitAny: `glob` is a Vite extension to ImportMeta\n const meta = import.meta as any;\n if (meta && typeof meta.glob === 'function') {\n // biome-ignore lint/suspicious/noExplicitAny: Vite types live in `vite/client` which we don't pull in\n const modules = (import.meta as any).glob('../components/**/*.stories.tsx', { eager: true }) as Record<\n string,\n CsfModule\n >;\n if (modules && Object.keys(modules).length > 0) {\n return modules;\n }\n }\n } catch {\n // import.meta access can throw in non-ESM contexts — fall through.\n }\n\n // Metro / webpack — `require.context` static call rewritten at bundle time.\n try {\n if (typeof require === 'function' && typeof require.context === 'function') {\n const ctx = require.context('../components', true, /\\.stories\\.tsx$/);\n const out: Record<string, CsfModule> = {};\n for (const key of ctx.keys()) {\n out[key] = ctx(key);\n }\n return out;\n }\n } catch {\n // require may be undefined under pure ESM — fall through.\n }\n\n return {};\n}\n","// CSF loader — discovers every `*.stories.tsx` file under `../components`\n// at bundle time via Metro's `require.context`, normalises the CSF default\n// export + named story exports into the `ComponentEntry` shape consumed by\n// the native playground.\n//\n// This is the runtime side of the \"CSF as the single source of truth\"\n// architecture (see `docs/superpowers/specs/2026-04-28-playground-showcase-design.md`).\n// It deliberately handles only the CSF surface the existing stories use:\n// - default.title (string)\n// - default.component (component)\n// - default.args (object, optional)\n// - default.render (function, optional)\n// - named exports: each with optional `args`, optional `render`, and\n// optional `parameters.platforms` (filters the story out when the\n// current platform is not in the list — used for demos that only\n// make sense on a resizable web canvas, etc.)\n// `decorators`, `loaders`, and `play` are ignored.\n\nimport { type ComponentType, createElement, type ReactNode } from 'react';\nimport { humanise, pascalToKebab } from './csf-helpers';\nimport { discoverCsfModules } from './csf-loader-bundler';\n\ntype StoryPlatform = 'web' | 'native';\n// We can't `import { Platform } from 'react-native'` here — Jest's CJS\n// transform chokes on RN's flow-typed entry. The DOM probe is a reliable\n// proxy: only RN's JSC/Hermes runtime lacks `document`. Tests (jsdom)\n// and Storybook see `document` and resolve to `'web'`, which matches\n// where they actually run.\nconst CURRENT_PLATFORM: StoryPlatform = typeof document !== 'undefined' ? 'web' : 'native';\n\nexport type Story = {\n /** kebab-case story id (export name, kebab-cased) */\n id: string;\n /** Humanised story title (export name, spaced) */\n title: string;\n /** Component that renders this story with its merged args */\n render: ComponentType<Record<string, never>>;\n};\n\nexport type ComponentEntry = {\n /** kebab-case slug (last segment of CSF title, kebab-cased) */\n slug: string;\n /** Display name (last segment of CSF title) */\n name: string;\n /** Stories in CSF declaration order */\n stories: Story[];\n};\n\nexport { humanise, pascalToKebab } from './csf-helpers';\n\nexport type CsfModule = {\n default: {\n title: string;\n component?: ComponentType<unknown>;\n args?: Record<string, unknown>;\n render?: (args: Record<string, unknown>) => unknown;\n };\n [key: string]: unknown;\n};\n\nexport type RequireContext = {\n keys(): string[];\n (path: string): CsfModule;\n};\n\n// Tests stub the discovery via `__setCsfModules` below.\nlet testModules: Record<string, CsfModule> | null = null;\n\n/** Test-only: inject CSF modules so Jest can exercise the loader logic. */\nexport function __setCsfModules(modules: Record<string, CsfModule> | null): void {\n testModules = modules;\n}\n\nfunction readModules(): Record<string, CsfModule> {\n if (testModules) {\n return testModules;\n }\n // Bundler-specific discovery (Metro require.context / Vite import.meta.glob)\n // is isolated in csf-loader-bundler.ts because import.meta is a syntax\n // error under ts-jest's CJS target. Jest stubs that module to a no-op.\n return discoverCsfModules();\n}\n\nexport function buildComponents(modules: Record<string, CsfModule>): ComponentEntry[] {\n const entries: ComponentEntry[] = [];\n for (const path of Object.keys(modules)) {\n const mod = modules[path];\n const meta = mod?.default;\n if (!meta || typeof meta.title !== 'string') {\n continue;\n }\n\n const titleLast = meta.title.split('/').pop() ?? meta.title;\n const slug = pascalToKebab(titleLast);\n\n const stories: Story[] = [];\n // Object.keys preserves declaration order for own string keys\n // (per ECMAScript spec). We rely on this for \"stories in CSF\n // declaration order\".\n for (const key of Object.keys(mod)) {\n if (key === 'default') {\n continue;\n }\n const story = mod[key] as\n | {\n args?: Record<string, unknown>;\n render?: (a: Record<string, unknown>) => unknown;\n parameters?: { platforms?: ReadonlyArray<StoryPlatform> };\n }\n | undefined;\n if (!story || typeof story !== 'object') {\n continue;\n }\n\n const platforms = story.parameters?.platforms;\n if (platforms && !platforms.includes(CURRENT_PLATFORM)) {\n continue;\n }\n\n const mergedArgs: Record<string, unknown> = { ...(meta.args ?? {}), ...(story.args ?? {}) };\n const renderFn = story.render ?? meta.render;\n const Component = meta.component;\n\n const Render: ComponentType<Record<string, never>> = renderFn\n ? () => renderFn(mergedArgs) as ReactNode\n : Component\n ? () => createElement(Component as ComponentType<Record<string, unknown>>, mergedArgs)\n : () => null;\n\n stories.push({\n id: pascalToKebab(key),\n title: humanise(key),\n render: Render,\n });\n }\n\n if (stories.length === 0) {\n continue;\n }\n\n entries.push({ slug, name: titleLast, stories });\n }\n\n entries.sort((a, b) => a.slug.localeCompare(b.slug));\n return entries;\n}\n\n/** Native playground's source of truth for components + stories. */\nexport const components: ComponentEntry[] = buildComponents(readModules());\n"]}