@yahoo/uds 3.117.0 → 3.117.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/dist/automated-config/dist/utils/getConfigVariantComponentStatesMatrix.cjs +2 -3
  2. package/dist/automated-config/dist/utils/getConfigVariantProperties.cjs +2 -3
  3. package/dist/automated-config/dist/utils/getConfigVariants.cjs +2 -3
  4. package/dist/automated-config/dist/utils/index.cjs +3 -6
  5. package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
  6. package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
  7. package/dist/styles/styler.d.cts +53 -53
  8. package/dist/styles/styler.d.ts +53 -53
  9. package/dist/tailwind/dist/_virtual/_rolldown/runtime.cjs +27 -8
  10. package/dist/tailwind/dist/_virtual/_rolldown/runtime.js +3 -6
  11. package/dist/tailwind/dist/cli.cjs +11 -0
  12. package/dist/tailwind/dist/cli.d.cts +6 -0
  13. package/dist/tailwind/dist/cli.d.ts +6 -0
  14. package/dist/tailwind/dist/cli.js +7 -0
  15. package/dist/tailwind/dist/commands/css.cjs +36 -37
  16. package/dist/tailwind/dist/commands/css.d.cts +14 -0
  17. package/dist/tailwind/dist/commands/css.d.cts.map +1 -0
  18. package/dist/tailwind/dist/commands/css.d.ts +14 -0
  19. package/dist/tailwind/dist/commands/css.d.ts.map +1 -0
  20. package/dist/tailwind/dist/commands/css.helpers.cjs +2 -3
  21. package/dist/tailwind/dist/commands/css.helpers.js +3 -3
  22. package/dist/tailwind/dist/commands/css.helpers.js.map +1 -0
  23. package/dist/tailwind/dist/commands/css.js +5 -6
  24. package/dist/tailwind/dist/commands/css.js.map +1 -0
  25. package/dist/tailwind/dist/commands/generateComponentData.cjs +13 -14
  26. package/dist/tailwind/dist/commands/generateComponentData.d.cts +24 -0
  27. package/dist/tailwind/dist/commands/generateComponentData.d.cts.map +1 -0
  28. package/dist/tailwind/dist/commands/generateComponentData.d.ts +22 -1
  29. package/dist/tailwind/dist/commands/generateComponentData.d.ts.map +1 -0
  30. package/dist/tailwind/dist/commands/generateComponentData.js +6 -6
  31. package/dist/tailwind/dist/commands/generateComponentData.js.map +1 -0
  32. package/dist/tailwind/dist/commands/generatePurgeCSSData.cjs +5 -7
  33. package/dist/tailwind/dist/commands/generatePurgeCSSData.d.cts +15 -0
  34. package/dist/tailwind/dist/commands/generatePurgeCSSData.d.cts.map +1 -0
  35. package/dist/tailwind/dist/commands/generatePurgeCSSData.d.ts +15 -0
  36. package/dist/tailwind/dist/commands/generatePurgeCSSData.d.ts.map +1 -0
  37. package/dist/tailwind/dist/commands/generatePurgeCSSData.js +5 -6
  38. package/dist/tailwind/dist/commands/generatePurgeCSSData.js.map +1 -0
  39. package/dist/tailwind/dist/commands/purge.cjs +15 -16
  40. package/dist/tailwind/dist/commands/purge.d.cts +17 -0
  41. package/dist/tailwind/dist/commands/purge.d.cts.map +1 -0
  42. package/dist/tailwind/dist/commands/purge.d.ts +17 -0
  43. package/dist/tailwind/dist/commands/purge.d.ts.map +1 -0
  44. package/dist/tailwind/dist/commands/purge.js +5 -6
  45. package/dist/tailwind/dist/commands/purge.js.map +1 -0
  46. package/dist/tailwind/dist/css/generate.cjs +13 -16
  47. package/dist/tailwind/dist/css/generate.d.cts +3 -4
  48. package/dist/tailwind/dist/css/generate.d.cts.map +1 -0
  49. package/dist/tailwind/dist/css/generate.d.ts +3 -4
  50. package/dist/tailwind/dist/css/generate.d.ts.map +1 -0
  51. package/dist/tailwind/dist/css/generate.helpers.cjs +6 -6
  52. package/dist/tailwind/dist/css/generate.helpers.js +7 -6
  53. package/dist/tailwind/dist/css/generate.helpers.js.map +1 -0
  54. package/dist/tailwind/dist/css/generate.js +7 -9
  55. package/dist/tailwind/dist/css/generate.js.map +1 -0
  56. package/dist/tailwind/dist/css/nodeUtils.cjs +14 -16
  57. package/dist/tailwind/dist/css/nodeUtils.js +6 -7
  58. package/dist/tailwind/dist/css/nodeUtils.js.map +1 -0
  59. package/dist/tailwind/dist/css/postcss.cjs +2 -3
  60. package/dist/tailwind/dist/css/postcss.helpers.cjs +2 -3
  61. package/dist/tailwind/dist/css/postcss.helpers.js +3 -3
  62. package/dist/tailwind/dist/css/postcss.helpers.js.map +1 -0
  63. package/dist/tailwind/dist/css/postcss.js +4 -4
  64. package/dist/tailwind/dist/css/postcss.js.map +1 -0
  65. package/dist/tailwind/dist/css/runner.cjs +40 -35
  66. package/dist/tailwind/dist/css/runner.helpers.cjs +3 -4
  67. package/dist/tailwind/dist/css/runner.helpers.js +4 -4
  68. package/dist/tailwind/dist/css/runner.helpers.js.map +1 -0
  69. package/dist/tailwind/dist/css/runner.js +17 -11
  70. package/dist/tailwind/dist/css/runner.js.map +1 -0
  71. package/dist/tailwind/dist/css/theme.cjs +2 -3
  72. package/dist/tailwind/dist/css/theme.d.cts +13 -5
  73. package/dist/tailwind/dist/css/theme.d.cts.map +1 -0
  74. package/dist/tailwind/dist/css/theme.d.ts +13 -5
  75. package/dist/tailwind/dist/css/theme.d.ts.map +1 -0
  76. package/dist/tailwind/dist/css/theme.js +3 -3
  77. package/dist/tailwind/dist/css/theme.js.map +1 -0
  78. package/dist/tailwind/dist/css/utils.cjs +5 -5
  79. package/dist/tailwind/dist/css/utils.js +5 -5
  80. package/dist/tailwind/dist/css/utils.js.map +1 -0
  81. package/dist/tailwind/dist/index.cjs +9 -0
  82. package/dist/tailwind/dist/index.d.cts +3 -2
  83. package/dist/tailwind/dist/index.d.ts +3 -2
  84. package/dist/tailwind/dist/index.js +6 -0
  85. package/dist/tailwind/dist/plugin.cjs +7 -6
  86. package/dist/tailwind/dist/plugin.d.cts +3 -3
  87. package/dist/tailwind/dist/plugin.d.cts.map +1 -0
  88. package/dist/tailwind/dist/plugin.d.ts +3 -3
  89. package/dist/tailwind/dist/plugin.d.ts.map +1 -0
  90. package/dist/tailwind/dist/plugin.js +4 -4
  91. package/dist/tailwind/dist/plugin.js.map +1 -0
  92. package/dist/tailwind/dist/purger/legacy/index.d.ts +2 -0
  93. package/dist/tailwind/dist/purger/legacy/purgeCSS.cjs +25 -24
  94. package/dist/tailwind/dist/purger/legacy/purgeCSS.d.cts +24 -0
  95. package/dist/tailwind/dist/purger/legacy/purgeCSS.d.cts.map +1 -0
  96. package/dist/tailwind/dist/purger/legacy/purgeCSS.d.ts +24 -0
  97. package/dist/tailwind/dist/purger/legacy/purgeCSS.d.ts.map +1 -0
  98. package/dist/tailwind/dist/purger/legacy/purgeCSS.js +8 -9
  99. package/dist/tailwind/dist/purger/legacy/purgeCSS.js.map +1 -0
  100. package/dist/tailwind/dist/purger/legacy/purgeFromCode.cjs +59 -0
  101. package/dist/tailwind/dist/purger/legacy/purgeFromCode.d.cts +28 -0
  102. package/dist/tailwind/dist/purger/legacy/purgeFromCode.d.cts.map +1 -0
  103. package/dist/tailwind/dist/purger/legacy/purgeFromCode.d.ts +28 -0
  104. package/dist/tailwind/dist/purger/legacy/purgeFromCode.d.ts.map +1 -0
  105. package/dist/tailwind/dist/purger/legacy/purgeFromCode.js +59 -0
  106. package/dist/tailwind/dist/purger/legacy/purgeFromCode.js.map +1 -0
  107. package/dist/tailwind/dist/purger/optimized/ast/expressions.cjs +5 -6
  108. package/dist/tailwind/dist/purger/optimized/ast/expressions.d.ts +2 -0
  109. package/dist/tailwind/dist/purger/optimized/ast/expressions.js +5 -5
  110. package/dist/tailwind/dist/purger/optimized/ast/expressions.js.map +1 -0
  111. package/dist/tailwind/dist/purger/optimized/ast/index.d.ts +5 -0
  112. package/dist/tailwind/dist/purger/optimized/ast/jsx.cjs +3 -4
  113. package/dist/tailwind/dist/purger/optimized/ast/jsx.d.ts +3 -0
  114. package/dist/tailwind/dist/purger/optimized/ast/jsx.js +4 -4
  115. package/dist/tailwind/dist/purger/optimized/ast/jsx.js.map +1 -0
  116. package/dist/tailwind/dist/purger/optimized/ast/props.d.ts +2 -0
  117. package/dist/tailwind/dist/purger/optimized/ast/spread.d.ts +3 -0
  118. package/dist/tailwind/dist/purger/optimized/index.d.ts +6 -0
  119. package/dist/tailwind/dist/purger/optimized/purge.cjs +5 -6
  120. package/dist/tailwind/dist/purger/optimized/purge.d.ts +2 -0
  121. package/dist/tailwind/dist/purger/optimized/purge.js +5 -5
  122. package/dist/tailwind/dist/purger/optimized/purge.js.map +1 -0
  123. package/dist/tailwind/dist/purger/optimized/purgeFromCode.cjs +3 -4
  124. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.cts +58 -0
  125. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.cts.map +1 -0
  126. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.ts +58 -0
  127. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.ts.map +1 -0
  128. package/dist/tailwind/dist/purger/optimized/purgeFromCode.js +4 -4
  129. package/dist/tailwind/dist/purger/optimized/purgeFromCode.js.map +1 -0
  130. package/dist/tailwind/dist/purger/optimized/types.d.cts +22 -0
  131. package/dist/tailwind/dist/purger/optimized/types.d.cts.map +1 -0
  132. package/dist/tailwind/dist/purger/optimized/types.d.ts +23 -0
  133. package/dist/tailwind/dist/purger/optimized/types.d.ts.map +1 -0
  134. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.cjs +8 -9
  135. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js +7 -7
  136. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js.map +1 -0
  137. package/dist/tailwind/dist/purger/optimized/utils/files.cjs +3 -4
  138. package/dist/tailwind/dist/purger/optimized/utils/files.d.ts +2 -0
  139. package/dist/tailwind/dist/purger/optimized/utils/files.js +4 -4
  140. package/dist/tailwind/dist/purger/optimized/utils/files.js.map +1 -0
  141. package/dist/tailwind/dist/purger/optimized/utils/safelist.cjs +7 -8
  142. package/dist/tailwind/dist/purger/optimized/utils/safelist.js +6 -6
  143. package/dist/tailwind/dist/purger/optimized/utils/safelist.js.map +1 -0
  144. package/dist/tailwind/dist/purger.cjs +7 -0
  145. package/dist/tailwind/dist/purger.d.cts +4 -0
  146. package/dist/tailwind/dist/purger.d.ts +6 -0
  147. package/dist/tailwind/dist/purger.js +5 -0
  148. package/dist/tailwind/dist/tailwind/base/addColorModeVars.cjs +10 -10
  149. package/dist/tailwind/dist/tailwind/base/addColorModeVars.js +6 -6
  150. package/dist/tailwind/dist/tailwind/base/addColorModeVars.js.map +1 -0
  151. package/dist/tailwind/dist/tailwind/base/addColorModeVarsV2.cjs +14 -14
  152. package/dist/tailwind/dist/tailwind/base/addColorModeVarsV2.js +6 -6
  153. package/dist/tailwind/dist/tailwind/base/addColorModeVarsV2.js.map +1 -0
  154. package/dist/tailwind/dist/tailwind/base/addFontFaceDeclarations.cjs +2 -3
  155. package/dist/tailwind/dist/tailwind/base/addFontFaceDeclarations.js +4 -4
  156. package/dist/tailwind/dist/tailwind/base/addFontFaceDeclarations.js.map +1 -0
  157. package/dist/tailwind/dist/tailwind/base/addFontVars.cjs +2 -3
  158. package/dist/tailwind/dist/tailwind/base/addFontVars.js +4 -4
  159. package/dist/tailwind/dist/tailwind/base/addFontVars.js.map +1 -0
  160. package/dist/tailwind/dist/tailwind/base/addMotionVars.cjs +2 -3
  161. package/dist/tailwind/dist/tailwind/base/addMotionVars.js +4 -4
  162. package/dist/tailwind/dist/tailwind/base/addMotionVars.js.map +1 -0
  163. package/dist/tailwind/dist/tailwind/base/addScaleModeVars.cjs +13 -13
  164. package/dist/tailwind/dist/tailwind/base/addScaleModeVars.js +6 -6
  165. package/dist/tailwind/dist/tailwind/base/addScaleModeVars.js.map +1 -0
  166. package/dist/tailwind/dist/tailwind/components/getFocusRingStyles.cjs +6 -6
  167. package/dist/tailwind/dist/tailwind/components/getFocusRingStyles.js +5 -5
  168. package/dist/tailwind/dist/tailwind/components/getFocusRingStyles.js.map +1 -0
  169. package/dist/tailwind/dist/tailwind/components/getGroupedTextStyles.cjs +12 -12
  170. package/dist/tailwind/dist/tailwind/components/getGroupedTextStyles.js +6 -6
  171. package/dist/tailwind/dist/tailwind/components/getGroupedTextStyles.js.map +1 -0
  172. package/dist/tailwind/dist/tailwind/components/getHitTargetStyles.cjs +2 -3
  173. package/dist/tailwind/dist/tailwind/components/getHitTargetStyles.js +3 -3
  174. package/dist/tailwind/dist/tailwind/components/getHitTargetStyles.js.map +1 -0
  175. package/dist/tailwind/dist/tailwind/components/getIconStyles.cjs +2 -3
  176. package/dist/tailwind/dist/tailwind/components/getIconStyles.js +3 -3
  177. package/dist/tailwind/dist/tailwind/components/getIconStyles.js.map +1 -0
  178. package/dist/tailwind/dist/tailwind/components/getInputStyles.cjs +2 -3
  179. package/dist/tailwind/dist/tailwind/components/getInputStyles.d.cts +3 -3
  180. package/dist/tailwind/dist/tailwind/components/getInputStyles.d.cts.map +1 -0
  181. package/dist/tailwind/dist/tailwind/components/getInputStyles.d.ts +3 -3
  182. package/dist/tailwind/dist/tailwind/components/getInputStyles.d.ts.map +1 -0
  183. package/dist/tailwind/dist/tailwind/components/getInputStyles.js +3 -3
  184. package/dist/tailwind/dist/tailwind/components/getInputStyles.js.map +1 -0
  185. package/dist/tailwind/dist/tailwind/components/getResponsiveTextStyles.cjs +29 -29
  186. package/dist/tailwind/dist/tailwind/components/getResponsiveTextStyles.d.cts +6 -4
  187. package/dist/tailwind/dist/tailwind/components/getResponsiveTextStyles.d.cts.map +1 -0
  188. package/dist/tailwind/dist/tailwind/components/getResponsiveTextStyles.d.ts +6 -4
  189. package/dist/tailwind/dist/tailwind/components/getResponsiveTextStyles.d.ts.map +1 -0
  190. package/dist/tailwind/dist/tailwind/components/getResponsiveTextStyles.js +8 -8
  191. package/dist/tailwind/dist/tailwind/components/getResponsiveTextStyles.js.map +1 -0
  192. package/dist/tailwind/dist/tailwind/components/types.d.cts +3 -3
  193. package/dist/tailwind/dist/tailwind/components/types.d.cts.map +1 -0
  194. package/dist/tailwind/dist/tailwind/components/types.d.ts +3 -3
  195. package/dist/tailwind/dist/tailwind/components/types.d.ts.map +1 -0
  196. package/dist/tailwind/dist/tailwind/defaultTailwindThemeAsUdsConfig.cjs +2 -3
  197. package/dist/tailwind/dist/tailwind/defaultTailwindThemeAsUdsConfig.d.cts +6 -6
  198. package/dist/tailwind/dist/tailwind/defaultTailwindThemeAsUdsConfig.d.cts.map +1 -0
  199. package/dist/tailwind/dist/tailwind/defaultTailwindThemeAsUdsConfig.d.ts +6 -6
  200. package/dist/tailwind/dist/tailwind/defaultTailwindThemeAsUdsConfig.d.ts.map +1 -0
  201. package/dist/tailwind/dist/tailwind/defaultTailwindThemeAsUdsConfig.js +3 -3
  202. package/dist/tailwind/dist/tailwind/defaultTailwindThemeAsUdsConfig.js.map +1 -0
  203. package/dist/tailwind/dist/tailwind/plugins/a11y.cjs +3 -4
  204. package/dist/tailwind/dist/tailwind/plugins/a11y.js +4 -4
  205. package/dist/tailwind/dist/tailwind/plugins/a11y.js.map +1 -0
  206. package/dist/tailwind/dist/tailwind/plugins/blurBgFallback.cjs +7 -8
  207. package/dist/tailwind/dist/tailwind/plugins/blurBgFallback.js +5 -5
  208. package/dist/tailwind/dist/tailwind/plugins/blurBgFallback.js.map +1 -0
  209. package/dist/tailwind/dist/tailwind/plugins/borderRadius.cjs +8 -9
  210. package/dist/tailwind/dist/tailwind/plugins/borderRadius.js +7 -7
  211. package/dist/tailwind/dist/tailwind/plugins/borderRadius.js.map +1 -0
  212. package/dist/tailwind/dist/tailwind/plugins/borderWidth.cjs +8 -9
  213. package/dist/tailwind/dist/tailwind/plugins/borderWidth.js +7 -7
  214. package/dist/tailwind/dist/tailwind/plugins/borderWidth.js.map +1 -0
  215. package/dist/tailwind/dist/tailwind/plugins/breakpoints.cjs +3 -4
  216. package/dist/tailwind/dist/tailwind/plugins/breakpoints.js +4 -4
  217. package/dist/tailwind/dist/tailwind/plugins/breakpoints.js.map +1 -0
  218. package/dist/tailwind/dist/tailwind/plugins/colors.cjs +17 -17
  219. package/dist/tailwind/dist/tailwind/plugins/colors.js +9 -9
  220. package/dist/tailwind/dist/tailwind/plugins/colors.js.map +1 -0
  221. package/dist/tailwind/dist/tailwind/plugins/components.cjs +25 -26
  222. package/dist/tailwind/dist/tailwind/plugins/components.js +7 -7
  223. package/dist/tailwind/dist/tailwind/plugins/components.js.map +1 -0
  224. package/dist/tailwind/dist/tailwind/plugins/elevation.cjs +7 -8
  225. package/dist/tailwind/dist/tailwind/plugins/elevation.js +6 -6
  226. package/dist/tailwind/dist/tailwind/plugins/elevation.js.map +1 -0
  227. package/dist/tailwind/dist/tailwind/plugins/getTailwindAsUdsColors.cjs +5 -5
  228. package/dist/tailwind/dist/tailwind/plugins/getTailwindAsUdsColors.js +5 -5
  229. package/dist/tailwind/dist/tailwind/plugins/getTailwindAsUdsColors.js.map +1 -0
  230. package/dist/tailwind/dist/tailwind/plugins/icons.cjs +3 -4
  231. package/dist/tailwind/dist/tailwind/plugins/icons.js +4 -4
  232. package/dist/tailwind/dist/tailwind/plugins/icons.js.map +1 -0
  233. package/dist/tailwind/dist/tailwind/plugins/input.cjs +3 -4
  234. package/dist/tailwind/dist/tailwind/plugins/input.js +4 -4
  235. package/dist/tailwind/dist/tailwind/plugins/input.js.map +1 -0
  236. package/dist/tailwind/dist/tailwind/plugins/motion.cjs +3 -4
  237. package/dist/tailwind/dist/tailwind/plugins/motion.js +4 -4
  238. package/dist/tailwind/dist/tailwind/plugins/motion.js.map +1 -0
  239. package/dist/tailwind/dist/tailwind/plugins/nestedBorderRadius.cjs +3 -4
  240. package/dist/tailwind/dist/tailwind/plugins/nestedBorderRadius.js +4 -4
  241. package/dist/tailwind/dist/tailwind/plugins/nestedBorderRadius.js.map +1 -0
  242. package/dist/tailwind/dist/tailwind/plugins/scaleMode.cjs +3 -4
  243. package/dist/tailwind/dist/tailwind/plugins/scaleMode.js +4 -4
  244. package/dist/tailwind/dist/tailwind/plugins/scaleMode.js.map +1 -0
  245. package/dist/tailwind/dist/tailwind/plugins/shadows.cjs +8 -9
  246. package/dist/tailwind/dist/tailwind/plugins/shadows.js +5 -5
  247. package/dist/tailwind/dist/tailwind/plugins/shadows.js.map +1 -0
  248. package/dist/tailwind/dist/tailwind/plugins/sizing.cjs +5 -6
  249. package/dist/tailwind/dist/tailwind/plugins/sizing.js +5 -5
  250. package/dist/tailwind/dist/tailwind/plugins/sizing.js.map +1 -0
  251. package/dist/tailwind/dist/tailwind/plugins/spacing.cjs +3 -4
  252. package/dist/tailwind/dist/tailwind/plugins/spacing.js +4 -4
  253. package/dist/tailwind/dist/tailwind/plugins/spacing.js.map +1 -0
  254. package/dist/tailwind/dist/tailwind/plugins/typography.cjs +10 -11
  255. package/dist/tailwind/dist/tailwind/plugins/typography.js +7 -7
  256. package/dist/tailwind/dist/tailwind/plugins/typography.js.map +1 -0
  257. package/dist/tailwind/dist/tailwind/theme/getFontFamilyTheme.cjs +9 -9
  258. package/dist/tailwind/dist/tailwind/theme/getFontFamilyTheme.js +6 -6
  259. package/dist/tailwind/dist/tailwind/theme/getFontFamilyTheme.js.map +1 -0
  260. package/dist/tailwind/dist/tailwind/utils/addFontsPlugin.cjs +3 -4
  261. package/dist/tailwind/dist/tailwind/utils/addFontsPlugin.d.cts +4 -4
  262. package/dist/tailwind/dist/tailwind/utils/addFontsPlugin.d.cts.map +1 -0
  263. package/dist/tailwind/dist/tailwind/utils/addFontsPlugin.d.ts +4 -4
  264. package/dist/tailwind/dist/tailwind/utils/addFontsPlugin.d.ts.map +1 -0
  265. package/dist/tailwind/dist/tailwind/utils/addFontsPlugin.js +4 -4
  266. package/dist/tailwind/dist/tailwind/utils/addFontsPlugin.js.map +1 -0
  267. package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.cjs +15 -9
  268. package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.d.cts +4 -4
  269. package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.d.cts.map +1 -0
  270. package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.d.ts +5 -5
  271. package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.d.ts.map +1 -0
  272. package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.js +7 -7
  273. package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.js.map +1 -0
  274. package/dist/tailwind/dist/tailwind/utils/getColorModeStyles.cjs +2 -3
  275. package/dist/tailwind/dist/tailwind/utils/getColorModeStyles.d.cts +3 -3
  276. package/dist/tailwind/dist/tailwind/utils/getColorModeStyles.d.cts.map +1 -0
  277. package/dist/tailwind/dist/tailwind/utils/getColorModeStyles.d.ts +3 -3
  278. package/dist/tailwind/dist/tailwind/utils/getColorModeStyles.d.ts.map +1 -0
  279. package/dist/tailwind/dist/tailwind/utils/getColorModeStyles.js +3 -3
  280. package/dist/tailwind/dist/tailwind/utils/getColorModeStyles.js.map +1 -0
  281. package/dist/tailwind/dist/tailwind/utils/getElevationStyles.cjs +9 -9
  282. package/dist/tailwind/dist/tailwind/utils/getElevationStyles.d.cts +4 -4
  283. package/dist/tailwind/dist/tailwind/utils/getElevationStyles.d.cts.map +1 -0
  284. package/dist/tailwind/dist/tailwind/utils/getElevationStyles.d.ts +4 -4
  285. package/dist/tailwind/dist/tailwind/utils/getElevationStyles.d.ts.map +1 -0
  286. package/dist/tailwind/dist/tailwind/utils/getElevationStyles.js +5 -5
  287. package/dist/tailwind/dist/tailwind/utils/getElevationStyles.js.map +1 -0
  288. package/dist/tailwind/dist/tailwind/utils/getFontFaceDeclarations.cjs +5 -5
  289. package/dist/tailwind/dist/tailwind/utils/getFontFaceDeclarations.d.cts +4 -4
  290. package/dist/tailwind/dist/tailwind/utils/getFontFaceDeclarations.d.cts.map +1 -0
  291. package/dist/tailwind/dist/tailwind/utils/getFontFaceDeclarations.d.ts +4 -4
  292. package/dist/tailwind/dist/tailwind/utils/getFontFaceDeclarations.d.ts.map +1 -0
  293. package/dist/tailwind/dist/tailwind/utils/getFontFaceDeclarations.js +5 -5
  294. package/dist/tailwind/dist/tailwind/utils/getFontFaceDeclarations.js.map +1 -0
  295. package/dist/tailwind/dist/tailwind/utils/getFontStyles.cjs +7 -7
  296. package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.cts +4 -4
  297. package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.cts.map +1 -0
  298. package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.ts +4 -4
  299. package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.ts.map +1 -0
  300. package/dist/tailwind/dist/tailwind/utils/getFontStyles.js +6 -6
  301. package/dist/tailwind/dist/tailwind/utils/getFontStyles.js.map +1 -0
  302. package/dist/tailwind/dist/tailwind/utils/getMotionStyles.cjs +7 -7
  303. package/dist/tailwind/dist/tailwind/utils/getMotionStyles.d.cts +4 -4
  304. package/dist/tailwind/dist/tailwind/utils/getMotionStyles.d.cts.map +1 -0
  305. package/dist/tailwind/dist/tailwind/utils/getMotionStyles.d.ts +4 -4
  306. package/dist/tailwind/dist/tailwind/utils/getMotionStyles.d.ts.map +1 -0
  307. package/dist/tailwind/dist/tailwind/utils/getMotionStyles.js +6 -6
  308. package/dist/tailwind/dist/tailwind/utils/getMotionStyles.js.map +1 -0
  309. package/dist/tailwind/dist/tailwind/utils/getNestedBorderRadiusUtilities.cjs +2 -3
  310. package/dist/tailwind/dist/tailwind/utils/getNestedBorderRadiusUtilities.js +3 -3
  311. package/dist/tailwind/dist/tailwind/utils/getNestedBorderRadiusUtilities.js.map +1 -0
  312. package/dist/tailwind/dist/tailwind/utils/getScaleModeStyles.cjs +2 -3
  313. package/dist/tailwind/dist/tailwind/utils/getScaleModeStyles.d.cts +3 -3
  314. package/dist/tailwind/dist/tailwind/utils/getScaleModeStyles.d.cts.map +1 -0
  315. package/dist/tailwind/dist/tailwind/utils/getScaleModeStyles.d.ts +3 -3
  316. package/dist/tailwind/dist/tailwind/utils/getScaleModeStyles.d.ts.map +1 -0
  317. package/dist/tailwind/dist/tailwind/utils/getScaleModeStyles.js +3 -3
  318. package/dist/tailwind/dist/tailwind/utils/getScaleModeStyles.js.map +1 -0
  319. package/dist/tailwind/dist/tailwind/utils/getShadowPresetValues.cjs +5 -5
  320. package/dist/tailwind/dist/tailwind/utils/getShadowPresetValues.d.cts +5 -5
  321. package/dist/tailwind/dist/tailwind/utils/getShadowPresetValues.d.cts.map +1 -0
  322. package/dist/tailwind/dist/tailwind/utils/getShadowPresetValues.d.ts +5 -5
  323. package/dist/tailwind/dist/tailwind/utils/getShadowPresetValues.d.ts.map +1 -0
  324. package/dist/tailwind/dist/tailwind/utils/getShadowPresetValues.js +5 -5
  325. package/dist/tailwind/dist/tailwind/utils/getShadowPresetValues.js.map +1 -0
  326. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.cjs +6 -6
  327. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.cts +5 -5
  328. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.cts.map +1 -0
  329. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.ts +5 -5
  330. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.ts.map +1 -0
  331. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.js +5 -5
  332. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.js.map +1 -0
  333. package/dist/tailwind/dist/utils/assertUnreachable.cjs +2 -3
  334. package/dist/tailwind/dist/utils/assertUnreachable.js +3 -3
  335. package/dist/tailwind/dist/utils/assertUnreachable.js.map +1 -0
  336. package/dist/tailwind/dist/utils/entries.cjs +2 -3
  337. package/dist/tailwind/dist/utils/entries.js +3 -3
  338. package/dist/tailwind/dist/utils/entries.js.map +1 -0
  339. package/dist/tailwind/dist/utils/entryPoints.cjs +5 -6
  340. package/dist/tailwind/dist/utils/entryPoints.js +5 -5
  341. package/dist/tailwind/dist/utils/entryPoints.js.map +1 -0
  342. package/dist/tailwind/dist/utils/fromEntries.cjs +2 -3
  343. package/dist/tailwind/dist/utils/fromEntries.js +3 -3
  344. package/dist/tailwind/dist/utils/fromEntries.js.map +1 -0
  345. package/dist/tailwind/dist/utils/generatePurgeCSSData.cjs +11 -13
  346. package/dist/tailwind/dist/utils/generatePurgeCSSData.js +7 -8
  347. package/dist/tailwind/dist/utils/generatePurgeCSSData.js.map +1 -0
  348. package/dist/tailwind/dist/utils/mapValues.cjs +2 -3
  349. package/dist/tailwind/dist/utils/mapValues.js +3 -3
  350. package/dist/tailwind/dist/utils/mapValues.js.map +1 -0
  351. package/dist/tailwind/dist/utils/opacity.cjs +6 -6
  352. package/dist/tailwind/dist/utils/opacity.js +4 -4
  353. package/dist/tailwind/dist/utils/opacity.js.map +1 -0
  354. package/dist/tailwind/dist/utils/optimizeCSS.cjs +3 -4
  355. package/dist/tailwind/dist/utils/optimizeCSS.js +4 -4
  356. package/dist/tailwind/dist/utils/optimizeCSS.js.map +1 -0
  357. package/dist/tailwind/dist/utils/parseTokens.cjs +32 -32
  358. package/dist/tailwind/dist/utils/parseTokens.d.cts +5 -5
  359. package/dist/tailwind/dist/utils/parseTokens.d.cts.map +1 -0
  360. package/dist/tailwind/dist/utils/parseTokens.d.ts +5 -5
  361. package/dist/tailwind/dist/utils/parseTokens.d.ts.map +1 -0
  362. package/dist/tailwind/dist/utils/parseTokens.js +6 -6
  363. package/dist/tailwind/dist/utils/parseTokens.js.map +1 -0
  364. package/dist/tailwind/dist/utils/postcssPreserveVars.cjs +2 -3
  365. package/dist/tailwind/dist/utils/postcssPreserveVars.js +3 -3
  366. package/dist/tailwind/dist/utils/postcssPreserveVars.js.map +1 -0
  367. package/dist/tailwind/dist/utils/tsMorph.cjs +13 -11
  368. package/dist/tailwind/dist/utils/tsMorph.js +4 -4
  369. package/dist/tailwind/dist/utils/tsMorph.js.map +1 -0
  370. package/dist/tailwind/dist/utils.cjs +25 -0
  371. package/dist/tailwind/dist/utils.d.cts +2 -1
  372. package/dist/tailwind/dist/utils.d.ts +2 -1
  373. package/dist/tailwind/dist/utils.js +13 -0
  374. package/dist/uds/generated/componentData.cjs +145 -145
  375. package/dist/uds/generated/componentData.js +145 -145
  376. package/generated/componentData.json +209 -209
  377. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purgeFromCode.js","names":[],"sources":["../../../src/purger/optimized/purgeFromCode.ts"],"sourcesContent":["import type { ImportDeclaration } from 'ts-morph';\nimport { Node, Project, SyntaxKind, ts } from 'ts-morph';\n\nimport { extractStringLiterals, findJsxReferences } from './ast';\nimport type { JsxElementWithAttributes, PurgeStats } from './types';\n\ninterface PurgeFromCodeResult {\n safelist: string[];\n imports: string[];\n components: string[];\n stats: PurgeStats;\n}\n\n/**\n * Serialized component info from pre-generated data\n */\ninterface SerializedComponentInfo {\n name: string;\n defaultProps: Record<string, string>;\n getStylesLiterals: Record<string, string>;\n cxLiterals?: string[];\n internalComponents: string[];\n internalComponentProps: Record<string, Record<string, string[]>>;\n propToVariantKeys: Record<string, string[]>;\n}\n\n/**\n * Get component info with all its dependencies (using pre-generated data)\n */\nconst getComponentWithDeps = (componentName: string): SerializedComponentInfo[] => {\n const visited = new Set<string>();\n const result: SerializedComponentInfo[] = [];\n\n const collect = (name: string): void => {\n if (visited.has(name)) {\n return;\n }\n visited.add(name);\n\n const info = resolveComponentInfo(name);\n if (!info) {\n return;\n }\n\n result.push(info);\n\n // Recursively collect internal component dependencies\n info.internalComponents.forEach((depName) => collect(depName));\n };\n\n collect(componentName);\n return result;\n};\n\n/**\n * Optimized purge from code string.\n *\n * This is a standalone implementation that:\n * - Analyzes UDS component source files to get accurate default props\n * - Includes defaults from internally used components\n * - Only depends on variants from src/styles/variants.ts (source of truth)\n * - Uses ts-morph for AST analysis\n *\n * Key behaviors:\n * - Includes classes for component default props (analyzed from source)\n * - Includes defaults for internal component dependencies\n * - Includes classes for explicitly used prop values\n * - Resolves ternary/logical expressions to extract all possible values\n * - Traces spreads to const objects in the same file\n * - Does NOT fall back to type properties for unresolved spreads\n */\n/**\n * Variant defaults per component from consumer's config\n * e.g., { Button: { size: 'md', variant: 'primary' }, Avatar: { size: 'md' } }\n */\ntype VariantDefaults = Record<string, Record<string, string>>;\n\ninterface PurgeFromCodeOptions {\n colorModes?: ('dark' | 'light')[];\n /** Variant defaults from consumer's config - used to include default CSS when prop not specified */\n variantDefaults?: VariantDefaults;\n variants: Record<string, Record<string, string>>;\n autoVariants: Record<string, Record<string, string>>;\n componentData: Record<string, SerializedComponentInfo>;\n includeAllClassNamePrimitives?: boolean;\n filePath?: string;\n}\n\n/**\n * Auto-variants lookup (loaded at module init)\n */\nlet autoVariantsCache = null as unknown as Record<string, Record<string, string>>;\n\n/**\n * Pre-generated component data (loaded at module init)\n */\nlet componentCache = null as unknown as Record<string, SerializedComponentInfo>;\n\n/**\n * Map of normalized component name -> actual component cache key\n * Useful when internal components are imported without namespace separators\n * (e.g., MenuItemBase vs Menu.ItemBase).\n */\nlet componentNameLookup: Record<string, string> | null = null;\n\nconst buildComponentNameLookup = (\n data: Record<string, SerializedComponentInfo>,\n): Record<string, string> => {\n const lookup: Record<string, string> = {};\n\n Object.keys(data).forEach((key) => {\n const normalized = normalizeComponentName(key);\n // Keep the first match to avoid arbitrary overwrites on collisions\n if (!lookup[normalized]) {\n lookup[normalized] = key;\n }\n });\n\n return lookup;\n};\n\nconst resolveComponentInfo = (name: string): SerializedComponentInfo | undefined => {\n if (componentCache && componentCache[name]) {\n return componentCache[name];\n }\n\n const normalized = normalizeComponentName(name);\n const mappedName = componentNameLookup?.[normalized];\n if (mappedName && componentCache) {\n return componentCache[mappedName];\n }\n\n return undefined;\n};\n\nconst getModuleSpecifierValue = (importDecl: ImportDeclaration): string => {\n return (\n importDecl.getModuleSpecifierValue() ??\n importDecl\n .getModuleSpecifier()\n .getText()\n .replace(/^['\"]|['\"]$/g, '')\n );\n};\n\nconst isTypeOnlyNamedImport = (importDecl: ImportDeclaration, importName: string): boolean => {\n if (importDecl.isTypeOnly()) {\n return true;\n }\n\n return (\n importDecl\n .getNamedImports()\n .find((namedImport) => namedImport.getName() === importName)\n ?.isTypeOnly() ?? false\n );\n};\n\nconst isUdsComponentModule = (moduleSpecifier: string): boolean => {\n const cleaned = moduleSpecifier.replace(/^['\"]|['\"]$/g, '');\n return cleaned === '@yahoo/uds' || cleaned.startsWith('@yahoo/uds/');\n};\n\n/**\n * Normalize component name to match autoVariants keys (lower camel, no punctuation).\n */\nconst normalizeComponentName = (name: string): string => {\n const cleaned = name.replace(/\\W/g, '');\n return cleaned.charAt(0).toLowerCase() + cleaned.slice(1);\n};\n\n/**\n * Fallback: infer prop -> variant key mapping from autoVariants when the\n * generated component data misses it (e.g., helpers like buildAvatarRootClasses).\n */\nconst getAutoVariantKeysForProp = (componentName: string, propName: string): string[] => {\n if (!autoVariantsCache) {\n return [];\n }\n\n const segments = componentName.match(/[A-Z][a-z0-9]*/g) ?? [];\n const candidates = new Set<string>([normalizeComponentName(componentName)]);\n\n // Add progressively shorter prefixes (e.g., AvatarImage -> avatar, avatarimage)\n if (segments.length > 0) {\n Array.from({ length: segments.length }, (_, index) => index + 1).forEach((i) => {\n const partial = segments.slice(0, i).join('');\n candidates.add(normalizeComponentName(partial));\n });\n }\n\n const propLower = propName.toLowerCase();\n\n return Object.keys(autoVariantsCache).filter((key) => {\n const keyLower = key.toLowerCase();\n return Array.from(candidates).some(\n (candidate) => keyLower.startsWith(candidate) && keyLower.includes(propLower),\n );\n });\n};\n\nconst getVariantKeysForProp = (\n componentInfo: SerializedComponentInfo,\n propName: string,\n): string[] => {\n const keys = new Set(componentInfo.propToVariantKeys?.[propName] ?? []);\n\n getAutoVariantKeysForProp(componentInfo.name, propName).forEach((inferred) => keys.add(inferred));\n\n return [...keys];\n};\n\nconst extractClassNamePrimitives = (\n sourceFile: ReturnType<Project['createSourceFile']>,\n): string[] => {\n const classes: string[] = [];\n\n // JSX className attributes\n sourceFile.getDescendantsOfKind(SyntaxKind.JsxAttribute).forEach((attr) => {\n if (attr.getNameNode().getText() !== 'className') {\n return;\n }\n\n const initializer = attr.getInitializer();\n if (!initializer) {\n return;\n }\n\n const values: string[] = [];\n\n if (Node.isStringLiteral(initializer)) {\n values.push(initializer.getLiteralText());\n } else if (Node.isJsxExpression(initializer)) {\n const expr = initializer.getExpression();\n if (expr) {\n values.push(...extractStringLiterals(expr));\n }\n }\n\n values.forEach((raw) => {\n classes.push(...raw.split(/\\s+/).filter(Boolean));\n });\n });\n\n // Plain object property assignments like const props = { className: '...' }\n sourceFile.getDescendantsOfKind(SyntaxKind.PropertyAssignment).forEach((prop) => {\n if (prop.getName() !== 'className') {\n return;\n }\n\n const initializer = prop.getInitializer();\n if (!initializer) {\n return;\n }\n\n const rawValues = extractStringLiterals(initializer);\n rawValues.forEach((raw) => {\n classes.push(...raw.split(/\\s+/).filter(Boolean));\n });\n });\n\n return classes;\n};\n\nconst purgeFromCodeOptimized = async (\n code: string,\n options: PurgeFromCodeOptions,\n): Promise<PurgeFromCodeResult> => {\n const { variants, autoVariants, componentData } = options;\n\n if (!autoVariantsCache) {\n autoVariantsCache = autoVariants;\n }\n\n if (!componentCache) {\n componentCache = componentData;\n componentNameLookup = buildComponentNameLookup(componentData);\n }\n\n const startTime = performance.now();\n\n const project = new Project({ useInMemoryFileSystem: true });\n const sourceFile = project.createSourceFile(options.filePath ?? 'input.tsx', code, {\n overwrite: true,\n });\n\n const stats: PurgeStats = {\n filesScanned: 1,\n timeMs: 0,\n classesGenerated: 0,\n spreadsTraced: 0,\n expressionsResolved: 0,\n };\n\n // Parse UDS imports\n const imports: string[] = [];\n sourceFile.getImportDeclarations().forEach((importDecl) => {\n const moduleSpec = getModuleSpecifierValue(importDecl);\n if (isUdsComponentModule(moduleSpec)) {\n importDecl.getNamedImports().forEach((namedImport) => {\n if (!namedImport.isTypeOnly() && !importDecl.isTypeOnly()) {\n imports.push(namedImport.getName());\n }\n });\n }\n });\n\n // Track all resolved prop values per component\n const componentProps = new Map<string, Map<string, Set<string>>>();\n const referencedComponents = new Set<string>();\n\n // Extract props from getStyles() calls in user code\n const getStylesProps = extractGetStylesCalls(sourceFile, stats, variants);\n\n // Find all JSX elements that use UDS components\n imports.forEach((imp) => {\n const references = findComponentReferences(sourceFile, imp);\n\n references.forEach((reference) => {\n const tagName = reference.getTagNameNode().getText();\n const componentName = tagName || imp;\n\n referencedComponents.add(componentName);\n\n const propsMap = componentProps.get(componentName) ?? new Map<string, Set<string>>();\n const props = extractPropsFromReference(reference, stats, sourceFile);\n\n props.forEach(([propName, values]) => {\n if (values.length > 0) {\n const existing = propsMap.get(propName) ?? new Set();\n values.forEach((val) => existing.add(val));\n propsMap.set(propName, existing);\n }\n });\n\n componentProps.set(componentName, propsMap);\n });\n\n if (!componentProps.has(imp)) {\n componentProps.set(imp, new Map());\n }\n });\n\n // Collect all components (including dependencies)\n const allComponents: SerializedComponentInfo[] = [];\n const seenComponents = new Set<string>();\n\n const componentsToProcess = new Set<string>([...imports, ...referencedComponents]);\n\n componentsToProcess.forEach((componentName) => {\n const componentsWithDeps = getComponentWithDeps(componentName);\n componentsWithDeps.forEach((comp) => {\n if (!seenComponents.has(comp.name)) {\n seenComponents.add(comp.name);\n allComponents.push(comp);\n }\n });\n });\n\n // Generate safelist\n const safelist: string[] = [];\n\n // Add classes from getStyles() calls in user code\n [...getStylesProps.entries()].forEach(([propName, values]) => {\n const variantGroup = variants[propName as keyof typeof variants];\n if (variantGroup) {\n values.forEach((value) => {\n const cls = (variantGroup as Record<string, string>)[value];\n if (cls) {\n safelist.push(cls.replaceAll('\\\\', ''));\n }\n });\n }\n });\n\n // Add defaults from all components (including internal dependencies)\n allComponents.forEach((componentInfo) => {\n const userProps = componentProps.get(componentInfo.name) ?? new Map();\n\n // Add default classes (only for props not explicitly set by user)\n Object.entries(componentInfo.defaultProps).forEach(([propName, propValue]) => {\n // Skip if user set this prop explicitly\n if (userProps.has(propName)) {\n return;\n }\n\n // Try direct lookup first\n const variantGroup = variants[propName as keyof typeof variants];\n if (variantGroup) {\n const cls = (variantGroup as Record<string, string>)[propValue];\n if (cls) {\n safelist.push(cls.replaceAll('\\\\', ''));\n }\n }\n\n // Also check propToVariantKeys mapping (e.g., Text's variant -> fontFamily, fontSize, etc.)\n const variantKeys = getVariantKeysForProp(componentInfo, propName);\n if (variantKeys.length > 0) {\n variantKeys.forEach((variantKey) => {\n const mappedVariantGroup =\n variants[variantKey as keyof typeof variants] ?? autoVariantsCache[variantKey];\n if (mappedVariantGroup) {\n const cls = (mappedVariantGroup as Record<string, string>)[propValue];\n if (cls) {\n safelist.push(cls.replaceAll('\\\\', ''));\n }\n }\n });\n }\n });\n\n // Add hardcoded literals from getStyles() calls in component source\n Object.entries(componentInfo.getStylesLiterals).forEach(([propName, propValue]) => {\n // Strip indexed suffix (e.g., \"variantKey:1\" -> \"variantKey\")\n // This handles ternary expressions that generate multiple values per key\n const basePropName = propName.replace(/:\\d+$/, '');\n const variantGroup = variants[basePropName as keyof typeof variants];\n if (variantGroup) {\n const cls = (variantGroup as Record<string, string>)[propValue];\n if (cls) {\n safelist.push(cls.replaceAll('\\\\', ''));\n }\n }\n });\n\n // Add raw Tailwind classes from cx() calls in component source\n if (componentInfo.cxLiterals) {\n componentInfo.cxLiterals.forEach((cls) => safelist.push(cls));\n }\n\n // Add default-variant classes for props not explicitly set\n // The component uses \"uds-button-size-default-root\" at runtime when no size prop is specified\n // The CSS generator creates rules like: .uds-button-size-md-root, .uds-button-size-default-root { ... }\n // We need BOTH classes: the default (runtime) and the actual value (triggers CSS generation)\n if (componentInfo.propToVariantKeys) {\n // Get defaults from consumer config if provided\n const componentDefaults = options.variantDefaults?.[componentInfo.name] ?? {};\n\n Object.keys(componentInfo.propToVariantKeys).forEach((propName) => {\n // Skip if user set this prop explicitly\n if (userProps.has(propName)) {\n return;\n }\n\n // Get the default value from consumer's config\n const defaultValue = componentDefaults[propName];\n const variantKeys = getVariantKeysForProp(componentInfo, propName);\n\n variantKeys.forEach((variantKey) => {\n const variantGroup = autoVariantsCache[variantKey];\n if (variantGroup) {\n // Add the \"default\" class (used by component at runtime)\n if (variantGroup['default']) {\n safelist.push(variantGroup['default']);\n }\n // Add the actual value class (triggers CSS generation with the alias)\n if (defaultValue && variantGroup[defaultValue]) {\n safelist.push(variantGroup[defaultValue]);\n }\n }\n });\n });\n }\n\n // Add classes for props passed to internal components with literal values\n Object.entries(componentInfo.internalComponentProps).forEach(\n ([_internalCompName, propsRecord]) => {\n Object.entries(propsRecord).forEach(([propName, propValues]) => {\n if (propName === 'className') {\n propValues.forEach((propValue) => {\n propValue\n .split(/\\s+/)\n .filter(Boolean)\n .forEach((cls) => safelist.push(cls));\n });\n return;\n }\n\n const variantGroup = variants[propName as keyof typeof variants];\n if (variantGroup) {\n propValues.forEach((propValue) => {\n const cls = (variantGroup as Record<string, string>)[propValue];\n if (cls) {\n safelist.push(cls.replaceAll('\\\\', ''));\n }\n });\n }\n });\n },\n );\n\n // Add classes for explicitly used props\n [...userProps.entries()].forEach(([propName, usedValues]) => {\n if (propName === 'className') {\n [...usedValues].forEach((value) => {\n value\n .split(/\\s+/)\n .filter(Boolean)\n .forEach((cls: string) => safelist.push(cls));\n });\n return;\n }\n\n // First try direct lookup (for Box-style props like backgroundColor)\n const variantGroup = variants[propName as keyof typeof variants];\n if (variantGroup) {\n [...usedValues].forEach((value) => {\n const cls = (variantGroup as Record<string, string>)[value];\n if (cls) {\n safelist.push(cls.replaceAll('\\\\', ''));\n }\n });\n }\n\n // Check if this prop maps to variant keys in this component or its internal components\n // This handles cases like Avatar where size prop mapping is in internal AvatarIcon,\n // and Text where variant -> fontFamily, fontSize, fontWeight, lineHeight, etc.\n const componentsToCheck = [\n componentInfo,\n ...getComponentWithDeps(componentInfo.name).slice(1),\n ];\n componentsToCheck.forEach((comp) => {\n const variantKeys = getVariantKeysForProp(comp, propName);\n if (variantKeys.length > 0) {\n variantKeys.forEach((variantKey) => {\n const mappedVariantGroup = variants[variantKey as keyof typeof variants];\n if (mappedVariantGroup) {\n [...usedValues].forEach((value) => {\n const cls = (mappedVariantGroup as Record<string, string>)[value];\n if (cls) {\n safelist.push(cls.replaceAll('\\\\', ''));\n }\n });\n }\n });\n }\n });\n });\n });\n\n if (options.includeAllClassNamePrimitives) {\n safelist.push(...extractClassNamePrimitives(sourceFile));\n }\n\n // Deduplicate\n const finalSafelist = [...new Set(safelist)];\n\n stats.timeMs = Math.round(performance.now() - startTime);\n stats.classesGenerated = finalSafelist.length;\n\n return {\n safelist: finalSafelist,\n imports,\n components: [...seenComponents],\n stats,\n };\n};\n\n/**\n * Find JSX references for a component in the source file\n */\nconst findComponentReferences = (\n sourceFile: ReturnType<Project['createSourceFile']>,\n componentName: string,\n): JsxElementWithAttributes[] => {\n const references: JsxElementWithAttributes[] = [];\n const seenTags = new Set<string>();\n\n const collectMatchingTags = (localName: string): void => {\n sourceFile\n .getDescendants()\n .filter(\n (node): node is JsxElementWithAttributes =>\n Node.isJsxOpeningElement(node) || Node.isJsxSelfClosingElement(node),\n )\n .forEach((node) => {\n const tagName = node.getTagNameNode().getText();\n if (tagName === localName || tagName.startsWith(`${localName}.`)) {\n const key = `${tagName}:${node.getStart()}`;\n if (!seenTags.has(key)) {\n seenTags.add(key);\n references.push(node);\n }\n }\n });\n };\n\n sourceFile.getImportDeclarations().forEach((importDecl) => {\n const moduleSpec = getModuleSpecifierValue(importDecl);\n if (!isUdsComponentModule(moduleSpec)) {\n return;\n }\n\n importDecl.getNamedImports().forEach((namedImport) => {\n if (\n namedImport.getName() !== componentName ||\n isTypeOnlyNamedImport(importDecl, componentName)\n ) {\n return;\n }\n\n const localName = namedImport.getAliasNode()?.getText() ?? componentName;\n const identifier = namedImport.getFirstDescendantByKindOrThrow(ts.SyntaxKind.Identifier);\n\n findJsxReferences(identifier).forEach((reference) => {\n const key = `${reference.getTagNameNode().getText()}:${reference.getStart()}`;\n if (!seenTags.has(key)) {\n seenTags.add(key);\n references.push(reference);\n }\n });\n\n collectMatchingTags(localName);\n });\n });\n\n return references;\n};\n\n/**\n * Extract props from a JSX reference.\n */\nconst extractPropsFromReference = (\n reference: JsxElementWithAttributes,\n stats: PurgeStats,\n sourceFile: ReturnType<Project['createSourceFile']>,\n): Array<[string, string[]]> => {\n const props: Array<[string, string[]]> = [];\n const attributes = reference.getAttributes();\n\n attributes.forEach((attr) => {\n if (attr.asKind(SyntaxKind.JsxAttribute)) {\n const jsxAttr = attr.asKindOrThrow(SyntaxKind.JsxAttribute);\n const propName = jsxAttr.getNameNode().getText();\n const values: string[] = [];\n\n const initializer = jsxAttr.getInitializer();\n\n // Direct string literal: prop=\"value\"\n if (initializer && Node.isStringLiteral(initializer)) {\n values.push(initializer.getLiteralText());\n stats.expressionsResolved++;\n } else if (initializer && initializer.asKind(SyntaxKind.JsxExpression)) {\n // JSX expression: prop={expression}\n // Use extractStringLiterals to handle ternaries, nullish, OR, etc.\n const jsxExpr = initializer.asKindOrThrow(SyntaxKind.JsxExpression);\n const expression = jsxExpr.getExpression();\n if (expression) {\n const resolved = extractStringLiterals(expression);\n values.push(...resolved);\n if (resolved.length > 0) {\n stats.expressionsResolved++;\n }\n }\n }\n\n props.push([propName, values]);\n }\n\n if (attr.asKind(SyntaxKind.JsxSpreadAttribute)) {\n stats.spreadsTraced++;\n\n const spreadAttr = attr.asKindOrThrow(SyntaxKind.JsxSpreadAttribute);\n const expression = spreadAttr.getExpression();\n const spreadName = expression.getText();\n\n const resolvedSpreadProps = traceSpreadInFile(spreadName, sourceFile);\n\n resolvedSpreadProps.forEach(([propName, values]) => {\n if (values.length > 0) {\n props.push([propName, values]);\n }\n });\n }\n });\n\n return props;\n};\n\n/**\n * Trace spread props to their source within the same file.\n */\nconst traceSpreadInFile = (\n spreadName: string,\n sourceFile: ReturnType<Project['createSourceFile']>,\n): Array<[string, string[]]> => {\n const props: Array<[string, string[]]> = [];\n\n const varDecl = sourceFile.getVariableDeclaration(spreadName);\n if (!varDecl) {\n return props;\n }\n\n const initializer = varDecl.getInitializer();\n if (!initializer) {\n return props;\n }\n\n const objLiteral = initializer.asKind(SyntaxKind.ObjectLiteralExpression)\n ? initializer.asKindOrThrow(SyntaxKind.ObjectLiteralExpression)\n : initializer.asKind(SyntaxKind.AsExpression)\n ? initializer\n .asKindOrThrow(SyntaxKind.AsExpression)\n .getExpression()\n .asKind(SyntaxKind.ObjectLiteralExpression)\n ? initializer\n .asKindOrThrow(SyntaxKind.AsExpression)\n .getExpression()\n .asKindOrThrow(SyntaxKind.ObjectLiteralExpression)\n : null\n : null;\n\n if (!objLiteral) {\n return props;\n }\n\n objLiteral.getProperties().forEach((prop) => {\n if (prop.asKind(SyntaxKind.PropertyAssignment)) {\n const propAssign = prop.asKindOrThrow(SyntaxKind.PropertyAssignment);\n const propName = propAssign.getName();\n const propInit = propAssign.getInitializer();\n\n if (propInit) {\n const values = extractStringLiterals(propInit);\n if (values.length > 0) {\n props.push([propName, values]);\n }\n }\n }\n });\n\n return props;\n};\n\n/**\n * Extract props from getStyles() calls in user code.\n * This handles cases like:\n * const styles = getStyles({ backgroundColor: 'brand', spacing: '4' });\n */\nconst extractGetStylesCalls = (\n sourceFile: ReturnType<Project['createSourceFile']>,\n stats: PurgeStats,\n\n variants: Record<string, Record<string, string>>,\n): Map<string, Set<string>> => {\n const props = new Map<string, Set<string>>();\n\n const VALID_VARIANTS = new Set(Object.keys(variants));\n\n // Find all getStyles() call expressions\n const callExpressions = sourceFile.getDescendantsOfKind(SyntaxKind.CallExpression);\n\n callExpressions.forEach((call) => {\n const expression = call.getExpression();\n if (expression.getText() !== 'getStyles') {\n return;\n }\n\n const args = call.getArguments();\n if (args.length === 0) {\n return;\n }\n\n const firstArg = args[0];\n if (!firstArg.asKind(SyntaxKind.ObjectLiteralExpression)) {\n return;\n }\n\n const objLiteral = firstArg.asKindOrThrow(SyntaxKind.ObjectLiteralExpression);\n\n objLiteral.getProperties().forEach((prop) => {\n if (prop.asKind(SyntaxKind.PropertyAssignment)) {\n const propAssign = prop.asKindOrThrow(SyntaxKind.PropertyAssignment);\n const propName = propAssign.getName();\n const propInit = propAssign.getInitializer();\n\n if (propInit && VALID_VARIANTS.has(propName)) {\n const values = extractStringLiterals(propInit);\n if (values.length > 0) {\n const existing = props.get(propName) ?? new Set();\n values.forEach((v) => existing.add(v));\n props.set(propName, existing);\n stats.expressionsResolved++;\n }\n }\n } else if (prop.asKind(SyntaxKind.ShorthandPropertyAssignment)) {\n // Handle shorthand like { backgroundColor } where backgroundColor is a variable\n const shorthand = prop.asKindOrThrow(SyntaxKind.ShorthandPropertyAssignment);\n const propName = shorthand.getName();\n\n if (VALID_VARIANTS.has(propName)) {\n // Try to trace the variable\n const nameNode = shorthand.getNameNode();\n const values = extractStringLiterals(nameNode);\n if (values.length > 0) {\n const existing = props.get(propName) ?? new Set();\n values.forEach((v) => existing.add(v));\n props.set(propName, existing);\n stats.expressionsResolved++;\n }\n }\n }\n });\n });\n\n return props;\n};\n\nexport type { PurgeFromCodeOptions, PurgeFromCodeResult, VariantDefaults };\nexport { purgeFromCodeOptimized };\n"],"mappings":";;;;;;;;;AA6BA,MAAM,wBAAwB,kBAAqD;CACjF,MAAM,0BAAU,IAAI,KAAa;CACjC,MAAM,SAAoC,EAAE;CAE5C,MAAM,WAAW,SAAuB;AACtC,MAAI,QAAQ,IAAI,KAAK,CACnB;AAEF,UAAQ,IAAI,KAAK;EAEjB,MAAM,OAAO,qBAAqB,KAAK;AACvC,MAAI,CAAC,KACH;AAGF,SAAO,KAAK,KAAK;AAGjB,OAAK,mBAAmB,SAAS,YAAY,QAAQ,QAAQ,CAAC;;AAGhE,SAAQ,cAAc;AACtB,QAAO;;;;;AAwCT,IAAI,oBAAoB;;;;AAKxB,IAAI,iBAAiB;;;;;;AAOrB,IAAI,sBAAqD;AAEzD,MAAM,4BACJ,SAC2B;CAC3B,MAAM,SAAiC,EAAE;AAEzC,QAAO,KAAK,KAAK,CAAC,SAAS,QAAQ;EACjC,MAAM,aAAa,uBAAuB,IAAI;AAE9C,MAAI,CAAC,OAAO,YACV,QAAO,cAAc;GAEvB;AAEF,QAAO;;AAGT,MAAM,wBAAwB,SAAsD;AAClF,KAAI,kBAAkB,eAAe,MACnC,QAAO,eAAe;CAGxB,MAAM,aAAa,uBAAuB,KAAK;CAC/C,MAAM,aAAa,sBAAsB;AACzC,KAAI,cAAc,eAChB,QAAO,eA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W,eAAe,CAElE,SAAS,SAAS;AAEhC,MADmB,KAAK,eAAe,CACxB,SAAS,KAAK,YAC3B;EAGF,MAAM,OAAO,KAAK,cAAc;AAChC,MAAI,KAAK,WAAW,EAClB;EAGF,MAAM,WAAW,KAAK;AACtB,MAAI,CAAC,SAAS,OAAO,WAAW,wBAAwB,CACtD;AAKF,EAFmB,SAAS,cAAc,WAAW,wBAAwB,CAElE,eAAe,CAAC,SAAS,SAAS;AAC3C,OAAI,KAAK,OAAO,WAAW,mBAAmB,EAAE;IAC9C,MAAM,aAAa,KAAK,cAAc,WAAW,mBAAmB;IACpE,MAAM,WAAW,WAAW,SAAS;IACrC,MAAM,WAAW,WAAW,gBAAgB;AAE5C,QAAI,YAAY,eAAe,IAAI,SAAS,EAAE;KAC5C,MAAM,SAAS,sBAAsB,SAAS;AAC9C,SAAI,OAAO,SAAS,GAAG;MACrB,MAAM,WAAW,MAAM,IAAI,SAAS,oBAAI,IAAI,KAAK;AACjD,aAAO,SAAS,MAAM,SAAS,IAAI,EAAE,CAAC;AACtC,YAAM,IAAI,UAAU,SAAS;AAC7B,YAAM;;;cAGD,KAAK,OAAO,WAAW,4BAA4B,EAAE;IAE9D,MAAM,YAAY,KAAK,cAAc,WAAW,4BAA4B;IAC5E,MAAM,WAAW,UAAU,SAAS;AAEpC,QAAI,eAAe,IAAI,SAAS,EAAE;KAGhC,MAAM,SAAS,sBADE,UAAU,aAAa,CACM;AAC9C,SAAI,OAAO,SAAS,GAAG;MACrB,MAAM,WAAW,MAAM,IAAI,SAAS,oBAAI,IAAI,KAAK;AACjD,aAAO,SAAS,MAAM,SAAS,IAAI,EAAE,CAAC;AACtC,YAAM,IAAI,UAAU,SAAS;AAC7B,YAAM;;;;IAIZ;GACF;AAEF,QAAO"}
@@ -0,0 +1,22 @@
1
+
2
+ import { Project } from "ts-morph";
3
+
4
+ //#region src/purger/optimized/types.d.ts
5
+ /**
6
+ * Statistics from a purge operation
7
+ */
8
+ interface PurgeStats {
9
+ /** Number of files scanned */
10
+ filesScanned: number;
11
+ /** Time taken in milliseconds */
12
+ timeMs: number;
13
+ /** Number of CSS classes generated */
14
+ classesGenerated: number;
15
+ /** Number of spread operators traced */
16
+ spreadsTraced: number;
17
+ /** Number of expressions resolved */
18
+ expressionsResolved: number;
19
+ }
20
+ //#endregion
21
+ export { PurgeStats };
22
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/purger/optimized/types.ts"],"mappings":";;;;;;;UAoCiB,UAAA;;EAEf,YAAA;;EAEA,MAAA;;EAEA,gBAAA;;EAEA,aAAA;;EAEA,mBAAA;AAAA"}
@@ -0,0 +1,23 @@
1
+
2
+ import "../../commands/generateComponentData.js";
3
+ import { Project } from "ts-morph";
4
+
5
+ //#region src/purger/optimized/types.d.ts
6
+ /**
7
+ * Statistics from a purge operation
8
+ */
9
+ interface PurgeStats {
10
+ /** Number of files scanned */
11
+ filesScanned: number;
12
+ /** Time taken in milliseconds */
13
+ timeMs: number;
14
+ /** Number of CSS classes generated */
15
+ classesGenerated: number;
16
+ /** Number of spread operators traced */
17
+ spreadsTraced: number;
18
+ /** Number of expressions resolved */
19
+ expressionsResolved: number;
20
+ }
21
+ //#endregion
22
+ export { PurgeStats };
23
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/purger/optimized/types.ts"],"mappings":";;;;;;;;UAoCiB,UAAA;;EAEf,YAAA;;EAEA,MAAA;;EAEA,gBAAA;;EAEA,aAAA;;EAEA,mBAAA;AAAA"}
@@ -1,16 +1,15 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- const require_runtime = require('../../../../../_virtual/_rolldown/runtime.cjs');
3
- const require_index = require('../../../../../motion-tokens/dist/index.cjs');
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
+ const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
4
3
  const require_entryPoints = require('../../../utils/entryPoints.cjs');
4
+ let node_fs = require("node:fs");
5
5
  let node_path = require("node:path");
6
6
  node_path = require_runtime.__toESM(node_path);
7
- let node_fs = require("node:fs");
8
- let ts_morph = require("ts-morph");
9
7
  let fast_glob = require("fast-glob");
10
8
  fast_glob = require_runtime.__toESM(fast_glob);
9
+ let ts_morph = require("ts-morph");
10
+ let _yahoo_uds_motion_tokens = require("@yahoo/uds-motion-tokens");
11
11
 
12
- //#region ../tailwind/dist/purger/optimized/utils/componentAnalyzer.js
13
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
12
+ //#region src/purger/optimized/utils/componentAnalyzer.ts
14
13
  /**
15
14
  * Known UDS component names (populated by scanning)
16
15
  */
@@ -439,9 +438,9 @@ const extractMotionVarPrefixes = (sourceFile) => {
439
438
  }
440
439
  }
441
440
  });
