@yahoo/uds-v5-wip 1.60.0 → 1.62.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 (605) hide show
  1. package/dist/config/dist/AssetGroup.d.ts +75 -0
  2. package/dist/config/dist/AssetGroup.js +114 -0
  3. package/dist/config/dist/Component.d.ts +309 -0
  4. package/dist/config/dist/Component.js +897 -0
  5. package/dist/config/dist/ComponentGroup.d.ts +21 -0
  6. package/dist/config/dist/ComponentGroup.js +46 -0
  7. package/dist/config/dist/CompositeStyle.d.ts +28 -0
  8. package/dist/config/dist/CompositeStyle.js +52 -0
  9. package/dist/config/dist/Config.d.ts +422 -0
  10. package/dist/config/dist/Config.js +1426 -0
  11. package/dist/config/dist/Mode.d.ts +42 -0
  12. package/dist/config/dist/Mode.js +81 -0
  13. package/dist/config/dist/Modifier.d.ts +52 -0
  14. package/dist/config/dist/Modifier.js +97 -0
  15. package/dist/config/dist/MotionDef.d.ts +50 -0
  16. package/dist/config/dist/MotionDef.js +97 -0
  17. package/dist/config/dist/Props.d.ts +284 -39
  18. package/dist/config/dist/Provider.d.ts +21 -0
  19. package/dist/config/dist/Provider.js +14 -0
  20. package/dist/config/dist/StyleProp.d.ts +113 -0
  21. package/dist/config/dist/StyleProp.js +197 -0
  22. package/dist/config/dist/Token.d.ts +56 -0
  23. package/dist/config/dist/Token.js +112 -0
  24. package/dist/config/dist/TokenGroup.d.ts +33 -0
  25. package/dist/config/dist/TokenGroup.js +68 -0
  26. package/dist/config/dist/asset-kind.d.ts +56 -0
  27. package/dist/config/dist/asset-kind.js +29 -0
  28. package/dist/config/dist/brands.d.ts +31 -0
  29. package/dist/config/dist/brands.js +20 -0
  30. package/dist/config/dist/captureCallerPath.d.ts +49 -0
  31. package/dist/config/dist/captureCallerPath.js +95 -0
  32. package/dist/config/dist/colorExpressions.d.ts +132 -0
  33. package/dist/config/dist/colorExpressions.js +148 -0
  34. package/dist/config/dist/defineAssetGroup.d.ts +158 -0
  35. package/dist/config/dist/defineAssetGroup.js +263 -0
  36. package/dist/config/dist/defineProvider.d.ts +30 -0
  37. package/dist/config/dist/defineProvider.js +60 -0
  38. package/dist/config/dist/element-marker.d.ts +55 -0
  39. package/dist/config/dist/element-marker.js +113 -0
  40. package/dist/config/dist/entity-utils.d.ts +27 -0
  41. package/dist/config/dist/entity-utils.js +105 -0
  42. package/dist/config/dist/factories.d.ts +707 -0
  43. package/dist/config/dist/factories.js +393 -0
  44. package/dist/config/dist/foreign-component-name.js +42 -0
  45. package/dist/config/dist/index.d.ts +31 -13
  46. package/dist/config/dist/index.js +26 -10
  47. package/dist/config/dist/interpolate.d.ts +21 -0
  48. package/dist/{foundational-presets/dist/motion.js → config/dist/interpolate.js} +1 -1
  49. package/dist/config/dist/markers.d.ts +218 -0
  50. package/dist/config/dist/markers.js +67 -0
  51. package/dist/config/dist/refs.d.ts +159 -0
  52. package/dist/config/dist/refs.js +98 -71
  53. package/dist/config/dist/token-override-rows.d.ts +67 -0
  54. package/dist/config/dist/token-override-rows.js +223 -0
  55. package/dist/config/dist/tokenValueType.js +138 -0
  56. package/dist/config/dist/types/css-properties.d.ts +233 -0
  57. package/dist/config/dist/types/css-property-keywords.d.ts +157 -0
  58. package/dist/config/dist/types/css-property-keywords.js +616 -0
  59. package/dist/config/dist/types/css-values.d.ts +20 -17
  60. package/dist/config/dist/types.d.ts +697 -64
  61. package/dist/config/dist/units.d.ts +15 -0
  62. package/dist/config/dist/units.js +16 -0
  63. package/dist/config.d.ts +32 -1562
  64. package/dist/config.js +28 -21
  65. package/dist/loader/dist/_virtual/_rolldown/runtime.js +1 -2
  66. package/dist/loader/dist/index.d.ts +2 -0
  67. package/dist/loader/dist/index.js +3 -0
  68. package/dist/loader/dist/loader/artifacts.js +26 -9
  69. package/dist/loader/dist/loader/babel-utils.js +1 -29
  70. package/dist/loader/dist/loader.d.ts +17 -1
  71. package/dist/loader/dist/loader.js +56 -339
  72. package/dist/loader/dist/next.d.ts +2 -1
  73. package/dist/loader/dist/next.js +3 -3
  74. package/dist/loader/dist/transform-runner.js +7 -0
  75. package/dist/loader/dist/unplugin.d.ts +27 -0
  76. package/dist/loader/dist/unplugin.js +52 -0
  77. package/dist/plugin.d.ts +2 -2
  78. package/dist/plugin.js +3 -2
  79. package/dist/tsconfig.tsbuildinfo +1 -1
  80. package/dist/utils/dist/index.js +1 -0
  81. package/dist/utils/dist/motion-utils/resolveMotionState.d.ts +35 -0
  82. package/dist/utils/dist/motion-utils/resolveMotionState.js +33 -0
  83. package/dist/utils/dist/string-utils/componentClassName.d.ts +41 -8
  84. package/dist/utils/dist/string-utils/componentClassName.js +48 -11
  85. package/dist/utils.d.ts +3 -2
  86. package/dist/utils.js +3 -2
  87. package/package.json +3 -51
  88. package/dist/components/accordion.config.d.ts +0 -2
  89. package/dist/components/accordion.config.js +0 -2
  90. package/dist/components/accordion.d.ts +0 -2
  91. package/dist/components/accordion.js +0 -2
  92. package/dist/components/alert.config.d.ts +0 -2
  93. package/dist/components/alert.config.js +0 -2
  94. package/dist/components/alert.d.ts +0 -2
  95. package/dist/components/alert.js +0 -2
  96. package/dist/components/anchor.config.d.ts +0 -2
  97. package/dist/components/anchor.config.js +0 -2
  98. package/dist/components/anchor.d.ts +0 -2
  99. package/dist/components/anchor.js +0 -2
  100. package/dist/components/article.d.ts +0 -2
  101. package/dist/components/article.js +0 -2
  102. package/dist/components/aside.d.ts +0 -2
  103. package/dist/components/aside.js +0 -2
  104. package/dist/components/avatar-group.config.d.ts +0 -2
  105. package/dist/components/avatar-group.config.js +0 -2
  106. package/dist/components/avatar-group.d.ts +0 -2
  107. package/dist/components/avatar-group.js +0 -2
  108. package/dist/components/avatar.config.d.ts +0 -2
  109. package/dist/components/avatar.config.js +0 -2
  110. package/dist/components/avatar.d.ts +0 -2
  111. package/dist/components/avatar.js +0 -2
  112. package/dist/components/badge.config.d.ts +0 -2
  113. package/dist/components/badge.config.js +0 -2
  114. package/dist/components/badge.d.ts +0 -2
  115. package/dist/components/badge.js +0 -2
  116. package/dist/components/box.d.ts +0 -2
  117. package/dist/components/box.js +0 -2
  118. package/dist/components/breadcrumb.config.d.ts +0 -2
  119. package/dist/components/breadcrumb.config.js +0 -2
  120. package/dist/components/breadcrumb.d.ts +0 -2
  121. package/dist/components/breadcrumb.js +0 -2
  122. package/dist/components/button.config.d.ts +0 -2
  123. package/dist/components/button.config.js +0 -2
  124. package/dist/components/button.d.ts +0 -2
  125. package/dist/components/button.js +0 -2
  126. package/dist/components/card.config.d.ts +0 -2
  127. package/dist/components/card.config.js +0 -2
  128. package/dist/components/card.d.ts +0 -2
  129. package/dist/components/card.js +0 -2
  130. package/dist/components/collapsible.config.d.ts +0 -2
  131. package/dist/components/collapsible.config.js +0 -2
  132. package/dist/components/collapsible.d.ts +0 -2
  133. package/dist/components/collapsible.js +0 -2
  134. package/dist/components/command.config.d.ts +0 -2
  135. package/dist/components/command.config.js +0 -2
  136. package/dist/components/command.d.ts +0 -2
  137. package/dist/components/command.js +0 -2
  138. package/dist/components/control-color.config.d.ts +0 -2
  139. package/dist/components/control-color.config.js +0 -2
  140. package/dist/components/control-color.d.ts +0 -2
  141. package/dist/components/control-color.js +0 -2
  142. package/dist/components/control-curve.config.d.ts +0 -2
  143. package/dist/components/control-curve.config.js +0 -2
  144. package/dist/components/control-curve.d.ts +0 -2
  145. package/dist/components/control-curve.js +0 -2
  146. package/dist/components/control-folder.config.d.ts +0 -2
  147. package/dist/components/control-folder.config.js +0 -2
  148. package/dist/components/control-folder.d.ts +0 -2
  149. package/dist/components/control-folder.js +0 -2
  150. package/dist/components/control-group.config.d.ts +0 -2
  151. package/dist/components/control-group.config.js +0 -2
  152. package/dist/components/control-group.d.ts +0 -2
  153. package/dist/components/control-group.js +0 -2
  154. package/dist/components/control-knob.config.d.ts +0 -2
  155. package/dist/components/control-knob.config.js +0 -2
  156. package/dist/components/control-knob.d.ts +0 -2
  157. package/dist/components/control-knob.js +0 -2
  158. package/dist/components/control-panel.config.d.ts +0 -2
  159. package/dist/components/control-panel.config.js +0 -2
  160. package/dist/components/control-panel.d.ts +0 -2
  161. package/dist/components/control-panel.js +0 -2
  162. package/dist/components/control-select.config.d.ts +0 -2
  163. package/dist/components/control-select.config.js +0 -2
  164. package/dist/components/control-select.d.ts +0 -2
  165. package/dist/components/control-select.js +0 -2
  166. package/dist/components/control-slider.config.d.ts +0 -2
  167. package/dist/components/control-slider.config.js +0 -2
  168. package/dist/components/control-slider.d.ts +0 -2
  169. package/dist/components/control-slider.js +0 -2
  170. package/dist/components/control-spring.config.d.ts +0 -2
  171. package/dist/components/control-spring.config.js +0 -2
  172. package/dist/components/control-spring.d.ts +0 -2
  173. package/dist/components/control-spring.js +0 -2
  174. package/dist/components/control-stepper.config.d.ts +0 -2
  175. package/dist/components/control-stepper.config.js +0 -2
  176. package/dist/components/control-stepper.d.ts +0 -2
  177. package/dist/components/control-stepper.js +0 -2
  178. package/dist/components/control-toggle.config.d.ts +0 -2
  179. package/dist/components/control-toggle.config.js +0 -2
  180. package/dist/components/control-toggle.d.ts +0 -2
  181. package/dist/components/control-toggle.js +0 -2
  182. package/dist/components/dist/_slots.js +0 -8
  183. package/dist/components/dist/accordion.config.d.ts +0 -431
  184. package/dist/components/dist/accordion.config.js +0 -81
  185. package/dist/components/dist/accordion.d.ts +0 -453
  186. package/dist/components/dist/accordion.js +0 -60
  187. package/dist/components/dist/alert.config.d.ts +0 -219
  188. package/dist/components/dist/alert.config.js +0 -54
  189. package/dist/components/dist/alert.d.ts +0 -230
  190. package/dist/components/dist/alert.js +0 -16
  191. package/dist/components/dist/anchor.config.d.ts +0 -250
  192. package/dist/components/dist/anchor.config.js +0 -22
  193. package/dist/components/dist/anchor.d.ts +0 -261
  194. package/dist/components/dist/anchor.js +0 -9
  195. package/dist/components/dist/article.d.ts +0 -11
  196. package/dist/components/dist/article.js +0 -9
  197. package/dist/components/dist/aside.d.ts +0 -11
  198. package/dist/components/dist/aside.js +0 -9
  199. package/dist/components/dist/avatar-group.config.d.ts +0 -315
  200. package/dist/components/dist/avatar-group.config.js +0 -33
  201. package/dist/components/dist/avatar-group.d.ts +0 -329
  202. package/dist/components/dist/avatar-group.js +0 -39
  203. package/dist/components/dist/avatar.config.d.ts +0 -197
  204. package/dist/components/dist/avatar.config.js +0 -49
  205. package/dist/components/dist/avatar.d.ts +0 -211
  206. package/dist/components/dist/avatar.js +0 -20
  207. package/dist/components/dist/badge.config.d.ts +0 -477
  208. package/dist/components/dist/badge.config.js +0 -99
  209. package/dist/components/dist/badge.d.ts +0 -489
  210. package/dist/components/dist/badge.js +0 -16
  211. package/dist/components/dist/box.d.ts +0 -14
  212. package/dist/components/dist/box.js +0 -9
  213. package/dist/components/dist/breadcrumb.config.d.ts +0 -390
  214. package/dist/components/dist/breadcrumb.config.js +0 -43
  215. package/dist/components/dist/breadcrumb.d.ts +0 -420
  216. package/dist/components/dist/breadcrumb.js +0 -119
  217. package/dist/components/dist/button.config.d.ts +0 -381
  218. package/dist/components/dist/button.config.js +0 -91
  219. package/dist/components/dist/button.d.ts +0 -403
  220. package/dist/components/dist/button.js +0 -35
  221. package/dist/components/dist/card.config.d.ts +0 -336
  222. package/dist/components/dist/card.config.js +0 -33
  223. package/dist/components/dist/card.d.ts +0 -352
  224. package/dist/components/dist/card.js +0 -27
  225. package/dist/components/dist/collapsible.config.d.ts +0 -45
  226. package/dist/components/dist/collapsible.config.js +0 -46
  227. package/dist/components/dist/collapsible.d.ts +0 -61
  228. package/dist/components/dist/collapsible.js +0 -38
  229. package/dist/components/dist/command.config.d.ts +0 -1613
  230. package/dist/components/dist/command.config.js +0 -170
  231. package/dist/components/dist/command.d.ts +0 -1722
  232. package/dist/components/dist/command.js +0 -341
  233. package/dist/components/dist/control-color.config.d.ts +0 -979
  234. package/dist/components/dist/control-color.config.js +0 -81
  235. package/dist/components/dist/control-color.d.ts +0 -995
  236. package/dist/components/dist/control-color.js +0 -64
  237. package/dist/components/dist/control-curve.config.d.ts +0 -18
  238. package/dist/components/dist/control-curve.config.js +0 -14
  239. package/dist/components/dist/control-curve.d.ts +0 -35
  240. package/dist/components/dist/control-curve.js +0 -81
  241. package/dist/components/dist/control-folder.config.d.ts +0 -177
  242. package/dist/components/dist/control-folder.config.js +0 -47
  243. package/dist/components/dist/control-folder.d.ts +0 -194
  244. package/dist/components/dist/control-folder.js +0 -41
  245. package/dist/components/dist/control-group.config.d.ts +0 -859
  246. package/dist/components/dist/control-group.config.js +0 -80
  247. package/dist/components/dist/control-group.d.ts +0 -881
  248. package/dist/components/dist/control-group.js +0 -89
  249. package/dist/components/dist/control-knob.config.d.ts +0 -792
  250. package/dist/components/dist/control-knob.config.js +0 -67
  251. package/dist/components/dist/control-knob.d.ts +0 -819
  252. package/dist/components/dist/control-knob.js +0 -148
  253. package/dist/components/dist/control-panel.config.d.ts +0 -402
  254. package/dist/components/dist/control-panel.config.js +0 -38
  255. package/dist/components/dist/control-panel.d.ts +0 -415
  256. package/dist/components/dist/control-panel.js +0 -22
  257. package/dist/components/dist/control-select.config.d.ts +0 -1176
  258. package/dist/components/dist/control-select.config.js +0 -102
  259. package/dist/components/dist/control-select.d.ts +0 -1200
  260. package/dist/components/dist/control-select.js +0 -63
  261. package/dist/components/dist/control-slider.config.d.ts +0 -104
  262. package/dist/components/dist/control-slider.config.js +0 -98
  263. package/dist/components/dist/control-slider.d.ts +0 -127
  264. package/dist/components/dist/control-slider.js +0 -87
  265. package/dist/components/dist/control-spring.config.d.ts +0 -417
  266. package/dist/components/dist/control-spring.config.js +0 -36
  267. package/dist/components/dist/control-spring.d.ts +0 -439
  268. package/dist/components/dist/control-spring.js +0 -136
  269. package/dist/components/dist/control-stepper.config.d.ts +0 -1084
  270. package/dist/components/dist/control-stepper.config.js +0 -108
  271. package/dist/components/dist/control-stepper.d.ts +0 -1104
  272. package/dist/components/dist/control-stepper.js +0 -109
  273. package/dist/components/dist/control-toggle.config.d.ts +0 -407
  274. package/dist/components/dist/control-toggle.config.js +0 -26
  275. package/dist/components/dist/control-toggle.d.ts +0 -420
  276. package/dist/components/dist/control-toggle.js +0 -36
  277. package/dist/components/dist/createSlot.d.ts +0 -8
  278. package/dist/components/dist/createSlot.js +0 -89
  279. package/dist/components/dist/dropdown.config.d.ts +0 -920
  280. package/dist/components/dist/dropdown.config.js +0 -107
  281. package/dist/components/dist/dropdown.d.ts +0 -950
  282. package/dist/components/dist/dropdown.js +0 -92
  283. package/dist/components/dist/empty-state.config.d.ts +0 -396
  284. package/dist/components/dist/empty-state.config.js +0 -53
  285. package/dist/components/dist/empty-state.d.ts +0 -416
  286. package/dist/components/dist/empty-state.js +0 -33
  287. package/dist/components/dist/footer.d.ts +0 -11
  288. package/dist/components/dist/footer.js +0 -9
  289. package/dist/components/dist/grid.d.ts +0 -41
  290. package/dist/components/dist/grid.js +0 -34
  291. package/dist/components/dist/header.d.ts +0 -11
  292. package/dist/components/dist/header.js +0 -9
  293. package/dist/components/dist/hstack.d.ts +0 -15
  294. package/dist/components/dist/hstack.js +0 -21
  295. package/dist/components/dist/image.d.ts +0 -19
  296. package/dist/components/dist/image.js +0 -9
  297. package/dist/components/dist/input.config.d.ts +0 -58
  298. package/dist/components/dist/input.config.js +0 -42
  299. package/dist/components/dist/input.d.ts +0 -67
  300. package/dist/components/dist/input.js +0 -14
  301. package/dist/components/dist/item.config.d.ts +0 -351
  302. package/dist/components/dist/item.config.js +0 -83
  303. package/dist/components/dist/item.d.ts +0 -374
  304. package/dist/components/dist/item.js +0 -51
  305. package/dist/components/dist/list.d.ts +0 -19
  306. package/dist/components/dist/list.js +0 -21
  307. package/dist/components/dist/main.d.ts +0 -11
  308. package/dist/components/dist/main.js +0 -9
  309. package/dist/components/dist/modal.config.d.ts +0 -397
  310. package/dist/components/dist/modal.config.js +0 -92
  311. package/dist/components/dist/modal.d.ts +0 -433
  312. package/dist/components/dist/modal.js +0 -125
  313. package/dist/components/dist/nav-header.config.d.ts +0 -158
  314. package/dist/components/dist/nav-header.config.js +0 -26
  315. package/dist/components/dist/nav-header.d.ts +0 -173
  316. package/dist/components/dist/nav-header.js +0 -23
  317. package/dist/components/dist/nav.d.ts +0 -11
  318. package/dist/components/dist/nav.js +0 -9
  319. package/dist/components/dist/preset-bar.config.d.ts +0 -192
  320. package/dist/components/dist/preset-bar.config.js +0 -39
  321. package/dist/components/dist/preset-bar.d.ts +0 -215
  322. package/dist/components/dist/preset-bar.js +0 -71
  323. package/dist/components/dist/presets/index.d.ts +0 -17674
  324. package/dist/components/dist/presets/index.js +0 -97
  325. package/dist/components/dist/pressable.d.ts +0 -11
  326. package/dist/components/dist/pressable.js +0 -9
  327. package/dist/components/dist/progress.config.d.ts +0 -296
  328. package/dist/components/dist/progress.config.js +0 -35
  329. package/dist/components/dist/progress.d.ts +0 -311
  330. package/dist/components/dist/progress.js +0 -43
  331. package/dist/components/dist/section.d.ts +0 -11
  332. package/dist/components/dist/section.js +0 -9
  333. package/dist/components/dist/select.config.d.ts +0 -31
  334. package/dist/components/dist/select.config.js +0 -25
  335. package/dist/components/dist/select.d.ts +0 -45
  336. package/dist/components/dist/select.js +0 -13
  337. package/dist/components/dist/sheet.config.d.ts +0 -245
  338. package/dist/components/dist/sheet.config.js +0 -99
  339. package/dist/components/dist/sheet.d.ts +0 -267
  340. package/dist/components/dist/sheet.js +0 -53
  341. package/dist/components/dist/sidebar.config.d.ts +0 -1651
  342. package/dist/components/dist/sidebar.config.js +0 -217
  343. package/dist/components/dist/sidebar.d.ts +0 -1825
  344. package/dist/components/dist/sidebar.js +0 -492
  345. package/dist/components/dist/skeleton.config.d.ts +0 -16
  346. package/dist/components/dist/skeleton.config.js +0 -10
  347. package/dist/components/dist/skeleton.d.ts +0 -27
  348. package/dist/components/dist/skeleton.js +0 -16
  349. package/dist/components/dist/slider.config.d.ts +0 -44
  350. package/dist/components/dist/slider.config.js +0 -40
  351. package/dist/components/dist/slider.d.ts +0 -70
  352. package/dist/components/dist/slider.js +0 -247
  353. package/dist/components/dist/spinner.config.d.ts +0 -34
  354. package/dist/components/dist/spinner.config.js +0 -24
  355. package/dist/components/dist/spinner.d.ts +0 -42
  356. package/dist/components/dist/spinner.js +0 -29
  357. package/dist/components/dist/svg.d.ts +0 -21
  358. package/dist/components/dist/svg.js +0 -17
  359. package/dist/components/dist/switch.config.d.ts +0 -353
  360. package/dist/components/dist/switch.config.js +0 -47
  361. package/dist/components/dist/switch.d.ts +0 -370
  362. package/dist/components/dist/switch.js +0 -32
  363. package/dist/components/dist/table.d.ts +0 -36
  364. package/dist/components/dist/table.js +0 -29
  365. package/dist/components/dist/tabs.config.d.ts +0 -611
  366. package/dist/components/dist/tabs.config.js +0 -56
  367. package/dist/components/dist/tabs.d.ts +0 -632
  368. package/dist/components/dist/tabs.js +0 -77
  369. package/dist/components/dist/text.config.d.ts +0 -306
  370. package/dist/components/dist/text.config.js +0 -149
  371. package/dist/components/dist/text.d.ts +0 -205
  372. package/dist/components/dist/text.js +0 -12
  373. package/dist/components/dist/textarea.config.d.ts +0 -352
  374. package/dist/components/dist/textarea.config.js +0 -57
  375. package/dist/components/dist/textarea.d.ts +0 -362
  376. package/dist/components/dist/textarea.js +0 -9
  377. package/dist/components/dist/toast.config.d.ts +0 -335
  378. package/dist/components/dist/toast.config.js +0 -145
  379. package/dist/components/dist/toast.d.ts +0 -426
  380. package/dist/components/dist/toast.js +0 -159
  381. package/dist/components/dist/tooltip.config.d.ts +0 -193
  382. package/dist/components/dist/tooltip.config.js +0 -40
  383. package/dist/components/dist/tooltip.d.ts +0 -206
  384. package/dist/components/dist/tooltip.js +0 -28
  385. package/dist/components/dist/vstack.d.ts +0 -15
  386. package/dist/components/dist/vstack.js +0 -20
  387. package/dist/components/dropdown.config.d.ts +0 -2
  388. package/dist/components/dropdown.config.js +0 -2
  389. package/dist/components/dropdown.d.ts +0 -2
  390. package/dist/components/dropdown.js +0 -2
  391. package/dist/components/empty-state.config.d.ts +0 -2
  392. package/dist/components/empty-state.config.js +0 -2
  393. package/dist/components/empty-state.d.ts +0 -2
  394. package/dist/components/empty-state.js +0 -2
  395. package/dist/components/footer.d.ts +0 -2
  396. package/dist/components/footer.js +0 -2
  397. package/dist/components/grid.d.ts +0 -2
  398. package/dist/components/grid.js +0 -2
  399. package/dist/components/header.d.ts +0 -2
  400. package/dist/components/header.js +0 -2
  401. package/dist/components/hstack.d.ts +0 -2
  402. package/dist/components/hstack.js +0 -2
  403. package/dist/components/image.d.ts +0 -2
  404. package/dist/components/image.js +0 -2
  405. package/dist/components/input.config.d.ts +0 -2
  406. package/dist/components/input.config.js +0 -2
  407. package/dist/components/input.d.ts +0 -2
  408. package/dist/components/input.js +0 -2
  409. package/dist/components/item.config.d.ts +0 -2
  410. package/dist/components/item.config.js +0 -2
  411. package/dist/components/item.d.ts +0 -2
  412. package/dist/components/item.js +0 -2
  413. package/dist/components/list.d.ts +0 -2
  414. package/dist/components/list.js +0 -2
  415. package/dist/components/main.d.ts +0 -2
  416. package/dist/components/main.js +0 -2
  417. package/dist/components/modal.config.d.ts +0 -2
  418. package/dist/components/modal.config.js +0 -2
  419. package/dist/components/modal.d.ts +0 -2
  420. package/dist/components/modal.js +0 -2
  421. package/dist/components/nav-header.config.d.ts +0 -2
  422. package/dist/components/nav-header.config.js +0 -2
  423. package/dist/components/nav-header.d.ts +0 -2
  424. package/dist/components/nav-header.js +0 -2
  425. package/dist/components/nav.d.ts +0 -2
  426. package/dist/components/nav.js +0 -2
  427. package/dist/components/preset-bar.config.d.ts +0 -2
  428. package/dist/components/preset-bar.config.js +0 -2
  429. package/dist/components/preset-bar.d.ts +0 -2
  430. package/dist/components/preset-bar.js +0 -2
  431. package/dist/components/presets/index.d.ts +0 -44
  432. package/dist/components/presets/index.js +0 -44
  433. package/dist/components/pressable.d.ts +0 -2
  434. package/dist/components/pressable.js +0 -2
  435. package/dist/components/progress.config.d.ts +0 -2
  436. package/dist/components/progress.config.js +0 -2
  437. package/dist/components/progress.d.ts +0 -2
  438. package/dist/components/progress.js +0 -2
  439. package/dist/components/section.d.ts +0 -2
  440. package/dist/components/section.js +0 -2
  441. package/dist/components/select.config.d.ts +0 -2
  442. package/dist/components/select.config.js +0 -2
  443. package/dist/components/select.d.ts +0 -2
  444. package/dist/components/select.js +0 -2
  445. package/dist/components/sheet.config.d.ts +0 -2
  446. package/dist/components/sheet.config.js +0 -2
  447. package/dist/components/sheet.d.ts +0 -2
  448. package/dist/components/sheet.js +0 -2
  449. package/dist/components/sidebar.config.d.ts +0 -2
  450. package/dist/components/sidebar.config.js +0 -2
  451. package/dist/components/sidebar.d.ts +0 -2
  452. package/dist/components/sidebar.js +0 -2
  453. package/dist/components/skeleton.config.d.ts +0 -2
  454. package/dist/components/skeleton.config.js +0 -2
  455. package/dist/components/skeleton.d.ts +0 -2
  456. package/dist/components/skeleton.js +0 -2
  457. package/dist/components/slider.config.d.ts +0 -2
  458. package/dist/components/slider.config.js +0 -2
  459. package/dist/components/slider.d.ts +0 -2
  460. package/dist/components/slider.js +0 -2
  461. package/dist/components/spinner.config.d.ts +0 -2
  462. package/dist/components/spinner.config.js +0 -2
  463. package/dist/components/spinner.d.ts +0 -2
  464. package/dist/components/spinner.js +0 -2
  465. package/dist/components/svg.d.ts +0 -2
  466. package/dist/components/svg.js +0 -2
  467. package/dist/components/switch.config.d.ts +0 -2
  468. package/dist/components/switch.config.js +0 -2
  469. package/dist/components/switch.d.ts +0 -2
  470. package/dist/components/switch.js +0 -2
  471. package/dist/components/table.d.ts +0 -2
  472. package/dist/components/table.js +0 -2
  473. package/dist/components/tabs.config.d.ts +0 -2
  474. package/dist/components/tabs.config.js +0 -2
  475. package/dist/components/tabs.d.ts +0 -2
  476. package/dist/components/tabs.js +0 -2
  477. package/dist/components/text.config.d.ts +0 -2
  478. package/dist/components/text.config.js +0 -2
  479. package/dist/components/text.d.ts +0 -2
  480. package/dist/components/text.js +0 -2
  481. package/dist/components/textarea.config.d.ts +0 -2
  482. package/dist/components/textarea.config.js +0 -2
  483. package/dist/components/textarea.d.ts +0 -2
  484. package/dist/components/textarea.js +0 -2
  485. package/dist/components/toast.config.d.ts +0 -2
  486. package/dist/components/toast.config.js +0 -2
  487. package/dist/components/toast.d.ts +0 -2
  488. package/dist/components/toast.js +0 -2
  489. package/dist/components/tooltip.config.d.ts +0 -2
  490. package/dist/components/tooltip.config.js +0 -2
  491. package/dist/components/tooltip.d.ts +0 -2
  492. package/dist/components/tooltip.js +0 -2
  493. package/dist/components/vstack.d.ts +0 -2
  494. package/dist/components/vstack.js +0 -2
  495. package/dist/config/dist/component-config.d.ts +0 -349
  496. package/dist/config/dist/component-refs.d.ts +0 -98
  497. package/dist/config/dist/component-resolution.js +0 -78
  498. package/dist/config/dist/consts/defaultColors.d.ts +0 -253
  499. package/dist/config/dist/consts/defaultColors.js +0 -252
  500. package/dist/config/dist/createComponent.d.ts +0 -1
  501. package/dist/config/dist/createComponent.js +0 -1
  502. package/dist/config/dist/createConfig.d.ts +0 -375
  503. package/dist/config/dist/createConfig.js +0 -625
  504. package/dist/config/dist/defineComponent.d.ts +0 -24
  505. package/dist/config/dist/defineComponent.js +0 -2
  506. package/dist/config/dist/defineStyleProp.d.ts +0 -93
  507. package/dist/config/dist/defineStyleProp.js +0 -60
  508. package/dist/config/dist/preset-merge.js +0 -192
  509. package/dist/config/dist/propertyAcceptedTypes.js +0 -220
  510. package/dist/config/dist/propertyGroups.d.ts +0 -1
  511. package/dist/config/dist/propertyGroups.js +0 -414
  512. package/dist/config/dist/resolveStyleProp.d.ts +0 -88
  513. package/dist/config/dist/resolveStyleProp.js +0 -235
  514. package/dist/config/dist/resolveTokenTypes.d.ts +0 -1
  515. package/dist/config/dist/resolveTokenTypes.js +0 -149
  516. package/dist/config/dist/runtime-registry.js +0 -9
  517. package/dist/config/dist/serialize.d.ts +0 -73
  518. package/dist/config/dist/serialize.js +0 -172
  519. package/dist/config/dist/style-prop-runtime.d.ts +0 -1
  520. package/dist/config-utils/dist/componentConfig.d.ts +0 -10
  521. package/dist/config-utils/dist/componentConfig.js +0 -11
  522. package/dist/config-utils.d.ts +0 -2
  523. package/dist/config-utils.js +0 -2
  524. package/dist/core/dist/color-opacity-map.js +0 -33
  525. package/dist/core/dist/compositeStyles.d.ts +0 -21
  526. package/dist/core/dist/compositeStyles.js +0 -51
  527. package/dist/core/dist/configurable-prop-helpers.d.ts +0 -31
  528. package/dist/core/dist/configurable-prop-helpers.js +0 -61
  529. package/dist/core/dist/createComponent.boundaries.js +0 -192
  530. package/dist/core/dist/createComponent.d.ts +0 -56
  531. package/dist/core/dist/createComponent.js +0 -67
  532. package/dist/core/dist/createComponentExample.d.ts +0 -41
  533. package/dist/core/dist/createComponentExample.js +0 -27
  534. package/dist/core/dist/createProvider.d.ts +0 -12
  535. package/dist/core/dist/createProvider.js +0 -24
  536. package/dist/core/dist/generated/stylePropsTwMap.d.ts +0 -1700
  537. package/dist/core/dist/generated/stylePropsTwMap.js +0 -570
  538. package/dist/core/dist/getComponentStyles.d.ts +0 -49
  539. package/dist/core/dist/getComponentStyles.js +0 -85
  540. package/dist/core/dist/getStyles.d.ts +0 -42
  541. package/dist/core/dist/getStyles.js +0 -300
  542. package/dist/core/dist/index.d.ts +0 -13
  543. package/dist/core/dist/index.js +0 -13
  544. package/dist/core/dist/modifier-mappings.d.ts +0 -12
  545. package/dist/core/dist/modifier-mappings.js +0 -61
  546. package/dist/core/dist/resolveMotionState.d.ts +0 -4
  547. package/dist/core/dist/resolveMotionState.js +0 -17
  548. package/dist/core/dist/resolveProps.boundaries.js +0 -131
  549. package/dist/core/dist/style-prop-data.d.ts +0 -32
  550. package/dist/core/dist/style-prop-data.js +0 -1257
  551. package/dist/core/dist/transformPreset.d.ts +0 -17
  552. package/dist/core/dist/transformPreset.js +0 -28
  553. package/dist/core/dist/withDefaultStyleProps.d.ts +0 -43
  554. package/dist/core/dist/withDefaultStyleProps.js +0 -18
  555. package/dist/core.d.ts +0 -14
  556. package/dist/core.js +0 -15
  557. package/dist/createSlot.d.ts +0 -2
  558. package/dist/createSlot.js +0 -2
  559. package/dist/fixtures.d.ts +0 -4
  560. package/dist/fixtures.js +0 -5
  561. package/dist/foundational-presets/dist/_virtual/_rolldown/runtime.js +0 -13
  562. package/dist/foundational-presets/dist/defaultPreset.d.ts +0 -1557
  563. package/dist/foundational-presets/dist/defaultPreset.js +0 -615
  564. package/dist/foundational-presets/dist/index.d.ts +0 -1
  565. package/dist/foundational-presets/dist/index.js +0 -1
  566. package/dist/foundational-presets/dist/motion.d.ts +0 -12
  567. package/dist/foundational-presets/dist/style-props.js +0 -1445
  568. package/dist/loader/dist/loader/create-component-data.js +0 -33
  569. package/dist/loader/dist/loader/create-component-lowering.js +0 -454
  570. package/dist/loader/dist/loader/data-attr-transform.js +0 -191
  571. package/dist/loader/dist/loader/dynamic-style-codegen.js +0 -97
  572. package/dist/loader/dist/loader/internal-meta.js +0 -22
  573. package/dist/loader/dist/loader/lower-new-api-primitive.js +0 -90
  574. package/dist/loader/dist/loader/motion-transform.js +0 -717
  575. package/dist/loader/dist/loader/style-transform.js +0 -670
  576. package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -203
  577. package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -25
  578. package/dist/loader/dist/node_modules/react/cjs/react.development.js +0 -762
  579. package/dist/loader/dist/node_modules/react/cjs/react.production.js +0 -351
  580. package/dist/loader/dist/node_modules/react/index.js +0 -10
  581. package/dist/loader/dist/node_modules/react/jsx-runtime.js +0 -10
  582. package/dist/loader/dist/packages/core/dist/color-opacity-map.js +0 -33
  583. package/dist/loader/dist/packages/core/dist/compositeStyles.js +0 -43
  584. package/dist/loader/dist/packages/core/dist/createComponent.js +0 -6
  585. package/dist/loader/dist/packages/core/dist/createProvider.js +0 -7
  586. package/dist/loader/dist/packages/core/dist/generated/stylePropsTwMap.js +0 -570
  587. package/dist/loader/dist/packages/core/dist/getComponentStyles.js +0 -2
  588. package/dist/loader/dist/packages/core/dist/getStyles.js +0 -60
  589. package/dist/loader/dist/packages/core/dist/index.js +0 -6
  590. package/dist/loader/dist/packages/core/dist/modifier-mappings.js +0 -61
  591. package/dist/loader/dist/packages/core/dist/style-prop-data.js +0 -1257
  592. package/dist/loader/dist/packages/core/dist/withDefaultStyleProps.js +0 -1
  593. package/dist/presets/dist/defaultPreset.d.ts +0 -6
  594. package/dist/presets/dist/defaultPreset.js +0 -51
  595. package/dist/presets/dist/index.d.ts +0 -1
  596. package/dist/presets/dist/index.js +0 -1
  597. package/dist/presets/motion.d.ts +0 -2
  598. package/dist/presets/motion.js +0 -2
  599. package/dist/presets.d.ts +0 -2
  600. package/dist/presets.js +0 -3
  601. package/dist/styles.d.ts +0 -4
  602. package/dist/styles.js +0 -5
  603. package/dist/transformPreset.d.ts +0 -2
  604. package/dist/transformPreset.js +0 -3
  605. /package/dist/{config/dist/component-resolution.d.ts → loader/dist/transform-runner.d.ts} +0 -0
