@yahoo/uds 3.120.0 → 3.122.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/components/client/Popover/Popover.cjs +1 -1
  2. package/dist/components/client/Popover/Popover.js +1 -1
  3. package/dist/components/client/Popover/PopoverContent.cjs +12 -17
  4. package/dist/components/client/Popover/PopoverContent.js +12 -17
  5. package/dist/components/client/Popover/UDSPopoverConfigProvider.cjs +13 -3
  6. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +13 -5
  7. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +13 -5
  8. package/dist/components/client/Popover/UDSPopoverConfigProvider.js +13 -3
  9. package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +1 -1
  10. package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +1 -1
  11. package/dist/fixtures/dist/index.cjs +1 -2
  12. package/dist/fixtures/dist/index.js +1 -2
  13. package/dist/index.d.cts +2 -2
  14. package/dist/index.d.ts +2 -2
  15. package/dist/runtime/popoverConfig.cjs +2 -0
  16. package/dist/runtime/popoverConfig.d.cts +3 -1
  17. package/dist/runtime/popoverConfig.d.ts +3 -1
  18. package/dist/runtime/popoverConfig.js +2 -0
  19. package/dist/styles/styler.d.cts +43 -43
  20. package/dist/styles/styler.d.ts +43 -43
  21. package/dist/tailwind/dist/commands/generateComponentData.cjs +5 -1
  22. package/dist/tailwind/dist/commands/generateComponentData.d.cts +3 -0
  23. package/dist/tailwind/dist/commands/generateComponentData.d.cts.map +1 -1
  24. package/dist/tailwind/dist/commands/generateComponentData.d.ts +3 -0
  25. package/dist/tailwind/dist/commands/generateComponentData.d.ts.map +1 -1
  26. package/dist/tailwind/dist/commands/generateComponentData.js +5 -1
  27. package/dist/tailwind/dist/commands/generateComponentData.js.map +1 -1
  28. package/dist/tailwind/dist/css/generate.cjs +2 -1
  29. package/dist/tailwind/dist/css/generate.d.cts.map +1 -1
  30. package/dist/tailwind/dist/css/generate.d.ts.map +1 -1
  31. package/dist/tailwind/dist/css/generate.js +3 -2
  32. package/dist/tailwind/dist/css/generate.js.map +1 -1
  33. package/dist/tailwind/dist/css/nodeUtils.cjs +7 -5
  34. package/dist/tailwind/dist/css/nodeUtils.js +7 -5
  35. package/dist/tailwind/dist/css/nodeUtils.js.map +1 -1
  36. package/dist/tailwind/dist/css/runner.cjs +4 -3
  37. package/dist/tailwind/dist/css/runner.js +5 -4
  38. package/dist/tailwind/dist/css/runner.js.map +1 -1
  39. package/dist/tailwind/dist/css/utils.cjs +62 -0
  40. package/dist/tailwind/dist/css/utils.js +62 -1
  41. package/dist/tailwind/dist/css/utils.js.map +1 -1
  42. package/dist/tailwind/dist/fixtures/dist/index.js.map +1 -1
  43. package/dist/tailwind/dist/purger/optimized/purgeFromCode.cjs +104 -19
  44. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.cts +5 -0
  45. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.cts.map +1 -1
  46. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.ts +5 -0
  47. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.ts.map +1 -1
  48. package/dist/tailwind/dist/purger/optimized/purgeFromCode.js +104 -19
  49. package/dist/tailwind/dist/purger/optimized/purgeFromCode.js.map +1 -1
  50. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.cjs +99 -10
  51. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js +99 -10
  52. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js.map +1 -1
  53. package/dist/tailwind/dist/runtimeConfig/hookMetadata.cjs +364 -0
  54. package/dist/tailwind/dist/runtimeConfig/hookMetadata.js +358 -0
  55. package/dist/tailwind/dist/runtimeConfig/hookMetadata.js.map +1 -0
  56. package/dist/tailwind/dist/types/dist/index.d.cts.map +1 -1
  57. package/dist/tailwind/dist/types/dist/index.d.ts.map +1 -1
  58. package/dist/tokens/index.d.cts +2 -2
  59. package/dist/tokens/index.d.ts +2 -2
  60. package/dist/tokens/types.d.cts +2 -2
  61. package/dist/tokens/types.d.ts +2 -2
  62. package/dist/types/dist/index.d.cts +2 -1
  63. package/dist/types/dist/index.d.ts +2 -1
  64. package/dist/uds/generated/componentData.cjs +915 -628
  65. package/dist/uds/generated/componentData.js +915 -628
  66. package/dist/uds/package.cjs +3 -3
  67. package/dist/uds/package.js +3 -3
  68. package/generated/componentData.json +1131 -782
  69. package/package.json +4 -4
@@ -1,6 +1,7 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
2
  import { getAllowedEntryFileGlobPatterns, stripAllowedEntryFileExtension } from "../../../utils/entryPoints.js";
3
3
  import { SPRING_MOTION_DEFAULTS } from "../../../motion-tokens/dist/index.js";
4
+ import { getRuntimeHookConfig } from "../../../runtimeConfig/hookMetadata.js";
4
5
  import { existsSync } from "node:fs";
5
6
  import path from "node:path";
6
7
  import fg from "fast-glob";
@@ -64,6 +65,72 @@ const addPropToVariantKeyMapping = (propToVariantKeys, propName, variantKey) =>
64
65
  const existing = propToVariantKeys.get(propName) ?? [];
65
66
  if (!existing.includes(variantKey)) propToVariantKeys.set(propName, [...existing, variantKey]);
66
67
  };
68
+ const addRuntimeSelector = (target, key, selector) => {
69
+ const existing = target.get(key) ?? [];
70
+ if (!existing.includes(selector)) target.set(key, [...existing, selector]);
71
+ };
72
+ const getExpressionWithoutWrappers = (node) => {
73
+ if (Node.isParenthesizedExpression(node)) return getExpressionWithoutWrappers(node.getExpression());
74
+ if (Node.isAsExpression(node) || Node.isTypeAssertion(node) || Node.isSatisfiesExpression(node)) return getExpressionWithoutWrappers(node.getExpression());
75
+ return node;
76
+ };
77
+ const applyRuntimeSelectorIndex = (selector, indexKey, isIdentifierIndex = false) => {
78
+ if (selector.includes("${")) return selector;
79
+ return isIdentifierIndex ? selector + ".${" + indexKey + "}" : `${selector}.${indexKey}`;
80
+ };
81
+ const resolveRuntimeBindingFromExpression = (expr, runtimeBindings) => {
82
+ const normalized = getExpressionWithoutWrappers(expr);
83
+ if (Node.isIdentifier(normalized)) return runtimeBindings.get(normalized.getText()) ?? null;
84
+ if (Node.isElementAccessExpression(normalized)) {
85
+ const target = resolveRuntimeBindingFromExpression(normalized.getExpression(), runtimeBindings);
86
+ if (!target) return null;
87
+ const argumentExpression = normalized.getArgumentExpression();
88
+ if (!argumentExpression) return null;
89
+ const argument = getExpressionWithoutWrappers(argumentExpression);
90
+ if (Node.isStringLiteral(argument)) return { selector: applyRuntimeSelectorIndex(target.selector, argument.getLiteralValue()) };
91
+ if (Node.isIdentifier(argument)) return { selector: applyRuntimeSelectorIndex(target.selector, argument.getText(), true) };
92
+ }
93
+ if (Node.isPropertyAccessExpression(normalized)) {
94
+ const target = resolveRuntimeBindingFromExpression(normalized.getExpression(), runtimeBindings);
95
+ if (!target) return null;
96
+ return { selector: applyRuntimeSelectorIndex(target.selector, normalized.getName()) };
97
+ }
98
+ return null;
99
+ };
100
+ const collectRuntimeSelectorsFromExpression = (expr, runtimeBindings) => {
101
+ const normalized = getExpressionWithoutWrappers(expr);
102
+ const resolvedBinding = resolveRuntimeBindingFromExpression(normalized, runtimeBindings);
103
+ if (resolvedBinding) return [resolvedBinding.selector];
104
+ if (Node.isConditionalExpression(normalized)) return [...collectRuntimeSelectorsFromExpression(normalized.getWhenTrue(), runtimeBindings), ...collectRuntimeSelectorsFromExpression(normalized.getWhenFalse(), runtimeBindings)];
105
+ if (Node.isBinaryExpression(normalized)) return [...collectRuntimeSelectorsFromExpression(normalized.getLeft(), runtimeBindings), ...collectRuntimeSelectorsFromExpression(normalized.getRight(), runtimeBindings)];
106
+ return [];
107
+ };
108
+ const collectRuntimeConfigBindings = (sourceFile, runtimeBindings, runtimeConfigDefaultProps) => {
109
+ sourceFile.getDescendantsOfKind(SyntaxKind.VariableDeclaration).forEach((declaration) => {
110
+ const initializer = declaration.getInitializer();
111
+ if (!initializer) return;
112
+ const normalizedInitializer = getExpressionWithoutWrappers(initializer);
113
+ const nameNode = declaration.getNameNode();
114
+ if (Node.isObjectBindingPattern(nameNode) && Node.isCallExpression(normalizedInitializer)) {
115
+ const hookConfig = getRuntimeHookConfig(normalizedInitializer.getExpression().getText());
116
+ if (!hookConfig) return;
117
+ Object.entries(hookConfig.defaultProps).forEach(([propName, selector]) => {
118
+ runtimeConfigDefaultProps.set(propName, selector);
119
+ });
120
+ nameNode.getElements().forEach((element) => {
121
+ const fieldName = element.getPropertyNameNode()?.getText() ?? element.getName();
122
+ const localName = element.getName();
123
+ const fieldConfig = hookConfig.fields[fieldName];
124
+ if (!fieldConfig) return;
125
+ runtimeBindings.set(localName, { selector: fieldConfig.bindingSelector });
126
+ });
127
+ return;
128
+ }
129
+ if (!Node.isIdentifier(nameNode)) return;
130
+ const resolvedBinding = resolveRuntimeBindingFromExpression(normalizedInitializer, runtimeBindings);
131
+ if (resolvedBinding) runtimeBindings.set(nameNode.getText(), resolvedBinding);
132
+ });
133
+ };
67
134
  const extractFallbackIdentifier = (initializer) => {
68
135
  if (!Node.isBinaryExpression(initializer)) return null;
69
136
  const operatorKind = initializer.getOperatorToken().getKind();
@@ -117,11 +184,16 @@ const analyzeComponent = (project, componentPath) => {
117
184
  const internalComponents = [];
118
185
  const internalComponentProps = /* @__PURE__ */ new Map();
119
186
  const propToVariantKeys = /* @__PURE__ */ new Map();
187
+ const runtimeConfigDefaultProps = /* @__PURE__ */ new Map();
188
+ const runtimeConfigGetStyles = /* @__PURE__ */ new Map();
189
+ const runtimeConfigInternalComponentProps = /* @__PURE__ */ new Map();
190
+ const runtimeBindings = /* @__PURE__ */ new Map();
120
191
  collectComponentDefaultsAndProps(sourceFile, defaultProps, componentPropNames);
121
- collectGetStylesMetadata(sourceFile, styleProps, getStylesLiterals, propToVariantKeys);
192
+ collectRuntimeConfigBindings(sourceFile, runtimeBindings, runtimeConfigDefaultProps);
193
+ collectGetStylesMetadata(sourceFile, styleProps, getStylesLiterals, propToVariantKeys, runtimeBindings, runtimeConfigGetStyles);
122
194
  collectCxLiterals(sourceFile, cxLiterals);
123
195
  collectIntrinsicClassNameLiterals(sourceFile, cxLiterals);
124
- extractInternalComponents(sourceFile, internalComponents, internalComponentProps, propToVariantKeys, componentPropNames);
196
+ extractInternalComponents(sourceFile, internalComponents, internalComponentProps, runtimeConfigInternalComponentProps, propToVariantKeys, componentPropNames, runtimeBindings);
125
197
  return {
126
198
  name: componentName,
127
199
  filePath: componentPath,
@@ -132,6 +204,9 @@ const analyzeComponent = (project, componentPath) => {
132
204
  internalComponents,
133
205
  internalComponentProps,
134
206
  propToVariantKeys,
207
+ runtimeConfigDefaultProps,
208
+ runtimeConfigGetStyles,
209
+ runtimeConfigInternalComponentProps,
135
210
  motionVarPrefixes: extractMotionVarPrefixes(sourceFile)
136
211
  };
137
212
  };
@@ -172,20 +247,23 @@ const storeVariantLiteralValues = (variantKey, literalValues, getStylesLiterals)
172
247
  getStylesLiterals.set(literalKey, value);
173
248
  });