442
- const layoutPrefix = `--uds-motion-${props.layoutVariant ?? require_index.SPRING_MOTION_DEFAULTS.layoutVariant}-${props.layoutSpeed ?? require_index.SPRING_MOTION_DEFAULTS.layoutSpeed}-`;
441
+ const layoutPrefix = `--uds-motion-${props.layoutVariant ?? _yahoo_uds_motion_tokens.SPRING_MOTION_DEFAULTS.layoutVariant}-${props.layoutSpeed ?? _yahoo_uds_motion_tokens.SPRING_MOTION_DEFAULTS.layoutSpeed}-`;
443
442
  if (!prefixes.includes(layoutPrefix)) prefixes.push(layoutPrefix);
444
- const colorPrefix = `--uds-motion-${props.colorVariant ?? require_index.SPRING_MOTION_DEFAULTS.colorVariant}-${props.colorSpeed ?? require_index.SPRING_MOTION_DEFAULTS.colorSpeed}-`;
443
+ const colorPrefix = `--uds-motion-${props.colorVariant ?? _yahoo_uds_motion_tokens.SPRING_MOTION_DEFAULTS.colorVariant}-${props.colorSpeed ?? _yahoo_uds_motion_tokens.SPRING_MOTION_DEFAULTS.colorSpeed}-`;
445
444
  if (!prefixes.includes(colorPrefix)) prefixes.push(colorPrefix);
