@yahoo/uds-v5-wip 1.60.0 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (563) hide show
  1. package/dist/codegen/dist/loader/getLoaderArtifacts.js +2 -0
  2. package/dist/config/dist/Props.d.ts +161 -25
  3. package/dist/config/dist/bindRender.d.ts +16 -0
  4. package/dist/config/dist/bindRender.js +310 -0
  5. package/dist/config/dist/className.d.ts +54 -0
  6. package/dist/config/dist/className.js +77 -0
  7. package/dist/config/dist/component-config.d.ts +674 -161
  8. package/dist/config/dist/component-config.js +163 -0
  9. package/dist/config/dist/component-refs.d.ts +41 -18
  10. package/dist/config/dist/createConfig.d.ts +140 -59
  11. package/dist/config/dist/createConfig.js +95 -217
  12. package/dist/config/dist/createStyler.d.ts +35 -0
  13. package/dist/config/dist/createStyler.js +93 -0
  14. package/dist/config/dist/defineComponent.d.ts +297 -4
  15. package/dist/config/dist/defineComponent.js +264 -2
  16. package/dist/config/dist/defineCompositeStyle.d.ts +93 -0
  17. package/dist/config/dist/defineCompositeStyle.js +18 -0
  18. package/dist/config/dist/defineMotionConfig.d.ts +152 -0
  19. package/dist/config/dist/definePreview.d.ts +45 -0
  20. package/dist/config/dist/definePreview.js +35 -0
  21. package/dist/config/dist/defineStyleProp.d.ts +199 -3
  22. package/dist/config/dist/defineStyleProp.js +3 -2
  23. package/dist/config/dist/index.d.ts +20 -11
  24. package/dist/config/dist/index.js +8 -4
  25. package/dist/config/dist/merge-utils.js +51 -0
  26. package/dist/config/dist/propertyAcceptedTypes.d.ts +19 -0
  27. package/dist/config/dist/refs.d.ts +85 -0
  28. package/dist/config/dist/refs.js +92 -47
  29. package/dist/config/dist/resolveCompoundProps.d.ts +65 -0
  30. package/dist/config/dist/resolveCompoundProps.js +120 -0
  31. package/dist/config/dist/resolveStyleProp.d.ts +72 -3
  32. package/dist/config/dist/resolveStyleProp.js +68 -43
  33. package/dist/config/dist/runtime-registry.js +30 -2
  34. package/dist/config/dist/serialize.d.ts +8 -34
  35. package/dist/config/dist/serialize.js +10 -71
  36. package/dist/config/dist/sniffTokenType.d.ts +7 -0
  37. package/dist/config/dist/sniffTokenType.js +67 -0
  38. package/dist/config/dist/style-prop-runtime.d.ts +75 -1
  39. package/dist/config/dist/style-prop-runtime.js +390 -0
  40. package/dist/config/dist/types/css-properties.d.ts +223 -0
  41. package/dist/config/dist/types/css-values.d.ts +2 -1
  42. package/dist/config/dist/types.d.ts +14 -3
  43. package/dist/config.d.ts +21 -1560
  44. package/dist/config.js +15 -20
  45. package/dist/loader/dist/_virtual/_rolldown/runtime.js +1 -2
  46. package/dist/loader/dist/index.d.ts +2 -0
  47. package/dist/loader/dist/index.js +3 -0
  48. package/dist/loader/dist/loader/artifacts.js +2 -2
  49. package/dist/loader/dist/loader/babel-utils.js +1 -29
  50. package/dist/loader/dist/loader/internal-meta.js +38 -1
  51. package/dist/loader/dist/loader/lower-new-api-primitive.js +176 -14
  52. package/dist/loader/dist/loader.d.ts +29 -1
  53. package/dist/loader/dist/loader.js +71 -309
  54. package/dist/loader/dist/next.d.ts +2 -1
  55. package/dist/loader/dist/transform-runner.js +14 -0
  56. package/dist/loader/dist/unplugin.d.ts +27 -0
  57. package/dist/loader/dist/unplugin.js +52 -0
  58. package/dist/plugin.d.ts +2 -2
  59. package/dist/plugin.js +3 -2
  60. package/dist/tsconfig.tsbuildinfo +1 -1
  61. package/package.json +3 -51
  62. package/dist/components/accordion.config.d.ts +0 -2
  63. package/dist/components/accordion.config.js +0 -2
  64. package/dist/components/accordion.d.ts +0 -2
  65. package/dist/components/accordion.js +0 -2
  66. package/dist/components/alert.config.d.ts +0 -2
  67. package/dist/components/alert.config.js +0 -2
  68. package/dist/components/alert.d.ts +0 -2
  69. package/dist/components/alert.js +0 -2
  70. package/dist/components/anchor.config.d.ts +0 -2
  71. package/dist/components/anchor.config.js +0 -2
  72. package/dist/components/anchor.d.ts +0 -2
  73. package/dist/components/anchor.js +0 -2
  74. package/dist/components/article.d.ts +0 -2
  75. package/dist/components/article.js +0 -2
  76. package/dist/components/aside.d.ts +0 -2
  77. package/dist/components/aside.js +0 -2
  78. package/dist/components/avatar-group.config.d.ts +0 -2
  79. package/dist/components/avatar-group.config.js +0 -2
  80. package/dist/components/avatar-group.d.ts +0 -2
  81. package/dist/components/avatar-group.js +0 -2
  82. package/dist/components/avatar.config.d.ts +0 -2
  83. package/dist/components/avatar.config.js +0 -2
  84. package/dist/components/avatar.d.ts +0 -2
  85. package/dist/components/avatar.js +0 -2
  86. package/dist/components/badge.config.d.ts +0 -2
  87. package/dist/components/badge.config.js +0 -2
  88. package/dist/components/badge.d.ts +0 -2
  89. package/dist/components/badge.js +0 -2
  90. package/dist/components/box.d.ts +0 -2
  91. package/dist/components/box.js +0 -2
  92. package/dist/components/breadcrumb.config.d.ts +0 -2
  93. package/dist/components/breadcrumb.config.js +0 -2
  94. package/dist/components/breadcrumb.d.ts +0 -2
  95. package/dist/components/breadcrumb.js +0 -2
  96. package/dist/components/button.config.d.ts +0 -2
  97. package/dist/components/button.config.js +0 -2
  98. package/dist/components/button.d.ts +0 -2
  99. package/dist/components/button.js +0 -2
  100. package/dist/components/card.config.d.ts +0 -2
  101. package/dist/components/card.config.js +0 -2
  102. package/dist/components/card.d.ts +0 -2
  103. package/dist/components/card.js +0 -2
  104. package/dist/components/collapsible.config.d.ts +0 -2
  105. package/dist/components/collapsible.config.js +0 -2
  106. package/dist/components/collapsible.d.ts +0 -2
  107. package/dist/components/collapsible.js +0 -2
  108. package/dist/components/command.config.d.ts +0 -2
  109. package/dist/components/command.config.js +0 -2
  110. package/dist/components/command.d.ts +0 -2
  111. package/dist/components/command.js +0 -2
  112. package/dist/components/control-color.config.d.ts +0 -2
  113. package/dist/components/control-color.config.js +0 -2
  114. package/dist/components/control-color.d.ts +0 -2
  115. package/dist/components/control-color.js +0 -2
  116. package/dist/components/control-curve.config.d.ts +0 -2
  117. package/dist/components/control-curve.config.js +0 -2
  118. package/dist/components/control-curve.d.ts +0 -2
  119. package/dist/components/control-curve.js +0 -2
  120. package/dist/components/control-folder.config.d.ts +0 -2
  121. package/dist/components/control-folder.config.js +0 -2
  122. package/dist/components/control-folder.d.ts +0 -2
  123. package/dist/components/control-folder.js +0 -2
  124. package/dist/components/control-group.config.d.ts +0 -2
  125. package/dist/components/control-group.config.js +0 -2
  126. package/dist/components/control-group.d.ts +0 -2
  127. package/dist/components/control-group.js +0 -2
  128. package/dist/components/control-knob.config.d.ts +0 -2
  129. package/dist/components/control-knob.config.js +0 -2
  130. package/dist/components/control-knob.d.ts +0 -2
  131. package/dist/components/control-knob.js +0 -2
  132. package/dist/components/control-panel.config.d.ts +0 -2
  133. package/dist/components/control-panel.config.js +0 -2
  134. package/dist/components/control-panel.d.ts +0 -2
  135. package/dist/components/control-panel.js +0 -2
  136. package/dist/components/control-select.config.d.ts +0 -2
  137. package/dist/components/control-select.config.js +0 -2
  138. package/dist/components/control-select.d.ts +0 -2
  139. package/dist/components/control-select.js +0 -2
  140. package/dist/components/control-slider.config.d.ts +0 -2
  141. package/dist/components/control-slider.config.js +0 -2
  142. package/dist/components/control-slider.d.ts +0 -2
  143. package/dist/components/control-slider.js +0 -2
  144. package/dist/components/control-spring.config.d.ts +0 -2
  145. package/dist/components/control-spring.config.js +0 -2
  146. package/dist/components/control-spring.d.ts +0 -2
  147. package/dist/components/control-spring.js +0 -2
  148. package/dist/components/control-stepper.config.d.ts +0 -2
  149. package/dist/components/control-stepper.config.js +0 -2
  150. package/dist/components/control-stepper.d.ts +0 -2
  151. package/dist/components/control-stepper.js +0 -2
  152. package/dist/components/control-toggle.config.d.ts +0 -2
  153. package/dist/components/control-toggle.config.js +0 -2
  154. package/dist/components/control-toggle.d.ts +0 -2
  155. package/dist/components/control-toggle.js +0 -2
  156. package/dist/components/dist/_slots.js +0 -8
  157. package/dist/components/dist/accordion.config.d.ts +0 -431
  158. package/dist/components/dist/accordion.config.js +0 -81
  159. package/dist/components/dist/accordion.d.ts +0 -453
  160. package/dist/components/dist/accordion.js +0 -60
  161. package/dist/components/dist/alert.config.d.ts +0 -219
  162. package/dist/components/dist/alert.config.js +0 -54
  163. package/dist/components/dist/alert.d.ts +0 -230
  164. package/dist/components/dist/alert.js +0 -16
  165. package/dist/components/dist/anchor.config.d.ts +0 -250
  166. package/dist/components/dist/anchor.config.js +0 -22
  167. package/dist/components/dist/anchor.d.ts +0 -261
  168. package/dist/components/dist/anchor.js +0 -9
  169. package/dist/components/dist/article.d.ts +0 -11
  170. package/dist/components/dist/article.js +0 -9
  171. package/dist/components/dist/aside.d.ts +0 -11
  172. package/dist/components/dist/aside.js +0 -9
  173. package/dist/components/dist/avatar-group.config.d.ts +0 -315
  174. package/dist/components/dist/avatar-group.config.js +0 -33
  175. package/dist/components/dist/avatar-group.d.ts +0 -329
  176. package/dist/components/dist/avatar-group.js +0 -39
  177. package/dist/components/dist/avatar.config.d.ts +0 -197
  178. package/dist/components/dist/avatar.config.js +0 -49
  179. package/dist/components/dist/avatar.d.ts +0 -211
  180. package/dist/components/dist/avatar.js +0 -20
  181. package/dist/components/dist/badge.config.d.ts +0 -477
  182. package/dist/components/dist/badge.config.js +0 -99
  183. package/dist/components/dist/badge.d.ts +0 -489
  184. package/dist/components/dist/badge.js +0 -16
  185. package/dist/components/dist/box.d.ts +0 -14
  186. package/dist/components/dist/box.js +0 -9
  187. package/dist/components/dist/breadcrumb.config.d.ts +0 -390
  188. package/dist/components/dist/breadcrumb.config.js +0 -43
  189. package/dist/components/dist/breadcrumb.d.ts +0 -420
  190. package/dist/components/dist/breadcrumb.js +0 -119
  191. package/dist/components/dist/button.config.d.ts +0 -381
  192. package/dist/components/dist/button.config.js +0 -91
  193. package/dist/components/dist/button.d.ts +0 -403
  194. package/dist/components/dist/button.js +0 -35
  195. package/dist/components/dist/card.config.d.ts +0 -336
  196. package/dist/components/dist/card.config.js +0 -33
  197. package/dist/components/dist/card.d.ts +0 -352
  198. package/dist/components/dist/card.js +0 -27
  199. package/dist/components/dist/collapsible.config.d.ts +0 -45
  200. package/dist/components/dist/collapsible.config.js +0 -46
  201. package/dist/components/dist/collapsible.d.ts +0 -61
  202. package/dist/components/dist/collapsible.js +0 -38
  203. package/dist/components/dist/command.config.d.ts +0 -1613
  204. package/dist/components/dist/command.config.js +0 -170
  205. package/dist/components/dist/command.d.ts +0 -1722
  206. package/dist/components/dist/command.js +0 -341
  207. package/dist/components/dist/control-color.config.d.ts +0 -979
  208. package/dist/components/dist/control-color.config.js +0 -81
  209. package/dist/components/dist/control-color.d.ts +0 -995
  210. package/dist/components/dist/control-color.js +0 -64
  211. package/dist/components/dist/control-curve.config.d.ts +0 -18
  212. package/dist/components/dist/control-curve.config.js +0 -14
  213. package/dist/components/dist/control-curve.d.ts +0 -35
  214. package/dist/components/dist/control-curve.js +0 -81
  215. package/dist/components/dist/control-folder.config.d.ts +0 -177
  216. package/dist/components/dist/control-folder.config.js +0 -47
  217. package/dist/components/dist/control-folder.d.ts +0 -194
  218. package/dist/components/dist/control-folder.js +0 -41
  219. package/dist/components/dist/control-group.config.d.ts +0 -859
  220. package/dist/components/dist/control-group.config.js +0 -80
  221. package/dist/components/dist/control-group.d.ts +0 -881
  222. package/dist/components/dist/control-group.js +0 -89
  223. package/dist/components/dist/control-knob.config.d.ts +0 -792
  224. package/dist/components/dist/control-knob.config.js +0 -67
  225. package/dist/components/dist/control-knob.d.ts +0 -819
  226. package/dist/components/dist/control-knob.js +0 -148
  227. package/dist/components/dist/control-panel.config.d.ts +0 -402
  228. package/dist/components/dist/control-panel.config.js +0 -38
  229. package/dist/components/dist/control-panel.d.ts +0 -415
  230. package/dist/components/dist/control-panel.js +0 -22
  231. package/dist/components/dist/control-select.config.d.ts +0 -1176
  232. package/dist/components/dist/control-select.config.js +0 -102
  233. package/dist/components/dist/control-select.d.ts +0 -1200
  234. package/dist/components/dist/control-select.js +0 -63
  235. package/dist/components/dist/control-slider.config.d.ts +0 -104
  236. package/dist/components/dist/control-slider.config.js +0 -98
  237. package/dist/components/dist/control-slider.d.ts +0 -127
  238. package/dist/components/dist/control-slider.js +0 -87
  239. package/dist/components/dist/control-spring.config.d.ts +0 -417
  240. package/dist/components/dist/control-spring.config.js +0 -36
  241. package/dist/components/dist/control-spring.d.ts +0 -439
  242. package/dist/components/dist/control-spring.js +0 -136
  243. package/dist/components/dist/control-stepper.config.d.ts +0 -1084
  244. package/dist/components/dist/control-stepper.config.js +0 -108
  245. package/dist/components/dist/control-stepper.d.ts +0 -1104
  246. package/dist/components/dist/control-stepper.js +0 -109
  247. package/dist/components/dist/control-toggle.config.d.ts +0 -407
  248. package/dist/components/dist/control-toggle.config.js +0 -26
  249. package/dist/components/dist/control-toggle.d.ts +0 -420
  250. package/dist/components/dist/control-toggle.js +0 -36
  251. package/dist/components/dist/createSlot.d.ts +0 -8
  252. package/dist/components/dist/createSlot.js +0 -89
  253. package/dist/components/dist/dropdown.config.d.ts +0 -920
  254. package/dist/components/dist/dropdown.config.js +0 -107
  255. package/dist/components/dist/dropdown.d.ts +0 -950
  256. package/dist/components/dist/dropdown.js +0 -92
  257. package/dist/components/dist/empty-state.config.d.ts +0 -396
  258. package/dist/components/dist/empty-state.config.js +0 -53
  259. package/dist/components/dist/empty-state.d.ts +0 -416
  260. package/dist/components/dist/empty-state.js +0 -33
  261. package/dist/components/dist/footer.d.ts +0 -11
  262. package/dist/components/dist/footer.js +0 -9
  263. package/dist/components/dist/grid.d.ts +0 -41
  264. package/dist/components/dist/grid.js +0 -34
  265. package/dist/components/dist/header.d.ts +0 -11
  266. package/dist/components/dist/header.js +0 -9
  267. package/dist/components/dist/hstack.d.ts +0 -15
  268. package/dist/components/dist/hstack.js +0 -21
  269. package/dist/components/dist/image.d.ts +0 -19
  270. package/dist/components/dist/image.js +0 -9
  271. package/dist/components/dist/input.config.d.ts +0 -58
  272. package/dist/components/dist/input.config.js +0 -42
  273. package/dist/components/dist/input.d.ts +0 -67
  274. package/dist/components/dist/input.js +0 -14
  275. package/dist/components/dist/item.config.d.ts +0 -351
  276. package/dist/components/dist/item.config.js +0 -83
  277. package/dist/components/dist/item.d.ts +0 -374
  278. package/dist/components/dist/item.js +0 -51
  279. package/dist/components/dist/list.d.ts +0 -19
  280. package/dist/components/dist/list.js +0 -21
  281. package/dist/components/dist/main.d.ts +0 -11
  282. package/dist/components/dist/main.js +0 -9
  283. package/dist/components/dist/modal.config.d.ts +0 -397
  284. package/dist/components/dist/modal.config.js +0 -92
  285. package/dist/components/dist/modal.d.ts +0 -433
  286. package/dist/components/dist/modal.js +0 -125
  287. package/dist/components/dist/nav-header.config.d.ts +0 -158
  288. package/dist/components/dist/nav-header.config.js +0 -26
  289. package/dist/components/dist/nav-header.d.ts +0 -173
  290. package/dist/components/dist/nav-header.js +0 -23
  291. package/dist/components/dist/nav.d.ts +0 -11
  292. package/dist/components/dist/nav.js +0 -9
  293. package/dist/components/dist/preset-bar.config.d.ts +0 -192
  294. package/dist/components/dist/preset-bar.config.js +0 -39
  295. package/dist/components/dist/preset-bar.d.ts +0 -215
  296. package/dist/components/dist/preset-bar.js +0 -71
  297. package/dist/components/dist/presets/index.d.ts +0 -17674
  298. package/dist/components/dist/presets/index.js +0 -97
  299. package/dist/components/dist/pressable.d.ts +0 -11
  300. package/dist/components/dist/pressable.js +0 -9
  301. package/dist/components/dist/progress.config.d.ts +0 -296
  302. package/dist/components/dist/progress.config.js +0 -35
  303. package/dist/components/dist/progress.d.ts +0 -311
  304. package/dist/components/dist/progress.js +0 -43
  305. package/dist/components/dist/section.d.ts +0 -11
  306. package/dist/components/dist/section.js +0 -9
  307. package/dist/components/dist/select.config.d.ts +0 -31
  308. package/dist/components/dist/select.config.js +0 -25
  309. package/dist/components/dist/select.d.ts +0 -45
  310. package/dist/components/dist/select.js +0 -13
  311. package/dist/components/dist/sheet.config.d.ts +0 -245
  312. package/dist/components/dist/sheet.config.js +0 -99
  313. package/dist/components/dist/sheet.d.ts +0 -267
  314. package/dist/components/dist/sheet.js +0 -53
  315. package/dist/components/dist/sidebar.config.d.ts +0 -1651
  316. package/dist/components/dist/sidebar.config.js +0 -217
  317. package/dist/components/dist/sidebar.d.ts +0 -1825
  318. package/dist/components/dist/sidebar.js +0 -492
  319. package/dist/components/dist/skeleton.config.d.ts +0 -16
  320. package/dist/components/dist/skeleton.config.js +0 -10
  321. package/dist/components/dist/skeleton.d.ts +0 -27
  322. package/dist/components/dist/skeleton.js +0 -16
  323. package/dist/components/dist/slider.config.d.ts +0 -44
  324. package/dist/components/dist/slider.config.js +0 -40
  325. package/dist/components/dist/slider.d.ts +0 -70
  326. package/dist/components/dist/slider.js +0 -247
  327. package/dist/components/dist/spinner.config.d.ts +0 -34
  328. package/dist/components/dist/spinner.config.js +0 -24
  329. package/dist/components/dist/spinner.d.ts +0 -42
  330. package/dist/components/dist/spinner.js +0 -29
  331. package/dist/components/dist/svg.d.ts +0 -21
  332. package/dist/components/dist/svg.js +0 -17
  333. package/dist/components/dist/switch.config.d.ts +0 -353
  334. package/dist/components/dist/switch.config.js +0 -47
  335. package/dist/components/dist/switch.d.ts +0 -370
  336. package/dist/components/dist/switch.js +0 -32
  337. package/dist/components/dist/table.d.ts +0 -36
  338. package/dist/components/dist/table.js +0 -29
  339. package/dist/components/dist/tabs.config.d.ts +0 -611
  340. package/dist/components/dist/tabs.config.js +0 -56
  341. package/dist/components/dist/tabs.d.ts +0 -632
  342. package/dist/components/dist/tabs.js +0 -77
  343. package/dist/components/dist/text.config.d.ts +0 -306
  344. package/dist/components/dist/text.config.js +0 -149
  345. package/dist/components/dist/text.d.ts +0 -205
  346. package/dist/components/dist/text.js +0 -12
  347. package/dist/components/dist/textarea.config.d.ts +0 -352
  348. package/dist/components/dist/textarea.config.js +0 -57
  349. package/dist/components/dist/textarea.d.ts +0 -362
  350. package/dist/components/dist/textarea.js +0 -9
  351. package/dist/components/dist/toast.config.d.ts +0 -335
  352. package/dist/components/dist/toast.config.js +0 -145
  353. package/dist/components/dist/toast.d.ts +0 -426
  354. package/dist/components/dist/toast.js +0 -159
  355. package/dist/components/dist/tooltip.config.d.ts +0 -193
  356. package/dist/components/dist/tooltip.config.js +0 -40
  357. package/dist/components/dist/tooltip.d.ts +0 -206
  358. package/dist/components/dist/tooltip.js +0 -28
  359. package/dist/components/dist/vstack.d.ts +0 -15
  360. package/dist/components/dist/vstack.js +0 -20
  361. package/dist/components/dropdown.config.d.ts +0 -2
  362. package/dist/components/dropdown.config.js +0 -2
  363. package/dist/components/dropdown.d.ts +0 -2
  364. package/dist/components/dropdown.js +0 -2
  365. package/dist/components/empty-state.config.d.ts +0 -2
  366. package/dist/components/empty-state.config.js +0 -2
  367. package/dist/components/empty-state.d.ts +0 -2
  368. package/dist/components/empty-state.js +0 -2
  369. package/dist/components/footer.d.ts +0 -2
  370. package/dist/components/footer.js +0 -2
  371. package/dist/components/grid.d.ts +0 -2
  372. package/dist/components/grid.js +0 -2
  373. package/dist/components/header.d.ts +0 -2
  374. package/dist/components/header.js +0 -2
  375. package/dist/components/hstack.d.ts +0 -2
  376. package/dist/components/hstack.js +0 -2
  377. package/dist/components/image.d.ts +0 -2
  378. package/dist/components/image.js +0 -2
  379. package/dist/components/input.config.d.ts +0 -2
  380. package/dist/components/input.config.js +0 -2
  381. package/dist/components/input.d.ts +0 -2
  382. package/dist/components/input.js +0 -2
  383. package/dist/components/item.config.d.ts +0 -2
  384. package/dist/components/item.config.js +0 -2
  385. package/dist/components/item.d.ts +0 -2
  386. package/dist/components/item.js +0 -2
  387. package/dist/components/list.d.ts +0 -2
  388. package/dist/components/list.js +0 -2
  389. package/dist/components/main.d.ts +0 -2
  390. package/dist/components/main.js +0 -2
  391. package/dist/components/modal.config.d.ts +0 -2
  392. package/dist/components/modal.config.js +0 -2
  393. package/dist/components/modal.d.ts +0 -2
  394. package/dist/components/modal.js +0 -2
  395. package/dist/components/nav-header.config.d.ts +0 -2
  396. package/dist/components/nav-header.config.js +0 -2
  397. package/dist/components/nav-header.d.ts +0 -2
  398. package/dist/components/nav-header.js +0 -2
  399. package/dist/components/nav.d.ts +0 -2
  400. package/dist/components/nav.js +0 -2
  401. package/dist/components/preset-bar.config.d.ts +0 -2
  402. package/dist/components/preset-bar.config.js +0 -2
  403. package/dist/components/preset-bar.d.ts +0 -2
  404. package/dist/components/preset-bar.js +0 -2
  405. package/dist/components/presets/index.d.ts +0 -44
  406. package/dist/components/presets/index.js +0 -44
  407. package/dist/components/pressable.d.ts +0 -2
  408. package/dist/components/pressable.js +0 -2
  409. package/dist/components/progress.config.d.ts +0 -2
  410. package/dist/components/progress.config.js +0 -2
  411. package/dist/components/progress.d.ts +0 -2
  412. package/dist/components/progress.js +0 -2
  413. package/dist/components/section.d.ts +0 -2
  414. package/dist/components/section.js +0 -2
  415. package/dist/components/select.config.d.ts +0 -2
  416. package/dist/components/select.config.js +0 -2
  417. package/dist/components/select.d.ts +0 -2
  418. package/dist/components/select.js +0 -2
  419. package/dist/components/sheet.config.d.ts +0 -2
  420. package/dist/components/sheet.config.js +0 -2
  421. package/dist/components/sheet.d.ts +0 -2
  422. package/dist/components/sheet.js +0 -2
  423. package/dist/components/sidebar.config.d.ts +0 -2
  424. package/dist/components/sidebar.config.js +0 -2
  425. package/dist/components/sidebar.d.ts +0 -2
  426. package/dist/components/sidebar.js +0 -2
  427. package/dist/components/skeleton.config.d.ts +0 -2
  428. package/dist/components/skeleton.config.js +0 -2
  429. package/dist/components/skeleton.d.ts +0 -2
  430. package/dist/components/skeleton.js +0 -2
  431. package/dist/components/slider.config.d.ts +0 -2
  432. package/dist/components/slider.config.js +0 -2
  433. package/dist/components/slider.d.ts +0 -2
  434. package/dist/components/slider.js +0 -2
  435. package/dist/components/spinner.config.d.ts +0 -2
  436. package/dist/components/spinner.config.js +0 -2
  437. package/dist/components/spinner.d.ts +0 -2
  438. package/dist/components/spinner.js +0 -2
  439. package/dist/components/svg.d.ts +0 -2
  440. package/dist/components/svg.js +0 -2
  441. package/dist/components/switch.config.d.ts +0 -2
  442. package/dist/components/switch.config.js +0 -2
  443. package/dist/components/switch.d.ts +0 -2
  444. package/dist/components/switch.js +0 -2
  445. package/dist/components/table.d.ts +0 -2
  446. package/dist/components/table.js +0 -2
  447. package/dist/components/tabs.config.d.ts +0 -2
  448. package/dist/components/tabs.config.js +0 -2
  449. package/dist/components/tabs.d.ts +0 -2
  450. package/dist/components/tabs.js +0 -2
  451. package/dist/components/text.config.d.ts +0 -2
  452. package/dist/components/text.config.js +0 -2
  453. package/dist/components/text.d.ts +0 -2
  454. package/dist/components/text.js +0 -2
  455. package/dist/components/textarea.config.d.ts +0 -2
  456. package/dist/components/textarea.config.js +0 -2
  457. package/dist/components/textarea.d.ts +0 -2
  458. package/dist/components/textarea.js +0 -2
  459. package/dist/components/toast.config.d.ts +0 -2
  460. package/dist/components/toast.config.js +0 -2
  461. package/dist/components/toast.d.ts +0 -2
  462. package/dist/components/toast.js +0 -2
  463. package/dist/components/tooltip.config.d.ts +0 -2
  464. package/dist/components/tooltip.config.js +0 -2
  465. package/dist/components/tooltip.d.ts +0 -2
  466. package/dist/components/tooltip.js +0 -2
  467. package/dist/components/vstack.d.ts +0 -2
  468. package/dist/components/vstack.js +0 -2
  469. package/dist/config/dist/component-resolution.js +0 -78
  470. package/dist/config/dist/consts/defaultColors.d.ts +0 -253
  471. package/dist/config/dist/consts/defaultColors.js +0 -252
  472. package/dist/config/dist/createComponent.d.ts +0 -1
  473. package/dist/config/dist/createComponent.js +0 -1
  474. package/dist/config/dist/preset-merge.js +0 -192
  475. package/dist/config/dist/propertyGroups.d.ts +0 -1
  476. package/dist/config/dist/propertyGroups.js +0 -414
  477. package/dist/config/dist/resolveTokenTypes.d.ts +0 -1
  478. package/dist/config/dist/resolveTokenTypes.js +0 -149
  479. package/dist/config-utils/dist/componentConfig.d.ts +0 -10
  480. package/dist/config-utils/dist/componentConfig.js +0 -11
  481. package/dist/config-utils.d.ts +0 -2
  482. package/dist/config-utils.js +0 -2
  483. package/dist/core/dist/color-opacity-map.js +0 -33
  484. package/dist/core/dist/compositeStyles.d.ts +0 -21
  485. package/dist/core/dist/compositeStyles.js +0 -51
  486. package/dist/core/dist/configurable-prop-helpers.d.ts +0 -31
  487. package/dist/core/dist/configurable-prop-helpers.js +0 -61
  488. package/dist/core/dist/createComponent.boundaries.js +0 -192
  489. package/dist/core/dist/createComponent.d.ts +0 -56
  490. package/dist/core/dist/createComponent.js +0 -67
  491. package/dist/core/dist/createComponentExample.d.ts +0 -41
  492. package/dist/core/dist/createComponentExample.js +0 -27
  493. package/dist/core/dist/createProvider.d.ts +0 -12
  494. package/dist/core/dist/createProvider.js +0 -24
  495. package/dist/core/dist/generated/stylePropsTwMap.d.ts +0 -1700
  496. package/dist/core/dist/generated/stylePropsTwMap.js +0 -570
  497. package/dist/core/dist/getComponentStyles.d.ts +0 -49
  498. package/dist/core/dist/getComponentStyles.js +0 -85
  499. package/dist/core/dist/getStyles.d.ts +0 -42
  500. package/dist/core/dist/getStyles.js +0 -300
  501. package/dist/core/dist/index.d.ts +0 -13
  502. package/dist/core/dist/index.js +0 -13
  503. package/dist/core/dist/modifier-mappings.d.ts +0 -12
  504. package/dist/core/dist/modifier-mappings.js +0 -61
  505. package/dist/core/dist/resolveMotionState.d.ts +0 -4
  506. package/dist/core/dist/resolveMotionState.js +0 -17
  507. package/dist/core/dist/resolveProps.boundaries.js +0 -131
  508. package/dist/core/dist/style-prop-data.d.ts +0 -32
  509. package/dist/core/dist/style-prop-data.js +0 -1257
  510. package/dist/core/dist/transformPreset.d.ts +0 -17
  511. package/dist/core/dist/transformPreset.js +0 -28
  512. package/dist/core/dist/withDefaultStyleProps.d.ts +0 -43
  513. package/dist/core/dist/withDefaultStyleProps.js +0 -18
  514. package/dist/core.d.ts +0 -14
  515. package/dist/core.js +0 -15
  516. package/dist/createSlot.d.ts +0 -2
  517. package/dist/createSlot.js +0 -2
  518. package/dist/fixtures.d.ts +0 -4
  519. package/dist/fixtures.js +0 -5
  520. package/dist/foundational-presets/dist/_virtual/_rolldown/runtime.js +0 -13
  521. package/dist/foundational-presets/dist/defaultPreset.d.ts +0 -1557
  522. package/dist/foundational-presets/dist/defaultPreset.js +0 -615
  523. package/dist/foundational-presets/dist/index.d.ts +0 -1
  524. package/dist/foundational-presets/dist/index.js +0 -1
  525. package/dist/foundational-presets/dist/motion.d.ts +0 -12
  526. package/dist/foundational-presets/dist/motion.js +0 -10
  527. package/dist/foundational-presets/dist/style-props.js +0 -1445
  528. package/dist/loader/dist/loader/create-component-data.js +0 -33
  529. package/dist/loader/dist/loader/create-component-lowering.js +0 -454
  530. package/dist/loader/dist/loader/data-attr-transform.js +0 -191
  531. package/dist/loader/dist/loader/dynamic-style-codegen.js +0 -97
  532. package/dist/loader/dist/loader/motion-transform.js +0 -717
  533. package/dist/loader/dist/loader/style-transform.js +0 -670
  534. package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -203
  535. package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -25
  536. package/dist/loader/dist/node_modules/react/cjs/react.development.js +0 -762
  537. package/dist/loader/dist/node_modules/react/cjs/react.production.js +0 -351
  538. package/dist/loader/dist/node_modules/react/index.js +0 -10
  539. package/dist/loader/dist/node_modules/react/jsx-runtime.js +0 -10
  540. package/dist/loader/dist/packages/core/dist/color-opacity-map.js +0 -33
  541. package/dist/loader/dist/packages/core/dist/compositeStyles.js +0 -43
  542. package/dist/loader/dist/packages/core/dist/createComponent.js +0 -6
  543. package/dist/loader/dist/packages/core/dist/createProvider.js +0 -7
  544. package/dist/loader/dist/packages/core/dist/generated/stylePropsTwMap.js +0 -570
  545. package/dist/loader/dist/packages/core/dist/getComponentStyles.js +0 -2
  546. package/dist/loader/dist/packages/core/dist/getStyles.js +0 -60
  547. package/dist/loader/dist/packages/core/dist/index.js +0 -6
  548. package/dist/loader/dist/packages/core/dist/modifier-mappings.js +0 -61
  549. package/dist/loader/dist/packages/core/dist/style-prop-data.js +0 -1257
  550. package/dist/loader/dist/packages/core/dist/withDefaultStyleProps.js +0 -1
  551. package/dist/presets/dist/defaultPreset.d.ts +0 -6
  552. package/dist/presets/dist/defaultPreset.js +0 -51
  553. package/dist/presets/dist/index.d.ts +0 -1
  554. package/dist/presets/dist/index.js +0 -1
  555. package/dist/presets/motion.d.ts +0 -2
  556. package/dist/presets/motion.js +0 -2
  557. package/dist/presets.d.ts +0 -2
  558. package/dist/presets.js +0 -3
  559. package/dist/styles.d.ts +0 -4
  560. package/dist/styles.js +0 -5
  561. package/dist/transformPreset.d.ts +0 -2
  562. package/dist/transformPreset.js +0 -3
  563. /package/dist/{config/dist/component-resolution.d.ts → loader/dist/transform-runner.d.ts} +0 -0