174
249
  };
175
- const handleGetStylesPropertyAssignment = (prop, styleProps, getStylesLiterals, propToVariantKeys) => {
250
+ const handleGetStylesPropertyAssignment = (prop, styleProps, getStylesLiterals, propToVariantKeys, runtimeBindings, runtimeConfigGetStyles) => {
176
251
  const variantKey = prop.getName();
177
252
  addStyleProp(styleProps, variantKey);
178
253
  const initializer = prop.getInitializer();
179
254
  if (!initializer) return;
180
255
  if (Node.isStringLiteral(initializer)) getStylesLiterals.set(variantKey, initializer.getLiteralValue());
181
256
  if (Node.isIdentifier(initializer)) addPropToVariantKeyMapping(propToVariantKeys, initializer.getText(), variantKey);
257
+ collectRuntimeSelectorsFromExpression(initializer, runtimeBindings).forEach((selector) => {
258
+ addRuntimeSelector(runtimeConfigGetStyles, variantKey, selector);
259
+ });
182
260
  const fallbackIdentifier = extractFallbackIdentifier(initializer);
183
261
  if (fallbackIdentifier) addPropToVariantKeyMapping(propToVariantKeys, fallbackIdentifier, variantKey);
184
262
  if (Node.isConditionalExpression(initializer)) storeVariantLiteralValues(variantKey, [...extractConditionalStringLiterals(initializer.getWhenTrue()), ...extractConditionalStringLiterals(initializer.getWhenFalse())], getStylesLiterals);
185
263
  };
186
- const handleGetStylesObjectProperty = (prop, styleProps, getStylesLiterals, propToVariantKeys, sourceFile) => {
264
+ const handleGetStylesObjectProperty = (prop, styleProps, getStylesLiterals, propToVariantKeys, sourceFile, runtimeBindings, runtimeConfigGetStyles) => {
187
265
  if (Node.isPropertyAssignment(prop)) {
188
- handleGetStylesPropertyAssignment(prop, styleProps, getStylesLiterals, propToVariantKeys);
266
+ handleGetStylesPropertyAssignment(prop, styleProps, getStylesLiterals, propToVariantKeys, runtimeBindings, runtimeConfigGetStyles);
189
267
  return;
190
268
  }
191
269
  if (Node.isShorthandPropertyAssignment(prop)) {
@@ -197,12 +275,12 @@ const handleGetStylesObjectProperty = (prop, styleProps, getStylesLiterals, prop
197
275
  if (objectLiteral) analyzeObjectForVariantMappings(objectLiteral, styleProps, getStylesLiterals, propToVariantKeys, sourceFile);
198
276
  }
199
277
  };
200
- const collectGetStylesMetadata = (sourceFile, styleProps, getStylesLiterals, propToVariantKeys) => {
278
+ const collectGetStylesMetadata = (sourceFile, styleProps, getStylesLiterals, propToVariantKeys, runtimeBindings, runtimeConfigGetStyles) => {
201
279
  sourceFile.getDescendantsOfKind(SyntaxKind.CallExpression).filter((call) => call.getExpression().getText() === "getStyles").forEach((call) => {
202
280
  const args = call.getArguments();
203
281
  if (args.length === 0 || !Node.isObjectLiteralExpression(args[0])) return;
204
282
  args[0].getProperties().forEach((prop) => {
205
- handleGetStylesObjectProperty(prop, styleProps, getStylesLiterals, propToVariantKeys, sourceFile);
283
+ handleGetStylesObjectProperty(prop, styleProps, getStylesLiterals, propToVariantKeys, sourceFile, runtimeBindings, runtimeConfigGetStyles);
206
284
  });
207
285
  });
208
286
  };
@@ -238,9 +316,9 @@ const collectIntrinsicClassNameLiterals = (sourceFile, cxLiterals) => {
238
316
  * Extract UDS components used internally in the file and their prop values.
239
317
  * Also detects prop aliasing (e.g., columnGap={gap} means gap -> columnGap).
240
318
  */
241
- const extractInternalComponents = (sourceFile, internalComponents, internalComponentProps, propToVariantKeys, componentProps) => {
319
+ const extractInternalComponents = (sourceFile, internalComponents, internalComponentProps, runtimeConfigInternalComponentProps, propToVariantKeys, componentProps, runtimeBindings) => {
242
320
  collectImportedInternalComponents(sourceFile, internalComponents);
243
- collectInternalComponentUsages(sourceFile, internalComponents, internalComponentProps, propToVariantKeys, componentProps);
321
+ collectInternalComponentUsages(sourceFile, internalComponents, internalComponentProps, runtimeConfigInternalComponentProps, propToVariantKeys, componentProps, runtimeBindings);
244
322
  };
245
323
  const isInternalUdsModule = (moduleSpec) => {
246
324
  return (moduleSpec.startsWith("@yahoo/uds") || moduleSpec.startsWith("../") || moduleSpec.startsWith("./")) && (moduleSpec.includes("/components/") || moduleSpec === "@yahoo/uds");
@@ -291,12 +369,23 @@ const extractJsxAttributeLiteralValues = (attr, componentProps, propToVariantKey
291
369
  values: []
292
370
  };
293
371
  };
294
- const collectInternalComponentUsages = (sourceFile, internalComponents, internalComponentProps, propToVariantKeys, componentProps) => {
372
+ const collectInternalComponentUsages = (sourceFile, internalComponents, internalComponentProps, runtimeConfigInternalComponentProps, propToVariantKeys, componentProps, runtimeBindings) => {
295
373
  [...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement), ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement)].forEach((element) => {
296
374
  const tagName = element.getTagNameNode().getText();
297
375
  if (!/^[A-Z]/.test(tagName)) return;
298
376
  pushUniqueComponentName(internalComponents, tagName);
299
377
  element.getAttributes().forEach((attr) => {
378
+ if (Node.isJsxAttribute(attr)) {
379
+ const initializer = attr.getInitializer();
380
+ const expression = initializer && Node.isJsxExpression(initializer) ? initializer.getExpression() : void 0;
381
+ const runtimeSelectors = expression ? collectRuntimeSelectorsFromExpression(expression, runtimeBindings) : [];
382
+ if (runtimeSelectors.length > 0) {
383
+ const runtimePropsMap = getOrCreateComponentPropsMap(runtimeConfigInternalComponentProps, tagName);
384
+ const runtimePropName = attr.getNameNode().getText();
385
+ const existingRuntimeSelectors = runtimePropsMap.get(runtimePropName) ?? [];
386
+ runtimePropsMap.set(runtimePropName, [...new Set([...existingRuntimeSelectors, ...runtimeSelectors])]);
387
+ }
388
+ }
300
389
  const extracted = extractJsxAttributeLiteralValues(attr, componentProps, propToVariantKeys);
301
390
  if (!extracted || extracted.values.length === 0) return;
302
391
  const componentPropsMap = getOrCreateComponentPropsMap(internalComponentProps, tagName);
@@ -1 +1 @@
1
- {"version":3,"file":"componentAnalyzer.js","names":[],"sources":["../../../../src/purger/optimized/utils/componentAnalyzer.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport path from 'node:path';\n\nimport { SPRING_MOTION_DEFAULTS } from '@yahoo/uds-motion-tokens';\nimport fg from 'fast-glob';\nimport type { ObjectLiteralExpression, Project, SourceFile } from 'ts-morph';\nimport { Node, SyntaxKind } from 'ts-morph';\n\nimport {\n getAllowedEntryFileGlobPatterns,\n stripAllowedEntryFileExtension,\n} from '../../../utils/entryPoints';\n\ninterface ComponentInfo {\n name: string;\n filePath: string;\n /** Default values from function parameter destructuring (e.g., display = 'flex') */\n defaultProps: Map<string, string>;\n /** Props passed to getStyles() calls */\n styleProps: string[];\n /** Hardcoded literal values passed directly to getStyles() (e.g., flex: 'none') */\n getStylesLiterals: Map<string, string>;\n /** Raw Tailwind class literals from cx() calls (e.g., 'absolute', 'opacity-0') */\n cxLiterals: string[];\n /** Other UDS components used internally */\n internalComponents: string[];\n /** Literal prop values passed to internal UDS components (e.g., <Icon color=\"current\" />) */\n internalComponentProps: Map<string, Map<string, string[]>>;\n /** Maps prop names to variant keys (e.g., variant -> [buttonVariantRoot, buttonVariantIcon]) */\n propToVariantKeys: Map<string, string[]>;\n /**\n * Motion CSS variable prefixes used by this component.\n * e.g., ['--uds-motion-bouncy-4-', '--uds-motion-smooth-3-']\n * Empty array means no motion vars needed.\n */\n motionVarPrefixes: string[];\n}\n\n/**\n * Known UDS component names (populated by scanning)\n */\nlet knownComponents: Set<string> | null = null;\n\n/**\n * Map of component name -> file path\n */\nlet componentPaths: Map<string, string> | null = null;\nlet scannedComponentsDir: string | null = null;\nconst hasImportQuery = (moduleSpecifier: string): boolean => moduleSpecifier.includes('?');\nconst scanComponentFilePaths = async (componentsDir: string): Promise<string[]> =>\n fg(getAllowedEntryFileGlobPatterns(), {\n cwd: componentsDir,\n absolute: true,\n });\n\n/**\n * Scan src/components to build a map of all component files\n */\nconst scanComponentFiles = async (componentsDir: string): Promise<Map<string, string>> => {\n if (componentPaths && scannedComponentsDir === componentsDir) {\n return componentPaths;\n }\n\n componentPaths = new Map();\n knownComponents = new Set();\n scannedComponentsDir = componentsDir;\n\n const nextComponentPaths = componentPaths;\n const nextKnownComponents = knownComponents;\n\n const files = await scanComponentFilePaths(componentsDir);\n\n files.forEach((file) => {\n // Skip test files and index files\n if (\n file.includes('.test.') ||\n path.basename(stripAllowedEntryFileExtension(file)) === 'index'\n ) {\n return;\n }\n\n const fileName = path.basename(stripAllowedEntryFileExtension(file));\n\n // Use PascalCase file names as component names\n if (/^[A-Z]/.test(fileName)) {\n nextComponentPaths.set(fileName, file);\n nextKnownComponents.add(fileName);\n }\n });\n\n return nextComponentPaths;\n};\n\n/**\n * Get the file path for a component by name\n */\nconst getComponentPath = async (\n componentName: string,\n componentsDir: string,\n): Promise<string | null> => {\n const paths = await scanComponentFiles(componentsDir);\n return paths.get(componentName) ?? null;\n};\n\n/**\n * Analyze an object literal for variant key mappings.\n * Handles:\n * - Direct property assignments: { fontSize: variant } -> variant maps to fontSize\n * - Nullish coalescing: { fontSize: fontSize ?? variant } -> variant maps to fontSize\n * - Conditional spreads: ...(condition ? { props } : {}) -> recursively analyze props\n */\nconst analyzeObjectForVariantMappings = (\n objLiteral: ObjectLiteralExpression,\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n sourceFile: SourceFile,\n): void => {\n objLiteral.getProperties().forEach((prop) => {\n if (Node.isPropertyAssignment(prop)) {\n analyzeVariantPropertyAssignment(prop, styleProps, getStylesLiterals, propToVariantKeys);\n return;\n }\n\n if (Node.isSpreadAssignment(prop)) {\n analyzeVariantSpreadAssignment(\n prop,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n });\n};\n\nconst addStyleProp = (styleProps: string[], variantKey: string): void => {\n if (!styleProps.includes(variantKey)) {\n styleProps.push(variantKey);\n }\n};\n\nconst addPropToVariantKeyMapping = (\n propToVariantKeys: Map<string, string[]>,\n propName: string,\n variantKey: string,\n): void => {\n const existing = propToVariantKeys.get(propName) ?? [];\n if (!existing.includes(variantKey)) {\n propToVariantKeys.set(propName, [...existing, variantKey]);\n }\n};\n\nconst extractFallbackIdentifier = (initializer: Node): string | null => {\n if (!Node.isBinaryExpression(initializer)) {\n return null;\n }\n\n const operatorKind = initializer.getOperatorToken().getKind();\n const isFallbackOperator =\n operatorKind === SyntaxKind.QuestionQuestionToken || operatorKind === SyntaxKind.BarBarToken;\n\n if (!isFallbackOperator || !Node.isIdentifier(initializer.getRight())) {\n return null;\n }\n\n return initializer.getRight().getText();\n};\n\nconst analyzeVariantPropertyAssignment = (\n prop: Node & { getName: () => string; getInitializer: () => Node | undefined },\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n): void => {\n const variantKey = prop.getName();\n addStyleProp(styleProps, variantKey);\n\n const initializer = prop.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isStringLiteral(initializer)) {\n getStylesLiterals.set(variantKey, initializer.getLiteralValue());\n }\n\n if (Node.isIdentifier(initializer)) {\n addPropToVariantKeyMapping(propToVariantKeys, initializer.getText(), variantKey);\n }\n\n const fallbackIdentifier = extractFallbackIdentifier(initializer);\n if (fallbackIdentifier) {\n addPropToVariantKeyMapping(propToVariantKeys, fallbackIdentifier, variantKey);\n }\n};\n\nconst findVariableObjectLiteral = (\n sourceFile: SourceFile,\n variableName: string,\n): ObjectLiteralExpression | null => {\n const declaration = sourceFile\n .getDescendantsOfKind(SyntaxKind.VariableDeclaration)\n .find((candidate) => candidate.getName() === variableName);\n const initializer = declaration?.getInitializer();\n\n return initializer && Node.isObjectLiteralExpression(initializer) ? initializer : null;\n};\n\nconst analyzeVariantSpreadAssignment = (\n prop: Node & { getExpression: () => Node },\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n sourceFile: SourceFile,\n): void => {\n const spreadExpr = prop.getExpression();\n\n if (Node.isParenthesizedExpression(spreadExpr)) {\n const conditionalExpr = spreadExpr.getExpression();\n if (Node.isConditionalExpression(conditionalExpr)) {\n const whenTrue = conditionalExpr.getWhenTrue();\n if (!Node.isObjectLiteralExpression(whenTrue)) {\n return;\n }\n\n analyzeObjectForVariantMappings(\n whenTrue,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n }\n\n if (Node.isIdentifier(spreadExpr)) {\n const objectLiteral = findVariableObjectLiteral(sourceFile, spreadExpr.getText());\n if (objectLiteral) {\n analyzeObjectForVariantMappings(\n objectLiteral,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n }\n};\n\n/**\n * Analyzes a UDS component file to extract:\n * 1. Default prop values (e.g., display = 'flex')\n * 2. Props passed to getStyles()\n * 3. Internal UDS component usage\n */\nconst analyzeComponent = (project: Project, componentPath: string): ComponentInfo | null => {\n const sourceFile = project.getSourceFile(componentPath);\n if (!sourceFile) {\n return null;\n }\n\n const componentName = path.basename(stripAllowedEntryFileExtension(componentPath));\n const defaultProps = new Map<string, string>();\n const componentPropNames = new Set<string>(); // All prop names (not just defaults)\n const styleProps: string[] = [];\n const getStylesLiterals = new Map<string, string>();\n const cxLiterals: string[] = [];\n const internalComponents: string[] = [];\n const internalComponentProps = new Map<string, Map<string, string[]>>();\n const propToVariantKeys = new Map<string, string[]>();\n\n collectComponentDefaultsAndProps(sourceFile, defaultProps, componentPropNames);\n\n collectGetStylesMetadata(sourceFile, styleProps, getStylesLiterals, propToVariantKeys);\n\n collectCxLiterals(sourceFile, cxLiterals);\n collectIntrinsicClassNameLiterals(sourceFile, cxLiterals);\n\n // Find internal UDS component usage and their prop values\n // Also detect prop aliasing (e.g., gap -> columnGap, rowGap in VStack)\n extractInternalComponents(\n sourceFile,\n internalComponents,\n internalComponentProps,\n propToVariantKeys,\n componentPropNames,\n );\n\n // Extract motion CSS variable prefixes from SpringMotionConfig usage\n const motionVarPrefixes = extractMotionVarPrefixes(sourceFile);\n\n return {\n name: componentName,\n filePath: componentPath,\n defaultProps,\n styleProps,\n getStylesLiterals,\n cxLiterals,\n internalComponents,\n internalComponentProps,\n propToVariantKeys,\n motionVarPrefixes,\n };\n};\n\nconst getComponentFunctionNodes = (sourceFile: SourceFile): Node[] => [\n ...sourceFile.getFunctions(),\n ...sourceFile.getVariableDeclarations().filter((declaration) => {\n const initializer = declaration.getInitializer();\n return initializer && (Node.isArrowFunction(initializer) || Node.isCallExpression(initializer));\n }),\n];\n\nconst collectComponentDefaultsAndProps = (\n sourceFile: SourceFile,\n defaultProps: Map<string, string>,\n componentPropNames: Set<string>,\n): void => {\n getComponentFunctionNodes(sourceFile).forEach((fn) => {\n if (Node.isFunctionDeclaration(fn)) {\n extractDefaultsFromFunction(fn, defaultProps);\n extractAllPropNames(fn, componentPropNames);\n return;\n }\n\n if (!Node.isVariableDeclaration(fn)) {\n return;\n }\n\n const initializer = fn.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isCallExpression(initializer)) {\n initializer.getArguments().forEach((arg) => {\n if (Node.isFunctionExpression(arg) || Node.isArrowFunction(arg)) {\n extractDefaultsFromFunction(arg, defaultProps);\n extractAllPropNames(arg, componentPropNames);\n }\n });\n }\n\n if (Node.isArrowFunction(initializer)) {\n extractDefaultsFromFunction(initializer, defaultProps);\n extractAllPropNames(initializer, componentPropNames);\n }\n });\n};\n\nconst extractConditionalStringLiterals = (node: Node): string[] => {\n if (Node.isStringLiteral(node)) {\n return [node.getLiteralValue()];\n }\n\n if (Node.isConditionalExpression(node)) {\n return [\n ...extractConditionalStringLiterals(node.getWhenTrue()),\n ...extractConditionalStringLiterals(node.getWhenFalse()),\n ];\n }\n\n return [];\n};\n\nconst storeVariantLiteralValues = (\n variantKey: string,\n literalValues: string[],\n getStylesLiterals: Map<string, string>,\n): void => {\n literalValues.forEach((value, index) => {\n const literalKey = index === 0 ? variantKey : `${variantKey}:${index}`;\n getStylesLiterals.set(literalKey, value);\n });\n};\n\nconst handleGetStylesPropertyAssignment = (\n prop: Node & { getName: () => string; getInitializer: () => Node | undefined },\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n): void => {\n const variantKey = prop.getName();\n addStyleProp(styleProps, variantKey);\n\n const initializer = prop.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isStringLiteral(initializer)) {\n getStylesLiterals.set(variantKey, initializer.getLiteralValue());\n }\n\n if (Node.isIdentifier(initializer)) {\n addPropToVariantKeyMapping(propToVariantKeys, initializer.getText(), variantKey);\n }\n\n const fallbackIdentifier = extractFallbackIdentifier(initializer);\n if (fallbackIdentifier) {\n addPropToVariantKeyMapping(propToVariantKeys, fallbackIdentifier, variantKey);\n }\n\n if (Node.isConditionalExpression(initializer)) {\n const allValues = [\n ...extractConditionalStringLiterals(initializer.getWhenTrue()),\n ...extractConditionalStringLiterals(initializer.getWhenFalse()),\n ];\n storeVariantLiteralValues(variantKey, allValues, getStylesLiterals);\n }\n};\n\nconst handleGetStylesObjectProperty = (\n prop: Node,\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n sourceFile: SourceFile,\n): void => {\n if (Node.isPropertyAssignment(prop)) {\n handleGetStylesPropertyAssignment(prop, styleProps, getStylesLiterals, propToVariantKeys);\n return;\n }\n\n if (Node.isShorthandPropertyAssignment(prop)) {\n addStyleProp(styleProps, prop.getName());\n return;\n }\n\n if (Node.isSpreadAssignment(prop) && Node.isIdentifier(prop.getExpression())) {\n const objectLiteral = findVariableObjectLiteral(sourceFile, prop.getExpression().getText());\n if (objectLiteral) {\n analyzeObjectForVariantMappings(\n objectLiteral,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n }\n};\n\nconst collectGetStylesMetadata = (\n sourceFile: SourceFile,\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n): void => {\n sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((call) => call.getExpression().getText() === 'getStyles')\n .forEach((call) => {\n const args = call.getArguments();\n if (args.length === 0 || !Node.isObjectLiteralExpression(args[0])) {\n return;\n }\n\n args[0].getProperties().forEach((prop) => {\n handleGetStylesObjectProperty(\n prop,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n });\n });\n};\n\nconst collectCxLiterals = (sourceFile: SourceFile, cxLiterals: string[]): void => {\n sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((call) => call.getExpression().getText() === 'cx')\n .forEach((call) => {\n call.getArguments().forEach((arg) => extractCxStringLiterals(arg, cxLiterals));\n });\n};\n\nconst pushUniqueClasses = (target: string[], rawValue: string): void => {\n rawValue\n .split(/\\s+/)\n .filter(Boolean)\n .forEach((className) => {\n if (!target.includes(className)) {\n target.push(className);\n }\n });\n};\n\nconst collectIntrinsicClassNameLiterals = (sourceFile: SourceFile, cxLiterals: string[]): void => {\n const jsxElements = [\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),\n ];\n\n jsxElements.forEach((element) => {\n const tagName = element.getTagNameNode().getText();\n if (!/^[a-z]/.test(tagName)) {\n return;\n }\n\n element.getAttributes().forEach((attr) => {\n if (!Node.isJsxAttribute(attr) || attr.getNameNode().getText() !== 'className') {\n return;\n }\n\n const initializer = attr.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isStringLiteral(initializer)) {\n pushUniqueClasses(cxLiterals, initializer.getLiteralValue());\n return;\n }\n\n if (!Node.isJsxExpression(initializer)) {\n return;\n }\n\n const expr = initializer.getExpression();\n if (expr && Node.isStringLiteral(expr)) {\n pushUniqueClasses(cxLiterals, expr.getLiteralValue());\n }\n });\n });\n};\n\n/**\n * Extract UDS components used internally in the file and their prop values.\n * Also detects prop aliasing (e.g., columnGap={gap} means gap -> columnGap).\n */\nconst extractInternalComponents = (\n sourceFile: SourceFile,\n internalComponents: string[],\n internalComponentProps: Map<string, Map<string, string[]>>,\n propToVariantKeys: Map<string, string[]>,\n componentProps: Set<string>,\n): void => {\n collectImportedInternalComponents(sourceFile, internalComponents);\n collectInternalComponentUsages(\n sourceFile,\n internalComponents,\n internalComponentProps,\n propToVariantKeys,\n componentProps,\n );\n};\n\nconst isInternalUdsModule = (moduleSpec: string): boolean => {\n const isUdsImport =\n moduleSpec.startsWith('@yahoo/uds') ||\n moduleSpec.startsWith('../') ||\n moduleSpec.startsWith('./');\n\n return isUdsImport && (moduleSpec.includes('/components/') || moduleSpec === '@yahoo/uds');\n};\n\nconst pushUniqueComponentName = (components: string[], name: string): void => {\n if (/^[A-Z]/.test(name) && !components.includes(name)) {\n components.push(name);\n }\n};\n\nconst collectImportedInternalComponents = (\n sourceFile: SourceFile,\n internalComponents: string[],\n): void => {\n sourceFile.getImportDeclarations().forEach((importDecl) => {\n if (!isInternalUdsModule(importDecl.getModuleSpecifierValue())) {\n return;\n }\n\n importDecl\n .getNamedImports()\n .forEach((namedImport) => pushUniqueComponentName(internalComponents, namedImport.getName()));\n });\n};\n\nconst getOrCreateComponentPropsMap = (\n internalComponentProps: Map<string, Map<string, string[]>>,\n componentName: string,\n): Map<string, string[]> => {\n const existing = internalComponentProps.get(componentName);\n if (existing) {\n return existing;\n }\n\n const created = new Map<string, string[]>();\n internalComponentProps.set(componentName, created);\n return created;\n};\n\nconst extractJsxAttributeLiteralValues = (\n attr: Node,\n componentProps: Set<string>,\n propToVariantKeys: Map<string, string[]>,\n): { propName: string; values: string[] } | null => {\n if (!Node.isJsxAttribute(attr)) {\n return null;\n }\n\n const propName = attr.getNameNode().getText();\n const initializer = attr.getInitializer();\n if (!initializer) {\n return { propName, values: [] };\n }\n\n if (Node.isStringLiteral(initializer)) {\n return { propName, values: [initializer.getLiteralValue()] };\n }\n\n if (!Node.isJsxExpression(initializer)) {\n return { propName, values: [] };\n }\n\n const expr = initializer.getExpression();\n if (expr && Node.isStringLiteral(expr)) {\n return { propName, values: [expr.getLiteralValue()] };\n }\n\n if (expr && Node.isIdentifier(expr)) {\n const identifierName = expr.getText();\n if (componentProps.has(identifierName) && identifierName !== propName) {\n addPropToVariantKeyMapping(propToVariantKeys, identifierName, propName);\n }\n }\n\n return { propName, values: [] };\n};\n\nconst collectInternalComponentUsages = (\n sourceFile: SourceFile,\n internalComponents: string[],\n internalComponentProps: Map<string, Map<string, string[]>>,\n propToVariantKeys: Map<string, string[]>,\n componentProps: Set<string>,\n): void => {\n const jsxElements = [\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),\n ];\n\n jsxElements.forEach((element) => {\n const tagName = element.getTagNameNode().getText();\n if (!/^[A-Z]/.test(tagName)) {\n return;\n }\n\n pushUniqueComponentName(internalComponents, tagName);\n\n element.getAttributes().forEach((attr) => {\n const extracted = extractJsxAttributeLiteralValues(attr, componentProps, propToVariantKeys);\n if (!extracted || extracted.values.length === 0) {\n return;\n }\n\n const componentPropsMap = getOrCreateComponentPropsMap(internalComponentProps, tagName);\n const existingValues = componentPropsMap.get(extracted.propName) ?? [];\n const mergedValues = [...new Set([...existingValues, ...extracted.values])];\n componentPropsMap.set(extracted.propName, mergedValues);\n });\n });\n};\n\n/**\n * Extract default prop values from a function's parameter destructuring\n */\nconst extractDefaultsFromFunction = (fn: Node, defaults: Map<string, string>): void => {\n let params: Node[] = [];\n\n if (Node.isFunctionDeclaration(fn) || Node.isFunctionExpression(fn)) {\n params = fn.getParameters();\n } else if (Node.isArrowFunction(fn)) {\n params = fn.getParameters();\n }\n\n params.forEach((param) => {\n if (!Node.isParameterDeclaration(param)) {\n return;\n }\n\n const nameNode = param.getNameNode();\n if (!nameNode || !Node.isObjectBindingPattern(nameNode)) {\n return;\n }\n\n nameNode.getElements().forEach((element) => {\n const propName = element.getPropertyNameNode()?.getText() || element.getName();\n const initializer = element.getInitializer();\n\n if (initializer && Node.isStringLiteral(initializer)) {\n defaults.set(propName, initializer.getLiteralValue());\n } else if (initializer && Node.isIdentifier(initializer)) {\n const resolved = resolveIdentifierToStringLiteral(initializer);\n if (resolved) {\n defaults.set(propName, resolved);\n }\n }\n });\n });\n};\n\n/**\n * Extract ALL prop names from a function's parameter destructuring (not just defaults)\n */\nconst extractAllPropNames = (fn: Node, propNames: Set<string>): void => {\n let params: Node[] = [];\n\n if (Node.isFunctionDeclaration(fn) || Node.isFunctionExpression(fn)) {\n params = fn.getParameters();\n } else if (Node.isArrowFunction(fn)) {\n params = fn.getParameters();\n }\n\n params.forEach((param) => {\n if (!Node.isParameterDeclaration(param)) {\n return;\n }\n\n const nameNode = param.getNameNode();\n if (!nameNode || !Node.isObjectBindingPattern(nameNode)) {\n return;\n }\n\n nameNode.getElements().forEach((element) => {\n const propName = element.getPropertyNameNode()?.getText() || element.getName();\n propNames.add(propName);\n });\n });\n};\n\n/**\n * Get default classes for a component based on its default props\n */\nconst getDefaultClasses = (\n componentInfo: ComponentInfo,\n variants: Record<string, Record<string, string>>,\n): string[] => {\n const classes: string[] = [];\n\n componentInfo.defaultProps.forEach((propValue, propName) => {\n const variantGroup = variants[propName as keyof typeof variants];\n if (variantGroup && variantGroup[propValue]) {\n classes.push(variantGroup[propValue]);\n }\n });\n\n return classes;\n};\n\n/**\n * Get all components (including dependencies) for a given component\n */\nconst getComponentWithDependencies = (\n componentInfo: ComponentInfo,\n allComponents: Map<string, ComponentInfo>,\n visited: Set<string> = new Set(),\n): ComponentInfo[] => {\n if (visited.has(componentInfo.name)) {\n return [];\n }\n visited.add(componentInfo.name);\n\n const result: ComponentInfo[] = [componentInfo];\n\n componentInfo.internalComponents.forEach((depName) => {\n const depInfo = allComponents.get(depName);\n if (depInfo) {\n result.push(...getComponentWithDependencies(depInfo, allComponents, visited));\n }\n });\n\n return result;\n};\n\n/**\n * Extract string literals from cx() call arguments.\n * Handles:\n * - Direct string literals: cx('class1', 'class2')\n * - Object keys: cx({ 'class1': condition, 'class2': true })\n * - Nested calls and arrays\n */\nconst extractCxStringLiterals = (node: Node, literals: string[]): void => {\n if (Node.isStringLiteral(node)) {\n // Split by whitespace to handle multiple classes in one string\n const classes = node.getLiteralValue().split(/\\s+/).filter(Boolean);\n classes.forEach((cls) => {\n if (!literals.includes(cls)) {\n literals.push(cls);\n }\n });\n } else if (Node.isObjectLiteralExpression(node)) {\n // Extract keys from object: cx({ 'class1': condition })\n node.getProperties().forEach((prop) => {\n if (Node.isPropertyAssignment(prop)) {\n const nameNode = prop.getNameNode();\n if (Node.isStringLiteral(nameNode)) {\n const classes = nameNode.getLiteralValue().split(/\\s+/).filter(Boolean);\n classes.forEach((cls) => {\n if (!literals.includes(cls)) {\n literals.push(cls);\n }\n });\n } else if (Node.isIdentifier(nameNode)) {\n // Plain identifier key: cx({ className: condition })\n const cls = nameNode.getText();\n if (!literals.includes(cls)) {\n literals.push(cls);\n }\n }\n }\n });\n } else if (Node.isArrayLiteralExpression(node)) {\n // Recurse into array elements\n node.getElements().forEach((element) => {\n extractCxStringLiterals(element, literals);\n });\n } else if (Node.isConditionalExpression(node)) {\n // Handle ternary: condition ? 'class1' : 'class2'\n extractCxStringLiterals(node.getWhenTrue(), literals);\n extractCxStringLiterals(node.getWhenFalse(), literals);\n } else if (Node.isBinaryExpression(node)) {\n // Handle logical expressions: condition && 'class'\n extractCxStringLiterals(node.getLeft(), literals);\n extractCxStringLiterals(node.getRight(), literals);\n }\n};\n\n/**\n * Try to resolve an identifier to its initializer value (for const declarations)\n */\nconst resolveIdentifierToObject = (\n sourceFile: SourceFile,\n identifier: string,\n): Record<string, string> | null => {\n // Find variable declarations in the file\n const varDecls = sourceFile.getDescendantsOfKind(SyntaxKind.VariableDeclaration);\n\n const decl = varDecls.find((candidate) => candidate.getName() === identifier);\n if (!decl) {\n return null;\n }\n\n let initializer = decl.getInitializer();\n if (!initializer) {\n return null;\n }\n\n // Unwrap \"as const\" expressions: { ... } as const\n if (Node.isAsExpression(initializer)) {\n initializer = initializer.getExpression();\n }\n\n if (!Node.isObjectLiteralExpression(initializer)) {\n return null;\n }\n\n // Extract properties from the object literal\n const result: Record<string, string> = {};\n initializer.getProperties().forEach((prop) => {\n if (!Node.isPropertyAssignment(prop)) {\n return;\n }\n\n const propName = prop.getName();\n const propInit = prop.getInitializer();\n\n if (propInit && Node.isStringLiteral(propInit)) {\n result[propName] = propInit.getLiteralValue();\n }\n });\n\n return result;\n};\n\n/**\n * Extract motion CSS variable prefixes from SpringMotionConfig usage.\n * Returns prefixes like ['--uds-motion-bouncy-4-', '--uds-motion-smooth-3-']\n */\nconst extractMotionVarPrefixes = (sourceFile: SourceFile): string[] => {\n const prefixes: string[] = [];\n\n // Find all SpringMotionConfig JSX elements\n const jsxElements = [\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),\n ];\n\n jsxElements.forEach((element) => {\n const tagName = element.getTagNameNode().getText();\n if (tagName !== 'SpringMotionConfig') {\n return;\n }\n\n // Extract prop values\n const props: Record<string, string | null> = {\n layoutVariant: null,\n layoutSpeed: null,\n colorVariant: null,\n colorSpeed: null,\n };\n\n const attrs = element.getAttributes();\n attrs.forEach((attr) => {\n // Handle spread attributes: {...toggleTransition}\n if (Node.isJsxSpreadAttribute(attr)) {\n const expr = attr.getExpression();\n if (Node.isIdentifier(expr)) {\n const spreadObj = resolveIdentifierToObject(sourceFile, expr.getText());\n if (spreadObj) {\n // Apply spread values to props\n Object.keys(props).forEach((key) => {\n if (key in spreadObj) {\n props[key] = spreadObj[key];\n }\n });\n }\n }\n return;\n }\n\n if (!Node.isJsxAttribute(attr)) {\n return;\n }\n\n const propName = attr.getNameNode().getText();\n if (!(propName in props)) {\n return;\n }\n\n const initializer = attr.getInitializer();\n if (initializer) {\n if (Node.isStringLiteral(initializer)) {\n props[propName] = initializer.getLiteralValue();\n } else if (Node.isJsxExpression(initializer)) {\n const expr = initializer.getExpression();\n if (expr && Node.isStringLiteral(expr)) {\n props[propName] = expr.getLiteralValue();\n }\n // If it's a variable/prop, we can't determine the value statically\n // Fall back to including all variants for that dimension\n }\n }\n });\n\n // Build the CSS variable prefixes\n // Layout config: --uds-motion-{variant}-{speed}-\n const layoutVariant = props.layoutVariant ?? SPRING_MOTION_DEFAULTS.layoutVariant;\n const layoutSpeed = props.layoutSpeed ?? SPRING_MOTION_DEFAULTS.layoutSpeed;\n const layoutPrefix = `--uds-motion-${layoutVariant}-${layoutSpeed}-`;\n if (!prefixes.includes(layoutPrefix)) {\n prefixes.push(layoutPrefix);\n }\n\n // Color config: --uds-motion-{variant}-{speed}-\n const colorVariant = props.colorVariant ?? SPRING_MOTION_DEFAULTS.colorVariant;\n const colorSpeed = props.colorSpeed ?? SPRING_MOTION_DEFAULTS.colorSpeed;\n const colorPrefix = `--uds-motion-${colorVariant}-${colorSpeed}-`;\n if (!prefixes.includes(colorPrefix)) {\n prefixes.push(colorPrefix);\n }\n });\n\n return prefixes;\n};\n\nconst resolveIdentifierToStringLiteral = (identifier: Node): string | null => {\n if (!Node.isIdentifier(identifier)) {\n return null;\n }\n\n const symbol = identifier.getSymbol();\n if (!symbol) {\n return resolveImportedIdentifier(identifier);\n }\n\n const resolvedDeclarationValue = symbol\n .getDeclarations()\n .reduce<string | undefined>((resolved, declaration) => {\n if (resolved) {\n return resolved;\n }\n\n if (Node.isVariableDeclaration(declaration)) {\n let initializer = declaration.getInitializer();\n\n // Unwrap \"as const\"\n if (initializer && Node.isAsExpression(initializer)) {\n initializer = initializer.getExpression();\n }\n\n if (initializer && Node.isStringLiteral(initializer)) {\n return initializer.getLiteralValue();\n }\n }\n\n if (Node.isEnumMember(declaration)) {\n const initializer = declaration.getInitializer();\n if (initializer && Node.isStringLiteral(initializer)) {\n return initializer.getLiteralValue();\n }\n }\n\n return undefined;\n }, undefined);\n\n if (resolvedDeclarationValue) {\n return resolvedDeclarationValue;\n }\n\n return resolveImportedIdentifier(identifier);\n};\n\nconst resolveImportedIdentifier = (identifier: Node): string | null => {\n if (!Node.isIdentifier(identifier)) {\n return null;\n }\n\n const name = identifier.getText();\n const sourceFile = identifier.getSourceFile();\n const project = sourceFile.getProject();\n const baseDir = path.dirname(sourceFile.getFilePath());\n\n const importResolution = sourceFile\n .getImportDeclarations()\n .reduce<string | undefined>((resolvedImport, importDecl) => {\n if (resolvedImport) {\n return resolvedImport;\n }\n\n const namedImport = importDecl.getNamedImports().find((n) => n.getName() === name);\n if (!namedImport) {\n return undefined;\n }\n\n const moduleSpec = importDecl.getModuleSpecifierValue();\n if (!moduleSpec.startsWith('.') || hasImportQuery(moduleSpec)) {\n return undefined;\n }\n\n const resolvedBase = path.resolve(baseDir, moduleSpec);\n const candidates = [resolvedBase, `${resolvedBase}.ts`, `${resolvedBase}.tsx`];\n\n return candidates.reduce<string | undefined>((resolvedCandidate, candidate) => {\n if (resolvedCandidate) {\n return resolvedCandidate;\n }\n\n if (!existsSync(candidate)) {\n return undefined;\n }\n\n const importedFile = project.addSourceFileAtPathIfExists(candidate);\n if (!importedFile) {\n return undefined;\n }\n\n const varDecl = importedFile.getVariableDeclaration(name);\n if (!varDecl) {\n return undefined;\n }\n\n let initializer = varDecl.getInitializer();\n if (initializer && Node.isAsExpression(initializer)) {\n initializer = initializer.getExpression();\n }\n\n return initializer && Node.isStringLiteral(initializer)\n ? initializer.getLiteralValue()\n : undefined;\n }, undefined);\n }, undefined);\n\n if (importResolution) {\n return importResolution;\n }\n\n return null;\n};\n\nexport type { ComponentInfo };\nexport {\n analyzeComponent,\n getComponentPath,\n getComponentWithDependencies,\n getDefaultClasses,\n scanComponentFiles,\n};\n"],"mappings":";;;;;;;;;;;;AAyCA,IAAI,kBAAsC;;;;AAK1C,IAAI,iBAA6C;AACjD,IAAI,uBAAsC;AAC1C,MAAM,kBAAkB,oBAAqC,gBAAgB,SAAS,IAAI;AAC1F,MAAM,yBAAyB,OAAO,kBACpC,GAAG,iCAAiC,EAAE;CACpC,KAAK;CACL,UAAU;CACX,CAAC;;;;AAKJ,MAAM,qBAAqB,OAAO,kBAAwD;AACxF,KAAI,kBAAkB,yBAAyB,cAC7C,QAAO;AAGT,kCAAiB,IAAI,KAAK;AAC1B,mCAAkB,IAAI,KAAK;AAC3B,wBAAuB;CAEvB,MAAM,qBAAqB;CAC3B,MAAM,sBAAsB;AAI5B,EAFc,MAAM,uBAAuB,cAAc,EAEnD,SAAS,SAAS;AAEtB,MACE,KAAK,SAAS,SAAS,IACvB,KAAK,SAAS,+BAA+B,KAAK,CAAC,KAAK,QAExD;EAGF,MAAM,WAAW,KAAK,SAAS,+BAA+B,KAAK,CAAC;AAGpE,MAAI,SAAS,KAAK,SAAS,EAAE;AAC3B,sBAAmB,IAAI,UAAU,KAAK;AACtC,uBAAoB,IAAI,SAAS;;GAEnC;AAEF,QAAO;;;;;;;;;AAqBT,MAAM,mCACJ,YACA,YACA,mBACA,mBACA,eACS;AACT,YAAW,eAAe,CAAC,SAAS,SAAS;AAC3C,MAAI,KAAK,qBAAqB,KAAK,EAAE;AACnC,oCAAiC,MAAM,YAAY,mBAAmB,kBAAkB;AACxF;;AAGF,MAAI,KAAK,mBAAmB,KAAK,CAC/B,gCACE,MACA,YACA,mBACA,mBACA,WACD;GAEH;;AAGJ,MAAM,gBAAgB,YAAsB,eAA6B;AACvE,KAAI,CAAC,WAAW,SAAS,WAAW,CAClC,YAAW,KAA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Y,eAAe;AAG3C,UAAO,eAAe,KAAK,gBAAgB,YAAY,GACnD,YAAY,iBAAiB,GAC7B;KACH,OAAU;IACZ,OAAU;AAEf,KAAI,iBACF,QAAO;AAGT,QAAO"}
1
+ {"version":3,"file":"componentAnalyzer.js","names":[],"sources":["../../../../src/purger/optimized/utils/componentAnalyzer.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport path from 'node:path';\n\nimport { SPRING_MOTION_DEFAULTS } from '@yahoo/uds-motion-tokens';\nimport fg from 'fast-glob';\nimport type { ObjectLiteralExpression, Project, SourceFile } from 'ts-morph';\nimport { Node, SyntaxKind } from 'ts-morph';\n\nimport { getRuntimeHookConfig } from '../../../runtimeConfig/hookMetadata';\nimport {\n getAllowedEntryFileGlobPatterns,\n stripAllowedEntryFileExtension,\n} from '../../../utils/entryPoints';\n\ninterface ComponentInfo {\n name: string;\n filePath: string;\n /** Default values from function parameter destructuring (e.g., display = 'flex') */\n defaultProps: Map<string, string>;\n /** Props passed to getStyles() calls */\n styleProps: string[];\n /** Hardcoded literal values passed directly to getStyles() (e.g., flex: 'none') */\n getStylesLiterals: Map<string, string>;\n /** Raw Tailwind class literals from cx() calls (e.g., 'absolute', 'opacity-0') */\n cxLiterals: string[];\n /** Other UDS components used internally */\n internalComponents: string[];\n /** Literal prop values passed to internal UDS components (e.g., <Icon color=\"current\" />) */\n internalComponentProps: Map<string, Map<string, string[]>>;\n /** Maps prop names to variant keys (e.g., variant -> [buttonVariantRoot, buttonVariantIcon]) */\n propToVariantKeys: Map<string, string[]>;\n /** Runtime-config-backed defaults for component props (e.g., size -> toast.defaultSize) */\n runtimeConfigDefaultProps: Map<string, string>;\n /** Runtime-config selectors used directly in getStyles() variant keys */\n runtimeConfigGetStyles: Map<string, string[]>;\n /** Runtime-config selectors passed to internal UDS component props */\n runtimeConfigInternalComponentProps: Map<string, Map<string, string[]>>;\n /**\n * Motion CSS variable prefixes used by this component.\n * e.g., ['--uds-motion-bouncy-4-', '--uds-motion-smooth-3-']\n * Empty array means no motion vars needed.\n */\n motionVarPrefixes: string[];\n}\n\ntype RuntimeConfigBinding = {\n selector: string;\n};\n\n/**\n * Known UDS component names (populated by scanning)\n */\nlet knownComponents: Set<string> | null = null;\n\n/**\n * Map of component name -> file path\n */\nlet componentPaths: Map<string, string> | null = null;\nlet scannedComponentsDir: string | null = null;\nconst hasImportQuery = (moduleSpecifier: string): boolean => moduleSpecifier.includes('?');\nconst scanComponentFilePaths = async (componentsDir: string): Promise<string[]> =>\n fg(getAllowedEntryFileGlobPatterns(), {\n cwd: componentsDir,\n absolute: true,\n });\n\n/**\n * Scan src/components to build a map of all component files\n */\nconst scanComponentFiles = async (componentsDir: string): Promise<Map<string, string>> => {\n if (componentPaths && scannedComponentsDir === componentsDir) {\n return componentPaths;\n }\n\n componentPaths = new Map();\n knownComponents = new Set();\n scannedComponentsDir = componentsDir;\n\n const nextComponentPaths = componentPaths;\n const nextKnownComponents = knownComponents;\n\n const files = await scanComponentFilePaths(componentsDir);\n\n files.forEach((file) => {\n // Skip test files and index files\n if (\n file.includes('.test.') ||\n path.basename(stripAllowedEntryFileExtension(file)) === 'index'\n ) {\n return;\n }\n\n const fileName = path.basename(stripAllowedEntryFileExtension(file));\n\n // Use PascalCase file names as component names\n if (/^[A-Z]/.test(fileName)) {\n nextComponentPaths.set(fileName, file);\n nextKnownComponents.add(fileName);\n }\n });\n\n return nextComponentPaths;\n};\n\n/**\n * Get the file path for a component by name\n */\nconst getComponentPath = async (\n componentName: string,\n componentsDir: string,\n): Promise<string | null> => {\n const paths = await scanComponentFiles(componentsDir);\n return paths.get(componentName) ?? null;\n};\n\n/**\n * Analyze an object literal for variant key mappings.\n * Handles:\n * - Direct property assignments: { fontSize: variant } -> variant maps to fontSize\n * - Nullish coalescing: { fontSize: fontSize ?? variant } -> variant maps to fontSize\n * - Conditional spreads: ...(condition ? { props } : {}) -> recursively analyze props\n */\nconst analyzeObjectForVariantMappings = (\n objLiteral: ObjectLiteralExpression,\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n sourceFile: SourceFile,\n): void => {\n objLiteral.getProperties().forEach((prop) => {\n if (Node.isPropertyAssignment(prop)) {\n analyzeVariantPropertyAssignment(prop, styleProps, getStylesLiterals, propToVariantKeys);\n return;\n }\n\n if (Node.isSpreadAssignment(prop)) {\n analyzeVariantSpreadAssignment(\n prop,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n });\n};\n\nconst addStyleProp = (styleProps: string[], variantKey: string): void => {\n if (!styleProps.includes(variantKey)) {\n styleProps.push(variantKey);\n }\n};\n\nconst addPropToVariantKeyMapping = (\n propToVariantKeys: Map<string, string[]>,\n propName: string,\n variantKey: string,\n): void => {\n const existing = propToVariantKeys.get(propName) ?? [];\n if (!existing.includes(variantKey)) {\n propToVariantKeys.set(propName, [...existing, variantKey]);\n }\n};\n\nconst addRuntimeSelector = (target: Map<string, string[]>, key: string, selector: string): void => {\n const existing = target.get(key) ?? [];\n if (!existing.includes(selector)) {\n target.set(key, [...existing, selector]);\n }\n};\n\nconst getExpressionWithoutWrappers = (node: Node): Node => {\n if (Node.isParenthesizedExpression(node)) {\n return getExpressionWithoutWrappers(node.getExpression());\n }\n\n if (Node.isAsExpression(node) || Node.isTypeAssertion(node) || Node.isSatisfiesExpression(node)) {\n return getExpressionWithoutWrappers(node.getExpression());\n }\n\n return node;\n};\n\nconst applyRuntimeSelectorIndex = (\n selector: string,\n indexKey: string,\n isIdentifierIndex = false,\n): string => {\n if (selector.includes('${')) {\n return selector;\n }\n\n return isIdentifierIndex ? selector + '.${' + indexKey + '}' : `${selector}.${indexKey}`;\n};\n\nconst resolveRuntimeBindingFromExpression = (\n expr: Node,\n runtimeBindings: Map<string, RuntimeConfigBinding>,\n): RuntimeConfigBinding | null => {\n const normalized = getExpressionWithoutWrappers(expr);\n\n if (Node.isIdentifier(normalized)) {\n return runtimeBindings.get(normalized.getText()) ?? null;\n }\n\n if (Node.isElementAccessExpression(normalized)) {\n const target = resolveRuntimeBindingFromExpression(normalized.getExpression(), runtimeBindings);\n if (!target) {\n return null;\n }\n\n const argumentExpression = normalized.getArgumentExpression();\n if (!argumentExpression) {\n return null;\n }\n\n const argument = getExpressionWithoutWrappers(argumentExpression);\n\n if (Node.isStringLiteral(argument)) {\n return {\n selector: applyRuntimeSelectorIndex(target.selector, argument.getLiteralValue()),\n };\n }\n\n if (Node.isIdentifier(argument)) {\n return {\n selector: applyRuntimeSelectorIndex(target.selector, argument.getText(), true),\n };\n }\n }\n\n if (Node.isPropertyAccessExpression(normalized)) {\n const target = resolveRuntimeBindingFromExpression(normalized.getExpression(), runtimeBindings);\n if (!target) {\n return null;\n }\n\n return { selector: applyRuntimeSelectorIndex(target.selector, normalized.getName()) };\n }\n\n return null;\n};\n\nconst collectRuntimeSelectorsFromExpression = (\n expr: Node,\n runtimeBindings: Map<string, RuntimeConfigBinding>,\n): string[] => {\n const normalized = getExpressionWithoutWrappers(expr);\n const resolvedBinding = resolveRuntimeBindingFromExpression(normalized, runtimeBindings);\n if (resolvedBinding) {\n return [resolvedBinding.selector];\n }\n\n if (Node.isConditionalExpression(normalized)) {\n return [\n ...collectRuntimeSelectorsFromExpression(normalized.getWhenTrue(), runtimeBindings),\n ...collectRuntimeSelectorsFromExpression(normalized.getWhenFalse(), runtimeBindings),\n ];\n }\n\n if (Node.isBinaryExpression(normalized)) {\n return [\n ...collectRuntimeSelectorsFromExpression(normalized.getLeft(), runtimeBindings),\n ...collectRuntimeSelectorsFromExpression(normalized.getRight(), runtimeBindings),\n ];\n }\n\n return [];\n};\n\nconst collectRuntimeConfigBindings = (\n sourceFile: SourceFile,\n runtimeBindings: Map<string, RuntimeConfigBinding>,\n runtimeConfigDefaultProps: Map<string, string>,\n): void => {\n sourceFile.getDescendantsOfKind(SyntaxKind.VariableDeclaration).forEach((declaration) => {\n const initializer = declaration.getInitializer();\n if (!initializer) {\n return;\n }\n\n const normalizedInitializer = getExpressionWithoutWrappers(initializer);\n const nameNode = declaration.getNameNode();\n\n if (Node.isObjectBindingPattern(nameNode) && Node.isCallExpression(normalizedInitializer)) {\n const hookName = normalizedInitializer.getExpression().getText();\n const hookConfig = getRuntimeHookConfig(hookName);\n if (!hookConfig) {\n return;\n }\n\n Object.entries(hookConfig.defaultProps).forEach(([propName, selector]) => {\n runtimeConfigDefaultProps.set(propName, selector);\n });\n\n nameNode.getElements().forEach((element) => {\n const fieldName = element.getPropertyNameNode()?.getText() ?? element.getName();\n const localName = element.getName();\n const fieldConfig = hookConfig.fields[fieldName as keyof typeof hookConfig.fields];\n if (!fieldConfig) {\n return;\n }\n\n runtimeBindings.set(localName, { selector: fieldConfig.bindingSelector });\n });\n\n return;\n }\n\n if (!Node.isIdentifier(nameNode)) {\n return;\n }\n\n const resolvedBinding = resolveRuntimeBindingFromExpression(\n normalizedInitializer,\n runtimeBindings,\n );\n if (resolvedBinding) {\n runtimeBindings.set(nameNode.getText(), resolvedBinding);\n }\n });\n};\n\nconst extractFallbackIdentifier = (initializer: Node): string | null => {\n if (!Node.isBinaryExpression(initializer)) {\n return null;\n }\n\n const operatorKind = initializer.getOperatorToken().getKind();\n const isFallbackOperator =\n operatorKind === SyntaxKind.QuestionQuestionToken || operatorKind === SyntaxKind.BarBarToken;\n\n if (!isFallbackOperator || !Node.isIdentifier(initializer.getRight())) {\n return null;\n }\n\n return initializer.getRight().getText();\n};\n\nconst analyzeVariantPropertyAssignment = (\n prop: Node & { getName: () => string; getInitializer: () => Node | undefined },\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n): void => {\n const variantKey = prop.getName();\n addStyleProp(styleProps, variantKey);\n\n const initializer = prop.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isStringLiteral(initializer)) {\n getStylesLiterals.set(variantKey, initializer.getLiteralValue());\n }\n\n if (Node.isIdentifier(initializer)) {\n addPropToVariantKeyMapping(propToVariantKeys, initializer.getText(), variantKey);\n }\n\n const fallbackIdentifier = extractFallbackIdentifier(initializer);\n if (fallbackIdentifier) {\n addPropToVariantKeyMapping(propToVariantKeys, fallbackIdentifier, variantKey);\n }\n};\n\nconst findVariableObjectLiteral = (\n sourceFile: SourceFile,\n variableName: string,\n): ObjectLiteralExpression | null => {\n const declaration = sourceFile\n .getDescendantsOfKind(SyntaxKind.VariableDeclaration)\n .find((candidate) => candidate.getName() === variableName);\n const initializer = declaration?.getInitializer();\n\n return initializer && Node.isObjectLiteralExpression(initializer) ? initializer : null;\n};\n\nconst analyzeVariantSpreadAssignment = (\n prop: Node & { getExpression: () => Node },\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n sourceFile: SourceFile,\n): void => {\n const spreadExpr = prop.getExpression();\n\n if (Node.isParenthesizedExpression(spreadExpr)) {\n const conditionalExpr = spreadExpr.getExpression();\n if (Node.isConditionalExpression(conditionalExpr)) {\n const whenTrue = conditionalExpr.getWhenTrue();\n if (!Node.isObjectLiteralExpression(whenTrue)) {\n return;\n }\n\n analyzeObjectForVariantMappings(\n whenTrue,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n }\n\n if (Node.isIdentifier(spreadExpr)) {\n const objectLiteral = findVariableObjectLiteral(sourceFile, spreadExpr.getText());\n if (objectLiteral) {\n analyzeObjectForVariantMappings(\n objectLiteral,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n }\n};\n\n/**\n * Analyzes a UDS component file to extract:\n * 1. Default prop values (e.g., display = 'flex')\n * 2. Props passed to getStyles()\n * 3. Internal UDS component usage\n */\nconst analyzeComponent = (project: Project, componentPath: string): ComponentInfo | null => {\n const sourceFile = project.getSourceFile(componentPath);\n if (!sourceFile) {\n return null;\n }\n\n const componentName = path.basename(stripAllowedEntryFileExtension(componentPath));\n const defaultProps = new Map<string, string>();\n const componentPropNames = new Set<string>(); // All prop names (not just defaults)\n const styleProps: string[] = [];\n const getStylesLiterals = new Map<string, string>();\n const cxLiterals: string[] = [];\n const internalComponents: string[] = [];\n const internalComponentProps = new Map<string, Map<string, string[]>>();\n const propToVariantKeys = new Map<string, string[]>();\n const runtimeConfigDefaultProps = new Map<string, string>();\n const runtimeConfigGetStyles = new Map<string, string[]>();\n const runtimeConfigInternalComponentProps = new Map<string, Map<string, string[]>>();\n const runtimeBindings = new Map<string, RuntimeConfigBinding>();\n\n collectComponentDefaultsAndProps(sourceFile, defaultProps, componentPropNames);\n\n collectRuntimeConfigBindings(sourceFile, runtimeBindings, runtimeConfigDefaultProps);\n\n collectGetStylesMetadata(\n sourceFile,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n runtimeBindings,\n runtimeConfigGetStyles,\n );\n\n collectCxLiterals(sourceFile, cxLiterals);\n collectIntrinsicClassNameLiterals(sourceFile, cxLiterals);\n\n // Find internal UDS component usage and their prop values\n // Also detect prop aliasing (e.g., gap -> columnGap, rowGap in VStack)\n extractInternalComponents(\n sourceFile,\n internalComponents,\n internalComponentProps,\n runtimeConfigInternalComponentProps,\n propToVariantKeys,\n componentPropNames,\n runtimeBindings,\n );\n\n // Extract motion CSS variable prefixes from SpringMotionConfig usage\n const motionVarPrefixes = extractMotionVarPrefixes(sourceFile);\n\n return {\n name: componentName,\n filePath: componentPath,\n defaultProps,\n styleProps,\n getStylesLiterals,\n cxLiterals,\n internalComponents,\n internalComponentProps,\n propToVariantKeys,\n runtimeConfigDefaultProps,\n runtimeConfigGetStyles,\n runtimeConfigInternalComponentProps,\n motionVarPrefixes,\n };\n};\n\nconst getComponentFunctionNodes = (sourceFile: SourceFile): Node[] => [\n ...sourceFile.getFunctions(),\n ...sourceFile.getVariableDeclarations().filter((declaration) => {\n const initializer = declaration.getInitializer();\n return initializer && (Node.isArrowFunction(initializer) || Node.isCallExpression(initializer));\n }),\n];\n\nconst collectComponentDefaultsAndProps = (\n sourceFile: SourceFile,\n defaultProps: Map<string, string>,\n componentPropNames: Set<string>,\n): void => {\n getComponentFunctionNodes(sourceFile).forEach((fn) => {\n if (Node.isFunctionDeclaration(fn)) {\n extractDefaultsFromFunction(fn, defaultProps);\n extractAllPropNames(fn, componentPropNames);\n return;\n }\n\n if (!Node.isVariableDeclaration(fn)) {\n return;\n }\n\n const initializer = fn.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isCallExpression(initializer)) {\n initializer.getArguments().forEach((arg) => {\n if (Node.isFunctionExpression(arg) || Node.isArrowFunction(arg)) {\n extractDefaultsFromFunction(arg, defaultProps);\n extractAllPropNames(arg, componentPropNames);\n }\n });\n }\n\n if (Node.isArrowFunction(initializer)) {\n extractDefaultsFromFunction(initializer, defaultProps);\n extractAllPropNames(initializer, componentPropNames);\n }\n });\n};\n\nconst extractConditionalStringLiterals = (node: Node): string[] => {\n if (Node.isStringLiteral(node)) {\n return [node.getLiteralValue()];\n }\n\n if (Node.isConditionalExpression(node)) {\n return [\n ...extractConditionalStringLiterals(node.getWhenTrue()),\n ...extractConditionalStringLiterals(node.getWhenFalse()),\n ];\n }\n\n return [];\n};\n\nconst storeVariantLiteralValues = (\n variantKey: string,\n literalValues: string[],\n getStylesLiterals: Map<string, string>,\n): void => {\n literalValues.forEach((value, index) => {\n const literalKey = index === 0 ? variantKey : `${variantKey}:${index}`;\n getStylesLiterals.set(literalKey, value);\n });\n};\n\nconst handleGetStylesPropertyAssignment = (\n prop: Node & { getName: () => string; getInitializer: () => Node | undefined },\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n runtimeBindings: Map<string, RuntimeConfigBinding>,\n runtimeConfigGetStyles: Map<string, string[]>,\n): void => {\n const variantKey = prop.getName();\n addStyleProp(styleProps, variantKey);\n\n const initializer = prop.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isStringLiteral(initializer)) {\n getStylesLiterals.set(variantKey, initializer.getLiteralValue());\n }\n\n if (Node.isIdentifier(initializer)) {\n addPropToVariantKeyMapping(propToVariantKeys, initializer.getText(), variantKey);\n }\n\n collectRuntimeSelectorsFromExpression(initializer, runtimeBindings).forEach((selector) => {\n addRuntimeSelector(runtimeConfigGetStyles, variantKey, selector);\n });\n\n const fallbackIdentifier = extractFallbackIdentifier(initializer);\n if (fallbackIdentifier) {\n addPropToVariantKeyMapping(propToVariantKeys, fallbackIdentifier, variantKey);\n }\n\n if (Node.isConditionalExpression(initializer)) {\n const allValues = [\n ...extractConditionalStringLiterals(initializer.getWhenTrue()),\n ...extractConditionalStringLiterals(initializer.getWhenFalse()),\n ];\n storeVariantLiteralValues(variantKey, allValues, getStylesLiterals);\n }\n};\n\nconst handleGetStylesObjectProperty = (\n prop: Node,\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n sourceFile: SourceFile,\n runtimeBindings: Map<string, RuntimeConfigBinding>,\n runtimeConfigGetStyles: Map<string, string[]>,\n): void => {\n if (Node.isPropertyAssignment(prop)) {\n handleGetStylesPropertyAssignment(\n prop,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n runtimeBindings,\n runtimeConfigGetStyles,\n );\n return;\n }\n\n if (Node.isShorthandPropertyAssignment(prop)) {\n addStyleProp(styleProps, prop.getName());\n return;\n }\n\n if (Node.isSpreadAssignment(prop) && Node.isIdentifier(prop.getExpression())) {\n const objectLiteral = findVariableObjectLiteral(sourceFile, prop.getExpression().getText());\n if (objectLiteral) {\n analyzeObjectForVariantMappings(\n objectLiteral,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n );\n }\n }\n};\n\nconst collectGetStylesMetadata = (\n sourceFile: SourceFile,\n styleProps: string[],\n getStylesLiterals: Map<string, string>,\n propToVariantKeys: Map<string, string[]>,\n runtimeBindings: Map<string, RuntimeConfigBinding>,\n runtimeConfigGetStyles: Map<string, string[]>,\n): void => {\n sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((call) => call.getExpression().getText() === 'getStyles')\n .forEach((call) => {\n const args = call.getArguments();\n if (args.length === 0 || !Node.isObjectLiteralExpression(args[0])) {\n return;\n }\n\n args[0].getProperties().forEach((prop) => {\n handleGetStylesObjectProperty(\n prop,\n styleProps,\n getStylesLiterals,\n propToVariantKeys,\n sourceFile,\n runtimeBindings,\n runtimeConfigGetStyles,\n );\n });\n });\n};\n\nconst collectCxLiterals = (sourceFile: SourceFile, cxLiterals: string[]): void => {\n sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((call) => call.getExpression().getText() === 'cx')\n .forEach((call) => {\n call.getArguments().forEach((arg) => extractCxStringLiterals(arg, cxLiterals));\n });\n};\n\nconst pushUniqueClasses = (target: string[], rawValue: string): void => {\n rawValue\n .split(/\\s+/)\n .filter(Boolean)\n .forEach((className) => {\n if (!target.includes(className)) {\n target.push(className);\n }\n });\n};\n\nconst collectIntrinsicClassNameLiterals = (sourceFile: SourceFile, cxLiterals: string[]): void => {\n const jsxElements = [\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),\n ];\n\n jsxElements.forEach((element) => {\n const tagName = element.getTagNameNode().getText();\n if (!/^[a-z]/.test(tagName)) {\n return;\n }\n\n element.getAttributes().forEach((attr) => {\n if (!Node.isJsxAttribute(attr) || attr.getNameNode().getText() !== 'className') {\n return;\n }\n\n const initializer = attr.getInitializer();\n if (!initializer) {\n return;\n }\n\n if (Node.isStringLiteral(initializer)) {\n pushUniqueClasses(cxLiterals, initializer.getLiteralValue());\n return;\n }\n\n if (!Node.isJsxExpression(initializer)) {\n return;\n }\n\n const expr = initializer.getExpression();\n if (expr && Node.isStringLiteral(expr)) {\n pushUniqueClasses(cxLiterals, expr.getLiteralValue());\n }\n });\n });\n};\n\n/**\n * Extract UDS components used internally in the file and their prop values.\n * Also detects prop aliasing (e.g., columnGap={gap} means gap -> columnGap).\n */\nconst extractInternalComponents = (\n sourceFile: SourceFile,\n internalComponents: string[],\n internalComponentProps: Map<string, Map<string, string[]>>,\n runtimeConfigInternalComponentProps: Map<string, Map<string, string[]>>,\n propToVariantKeys: Map<string, string[]>,\n componentProps: Set<string>,\n runtimeBindings: Map<string, RuntimeConfigBinding>,\n): void => {\n collectImportedInternalComponents(sourceFile, internalComponents);\n collectInternalComponentUsages(\n sourceFile,\n internalComponents,\n internalComponentProps,\n runtimeConfigInternalComponentProps,\n propToVariantKeys,\n componentProps,\n runtimeBindings,\n );\n};\n\nconst isInternalUdsModule = (moduleSpec: string): boolean => {\n const isUdsImport =\n moduleSpec.startsWith('@yahoo/uds') ||\n moduleSpec.startsWith('../') ||\n moduleSpec.startsWith('./');\n\n return isUdsImport && (moduleSpec.includes('/components/') || moduleSpec === '@yahoo/uds');\n};\n\nconst pushUniqueComponentName = (components: string[], name: string): void => {\n if (/^[A-Z]/.test(name) && !components.includes(name)) {\n components.push(name);\n }\n};\n\nconst collectImportedInternalComponents = (\n sourceFile: SourceFile,\n internalComponents: string[],\n): void => {\n sourceFile.getImportDeclarations().forEach((importDecl) => {\n if (!isInternalUdsModule(importDecl.getModuleSpecifierValue())) {\n return;\n }\n\n importDecl\n .getNamedImports()\n .forEach((namedImport) => pushUniqueComponentName(internalComponents, namedImport.getName()));\n });\n};\n\nconst getOrCreateComponentPropsMap = (\n internalComponentProps: Map<string, Map<string, string[]>>,\n componentName: string,\n): Map<string, string[]> => {\n const existing = internalComponentProps.get(componentName);\n if (existing) {\n return existing;\n }\n\n const created = new Map<string, string[]>();\n internalComponentProps.set(componentName, created);\n return created;\n};\n\nconst extractJsxAttributeLiteralValues = (\n attr: Node,\n componentProps: Set<string>,\n propToVariantKeys: Map<string, string[]>,\n): { propName: string; values: string[] } | null => {\n if (!Node.isJsxAttribute(attr)) {\n return null;\n }\n\n const propName = attr.getNameNode().getText();\n const initializer = attr.getInitializer();\n if (!initializer) {\n return { propName, values: [] };\n }\n\n if (Node.isStringLiteral(initializer)) {\n return { propName, values: [initializer.getLiteralValue()] };\n }\n\n if (!Node.isJsxExpression(initializer)) {\n return { propName, values: [] };\n }\n\n const expr = initializer.getExpression();\n if (expr && Node.isStringLiteral(expr)) {\n return { propName, values: [expr.getLiteralValue()] };\n }\n\n if (expr && Node.isIdentifier(expr)) {\n const identifierName = expr.getText();\n if (componentProps.has(identifierName) && identifierName !== propName) {\n addPropToVariantKeyMapping(propToVariantKeys, identifierName, propName);\n }\n }\n\n return { propName, values: [] };\n};\n\nconst collectInternalComponentUsages = (\n sourceFile: SourceFile,\n internalComponents: string[],\n internalComponentProps: Map<string, Map<string, string[]>>,\n runtimeConfigInternalComponentProps: Map<string, Map<string, string[]>>,\n propToVariantKeys: Map<string, string[]>,\n componentProps: Set<string>,\n runtimeBindings: Map<string, RuntimeConfigBinding>,\n): void => {\n const jsxElements = [\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),\n ];\n\n jsxElements.forEach((element) => {\n const tagName = element.getTagNameNode().getText();\n if (!/^[A-Z]/.test(tagName)) {\n return;\n }\n\n pushUniqueComponentName(internalComponents, tagName);\n\n element.getAttributes().forEach((attr) => {\n if (Node.isJsxAttribute(attr)) {\n const initializer = attr.getInitializer();\n const expression =\n initializer && Node.isJsxExpression(initializer)\n ? initializer.getExpression()\n : undefined;\n const runtimeSelectors = expression\n ? collectRuntimeSelectorsFromExpression(expression, runtimeBindings)\n : [];\n\n if (runtimeSelectors.length > 0) {\n const runtimePropsMap = getOrCreateComponentPropsMap(\n runtimeConfigInternalComponentProps,\n tagName,\n );\n const runtimePropName = attr.getNameNode().getText();\n const existingRuntimeSelectors = runtimePropsMap.get(runtimePropName) ?? [];\n runtimePropsMap.set(runtimePropName, [\n ...new Set([...existingRuntimeSelectors, ...runtimeSelectors]),\n ]);\n }\n }\n\n const extracted = extractJsxAttributeLiteralValues(attr, componentProps, propToVariantKeys);\n if (!extracted || extracted.values.length === 0) {\n return;\n }\n\n const componentPropsMap = getOrCreateComponentPropsMap(internalComponentProps, tagName);\n const existingValues = componentPropsMap.get(extracted.propName) ?? [];\n const mergedValues = [...new Set([...existingValues, ...extracted.values])];\n componentPropsMap.set(extracted.propName, mergedValues);\n });\n });\n};\n\n/**\n * Extract default prop values from a function's parameter destructuring\n */\nconst extractDefaultsFromFunction = (fn: Node, defaults: Map<string, string>): void => {\n let params: Node[] = [];\n\n if (Node.isFunctionDeclaration(fn) || Node.isFunctionExpression(fn)) {\n params = fn.getParameters();\n } else if (Node.isArrowFunction(fn)) {\n params = fn.getParameters();\n }\n\n params.forEach((param) => {\n if (!Node.isParameterDeclaration(param)) {\n return;\n }\n\n const nameNode = param.getNameNode();\n if (!nameNode || !Node.isObjectBindingPattern(nameNode)) {\n return;\n }\n\n nameNode.getElements().forEach((element) => {\n const propName = element.getPropertyNameNode()?.getText() || element.getName();\n const initializer = element.getInitializer();\n\n if (initializer && Node.isStringLiteral(initializer)) {\n defaults.set(propName, initializer.getLiteralValue());\n } else if (initializer && Node.isIdentifier(initializer)) {\n const resolved = resolveIdentifierToStringLiteral(initializer);\n if (resolved) {\n defaults.set(propName, resolved);\n }\n }\n });\n });\n};\n\n/**\n * Extract ALL prop names from a function's parameter destructuring (not just defaults)\n */\nconst extractAllPropNames = (fn: Node, propNames: Set<string>): void => {\n let params: Node[] = [];\n\n if (Node.isFunctionDeclaration(fn) || Node.isFunctionExpression(fn)) {\n params = fn.getParameters();\n } else if (Node.isArrowFunction(fn)) {\n params = fn.getParameters();\n }\n\n params.forEach((param) => {\n if (!Node.isParameterDeclaration(param)) {\n return;\n }\n\n const nameNode = param.getNameNode();\n if (!nameNode || !Node.isObjectBindingPattern(nameNode)) {\n return;\n }\n\n nameNode.getElements().forEach((element) => {\n const propName = element.getPropertyNameNode()?.getText() || element.getName();\n propNames.add(propName);\n });\n });\n};\n\n/**\n * Get default classes for a component based on its default props\n */\nconst getDefaultClasses = (\n componentInfo: ComponentInfo,\n variants: Record<string, Record<string, string>>,\n): string[] => {\n const classes: string[] = [];\n\n componentInfo.defaultProps.forEach((propValue, propName) => {\n const variantGroup = variants[propName as keyof typeof variants];\n if (variantGroup && variantGroup[propValue]) {\n classes.push(variantGroup[propValue]);\n }\n });\n\n return classes;\n};\n\n/**\n * Get all components (including dependencies) for a given component\n */\nconst getComponentWithDependencies = (\n componentInfo: ComponentInfo,\n allComponents: Map<string, ComponentInfo>,\n visited: Set<string> = new Set(),\n): ComponentInfo[] => {\n if (visited.has(componentInfo.name)) {\n return [];\n }\n visited.add(componentInfo.name);\n\n const result: ComponentInfo[] = [componentInfo];\n\n componentInfo.internalComponents.forEach((depName) => {\n const depInfo = allComponents.get(depName);\n if (depInfo) {\n result.push(...getComponentWithDependencies(depInfo, allComponents, visited));\n }\n });\n\n return result;\n};\n\n/**\n * Extract string literals from cx() call arguments.\n * Handles:\n * - Direct string literals: cx('class1', 'class2')\n * - Object keys: cx({ 'class1': condition, 'class2': true })\n * - Nested calls and arrays\n */\nconst extractCxStringLiterals = (node: Node, literals: string[]): void => {\n if (Node.isStringLiteral(node)) {\n // Split by whitespace to handle multiple classes in one string\n const classes = node.getLiteralValue().split(/\\s+/).filter(Boolean);\n classes.forEach((cls) => {\n if (!literals.includes(cls)) {\n literals.push(cls);\n }\n });\n } else if (Node.isObjectLiteralExpression(node)) {\n // Extract keys from object: cx({ 'class1': condition })\n node.getProperties().forEach((prop) => {\n if (Node.isPropertyAssignment(prop)) {\n const nameNode = prop.getNameNode();\n if (Node.isStringLiteral(nameNode)) {\n const classes = nameNode.getLiteralValue().split(/\\s+/).filter(Boolean);\n classes.forEach((cls) => {\n if (!literals.includes(cls)) {\n literals.push(cls);\n }\n });\n } else if (Node.isIdentifier(nameNode)) {\n // Plain identifier key: cx({ className: condition })\n const cls = nameNode.getText();\n if (!literals.includes(cls)) {\n literals.push(cls);\n }\n }\n }\n });\n } else if (Node.isArrayLiteralExpression(node)) {\n // Recurse into array elements\n node.getElements().forEach((element) => {\n extractCxStringLiterals(element, literals);\n });\n } else if (Node.isConditionalExpression(node)) {\n // Handle ternary: condition ? 'class1' : 'class2'\n extractCxStringLiterals(node.getWhenTrue(), literals);\n extractCxStringLiterals(node.getWhenFalse(), literals);\n } else if (Node.isBinaryExpression(node)) {\n // Handle logical expressions: condition && 'class'\n extractCxStringLiterals(node.getLeft(), literals);\n extractCxStringLiterals(node.getRight(), literals);\n }\n};\n\n/**\n * Try to resolve an identifier to its initializer value (for const declarations)\n */\nconst resolveIdentifierToObject = (\n sourceFile: SourceFile,\n identifier: string,\n): Record<string, string> | null => {\n // Find variable declarations in the file\n const varDecls = sourceFile.getDescendantsOfKind(SyntaxKind.VariableDeclaration);\n\n const decl = varDecls.find((candidate) => candidate.getName() === identifier);\n if (!decl) {\n return null;\n }\n\n let initializer = decl.getInitializer();\n if (!initializer) {\n return null;\n }\n\n // Unwrap \"as const\" expressions: { ... } as const\n if (Node.isAsExpression(initializer)) {\n initializer = initializer.getExpression();\n }\n\n if (!Node.isObjectLiteralExpression(initializer)) {\n return null;\n }\n\n // Extract properties from the object literal\n const result: Record<string, string> = {};\n initializer.getProperties().forEach((prop) => {\n if (!Node.isPropertyAssignment(prop)) {\n return;\n }\n\n const propName = prop.getName();\n const propInit = prop.getInitializer();\n\n if (propInit && Node.isStringLiteral(propInit)) {\n result[propName] = propInit.getLiteralValue();\n }\n });\n\n return result;\n};\n\n/**\n * Extract motion CSS variable prefixes from SpringMotionConfig usage.\n * Returns prefixes like ['--uds-motion-bouncy-4-', '--uds-motion-smooth-3-']\n */\nconst extractMotionVarPrefixes = (sourceFile: SourceFile): string[] => {\n const prefixes: string[] = [];\n\n // Find all SpringMotionConfig JSX elements\n const jsxElements = [\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),\n ...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),\n ];\n\n jsxElements.forEach((element) => {\n const tagName = element.getTagNameNode().getText();\n if (tagName !== 'SpringMotionConfig') {\n return;\n }\n\n // Extract prop values\n const props: Record<string, string | null> = {\n layoutVariant: null,\n layoutSpeed: null,\n colorVariant: null,\n colorSpeed: null,\n };\n\n const attrs = element.getAttributes();\n attrs.forEach((attr) => {\n // Handle spread attributes: {...toggleTransition}\n if (Node.isJsxSpreadAttribute(attr)) {\n const expr = attr.getExpression();\n if (Node.isIdentifier(expr)) {\n const spreadObj = resolveIdentifierToObject(sourceFile, expr.getText());\n if (spreadObj) {\n // Apply spread values to props\n Object.keys(props).forEach((key) => {\n if (key in spreadObj) {\n props[key] = spreadObj[key];\n }\n });\n }\n }\n return;\n }\n\n if (!Node.isJsxAttribute(attr)) {\n return;\n }\n\n const propName = attr.getNameNode().getText();\n if (!(propName in props)) {\n return;\n }\n\n const initializer = attr.getInitializer();\n if (initializer) {\n if (Node.isStringLiteral(initializer)) {\n props[propName] = initializer.getLiteralValue();\n } else if (Node.isJsxExpression(initializer)) {\n const expr = initializer.getExpression();\n if (expr && Node.isStringLiteral(expr)) {\n props[propName] = expr.getLiteralValue();\n }\n // If it's a variable/prop, we can't determine the value statically\n // Fall back to including all variants for that dimension\n }\n }\n });\n\n // Build the CSS variable prefixes\n // Layout config: --uds-motion-{variant}-{speed}-\n const layoutVariant = props.layoutVariant ?? SPRING_MOTION_DEFAULTS.layoutVariant;\n const layoutSpeed = props.layoutSpeed ?? SPRING_MOTION_DEFAULTS.layoutSpeed;\n const layoutPrefix = `--uds-motion-${layoutVariant}-${layoutSpeed}-`;\n if (!prefixes.includes(layoutPrefix)) {\n prefixes.push(layoutPrefix);\n }\n\n // Color config: --uds-motion-{variant}-{speed}-\n const colorVariant = props.colorVariant ?? SPRING_MOTION_DEFAULTS.colorVariant;\n const colorSpeed = props.colorSpeed ?? SPRING_MOTION_DEFAULTS.colorSpeed;\n const colorPrefix = `--uds-motion-${colorVariant}-${colorSpeed}-`;\n if (!prefixes.includes(colorPrefix)) {\n prefixes.push(colorPrefix);\n }\n });\n\n return prefixes;\n};\n\nconst resolveIdentifierToStringLiteral = (identifier: Node): string | null => {\n if (!Node.isIdentifier(identifier)) {\n return null;\n }\n\n const symbol = identifier.getSymbol();\n if (!symbol) {\n return resolveImportedIdentifier(identifier);\n }\n\n const resolvedDeclarationValue = symbol\n .getDeclarations()\n .reduce<string | undefined>((resolved, declaration) => {\n if (resolved) {\n return resolved;\n }\n\n if (Node.isVariableDeclaration(declaration)) {\n let initializer = declaration.getInitializer();\n\n // Unwrap \"as const\"\n if (initializer && Node.isAsExpression(initializer)) {\n initializer = initializer.getExpression();\n }\n\n if (initializer && Node.isStringLiteral(initializer)) {\n return initializer.getLiteralValue();\n }\n }\n\n if (Node.isEnumMember(declaration)) {\n const initializer = declaration.getInitializer();\n if (initializer && Node.isStringLiteral(initializer)) {\n return initializer.getLiteralValue();\n }\n }\n\n return undefined;\n }, undefined);\n\n if (resolvedDeclarationValue) {\n return resolvedDeclarationValue;\n }\n\n return resolveImportedIdentifier(identifier);\n};\n\nconst resolveImportedIdentifier = (identifier: Node): string | null => {\n if (!Node.isIdentifier(identifier)) {\n return null;\n }\n\n const name = identifier.getText();\n const sourceFile = identifier.getSourceFile();\n const project = sourceFile.getProject();\n const baseDir = path.dirname(sourceFile.getFilePath());\n\n const importResolution = sourceFile\n .getImportDeclarations()\n .reduce<string | undefined>((resolvedImport, importDecl) => {\n if (resolvedImport) {\n return resolvedImport;\n }\n\n const namedImport = importDecl.getNamedImports().find((n) => n.getName() === name);\n if (!namedImport) {\n return undefined;\n }\n\n const moduleSpec = importDecl.getModuleSpecifierValue();\n if (!moduleSpec.startsWith('.') || hasImportQuery(moduleSpec)) {\n return undefined;\n }\n\n const resolvedBase = path.resolve(baseDir, moduleSpec);\n const candidates = [resolvedBase, `${resolvedBase}.ts`, `${resolvedBase}.tsx`];\n\n return candidates.reduce<string | undefined>((resolvedCandidate, candidate) => {\n if (resolvedCandidate) {\n return resolvedCandidate;\n }\n\n if (!existsSync(candidate)) {\n return undefined;\n }\n\n const importedFile = project.addSourceFileAtPathIfExists(candidate);\n if (!importedFile) {\n return undefined;\n }\n\n const varDecl = importedFile.getVariableDeclaration(name);\n if (!varDecl) {\n return undefined;\n }\n\n let initializer = varDecl.getInitializer();\n if (initializer && Node.isAsExpression(initializer)) {\n initializer = initializer.getExpression();\n }\n\n return initializer && Node.isStringLiteral(initializer)\n ? initializer.getLiteralValue()\n : undefined;\n }, undefined);\n }, undefined);\n\n if (importResolution) {\n return importResolution;\n }\n\n return null;\n};\n\nexport type { ComponentInfo };\nexport {\n analyzeComponent,\n getComponentPath,\n getComponentWithDependencies,\n getDefaultClasses,\n scanComponentFiles,\n};\n"],"mappings":";;;;;;;;;;;;;AAoDA,IAAI,kBAAsC;;;;AAK1C,IAAI,iBAA6C;AACjD,IAAI,uBAAsC;AAC1C,MAAM,kBAAkB,oBAAqC,gBAAgB,SAAS,IAAI;AAC1F,MAAM,yBAAyB,OAAO,kBACpC,GAAG,iCAAiC,EAAE;CACpC,KAAK;CACL,UAAU;CACX,CAAC;;;;AAKJ,MAAM,qBAAqB,OAAO,kBAAwD;AACxF,KAAI,kBAAkB,yBAAyB,cAC7C,QAAO;AAGT,kCAAiB,IAAI,KAAK;AAC1B,mCAAkB,IAAI,KAAK;AAC3B,wBAAuB;CAEvB,MAAM,qBAAqB;CAC3B,MAAM,sBAAsB;AAI5B,EAFc,MAAM,uBAAuB,cAAc,EAEnD,SAAS,SAAS;AAEtB,MACE,KAAK,SAAS,SAAS,IACvB,KAAK,SAAS,+BAA+B,KAAK,CAAC,KAAK,QAExD;EAGF,MAAM,WAAW,KAAK,SAAS,+BAA+B,KAAK,CAAC;AAGpE,MAAI,SAAS,KAAK,SAAS,EAAE;AAC3B,sBAAmB,IAAI,UAAU,KAAK;AACtC,uBAAoB,IAAI,SAAS;;GAEnC;AAEF,QAAO;;;;;;;;;AAqBT,MAAM,mCACJ,YACA,YACA,mBACA,mBACA,eACS;AACT,YAAW,eAAe,CAAC,SAAS,SAAS;AAC3C,MAAI,KAAK,qBAAqB,KAAK,EAAE;AACnC,oCAAiC,MAAM,YAAY,mBAAmB,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