446
445
  });
447
446
  return prefixes;
@@ -1,13 +1,12 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- import { SPRING_MOTION_DEFAULTS } from "../../../../../motion-tokens/dist/index.js";
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
3
2
  import { getAllowedEntryFileGlobPatterns, stripAllowedEntryFileExtension } from "../../../utils/entryPoints.js";
4
- import path from "node:path";
5
3
  import { existsSync } from "node:fs";
6
- import { Node, SyntaxKind } from "ts-morph";
4
+ import path from "node:path";
7
5
  import fg from "fast-glob";
6
+ import { Node, SyntaxKind } from "ts-morph";
7
+ import { SPRING_MOTION_DEFAULTS } from "@yahoo/uds-motion-tokens";
8
8
 
9
- //#region ../tailwind/dist/purger/optimized/utils/componentAnalyzer.js
10
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
9
+ //#region src/purger/optimized/utils/componentAnalyzer.ts
11
10
  /**
12
11
  * Known UDS component names (populated by scanning)
13
12
  */
@@ -495,4 +494,5 @@ const resolveImportedIdentifier = (identifier) => {
495
494
  };
496
495
 
497
496
  //#endregion
498
- export { analyzeComponent, scanComponentFiles };
497
+ export { analyzeComponent, scanComponentFiles };
498
+ //# sourceMappingURL=componentAnalyzer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentAnalyzer.js","names":[],"sources":["../../../../src/purger/optimized/utils/componentAnalyzer.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport path from 'node:path';\n\nimport { SPRING_MOTION_DEFAULTS } from '@yahoo/uds-motion-tokens';\nimport fg from 'fast-glob';\nimport type { ObjectLiteralExpression, Project, SourceFile } from 'ts-morph';\nimport { Node, SyntaxKind } from 'ts-morph';\n\nimport {\n getAllowedEntryFileGlobPatterns,\n stripAllowedEntryFileExtension,\n} from '../../../utils/entryPoints';\n\ninterface ComponentInfo {\n name: string;\n filePath: string;\n /** Default values from function parameter destructuring (e.g., display = 'flex') */\n defaultProps: Map<string, string>;\n /** Props passed to getStyles() calls */\n styleProps: string[];\n /** Hardcoded literal values passed directly to getStyles() (e.g., flex: 'none') */\n getStylesLiterals: Map<string, string>;\n /** Raw Tailwind class literals from cx() calls (e.g., 'absolute', 'opacity-0') */\n cxLiterals: string[];\n /** Other UDS components used internally */\n internalComponents: string[];\n /** Literal prop values passed to internal UDS components (e.g., <Icon color=\"current\" />) */\n internalComponentProps: Map<string, Map<string, string[]>>;\n /** Maps prop names to variant keys (e.g., variant -> [buttonVariantRoot, buttonVariantIcon]) */\n propToVariantKeys: Map<string, string[]>;\n /**\n * Motion CSS variable prefixes used by this component.\n * e.g., ['--uds-motion-bouncy-4-', '--uds-motion-smooth-3-']\n * Empty array means no motion vars needed.\n */\n motionVarPrefixes: string[];\n}\n\n/**\n * Known UDS component names (populated by scanning)\n */\nlet knownComponents: Set<string> | null = null;\n\n/**\n * Map of component name -> file path\n */\nlet componentPaths: Map<string, string> | null = null;\nlet scannedComponentsDir: string | null = null;\nconst hasImportQuery = (moduleSpecifier: string): boolean => moduleSpecifier.includes('?');\nconst scanComponentFilePaths = async (componentsDir: string): Promise<string[]> =>\n fg(getAllowedEntryFileGlobPatterns(), {\n cwd: componentsDir,\n absolute: true,\n });\n\n/**\n * Scan src/components to build a map of all component files\n */\nconst scanComponentFiles = async (componentsDir: string): Promise<Map<string, string>> => {\n if (componentPaths && scannedComponentsDir === componentsDir) {\n return componentPaths;\n }\n\n componentPaths = new Map();\n knownComponents = new Set();\n scannedComponentsDir = componentsDir;\n\n const nextComponentPaths = componentPaths;\n const nextKnownComponents = knownComponents;\n\n const files = await scanComponentFilePaths(componentsDir);\n\n files.forEach((file) => {\n // Skip test files and index files\n if (\n file.includes('.test.') ||\n path.basename(stripAllowedEntryFileExtension(file)) === 'index'\n ) {\n return;\n }\n\n const fileName = path.basename(stripAllowedEntryFileExtension(file));\n\n // Use PascalCase file names as component names\n if (/^[A-Z]/.test(fileName)) {\n nextComponentPaths.set(fileName, file);\n nextKnownComponents.add(fileName);\n }\n });\n\n return nextComponentPaths;\n};\n\n/**\n * Get the file path for a component by name\n */\nconst getComponentPath = async (\n componentName: string,\n componentsDir: string,\n): Promise<string | null> => {\n const paths = await scanComponentFiles(componentsDir);\n return paths.get(componentName) ?? null;\n};\n\n/**\n * Analyze an object literal for variant key mappings.\n * Handles:\n * - Direct property assignments: { fontSize: variant } -> variant maps to fontSize\n * - Nullish coalescing: { fontSize: fontSize ?? variant } -> variant maps to fontSize\n * - Conditional spreads: ...(condition ? { props } : {}) -> recursively analyze props\n */\nconst analyzeObjectForVariantMappings = (\n objLiteral: ObjectLiteralExpression,\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n sourceFile: SourceFile,\n): void => {\n objLiteral.getProperties().forEach((prop) => {\n if (Node.isPropertyAssignment(prop)) {\n analyzeVariantPropertyAssignment(prop, styleProps, getStylesLiterals, propToVariantKeys);\n return;\n }\n\n if (Node.isSpreadAssignment(prop)) {\n analyzeVariantSpreadAssignment(\n prop,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n });\n};\n\nconst addStyleProp = (styleProps: string[], variantKey: string): void => {\n if (!styleProps.includes(variantKey)) {\n styleProps.push(variantKey);\n }\n};\n\nconst addPropToVariantKeyMapping = (\n propToVariantKeys: Map<string, string[]>,\n propName: string,\n variantKey: string,\n): void => {\n const existing = propToVariantKeys.get(propName) ?? [];\n if (!existing.includes(variantKey)) {\n propToVariantKeys.set(propName, [...existing, variantKey]);\n }\n};\n\nconst extractFallbackIdentifier = (initializer: Node): string | null => {\n if (!Node.isBinaryExpression(initializer)) {\n return null;\n }\n\n const operatorKind = initializer.getOperatorToken().getKind();\n const isFallbackOperator =\n operatorKind === SyntaxKind.QuestionQuestionToken || operatorKind === SyntaxKind.BarBarToken;\n\n if (!isFallbackOperator || !Node.isIdentifier(initializer.getRight())) {\n return null;\n }\n\n return initializer.getRight().getText();\n};\n\nconst analyzeVariantPropertyAssignment = (\n prop: Node & { getName: () => string; getInitializer: () => Node | undefined },\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n): void => {\n const variantKey = prop.getName();\n addStyleProp(styleProps, variantKey);\n\n const initializer = prop.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isStringLiteral(initializer)) {\n getStylesLiterals.set(variantKey, initializer.getLiteralValue());\n }\n\n if (Node.isIdentifier(initializer)) {\n addPropToVariantKeyMapping(propToVariantKeys, initializer.getText(), variantKey);\n }\n\n const fallbackIdentifier = extractFallbackIdentifier(initializer);\n if (fallbackIdentifier) {\n addPropToVariantKeyMapping(propToVariantKeys, fallbackIdentifier, variantKey);\n }\n};\n\nconst findVariableObjectLiteral = (\n sourceFile: SourceFile,\n variableName: string,\n): ObjectLiteralExpression | null => {\n const declaration = sourceFile\n .getDescendantsOfKind(SyntaxKind.VariableDeclaration)\n .find((candidate) => candidate.getName() === variableName);\n const initializer = declaration?.getInitializer();\n\n return initializer && Node.isObjectLiteralExpression(initializer) ? initializer : null;\n};\n\nconst analyzeVariantSpreadAssignment = (\n prop: Node & { getExpression: () => Node },\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n sourceFile: SourceFile,\n): void => {\n const spreadExpr = prop.getExpression();\n\n if (Node.isParenthesizedExpression(spreadExpr)) {\n const conditionalExpr = spreadExpr.getExpression();\n if (Node.isConditionalExpression(conditionalExpr)) {\n const whenTrue = conditionalExpr.getWhenTrue();\n if (!Node.isObjectLiteralExpression(whenTrue)) {\n return;\n }\n\n analyzeObjectForVariantMappings(\n whenTrue,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n }\n\n if (Node.isIdentifier(spreadExpr)) {\n const objectLiteral = findVariableObjectLiteral(sourceFile, spreadExpr.getText());\n if (objectLiteral) {\n analyzeObjectForVariantMappings(\n objectLiteral,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n }\n};\n\n/**\n * Analyzes a UDS component file to extract:\n * 1. Default prop values (e.g., display = 'flex')\n * 2. Props passed to getStyles()\n * 3. Internal UDS component usage\n */\nconst analyzeComponent = (project: Project, componentPath: string): ComponentInfo | null => {\n const sourceFile = project.getSourceFile(componentPath);\n if (!sourceFile) {\n return null;\n }\n\n const componentName = path.basename(stripAllowedEntryFileExtension(componentPath));\n const defaultProps = new Map<string, string>();\n const componentPropNames = new Set<string>(); // All prop names (not just defaults)\n const styleProps: string[] = [];\n const getStylesLiterals = new Map<string, string>();\n const cxLiterals: string[] = [];\n const internalComponents: string[] = [];\n const internalComponentProps = new Map<string, Map<string, string[]>>();\n const propToVariantKeys = new Map<string, string[]>();\n\n collectComponentDefaultsAndProps(sourceFile, defaultProps, componentPropNames);\n\n collectGetStylesMetadata(sourceFile, styleProps, getStylesLiterals, propToVariantKeys);\n\n collectCxLiterals(sourceFile, cxLiterals);\n collectIntrinsicClassNameLiterals(sourceFile, cxLiterals);\n\n // Find internal UDS component usage and their prop values\n // Also detect prop aliasing (e.g., gap -> columnGap, rowGap in VStack)\n extractInternalComponents(\n sourceFile,\n internalComponents,\n internalComponentProps,\n propToVariantKeys,\n componentPropNames,\n );\n\n // Extract motion CSS variable prefixes from SpringMotionConfig usage\n const motionVarPrefixes = extractMotionVarPrefixes(sourceFile);\n\n return {\n name: componentName,\n filePath: componentPath,\n defaultProps,\n styleProps,\n getStylesLiterals,\n cxLiterals,\n internalComponents,\n internalComponentProps,\n propToVariantKeys,\n motionVarPrefixes,\n };\n};\n\nconst getComponentFunctionNodes = (sourceFile: SourceFile): Node[] => [\n ...sourceFile.getFunctions(),\n ...sourceFile.getVariableDeclarations().filter((declaration) => {\n const initializer = declaration.getInitializer();\n return initializer && (Node.isArrowFunction(initializer) || Node.isCallExpression(initializer));\n }),\n];\n\nconst collectComponentDefaultsAndProps = (\n sourceFile: SourceFile,\n defaultProps: Map<string, string>,\n componentPropNames: Set<string>,\n): void => {\n getComponentFunctionNodes(sourceFile).forEach((fn) => {\n if (Node.isFunctionDeclaration(fn)) {\n extractDefaultsFromFunction(fn, defaultProps);\n extractAllPropNames(fn, componentPropNames);\n return;\n }\n\n if (!Node.isVariableDeclaration(fn)) {\n return;\n }\n\n const initializer = fn.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isCallExpression(initializer)) {\n initializer.getArguments().forEach((arg) => {\n if (Node.isFunctionExpression(arg) || Node.isArrowFunction(arg)) {\n extractDefaultsFromFunction(arg, defaultProps);\n extractAllPropNames(arg, componentPropNames);\n }\n });\n }\n\n if (Node.isArrowFunction(initializer)) {\n extractDefaultsFromFunction(initializer, defaultProps);\n extractAllPropNames(initializer, componentPropNames);\n }\n });\n};\n\nconst extractConditionalStringLiterals = (node: Node): string[] => {\n if (Node.isStringLiteral(node)) {\n return [node.getLiteralValue()];\n }\n\n if (Node.isConditionalExpression(node)) {\n return [\n ...extractConditionalStringLiterals(node.getWhenTrue()),\n ...extractConditionalStringLiterals(node.getWhenFalse()),\n ];\n }\n\n return [];\n};\n\nconst storeVariantLiteralValues = (\n variantKey: string,\n literalValues: string[],\n getStylesLiterals: Map<string, string>,\n): void => {\n literalValues.forEach((value, index) => {\n const literalKey = index === 0 ? variantKey : `${variantKey}:${index}`;\n getStylesLiterals.set(literalKey, value);\n });\n};\n\nconst handleGetStylesPropertyAssignment = (\n prop: Node & { getName: () => string; getInitializer: () => Node | undefined },\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n): void => {\n const variantKey = prop.getName();\n addStyleProp(styleProps, variantKey);\n\n const initializer = prop.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isStringLiteral(initializer)) {\n getStylesLiterals.set(variantKey, initializer.getLiteralValue());\n }\n\n if (Node.isIdentifier(initializer)) {\n addPropToVariantKeyMapping(propToVariantKeys, initializer.getText(), variantKey);\n }\n\n const fallbackIdentifier = extractFallbackIdentifier(initializer);\n if (fallbackIdentifier) {\n addPropToVariantKeyMapping(propToVariantKeys, fallbackIdentifier, variantKey);\n }\n\n if (Node.isConditionalExpression(initializer)) {\n const allValues = [\n ...extractConditionalStringLiterals(initializer.getWhenTrue()),\n ...extractConditionalStringLiterals(initializer.getWhenFalse()),\n ];\n storeVariantLiteralValues(variantKey, allValues, getStylesLiterals);\n }\n};\n\nconst handleGetStylesObjectProperty = (\n prop: Node,\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n sourceFile: SourceFile,\n): void => {\n if (Node.isPropertyAssignment(prop)) {\n handleGetStylesPropertyAssignment(prop, styleProps, getStylesLiterals, propToVariantKeys);\n return;\n }\n\n if (Node.isShorthandPropertyAssignment(prop)) {\n addStyleProp(styleProps, prop.getName());\n return;\n }\n\n if (Node.isSpreadAssignment(prop) && Node.isIdentifier(prop.getExpression())) {\n const objectLiteral = findVariableObjectLiteral(sourceFile, prop.getExpression().getText());\n if (objectLiteral) {\n analyzeObjectForVariantMappings(\n objectLiteral,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n }\n};\n\nconst collectGetStylesMetadata = (\n sourceFile: SourceFile,\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n): void => {\n sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((call) => call.getExpression().getText() === 'getStyles')\n .forEach((call) => {\n const args = call.getArguments();\n if (args.length === 0 || !Node.isObjectLiteralExpression(args[0])) {\n return;\n }\n\n args[0].getProperties().forEach((prop) => {\n handleGetStylesObjectProperty(\n prop,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n });\n });\n};\n\nconst collectCxLiterals = (sourceFile: SourceFile, cxLiterals: string[]): void => {\n sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((call) => call.getExpression().getText() === 'cx')\n .forEach((call) => {\n call.getArguments().forEach((arg) => extractCxStringLiterals(arg, cxLiterals));\n });\n};\n\nconst pushUniqueClasses = (target: string[], rawValue: string): void => {\n rawValue\n .split(/\\s+/)\n .filter(Boolean)\n .forEach((className) => {\n if (!target.includes(className)) {\n target.push(className);\n }\n });\n};\n\nconst collectIntrinsicClassNameLiterals = (sourceFile: SourceFile, cxLiterals: string[]): void => {\n const jsxElements = [\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),\n ];\n\n jsxElements.forEach((element) => {\n const tagName = element.getTagNameNode().getText();\n if (!/^[a-z]/.test(tagName)) {\n return;\n }\n\n element.getAttributes().forEach((attr) => {\n if (!Node.isJsxAttribute(attr) || attr.getNameNode().getText() !== 'className') {\n return;\n }\n\n const initializer = attr.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isStringLiteral(initializer)) {\n pushUniqueClasses(cxLiterals, initializer.getLiteralValue());\n return;\n }\n\n if (!Node.isJsxExpression(initializer)) {\n return;\n }\n\n const expr = initializer.getExpression();\n if (expr && Node.isStringLiteral(expr)) {\n pushUniqueClasses(cxLiterals, expr.getLiteralValue());\n }\n });\n });\n};\n\n/**\n * Extract UDS components used internally in the file and their prop values.\n * Also detects prop aliasing (e.g., columnGap={gap} means gap -> columnGap).\n */\nconst extractInternalComponents = (\n sourceFile: SourceFile,\n internalComponents: string[],\n internalComponentProps: Map<string, Map<string, string[]>>,\n propToVariantKeys: Map<string, string[]>,\n componentProps: Set<string>,\n): void => {\n collectImportedInternalComponents(sourceFile, internalComponents);\n collectInternalComponentUsages(\n sourceFile,\n internalComponents,\n internalComponentProps,\n propToVariantKeys,\n componentProps,\n );\n};\n\nconst isInternalUdsModule = (moduleSpec: string): boolean => {\n const isUdsImport =\n moduleSpec.startsWith('@yahoo/uds') ||\n moduleSpec.startsWith('../') ||\n moduleSpec.startsWith('./');\n\n return isUdsImport && (moduleSpec.includes('/components/') || moduleSpec === '@yahoo/uds');\n};\n\nconst pushUniqueComponentName = (components: string[], name: string): void => {\n if (/^[A-Z]/.test(name) && !components.includes(name)) {\n components.push(name);\n }\n};\n\nconst collectImportedInternalComponents = (\n sourceFile: SourceFile,\n internalComponents: string[],\n): void => {\n sourceFile.getImportDeclarations().forEach((importDecl) => {\n if (!isInternalUdsModule(importDecl.getModuleSpecifierValue())) {\n return;\n }\n\n importDecl\n .getNamedImports()\n .forEach((namedImport) => pushUniqueComponentName(internalComponents, namedImport.getName()));\n });\n};\n\nconst getOrCreateComponentPropsMap = (\n internalComponentProps: Map<string, Map<string, string[]>>,\n componentName: string,\n): Map<string, string[]> => {\n const existing = internalComponentProps.get(componentName);\n if (existing) {\n return existing;\n }\n\n const created = new Map<string, string[]>();\n internalComponentProps.set(componentName, created);\n return created;\n};\n\nconst extractJsxAttributeLiteralValues = (\n attr: Node,\n componentProps: Set<string>,\n propToVariantKeys: Map<string, string[]>,\n): { propName: string; values: string[] } | null => {\n if (!Node.isJsxAttribute(attr)) {\n return null;\n }\n\n const propName = attr.getNameNode().getText();\n const initializer = attr.getInitializer();\n if (!initializer) {\n return { propName, values: [] };\n }\n\n if (Node.isStringLiteral(initializer)) {\n return { propName, values: [initializer.getLiteralValue()] };\n }\n\n if (!Node.isJsxExpression(initializer)) {\n return { propName, values: [] };\n }\n\n const expr = initializer.getExpression();\n if (expr && Node.isStringLiteral(expr)) {\n return { propName, values: [expr.getLiteralValue()] };\n }\n\n if (expr && Node.isIdentifier(expr)) {\n const identifierName = expr.getText();\n if (componentProps.has(identifierName) && identifierName !== propName) {\n addPropToVariantKeyMapping(propToVariantKeys, identifierName, propName);\n }\n }\n\n return { propName, values: [] };\n};\n\nconst collectInternalComponentUsages = (\n sourceFile: SourceFile,\n internalComponents: string[],\n internalComponentProps: Map<string, Map<string, string[]>>,\n propToVariantKeys: Map<string, string[]>,\n componentProps: Set<string>,\n): void => {\n const jsxElements = [\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),\n ];\n\n jsxElements.forEach((element) => {\n const tagName = element.getTagNameNode().getText();\n if (!/^[A-Z]/.test(tagName)) {\n return;\n }\n\n pushUniqueComponentName(internalComponents, tagName);\n\n element.getAttributes().forEach((attr) => {\n const extracted = extractJsxAttributeLiteralValues(attr, componentProps, propToVariantKeys);\n if (!extracted || extracted.values.length === 0) {\n return;\n }\n\n const componentPropsMap = getOrCreateComponentPropsMap(internalComponentProps, tagName);\n const existingValues = componentPropsMap.get(extracted.propName) ?? [];\n const mergedValues = [...new Set([...existingValues, ...extracted.values])];\n componentPropsMap.set(extracted.propName, mergedValues);\n });\n });\n};\n\n/**\n * Extract default prop values from a function's parameter destructuring\n */\nconst extractDefaultsFromFunction = (fn: Node, defaults: Map<string, string>): void => {\n let params: Node[] = [];\n\n if (Node.isFunctionDeclaration(fn) || Node.isFunctionExpression(fn)) {\n params = fn.getParameters();\n } else if (Node.isArrowFunction(fn)) {\n params = fn.getParameters();\n }\n\n params.forEach((param) => {\n if (!Node.isParameterDeclaration(param)) {\n return;\n }\n\n const nameNode = param.getNameNode();\n if (!nameNode || !Node.isObjectBindingPattern(nameNode)) {\n return;\n }\n\n nameNode.getElements().forEach((element) => {\n const propName = element.getPropertyNameNode()?.getText() || element.getName();\n const initializer = element.getInitializer();\n\n if (initializer && Node.isStringLiteral(initializer)) {\n defaults.set(propName, initializer.getLiteralValue());\n } else if (initializer && Node.isIdentifier(initializer)) {\n const resolved = resolveIdentifierToStringLiteral(initializer);\n if (resolved) {\n defaults.set(propName, resolved);\n }\n }\n });\n });\n};\n\n/**\n * Extract ALL prop names from a function's parameter destructuring (not just defaults)\n */\nconst extractAllPropNames = (fn: Node, propNames: Set<string>): void => {\n let params: Node[] = [];\n\n if (Node.isFunctionDeclaration(fn) || Node.isFunctionExpression(fn)) {\n params = fn.getParameters();\n } else if (Node.isArrowFunction(fn)) {\n params = fn.getParameters();\n }\n\n params.forEach((param) => {\n if (!Node.isParameterDeclaration(param)) {\n return;\n }\n\n const nameNode = param.getNameNode();\n if (!nameNode || !Node.isObjectBindingPattern(nameNode)) {\n return;\n }\n\n nameNode.getElements().forEach((element) => {\n const propName = element.getPropertyNameNode()?.getText() || element.getName();\n propNames.add(propName);\n });\n });\n};\n\n/**\n * Get default classes for a component based on its default props\n */\nconst getDefaultClasses = (\n componentInfo: ComponentInfo,\n variants: Record<string, Record<string, string>>,\n): string[] => {\n const classes: string[] = [];\n\n componentInfo.defaultProps.forEach((propValue, propName) => {\n const variantGroup = variants[propName as keyof typeof variants];\n if (variantGroup && variantGroup[propValue]) {\n classes.push(variantGroup[propValue]);\n }\n });\n\n return classes;\n};\n\n/**\n * Get all components (including dependencies) for a given component\n */\nconst getComponentWithDependencies = (\n componentInfo: ComponentInfo,\n allComponents: Map<string, ComponentInfo>,\n visited: Set<string> = new Set(),\n): ComponentInfo[] => {\n if (visited.has(componentInfo.name)) {\n return [];\n }\n visited.add(componentInfo.name);\n\n const result: ComponentInfo[] = [componentInfo];\n\n componentInfo.internalComponents.forEach((depName) => {\n const depInfo = allComponents.get(depName);\n if (depInfo) {\n result.push(...getComponentWithDependencies(depInfo, allComponents, visited));\n }\n });\n\n return result;\n};\n\n/**\n * Extract string literals from cx() call arguments.\n * Handles:\n * - Direct string literals: cx('class1', 'class2')\n * - Object keys: cx({ 'class1': condition, 'class2': true })\n * - Nested calls and arrays\n */\nconst extractCxStringLiterals = (node: Node, literals: string[]): void => {\n if (Node.isStringLiteral(node)) {\n // Split by whitespace to handle multiple classes in one string\n const classes = node.getLiteralValue().split(/\\s+/).filter(Boolean);\n classes.forEach((cls) => {\n if (!literals.includes(cls)) {\n literals.push(cls);\n }\n });\n } else if (Node.isObjectLiteralExpression(node)) {\n // Extract keys from object: cx({ 'class1': condition })\n node.getProperties().forEach((prop) => {\n if (Node.isPropertyAssignment(prop)) {\n const nameNode = prop.getNameNode();\n if (Node.isStringLiteral(nameNode)) {\n const classes = nameNode.getLiteralValue().split(/\\s+/).filter(Boolean);\n classes.forEach((cls) => {\n if (!literals.includes(cls)) {\n literals.push(cls);\n }\n });\n } else if (Node.isIdentifier(nameNode)) {\n // Plain identifier key: cx({ className: condition })\n const cls = nameNode.getText();\n if (!literals.includes(cls)) {\n literals.push(cls);\n }\n }\n }\n });\n } else if (Node.isArrayLiteralExpression(node)) {\n // Recurse into array elements\n node.getElements().forEach((element) => {\n extractCxStringLiterals(element, literals);\n });\n } else if (Node.isConditionalExpression(node)) {\n // Handle ternary: condition ? 'class1' : 'class2'\n extractCxStringLiterals(node.getWhenTrue(), literals);\n extractCxStringLiterals(node.getWhenFalse(), literals);\n } else if (Node.isBinaryExpression(node)) {\n // Handle logical expressions: condition && 'class'\n extractCxStringLiterals(node.getLeft(), literals);\n extractCxStringLiterals(node.getRight(), literals);\n }\n};\n\n/**\n * Try to resolve an identifier to its initializer value (for const declarations)\n */\nconst resolveIdentifierToObject = (\n sourceFile: SourceFile,\n identifier: string,\n): Record<string, string> | null => {\n // Find variable declarations in the file\n const varDecls = sourceFile.getDescendantsOfKind(SyntaxKind.VariableDeclaration);\n\n const decl = varDecls.find((candidate) => candidate.getName() === identifier);\n if (!decl) {\n return null;\n }\n\n let initializer = decl.getInitializer();\n if (!initializer) {\n return null;\n }\n\n // Unwrap \"as const\" expressions: { ... } as const\n if (Node.isAsExpression(initializer)) {\n initializer = initializer.getExpression();\n }\n\n if (!Node.isObjectLiteralExpression(initializer)) {\n return null;\n }\n\n // Extract properties from the object literal\n const result: Record<string, string> = {};\n initializer.getProperties().forEach((prop) => {\n if (!Node.isPropertyAssignment(prop)) {\n return;\n }\n\n const propName = prop.getName();\n const propInit = prop.getInitializer();\n\n if (propInit && Node.isStringLiteral(propInit)) {\n result[propName] = propInit.getLiteralValue();\n }\n });\n\n return result;\n};\n\n/**\n * Extract motion CSS variable prefixes from SpringMotionConfig usage.\n * Returns prefixes like ['--uds-motion-bouncy-4-', '--uds-motion-smooth-3-']\n */\nconst extractMotionVarPrefixes = (sourceFile: SourceFile): string[] => {\n const prefixes: string[] = [];\n\n // Find all SpringMotionConfig JSX elements\n const jsxElements = [\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),\n ];\n\n jsxElements.forEach((element) => {\n const tagName = element.getTagNameNode().getText();\n if (tagName !== 'SpringMotionConfig') {\n return;\n }\n\n // Extract prop values\n const props: Record<string, string | null> = {\n layoutVariant: null,\n layoutSpeed: null,\n colorVariant: null,\n colorSpeed: null,\n };\n\n const attrs = element.getAttributes();\n attrs.forEach((attr) => {\n // Handle spread attributes: {...toggleTransition}\n if (Node.isJsxSpreadAttribute(attr)) {\n const expr = attr.getExpression();\n if (Node.isIdentifier(expr)) {\n const spreadObj = resolveIdentifierToObject(sourceFile, expr.getText());\n if (spreadObj) {\n // Apply spread values to props\n Object.keys(props).forEach((key) => {\n if (key in spreadObj) {\n props[key] = spreadObj[key];\n }\n });\n }\n }\n return;\n }\n\n if (!Node.isJsxAttribute(attr)) {\n return;\n }\n\n const propName = attr.getNameNode().getText();\n if (!(propName in props)) {\n return;\n }\n\n const initializer = attr.getInitializer();\n if (initializer) {\n if (Node.isStringLiteral(initializer)) {\n props[propName] = initializer.getLiteralValue();\n } else if (Node.isJsxExpression(initializer)) {\n const expr = initializer.getExpression();\n if (expr && Node.isStringLiteral(expr)) {\n props[propName] = expr.getLiteralValue();\n }\n // If it's a variable/prop, we can't determine the value statically\n // Fall back to including all variants for that dimension\n }\n }\n });\n\n // Build the CSS variable prefixes\n // Layout config: --uds-motion-{variant}-{speed}-\n const layoutVariant = props.layoutVariant ?? SPRING_MOTION_DEFAULTS.layoutVariant;\n const layoutSpeed = props.layoutSpeed ?? SPRING_MOTION_DEFAULTS.layoutSpeed;\n const layoutPrefix = `--uds-motion-${layoutVariant}-${layoutSpeed}-`;\n if (!prefixes.includes(layoutPrefix)) {\n prefixes.push(layoutPrefix);\n }\n\n // Color config: --uds-motion-{variant}-{speed}-\n const colorVariant = props.colorVariant ?? SPRING_MOTION_DEFAULTS.colorVariant;\n const colorSpeed = props.colorSpeed ?? SPRING_MOTION_DEFAULTS.colorSpeed;\n const colorPrefix = `--uds-motion-${colorVariant}-${colorSpeed}-`;\n if (!prefixes.includes(colorPrefix)) {\n prefixes.push(colorPrefix);\n }\n });\n\n return prefixes;\n};\n\nconst resolveIdentifierToStringLiteral = (identifier: Node): string | null => {\n if (!Node.isIdentifier(identifier)) {\n return null;\n }\n\n const symbol = identifier.getSymbol();\n if (!symbol) {\n return resolveImportedIdentifier(identifier);\n }\n\n const resolvedDeclarationValue = symbol\n .getDeclarations()\n .reduce<string | undefined>((resolved, declaration) => {\n if (resolved) {\n return resolved;\n }\n\n if (Node.isVariableDeclaration(declaration)) {\n let initializer = declaration.getInitializer();\n\n // Unwrap \"as const\"\n if (initializer && Node.isAsExpression(initializer)) {\n initializer = initializer.getExpression();\n }\n\n if (initializer && Node.isStringLiteral(initializer)) {\n return initializer.getLiteralValue();\n }\n }\n\n if (Node.isEnumMember(declaration)) {\n const initializer = declaration.getInitializer();\n if (initializer && Node.isStringLiteral(initializer)) {\n return initializer.getLiteralValue();\n }\n }\n\n return undefined;\n }, undefined);\n\n if (resolvedDeclarationValue) {\n return resolvedDeclarationValue;\n }\n\n return resolveImportedIdentifier(identifier);\n};\n\nconst resolveImportedIdentifier = (identifier: Node): string | null => {\n if (!Node.isIdentifier(identifier)) {\n return null;\n }\n\n const name = identifier.getText();\n const sourceFile = identifier.getSourceFile();\n const project = sourceFile.getProject();\n const baseDir = path.dirname(sourceFile.getFilePath());\n\n const importResolution = sourceFile\n .getImportDeclarations()\n .reduce<string | undefined>((resolvedImport, importDecl) => {\n if (resolvedImport) {\n return resolvedImport;\n }\n\n const namedImport = importDecl.getNamedImports().find((n) => n.getName() === name);\n if (!namedImport) {\n return undefined;\n }\n\n const moduleSpec = importDecl.getModuleSpecifierValue();\n if (!moduleSpec.startsWith('.') || hasImportQuery(moduleSpec)) {\n return undefined;\n }\n\n const resolvedBase = path.resolve(baseDir, moduleSpec);\n const candidates = [resolvedBase, `${resolvedBase}.ts`, `${resolvedBase}.tsx`];\n\n return candidates.reduce<string | undefined>((resolvedCandidate, candidate) => {\n if (resolvedCandidate) {\n return resolvedCandidate;\n }\n\n if (!existsSync(candidate)) {\n return undefined;\n }\n\n const importedFile = project.addSourceFileAtPathIfExists(candidate);\n if (!importedFile) {\n return undefined;\n }\n\n const varDecl = importedFile.getVariableDeclaration(name);\n if (!varDecl) {\n return undefined;\n }\n\n let initializer = varDecl.getInitializer();\n if (initializer && Node.isAsExpression(initializer)) {\n initializer = initializer.getExpression();\n }\n\n return initializer && Node.isStringLiteral(initializer)\n ? initializer.getLiteralValue()\n : undefined;\n }, undefined);\n }, undefined);\n\n if (importResolution) {\n return importResolution;\n }\n\n return null;\n};\n\nexport type { ComponentInfo };\nexport {\n analyzeComponent,\n getComponentPath,\n getComponentWithDependencies,\n getDefaultClasses,\n scanComponentFiles,\n};\n"],"mappings":";;;;;;;;;;;;AAyCA,IAAI,kBAAsC;;;;AAK1C,IAAI,iBAA6C;AACjD,IAAI,uBAAsC;AAC1C,MAAM,kBAAkB,oBAAqC,gBAAgB,SAAS,IAAI;AAC1F,MAAM,yBAAyB,OAAO,kBACpC,GAAG,iCAAiC,EAAE;CACpC,KAAK;CACL,UAAU;CACX,CAAC;;;;AAKJ,MAAM,qBAAqB,OAAO,kBAAwD;AACxF,KAAI,kBAAkB,yBAAyB,cAC7C,QAAO;AAGT,kCAAiB,IAAI,KAAK;AAC1B,mCAAkB,IAAI,KAAK;AAC3B,wBAAuB;CAEvB,MAAM,qBAAqB;CAC3B,MAAM,sBAAsB;AAI5B,EAFc,MAAM,uBAAuB,cAAc,EAEnD,SAAS,SAAS;AAEtB,MACE,KAAK,SAAS,SAAS,IACvB,KAAK,SAAS,+BAA+B,KAAK,CAAC,KAAK,QAExD;EAGF,MAAM,WAAW,KAAK,SAAS,+BAA+B,KAAK,CAAC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AACvD,MAAI,CAAC,WAAW,WAAW,IAAI,IAAI,eAAe,WAAW,CAC3D;EAGF,MAAM,eAAe,KAAK,QAAQ,SAAS,WAAW;AAGtD,SAFmB;GAAC;GAAc,GAAG,aAAa;GAAM,GAAG,aAAa;GAAM,CAE5D,QAA4B,mBAAmB,cAAc;AAC7E,OAAI,kBACF,QAAO;AAGT,OAAI,CAAC,WAAW,UAAU,CACxB;GAGF,MAAM,eAAe,QAAQ,4BAA4B,UAAU;AACnE,OAAI,CAAC,aACH;GAGF,MAAM,UAAU,aAAa,uBAAuB,KAAK;AACzD,OAAI,CAAC,QACH;GAGF,IAAI,cAAc,QAAQ,gBAAgB;AAC1C,OAAI,eAAe,KAAK,eAAe,YAAY,CACjD,eAAc,YAAY,eAAe;AAG3C,UAAO,eAAe,KAAK,gBAAgB,YAAY,GACnD,YAAY,iBAAiB,GAC7B;KACH,OAAU;IACZ,OAAU;AAEf,KAAI,iBACF,QAAO;AAGT,QAAO"}
@@ -1,11 +1,10 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- const require_runtime = require('../../../../../_virtual/_rolldown/runtime.cjs');
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
+ const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_entryPoints = require('../../../utils/entryPoints.cjs');
4
4
  let fast_glob = require("fast-glob");