@@ -1,9 +1,24 @@
1
- import { ComponentRef, CompositeRef, RegisteredComponents, StylePropRef } from "./component-refs.js";
2
- import * as React$1 from "react";
3
- import { ReactNode } from "react";
1
+ import { CompositeRef, RegisteredComposites, StylePropRef } from "./component-refs.js";
2
+ import { SlotMotionConfig } from "./defineMotionConfig.js";
3
+ import { Props } from "./Props.js";
4
+ import * as _$react from "react";
5
+ import { CSSProperties, ReactNode } from "react";
6
+ import { ArbitraryValue, ModifierProp } from "@uds/types";
4
7
 
5
8
  //#region ../config/dist/component-config.d.ts
6
9
  //#region src/component-config.d.ts
10
+ /**
11
+ * Style values for a component-config slot. Accepts every registered
12
+ * style-prop name (per-app `RegisteredStyleProps` augmentation provides
13
+ * autocomplete), standard CSS properties (camelCase), and modifier
14
+ * objects (e.g. `_hover: { ... }`). Values are raw CSS strings, token
15
+ * literals, or `token('ns/name')` markers — not typed token names.
16
+ */
17
+ type ComponentSlotStyles = { [K in Exclude<string | keyof CSSProperties, 'motion'>]?: string | number | boolean | TokenMarker | undefined } & { [K in ModifierProp]?: ComponentSlotStyles } & {
18
+ /** Per-slot motion config (JS runtime): co-located with slot styles. */motion?: SlotMotionConfig;
19
+ };
20
+ /** Allowed values for component slot motion in config objects. */
21
+ type ComponentMotionValue<TMotionAlias extends string = string> = SlotMotionConfig | TMotionAlias | ArbitraryValue;
7
22
  /**
8
23
  * HTML tag literal. The TypeScript type is `string` (any tag name);
9
24
  * runtime renders it via `React.createElement(tag, ...)`.
@@ -13,54 +28,78 @@ import { ReactNode } from "react";
13
28
  * autocomplete tag names from JSX.
14
29
  */