package/dist/config.js CHANGED
@@ -1,22 +1,29 @@
1
- import { defaultColors } from "./config/dist/consts/defaultColors.js";
2
- import { buildTokenReference, createConfigBuilder, darker, lighter, resolveConfig } from "./config/dist/createConfig.js";
3
- import { buildReverseMap, deserializeConfig, serializeConfig } from "./config/dist/serialize.js";
1
+ import { cssClassName, cssDeclaration, cssSelector, cssVar } from "./config/dist/brands.js";
2
+ import { makeTokenRefToCss } from "./config/dist/entity-utils.js";
3
+ import { AssetGroup } from "./config/dist/AssetGroup.js";
4
+ import { ASSET_CLASS_CAPABILITIES, isPlaceable } from "./config/dist/asset-kind.js";
5
+ import { SOURCE_PATH_KEY, attachSourcePath, captureCallerPath, readSourcePath } from "./config/dist/captureCallerPath.js";
6
+ import { assetGroup, component, composite, isAssetGroupRef, isComponentRef, isCompositeRef, isModeRef, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, mode, styleProp, tag, token, tokenGroup } from "./config/dist/refs.js";
7
+ import { alpha, isColorExpression, isLinearGradientExpr, isMixExpr, isRadialGradientExpr, linearGradient, mix, radialGradient, resolveColorExpression } from "./config/dist/colorExpressions.js";
8
+ import { defineAssetGroup, defineAssetIcon } from "./config/dist/defineAssetGroup.js";
9
+ import { ELEMENT_MARKER_KIND, hasElementMarkerDeep, isElementLikeValue, isElementMarker, reviveElementMarkersDeep } from "./config/dist/element-marker.js";
10
+ import { PREVIEW_SEED_KEY, isBoolMarker, isLayerMarker, isNumberMarker, isPreviewAxisMarker, isSlotMarker, isStringMarker, isVariantArrayMarker, isVariantMarker, matchesPreviewWhen, resolvePreviewRules } from "./config/dist/markers.js";
11
+ import { Component, Layer } from "./config/dist/Component.js";
12
+ import { ComponentGroup } from "./config/dist/ComponentGroup.js";
13
+ import { CompositeStyle } from "./config/dist/CompositeStyle.js";
14
+ import { Mode, ModeOption } from "./config/dist/Mode.js";
15
+ import { Modifier } from "./config/dist/Modifier.js";
16
+ import { CssMotionDef, JsMotionDef } from "./config/dist/MotionDef.js";
17
+ import { Provider } from "./config/dist/Provider.js";
18
+ import { StyleProp } from "./config/dist/StyleProp.js";
19
+ import { Token } from "./config/dist/Token.js";
20
+ import { TokenGroup } from "./config/dist/TokenGroup.js";
21
+ import { Config, parseRegistryKey } from "./config/dist/Config.js";
22
+ import { defineProvider } from "./config/dist/defineProvider.js";
23
+ import { boolean, defineComponent, defineComponentGroup, defineCompositeStyle, defineMode, defineModifier, defineMotion, defineStyleProp, defineTokenGroup, number, slot, string, variant } from "./config/dist/factories.js";
24
+ import { interpolate } from "./config/dist/interpolate.js";
25
+ import { buildModeBackedModifierLookup, buildNestedModifierUpdate, createModeBackedModifierLookup, mergeModifierUpdates, modifierIdToPath, modifierPathToId, modifierTreeToOverrideRows, overrideRowsToModifierTree, resolveOverrideRowValue } from "./config/dist/token-override-rows.js";
26
+ import { CSS_GLOBAL_KEYWORDS, CSS_PROPERTY_KEYWORDS } from "./config/dist/types/css-property-keywords.js";
27
+ import { rem } from "./config/dist/units.js";
4
28
  import "./config/dist/index.js";
