@yahoo/uds 3.117.0 → 3.117.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +1 -1
  8. package/dist/styles/styler.d.ts +1 -1
  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 +9 -9
  328. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.cts.map +1 -0
  329. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.ts +9 -9
  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 +234 -234
  375. package/dist/uds/generated/componentData.js +234 -234
  376. package/generated/componentData.json +324 -324
  377. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purgeFromCode.js","names":[],"sources":["../../../src/purger/legacy/purgeFromCode.ts"],"sourcesContent":["import {\n DARK_COLOR_MODE_CLASSNAME,\n LARGE_SCALE_MODE_CLASSNAME,\n LIGHT_COLOR_MODE_CLASSNAME,\n} from '@yahoo/uds-css-tokens';\nimport { Project, ts } from 'ts-morph';\n\nimport type { GeneratedPurgeCSSData } from './purgeCSS';\nimport { getComponentsToConvertToTW, getTailwindSafelist, parseFiles } from './purgeCSS';\n\ninterface PurgeFromCodeResult {\n safelist: string[];\n imports: string[];\n components: string[];\n error?: string;\n}\n\ninterface PurgeFromCodeOptions {\n colorModes?: ('dark' | 'light')[];\n variants: Record<string, Record<string, string>>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n packageJson: Record<string, any>;\n generatedPurgeCssData: GeneratedPurgeCSSData;\n}\n\nconst COLOR_MODE_CLASSES: Record<string, string> = {\n dark: DARK_COLOR_MODE_CLASSNAME,\n light: LIGHT_COLOR_MODE_CLASSNAME,\n};\n\n/**\n * Run the legacy purger on a code string and return the safelist.\n * This uses the same logic as the CLI `uds purge` command but with in-memory files.\n *\n * @param code - The TypeScript/TSX code to analyze\n * @param options - Configuration options for color modes\n * @returns The purge result containing safelist, imports, and components\n */\nfunction purgeFromCode(code: string, options: PurgeFromCodeOptions): PurgeFromCodeResult {\n const { colorModes = ['dark', 'light'] } = options;\n\n try {\n const project = new Project({\n useInMemoryFileSystem: true,\n compilerOptions: {\n jsx: ts.JsxEmit.ReactJSX,\n jsxImportSource: 'react',\n target: ts.ScriptTarget.ESNext,\n module: ts.ModuleKind.ESNext,\n moduleResolution: ts.ModuleResolutionKind.NodeJs,\n esModuleInterop: true,\n strict: true,\n },\n });\n\n const sourceFile = project.createSourceFile('user-code.tsx', code);\n\n const imports = parseFiles(project, [sourceFile.getFilePath()]);\n const components = getComponentsToConvertToTW(imports, options.generatedPurgeCssData);\n const safelist = getTailwindSafelist(\n project,\n components,\n options.variants,\n options.generatedPurgeCssData,\n options.packageJson,\n );\n\n // Add color mode classes\n for (const mode of colorModes) {\n const cls = COLOR_MODE_CLASSES[mode];\n if (cls) {\n safelist.push(cls);\n }\n }\n\n // Always include large scale mode\n safelist.push(LARGE_SCALE_MODE_CLASSNAME);\n\n return {\n safelist: Array.from(new Set(safelist)),\n imports,\n components,\n };\n } catch (error) {\n return {\n safelist: [],\n imports: [],\n components: [],\n error: error instanceof Error ? error.message : 'Unknown error',\n };\n }\n}\n\nexport type { PurgeFromCodeOptions, PurgeFromCodeResult };\nexport { purgeFromCode };\n"],"mappings":";;;;;;AAyBA,MAAM,qBAA6C;CACjD,MAAM;CACN,OAAO;CACR;;;;;;;;;AAUD,SAAS,cAAc,MAAc,SAAoD;CACvF,MAAM,EAAE,aAAa,CAAC,QAAQ,QAAQ,KAAK;AAE3C,KAAI;EACF,MAAM,UAAU,IAAI,QAAQ;GAC1B,uBAAuB;GACvB,iBAAiB;IACf,KAAK,GAAG,QAAQ;IAChB,iBAAiB;IACjB,QAAQ,GAAG,aAAa;IACxB,QAAQ,GAAG,WAAW;IACtB,kBAAkB,GAAG,qBAAqB;IAC1C,iBAAiB;IACjB,QAAQ;IACT;GACF,CAAC;EAIF,MAAM,UAAU,WAAW,SAAS,CAFjB,QAAQ,iBAAiB,iBAAiB,KAAK,CAElB,aAAa,CAAC,CAAC;EAC/D,MAAM,aAAa,2BAA2B,SAAS,QAAQ,sBAAsB;EACrF,MAAM,WAAW,oBACf,SACA,YACA,QAAQ,UACR,QAAQ,uBACR,QAAQ,YACT;AAGD,OAAK,MAAM,QAAQ,YAAY;GAC7B,MAAM,MAAM,mBAAmB;AAC/B,OAAI,IACF,UAAS,KAAK,IAAI;;AAKtB,WAAS,KAAK,2BAA2B;AAEzC,SAAO;GACL,UAAU,MAAM,KAAK,IAAI,IAAI,SAAS,CAAC;GACvC;GACA;GACD;UACM,OAAO;AACd,SAAO;GACL,UAAU,EAAE;GACZ,SAAS,EAAE;GACX,YAAY,EAAE;GACd,OAAO,iBAAiB,QAAQ,MAAM,UAAU;GACjD"}
@@ -1,13 +1,12 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- const require_runtime = require('../../../../../_virtual/_rolldown/runtime.cjs');
3
- let node_path = require("node:path");
4
- node_path = require_runtime.__toESM(node_path);
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
+ const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
5
3
  let node_fs = require("node:fs");
6
4
  node_fs = require_runtime.__toESM(node_fs);
5
+ let node_path = require("node:path");
6
+ node_path = require_runtime.__toESM(node_path);
7
7
  let ts_morph = require("ts-morph");
8
8
 
9
- //#region ../tailwind/dist/purger/optimized/ast/expressions.js
10
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
9
+ //#region src/purger/optimized/ast/expressions.ts
11
10
  const importedSourceProject = new ts_morph.Project({ useInMemoryFileSystem: true });
12
11
  const importedSourceFileCache = /* @__PURE__ */ new Map();
13
12
  const tsConfigPathCache = /* @__PURE__ */ new Map();
@@ -0,0 +1,2 @@
1
+
2
+ import { Node } from "ts-morph";
@@ -1,10 +1,9 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- import path from "node:path";
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
3
2
  import fs from "node:fs";
3
+ import path from "node:path";
4
4
  import { Node, Project, SyntaxKind, ts } from "ts-morph";
5
5
 
6
- //#region ../tailwind/dist/purger/optimized/ast/expressions.js
7
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
6
+ //#region src/purger/optimized/ast/expressions.ts
8
7
  const importedSourceProject = new Project({ useInMemoryFileSystem: true });
9
8
  const importedSourceFileCache = /* @__PURE__ */ new Map();
10
9
  const tsConfigPathCache = /* @__PURE__ */ new Map();
@@ -286,4 +285,5 @@ const extractLiteralValuesFromType = (node) => {
286
285
  };
287
286
 
288
287
  //#endregion
289
- export { extractStringLiterals };
288
+ export { extractStringLiterals };
289
+ //# sourceMappingURL=expressions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expressions.js","names":[],"sources":["../../../../src/purger/optimized/ast/expressions.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { Node, Project, SyntaxKind, ts } from 'ts-morph';\n\nconst importedSourceProject = new Project({ useInMemoryFileSystem: true });\nconst importedSourceFileCache = new Map<string, ReturnType<Project['createSourceFile']>>();\nconst tsConfigPathCache = new Map<string, string | null>();\nconst compilerOptionsCache = new Map<string, ts.CompilerOptions | null>();\nconst hasImportQuery = (moduleSpecifier: string): boolean => moduleSpecifier.includes('?');\n\nconst isExistingFile = (candidate: string): boolean =>\n fs.existsSync(candidate) && fs.statSync(candidate).isFile();\n\nconst resolveRelativeImportPath = (\n sourceFilePath: string,\n moduleSpecifier: string,\n): string | null => {\n if (\n !path.isAbsolute(sourceFilePath) ||\n !moduleSpecifier.startsWith('.') ||\n hasImportQuery(moduleSpecifier)\n ) {\n return null;\n }\n\n const basePath = path.resolve(path.dirname(sourceFilePath), moduleSpecifier);\n const candidates = [\n basePath,\n `${basePath}.ts`,\n `${basePath}.tsx`,\n `${basePath}.js`,\n `${basePath}.jsx`,\n path.join(basePath, 'index.ts'),\n path.join(basePath, 'index.tsx'),\n path.join(basePath, 'index.js'),\n path.join(basePath, 'index.jsx'),\n ];\n\n return candidates.find((candidate) => isExistingFile(candidate)) ?? null;\n};\n\nconst findNearestTypeScriptConfig = (sourceFilePath: string): string | null => {\n const sourceDir = path.dirname(sourceFilePath);\n const cached = tsConfigPathCache.get(sourceDir);\n\n if (cached !== undefined) {\n return cached;\n }\n\n let currentDir = sourceDir;\n\n while (true) {\n const tsConfigPath = path.join(currentDir, 'tsconfig.json');\n if (isExistingFile(tsConfigPath)) {\n tsConfigPathCache.set(sourceDir, tsConfigPath);\n return tsConfigPath;\n }\n\n const jsConfigPath = path.join(currentDir, 'jsconfig.json');\n if (isExistingFile(jsConfigPath)) {\n tsConfigPathCache.set(sourceDir, jsConfigPath);\n return jsConfigPath;\n }\n\n const parentDir = path.dirname(currentDir);\n if (parentDir === currentDir) {\n tsConfigPathCache.set(sourceDir, null);\n return null;\n }\n\n currentDir = parentDir;\n }\n};\n\nconst getCompilerOptionsForSourceFile = (sourceFilePath: string): ts.CompilerOptions | null => {\n const configPath = findNearestTypeScriptConfig(sourceFilePath);\n if (!configPath) {\n return null;\n }\n\n const cached = compilerOptionsCache.get(configPath);\n if (cached !== undefined) {\n return cached;\n }\n\n const readResult = ts.readConfigFile(configPath, ts.sys.readFile);\n if (readResult.error) {\n compilerOptionsCache.set(configPath, null);\n return null;\n }\n\n const parsed = ts.parseJsonConfigFileContent(readResult.config, ts.sys, path.dirname(configPath));\n\n const compilerOptions =\n parsed.options.paths && !parsed.options.baseUrl\n ? { ...parsed.options, baseUrl: path.dirname(configPath) }\n : parsed.options;\n\n compilerOptionsCache.set(configPath, compilerOptions);\n return compilerOptions;\n};\n\nconst resolveConfigImportPath = (\n sourceFilePath: string,\n moduleSpecifier: string,\n): string | null => {\n if (hasImportQuery(moduleSpecifier)) {\n return null;\n }\n\n const compilerOptions = getCompilerOptionsForSourceFile(sourceFilePath);\n if (!compilerOptions) {\n return null;\n }\n\n const resolvedModule = ts.resolveModuleName(\n moduleSpecifier,\n sourceFilePath,\n compilerOptions,\n ts.sys,\n ).resolvedModule;\n\n if (!resolvedModule) {\n return null;\n }\n\n return isExistingFile(resolvedModule.resolvedFileName) ? resolvedModule.resolvedFileName : null;\n};\n\nconst resolveImportPath = (sourceFilePath: string, moduleSpecifier: string): string | null =>\n moduleSpecifier.startsWith('.')\n ? resolveRelativeImportPath(sourceFilePath, moduleSpecifier)\n : resolveConfigImportPath(sourceFilePath, moduleSpecifier);\n\nconst getImportedSourceFile = (filePath: string) => {\n const cached = importedSourceFileCache.get(filePath);\n if (cached) {\n return cached;\n }\n\n if (!fs.existsSync(filePath)) {\n return null;\n }\n\n const sourceFile = importedSourceProject.createSourceFile(\n filePath,\n fs.readFileSync(filePath, 'utf-8'),\n {\n overwrite: true,\n },\n );\n importedSourceFileCache.set(filePath, sourceFile);\n return sourceFile;\n};\n\nconst extractImportedIdentifierValues = (node: Node, visited: Set<Node>): string[] => {\n if (!Node.isIdentifier(node)) {\n return [];\n }\n\n const sourceFile = node.getSourceFile();\n const sourceFilePath = sourceFile.getFilePath();\n const importMatch = sourceFile\n .getImportDeclarations()\n .find((importDecl) =>\n importDecl\n .getNamedImports()\n .some(\n (namedImport) =>\n (namedImport.getAliasNode()?.getText() ?? namedImport.getName()) === node.getText(),\n ),\n );\n\n if (!importMatch) {\n return [];\n }\n\n const namedImport = importMatch\n .getNamedImports()\n .find(\n (candidate) =>\n (candidate.getAliasNode()?.getText() ?? candidate.getName()) === node.getText(),\n );\n\n if (!namedImport) {\n return [];\n }\n\n const resolvedPath = resolveImportPath(sourceFilePath, importMatch.getModuleSpecifierValue());\n if (!resolvedPath) {\n return [];\n }\n\n const importedSourceFile = getImportedSourceFile(resolvedPath);\n if (!importedSourceFile) {\n return [];\n }\n\n const declaration = importedSourceFile.getVariableDeclaration(namedImport.getName());\n const initializer = declaration?.getInitializer();\n return initializer ? extractStringLiterals(initializer, visited) : [];\n};\n\n/**\n * Extracts string literal values from an expression.\n *\n * Handles:\n * - Direct string literals: 'value'\n * - Ternary expressions: condition ? 'a' : 'b' -> ['a', 'b']\n * - Variable references: traces back to initializer\n * - Logical expressions: a || 'fallback', a ?? 'default'\n * - Function calls: traces to return statements\n * - Template literals: `value`\n * - As expressions: value as Type\n *\n * @param node The expression node to extract values from\n * @param visited Set of visited nodes to prevent infinite recursion\n * @returns Array of extracted string literal values\n */\nconst extractStringLiterals = (node: Node, visited: Set<Node> = new Set()): string[] => {\n if (visited.has(node)) {\n return [];\n }\n visited.add(node);\n\n const directValues = extractDirectLiteralValues(node);\n if (directValues) {\n return directValues;\n }\n\n const templateValues = extractTemplateExpressionValues(node, visited);\n if (templateValues) {\n return templateValues;\n }\n\n // Ternary/conditional expression: condition ? 'a' : 'b'\n if (Node.isConditionalExpression(node)) {\n return [\n ...extractStringLiterals(node.getWhenTrue(), visited),\n ...extractStringLiterals(node.getWhenFalse(), visited),\n ];\n }\n\n const binaryValues = extractBinaryExpressionValues(node, visited);\n if (binaryValues) {\n return binaryValues;\n }\n\n const wrappedExpressionValues = extractWrappedExpressionValues(node, visited);\n if (wrappedExpressionValues) {\n return wrappedExpressionValues;\n }\n\n const propertyAccessValues = extractPropertyAccessValues(node, visited);\n if (propertyAccessValues) {\n return propertyAccessValues;\n }\n\n const elementAccessValues = extractElementAccessValues(node);\n if (elementAccessValues) {\n return elementAccessValues;\n }\n\n const callExpressionValues = extractCallExpressionValues(node, visited);\n if (callExpressionValues) {\n return callExpressionValues;\n }\n\n const identifierValues = extractIdentifierValues(node, visited);\n if (identifierValues) {\n return identifierValues;\n }\n\n return [];\n};\n\nconst extractDirectLiteralValues = (node: Node): string[] | null => {\n if (Node.isStringLiteral(node) || Node.isNoSubstitutionTemplateLiteral(node)) {\n return [node.getLiteralValue()];\n }\n\n return null;\n};\n\nconst extractTemplateExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isTemplateExpression(node)) {\n return null;\n }\n\n const parts: string[][] = [[node.getHead().getLiteralText()]];\n\n node.getTemplateSpans().forEach((span) => {\n const exprValues = extractStringLiterals(span.getExpression(), visited);\n const literalText = span.getLiteral().getLiteralText();\n parts.push(\n exprValues.length > 0\n ? exprValues.map((value) => `${value}${literalText}`)\n : ['', literalText],\n );\n });\n\n return parts\n .reduce<\n string[]\n >((acc, segment) => acc.flatMap((base) => segment.map((frag) => `${base}${frag}`)), [''])\n .filter((value) => value.length > 0);\n};\n\nconst extractBinaryExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isBinaryExpression(node)) {\n return null;\n }\n\n const operator = node.getOperatorToken().getText();\n if (operator === '+') {\n const left = extractStringLiterals(node.getLeft(), visited);\n const right = extractStringLiterals(node.getRight(), visited);\n const combined = left.flatMap((l) => right.map((r) => `${l}${r}`));\n return combined.length > 0 ? combined : [];\n }\n\n if (operator === '||' || operator === '??') {\n return [\n ...extractStringLiterals(node.getLeft(), visited),\n ...extractStringLiterals(node.getRight(), visited),\n ];\n }\n\n return [];\n};\n\nconst extractWrappedExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (Node.isParenthesizedExpression(node) || Node.isAsExpression(node)) {\n return extractStringLiterals(node.getExpression(), visited);\n }\n\n return null;\n};\n\nconst extractPropertyAccessValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isPropertyAccessExpression(node)) {\n return null;\n }\n\n const typeValues = extractLiteralValuesFromType(node);\n if (typeValues.length > 0) {\n return typeValues;\n }\n\n const propertyName = node.getName();\n return extractObjectValues(node.getExpression(), visited)\n .filter(\n (value): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && propertyName in value,\n )\n .map((value) => value[propertyName])\n .filter((value): value is string => typeof value === 'string');\n};\n\nconst extractElementAccessValues = (node: Node): string[] | null => {\n if (!Node.isElementAccessExpression(node)) {\n return null;\n }\n\n return extractLiteralValuesFromType(node);\n};\n\nconst extractCallExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isCallExpression(node)) {\n return null;\n }\n\n const expression = node.getExpression();\n\n const fromDefinitions = Node.isIdentifier(expression)\n ? expression.getDefinitionNodes().flatMap((definition) => {\n if (Node.isFunctionDeclaration(definition)) {\n return definition\n .getDescendantsOfKind(SyntaxKind.ReturnStatement)\n .flatMap((returnStmt) => {\n const expression = returnStmt.getExpression();\n return expression ? extractStringLiterals(expression, visited) : [];\n });\n }\n\n if (Node.isVariableDeclaration(definition)) {\n const initializer = definition.getInitializer();\n return initializer ? extractFromFunctionLike(initializer, visited) : [];\n }\n\n return [];\n })\n : [];\n\n const fromArguments = node.getArguments().flatMap((arg) => extractStringLiterals(arg, visited));\n\n return [...fromDefinitions, ...fromArguments];\n};\n\nconst extractIdentifierValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isIdentifier(node)) {\n return null;\n }\n\n const values = node.getDefinitionNodes().flatMap((definition) => {\n if (\n Node.isVariableDeclaration(definition) ||\n Node.isParameterDeclaration(definition) ||\n Node.isBindingElement(definition)\n ) {\n const initializer = definition.getInitializer();\n return initializer ? extractStringLiterals(initializer, visited) : [];\n }\n\n return [];\n });\n\n if (values.length > 0) {\n return values;\n }\n\n const importedValues = extractImportedIdentifierValues(node, visited);\n if (importedValues.length > 0) {\n return importedValues;\n }\n\n return extractLiteralValuesFromType(node);\n};\n\n/**\n * Extract string literals from arrow functions or function expressions\n */\nconst extractFromFunctionLike = (node: Node, visited: Set<Node>): string[] => {\n const values: string[] = [];\n\n if (Node.isArrowFunction(node)) {\n const body = node.getBody();\n if (Node.isBlock(body)) {\n body.getDescendantsOfKind(SyntaxKind.ReturnStatement).forEach((returnStmt) => {\n const returnExpr = returnStmt.getExpression();\n if (returnExpr) {\n values.push(...extractStringLiterals(returnExpr, visited));\n }\n });\n } else {\n values.push(...extractStringLiterals(body, visited));\n }\n } else if (Node.isFunctionExpression(node)) {\n node.getDescendantsOfKind(SyntaxKind.ReturnStatement).forEach((returnStmt) => {\n const returnExpr = returnStmt.getExpression();\n if (returnExpr) {\n values.push(...extractStringLiterals(returnExpr, visited));\n }\n });\n }\n\n return values;\n};\n\n/**\n * Extract object literal values from an expression.\n * Returns an array of all possible object values (for union types or indexed access).\n */\nconst extractObjectValues = (node: Node, visited: Set<Node>): unknown[] => {\n if (visited.has(node)) {\n return [];\n }\n visited.add(node);\n\n const values: unknown[] = [];\n\n // Object literal expression\n if (Node.isObjectLiteralExpression(node)) {\n const obj: Record<string, unknown> = {};\n node.getProperties().forEach((prop) => {\n if (Node.isPropertyAssignment(prop)) {\n const name = prop.getName();\n const init = prop.getInitializer();\n if (init && Node.isStringLiteral(init)) {\n obj[name] = init.getLiteralValue();\n } else if (init && Node.isObjectLiteralExpression(init)) {\n const nestedValues = extractObjectValues(init, visited);\n if (nestedValues.length > 0) {\n obj[name] = nestedValues[0];\n }\n }\n }\n });\n values.push(obj);\n return values;\n }\n\n // Identifier - trace to initializer\n if (Node.isIdentifier(node)) {\n node.getDefinitionNodes().forEach((definition) => {\n if (Node.isVariableDeclaration(definition)) {\n const initializer = definition.getInitializer();\n if (initializer) {\n // Handle 'as const' assertion\n if (Node.isAsExpression(initializer)) {\n const inner = initializer.getExpression();\n values.push(...extractObjectValues(inner, visited));\n } else {\n values.push(...extractObjectValues(initializer, visited));\n }\n }\n }\n });\n return values;\n }\n\n // Element access - return all values from the object\n if (Node.isElementAccessExpression(node)) {\n const expression = node.getExpression();\n const baseObjects = extractObjectValues(expression, visited);\n\n // For indexed access, return all possible values\n baseObjects.forEach((obj) => {\n if (typeof obj === 'object' && obj !== null) {\n Object.values(obj).forEach((value) => values.push(value));\n }\n });\n return values;\n }\n\n return values;\n};\n\n/**\n * Extract literal values from a TypeScript type (for union types like 'brand' | 'secondary')\n */\nexport const extractLiteralValuesFromType = (node: Node): string[] => {\n const values: string[] = [];\n const nodeType = node.getType();\n\n if (nodeType.isUnion()) {\n nodeType.getUnionTypes().forEach((unionMember) => {\n if (unionMember.isStringLiteral()) {\n values.push(unionMember.getLiteralValue() as string);\n }\n });\n } else if (nodeType.isStringLiteral()) {\n values.push(nodeType.getLiteralValue() as string);\n }\n\n return values;\n};\n\nexport { extractStringLiterals };\n"],"mappings":";;;;;;AAKA,MAAM,wBAAwB,IAAI,QAAQ,EAAE,uBAAuB,MAAM,CAAC;AAC1E,MAAM,0CAA0B,IAAI,KAAsD;AAC1F,MAAM,oCAAoB,IAAI,KAA4B;AAC1D,MAAM,uCAAuB,IAAI,KAAwC;AACzE,MAAM,kBAAkB,oBAAqC,gBAAgB,SAAS,IAAI;AAE1F,MAAM,kBAAkB,cACtB,GAAG,WAAW,UAAU,IAAI,GAAG,SAAS,UAAU,CAAC,QAAQ;AAE7D,MAAM,6BACJ,gBACA,oBACkB;AAClB,KACE,CAA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,KAAK,SAAS;AAE/B,KAAI,SAAS,SAAS,CACpB,UAAS,eAAe,CAAC,SAAS,gBAAgB;AAChD,MAAI,YAAY,iBAAiB,CAC/B,QAAO,KAAK,YAAY,iBAAiB,CAAW;GAEtD;UACO,SAAS,iBAAiB,CACnC,QAAO,KAAK,SAAS,iBAAiB,CAAW;AAGnD,QAAO"}
@@ -0,0 +1,5 @@
1
+
2
+ import "./expressions.js";
3
+ import "./jsx.js";
4
+ import "./props.js";
5
+ import "./spread.js";
@@ -1,9 +1,8 @@
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
  let ts_morph = require("ts-morph");
4
4
 
5
- //#region ../tailwind/dist/purger/optimized/ast/jsx.js
6
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
5
+ //#region src/purger/optimized/ast/jsx.ts
7
6
  /**
8
7
  * Find all JSX usages of a component from its identifier
9
8
  */
@@ -0,0 +1,3 @@
1
+
2
+ import "../types.js";
3
+ import { Node } from "ts-morph";
@@ -1,8 +1,7 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
2
  import { Node, SyntaxKind } from "ts-morph";
3
3
 
4
- //#region ../tailwind/dist/purger/optimized/ast/jsx.js
5
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
4
+ //#region src/purger/optimized/ast/jsx.ts
6
5
  /**
7
6
  * Find all JSX usages of a component from its identifier
8
7
  */
@@ -15,4 +14,5 @@ const findJsxReferences = (identifier) => {
15
14
  };
16
15
 
17
16
  //#endregion
18
- export { findJsxReferences };
17
+ export { findJsxReferences };
18
+ //# sourceMappingURL=jsx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx.js","names":[],"sources":["../../../../src/purger/optimized/ast/jsx.ts"],"sourcesContent":["import type {\n ArrowFunction,\n CallExpression,\n FunctionDeclaration,\n FunctionExpression,\n Identifier,\n JsxElement,\n JsxSelfClosingElement,\n VariableDeclaration,\n} from 'ts-morph';\nimport { Node, SyntaxKind } from 'ts-morph';\n\nimport type { JsxElementWithAttributes, ParentComponentInfo } from '../types';\n\n/**\n * Check if an expression is using React.forwardRef\n */\nexport const isForwardRefExpression = (node: Node): node is CallExpression => {\n if (!Node.isCallExpression(node)) {\n return false;\n }\n\n const expression = node.getExpression();\n\n if (Node.isIdentifier(expression) && expression.getText() === 'forwardRef') {\n return true;\n }\n\n if (Node.isPropertyAccessExpression(expression) && expression.getText() === 'React.forwardRef') {\n return true;\n }\n\n return false;\n};\n\n/**\n * Check if a node is a JSX component (PascalCase name)\n */\nexport const isJsxComponent = (\n node: Node,\n): node is VariableDeclaration | FunctionDeclaration | FunctionExpression | ArrowFunction => {\n let name: string | undefined;\n\n if (\n Node.isVariableDeclaration(node) ||\n Node.isFunctionDeclaration(node) ||\n Node.isClassDeclaration(node)\n ) {\n name = node.getName();\n } else if (Node.isFunctionExpression(node) || Node.isArrowFunction(node)) {\n const variableDeclaration = node.getFirstAncestorByKind(SyntaxKind.VariableDeclaration);\n name = variableDeclaration?.getName();\n }\n\n return name ? /^[A-Z]/.test(name) : false;\n};\n\n/**\n * Get the function declaration from a component, unwrapping forwardRef if needed\n */\nexport const getReactFunctionDeclaration = (\n declaration: Node,\n): ArrowFunction | FunctionDeclaration | FunctionExpression | null => {\n if (!isJsxComponent(declaration)) {\n return null;\n }\n\n if (Node.isFunctionDeclaration(declaration)) {\n return declaration;\n }\n\n if (Node.isVariableDeclaration(declaration)) {\n const initializer = declaration.getInitializer();\n if (!initializer) {\n return null;\n }\n\n if (isForwardRefExpression(initializer)) {\n const [arg] = initializer.getArguments();\n if (\n Node.isFunctionDeclaration(arg) ||\n Node.isFunctionExpression(arg) ||\n Node.isArrowFunction(arg)\n ) {\n return arg;\n }\n } else if (\n Node.isFunctionDeclaration(initializer) ||\n Node.isFunctionExpression(initializer) ||\n Node.isArrowFunction(initializer)\n ) {\n return initializer;\n }\n }\n\n return null;\n};\n\n/**\n * Get all JSX elements from a node\n */\nexport const getJsxElements = (node: Node): (JsxElement | JsxSelfClosingElement)[] => {\n return node\n .getDescendants()\n .filter((n) => Node.isJsxElement(n) || Node.isJsxSelfClosingElement(n)) as (\n | JsxElement\n | JsxSelfClosingElement\n )[];\n};\n\n/**\n * Find all JSX usages of a component from its identifier\n */\nexport const findJsxReferences = (identifier: Identifier): JsxElementWithAttributes[] => {\n try {\n return identifier\n .findReferencesAsNodes()\n .map((reference) =>\n reference.getFirstAncestor(\n (n) => Node.isJsxOpeningElement(n) || Node.isJsxSelfClosingElement(n),\n ),\n )\n .filter(\n (node): node is JsxElementWithAttributes =>\n Boolean(node) && (Node.isJsxOpeningElement(node) || Node.isJsxSelfClosingElement(node)),\n );\n } catch {\n return [];\n }\n};\n\n/**\n * Get the parent component that contains a JSX reference.\n * Returns information about the component including spread rest identifier.\n */\nexport const getParentComponentInfo = (\n reference: JsxElementWithAttributes,\n): ParentComponentInfo | undefined => {\n // Walk up to find the parent component\n const block = reference.getParentWhile((parent) => !getReactFunctionDeclaration(parent));\n if (!block) {\n return undefined;\n }\n\n const blockParent = block.getParent();\n if (!blockParent) {\n return undefined;\n }\n\n const reactComponent = getReactFunctionDeclaration(blockParent);\n if (!reactComponent) {\n return undefined;\n }\n\n // Get component name\n let componentName: string | undefined;\n const variableDeclaration = reactComponent.getFirstAncestorByKind(SyntaxKind.VariableDeclaration);\n if (variableDeclaration) {\n componentName = variableDeclaration.getName();\n } else if (Node.isFunctionDeclaration(reactComponent)) {\n componentName = reactComponent.getName();\n }\n\n if (!componentName) {\n return undefined;\n }\n\n // Extract parameter info\n let spreadRestIdentifier: string | undefined;\n let paramIdentifier: string | undefined;\n\n reactComponent.getParameters().forEach((parameter) => {\n const objectBindingPattern = parameter.getChildrenOfKind(SyntaxKind.ObjectBindingPattern)[0];\n const identifier = parameter.getChildrenOfKind(SyntaxKind.Identifier)[0];\n\n if (objectBindingPattern) {\n const dotDotToken = objectBindingPattern.getFirstDescendantByKind(SyntaxKind.DotDotDotToken);\n if (dotDotToken) {\n spreadRestIdentifier = dotDotToken\n .getParent()\n ?.getFirstChildByKindOrThrow(SyntaxKind.Identifier)\n .getText();\n }\n } else if (identifier) {\n paramIdentifier = identifier.getText();\n }\n });\n\n return { componentName, spreadRestIdentifier, paramIdentifier };\n};\n"],"mappings":";;;;;;;AAiHA,MAAa,qBAAqB,eAAuD;AACvF,KAAI;AACF,SAAO,WACJ,uBAAuB,CACvB,KAAK,cACJ,UAAU,kBACP,MAAM,KAAK,oBAAoB,EAAE,IAAI,KAAK,wBAAwB,EAAE,CACtE,CACF,CACA,QACE,SACC,QAAQ,KAAK,KAAK,KAAK,oBAAoB,KAAK,IAAI,KAAK,wBAAwB,KAAK,EACzF;SACG;AACN,SAAO,EAAE"}
@@ -0,0 +1,2 @@
1
+
2
+ import "../types.js";
@@ -0,0 +1,3 @@
1
+
2
+ import "../types.js";
3
+ import { Project } from "ts-morph";
@@ -0,0 +1,6 @@
1
+
2
+ import { PurgeStats } from "./types.js";
3
+ import "./purge.js";
4
+ import { PurgeFromCodeResult, purgeFromCodeOptimized } from "./purgeFromCode.js";
5
+ import "./ast/index.js";
6
+ import "./utils/files.js";
@@ -1,16 +1,15 @@
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_purgeFromCode = require('./purgeFromCode.cjs');
4
4
  const require_entryPoints = require('../../utils/entryPoints.cjs');
5
5
  const require_safelist = require('./utils/safelist.cjs');
6
6
  const require_files = require('./utils/files.cjs');
7
- let node_path = require("node:path");
8
- node_path = require_runtime.__toESM(node_path);
9
7
  let node_fs = require("node:fs");
10
8
  node_fs = require_runtime.__toESM(node_fs);
9
+ let node_path = require("node:path");
10
+ node_path = require_runtime.__toESM(node_path);
11
11
 
12
- //#region ../tailwind/dist/purger/optimized/purge.js
13
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
12
+ //#region src/purger/optimized/purge.ts
14
13
  const warnedLocations = /* @__PURE__ */ new Set();
15
14
  /**
16
15
  * Clear warned locations (call at start of new purge run)
@@ -0,0 +1,2 @@
1
+
2
+ import "./types.js";
@@ -1,13 +1,12 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
2
  import { purgeFromCodeOptimized } from "./purgeFromCode.js";
3
3
  import { DEFAULT_ENTRY } from "../../utils/entryPoints.js";
4
4
  import { deduplicateSafelist, getThemeAndScaleClasses, saveSafelistToFile } from "./utils/safelist.js";
5
5
  import { scanForFiles } from "./utils/files.js";
6
- import path from "node:path";
7
6
  import fs from "node:fs";
7
+ import path from "node:path";
8
8
 
9
- //#region ../tailwind/dist/purger/optimized/purge.js
10
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
9
+ //#region src/purger/optimized/purge.ts
11
10
  const warnedLocations = /* @__PURE__ */ new Set();
12
11
  /**
13
12
  * Clear warned locations (call at start of new purge run)
@@ -65,4 +64,5 @@ const purgeOptimized = async (options) => {
65
64
  };
66
65
 
67
66
  //#endregion
68
- export { purgeOptimized };
67
+ export { purgeOptimized };
68
+ //# sourceMappingURL=purge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purge.js","names":[],"sources":["../../../src/purger/optimized/purge.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { DEFAULT_ENTRY } from '../../utils/entryPoints';\nimport { purgeFromCodeOptimized } from './purgeFromCode';\nimport type { PurgeOptions, PurgeResult, PurgeStats } from './types';\nimport { scanForFiles } from './utils/files';\nimport { deduplicateSafelist, getThemeAndScaleClasses, saveSafelistToFile } from './utils/safelist';\n\n// Track warned locations to avoid duplicates\nconst warnedLocations = new Set<string>();\n\n/**\n * Clear warned locations (call at start of new purge run)\n */\nexport const clearWarnings = (): void => {\n warnedLocations.clear();\n};\n\n/**\n * Main purge function - optimized version\n *\n * Uses purgeFromCodeOptimized internally to ensure consistent behavior\n * between CLI and playground.\n */\nexport const purgeOptimized = async (options: PurgeOptions): Promise<PurgeResult> => {\n const {\n entry = DEFAULT_ENTRY,\n output = 'dist/safelist.ts',\n colorModes = ['dark'], // Light mode is already in :root\n variants,\n autoVariants,\n componentData,\n } = options;\n\n const startTime = performance.now();\n clearWarnings();\n\n const workspaceDir = process.env.PWD ?? process.cwd();\n\n const files = await scanForFiles(entry);\n\n // Aggregate results from all files\n const allClasses: string[] = [];\n const allImports = new Set<string>();\n const allComponents = new Set<string>();\n\n const stats: PurgeStats = {\n filesScanned: files.length,\n timeMs: 0,\n classesGenerated: 0,\n spreadsTraced: 0,\n expressionsResolved: 0,\n };\n\n // Process each file using purgeFromCodeOptimized\n const results = await Promise.all(\n files.map(async (filePath) => {\n const code = fs.readFileSync(filePath, 'utf-8');\n return purgeFromCodeOptimized(code, {\n colorModes,\n variants,\n autoVariants,\n componentData,\n });\n }),\n );\n\n results.forEach((result) => {\n allClasses.push(...result.safelist);\n result.imports.forEach((imp) => allImports.add(imp));\n result.components.forEach((comp) => allComponents.add(comp));\n stats.spreadsTraced += result.stats.spreadsTraced;\n stats.expressionsResolved += result.stats.expressionsResolved;\n });\n\n // Add color mode classes\n allClasses.push(...getThemeAndScaleClasses(colorModes));\n\n const finalSafelist = deduplicateSafelist(allClasses).sort();\n\n await saveSafelistToFile(finalSafelist, path.join(workspaceDir, output));\n\n stats.timeMs = Math.round(performance.now() - startTime);\n stats.classesGenerated = finalSafelist.length;\n\n return {\n safelist: final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EACV,SAAS,CAAC,GAAG,WAAW;EACxB,YAAY,CAAC,GAAG,cAAc;EAC9B;EACD"}
@@ -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_expressions = require('./ast/expressions.cjs');
4
4
  const require_jsx = require('./ast/jsx.cjs');
5
5
  let ts_morph = require("ts-morph");
6
6
 
7
- //#region ../tailwind/dist/purger/optimized/purgeFromCode.js
8
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
7
+ //#region src/purger/optimized/purgeFromCode.ts
9
8
  /**
10
9
  * Get component info with all its dependencies (using pre-generated data)
11
10
  */
@@ -0,0 +1,58 @@
1
+
2
+ import { PurgeStats } from "./types.cjs";
3
+
4
+ //#region src/purger/optimized/purgeFromCode.d.ts
5
+ interface PurgeFromCodeResult {
6
+ safelist: string[];
7
+ imports: string[];
8
+ components: string[];
9
+ stats: PurgeStats;
10
+ }
11
+ /**
12
+ * Serialized component info from pre-generated data
13
+ */
14
+ interface SerializedComponentInfo {
15
+ name: string;
16
+ defaultProps: Record<string, string>;
17
+ getStylesLiterals: Record<string, string>;
18
+ cxLiterals?: string[];
19
+ internalComponents: string[];
20
+ internalComponentProps: Record<string, Record<string, string[]>>;
21
+ propToVariantKeys: Record<string, string[]>;
22
+ }
23
+ /**
24
+ * Optimized purge from code string.
25
+ *
26
+ * This is a standalone implementation that:
27
+ * - Analyzes UDS component source files to get accurate default props
28
+ * - Includes defaults from internally used components
29
+ * - Only depends on variants from src/styles/variants.ts (source of truth)
30
+ * - Uses ts-morph for AST analysis
31
+ *
32
+ * Key behaviors:
33
+ * - Includes classes for component default props (analyzed from source)
34
+ * - Includes defaults for internal component dependencies
35
+ * - Includes classes for explicitly used prop values
36
+ * - Resolves ternary/logical expressions to extract all possible values
37
+ * - Traces spreads to const objects in the same file
38
+ * - Does NOT fall back to type properties for unresolved spreads
39
+ */
40
+ /**
41
+ * Variant defaults per component from consumer's config
42
+ * e.g., { Button: { size: 'md', variant: 'primary' }, Avatar: { size: 'md' } }
43
+ */
44
+ type VariantDefaults = Record<string, Record<string, string>>;
45
+ interface PurgeFromCodeOptions {
46
+ colorModes?: ('dark' | 'light')[];
47
+ /** Variant defaults from consumer's config - used to include default CSS when prop not specified */
48
+ variantDefaults?: VariantDefaults;
49
+ variants: Record<string, Record<string, string>>;
50
+ autoVariants: Record<string, Record<string, string>>;
51
+ componentData: Record<string, SerializedComponentInfo>;
52
+ includeAllClassNamePrimitives?: boolean;
53
+ filePath?: string;
54
+ }
55
+ declare const purgeFromCodeOptimized: (code: string, options: PurgeFromCodeOptions) => Promise<PurgeFromCodeResult>;
56
+ //#endregion
57
+ export { purgeFromCodeOptimized };
58
+ //# sourceMappingURL=purgeFromCode.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purgeFromCode.d.cts","names":[],"sources":["../../../src/purger/optimized/purgeFromCode.ts"],"mappings":";;;;UAMU,mBAAA;EACR,QAAA;EACA,OAAA;EACA,UAAA;EACA,KAAA,EAAO,UAAA;AAAA;;;;UAMC,uBAAA;EACR,IAAA;EACA,YAAA,EAAc,MAAA;EACd,iBAAA,EAAmB,MAAA;EACnB,UAAA;EACA,kBAAA;EACA,sBAAA,EAAwB,MAAA,SAAe,MAAA;EACvC,iBAAA,EAAmB,MAAA;AAAA;;;;;;;;;;;;;;;;;;;;AAAM;;KAoDtB,eAAA,GAAkB,MAAA,SAAe,MAAA;AAAA,UAE5B,oBAAA;EACR,UAAA;EADQ;EAGR,eAAA,GAAkB,eAAA;EAClB,QAAA,EAAU,MAAA,SAAe,MAAA;EACzB,YAAA,EAAc,MAAA,SAAe,MAAA;EAC7B,aAAA,EAAe,MAAA,SAAe,uBAAA;EAC9B,6BAAA;EACA,QAAA;AAAA;AAAA,cAmLI,sBAAA,GACJ,IAAA,UACA,OAAA,EAAS,oBAAA,KACR,OAAA,CAAQ,mBAAA"}
@@ -0,0 +1,58 @@
1
+
2
+ import { PurgeStats } from "./types.js";
3
+
4
+ //#region src/purger/optimized/purgeFromCode.d.ts
5
+ interface PurgeFromCodeResult {
6
+ safelist: string[];
7
+ imports: string[];
8
+ components: string[];
9
+ stats: PurgeStats;
10
+ }
11
+ /**
12
+ * Serialized component info from pre-generated data
13
+ */
14
+ interface SerializedComponentInfo {
15
+ name: string;
16
+ defaultProps: Record<string, string>;
17
+ getStylesLiterals: Record<string, string>;
18
+ cxLiterals?: string[];
19
+ internalComponents: string[];
20
+ internalComponentProps: Record<string, Record<string, string[]>>;
21
+ propToVariantKeys: Record<string, string[]>;
22
+ }
23
+ /**
24
+ * Optimized purge from code string.
25
+ *
26
+ * This is a standalone implementation that:
27
+ * - Analyzes UDS component source files to get accurate default props
28
+ * - Includes defaults from internally used components
29
+ * - Only depends on variants from src/styles/variants.ts (source of truth)
30
+ * - Uses ts-morph for AST analysis
31
+ *
32
+ * Key behaviors:
33
+ * - Includes classes for component default props (analyzed from source)
34
+ * - Includes defaults for internal component dependencies
35
+ * - Includes classes for explicitly used prop values
36
+ * - Resolves ternary/logical expressions to extract all possible values
37
+ * - Traces spreads to const objects in the same file
38
+ * - Does NOT fall back to type properties for unresolved spreads
39
+ */
40
+ /**
41
+ * Variant defaults per component from consumer's config
42
+ * e.g., { Button: { size: 'md', variant: 'primary' }, Avatar: { size: 'md' } }
43
+ */
44
+ type VariantDefaults = Record<string, Record<string, string>>;
45
+ interface PurgeFromCodeOptions {
46
+ colorModes?: ('dark' | 'light')[];
47
+ /** Variant defaults from consumer's config - used to include default CSS when prop not specified */
48
+ variantDefaults?: VariantDefaults;
49
+ variants: Record<string, Record<string, string>>;
50
+ autoVariants: Record<string, Record<string, string>>;
51
+ componentData: Record<string, SerializedComponentInfo>;
52
+ includeAllClassNamePrimitives?: boolean;
53
+ filePath?: string;
54
+ }
55
+ declare const purgeFromCodeOptimized: (code: string, options: PurgeFromCodeOptions) => Promise<PurgeFromCodeResult>;
56
+ //#endregion
57
+ export { type PurgeFromCodeResult, purgeFromCodeOptimized };
58
+ //# sourceMappingURL=purgeFromCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purgeFromCode.d.ts","names":[],"sources":["../../../src/purger/optimized/purgeFromCode.ts"],"mappings":";;;;UAMU,mBAAA;EACR,QAAA;EACA,OAAA;EACA,UAAA;EACA,KAAA,EAAO,UAAA;AAAA;;;;UAMC,uBAAA;EACR,IAAA;EACA,YAAA,EAAc,MAAA;EACd,iBAAA,EAAmB,MAAA;EACnB,UAAA;EACA,kBAAA;EACA,sBAAA,EAAwB,MAAA,SAAe,MAAA;EACvC,iBAAA,EAAmB,MAAA;AAAA;;;;;;;;;;;;;;;;;;;;AAAM;;KAoDtB,eAAA,GAAkB,MAAA,SAAe,MAAA;AAAA,UAE5B,oBAAA;EACR,UAAA;EADQ;EAGR,eAAA,GAAkB,eAAA;EAClB,QAAA,EAAU,MAAA,SAAe,MAAA;EACzB,YAAA,EAAc,MAAA,SAAe,MAAA;EAC7B,aAAA,EAAe,MAAA,SAAe,uBAAA;EAC9B,6BAAA;EACA,QAAA;AAAA;AAAA,cAmLI,sBAAA,GACJ,IAAA,UACA,OAAA,EAAS,oBAAA,KACR,OAAA,CAAQ,mBAAA"}
@@ -1,10 +1,9 @@
1
- /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
2
  import { extractStringLiterals } from "./ast/expressions.js";
3
3
  import { findJsxReferences } from "./ast/jsx.js";
4
4
  import { Node, Project, SyntaxKind, ts } from "ts-morph";
5
5
 
6
- //#region ../tailwind/dist/purger/optimized/purgeFromCode.js
7
- /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
6
+ //#region src/purger/optimized/purgeFromCode.ts
8
7
  /**
9
8
  * Get component info with all its dependencies (using pre-generated data)
10
9
  */
@@ -405,4 +404,5 @@ const extractGetStylesCalls = (sourceFile, stats, variants) => {
405
404
  };
406
405
 
407
406
  //#endregion
408
- export { purgeFromCodeOptimized };
407
+ export { purgeFromCodeOptimized };
408
+ //# sourceMappingURL=purgeFromCode.js.map
@@ -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,IAA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AS,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;