15
30
  type HtmlTag = string;
31
+ /**
32
+ * Per-slot motion descriptor — same shape the legacy `base.<slot>.motion`
33
+ * carried, surfaced verbatim into the build-time manifest under
34
+ * `components.<Name>.motion.<slot>`. Codegen does not interpret the
35
+ * keys; the loader's `applySlotMotionToElement` reads them at JSX
36
+ * rewrite time, so adding a new field here automatically flows through
37
+ * once the loader picks it up.
38
+ *
39
+ * `runtime: 'css'` opts out — the loader's `getCustomSlotMotion` skips
40
+ * css-runtime entries (CSS keyframes are handled elsewhere).
41
+ */
42
+ interface SlotMotion {
43
+ readonly runtime?: 'js' | 'css';
44
+ readonly initial?: unknown;
45
+ readonly animate?: unknown;
46
+ readonly exit?: unknown;
47
+ readonly transition?: unknown;
48
+ readonly whileHover?: unknown;
49
+ readonly whileTap?: unknown;
50
+ readonly drag?: unknown;
51
+ readonly dragConstraints?: unknown;
52
+ readonly dragElastic?: unknown;
53
+ readonly dragSnapToOrigin?: unknown;
54
+ readonly layout?: unknown;
55
+ }
16
56
  /**
17
57
  * Object form for a primitive (HTML-tag) layer that needs locked attrs
18
- * or default CSS-property values.
58
+ * (e.g. `role`, `aria-*`, locked `href`).
19
59
  *
20
60
  * Distributive mapped union over `keyof React.JSX.IntrinsicElements` so
21
61
  * `attrs` is narrowed to the HTML props valid for the chosen `tag` at
22
62
  * the call site — `{ tag: 'a', attrs: { href: '/x' } }` type-checks;
23
- * `{ tag: 'div', attrs: { href: '/x' } }` does not. `defaultProps`
24
- * stays loosely typed: it carries style-prop-keyed CSS declarations
25
- * (incl. `_hover`/`_focus`/etc. modifier keys) that feed the @utility
26
- * codegen, NOT HTML props.
27
- */
28
- type PrimitiveLayer = { [T in keyof React$1.JSX.IntrinsicElements]: {
29
- tag: T; /** HTML attributes always applied to this layer (e.g. `role="alert"`). */
30
- attrs?: Partial<React$1.ComponentPropsWithoutRef<T>>;
31
- /**
32
- * Default per-layer CSS declarations. Keys are style-prop names (or
33
- * raw CSS properties when no registered style prop applies); values
34
- * are token refs (`'{spacing/4}'`), alias names, or literal CSS.
35
- * Modifier keys (`_hover`, `_focus`, `_dataDisabled`, ...) nest the
36
- * same shape recursively. Codegen compiles this into a single
37
- * `@utility componentName-layerName { ... }` block.
38
- */
39
- defaultProps?: Record<string, unknown>;
40
- } }[keyof React$1.JSX.IntrinsicElements];
63
+ * `{ tag: 'div', attrs: { href: '/x' } }` does not.
64
+ *
65
+ * Per-layer base styles live in the config's top-level
66
+ * `base: { <layer>: {...} }` block — not inside this object.
67
+ */
68
+ type PrimitiveLayer = { [T in keyof _$react.JSX.IntrinsicElements]: {
69
+ tag: T;
70
+ attrs?: Partial<_$react.ComponentPropsWithoutRef<T>>;
71
+ } }[keyof _$react.JSX.IntrinsicElements];
41
72
  /**
42
- * Object form for a layer that's a composed React component (registered
43
- * via `.registerComponents({...})`). The `component` field is a brace-ref
44
- * narrowed against `RegisteredComponents`. `defaultProps` is narrowed
45
- * per-component so authors can only pass props the referenced component
46
- * actually accepts.
73
+ * Structural shape of a `defineComponent` value as it appears in a
74
+ * `layers` slot. Mirrors `BoundComponent` from `defineComponent.ts` but
75
+ * defined locally to avoid the circular import (`defineComponent.ts`
76
+ * imports types from this file). Authors don't see this shape directly
77
+ * they pass the actual `BoundComponent` value, which satisfies it.
47
78
  *
48
- * Codegen emits `RegisteredComponents[K]` as the component's resolved
49
- * prop shape (e.g. `{ backgroundColor: RegisteredStyleProps['bg']; … }`).
50
- * `Partial<RegisteredComponents[K]>` lets `defaultProps` narrow against
51
- * that shape. Without registered components, the union is `never` (so
52
- * package-internal authoring sites don't have to deal with this shape).
79
+ * The `__config` slot is the discriminator that distinguishes a
80
+ * composed-component layer from a plain function (which a layer can't
81
+ * be guards on the layer position rely on this brand).
53
82
  */