5
- import { defaultPreset as defaultPreset$1 } from "./presets/dist/defaultPreset.js";
6
- import "./presets/dist/index.js";
7
- //#region src/config.ts
8
- /** biome-ignore-all lint/suspicious/noExplicitAny: necessary for dynamic builder */
9
- const uds = createConfigBuilder({
10
- atomic: [],
11
- modes: [],
12
- modifiers: [],
13
- compositeStyles: {},
14
- motion: {},
15
- components: {},
16
- globalStyles: {},
17
- preflight: true,
18
- prefix: "uds"
19
- });
20
- const defaultPreset = defaultPreset$1;
21
- //#endregion
22
- export { buildReverseMap, buildTokenReference, createConfigBuilder, darker, defaultColors, defaultPreset, deserializeConfig, lighter, resolveConfig, serializeConfig, uds };
29
+ export { ASSET_CLASS_CAPABILITIES, AssetGroup, CSS_GLOBAL_KEYWORDS, CSS_PROPERTY_KEYWORDS, Component, ComponentGroup, CompositeStyle, Config, CssMotionDef, ELEMENT_MARKER_KIND, JsMotionDef, Layer, Mode, ModeOption, Modifier, PREVIEW_SEED_KEY, Provider, SOURCE_PATH_KEY, StyleProp, Token, TokenGroup, alpha, assetGroup, attachSourcePath, boolean, buildModeBackedModifierLookup, buildNestedModifierUpdate, captureCallerPath, component, composite, createModeBackedModifierLookup, cssClassName, cssDeclaration, cssSelector, cssVar, defineAssetGroup, defineAssetIcon, defineComponent, defineComponentGroup, defineCompositeStyle, defineMode, defineModifier, defineMotion, defineProvider, defineStyleProp, defineTokenGroup, hasElementMarkerDeep, interpolate, isAssetGroupRef, isBoolMarker, isColorExpression, isComponentRef, isCompositeRef, isElementLikeValue, isElementMarker, isLayerMarker, isLinearGradientExpr, isMixExpr, isModeRef, isNumberMarker, isPlaceable, isPreviewAxisMarker, isRadialGradientExpr, isSlotMarker, isStringMarker, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, isVariantArrayMarker, isVariantMarker, linearGradient, makeTokenRefToCss, matchesPreviewWhen, mergeModifierUpdates, mix, mode, modifierIdToPath, modifierPathToId, modifierTreeToOverrideRows, number, overrideRowsToModifierTree, parseRegistryKey, radialGradient, readSourcePath, rem, resolveColorExpression, resolveOverrideRowValue, resolvePreviewRules, reviveElementMarkersDeep, slot, string, styleProp, tag, token, tokenGroup, variant };
@@ -1,6 +1,5 @@
1
1
  import { createRequire } from "node:module";