5
5
  fast_glob = require_runtime.__toESM(fast_glob);
6
6
 
7
- //#region ../tailwind/dist/purger/optimized/utils/files.js
8
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
7
+ //#region src/purger/optimized/utils/files.ts
9
8
  /**
10
9
  * Scan a directory for JSX/TSX files
11
10
  */
@@ -0,0 +1,2 @@
1
+
2
+ import { Project } from "ts-morph";
@@ -1,9 +1,8 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
2
  import { DEFAULT_ENTRY, resolveEntryPaths } from "../../../utils/entryPoints.js";
3
3
  import fg from "fast-glob";
4
4
 
5
- //#region ../tailwind/dist/purger/optimized/utils/files.js
6
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
5
+ //#region src/purger/optimized/utils/files.ts
7
6
  /**
8
7
  * Scan a directory for JSX/TSX files
9
8
  */
@@ -25,4 +24,5 @@ const scanForFiles = async (entry) => {
25
24
  };
26
25
 
27
26
  //#endregion
28
- export { scanForFiles };
27
+ export { scanForFiles };
28
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","names":[],"sources":["../../../../src/purger/optimized/utils/files.ts"],"sourcesContent":["import fg from 'fast-glob';\nimport type { Project, SourceFile } from 'ts-morph';\n\nimport { DEFAULT_ENTRY, resolveEntryPaths } from '../../../utils/entryPoints';\n\n/**\n * Scan a directory for JSX/TSX files\n */\nexport const scanForFiles = async (entry: string | string[]): Promise<string[]> => {\n const workspaceDir = process.env.PWD ?? process.cwd();\n\n try {\n const fileGroups = await Promise.all(\n resolveEntryPaths(entry, workspaceDir, DEFAULT_ENTRY).map((entryPath) => {\n if (entryPath.kind === 'file') {\n return [entryPath.absolutePath];\n }\n\n return fg('**/*.{jsx,tsx}', {\n cwd: entryPath.absolutePath,\n absolute: true,\n ignore: ['**/node_modules/**'],\n });\n }),\n );\n\n return [...new Set(fileGroups.flat())];\n } catch (error) {\n throw error instanceof Error\n ? error\n : new Error(`Couldn't find the entry directory: ${entry}. Please make sure it exists.`);\n }\n};\n\n/**\n * Get all source files that import from @yahoo/uds\n */\nexport const getUdsImportingFiles = (project: Project): Set<SourceFile> =>\n new Set(\n project\n .getSourceFiles()\n .filter((sourceFile) =>\n sourceFile\n .getImportDeclarations()\n .some((importDecl) => importDecl.getModuleSpecifier().getText().includes('@yahoo/uds')),\n ),\n );\n\n/**\n * Parse files to extract UDS imports\n */\nexport const parseUdsImports = (project: Project, files: string[]): string[] => {\n const imports = files.flatMap((filePath) => {\n const sourceFile = project.getSourceFile(filePath);\n if (!sourceFile) {\n return [];\n }\n\n return sourceFile\n .getImportDeclarations()\n .filter((importDecl) => importDecl.getModuleSpecifier().getText().includes('@yahoo/uds'))\n .flatMap((importDecl) =>\n importDecl.getNamedImports().map((namedImport) => namedImport.getName()),\n );\n });\n\n return Array.from(new Set(imports));\n};\n\n/**\n * Get components and their dependencies from the import list\n */\nexport const getComponentsWithDependencies = (\n imports: string[],\n componentToVariants: Record<string, unknown>,\n componentsDependencies: Record<string, string[]>,\n): string[] => {\n const components = imports\n .filter((importName) => Boolean(componentToVariants[importName]))\n .flatMap((importName) => [importName, ...(componentsDependencies[importName] ?? [])]);\n\n return Array.from(new Set(components));\n};\n"],"mappings":";;;;;;;;AAQA,MAAa,eAAe,OAAO,UAAgD;CACjF,MAAM,eAAe,QAAQ,IAAI,OAAO,QAAQ,KAAK;AAErD,KAAI;EACF,MAAM,aAAa,MAAM,QAAQ,IAC/B,kBAAkB,OAAO,cAAc,cAAc,CAAC,KAAK,cAAc;AACvE,OAAI,UAAU,SAAS,OACrB,QAAO,CAAC,UAAU,aAAa;AAGjC,UAAO,GAAG,kBAAkB;IAC1B,KAAK,UAAU;IACf,UAAU;IACV,QAAQ,CAAC,qBAAqB;IAC/B,CAAC;IACF,CACH;AAED,SAAO,CAAC,GAAG,IAAI,IAAI,WAAW,MAAM,CAAC,CAAC;UAC/B,OAAO;AACd,QAAM,iBAAiB,QACnB,wBACA,IAAI,MAAM,sCAAsC,MAAM,+BAA+B"}
@@ -1,15 +1,14 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- const require_runtime = require('../../../../../_virtual/_rolldown/runtime.cjs');
3
- const require_index = require('../../../../../css-tokens/dist/index.cjs');
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
+ const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
3
+ let _yahoo_uds_css_tokens = require("@yahoo/uds-css-tokens");
4
+ let node_fs = require("node:fs");
4
5
  let node_path = require("node:path");