54
- type ComposedLayer = { [K in keyof RegisteredComponents & string]: {
55
- component: `{${K}}`;
56
- defaultProps?: Partial<RegisteredComponents[K]>;
57
- } }[keyof RegisteredComponents & string];
83
+ type ComposedComponentValue = _$react.FC< // biome-ignore lint/suspicious/noExplicitAny: any registered component
84
+ any> & {
85
+ readonly __config: ComponentConfigValue<Record<string, LayerInput>, any, HtmlTag | undefined>;
86
+ };
58
87
  /**
59
- * Allowed forms for a single layer's value. Authors usually pick the
60
- * shorthand (a bare tag string or a brace-ref); the object forms exist
61
- * for the cases that need `attrs` or `defaultProps`.
88
+ * Allowed forms for a single layer's value:
89
+ *
90
+ * - **`HtmlTag`** bare string (`'div'`, `'span'`, `'a'`, …) for
91
+ * plain HTML elements.
92
+ * - **`PrimitiveLayer`** — `{ tag, attrs }` object form for HTML
93
+ * layers that need locked attributes (`role`, `aria-*`, etc.).
94
+ * - **`ComposedComponentValue`** — a `defineComponent`-produced
95
+ * value (`Box`, `Pressable`, `Text`, …) used directly as the
96
+ * layer value.
97
+ *
98
+ * Per-layer base styles always live in the config's top-level
99
+ * `base: { <layer>: {...} }` block; consumer-facing JSX defaults go
100
+ * in `defaultProps: { <prop>: value }`.
62
101
  */