2
2
  //#region ../loader/dist/_virtual/_rolldown/runtime.js
3
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
3
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
4
  //#endregion
6
- export { __commonJSMin, __require };
5
+ export { __require };
@@ -0,0 +1,2 @@
1
+ import { transformLoader } from "./loader.js";
2
+ import { UdsPluginOptions, udsPlugin } from "./unplugin.js";
@@ -0,0 +1,3 @@
1
+ import "./loader.js";
2
+ import "./transform-runner.js";
3
+ import "./unplugin.js";
@@ -1,5 +1,9 @@
1
1
  import fs from "node:fs";
2
2
  //#region ../loader/dist/loader/artifacts.js
3
+ /**
4
+ * `.uds/config.json` IS the serialized config — no envelope. Parse and
5
+ * cache by file mtime so subsequent transforms reuse the same object.
6
+ */
3
7
  function createCachedJsonLoader() {
4
8
  let cached = null;
5
9
  let cachedPath = null;
@@ -27,17 +31,30 @@ function createCachedJsonLoaderWithSeed() {
27
31
  if (seededPath === filePath && seededData) return seededData;
28
32
  return loader(filePath, isDev);
29
33
  },
30
- seed: (filePath, data) => {
34
+ seed: (filePath, config) => {
31
35
  seededPath = filePath;
32
- seededData = data;
36
+ seededData = config;
33
37
  }
34
38
  };
35
39
  }