5
6
  node_path = require_runtime.__toESM(node_path);
6
- let node_fs = require("node:fs");
7
7
 
8
- //#region ../tailwind/dist/purger/optimized/utils/safelist.js
9
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
8
+ //#region src/purger/optimized/utils/safelist.ts
10
9
  const colorModeToClass = {
11
- dark: require_index.DARK_COLOR_MODE_CLASSNAME,
12
- light: require_index.LIGHT_COLOR_MODE_CLASSNAME
10
+ dark: _yahoo_uds_css_tokens.DARK_COLOR_MODE_CLASSNAME,
11
+ light: _yahoo_uds_css_tokens.LIGHT_COLOR_MODE_CLASSNAME
13
12
  };
14
13
  /**
15
14
  * Deduplicate and clean a safelist
@@ -1,10 +1,9 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- import { DARK_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME } from "../../../../../css-tokens/dist/index.js";
3
- import path from "node:path";
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
+ import { DARK_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME } from "@yahoo/uds-css-tokens";
4
3
  import { mkdirSync, writeFileSync } from "node:fs";
4
+ import path from "node:path";
5
5
 
6
- //#region ../tailwind/dist/purger/optimized/utils/safelist.js
7
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
6
+ //#region src/purger/optimized/utils/safelist.ts
8
7
  const colorModeToClass = {
9
8
  dark: DARK_COLOR_MODE_CLASSNAME,
10
9
  light: LIGHT_COLOR_MODE_CLASSNAME
@@ -49,4 +48,5 @@ export const safelist = ${JSON.stringify(safelist)};
49
48
  };
50
49
 
51
50
  //#endregion
52
- export { deduplicateSafelist, getThemeAndScaleClasses, saveSafelistToFile };
51
+ export { deduplicateSafelist, getThemeAndScaleClasses, saveSafelistToFile };
52
+ //# sourceMappingURL=safelist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safelist.js","names":[],"sources":["../../../../src/purger/optimized/utils/safelist.ts"],"sourcesContent":["import { mkdirSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\nimport { DARK_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME } from '@yahoo/uds-css-tokens';\nimport type { ColorModeConfig } from '@yahoo/uds-types';\n\nconst colorModeToClass: Record<keyof ColorModeConfig, string> = {\n dark: DARK_COLOR_MODE_CLASSNAME,\n light: LIGHT_COLOR_MODE_CLASSNAME,\n};\n\n/**\n * Deduplicate and clean a safelist\n */\nconst deduplicateSafelist = (safelist: string[]): string[] => {\n const deduped = safelist\n .map((cls) => cls.replaceAll('\\\\', '').trim())\n .filter((cleaned) => cleaned && isValidClassName(cleaned));\n\n return Array.from(new Set(deduped));\n};\n\n/**\n * Check if a class name is valid (not malformed from CSS escape sequences)\n */\nconst isValidClassName = (cls: string): boolean => {\n // Filter out malformed classes from CSS escape sequences\n if (cls.match(/^[0-9]/)) {\n return false;\n }\n if (cls.match(/[0-9][a-z]$/)) {\n return false;\n }\n if (cls.includes('2c')) {\n return false;\n }\n return true;\n};\n\n/**\n * Filter out autoVariant classes (we add them dynamically based on usage)\n */\nexport const filterAutoVariantClasses = (classes: string[]): string[] =>\n classes.filter((cls) => !cls.match(/^uds-[a-z]+-(?:variant|size)-/));\n\n/**\n * Get classes for enabled color modes.\n * Note: Light mode is not included by default since :root already defines light mode styles.\n * Only dark mode class is needed to enable dark mode switching.\n */\nexport const getThemeAndScaleClasses = (colorModes?: ('dark' | 'light')[]): string[] => {\n if (!colorModes || colorModes.length === 0) {\n // Default: only dark mode (light mode is already in :root)\n return [colorModeToClass.dark];\n }\n\n return colorModes\n .map((mode) => colorModeToClass[mode])\n .filter((className): className is string => Boolean(className));\n};\n\n/**\n * Get autoVariant classes for specific prop values used by a component\n */\nexport const getAutoVariantClasses = (\n componentName: string,\n usedProps: Map<string, Set<string>>,\n autoVariants: Record<string, Record<string, string>>,\n): string[] => {\n const componentLower = componentName.toLowerCase();\n\n return [...usedProps.entries()].flatMap(([propName, values]) => {\n const propNameCapitalized = propName.charAt(0).toUpperCase() + propName.slice(1);\n\n // Look for matching autoVariant keys\n return Object.entries(autoVariants)\n .filter(\n ([autoVariantKey]) =>\n autoVariantKey.startsWith(componentLower + propNameCapitalized) ||\n autoVariantKey.startsWith(componentLower + propName),\n )\n .flatMap(([, variantGroup]) =>\n [...values]\n .map((value) => variantGroup[value as keyof typeof variantGroup])\n .filter((className): className is string => Boolean(className)),\n );\n });\n};\n\n/**\n * Save safelist to a file\n */\nexport const saveSafelistToFile = async (safelist: string[], outputPath: string): Promise<void> => {\n const content = `\n//! This file is generated by the optimized purger from @yahoo/uds\n//! Do not edit directly\n//! If there is issue with this file please report to #ask-uds\nexport const safelist = ${JSON.stringify(safelist)};\n`;\n\n mkdirSync(path.dirname(outputPath), { recursive: true });\n writeFileSync(outputPath, content);\n};\n\nexport { deduplicateSafelist };\n"],"mappings":";;;;;;AAMA,MAAM,mBAA0D;CAC9D,MAAM;CACN,OAAO;CACR;;;;AAKD,MAAM,uBAAuB,aAAiC;CAC5D,MAAM,UAAU,SACb,KAAK,QAAQ,IAAI,WAAW,MAAM,GAAG,CAAC,MAAM,CAAC,CAC7C,QAAQ,YAAY,WAAW,iBAAiB,QAAQ,CAAC;AAE5D,QAAO,MAAM,KAAK,IAAI,IAAI,QAAQ,CAAC;;;;;AAMrC,MAAM,oBAAoB,QAAyB;AAEjD,KAAI,IAAI,MAAM,SAAS,CACrB,QAAO;AAET,KAAI,IAAI,MAAM,cAAc,CAC1B,QAAO;AAET,KAAI,IAAI,SAAS,KAAK,CACpB,QAAO;AAET,QAAO;;;;;;;AAcT,MAAa,2BAA2B,eAAgD;AACtF,KAAI,CAAC,cAAc,WAAW,WAAW,EAEvC,QAAO,CAAC,iBAAiB,KAAK;AAGhC,QAAO,WACJ,KAAK,SAAS,iBAAiB,MAAM,CACrC,QAAQ,cAAmC,QAAQ,UAAU,CAAC;;;;;AAkCnE,MAAa,qBAAqB,OAAO,UAAoB,eAAsC;CACjG,MAAM,UAAU;;;;0BAIQ,KAAK,UAAU,SAAS,CAAC;;AAGjD,WAAU,KAAK,QAAQ,WAAW,EAAE,EAAE,WAAW,MAAM,CAAC;AACxD,eAAc,YAAY,QAAQ"}
@@ -0,0 +1,7 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
+ const require_purgeFromCode = require('./purger/optimized/purgeFromCode.cjs');
4
+ const require_purgeFromCode$1 = require('./purger/legacy/purgeFromCode.cjs');
5
+
6
+ exports.purgeFromCode = require_purgeFromCode$1.purgeFromCode;
7
+ exports.purgeFromCodeOptimized = require_purgeFromCode.purgeFromCodeOptimized;
@@ -0,0 +1,4 @@
1
+
2
+ import { PurgeFromCodeResult, purgeFromCode } from "./purger/legacy/purgeFromCode.cjs";
3
+ import { purgeFromCodeOptimized } from "./purger/optimized/purgeFromCode.cjs";
4
+ export { type PurgeFromCodeResult, purgeFromCode, purgeFromCodeOptimized };
@@ -0,0 +1,6 @@
1
+
2
+ import { PurgeFromCodeResult, purgeFromCode } from "./purger/legacy/purgeFromCode.js";
3
+ import "./purger/legacy/index.js";
4
+ import { purgeFromCodeOptimized } from "./purger/optimized/purgeFromCode.js";
5
+ import "./purger/optimized/index.js";
6
+ export { type PurgeFromCodeResult, purgeFromCode, purgeFromCodeOptimized };
@@ -0,0 +1,5 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
+ import { purgeFromCodeOptimized } from "./purger/optimized/purgeFromCode.js";
3
+ import { purgeFromCode } from "./purger/legacy/purgeFromCode.js";
4
+
5
+ export { purgeFromCode, purgeFromCodeOptimized };
@@ -1,19 +1,19 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- const require_runtime = require('../../../../_virtual/_rolldown/runtime.cjs');
3
- const require_index = require('../../../../css-tokens/dist/index.cjs');
4
- const require_index$1 = require('../../../../modes/dist/index.cjs');
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
5
3
  const require_getColorModeStyles = require('../utils/getColorModeStyles.cjs');
6
- let lodash_es = require("lodash-es");
4
+ let _yahoo_uds_css_tokens = require("@yahoo/uds-css-tokens");
5
+ let lodash_isString_js = require("lodash/isString.js");
6
+ lodash_isString_js = require_runtime.__toESM(lodash_isString_js);
7
+ let _yahoo_uds_modes = require("@yahoo/uds-modes");
7
8
 
8
- //#region ../tailwind/dist/tailwind/base/addColorModeVars.js
9
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
9
+ //#region src/tailwind/base/addColorModeVars.ts
10
10
  function addColorModeVars(tokens, { addBase, config }) {
11
11
  const styles = require_getColorModeStyles.getColorModeStyles(tokens);
12
12
  const parentConfigImportant = config().important;
13
13
  addBase({
14
- [(0, lodash_es.isString)(parentConfigImportant) ? parentConfigImportant : ":root"]: styles[require_index$1.DEFAULT_COLOR_MODE],
15
- [`.${require_index.LIGHT_COLOR_MODE_CLASSNAME}`]: styles.light,
16
- [`.${require_index.DARK_COLOR_MODE_CLASSNAME}`]: styles.dark
14
+ [(0, lodash_isString_js.default)(parentConfigImportant) ? parentConfigImportant : ":root"]: styles[_yahoo_uds_modes.DEFAULT_COLOR_MODE],
15
+ [`.${_yahoo_uds_css_tokens.LIGHT_COLOR_MODE_CLASSNAME}`]: styles.light,
16
+ [`.${_yahoo_uds_css_tokens.DARK_COLOR_MODE_CLASSNAME}`]: styles.dark
17
17
  });
18
18
  }
19
19
 
@@ -1,11 +1,10 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- import { DARK_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME } from "../../../../css-tokens/dist/index.js";
3
- import { DEFAULT_COLOR_MODE } from "../../../../modes/dist/index.js";
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
4
2
  import { getColorModeStyles } from "../utils/getColorModeStyles.js";
3
+ import { DARK_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME } from "@yahoo/uds-css-tokens";
5
4
  import { isString } from "lodash-es";
5
+ import { DEFAULT_COLOR_MODE } from "@yahoo/uds-modes";
6
6
 
7
- //#region ../tailwind/dist/tailwind/base/addColorModeVars.js
8
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
7
+ //#region src/tailwind/base/addColorModeVars.ts
9
8
  function addColorModeVars(tokens, { addBase, config }) {
10
9
  const styles = getColorModeStyles(tokens);
11
10
  const parentConfigImportant = config().important;
@@ -17,4 +16,5 @@ function addColorModeVars(tokens, { addBase, config }) {
17
16
  }
18
17
 
19
18
  //#endregion
20
- export { addColorModeVars };
19
+ export { addColorModeVars };
20
+ //# sourceMappingURL=addColorModeVars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addColorModeVars.js","names":[],"sources":["../../../src/tailwind/base/addColorModeVars.ts"],"sourcesContent":["import { DARK_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME } from '@yahoo/uds-css-tokens';\nimport { DEFAULT_COLOR_MODE } from '@yahoo/uds-modes';\nimport { isString } from 'lodash';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport type { WebTokens } from '../../utils/parseTokens';\nimport { getColorModeStyles } from '../utils/getColorModeStyles';\n\nexport function addColorModeVars(tokens: WebTokens, { addBase, config }: PluginAPI) {\n const styles = getColorModeStyles(tokens);\n\n const parentConfigImportant = config().important;\n const useImportNamespace = isString(parentConfigImportant);\n const rootSelector = useImportNamespace ? parentConfigImportant : ':root';\n\n addBase({\n [rootSelector]: styles[DEFAULT_COLOR_MODE],\n [`.${LIGHT_COLOR_MODE_CLASSNAME}`]: styles.light,\n [`.${DARK_COLOR_MODE_CLASSNAME}`]: styles.dark,\n });\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,iBAAiB,QAAmB,EAAE,SAAS,UAAqB;CAClF,MAAM,SAAS,mBAAmB,OAAO;CAEzC,MAAM,wBAAwB,QAAQ,CAAC;AAIvC,SAAQ;GAHmB,SAAS,sBAAsB,GAChB,wBAAwB,UAGhD,OAAO;GACtB,IAAI,+BAA+B,OAAO;GAC1C,IAAI,8BAA8B,OAAO;EAC3C,CAAC"}
@@ -1,40 +1,40 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- const require_runtime = require('../../../../_virtual/_rolldown/runtime.cjs');
3
- const require_index = require('../../../../css-tokens/dist/index.cjs');
4
- const require_index$1 = require('../../../../modes/dist/index.cjs');
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
5
3
  const require_getColorModeStyles = require('../utils/getColorModeStyles.cjs');
6
- let lodash_es = require("lodash-es");
4
+ let _yahoo_uds_css_tokens = require("@yahoo/uds-css-tokens");
5
+ let lodash_isString_js = require("lodash/isString.js");
6
+ lodash_isString_js = require_runtime.__toESM(lodash_isString_js);
7
+ let _yahoo_uds_modes = require("@yahoo/uds-modes");
7
8
 
8
- //#region ../tailwind/dist/tailwind/base/addColorModeVarsV2.js
9
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
9
+ //#region src/tailwind/base/addColorModeVarsV2.ts
10
10
  function addColorModeVarsV2(tokens, { addBase, config }) {
11
11
  const parentConfigImportant = config().important;
12
- const rootSelector = (0, lodash_es.isString)(parentConfigImportant) ? parentConfigImportant : ":root";
12
+ const rootSelector = (0, lodash_isString_js.default)(parentConfigImportant) ? parentConfigImportant : ":root";
13
13
  const styles = require_getColorModeStyles.getColorModeStyles(tokens);
14
14
  const stylesWithInvert = (key) => {
15
15
  const { colorScheme: _, ...stylesDefault } = styles[key];
16
16
  const { colorScheme: __, ...stylesInvert } = styles[key === "light" ? "dark" : "light"];
17
17
  return {
18
18
  ...stylesDefault,
19
- [`.${require_index.INVERT_COLOR_MODE_CLASSNAME}`]: stylesInvert
19
+ [`.${_yahoo_uds_css_tokens.INVERT_COLOR_MODE_CLASSNAME}`]: stylesInvert
20
20
  };
21
21
  };
22
22
  const lightWithInvert = stylesWithInvert("light");
23
23
  const darkWithInvert = stylesWithInvert("dark");
24
24
  addBase({
25
25
  [rootSelector]: {
26
- colorScheme: require_index$1.DEFAULT_COLOR_MODE,
27
- ...stylesWithInvert(require_index$1.DEFAULT_COLOR_MODE)
26
+ colorScheme: _yahoo_uds_modes.DEFAULT_COLOR_MODE,
27
+ ...stylesWithInvert(_yahoo_uds_modes.DEFAULT_COLOR_MODE)
28
28
  },
29
- [`.${require_index.SYSTEM_COLOR_MODE_CLASSNAME}`]: {
29
+ [`.${_yahoo_uds_css_tokens.SYSTEM_COLOR_MODE_CLASSNAME}`]: {
30
30
  colorScheme: "light dark",
31
31
  "@media (prefers-color-scheme: dark)": darkWithInvert
32
32
  },
33
- [`.${require_index.LIGHT_COLOR_MODE_CLASSNAME}`]: {
33
+ [`.${_yahoo_uds_css_tokens.LIGHT_COLOR_MODE_CLASSNAME}`]: {
34
34
  colorScheme: "light",
35
35
  ...lightWithInvert
36
36
  },
37
- [`.${require_index.DARK_COLOR_MODE_CLASSNAME}`]: {
37
+ [`.${_yahoo_uds_css_tokens.DARK_COLOR_MODE_CLASSNAME}`]: {
38
38
  colorScheme: "dark",
39
39
  ...darkWithInvert
40
40
  }
@@ -1,11 +1,10 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- import { DARK_COLOR_MODE_CLASSNAME, INVERT_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME, SYSTEM_COLOR_MODE_CLASSNAME } from "../../../../css-tokens/dist/index.js";
3
- import { DEFAULT_COLOR_MODE } from "../../../../modes/dist/index.js";
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
4
2
  import { getColorModeStyles } from "../utils/getColorModeStyles.js";
3
+ import { DARK_COLOR_MODE_CLASSNAME, INVERT_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME, SYSTEM_COLOR_MODE_CLASSNAME } from "@yahoo/uds-css-tokens";
5
4
  import { isString } from "lodash-es";
5
+ import { DEFAULT_COLOR_MODE } from "@yahoo/uds-modes";
6
6
 
7
- //#region ../tailwind/dist/tailwind/base/addColorModeVarsV2.js
8
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
7
+ //#region src/tailwind/base/addColorModeVarsV2.ts
9
8
  function addColorModeVarsV2(tokens, { addBase, config }) {
10
9
  const parentConfigImportant = config().important;
11
10
  const rootSelector = isString(parentConfigImportant) ? parentConfigImportant : ":root";
@@ -41,4 +40,5 @@ function addColorModeVarsV2(tokens, { addBase, config }) {
41
40
  }
42
41
 
43
42
  //#endregion
44
- export { addColorModeVarsV2 };
43
+ export { addColorModeVarsV2 };
44
+ //# sourceMappingURL=addColorModeVarsV2.js.map