63
- type LayerInput = HtmlTag | ComponentRef | PrimitiveLayer | ComposedLayer;
102
+ type LayerInput = HtmlTag | PrimitiveLayer | ComposedComponentValue;
64
103
  /**
65
104
  * Bind a registered style prop to a specific layer. The style prop's
66
105
  * resolved class name is added to that layer's `className` bundle at
@@ -78,19 +117,24 @@ interface StylePropBinding {
78
117
  * Extract the root tag literal from a `layers` map when it can be read
79
118
  * statically. Returns the string literal `'a' | 'div' | …` when:
80
119
  *
81
- * - `layers.root` is a bare tag string (`'a'`), or
82
- * - `layers.root` is `{ tag: 'a', attrs?: … }`.
120
+ * - `layers.root` is a bare tag string (`'a'`),
121
+ * - `layers.root` is `{ tag: 'a', attrs?: … }`, or
122
+ * - `layers.root` is a component value whose `__config` carries its
123
+ * own captured root tag (recurses one level so a wrapper of
124
+ * `defineComponent('button', …)` inherits `'button'`).
83
125
  *
84
- * Returns `undefined` when `layers.root` is a brace-ref (`'{Box}'`), a
85
- * `{ component: '{Box}' }` form, or not present. `Props<TConfig>` reads
86
- * this and substitutes `React.ComponentPropsWithoutRef<TTag>` for the
87
- * generic `HTMLAttributes<HTMLElement>` when narrowable.
126
+ * Returns `undefined` when `layers.root` is a composed-component layer
127
+ * without a captured tag, or not present. `Props<TConfig>` reads this
128
+ * and substitutes `React.ComponentPropsWithRef<TTag>` for the generic
129
+ * `HTMLAttributes<HTMLElement>` when narrowable.
88
130
  */
89
131
  type RootTag<TLayers> = TLayers extends {
90
132
  root: infer R;
91
133
  } ? R extends HtmlTag ? R extends `{${string}}` ? undefined : R : R extends {
92
134
  tag: infer T extends HtmlTag;
93
- } ? T : undefined : undefined;
135
+ } ? T : R extends {
136
+ readonly __config: ComponentConfigValue<Record<string, LayerInput>, any, infer TInnerTag extends HtmlTag | undefined>;
137
+ } ? TInnerTag : undefined : undefined;
94
138
  /**
95
139
  * Bind a registered composite to a single layer. Multi-layer composites
96
140
  * use the `CompositeBinding` shape instead (see below).
@@ -110,46 +154,168 @@ interface CompositeBinding {
110
154
  layers: Record<string, string>;
111
155
  }
112
156
  /**
113
- * Forward a JSX prop value to one of the component's layers as an
114
- * existing surface key. The runtime-side / read-side shape — `layer`
115
- * and `from` are bare strings. Type-guards in `bindRender` use the
116
- * absence of `styleProp` / `composite` keys to discriminate this shape
117
- * from the registered-binding shapes.
157
+ * Boolean prop toggled on/off, no value beyond presence. Useful for
158
+ * `loading`, `disabled`, `selected`. Each layer's bundle gets a
159
+ * data-attribute (`data-loading="true"`) the consumer can target.
160
+ */
161
+ interface BoolMarker {
162
+ readonly __kind: 'bool';
163
+ }
164
+ /**
165
+ * String-valued prop — parallel to `bool()` but the JSX value is a
166
+ * string. Each layer's bundle gets `data-<kebab-name>="<value>"` at
167
+ * render time so CSS can target it (`[data-kind="primary"]`).
118
168
  *
119
- * Authoring sites get the narrower `TypedForwardBinding<TLayers>`
120
- * (below) via `VerbosePropBinding<TLayers>`, which structurally
121
- * extends this loose form.
169
+ * Authored via `string()` in the `props` block — surfaces as a typed
170
+ * `string` prop at the JSX call site and as a text-input control in
171
+ * the Studio design panel (driven by the `__kind` discriminator).
122
172
  */
173
+ interface StringMarker {
174
+ readonly __kind: 'string';
175
+ }
123
176
  /**
124
- * Authoring-site form of `ForwardBinding`, narrowed against the
125
- * component's own layer map. Distributes over `keyof TLayers` so:
177
+ * Style-prop binding marker JSX value contributes one resolved
178
+ * utility class to a layer's bundle, looked up by `ref` in the
179
+ * registered style-prop registry. The `__kind` discriminator lets
180
+ * the design panel and codegen branch on prop kind by reading the
181
+ * marker shape directly.
126
182
  *
127
- * - `layer` is constrained to one of the declared layer names.
128
- * - `from` is constrained by the target layer's shape:
129
- * • **ComposedLayer** (`{ component: '{Box}' }`) → one of the
130
- * wrapped component's exposed JSX props (looked up against
131
- * `RegisteredComponents['Box']`), so `{ layer: 'label', from:
132
- * 'variant' }` only type-checks if Text registers `variant`.
133
- * • **PrimitiveLayer / bare HTML tag** → any string (HTML attr or
134
- * event name; type-precision here would require pulling
135
- * `JSX.IntrinsicElements[tag]`, deferred).
183
+ * Authored via the `styleProp` helper passed into the
184
+ * `defineComponent` callback. Two forms:
136
185
  *
137
- * Structurally extends `ForwardBinding` so the runtime's type-guard
138
- * (`isForwardBinding`) still recognizes typed entries.
186
+ * styleProp('bg') // root layer, shorthand
187
+ * styleProp('label', 'color') // explicit layer
139
188
  */
140
- type TypedForwardBinding<TLayers extends Record<string, LayerInput>> = { [K in keyof TLayers & string]: {
141
- layer: K;
142
- from: TLayers[K] extends {
143
- component: `{${infer C}}`;
144
- } ? C extends keyof RegisteredComponents ? keyof RegisteredComponents[C] & string : string : string;
145
- } }[keyof TLayers & string];
189
+ interface StylePropMarker<TLayer extends string = string, TRef extends string = string> {
190
+ readonly __kind: 'styleProp';
191
+ readonly layer: TLayer;
192
+ readonly ref: TRef;
193
+ /**
194
+ * Re-target the marker to a different layer. Returns a fresh marker
195
+ * carrying the same `ref` but with `layer` set to `name`:
196
+ *
197
+ * styleProp('color').on('label')
198
+ * // → { __kind: 'styleProp', ref: 'color', layer: 'label' }
199
+ */
200
+ on<TNewLayer extends string>(name: TNewLayer): StylePropMarker<TNewLayer, TRef>;
201
+ }
146
202
  /**
147
- * Boolean prop toggled on/off, no value beyond presence. Useful for
148
- * `loading`, `disabled`, `selected`. Each layer's bundle gets a
149
- * data-attribute (`data-loading="true"`) the consumer can target.
203
+ * Token-reference marker for use inside style values (`base`, `enums`,
204
+ * `compoundProps`). The value tells codegen "look up the token at
205
+ * path `<namespace>/<name>`" it resolves to `var(--<prefix>-<ns>-<name>)`
206
+ * at build time. The `__kind` discriminator lets the design panel
207
+ * detect a token reference and offer a token picker.
208
+ *
209
+ * Authored via the `token(...)` helper:
210
+ *
211
+ * base: { root: { bg: token('bg/brand') } }
150
212
  */