36
- const manifestLoader = createCachedJsonLoaderWithSeed();
37
- const transformDataLoader = createCachedJsonLoaderWithSeed();
38
- const loadManifest = manifestLoader.load;
39
- manifestLoader.seed;
40
- const loadTransformData = transformDataLoader.load;
41
- transformDataLoader.seed;
40
+ const configLoader = createCachedJsonLoaderWithSeed();
41
+ const loadUdsConfig = configLoader.load;
42
+ configLoader.seed;
43
+ const projectionCache = /* @__PURE__ */ new WeakMap();
44
+ /**
45
+ * Build (or return a cached) projection of the config for the loader's
46
+ * hot path. Keyed by config object identity. The cache survives across
47
+ * transforms within one process; reloading `.uds/manifest.json`
48
+ * produces a fresh object, which transparently invalidates the
49
+ * projection.
50
+ */
51
+ function getLoaderProjection(config) {
52
+ const cached = projectionCache.get(config);
53
+ if (cached) return cached;
54
+ const components = config.components ?? {};
55
+ const projection = { componentNames: new Set(Object.keys(components)) };
56
+ projectionCache.set(config, projection);
57
+ return projection;
58
+ }
42
59
  //#endregion
43
- export { loadManifest, loadTransformData };
60
+ export { getLoaderProjection, loadUdsConfig };
@@ -1,29 +1 @@
1
- import * as t from "@babel/types";
2
- //#region ../loader/dist/loader/babel-utils.js
3
- /** JSX function names used by compiled JSX (React, etc.) */
4
- const COMPILED_JSX_NAMES = new Set([
5
- "jsx",
6
- "jsxs",
7
- "jsxDEV",
8
- "_jsx",
9
- "_jsxs",
10
- "_jsxDEV"
11
- ]);
12
- /**
13
- * Check whether a callee expression is a compiled JSX call.
14
- *
15
- * Matches:
16
- * - Direct identifiers: `jsx(...)`, `_jsxs(...)`, `jsxDEV(...)`, etc.
17
- * - Member expressions: `React.jsx(...)`, `_reactJsxRuntime.jsxs(...)`, etc.
18
- */
19
- function isCompiledJsxCallee(node) {
20
- if (!node) return false;
21
- if (t.isIdentifier(node)) return COMPILED_JSX_NAMES.has(node.name);
22
- if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
23
- if (!node.computed && t.isIdentifier(node.property)) return COMPILED_JSX_NAMES.has(node.property.name);
24
- if (node.computed && t.isStringLiteral(node.property)) return COMPILED_JSX_NAMES.has(node.property.value);
25
- }
26
- return false;
27
- }
28
- //#endregion
29
- export { isCompiledJsxCallee };
1
+ import "@babel/types";
@@ -1,7 +1,23 @@
1
1
  import { LoaderDefinitionFunction } from "webpack";
2
2
 
3
3
  //#region ../loader/dist/loader.d.ts
4
+ //#region src/loader.d.ts
5
+ /**
6
+ * The UDS loader's only build-time job: rewrite alias-prefixed local
7
+ * imports of registered UDS components from `@/uds/components/<seg>`
8
+ * (the authoring file) to `'#uds/components/<seg>'` (the codegen-
9
+ * emitted per-source-file module at `.uds/components/<seg>.tsx`).
10
+ *
11
+ * The authoring file is read only by codegen — production renders the
12
+ * downleveled FC. Per-file targets keep Next.js Fast Refresh surgical:
13
+ * editing one authoring source only invalidates that one downleveled
14
+ * module.
15
+ *
16
+ * No JSX-site work: composite / variant / bool / style-prop resolution
17
+ * and motion wiring are owned by the codegen-emitted FC. The loader
18
+ * only changes import sources.
19
+ */
4
20
  declare const transformLoader: LoaderDefinitionFunction;
5
- declare const normal: LoaderDefinitionFunction<{}, {}>;
21
+ declare const normal: LoaderDefinitionFunction<{}, {}>; //#endregion
6
22
  //#endregion
7
23
  export { normal, transformLoader };
@@ -1,65 +1,39 @@
1
- import { componentSlotClass } from "../../utils/dist/string-utils/componentClassName.js";
2
- import "../../utils/dist/index.js";
3
- import { loadManifest, loadTransformData } from "./loader/artifacts.js";
4
- import { isCompiledJsxCallee } from "./loader/babel-utils.js";
5
- import { canInlineSimpleLoweredComponent, resolveLoweredCreateComponentData } from "./loader/create-component-data.js";
6
- import { applySlotMotionToElement, clearHoistedMotionStates, componentHasExitMotion, getCustomSlotMotion, getHoistedMotionStates, handleMotionOnElement, wrapCustomComponentWithAnimatePresence, wrapParentConditionalWithAnimatePresence } from "./loader/motion-transform.js";
7
- import { findClassesParamName, findSlotFromClassNameAttr, findSlotFromPropsSpreadAttr, findSlotPropsParamName, handleCompiledJsxDataAttrs, injectInternalUdsProps } from "./loader/data-attr-transform.js";
8
- import { buildInlineSimpleLoweredCreateComponentRenderFn, buildInlineSimplePrimitiveCreateComponentRenderFn, buildLoweredCreateComponentConfigExpression, extractOwnPropKeys, inferCreateComponentNameFromAssignment, isCreateComponentRenderFnNode, remapOnPressToOnClickInJsxAttributes } from "./loader/create-component-lowering.js";
9
- import { lowerNewApiPrimitiveJsx } from "./loader/lower-new-api-primitive.js";
10
- import { createStyleTransformRuntime } from "./loader/style-transform.js";
11
- import * as t from "@babel/types";
12
- import path from "node:path";
13
- import _traverse from "@babel/traverse";
14
- import _generate from "@babel/generator";
1
+ import { getLoaderProjection, loadUdsConfig } from "./loader/artifacts.js";
15
2
  import { parse } from "@babel/parser";
3
+ import _traverse from "@babel/traverse";
16
4
  //#region ../loader/dist/loader.js
17
5
  const traverse = _traverse.default ?? _traverse;