151
- interface BoolMarker {
152
- readonly __kind: 'bool';
213
+ interface TokenMarker<TRef extends string = string> {
214
+ readonly __kind: 'token';
215
+ readonly ref: TRef;
216
+ }
217
+ /**
218
+ * Token-group reference marker for `defineStyleProp({ values: [...] })`
219
+ * entries. Tells the resolver "every token in this namespace is a
220
+ * valid value for this style prop" — so `tokenGroup('spacing')` on a
221
+ * `padding` prop pulls in `spacing/1`, `spacing/2`, … as accepted
222
+ * values that map to `p-1`, `p-2`, … utility classes.
223
+ *
224
+ * Authored via the `tokenGroup(...)` helper.
225
+ */
226
+ interface TokenGroupMarker<TGroup extends string = string> {
227
+ readonly __kind: 'tokenGroup';
228
+ readonly group: TGroup;
229
+ }
230
+ /**
231
+ * Slot prop — JSX-prop that accepts a `ReactNode` and routes it onto a
232
+ * named layer's bundle. Authored via `slot('layerName')` in the
233
+ * `props` block:
234
+ *
235
+ * defineComponent({
236
+ * layers: { root: 'div', title: 'div', content: 'div' },
237
+ * props: {
238
+ * title: slot('title'),
239
+ * content: slot('content'),
240
+ * },
241
+ * }).render(({ props, children }) => (
242
+ * <div {...props.root}>
243
+ * <div {...props.title} /> // renders the `title` JSX prop
244
+ * <div {...props.content} /> // renders the `content` JSX prop
245
+ * {children}
246
+ * </div>
247
+ * ));
248
+ *
249
+ * **Children routing (default).** Without `as`, the runtime puts the
250
+ * incoming value on `bundles[layer].children`, so spreading the layer
251
+ * bundle places the children automatically.
252
+ *
253
+ * **Named-prop routing (`{ as }`).** With `as: 'propName'`, the runtime
254
+ * puts the value on `bundles[layer][propName]` instead — useful when
255
+ * the layer is a composed component that already exposes its own
256
+ * named slots (`startContent`, `endContent`, …). Lets a wrapper like
257
+ * `EnhancedCard` declare its own JSX prop that forwards into the
258
+ * wrapped `Card`'s slot surface:
259
+ *
260
+ * const EnhancedCard = defineComponent({
261
+ * layers: { root: Card }, // Card as a layer
262
+ * props: {
263
+ * headline: slot('root', { as: 'startContent' }), // → Card.startContent
264
+ * cta: slot('root', { as: 'endContent' }), // → Card.endContent
265
+ * },
266
+ * });
267
+ *
268
+ * Codegen treats slot props as the canonical signal of named slots:
269
+ * each `slot()` entry in a `props` block becomes both a `ReactNode`
270
+ * prop in the catalog (typed as `string | { $slot: elementKey }` in
271
+ * json-render) AND adds the JSX-prop key to the prompt's
272
+ * `[slots: ...]` tag. Replaces the verbose `{ layer, from: 'children' }`
273
+ * forward binding for the common ReactNode-into-layer case.
274
+ */
275
+ interface SlotMarker<TLayer extends string = '', TProp extends string = 'children'> {
276
+ readonly __kind: 'slot';
277
+ /**
278
+ * Target layer the incoming JSX value routes onto. Empty string
279
+ * (`slot()` with no path) means the value is *not* routed — the
280
+ * marker just declares the JSX-prop key + types it as
281
+ * `ReactNode`; the render function receives the value verbatim in
282
+ * its args.
283
+ */
284
+ readonly layer: TLayer;
285
+ /**
286
+ * Target prop name on the layer's bundle. Defaults to `'children'`,
287
+ * which is what most slots want (the value lands as the layer
288
+ * element's children). Set to a different name to route into
289
+ * arbitrary props on the target layer's surface (`onClick`,
290
+ * `aria-label`, `startContent`, …).
291
+ */
292
+ readonly prop?: TProp;
293
+ }
294
+ /**
295
+ * Composite-style prop — the JSX value picks one entry from a
296
+ * registered composite group's `styles` map. The runtime expands
297
+ * the matched style bag into the layer's bundle and emits a marker
298
+ * class. Implicit `'root'` layer target.
299
+ *
300
+ * Authored via `composite('textVariant')` (bare name — narrowed
301
+ * against the registered composite names) in the `props` block:
302
+ *
303
+ * defineComponent(Box, {
304
+ * defaultProps: { as: 'p' },
305
+ * props: {
306
+ * variant: composite('textVariant'),
307
+ * },
308
+ * });
309
+ *
310
+ * For multi-layer composites or non-root layer targets, use the
311
+ * verbose `{ composite: '{ref}', layers: {...} }` /
312
+ * `{ layer: 'X', composite: '{ref}' }` binding shapes directly (the
313
+ * verbose forms keep the brace-ref shape for consistency with
314
+ * style-prop refs).
315
+ */
316
+ interface CompositeMarker<TRef extends string = string> {
317
+ readonly __kind: 'composite';
318
+ readonly ref: TRef;
153
319
  }
154
320
  /**
155
321
  * Enum prop — the value picks one entry from a map. Each entry can
@@ -173,19 +339,14 @@ interface EnumMarker<TValues extends Record<string, unknown>> {
173
339
  */
174
340
  type StylePropShorthand = StylePropRef;
175
341
  /**
176
- * All allowed shapes for a single entry in the verbose form's `props`
177
- * block. Verbose form (with explicit `layers`) requires the long-form
178
- * `{ layer, styleProp }` binding no shorthand. The shorthand
179
- * `'{bg}'` is allowed only in the primitive form's props (see
180
- * `PrimitivePropBinding`).
181
- *
182
- * Generic over `TLayers` so `TypedForwardBinding` can narrow the
183
- * `layer` + `from` fields against the component's own layer map.
184
- * Consumers that don't know the layer map (read-side helpers,
185
- * `bindRender`) parameterize with the wide default
186
- * `Record<string, LayerInput>` and get the loose `ForwardBinding`.
342
+ * Every allowed shape for a single entry in a `props` block. Each
343
+ * shape comes from a marker helper (`styleProp`, `slot`, `bool`,
344
+ * `string`, `enums`, `composite`) and carries an introspectable
345
+ * `__kind` discriminator. `TLayers` parameterizes the layer-bound
346
+ * markers (`slot('layer/prop')`, `styleProp('bg').on('layer')`) so
347
+ * typos in layer names surface at the authoring site.
187
348
  */
188
- type VerbosePropBinding<TLayers extends Record<string, LayerInput> = Record<string, LayerInput>> = StylePropBinding | SingleLayerCompositeBinding | CompositeBinding | TypedForwardBinding<TLayers> | BoolMarker | EnumMarker<any>;
349
+ type VerbosePropBinding<TLayers extends Record<string, LayerInput> = Record<string, LayerInput>> = StylePropMarker<keyof TLayers & string, string> | StylePropBinding | SingleLayerCompositeBinding | CompositeBinding | CompositeMarker | BoolMarker | StringMarker | EnumMarker<any> | SlotMarker<(keyof TLayers & string) | '', string>;
189
350
  /**
190
351
  * All allowed shapes for a single entry in the primitive form's `props`
191
352
  * block. Primitive form adds the `StylePropShorthand` brace-ref
@@ -207,93 +368,259 @@ type PropBinding<TLayers extends Record<string, LayerInput> = Record<string, Lay
207
368
  * loading: bool(),
208
369
  * disabled: bool(),
209
370
  * }
371
+ *
372
+ * Drives both the TS type (consumer sees `loading?: boolean`) and the
373
+ * Studio design panel control (toggle).
210
374
  */
375
+ declare function bool(): BoolMarker;
211
376
  /**
212
- * Names of prop bindings that participate in matrix/strip iteration
213
- * i.e. props authored as `enums({...})` or `bool()`. Other prop bindings
214
- * (style props, forwards, composites) don't have a fixed enumerable
215
- * set of values to iterate over and so aren't valid axes.
377
+ * Marker for a string-valued JSX prop. Parallel to `bool()` emits
378
+ * `data-<kebab-name>="<value>"` on each layer's bundle so CSS can
379
+ * target the rendered value. Use inside the `props` block:
216
380
  *
217
- * Resolves to `never` when `TProps` declares no enum/bool bindings.
381
+ * props: {
382
+ * kind: string(),
383
+ * tone: string(),
384
+ * }
385
+ *
386
+ * Drives both the TS type (consumer sees `kind?: string`) and the
387
+ * Studio design panel control (text input).
218
388
  */
219
- type IterableAxisOf<TProps> = { [K in keyof TProps]: TProps[K] extends EnumMarker<Record<string, unknown>> | BoolMarker ? K : never }[keyof TProps] & string;
389
+ declare function string(): StringMarker;
220
390
  /**
221
- * A single example entry describes one cell, one row, or one matrix.
391
+ * Bind a registered style prop. Single string arg defaults to the
392
+ * root layer; chain `.on(layerName)` to target a non-root layer:
222
393
  *
223
- * Three iteration shapes are supported, distinguished by which fields
224
- * are present:
394
+ * props: {
395
+ * bg: styleProp('bg'), // root layer
396
+ * textColor: styleProp('color').on('label'), // label layer
397
+ * }
225
398
  *
226
- * - Static: only `props`. Renders one cell with `props` as the consumer-
227
- * facing prop values.
228
- * - 1D strip: `axis` plus `props`. Iterates the named enum/bool prop and
229
- * renders one cell per value.
230
- * - 2D matrix: `rows` and `cols` plus `props`. Iterates both and renders
231
- * the Cartesian product as a labeled grid.
399
+ * The `__kind: 'styleProp'` discriminator lets the design panel render
400
+ * a color/token picker (driven by the registered style prop's value
401
+ * space) and lets codegen scan props uniformly off the marker shape.
402
+ */
403
+ declare function styleProp<TRef extends string>(ref: TRef): StylePropMarker<'root', TRef>;
404
+ /**
405
+ * Token-reference marker for style values. Use inside `base`, enum
406
+ * entries, and `compoundProps` overrides:
232
407
  *
233
- * `axis` and `rows`/`cols` are mutually exclusive; `rows` and `cols`
234
- * must appear together. The runtime validator enforces both.
408
+ * base: { root: { bg: token('bg/brand') } }
409
+ * props: {
410
+ * variant: enums({
411
+ * brand: { root: { color: token('color/on-brand') } },
412
+ * }),
413
+ * }
235
414
  *
236
- * `props` is keyed by *consumer-facing prop name* the same names a
237
- * caller of `<Link href='#'>` would pass — not by internal layer name.
238
- * The renderer maps consumer props to layer bundles using the
239
- * component's own `props` bindings.
415
+ * Codegen and runtime detect the `__kind: 'token'` discriminator and
416
+ * resolve the `ref` to `var(--<prefix>-<ns>-<name>)`. The design
417
+ * panel uses the same discriminator to offer a token picker.
418
+ */
419
+ declare function token<TRef extends string>(ref: TRef): TokenMarker<TRef>;
420
+ /**
421
+ * Token-group reference for `defineStyleProp({ values: [...] })`. Pulls
422
+ * every token in the named namespace into the style prop's accepted
423
+ * value set. The resolver expands the group at registration time:
424
+ *
425
+ * defineStyleProp({
426
+ * cssProperty: 'padding',
427
+ * classPrefix: 'p',
428
+ * values: [tokenGroup('spacing')], // → p-1, p-2, p-3, …
429
+ * })
240
430
  *
241
- * Authors don't control wrapper layout (gaps, padding, alignment) — the
242
- * renderer (Studio / docs) owns those decisions so the matrix surface
243
- * stays consistent across components.
431
+ * The `__kind: 'tokenGroup'` discriminator lets codegen and the design
432
+ * panel branch on group references without parsing strings.
244
433
  */
245
- interface ExampleEntry<TAxis extends string = string> {
246
- /** 1D iteration — one cell per value of this enum/bool prop. */
247
- axis?: TAxis;
248
- /** 2D iteration — rows × cols matrix. Mutually exclusive with `axis`. */
249
- rows?: TAxis;
250
- cols?: TAxis;
251
- /**
252
- * Consumer-facing prop values used by every cell. For 1D / 2D entries,
253
- * the cell's axis coords are overlaid on top of these (axis values win
254
- * on collision with `props.<axis>`).
255
- */
256
- props?: Record<string, unknown>;
257
- }
434
+ declare function tokenGroup<TGroup extends string>(group: TGroup): TokenGroupMarker<TGroup>;
435
+ /**
436
+ * Marker for an enum-valued JSX prop. Each value maps to a per-layer
437
+ * style override. Use inside the `props` block:
438
+ *
439
+ * props: {
440
+ * variant: enums({
441
+ * brand: { root: { bg: '{bg/brand}', color: '{color/on-brand}' } },
442
+ * ghost: { root: { color: '{color/on-primary}' } },
443
+ * }),
444
+ * }
445
+ *
446
+ * The shape of each value mirrors a partial layer-style map keyed by
447
+ * the component's own layer names.
448
+ */
449
+ declare function enums<const TValues extends Record<string, unknown>>(values: TValues): EnumMarker<TValues>;
450
+ /**
451
+ * Marker for a composite-style JSX prop. The JSX value picks one
452
+ * entry from the referenced composite group's `styles` map; the
453
+ * runtime expands the matched style bag onto the root layer's bundle
454
+ * and emits a marker class.
455
+ *
456
+ * // packages/.../text-variant.ts
457
+ * export const textVariant = defineCompositeStyle({
458
+ * label: 'Text Variant',
459
+ * styles: {
460
+ * body: { fontSize: '[1rem]', fontWeight: 'normal' },
461
+ * heading: { fontSize: '[1.5rem]', fontWeight: 'bold' },
462
+ * },
463
+ * });
464
+ *
465
+ * // apps/<consumer>/uds.config.ts
466
+ * udsBuilder.registerComposites({ textVariant });
467
+ *
468
+ * // The component:
469
+ * export const Text = defineComponent(Box, {
470
+ * defaultProps: { as: 'p' },
471
+ * props: {
472
+ * variant: composite('textVariant'),
473
+ * },
474
+ * });
475
+ *
476
+ * Argument is the bare composite name (no `{...}` brace wrapping) —
477
+ * the `composite()` function's position already establishes the
478
+ * composite-ref context, so the braces would be redundant. Authoring
479
+ * sites type-narrow `ref` against `keyof RegisteredComposites` so
480
+ * typos surface as compile errors.
481
+ *
482
+ * Layer target is implicit `'root'`. For multi-layer composite
483
+ * bindings or non-root layer targets, drop down to the verbose
484
+ * `{ layer: 'X', composite: '{ref}' }` /
485
+ * `{ composite: '{ref}', layers: {...} }` shapes (those keep the
486
+ * brace-ref form for consistency with style-prop refs).
487
+ */
488
+ type CompositeName = [keyof RegisteredComposites] extends [never] ? string : keyof RegisteredComposites & string;
489
+ declare function composite<TRef extends CompositeName>(ref: TRef): CompositeMarker<TRef>;
258
490
  /**
259
- * Component examples — required `default` plus any number of additional
260
- * named entries. `default` is the canonical single-instance showcase
261
- * Studio + docs fall back to when no specific example is requested.
491
+ * Splits a `'layer/prop'` slot path into its two segments. Mirrors the
492
+ * `{namespace/name}` token-ref convention — the slash is the delimiter
493
+ * and the second segment is the target prop on the layer's bundle.
494
+ * When no slash is present, the path is a bare layer name and the
495
+ * target prop defaults to `'children'`.
496
+ */
497
+ type SplitSlotPath<T extends string> = T extends `${infer L}/${infer A}` ? [L, A] : [T, 'children'];
498
+ /**
499
+ * Marker for a layer-targeted JSX-prop binding. Routes the incoming
500
+ * JSX value into `bundles[layer][prop]` at render time. The prop's
501
+ * TS value type is inferred from the target layer's surface — see
502
+ * `SlotPropValue` in `Props.ts`.
503
+ *
504
+ * Authoring forms:
262
505
  *
263
- * `default` is distinct from `defaultProps`: `defaultProps` is the
264
- * runtime API default applied when a consumer omits a prop; `examples.default`
265
- * is the showcase content (label, icons, href) used by tooling. A
266
- * component can declare both without conflict.
506
+ * - **Canonical: `slot('layer/prop')`** slash-separated path. The
507
+ * first segment names a declared layer; the second names the prop
508
+ * on that layer's bundle where the JSX value lands.
267
509
  *
268
- * Axis types narrow to `IterableAxisOf<TProps>` so referencing a non-
269
- * enum/bool prop name in `axis` / `rows` / `cols` is a type error.
510
+ * props: {
511
+ * title: slot('triggerText/children'), // Text.children
512
+ * onClick: slot('button/onClick'), // → button's onClick
513
+ * headline: slot('root/startContent'), // → Card.startContent
514
+ * }
515
+ *
516
+ * - **Sugar: `slot('layer')`** — equivalent to `slot('layer/children')`.
517
+ *
518
+ * - **Object form: `slot('layer', { prop: 'name' })`** — same as
519
+ * `slot('layer/name')` but reads better when `name` is a long
520
+ * identifier or contains characters the slash form can't carry.
521
+ *
522
+ * - **No-arg: `slot()`** — type-only declaration. The JSX value is
523
+ * typed as `ReactNode` and flows through to the render fn's args
524
+ * verbatim (no layer routing). Use for `children: slot()` to
525
+ * declare children without routing them to a specific layer.
526
+ *
527
+ * The marker is the canonical signal — to codegen and to json-render
528
+ * — that this JSX prop is a named slot.
270
529
  */
271
- type Examples<TProps extends Record<string, unknown> = Record<string, unknown>> = {
272
- default: ExampleEntry<IterableAxisOf<TProps>>;
273
- } & Record<string, ExampleEntry<IterableAxisOf<TProps>>>;
530
+ declare function slot(): SlotMarker<'', 'children'>;
531
+ declare function slot<const TPath extends string>(path: TPath): SlotMarker<SplitSlotPath<TPath>[0], SplitSlotPath<TPath>[1]>;
532
+ declare function slot<const TLayer extends string, const TProp extends string>(layer: TLayer, options: {
533
+ prop: TProp;
534
+ }): SlotMarker<TLayer, TProp>;
274
535
  /**
275
- * A compound-variant entry applies a per-layer style override when
276
- * *all* `conditions` match the incoming JSX props. Mirrors the legacy
277
- * `compoundVariants: [{ conditions, styles }]` shape (see
278
- * `componentCompoundClass()` for the emitted class name).
536
+ * Per-layer override shape, narrowed by the layer's declared form.
537
+ *
538
+ * Same shape as a single enum-value's per-layer style map — registered
539
+ * style props, CSS properties, and `_hover`/`_focus`/etc. modifier
540
+ * keys. Uniform across all layer forms (HTML tag, PrimitiveLayer, and
541
+ * ComposedLayer) because `ComposedLayer.defaultProps` is also
542
+ * `Record<string, unknown>` and narrowing here would over-constrain
543
+ * authoring relative to the layer's own surface.
279
544
  *
280
- * compoundVariants: [
545
+ * Authors use `hidden()` (a sibling marker) to hide a layer entirely;
546
+ * style-map values never carry the `hidden` flag inline.
547
+ */
548
+ type LayerOverride = ComponentSlotStyles;
549
+ /**
550
+ * Marker that hides an entire layer when the parent `compoundProps`
551
+ * entry matches. Separated from the style-map shape so authors don't
552
+ * mix structural visibility with style overrides inline.
553
+ *
554
+ * V1 `applyCompoundProps` translates a hidden layer to `display: none`
555
+ * on the resolved bundle — the DOM node still renders; see UDS-1631's
556
+ * open questions for the "strip entirely" follow-up.
557
+ */
558
+ interface HiddenMarker {
559
+ readonly __kind: 'hidden';
560
+ }
561
+ /**
562
+ * Marker factory — use inside `compoundProps[].layers.<layer>` to hide
563
+ * a layer entirely when the entry's `when` clause matches.
564
+ *
565
+ * compoundProps: [
281
566
  * {
282
- * conditions: { size: 'sm', variant: 'brand' },
283
- * styles: { root: { boxShadow: '{shadow/sm}' } },
567
+ * when: { variant: 'compact' },
568
+ * layers: { endIcon: hidden() },
284
569
  * },
285
570
  * ]
571
+ */
572
+ declare function hidden(): HiddenMarker;
573
+ /**
574
+ * Names of prop bindings that participate in `when` clauses — i.e.
575
+ * props authored as `enums({...})` or `bool()`. Other bindings (style
576
+ * props, forwards, composites) don't have a fixed enumerable value set
577
+ * and so aren't valid `when` keys. File-private — re-inlined here
578
+ * after the original `IterableAxisOf` was removed from the public
579
+ * surface along with the matrix-examples API.
580
+ */
581
+ type IterableAxisOf<TProps> = { [K in keyof TProps]: TProps[K] extends EnumMarker<Record<string, unknown>> | BoolMarker ? K : never }[keyof TProps] & string;
582
+ /**
583
+ * Resolve the legal value set for an iteration axis. `enums({...})` →
584
+ * the union of value keys; `bool()` → `boolean`. Used to narrow per-
585
+ * coord values in `compoundProps.when`. File-private (see `IterableAxisOf`).
586
+ */
587
+ type PropValuesOf<TBinding> = TBinding extends EnumMarker<infer TValues> ? keyof TValues & string : TBinding extends BoolMarker ? boolean : never;
588
+ /**
589
+ * A `compoundProps` `when` clause: partial map of iterable-axis prop
590
+ * names → required value. All listed keys must match the active props
591
+ * for the entry to apply. Keys narrow to enum/bool bindings only — so
592
+ * non-enum/non-bool props (style props, forwards, composites) are a
593
+ * type error at the authoring site. Values narrow to declared enum
594
+ * keys or `boolean`.
595
+ */
596
+ type WhenClause<TProps> = { [K in IterableAxisOf<TProps>]?: K extends keyof TProps ? PropValuesOf<TProps[K]> : never };
597
+ /**
598
+ * A single `compoundProps` entry — applies per-layer overrides when
599
+ * *all* `when` keys match the active prop values.
286
600
  *
287
- * `conditions` keys are JSX-prop names that resolve to `enums()` /
288
- * `bool()` markers in the `props` block; values are the variant values
289
- * (or `'true'` / `'false'` for bools) that must all match for the entry
290
- * to apply. Codegen emits one `@utility componentName-layerName--<sorted
291
- * conditions>` block per (layer); runtime appends that class when
292
- * conditions match.
601
+ * compoundProps: [
602
+ * {
603
+ * when: { variant: 'secondary', textVariant: 'legal1' },
604
+ * layers: {
605
+ * root: { color: '{color/tertiary}' },
606
+ * endIcon: hidden(),
607
+ * },
608
+ * },
609
+ * ]
610
+ *
611
+ * Multiple entries can match a given combination — specificity (number
612
+ * of keys in `when`) decides who wins per layer-property pair; ties
613
+ * break by source order (later wins).
293
614
  */
294
- interface CompoundVariant {
295
- conditions: Record<string, string>;
296
- styles: Record<string, Record<string, unknown>>;
615
+ interface CompoundPropsEntry<TLayers extends Record<string, LayerInput>, TProps extends Record<string, unknown> = Record<string, unknown>> {
616
+ when: WhenClause<TProps>;
617
+ /**
618
+ * Per-layer overrides. Style maps narrow against `ComponentSlotStyles`
619
+ * (registered style props + CSS properties + modifier keys); use
620
+ * `hidden()` to hide a layer entirely. Layer keys narrow to the
621
+ * component's declared layer names.
622
+ */
623
+ layers: { [K in keyof TLayers & string]?: LayerOverride | HiddenMarker };
297
624
  }
298
625
  /**
299
626
  * The architecture-doc-target component config. Distinct from today's
@@ -304,6 +631,149 @@ interface CompoundVariant {
304
631
  * narrow their `layer` field against the component's actual layer
305
632
  * names; typos surface at the authoring site.
306
633
  */
634
+ /**
635
+ * Static, always-on per-layer styles + props for verbose-form
636
+ * `defineComponent({...})`. Keyed by layer name — each value is
637
+ * `Partial<Props<TLayer>>` where `TLayer` is the layer's resolved
638
+ * component (Box / Pressable / Text / …). Mirrors the legacy
639
+ * `defineComponents({ <Name>: { base: { <slot>: {...} } } })`
640
+ * shape — `base` styles are unconditional, contrasted with the
641
+ * `props` block where `enums()` / `composite()` / style-prop
642
+ * bindings associate styles with consumer-controllable values.
643
+ *
644
+ * defineComponent({
645
+ * layers: { trigger: { component: Pressable } },
646
+ * base: {
647
+ * trigger: { padding: '4' }, // ✗ ERROR — Pressable exposes `spacing`, not `padding`
648
+ * trigger: { spacing: '4' }, // ✓
649
+ * },
650
+ * });
651
+ *
652
+ * Composed-component layers narrow to the wrapped component's prop
653
+ * surface via `Props<TLayer['__config']>` — catches style-prop typos
654
+ * at the authoring site. Bare-tag layers (`'div'`) fall back to
655
+ * `Record<string, unknown>` since they don't have a component-side
656
+ * prop registry; those layers' styles go through `prepareCss` as
657
+ * `@utility` CSS rules instead.
658
+ *
659
+ * `base[<layer>].as` on a composed layer overrides the layer's
660
+ * rendered tag (mirroring the existing primitive-form behavior).
661
+ */
662
+ /**
663
+ * Resolves the accepted JSX-value shape for a single prop binding —
664
+ * what `defaultProps` for that binding should be typed as.
665
+ *
666
+ * - `EnumMarker` → the union of declared value keys.
667
+ * - `BoolMarker` → `boolean`.
668
+ * - `CompositeMarker` → registered composite-value keys (loosely
669
+ * typed `string` here; consumer apps' augmentation refines it).
670
+ * - `SlotMarker` → `ReactNode` (slot-position values).
671
+ * - `BoolMarker` etc. follow.
672
+ * - Style-prop bindings (`'{bg}'` shorthand or
673
+ * `{ layer, styleProp: '{bg}' }`) → string (the resolved token
674
+ * or alias name; precise narrowing happens at the consumer's
675
+ * augmented-types boundary).
676
+ * - Everything else → `unknown`.
677
+ */
678
+ type BindingValueType<T> = T extends EnumMarker<infer V> ? keyof V & string : T extends BoolMarker ? boolean : T extends StringMarker ? string : T extends StylePropMarker ? string : T extends CompositeMarker ? string : T extends SlotMarker ? _$react.ReactNode : T extends string ? string : T extends {
679
+ readonly styleProp: string;
680
+ } ? string : unknown;
681
+ /**
682
+ * `defaultProps` for verbose-form `defineComponent({...})` —
683
+ * type-narrowed against the keys + binding values declared in the
684
+ * `props` block. Catches typos / wrong-value assignments at the
685
+ * authoring site:
686
+ *
687
+ * props: {
688
+ * variant: enums({ brand: {...}, ghost: {...} }),
689
+ * loading: bool(),
690
+ * },
691
+ * defaultProps: {
692
+ * variant: 'brand', // ✓
693
+ * variant: 'extra', // ✗ — not a declared enum value
694
+ * loading: false, // ✓
695
+ * typo: 'foo', // ✗ — not a declared prop key
696
+ * }
697
+ */
698
+ type BindingValueDefaults<TProps> = { [K in keyof TProps]?: BindingValueType<TProps[K]> };
699
+ type LayerBaseStyles<TLayers extends Record<string, LayerInput>> = { [K in keyof TLayers]?: TLayers[K] extends {
700
+ readonly __config: infer TLayerConfig;
701
+ } ? TLayerConfig extends ComponentConfigValue<Record<string, LayerInput>, any, HtmlTag | undefined> ? Partial<Props<TLayerConfig>> : Record<string, unknown> : Record<string, unknown> };
702
+ /**
703
+ * Per-layer motion descriptors for verbose-form
704
+ * `defineComponent({...})`. Keyed by layer name; each value is a
705
+ * {@link SlotMotion} (framer-motion `initial`/`animate`/`exit`/
706
+ * `transition`/etc. shape). Codegen surfaces these into the manifest
707
+ * under `components.<Name>.motion.<slot>` and uses them to rewrite
708
+ * the slot's JSX into a motion-wrapped element at build time —
709
+ * `<Box {...props.icon}>` becomes `<motion.create(Box) ...>` and
710
+ * conditional renders are wrapped in `<AnimatePresence>` when
711
+ * `exit` is set.
712
+ */
713
+ type LayerMotion<TLayers extends Record<string, LayerInput>> = { [K in keyof TLayers]?: SlotMotion };
714
+ interface ComponentConfigInput<TLayers extends Record<string, LayerInput>, TProps extends Record<string, VerbosePropBinding<TLayers>> = Record<string, VerbosePropBinding<TLayers>>> {
715
+ layers: TLayers;
716
+ props?: TProps;
717
+ /**
718
+ * Static per-layer styles + props applied unconditionally to every
719
+ * render. Each key is a layer name from `layers`; each value is
720
+ * `Partial<Props<that-layer's-component>>`. See {@link LayerBaseStyles}.
721
+ *
722
+ * base: {
723
+ * root: { borderWidth: 'thin', bg: 'primary' },
724
+ * trigger: { spacing: '4', _hover: { bg: 'tertiary' } },
725
+ * }
726
+ *
727
+ * Variant-controlled styles (per consumer JSX value) go through
728
+ * `enums()` / `composite()` / style-prop bindings in the `props`
729
+ * block. `base` is the always-on foundation; `props` adds
730
+ * value-driven overrides on top.
731
+ *
732
+ * Type-checked per layer — typos on composed layers surface as TS
733
+ * errors at the authoring site.
734
+ */
735
+ base?: LayerBaseStyles<TLayers>;
736
+ /**
737
+ * Default values for the consumer-controllable JSX props declared
738
+ * in the `props` block. Keys narrow against `keyof TProps`; values
739
+ * narrow against each binding's accepted shape (enum keys for
740
+ * `enums()`, composite values for `composite()`, registered tokens
741
+ * for style-prop bindings, `boolean` for `bool()`).
742
+ *
743
+ * props: {
744
+ * variant: enums({ brand: {...}, ghost: {...} }),
745
+ * loading: bool(),
746
+ * },
747
+ * defaultProps: {
748
+ * variant: 'brand', // narrows to `keyof enum.values`
749
+ * loading: false,
750
+ * typo: '...', // ✗ ERROR — not a declared prop
751
+ * }
752
+ */
753
+ defaultProps?: BindingValueDefaults<TProps>;
754
+ /**
755
+ * Per-layer motion descriptors. Keyed by layer name; each value is
756
+ * a {@link SlotMotion} (framer-motion shape). See {@link LayerMotion}.
757
+ *
758
+ * motion: {
759
+ * icon: {
760
+ * animate: { 'data-state': { open: { rotate: 180 }, closed: { rotate: 0 } } },
761
+ * transition: { duration: 0.2 },
762
+ * },
763
+ * content: {
764
+ * initial: { height: 0, opacity: 0 },
765
+ * animate: { height: 'auto', opacity: 1 },
766
+ * exit: { height: 0, opacity: 0 },
767
+ * },
768
+ * }
769
+ */
770
+ motion?: LayerMotion<TLayers>;
771
+ /**
772
+ * Per-combination layer overrides keyed on enum/bool prop values.
773
+ * See {@link CompoundPropsEntry}.
774
+ */
775
+ compoundProps?: CompoundPropsEntry<TLayers, TProps>[];
776
+ }
307
777
  /**
308
778
  * Branded shape returned by `defineComponent({...})`. Carries `layers`,
309
779
  * `props`, AND a phantom `__tag` slot as const-narrowed types so
@@ -332,18 +802,61 @@ interface ComponentConfigValue<TLayers extends Record<string, LayerInput>, TProp
332
802
  readonly __componentName?: string;
333
803
  readonly layers: TLayers;
334
804
  readonly props?: TProps;
805
+ /**
806
+ * Static per-layer styles, keyed by layer name. Codegen's
807
+ * downleveler spreads each entry into the layer's runtime bundle.
808
+ * Distinct from `defaultProps`, which carries declared-prop
809
+ * defaults.
810
+ */
811
+ readonly base?: Record<string, Record<string, unknown>>;
812
+ /**
813
+ * Per-layer motion descriptors keyed by layer name. Same shape as
814
+ * `LayerMotion<TLayers>` (loosened here so the read-side type
815
+ * doesn't require parameterizing against TLayers' Props).
816
+ */
817
+ readonly motion?: Record<string, SlotMotion>;
335
818
  readonly defaultProps?: Record<string, unknown>;
336
- readonly compoundVariants?: CompoundVariant[];
337
819
  /**
338
- * Component examples — see {@link Examples}. Carried through from
339
- * `ComponentConfigInput.examples`.
820
+ * Per-combination layer overrides — see {@link CompoundPropsEntry}.
821
+ * Carried through from `ComponentConfigInput.compoundProps`.
340
822
  */
341
- readonly examples?: Examples<TProps>;
823
+ readonly compoundProps?: CompoundPropsEntry<TLayers, TProps>[];
824
+ /**
825
+ * Authoring metadata (description, events) attached via the bound
826
+ * component's `.metadata({...})` chain. Stored non-enumerably on
827
+ * the config object so `JSON.stringify` output stays clean. Read by
828
+ * codegen's prompt + catalog generators.
829
+ *
830
+ * `acceptsChildren` isn't stored here — codegen derives it from
831
+ * `layers` + `props` shape so authors don't have to declare what's
832
+ * already obvious from the config (primitive + value-extend forms
833
+ * accept children unconditionally; verbose form derives from
834
+ * `ForwardBinding { from: 'children' }`).
835
+ */
836
+ readonly metadata?: {
837
+ readonly description?: string;
838
+ readonly events?: readonly string[];
839
+ };
342
840
  }
343
841
  /**
344
842
  * The bundle passed to the render function for each layer — a ready-to-
345
843
  * spread object with `className` and any forwarded attrs. The render
346
844
  * function destructures `props.<layerName>` into the JSX position.
347
845
  */
846
+ interface LayerBundle {
847
+ /** Resolved CSS class names for this layer. Omitted when empty so the
848
+ * rendered HTML doesn't carry a literal `class=""` attribute. */
849
+ className?: string;
850
+ [key: string]: unknown;
851
+ }
852
+ /**
853
+ * Derive the render-function argument shape from a component config
854
+ * type. The render fn receives `props: { <each layer>: LayerBundle }`
855
+ * plus `children` (always present at the React level).
856
+ */
857
+ type RenderArgs<TConfig extends ComponentConfigValue<Record<string, LayerInput>>> = {
858
+ props: { [K in keyof TConfig['layers']]: LayerBundle };
859
+ children?: ReactNode;
860
+ } & Record<string, unknown>; //#endregion
348
861
  //#endregion
349
- export { BoolMarker, ComponentConfigValue, ComposedLayer, CompositeBinding, CompoundVariant, EnumMarker, HtmlTag, LayerInput, PrimitiveLayer, PrimitivePropBinding, PropBinding, RootTag, SingleLayerCompositeBinding, StylePropBinding, StylePropShorthand, VerbosePropBinding };
862
+ export { BoolMarker, ComponentConfigInput, ComponentConfigValue, ComponentMotionValue, ComponentSlotStyles, CompositeBinding, CompositeMarker, CompoundPropsEntry, EnumMarker, HiddenMarker, HtmlTag, LayerBundle, LayerInput, LayerOverride, PrimitiveLayer, PrimitivePropBinding, PropBinding, RenderArgs, RootTag, SingleLayerCompositeBinding, SlotMarker, SlotMotion, SplitSlotPath, StringMarker, StylePropBinding, StylePropMarker, StylePropShorthand, TokenGroupMarker, TokenMarker, VerbosePropBinding, WhenClause, bool, composite, enums, hidden, slot, string, styleProp, token, tokenGroup };