18
- const generate = _generate.default ?? _generate;
19
- /** Build a custom component set from the manifest (used for motion transform). */
20
- function getCustomComponents(manifest) {
21
- if (!manifest) return null;
22
- const custom = /* @__PURE__ */ new Set();
23
- for (const [name, entry] of Object.entries(manifest.components)) if (entry.type === "custom") custom.add(name);
24
- return custom.size > 0 ? custom : null;
25
- }
26
- function isUdsImportSource(importSource) {
27
- return importSource.startsWith("uds/") || importSource.startsWith("@uds/") || importSource === "uds";
28
- }
29
- function isUdsComponentReference(nodePath, componentName, allUdsComponents, udsImportedNames, createComponentDefinedNames, customComponents) {
30
- if (!allUdsComponents.has(componentName)) return false;
31
- const binding = nodePath.scope?.getBinding?.(componentName);
32
- if (!binding?.path) return udsImportedNames.has(componentName) || createComponentDefinedNames.has(componentName);
33
- const bindingNode = binding.path.node;
34
- if (bindingNode?.type === "ImportSpecifier" || bindingNode?.type === "ImportDefaultSpecifier" || bindingNode?.type === "ImportNamespaceSpecifier") {
35
- const parentNode = binding.path.parent;
36
- if (!t.isImportDeclaration(parentNode)) return false;
37
- return isUdsImportSource(parentNode.source.value) || customComponents?.has(componentName) === true;
38
- }
39
- return createComponentDefinedNames.has(componentName);
40
- }
6
+ /**
7
+ * The UDS loader's only build-time job: rewrite alias-prefixed local
8
+ * imports of registered UDS components from `@/uds/components/<seg>`
9
+ * (the authoring file) to `'#uds/components/<seg>'` (the codegen-
10
+ * emitted per-source-file module at `.uds/components/<seg>.tsx`).
11
+ *
12
+ * The authoring file is read only by codegen — production renders the
13
+ * downleveled FC. Per-file targets keep Next.js Fast Refresh surgical:
14
+ * editing one authoring source only invalidates that one downleveled
15
+ * module.
16
+ *
17
+ * No JSX-site work: composite / variant / bool / style-prop resolution
18
+ * and motion wiring are owned by the codegen-emitted FC. The loader
19
+ * only changes import sources.
20
+ */
41
21
  const transformLoader = function(source) {
42
22
  const loaderContext = this ?? void 0;
43
23
  if (!loaderContext?.getOptions) return source;
44
- const { manifestPath, isDev, skipWatchDependencies } = loaderContext.getOptions();
45
- const transformDataPath = path.join(path.dirname(manifestPath), "motion-transform-data.json");
46
- const projectRoot = path.dirname(path.dirname(manifestPath));
24
+ const { dataPath, isDev, skipWatchDependencies } = loaderContext.getOptions();
47
25
  const resourcePath = loaderContext.resourcePath ?? "";
48
26
  if (resourcePath.includes(".uds/")) return source;
49
- if (!skipWatchDependencies) {
50
- loaderContext.addDependency?.(manifestPath);
51
- loaderContext.addDependency?.(transformDataPath);
27
+ if (!skipWatchDependencies) loaderContext.addDependency?.(dataPath);
28
+ const config = loadUdsConfig(dataPath, isDev);
29
+ if (!config) return source;
30
+ const projection = getLoaderProjection(config);
31
+ let hasComponentReference = false;
32
+ for (const name of projection.componentNames) if (source.includes(name)) {
33
+ hasComponentReference = true;
34
+ break;
52
35
  }
53
- const manifest = loadManifest(manifestPath, isDev);
54
- const transformData = loadTransformData(transformDataPath, isDev);
55
- const styleRuntime = createStyleTransformRuntime(transformData, manifest);
56
- const allUdsComponents = styleRuntime.allComponents;
57
- const primitiveUdsComponents = styleRuntime.primitiveComponents;
58
- const componentTagPatterns = styleRuntime.componentTagPatterns;
59
- const hasAnyComponent = source.includes("from 'uds/") || source.includes("from \"@uds/") || source.includes("from 'uds'") || source.includes("from \"uds/") || source.includes("from '@uds/") || source.includes("from \"uds\"") || componentTagPatterns.length > 0 && componentTagPatterns.some((pattern) => source.includes(pattern));
60
- const hasCreateComponent = source.includes("createComponent") || source.includes("createComponentStyler");
61
- if (!hasAnyComponent && !hasCreateComponent) return source;
62
- const customComponents = getCustomComponents(manifest);
36
+ if (!hasComponentReference) return source;
63
37
  const isTS = resourcePath?.endsWith(".ts") || resourcePath?.endsWith(".tsx");
64
38
  const isJSX = resourcePath?.endsWith(".tsx") || resourcePath?.endsWith(".jsx");
65
39
  const parserPlugins = [];
@@ -74,296 +48,39 @@ const transformLoader = function(source) {
74
48
  } catch {
75
49
  return source;
76
50
  }
77
- let transformed = false;
78
- const importsToAdd = /* @__PURE__ */ new Map();
79
- let hasMotionImport = false;
80
- let needsMotionImport = false;
81
- let hasAnimatePresenceImport = false;
82
- let needsAnimatePresenceImport = false;
83
- let needsResolveMotionStateImport = false;
84
- let needsProcessStylePropsImport = false;
85
- clearHoistedMotionStates();
86
- const stylerToComponent = /* @__PURE__ */ new Map();
87
- const classesVarToComponent = /* @__PURE__ */ new Map();
88
- const slotPropsVarToComponent = /* @__PURE__ */ new Map();
89
- const udsImportedNames = /* @__PURE__ */ new Set();
90
- const createComponentImportNames = /* @__PURE__ */ new Set();
91
- const createVariantsImportNames = /* @__PURE__ */ new Set();
92
- const createVariantsClassMaps = /* @__PURE__ */ new Map();
93
- const hoistedVariantClassMapNames = /* @__PURE__ */ new Map();
94
- const hoistedVariantClassMaps = /* @__PURE__ */ new Map();
95
- const createComponentDefinedNames = /* @__PURE__ */ new Set();
96
- let needsCreateComponentImportCleanup = false;
97
- traverse(ast, {
98
- JSXOpeningElement(nodePath) {
99
- const jsxName = nodePath.node.name;
100
- const jsxTagName = jsxName?.type === "JSXIdentifier" ? jsxName.name : void 0;
101
- if (jsxTagName) {
102
- const componentEntry = manifest?.components?.[jsxTagName];
103
- if (componentEntry?.propBindings && udsImportedNames.has(jsxTagName)) {
104
- const closingElement = (nodePath.parentPath?.node)?.closingElement ?? null;
105
- if (lowerNewApiPrimitiveJsx(nodePath.node, closingElement, {
106
- tag: componentEntry.element,
107
- propBindings: componentEntry.propBindings,
108
- defaultClassNames: componentEntry.defaultClassNames ?? []
109
- }, t)) transformed = true;
110
- return;
111
- }
112
- }
113
- if (jsxTagName && !allUdsComponents.has(jsxTagName) && udsImportedNames.has(jsxTagName)) {
114
- allUdsComponents.add(jsxTagName);
115
- if (!primitiveUdsComponents.has(jsxTagName)) {
116
- const manifestEntry = manifest?.components[jsxTagName];
117
- if (manifestEntry?.type === "primitive" && manifestEntry.element || transformData?.primitiveElementMap?.[jsxTagName]) primitiveUdsComponents.add(jsxTagName);
118
- }
119
- }
120
- const isUdsJsxTag = jsxTagName && isUdsComponentReference(nodePath, jsxTagName, allUdsComponents, udsImportedNames, createComponentDefinedNames, customComponents);
121
- if (isDev && jsxTagName && isUdsJsxTag) {
122
- injectInternalUdsProps(nodePath, resourcePath, projectRoot, {
123
- componentName: jsxTagName,
124
- slotName: "root"
125
- });
126
- transformed = true;
127
- }
128
- if (jsxTagName && isUdsJsxTag && remapOnPressToOnClickInJsxAttributes(nodePath.node.attributes)) transformed = true;
129
- let motionTransformed = false;
130
- if (isUdsJsxTag && handleMotionOnElement(nodePath, manifest, customComponents, primitiveUdsComponents, importsToAdd)) {
131
- transformed = true;
132
- motionTransformed = true;
133
- }
134
- if (jsxTagName && customComponents?.has(jsxTagName) && componentHasExitMotion(manifest, jsxTagName)) {
135
- if (wrapCustomComponentWithAnimatePresence(nodePath)) {
136
- needsAnimatePresenceImport = true;
137
- transformed = true;
138
- }
139
- }
140
- if (isUdsJsxTag && styleRuntime.transformUdsComponentStyleProps(nodePath, createVariantsClassMaps, hoistedVariantClassMapNames, hoistedVariantClassMaps)) transformed = true;
141
- if (!motionTransformed && jsxTagName && isUdsJsxTag && primitiveUdsComponents.has(jsxTagName)) {
142
- const baseElement = (manifest?.components[jsxTagName])?.element ?? transformData?.primitiveElementMap?.[jsxTagName];
143
- if (baseElement) {
144
- let resolvedElement = baseElement;
145
- const asAttrIndex = nodePath.node.attributes.findIndex((attr) => t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name) && attr.name.name === "as");
146
- if (asAttrIndex >= 0) {
147
- const asAttr = nodePath.node.attributes[asAttrIndex];
148
- if (t.isStringLiteral(asAttr.value)) {
149
- resolvedElement = asAttr.value.value;
150
- nodePath.node.attributes.splice(asAttrIndex, 1);
151
- } else if (t.isJSXExpressionContainer(asAttr.value) && t.isStringLiteral(asAttr.value.expression)) {
152
- resolvedElement = asAttr.value.expression.value;
153
- nodePath.node.attributes.splice(asAttrIndex, 1);
154
- }
155
- }
156
- const slotClassName = transformData?.componentClassData?.[jsxTagName]?.slotClassNames?.root ?? componentSlotClass(jsxTagName, "root");
157
- nodePath.node.name = t.jsxIdentifier(resolvedElement);
158
- const existingClassAttr = nodePath.node.attributes.find((attr) => t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name) && attr.name.name === "className");
159
- if (existingClassAttr && t.isJSXAttribute(existingClassAttr)) {
160
- if (t.isStringLiteral(existingClassAttr.value)) existingClassAttr.value = t.stringLiteral(`${slotClassName} ${existingClassAttr.value.value}`);
161
- else if (t.isJSXExpressionContainer(existingClassAttr.value) && !t.isJSXEmptyExpression(existingClassAttr.value.expression)) if (t.isStringLiteral(existingClassAttr.value.expression)) existingClassAttr.value = t.jsxExpressionContainer(t.stringLiteral(`${slotClassName} ${existingClassAttr.value.expression.value}`));
162
- else existingClassAttr.value = t.jsxExpressionContainer(t.templateLiteral([t.templateElement({
163
- raw: `${slotClassName} `,
164
- cooked: `${slotClassName} `
165
- }, false), t.templateElement({
166
- raw: "",
167
- cooked: ""
168
- }, true)], [existingClassAttr.value.expression]));
169
- } else nodePath.node.attributes.push(t.jsxAttribute(t.jsxIdentifier("className"), t.stringLiteral(slotClassName)));
170
- const parent = nodePath.parent;
171
- if (parent?.type === "JSXElement" && parent.closingElement?.name?.type === "JSXIdentifier") parent.closingElement.name = t.jsxIdentifier(resolvedElement);
172
- transformed = true;
173
- }
174
- }
175
- const classNameSlotInfo = findSlotFromClassNameAttr(nodePath.node.attributes, classesVarToComponent, stylerToComponent, slotPropsVarToComponent);
176
- const slotInfo = findSlotFromPropsSpreadAttr(nodePath.node.attributes, slotPropsVarToComponent) ?? classNameSlotInfo;
177
- if (!slotInfo) return;
178
- const slotMotion = getCustomSlotMotion(manifest, slotInfo);
179
- if (slotMotion) {
180
- const motionResult = applySlotMotionToElement(nodePath, slotMotion);
181
- if (motionResult.transformed) {
182
- transformed = true;
183
- needsMotionImport = true;
184
- }
185
- if (motionResult.needsResolveMotionStateImport) needsResolveMotionStateImport = true;
186
- if (motionResult.transformed && slotMotion.exit) {
187
- if (wrapParentConditionalWithAnimatePresence(nodePath)) needsAnimatePresenceImport = true;
188
- }
189
- }
190
- if (nodePath.node.attributes.some((attr) => attr.type === "JSXAttribute" && attr.name?.name === "data-uds-slot")) return;
191
- nodePath.node.attributes.push(t.jsxAttribute(t.jsxIdentifier("data-uds-slot"), t.stringLiteral(slotInfo.slotName)), t.jsxAttribute(t.jsxIdentifier("data-uds-component"), t.stringLiteral(slotInfo.componentName)));
192
- transformed = true;
193
- },
194
- ImportDeclaration(nodePath) {
195
- const importSource = nodePath.node.source?.value;
196
- if (!importSource) return;
197
- if (importSource === "motion/react") {
198
- for (const specifier of nodePath.node.specifiers) if (specifier.type === "ImportSpecifier" && specifier.imported?.type === "Identifier") {
199
- if (specifier.imported.name === "motion") hasMotionImport = true;
200
- if (specifier.imported.name === "AnimatePresence") hasAnimatePresenceImport = true;
201
- }
202
- }
203
- if (!isUdsImportSource(importSource)) return;
204
- for (const specifier of nodePath.node.specifiers) {
205
- const localName = specifier.local?.name;
206
- if (localName) udsImportedNames.add(localName);
207
- }
208
- for (const specifier of nodePath.node.specifiers) {
209
- if (specifier.type !== "ImportSpecifier") continue;
210
- const importedName = specifier.imported?.type === "Identifier" ? specifier.imported.name : specifier.imported?.value;
211
- if (!importedName) continue;
212
- const match = importedName.match(/^get(\w+)Styles$/);
213
- if (match) {
214
- const localName = specifier.local?.name ?? importedName;
215
- stylerToComponent.set(localName, match[1]);
216
- }
217
- if (importedName === "createVariants") {
218
- const localName = specifier.local?.name ?? importedName;
219
- createVariantsImportNames.add(localName);
220
- continue;
221
- }
222
- if (importedName === "createComponent") {
223
- const localName = specifier.local?.name ?? importedName;
224
- createComponentImportNames.add(localName);
225
- }
226
- }
227
- },
228
- VariableDeclarator(nodePath) {
229
- const init = nodePath.node.init;
230
- if (!init) return;
231
- const id = nodePath.node.id;
232
- if (init.type === "CallExpression" && init.callee?.type === "Identifier" && createVariantsImportNames.has(init.callee.name) && id?.type === "Identifier") {
233
- const variantClassMap = styleRuntime.extractVariantClassMapFromCreateVariantsCall(init);
234
- if (variantClassMap) createVariantsClassMaps.set(id.name, variantClassMap);
235
- return;
236
- }
237
- if (init.type === "CallExpression" && init.callee?.type === "Identifier" && init.callee.name === "createComponentStyler" && init.arguments[0]?.type === "StringLiteral" && id?.type === "Identifier") {
238
- stylerToComponent.set(id.name, init.arguments[0].value);
239
- return;
240
- }
241
- if (init.type === "CallExpression" && init.callee?.type === "Identifier" && id?.type === "Identifier") {
242
- const componentName = stylerToComponent.get(init.callee.name);
243
- if (componentName) classesVarToComponent.set(id.name, componentName);
244
- return;
245
- }
246
- if (init.type === "CallExpression" && init.callee?.type === "MemberExpression" && init.callee.property?.name === "resolve" && init.callee.object?.type === "Identifier" && id?.type === "ObjectPattern") {
247
- const componentName = stylerToComponent.get(init.callee.object.name);
248
- if (componentName) {
249
- for (const prop of id.properties) if (prop.type === "ObjectProperty" && prop.key?.type === "Identifier" && prop.key.name === "classes") {
250
- const valueName = prop.value?.type === "Identifier" ? prop.value.name : "classes";
251
- classesVarToComponent.set(valueName, componentName);
252
- break;
253
- }
254
- }
255
- }
256
- },
257
- CallExpression(nodePath) {
258
- const callee = nodePath.node.callee;
259
- if (callee.type !== "Identifier") return;
260
- if (isCompiledJsxCallee(callee)) {
261
- const firstArg = nodePath.node.arguments[0];
262
- if (t.isIdentifier(firstArg) && isUdsComponentReference(nodePath, firstArg.name, allUdsComponents, udsImportedNames, createComponentDefinedNames, customComponents) && styleRuntime.transformCompiledJsxStyleProps(nodePath.node, hoistedVariantClassMapNames, hoistedVariantClassMaps)) transformed = true;
263
- const compiledResult = handleCompiledJsxDataAttrs(nodePath.node, classesVarToComponent, stylerToComponent, slotPropsVarToComponent, manifest);
264
- if (compiledResult.transformed) transformed = true;
265
- if (compiledResult.needsMotionImport) needsMotionImport = true;
266
- if (compiledResult.needsResolveMotionStateImport) needsResolveMotionStateImport = true;
267
- return;
268
- }
269
- const isCreateComponentCall = createComponentImportNames.has(callee.name) || createComponentImportNames.size === 0 && callee.name === "createComponent";
270
- if (!isCreateComponentCall) return;
271
- const args = nodePath.node.arguments;
272
- const componentName = inferCreateComponentNameFromAssignment(nodePath);
273
- if (!componentName) return;
274
- createComponentDefinedNames.add(componentName);
275
- let renderFn = null;
276
- if (isCreateComponentCall) {
277
- if (args.length >= 2 && args[0]?.type === "StringLiteral" && isCreateComponentRenderFnNode(args[1])) throw nodePath.buildCodeFrameError("createComponent(\"Name\", renderFn) is no longer supported. Use createComponent(renderFn).");
278
- const isPrimitiveCreateComponentCall = args.length === 1 && t.isStringLiteral(args[0]);
279
- if (!(args.length === 1 && isCreateComponentRenderFnNode(args[0])) && !isPrimitiveCreateComponentCall) return;
280
- if (isCreateComponentRenderFnNode(args[0])) renderFn = args[0];
281
- }
282
- if (renderFn) {
283
- const classesParam = findClassesParamName(renderFn);
284
- if (classesParam) classesVarToComponent.set(classesParam, componentName);
285
- const slotPropsParam = findSlotPropsParamName(renderFn);
286
- if (slotPropsParam) slotPropsVarToComponent.set(slotPropsParam, componentName);
287
- }
288
- const loweredData = resolveLoweredCreateComponentData(componentName, renderFn ? extractOwnPropKeys(renderFn) : [], manifest, transformData);
289
- if (args.length === 1 && t.isStringLiteral(args[0])) {
290
- loweredData.rootElement = args[0].value;
291
- if (canInlineSimpleLoweredComponent(loweredData)) {
292
- const primitiveResult = buildInlineSimplePrimitiveCreateComponentRenderFn(loweredData);
293
- nodePath.replaceWith(primitiveResult.expression);
294
- if (primitiveResult.needsProcessStylePropsImport) needsProcessStylePropsImport = true;
295
- needsCreateComponentImportCleanup = true;
296
- transformed = true;
297
- return;
298
- }
299
- nodePath.replaceWith(t.callExpression(t.cloneNode(callee), [buildLoweredCreateComponentConfigExpression(loweredData), t.cloneNode(args[0], true)]));
300
- transformed = true;
301
- return;
302
- }
303
- if (canInlineSimpleLoweredComponent(loweredData)) {
304
- const inlineResult = buildInlineSimpleLoweredCreateComponentRenderFn(loweredData, renderFn);
305
- nodePath.replaceWith(inlineResult.expression);
306
- if (inlineResult.needsMotionImport) needsMotionImport = true;
307
- if (inlineResult.needsAnimatePresenceImport) needsAnimatePresenceImport = true;
308
- if (inlineResult.needsResolveMotionStateImport) needsResolveMotionStateImport = true;
309
- needsCreateComponentImportCleanup = true;
310
- transformed = true;
311
- return;
312
- }
313
- if (!renderFn) return;
314
- nodePath.replaceWith(t.callExpression(t.cloneNode(callee), [buildLoweredCreateComponentConfigExpression(loweredData), t.cloneNode(renderFn, true)]));
315
- transformed = true;
316
- }
317
- });
318
- if (needsCreateComponentImportCleanup) traverse(ast, { ImportDeclaration(nodePath) {
51
+ const edits = [];
52
+ traverse(ast, { ImportDeclaration(nodePath) {
319
53
  const importSource = nodePath.node.source?.value;
320
54
  if (!importSource) return;
321
- if (!isUdsImportSource(importSource)) return;
322
- const nextSpecifiers = nodePath.node.specifiers.filter((specifier) => {
323
- if (specifier.type !== "ImportSpecifier") return true;
324
- const importedName = specifier.imported?.type === "Identifier" ? specifier.imported.name : specifier.imported?.value;
325
- if (importedName !== "createComponent") return true;
326
- const localName = specifier.local?.name ?? importedName;
327
- nodePath.scope.crawl();
328
- const binding = nodePath.scope.getBinding(localName);
329
- return Boolean(binding?.referenced);
330
- });
331
- if (nextSpecifiers.length === nodePath.node.specifiers.length) return;
332
- if (nextSpecifiers.length === 0) {
333
- nodePath.remove();
334
- return;
55
+ if (!(!importSource.startsWith(".") && !importSource.startsWith("/"))) return;
56
+ let shouldRewriteSource = false;
57
+ for (const specifier of nodePath.node.specifiers) {
58
+ if (specifier.type !== "ImportSpecifier") continue;
59
+ const importedName = specifier.imported?.type === "Identifier" ? specifier.imported.name : void 0;
60
+ if (!importedName) continue;
61
+ if (projection.componentNames.has(importedName)) shouldRewriteSource = true;
62
+ }
63
+ const segmentMatch = importSource.match(/\/uds\/components\/([^/]+)$/);
64
+ if (!shouldRewriteSource && segmentMatch) {
65
+ const pascal = segmentMatch[1].split("-").filter(Boolean).map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("");
66
+ if (projection.componentNames.has(pascal)) shouldRewriteSource = true;
67
+ }
68
+ if (shouldRewriteSource && segmentMatch) {
69
+ const sourceNode = nodePath.node.source;
70
+ if (typeof sourceNode.start !== "number" || typeof sourceNode.end !== "number") return;
71
+ const quote = source[sourceNode.start] ?? "'";
72
+ edits.push({
73
+ start: sourceNode.start,
74
+ end: sourceNode.end,
75
+ value: `${quote}#uds/components/${segmentMatch[1]}${quote}`
76
+ });
335
77
  }
336
- nodePath.node.specifiers = nextSpecifiers;
337
78
  } });
338
- if (!transformed) return source;
339
- const sourceDir = path.dirname(resourcePath || projectRoot);
340
- for (const [componentName, importPath] of importsToAdd) {
341
- const absoluteImport = path.resolve(projectRoot, importPath);
342
- let resolvedPath = path.relative(sourceDir, absoluteImport);
343
- if (!resolvedPath.startsWith(".")) resolvedPath = `./${resolvedPath}`;
344
- ast.program.body.unshift(t.importDeclaration([t.importSpecifier(t.identifier(componentName), t.identifier(componentName))], t.stringLiteral(resolvedPath)));
345
- }
346
- const motionImportSpecifiers = [];
347
- if (needsMotionImport && !hasMotionImport) motionImportSpecifiers.push(t.importSpecifier(t.identifier("motion"), t.identifier("motion")));
348
- if (needsAnimatePresenceImport && !hasAnimatePresenceImport) motionImportSpecifiers.push(t.importSpecifier(t.identifier("AnimatePresence"), t.identifier("AnimatePresence")));
349
- if (motionImportSpecifiers.length > 0) ast.program.body.unshift(t.importDeclaration(motionImportSpecifiers, t.stringLiteral("motion/react")));
350
- if (needsProcessStylePropsImport) {
351
- if (!ast.program.body.some((node) => t.isImportDeclaration(node) && node.specifiers.some((s) => t.isImportSpecifier(s) && (t.isIdentifier(s.imported) && s.imported.name === "processStyleProps" || t.isStringLiteral(s.imported) && s.imported.value === "processStyleProps")))) ast.program.body.unshift(t.importDeclaration([t.importSpecifier(t.identifier("processStyleProps"), t.identifier("processStyleProps"))], t.stringLiteral("@uds/core")));
352
- }
353
- if (needsResolveMotionStateImport) ast.program.body.unshift(t.importDeclaration([t.importSpecifier(t.identifier("__rms"), t.identifier("resolveMotionState"))], t.stringLiteral("@uds/core")));
354
- const motionStatesMap = getHoistedMotionStates();
355
- if (motionStatesMap.size > 0) for (const [varName, statesConfig] of motionStatesMap) ast.program.body.unshift(t.variableDeclaration("const", [t.variableDeclarator(t.identifier(varName), t.valueToNode(statesConfig))]));
356
- if (hoistedVariantClassMaps.size > 0) {
357
- const declarations = [];
358
- for (const [lookupName, classMap] of hoistedVariantClassMaps) declarations.push(t.variableDeclaration("const", [t.variableDeclarator(t.identifier(lookupName), t.objectExpression(Object.entries(classMap).map(([variantName, className]) => t.objectProperty(t.stringLiteral(variantName), t.stringLiteral(className)))))]));
359
- const firstNonImportIndex = ast.program.body.findIndex((node) => node.type !== "ImportDeclaration");
360
- if (firstNonImportIndex === -1) ast.program.body.push(...declarations);
361
- else ast.program.body.splice(firstNonImportIndex, 0, ...declarations);
362
- }
363
- return generate(ast, {
364
- retainLines: true,
365
- sourceMaps: false
366
- }).code;
79
+ if (edits.length === 0) return source;
80
+ edits.sort((a, b) => b.start - a.start);
81
+ let output = source;
82
+ for (const edit of edits) output = output.slice(0, edit.start) + edit.value + output.slice(edit.end);
83
+ return output;
367
84
  };
368
85
  const normal = transformLoader;
369
86
  //#endregion
@@ -1,6 +1,7 @@
1
1
  import { NextConfig } from "next";
2
2
 
3
3
  //#region ../loader/dist/next.d.ts
4
+ //#region src/next.d.ts
4
5
  interface WithUdsOptions {
5
6
  /** Output directory for generated files (default: '.uds') */
6
7
  outputDir?: string;
@@ -11,6 +12,6 @@ interface WithUdsOptions {
11
12
  type NextConfigFn = (phase: string, ctx: {
12
13
  defaultConfig: NextConfig;
13
14
  }) => NextConfig | Promise<NextConfig>;
14
- declare function withUds(nextConfigOrFn: NextConfig | NextConfigFn, options?: WithUdsOptions): NextConfig | NextConfigFn;
15
+ declare function withUds(nextConfigOrFn: NextConfig | NextConfigFn, options?: WithUdsOptions): NextConfig | NextConfigFn; //#endregion
15
16
  //#endregion
16
17
  export { WithUdsOptions, withUds };
@@ -7,14 +7,14 @@ function resolveLoaderPath() {
7
7
  function applyUds(nextConfig, options) {
8
8
  const outputDir = options?.outputDir ?? ".uds";
9
9
  const skipWatch = options?.skipWatchDependencies ?? false;
10
- const manifestPath = path.resolve(process.cwd(), outputDir, "meta-loader.json");
10
+ const dataPath = path.resolve(process.cwd(), outputDir, "config.json");
11
11
  const loaderPath = resolveLoaderPath();
12
12
  const turbopack = nextConfig.turbopack ?? {};
13
13
  const existingRules = turbopack.rules ?? {};
14
14
  const udsLoader = {
15
15
  loader: loaderPath,
16
16
  options: {
17
- manifestPath,
17
+ dataPath,
18
18
  isDev: true,
19
19
  skipWatchDependencies: skipWatch
20
20
  }
@@ -45,7 +45,7 @@ function applyUds(nextConfig, options) {
45
45
  use: [{
46
46
  loader: loaderPath,
47
47
  options: {
48
- manifestPath,
48
+ dataPath,
49
49
  isDev: webpackOptions.dev,
50
50
  skipWatchDependencies: skipWatch
51
51
  }