@yahoo/uds 3.142.0 → 3.143.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 (106) hide show
  1. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +1 -1
  2. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +1 -1
  3. package/dist/styles/styler.d.cts +3 -3
  4. package/dist/styles/styler.d.ts +3 -3
  5. package/dist/tailwind/dist/automated-config/dist/mapTextVariantFixtureToValue.js.map +1 -1
  6. package/dist/tailwind/dist/automated-config/dist/properties.js.map +1 -1
  7. package/dist/tailwind/dist/automated-config/dist/utils/assertUnreachable.js.map +1 -1
  8. package/dist/tailwind/dist/automated-config/dist/utils/generateDefaultClassName.js.map +1 -1
  9. package/dist/tailwind/dist/automated-config/dist/utils/generateSchemaKey.js.map +1 -1
  10. package/dist/tailwind/dist/automated-config/dist/utils/index.js.map +1 -1
  11. package/dist/tailwind/dist/automated-config/dist/utils/mapColorFixtureToValue.js.map +1 -1
  12. package/dist/tailwind/dist/cli/dist/lib/logger.js.map +1 -1
  13. package/dist/tailwind/dist/cli/dist/lib/print.js.map +1 -1
  14. package/dist/tailwind/dist/cli/dist/lib/spinner.js.map +1 -1
  15. package/dist/tailwind/dist/commands/css.helpers.js.map +1 -1
  16. package/dist/tailwind/dist/commands/css.js.map +1 -1
  17. package/dist/tailwind/dist/commands/generateComponentData.js.map +1 -1
  18. package/dist/tailwind/dist/commands/generatePurgeCSSData.js.map +1 -1
  19. package/dist/tailwind/dist/commands/purge.js.map +1 -1
  20. package/dist/tailwind/dist/css/generate.helpers.js.map +1 -1
  21. package/dist/tailwind/dist/css/generate.js.map +1 -1
  22. package/dist/tailwind/dist/css/nodeUtils.js.map +1 -1
  23. package/dist/tailwind/dist/css/perf.js.map +1 -1
  24. package/dist/tailwind/dist/css/postcss.helpers.js.map +1 -1
  25. package/dist/tailwind/dist/css/postcss.js.map +1 -1
  26. package/dist/tailwind/dist/css/purgeWorker.js.map +1 -1
  27. package/dist/tailwind/dist/css/runner.helpers.js.map +1 -1
  28. package/dist/tailwind/dist/css/runner.js.map +1 -1
  29. package/dist/tailwind/dist/css/utils.js.map +1 -1
  30. package/dist/tailwind/dist/css/workerPool.js.map +1 -1
  31. package/dist/tailwind/dist/css-tokens/dist/index.js.map +1 -1
  32. package/dist/tailwind/dist/fixtures/dist/index.cjs +0 -10
  33. package/dist/tailwind/dist/fixtures/dist/index.js +0 -10
  34. package/dist/tailwind/dist/fixtures/dist/index.js.map +1 -1
  35. package/dist/tailwind/dist/modes/dist/index.cjs +1 -0
  36. package/dist/tailwind/dist/modes/dist/index.js +1 -0
  37. package/dist/tailwind/dist/modes/dist/index.js.map +1 -1
  38. package/dist/tailwind/dist/plugin.js.map +1 -1
  39. package/dist/tailwind/dist/purger/legacy/purgeCSS.js.map +1 -1
  40. package/dist/tailwind/dist/purger/legacy/purgeFromCode.js.map +1 -1
  41. package/dist/tailwind/dist/purger/optimized/ast/expressions.js.map +1 -1
  42. package/dist/tailwind/dist/purger/optimized/purge.js.map +1 -1
  43. package/dist/tailwind/dist/purger/optimized/purgeFromCode.js.map +1 -1
  44. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js.map +1 -1
  45. package/dist/tailwind/dist/purger/optimized/utils/files.js.map +1 -1
  46. package/dist/tailwind/dist/purger/optimized/utils/safelist.js.map +1 -1
  47. package/dist/tailwind/dist/runtimeConfig/hookMetadata.js.map +1 -1
  48. package/dist/tailwind/dist/tailwind/base/addColorModeVars.js.map +1 -1
  49. package/dist/tailwind/dist/tailwind/base/addColorModeVarsV2.js.map +1 -1
  50. package/dist/tailwind/dist/tailwind/base/addFontFaceDeclarations.js.map +1 -1
  51. package/dist/tailwind/dist/tailwind/base/addFontVars.js.map +1 -1
  52. package/dist/tailwind/dist/tailwind/base/addMotionVars.js.map +1 -1
  53. package/dist/tailwind/dist/tailwind/base/addScaleModeVars.js.map +1 -1
  54. package/dist/tailwind/dist/tailwind/components/getFocusRingStyles.js.map +1 -1
  55. package/dist/tailwind/dist/tailwind/components/getHitTargetStyles.js.map +1 -1
  56. package/dist/tailwind/dist/tailwind/components/getIconStyles.js.map +1 -1
  57. package/dist/tailwind/dist/tailwind/components/getInputStyles.js.map +1 -1
  58. package/dist/tailwind/dist/tailwind/components/getResponsiveTextStyles.js.map +1 -1
  59. package/dist/tailwind/dist/tailwind/plugins/a11y.js.map +1 -1
  60. package/dist/tailwind/dist/tailwind/plugins/blurBgFallback.js.map +1 -1
  61. package/dist/tailwind/dist/tailwind/plugins/borderRadius.js.map +1 -1
  62. package/dist/tailwind/dist/tailwind/plugins/borderWidth.js.map +1 -1
  63. package/dist/tailwind/dist/tailwind/plugins/breakpoints.js.map +1 -1
  64. package/dist/tailwind/dist/tailwind/plugins/colors.js.map +1 -1
  65. package/dist/tailwind/dist/tailwind/plugins/components.js.map +1 -1
  66. package/dist/tailwind/dist/tailwind/plugins/elevation.js.map +1 -1
  67. package/dist/tailwind/dist/tailwind/plugins/getTailwindAsUdsColors.js.map +1 -1
  68. package/dist/tailwind/dist/tailwind/plugins/icons.js.map +1 -1
  69. package/dist/tailwind/dist/tailwind/plugins/input.js.map +1 -1
  70. package/dist/tailwind/dist/tailwind/plugins/motion.js.map +1 -1
  71. package/dist/tailwind/dist/tailwind/plugins/nestedBorderRadius.js.map +1 -1
  72. package/dist/tailwind/dist/tailwind/plugins/scaleMode.js.map +1 -1
  73. package/dist/tailwind/dist/tailwind/plugins/shadows.js.map +1 -1
  74. package/dist/tailwind/dist/tailwind/plugins/sizing.js.map +1 -1
  75. package/dist/tailwind/dist/tailwind/plugins/typography.js.map +1 -1
  76. package/dist/tailwind/dist/tailwind/theme/getFontFamilyTheme.js.map +1 -1
  77. package/dist/tailwind/dist/tailwind/utils/addFontsPlugin.js.map +1 -1
  78. package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.js.map +1 -1
  79. package/dist/tailwind/dist/tailwind/utils/getColorModeStyles.js.map +1 -1
  80. package/dist/tailwind/dist/tailwind/utils/getElevationStyles.js.map +1 -1
  81. package/dist/tailwind/dist/tailwind/utils/getFontFaceDeclarations.js.map +1 -1
  82. package/dist/tailwind/dist/tailwind/utils/getFontStyles.js.map +1 -1
  83. package/dist/tailwind/dist/tailwind/utils/getMotionStyles.js.map +1 -1
  84. package/dist/tailwind/dist/tailwind/utils/getNestedBorderRadiusUtilities.js.map +1 -1
  85. package/dist/tailwind/dist/tailwind/utils/getScaleModeStyles.js.map +1 -1
  86. package/dist/tailwind/dist/tailwind/utils/getShadowPresetValues.js.map +1 -1
  87. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.js.map +1 -1
  88. package/dist/tailwind/dist/utils/assertUnreachable.js.map +1 -1
  89. package/dist/tailwind/dist/utils/entries.js.map +1 -1
  90. package/dist/tailwind/dist/utils/entryPoints.js.map +1 -1
  91. package/dist/tailwind/dist/utils/fromEntries.js.map +1 -1
  92. package/dist/tailwind/dist/utils/generatePurgeCSSData.js.map +1 -1
  93. package/dist/tailwind/dist/utils/mapValues.js.map +1 -1
  94. package/dist/tailwind/dist/utils/opacity.js.map +1 -1
  95. package/dist/tailwind/dist/utils/optimizeCSS.js.map +1 -1
  96. package/dist/tailwind/dist/utils/parseTokens.js.map +1 -1
  97. package/dist/tailwind/dist/utils/postcssPreserveVars.js.map +1 -1
  98. package/dist/tailwind/dist/utils/tsMorph.js.map +1 -1
  99. package/dist/uds/generated/componentData.cjs +1311 -1311
  100. package/dist/uds/generated/componentData.js +1311 -1311
  101. package/dist/uds/generated/tailwindPurge.cjs +3 -0
  102. package/dist/uds/generated/tailwindPurge.js +3 -0
  103. package/dist/uds/package.cjs +2 -2
  104. package/dist/uds/package.js +2 -2
  105. package/generated/componentData.json +1692 -1692
  106. package/package.json +3 -3
@@ -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 { 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 // Tab and TabList read `variant` from Tabs context (default 'primary' in tabsContext), not from\n // component props, so destructuring defaults miss it. Record the context default for purge.\n const tabsContextVariantComponents = new Set(['Tab', 'TabList']);\n if (\n tabsContextVariantComponents.has(componentName) &&\n propToVariantKeys.has('variant') &&\n !defaultProps.has('variant')\n ) {\n defaultProps.set('variant', 'primary');\n }\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\n/** Values already recorded for `variantKey` (base key plus `variantKey:1`, `:2`, …). */\nconst getExistingLiteralValuesForVariantKey = (\n variantKey: string,\n getStylesLiterals: Map<string, string>,\n): string[] => {\n const values: string[] = [];\n const base = getStylesLiterals.get(variantKey);\n if (base !== undefined) {\n values.push(base);\n }\n let index = 1;\n while (true) {\n const key = `${variantKey}:${index}`;\n const next = getStylesLiterals.get(key);\n if (next === undefined) {\n break;\n }\n values.push(next);\n index++;\n }\n return values;\n};\n\n/**\n * Record a string literal for a variant key from a getStyles() call.\n * Multiple calls with the same key (e.g. Tab's active-off vs active-on classes) must\n * all be kept; a plain Map set would drop earlier literals.\n */\nconst appendGetStylesStringLiteral = (\n variantKey: string,\n value: string,\n getStylesLiterals: Map<string, string>,\n): void => {\n if (getExistingLiteralValuesForVariantKey(variantKey, getStylesLiterals).includes(value)) {\n return;\n }\n\n let nextIndex = 0;\n while (true) {\n const key = nextIndex === 0 ? variantKey : `${variantKey}:${nextIndex}`;\n if (!getStylesLiterals.has(key)) {\n getStylesLiterals.set(key, value);\n return;\n }\n nextIndex++;\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 appendGetStylesStringLiteral(variantKey, initializer.getLiteralValue(), getStylesLiterals);\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;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B;GAGF,MAAM,eAAe,QAAQ,4BAA4B,UAAU;AACnE,OAAI,CAAC,aACH;GAGF,MAAM,UAAU,aAAa,uBAAuB,KAAK;AACzD,OAAI,CAAC,QACH;GAGF,IAAI,cAAc,QAAQ,gBAAgB;AAC1C,OAAI,eAAe,KAAK,eAAe,YAAY,CACjD,eAAc,YAAY,eAAe;AAG3C,UAAO,eAAe,KAAK,gBAAgB,YAAY,GACnD,YAAY,iBAAiB,GAC7B,KAAA;KACH,KAAA,EAAU;IACZ,KAAA,EAAU;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 // Tab and TabList read `variant` from Tabs context (default 'primary' in tabsContext), not from\n // component props, so destructuring defaults miss it. Record the context default for purge.\n const tabsContextVariantComponents = new Set(['Tab', 'TabList']);\n if (\n tabsContextVariantComponents.has(componentName) &&\n propToVariantKeys.has('variant') &&\n !defaultProps.has('variant')\n ) {\n defaultProps.set('variant', 'primary');\n }\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\n/** Values already recorded for `variantKey` (base key plus `variantKey:1`, `:2`, …). */\nconst getExistingLiteralValuesForVariantKey = (\n variantKey: string,\n getStylesLiterals: Map<string, string>,\n): string[] => {\n const values: string[] = [];\n const base = getStylesLiterals.get(variantKey);\n if (base !== undefined) {\n values.push(base);\n }\n let index = 1;\n while (true) {\n const key = `${variantKey}:${index}`;\n const next = getStylesLiterals.get(key);\n if (next === undefined) {\n break;\n }\n values.push(next);\n index++;\n }\n return values;\n};\n\n/**\n * Record a string literal for a variant key from a getStyles() call.\n * Multiple calls with the same key (e.g. Tab's active-off vs active-on classes) must\n * all be kept; a plain Map set would drop earlier literals.\n */\nconst appendGetStylesStringLiteral = (\n variantKey: string,\n value: string,\n getStylesLiterals: Map<string, string>,\n): void => {\n if (getExistingLiteralValuesForVariantKey(variantKey, getStylesLiterals).includes(value)) {\n return;\n }\n\n let nextIndex = 0;\n while (true) {\n const key = nextIndex === 0 ? variantKey : `${variantKey}:${nextIndex}`;\n if (!getStylesLiterals.has(key)) {\n getStylesLiterals.set(key, value);\n return;\n }\n nextIndex++;\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 appendGetStylesStringLiteral(variantKey, initializer.getLiteralValue(), getStylesLiterals);\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;CACxF,IAAI,kBAAkB,yBAAyB,eAC7C,OAAO;CAGT,iCAAiB,IAAI,KAAK;CAC1B,kCAAkB,IAAI,KAAK;CAC3B,uBAAuB;CAEvB,MAAM,qBAAqB;CAC3B,MAAM,sBAAsB;CAI5B,CAAA,MAFoB,uBAAuB,cAAc,EAEnD,SAAS,SAAS;EAEtB,IACE,KAAK,SAAS,SAAS,IACvB,KAAK,SAAS,+BAA+B,KAAK,CAAC,KAAK,SAExD;EAGF,MAAM,WAAW,KAAK,SAAS,+BAA+B,KAAK,CAAC;EAGpE,IAAI,SAAS,KAAK,SAAS,EAAE;GAC3B,mBAAmB,IAAI,UAAU,KAAK;GACtC,oBAAoB,IAAI,SAAS;;GAEnC;CAEF,OAAO;;;;;;;;;AAqBT,MAAM,mCACJ,YACA,YACA,mBACA,mBACA,eACS;CACT,WAAW,eAAe,CAAC,SAAS,SAAS;EAC3C,IAAI,KAAK,qBAAqB,KAAK,EAAE;GACnC,iCAAiC,MAAM,YAAY,mBAAmB,kBAAkB;GACxF;;EAGF,IAAI,KAAK,mBAAmB,KAAK,EAC/B,+BACE,MACA,YACA,mBACA,mBACA,WACD;G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7C,MAAM,UAAU,WAAW,YAAY;CACvC,MAAM,UAAU,KAAK,QAAQ,WAAW,aAAa,CAAC;CAEtD,MAAM,mBAAmB,WACtB,uBAAuB,CACvB,QAA4B,gBAAgB,eAAe;EAC1D,IAAI,gBACF,OAAO;EAIT,IAAI,CADgB,WAAW,iBAAiB,CAAC,MAAM,MAAM,EAAE,SAAS,KAAK,KAC7D,EACd;EAGF,MAAM,aAAa,WAAW,yBAAyB;EACvD,IAAI,CAAC,WAAW,WAAW,IAAI,IAAI,eAAe,WAAW,EAC3D;EAGF,MAAM,eAAe,KAAK,QAAQ,SAAS,WAAW;EAGtD,OAAO;GAFa;GAAc,GAAG,aAAa;GAAM,GAAG,aAAa;GAEvD,CAAC,QAA4B,mBAAmB,cAAc;GAC7E,IAAI,mBACF,OAAO;GAGT,IAAI,CAAC,WAAW,UAAU,EACxB;GAGF,MAAM,eAAe,QAAQ,4BAA4B,UAAU;GACnE,IAAI,CAAC,cACH;GAGF,MAAM,UAAU,aAAa,uBAAuB,KAAK;GACzD,IAAI,CAAC,SACH;GAGF,IAAI,cAAc,QAAQ,gBAAgB;GAC1C,IAAI,eAAe,KAAK,eAAe,YAAY,EACjD,cAAc,YAAY,eAAe;GAG3C,OAAO,eAAe,KAAK,gBAAgB,YAAY,GACnD,YAAY,iBAAiB,GAC7B,KAAA;KACH,KAAA,EAAU;IACZ,KAAA,EAAU;CAEf,IAAI,kBACF,OAAO;CAGT,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"files.js","names":[],"sources":["../../../../src/purger/optimized/utils/files.ts"],"sourcesContent":["import fg from 'fast-glob';\nimport type { Project, SourceFile } from 'ts-morph';\n\nimport { DEFAULT_ENTRY, resolveEntryPaths } from '../../../utils/entryPoints';\n\n/**\n * Scan a directory for JSX/TSX files\n */\nexport const scanForFiles = async (entry: string | string[]): Promise<string[]> => {\n const workspaceDir = process.env.PWD ?? process.cwd();\n\n try {\n const fileGroups = await Promise.all(\n resolveEntryPaths(entry, workspaceDir, DEFAULT_ENTRY).map((entryPath) => {\n if (entryPath.kind === 'file') {\n return [entryPath.absolutePath];\n }\n\n return fg('**/*.{jsx,tsx}', {\n cwd: entryPath.absolutePath,\n absolute: true,\n ignore: ['**/node_modules/**'],\n });\n }),\n );\n\n return [...new Set(fileGroups.flat())];\n } catch (error) {\n throw error instanceof Error\n ? error\n : new Error(`Couldn't find the entry directory: ${entry}. Please make sure it exists.`);\n }\n};\n\n/**\n * Get all source files that import from @yahoo/uds\n */\nexport const getUdsImportingFiles = (project: Project): Set<SourceFile> =>\n new Set(\n project\n .getSourceFiles()\n .filter((sourceFile) =>\n sourceFile\n .getImportDeclarations()\n .some((importDecl) => importDecl.getModuleSpecifier().getText().includes('@yahoo/uds')),\n ),\n );\n\n/**\n * Parse files to extract UDS imports\n */\nexport const parseUdsImports = (project: Project, files: string[]): string[] => {\n const imports = files.flatMap((filePath) => {\n const sourceFile = project.getSourceFile(filePath);\n if (!sourceFile) {\n return [];\n }\n\n return sourceFile\n .getImportDeclarations()\n .filter((importDecl) => importDecl.getModuleSpecifier().getText().includes('@yahoo/uds'))\n .flatMap((importDecl) =>\n importDecl.getNamedImports().map((namedImport) => namedImport.getName()),\n );\n });\n\n return Array.from(new Set(imports));\n};\n\n/**\n * Get components and their dependencies from the import list\n */\nexport const getComponentsWithDependencies = (\n imports: string[],\n componentToVariants: Record<string, unknown>,\n componentsDependencies: Record<string, string[]>,\n): string[] => {\n const components = imports\n .filter((importName) => Boolean(componentToVariants[importName]))\n .flatMap((importName) => [importName, ...(componentsDependencies[importName] ?? [])]);\n\n return Array.from(new Set(components));\n};\n"],"mappings":";;;;;;;AAQA,MAAa,eAAe,OAAO,UAAgD;CACjF,MAAM,eAAe,QAAQ,IAAI,OAAO,QAAQ,KAAK;AAErD,KAAI;EACF,MAAM,aAAa,MAAM,QAAQ,IAC/B,kBAAkB,OAAO,cAAc,cAAc,CAAC,KAAK,cAAc;AACvE,OAAI,UAAU,SAAS,OACrB,QAAO,CAAC,UAAU,aAAa;AAGjC,UAAO,GAAG,kBAAkB;IAC1B,KAAK,UAAU;IACf,UAAU;IACV,QAAQ,CAAC,qBAAqB;IAC/B,CAAC;IACF,CACH;AAED,SAAO,CAAC,GAAG,IAAI,IAAI,WAAW,MAAM,CAAC,CAAC;UAC/B,OAAO;AACd,QAAM,iBAAiB,QACnB,wBACA,IAAI,MAAM,sCAAsC,MAAM,+BAA+B"}
1
+ {"version":3,"file":"files.js","names":[],"sources":["../../../../src/purger/optimized/utils/files.ts"],"sourcesContent":["import fg from 'fast-glob';\nimport type { Project, SourceFile } from 'ts-morph';\n\nimport { DEFAULT_ENTRY, resolveEntryPaths } from '../../../utils/entryPoints';\n\n/**\n * Scan a directory for JSX/TSX files\n */\nexport const scanForFiles = async (entry: string | string[]): Promise<string[]> => {\n const workspaceDir = process.env.PWD ?? process.cwd();\n\n try {\n const fileGroups = await Promise.all(\n resolveEntryPaths(entry, workspaceDir, DEFAULT_ENTRY).map((entryPath) => {\n if (entryPath.kind === 'file') {\n return [entryPath.absolutePath];\n }\n\n return fg('**/*.{jsx,tsx}', {\n cwd: entryPath.absolutePath,\n absolute: true,\n ignore: ['**/node_modules/**'],\n });\n }),\n );\n\n return [...new Set(fileGroups.flat())];\n } catch (error) {\n throw error instanceof Error\n ? error\n : new Error(`Couldn't find the entry directory: ${entry}. Please make sure it exists.`);\n }\n};\n\n/**\n * Get all source files that import from @yahoo/uds\n */\nexport const getUdsImportingFiles = (project: Project): Set<SourceFile> =>\n new Set(\n project\n .getSourceFiles()\n .filter((sourceFile) =>\n sourceFile\n .getImportDeclarations()\n .some((importDecl) => importDecl.getModuleSpecifier().getText().includes('@yahoo/uds')),\n ),\n );\n\n/**\n * Parse files to extract UDS imports\n */\nexport const parseUdsImports = (project: Project, files: string[]): string[] => {\n const imports = files.flatMap((filePath) => {\n const sourceFile = project.getSourceFile(filePath);\n if (!sourceFile) {\n return [];\n }\n\n return sourceFile\n .getImportDeclarations()\n .filter((importDecl) => importDecl.getModuleSpecifier().getText().includes('@yahoo/uds'))\n .flatMap((importDecl) =>\n importDecl.getNamedImports().map((namedImport) => namedImport.getName()),\n );\n });\n\n return Array.from(new Set(imports));\n};\n\n/**\n * Get components and their dependencies from the import list\n */\nexport const getComponentsWithDependencies = (\n imports: string[],\n componentToVariants: Record<string, unknown>,\n componentsDependencies: Record<string, string[]>,\n): string[] => {\n const components = imports\n .filter((importName) => Boolean(componentToVariants[importName]))\n .flatMap((importName) => [importName, ...(componentsDependencies[importName] ?? [])]);\n\n return Array.from(new Set(components));\n};\n"],"mappings":";;;;;;;AAQA,MAAa,eAAe,OAAO,UAAgD;CACjF,MAAM,eAAe,QAAQ,IAAI,OAAO,QAAQ,KAAK;CAErD,IAAI;EACF,MAAM,aAAa,MAAM,QAAQ,IAC/B,kBAAkB,OAAO,cAAc,cAAc,CAAC,KAAK,cAAc;GACvE,IAAI,UAAU,SAAS,QACrB,OAAO,CAAC,UAAU,aAAa;GAGjC,OAAO,GAAG,kBAAkB;IAC1B,KAAK,UAAU;IACf,UAAU;IACV,QAAQ,CAAC,qBAAqB;IAC/B,CAAC;IACF,CACH;EAED,OAAO,CAAC,GAAG,IAAI,IAAI,WAAW,MAAM,CAAC,CAAC;UAC/B,OAAO;EACd,MAAM,iBAAiB,QACnB,wBACA,IAAI,MAAM,sCAAsC,MAAM,+BAA+B"}
@@ -1 +1 @@
1
- {"version":3,"file":"safelist.js","names":[],"sources":["../../../../src/purger/optimized/utils/safelist.ts"],"sourcesContent":["import { mkdirSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\nimport { DARK_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME } from '@yahoo/uds-css-tokens';\nimport type { ColorModeConfig } from '@yahoo/uds-types';\n\nconst colorModeToClass: Record<keyof ColorModeConfig, string> = {\n dark: DARK_COLOR_MODE_CLASSNAME,\n light: LIGHT_COLOR_MODE_CLASSNAME,\n};\n\nconst internalSafelistClasses = ['uds-light-mode-icon', 'uds-dark-mode-icon'] as const;\n\n/**\n * Deduplicate and clean a safelist\n */\nconst deduplicateSafelist = (safelist: string[]): string[] => {\n const deduped = safelist\n .map((cls) => cls.replaceAll('\\\\', '').trim())\n .filter((cleaned) => cleaned && isValidClassName(cleaned));\n\n return Array.from(new Set(deduped));\n};\n\n/**\n * Check if a class name is valid (not malformed from CSS escape sequences)\n */\nconst isValidClassName = (cls: string): boolean => {\n // Filter out malformed classes from CSS escape sequences\n if (cls.match(/^[0-9]/)) {\n return false;\n }\n if (cls.match(/[0-9][a-z]$/)) {\n return false;\n }\n if (cls.includes('2c')) {\n return false;\n }\n return true;\n};\n\n/**\n * Filter out autoVariant classes (we add them dynamically based on usage)\n */\nexport const filterAutoVariantClasses = (classes: string[]): string[] =>\n classes.filter((cls) => !cls.match(/^uds-[a-z]+-(?:variant|size)-/));\n\n/**\n * Get classes for enabled color modes.\n * Note: Light mode is not included by default since :root already defines light mode styles.\n * Only dark mode class is needed to enable dark mode switching.\n */\nexport const getThemeAndScaleClasses = (colorModes?: ('dark' | 'light')[]): string[] => {\n if (!colorModes || colorModes.length === 0) {\n // Default: only dark mode (light mode is already in :root)\n return [colorModeToClass.dark];\n }\n\n return colorModes\n .map((mode) => colorModeToClass[mode])\n .filter((className): className is string => Boolean(className));\n};\n\n/**\n * Get internal framework classes that are required even when plugin safelists\n * are intentionally ignored by the optimized CSS generation path.\n */\nexport const getInternalSafelistClasses = (): string[] => [...internalSafelistClasses];\n\n/**\n * Get autoVariant classes for specific prop values used by a component\n */\nexport const getAutoVariantClasses = (\n componentName: string,\n usedProps: Map<string, Set<string>>,\n autoVariants: Record<string, Record<string, string>>,\n): string[] => {\n const componentLower = componentName.toLowerCase();\n\n return [...usedProps.entries()].flatMap(([propName, values]) => {\n const propNameCapitalized = propName.charAt(0).toUpperCase() + propName.slice(1);\n\n // Look for matching autoVariant keys\n return Object.entries(autoVariants)\n .filter(\n ([autoVariantKey]) =>\n autoVariantKey.startsWith(componentLower + propNameCapitalized) ||\n autoVariantKey.startsWith(componentLower + propName),\n )\n .flatMap(([, variantGroup]) =>\n [...values]\n .map((value) => variantGroup[value as keyof typeof variantGroup])\n .filter((className): className is string => Boolean(className)),\n );\n });\n};\n\n/**\n * Save safelist to a file\n */\nexport const saveSafelistToFile = async (safelist: string[], outputPath: string): Promise<void> => {\n const content = `\n//! This file is generated by the optimized purger from @yahoo/uds\n//! Do not edit directly\n//! If there is issue with this file please report to #ask-uds\nexport const safelist = ${JSON.stringify(safelist)};\n`;\n\n mkdirSync(path.dirname(outputPath), { recursive: true });\n writeFileSync(outputPath, content);\n};\n\nexport { deduplicateSafelist };\n"],"mappings":";;;;;AAMA,MAAM,mBAA0D;CAC9D,MAAM;CACN,OAAO;CACR;AAED,MAAM,0BAA0B,CAAC,uBAAuB,qBAAqB;;;;AAK7E,MAAM,uBAAuB,aAAiC;CAC5D,MAAM,UAAU,SACb,KAAK,QAAQ,IAAI,WAAW,MAAM,GAAG,CAAC,MAAM,CAAC,CAC7C,QAAQ,YAAY,WAAW,iBAAiB,QAAQ,CAAC;AAE5D,QAAO,MAAM,KAAK,IAAI,IAAI,QAAQ,CAAC;;;;;AAMrC,MAAM,oBAAoB,QAAyB;AAEjD,KAAI,IAAI,MAAM,SAAS,CACrB,QAAO;AAET,KAAI,IAAI,MAAM,cAAc,CAC1B,QAAO;AAET,KAAI,IAAI,SAAS,KAAK,CACpB,QAAO;AAET,QAAO;;;;;;;AAcT,MAAa,2BAA2B,eAAgD;AACtF,KAAI,CAAC,cAAc,WAAW,WAAW,EAEvC,QAAO,CAAC,iBAAiB,KAAK;AAGhC,QAAO,WACJ,KAAK,SAAS,iBAAiB,MAAM,CACrC,QAAQ,cAAmC,QAAQ,UAAU,CAAC;;;;;;AAOnE,MAAa,mCAA6C,CAAC,GAAG,wBAAwB;;;;AAiCtF,MAAa,qBAAqB,OAAO,UAAoB,eAAsC;CACjG,MAAM,UAAU;;;;0BAIQ,KAAK,UAAU,SAAS,CAAC;;AAGjD,WAAU,KAAK,QAAQ,WAAW,EAAE,EAAE,WAAW,MAAM,CAAC;AACxD,eAAc,YAAY,QAAQ"}
1
+ {"version":3,"file":"safelist.js","names":[],"sources":["../../../../src/purger/optimized/utils/safelist.ts"],"sourcesContent":["import { mkdirSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\nimport { DARK_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME } from '@yahoo/uds-css-tokens';\nimport type { ColorModeConfig } from '@yahoo/uds-types';\n\nconst colorModeToClass: Record<keyof ColorModeConfig, string> = {\n dark: DARK_COLOR_MODE_CLASSNAME,\n light: LIGHT_COLOR_MODE_CLASSNAME,\n};\n\nconst internalSafelistClasses = ['uds-light-mode-icon', 'uds-dark-mode-icon'] as const;\n\n/**\n * Deduplicate and clean a safelist\n */\nconst deduplicateSafelist = (safelist: string[]): string[] => {\n const deduped = safelist\n .map((cls) => cls.replaceAll('\\\\', '').trim())\n .filter((cleaned) => cleaned && isValidClassName(cleaned));\n\n return Array.from(new Set(deduped));\n};\n\n/**\n * Check if a class name is valid (not malformed from CSS escape sequences)\n */\nconst isValidClassName = (cls: string): boolean => {\n // Filter out malformed classes from CSS escape sequences\n if (cls.match(/^[0-9]/)) {\n return false;\n }\n if (cls.match(/[0-9][a-z]$/)) {\n return false;\n }\n if (cls.includes('2c')) {\n return false;\n }\n return true;\n};\n\n/**\n * Filter out autoVariant classes (we add them dynamically based on usage)\n */\nexport const filterAutoVariantClasses = (classes: string[]): string[] =>\n classes.filter((cls) => !cls.match(/^uds-[a-z]+-(?:variant|size)-/));\n\n/**\n * Get classes for enabled color modes.\n * Note: Light mode is not included by default since :root already defines light mode styles.\n * Only dark mode class is needed to enable dark mode switching.\n */\nexport const getThemeAndScaleClasses = (colorModes?: ('dark' | 'light')[]): string[] => {\n if (!colorModes || colorModes.length === 0) {\n // Default: only dark mode (light mode is already in :root)\n return [colorModeToClass.dark];\n }\n\n return colorModes\n .map((mode) => colorModeToClass[mode])\n .filter((className): className is string => Boolean(className));\n};\n\n/**\n * Get internal framework classes that are required even when plugin safelists\n * are intentionally ignored by the optimized CSS generation path.\n */\nexport const getInternalSafelistClasses = (): string[] => [...internalSafelistClasses];\n\n/**\n * Get autoVariant classes for specific prop values used by a component\n */\nexport const getAutoVariantClasses = (\n componentName: string,\n usedProps: Map<string, Set<string>>,\n autoVariants: Record<string, Record<string, string>>,\n): string[] => {\n const componentLower = componentName.toLowerCase();\n\n return [...usedProps.entries()].flatMap(([propName, values]) => {\n const propNameCapitalized = propName.charAt(0).toUpperCase() + propName.slice(1);\n\n // Look for matching autoVariant keys\n return Object.entries(autoVariants)\n .filter(\n ([autoVariantKey]) =>\n autoVariantKey.startsWith(componentLower + propNameCapitalized) ||\n autoVariantKey.startsWith(componentLower + propName),\n )\n .flatMap(([, variantGroup]) =>\n [...values]\n .map((value) => variantGroup[value as keyof typeof variantGroup])\n .filter((className): className is string => Boolean(className)),\n );\n });\n};\n\n/**\n * Save safelist to a file\n */\nexport const saveSafelistToFile = async (safelist: string[], outputPath: string): Promise<void> => {\n const content = `\n//! This file is generated by the optimized purger from @yahoo/uds\n//! Do not edit directly\n//! If there is issue with this file please report to #ask-uds\nexport const safelist = ${JSON.stringify(safelist)};\n`;\n\n mkdirSync(path.dirname(outputPath), { recursive: true });\n writeFileSync(outputPath, content);\n};\n\nexport { deduplicateSafelist };\n"],"mappings":";;;;;AAMA,MAAM,mBAA0D;CAC9D,MAAM;CACN,OAAO;CACR;AAED,MAAM,0BAA0B,CAAC,uBAAuB,qBAAqB;;;;AAK7E,MAAM,uBAAuB,aAAiC;CAC5D,MAAM,UAAU,SACb,KAAK,QAAQ,IAAI,WAAW,MAAM,GAAG,CAAC,MAAM,CAAC,CAC7C,QAAQ,YAAY,WAAW,iBAAiB,QAAQ,CAAC;CAE5D,OAAO,MAAM,KAAK,IAAI,IAAI,QAAQ,CAAC;;;;;AAMrC,MAAM,oBAAoB,QAAyB;CAEjD,IAAI,IAAI,MAAM,SAAS,EACrB,OAAO;CAET,IAAI,IAAI,MAAM,cAAc,EAC1B,OAAO;CAET,IAAI,IAAI,SAAS,KAAK,EACpB,OAAO;CAET,OAAO;;;;;;;AAcT,MAAa,2BAA2B,eAAgD;CACtF,IAAI,CAAC,cAAc,WAAW,WAAW,GAEvC,OAAO,CAAC,iBAAiB,KAAK;CAGhC,OAAO,WACJ,KAAK,SAAS,iBAAiB,MAAM,CACrC,QAAQ,cAAmC,QAAQ,UAAU,CAAC;;;;;;AAOnE,MAAa,mCAA6C,CAAC,GAAG,wBAAwB;;;;AAiCtF,MAAa,qBAAqB,OAAO,UAAoB,eAAsC;CACjG,MAAM,UAAU;;;;0BAIQ,KAAK,UAAU,SAAS,CAAC;;CAGjD,UAAU,KAAK,QAAQ,WAAW,EAAE,EAAE,WAAW,MAAM,CAAC;CACxD,cAAc,YAAY,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"hookMetadata.js","names":[],"sources":["../../src/runtimeConfig/hookMetadata.ts"],"sourcesContent":["import type { UniversalTokensConfig } from '@yahoo/uds-config';\n\ninterface RuntimeHookFieldTokenSource {\n variableTemplate: string;\n valuePath: readonly string[];\n transformConfigPath?: readonly string[];\n}\n\ninterface RuntimeHookFieldMetadata {\n bindingSelector: string;\n selectorTemplates: string[];\n staticValue?: string | number | boolean;\n tokenSource?: RuntimeHookFieldTokenSource;\n}\n\ninterface RuntimeHookMetadata {\n defaultProps: Record<string, string>;\n defaultPropSources?: Record<string, readonly string[]>;\n defaultPropValues?: Record<string, string | number | boolean>;\n selectorParamValues?: Record<string, readonly string[]>;\n tokenConfigPath?: readonly string[];\n fields: Record<string, RuntimeHookFieldMetadata>;\n}\n\ntype RuntimeSelectorParams = Record<string, string>;\n\nconst defineRuntimeHookMetadata = <const T extends Record<string, RuntimeHookMetadata>>(\n metadata: T,\n): T => metadata;\n\nconst runtimeHookMetadata = defineRuntimeHookMetadata({\n useBottomSheetConfig: {\n defaultProps: {},\n selectorParamValues: {\n variant: ['default'],\n },\n tokenConfigPath: ['bottomSheet', 'variables'],\n fields: {\n backgroundColor: {\n bindingSelector: 'bottomSheet.backgroundColor',\n selectorTemplates: ['bottomSheet.backgroundColor.${variant}'],\n tokenSource: {\n variableTemplate: 'variant/${variant}/root',\n valuePath: ['backgroundColor', 'rest', 'value'],\n },\n },\n },\n },\n useToastConfig: {\n defaultProps: {\n size: 'toast.defaultSize',\n variant: 'toast.defaultVariant',\n },\n defaultPropSources: {\n size: ['toast', 'defaults', 'size'],\n variant: ['toast', 'defaults', 'variant'],\n },\n selectorParamValues: {\n size: ['default'],\n variant: ['success', 'error', 'info', 'warning', 'loading'],\n },\n tokenConfigPath: ['toast', 'variables'],\n fields: {\n autoClose: {\n bindingSelector: 'toast.autoClose',\n selectorTemplates: ['toast.autoClose'],\n staticValue: 6_000,\n },\n position: {\n bindingSelector: 'toast.position',\n selectorTemplates: ['toast.position'],\n staticValue: 'bottom-center',\n },\n size: {\n bindingSelector: 'toast.defaultSize',\n selectorTemplates: ['toast.defaultSize'],\n },\n variant: {\n bindingSelector: 'toast.defaultVariant',\n selectorTemplates: ['toast.defaultVariant'],\n },\n textVariant: {\n bindingSelector: 'toast.textVariant.${size}',\n selectorTemplates: ['toast.textVariant.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/label',\n valuePath: ['textVariant', 'rest', 'value'],\n },\n },\n textColor: {\n bindingSelector: 'toast.textColor.${variant}',\n selectorTemplates: ['toast.textColor.${variant}'],\n tokenSource: {\n variableTemplate: 'variant/${variant}/root',\n valuePath: ['color', 'rest', 'value'],\n },\n },\n iconSize: {\n bindingSelector: 'toast.iconSize.${size}',\n selectorTemplates: ['toast.iconSize.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/icon',\n valuePath: ['size', 'rest', 'value'],\n },\n },\n buttonSize: {\n bindingSelector: 'toast.buttonSize.${size}',\n selectorTemplates: ['toast.buttonSize.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/actionButton',\n valuePath: ['buttonSize', 'rest', 'value'],\n },\n },\n buttonVariant: {\n bindingSelector: 'toast.buttonVariant.${variant}',\n selectorTemplates: ['toast.buttonVariant.${variant}'],\n tokenSource: {\n variableTemplate: 'variant/${variant}/actionButton',\n valuePath: ['buttonVariant', 'rest', 'value'],\n },\n },\n iconVariant: {\n bindingSelector: 'toast.iconVariant.${variant}',\n selectorTemplates: ['toast.iconVariant.${variant}'],\n tokenSource: {\n variableTemplate: 'variant/${variant}/icon',\n valuePath: ['iconVariant', 'rest', 'value'],\n },\n },\n backgroundColor: {\n bindingSelector: 'toast.backgroundColor',\n selectorTemplates: ['toast.backgroundColor.${variant}'],\n tokenSource: {\n variableTemplate: 'variant/${variant}/root',\n valuePath: ['backgroundColor', 'rest', 'value'],\n },\n },\n },\n },\n useTooltipConfig: {\n defaultProps: {},\n selectorParamValues: {\n size: ['default'],\n },\n tokenConfigPath: ['tooltip', 'variables'],\n fields: {\n animationDuration: {\n bindingSelector: 'tooltip.animationDuration',\n selectorTemplates: ['tooltip.animationDuration'],\n staticValue: 200,\n },\n placement: {\n bindingSelector: 'tooltip.placement',\n selectorTemplates: ['tooltip.placement'],\n staticValue: 'top',\n },\n borderRadius: {\n bindingSelector: 'tooltip.borderRadius',\n selectorTemplates: ['tooltip.borderRadius.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/svg',\n valuePath: ['borderRadius', 'rest', 'value'],\n transformConfigPath: ['scaleMode', 'medium', 'borderRadius'],\n },\n },\n },\n },\n usePopoverConfig: {\n defaultProps: {\n size: 'popover.defaultSize',\n variant: 'popover.defaultVariant',\n },\n defaultPropValues: {\n size: 'default',\n variant: 'default',\n },\n selectorParamValues: {\n size: ['default'],\n },\n tokenConfigPath: ['popover', 'variables'],\n fields: {\n animationDuration: {\n bindingSelector: 'popover.animationDuration',\n selectorTemplates: ['popover.animationDuration'],\n staticValue: 200,\n },\n placement: {\n bindingSelector: 'popover.placement',\n selectorTemplates: ['popover.placement'],\n staticValue: 'top',\n },\n size: {\n bindingSelector: 'popover.defaultSize',\n selectorTemplates: ['popover.defaultSize'],\n },\n variant: {\n bindingSelector: 'popover.defaultVariant',\n selectorTemplates: ['popover.defaultVariant'],\n },\n borderRadius: {\n bindingSelector: 'popover.borderRadius.${size}',\n selectorTemplates: ['popover.borderRadius.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/svgBase',\n valuePath: ['borderRadius', 'rest', 'value'],\n transformConfigPath: ['scaleMode', 'medium', 'borderRadius'],\n },\n },\n gap: {\n bindingSelector: 'popover.gap.${size}',\n selectorTemplates: ['popover.gap.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/contentWrapper',\n valuePath: ['gap', 'rest', 'value'],\n },\n },\n spacingHorizontal: {\n bindingSelector: 'popover.spacingHorizontal.${size}',\n selectorTemplates: ['popover.spacingHorizontal.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/contentWrapper',\n valuePath: ['spacingHorizontal', 'rest', 'value'],\n },\n },\n spacingVertical: {\n bindingSelector: 'popover.spacingVertical.${size}',\n selectorTemplates: ['popover.spacingVertical.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/contentWrapper',\n valuePath: ['spacingVertical', 'rest', 'value'],\n },\n },\n dismissButtonSpacing: {\n bindingSelector: 'popover.dismissButtonSpacing.${size}',\n selectorTemplates: ['popover.dismissButtonSpacing.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/closeIconContainer',\n valuePath: ['spacing', 'rest', 'value'],\n },\n },\n dismissIconSize: {\n bindingSelector: 'popover.dismissIconSize.${size}',\n selectorTemplates: ['popover.dismissIconSize.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/closeIcon',\n valuePath: ['size', 'rest', 'value'],\n transformConfigPath: ['scaleMode', 'medium', 'iconSizes'],\n },\n },\n },\n },\n useModalConfig: {\n defaultProps: {\n size: 'modal.defaultSize',\n variant: 'modal.defaultVariant',\n },\n defaultPropValues: {\n size: 'default',\n variant: 'default',\n },\n selectorParamValues: {\n size: ['default'],\n },\n tokenConfigPath: ['modal', 'variables'],\n fields: {\n size: {\n bindingSelector: 'modal.defaultSize',\n selectorTemplates: ['modal.defaultSize'],\n },\n variant: {\n bindingSelector: 'modal.defaultVariant',\n selectorTemplates: ['modal.defaultVariant'],\n },\n gutter: {\n bindingSelector: 'modal.gutter.${size}',\n selectorTemplates: ['modal.gutter.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/scrim',\n valuePath: ['spacing', 'rest', 'value'],\n },\n },\n },\n },\n});\n\ntype RuntimeHookName = keyof typeof runtimeHookMetadata;\ntype RuntimeHookSelectorParamMap<T extends RuntimeHookName> =\n (typeof runtimeHookMetadata)[T] extends { selectorParamValues: infer P } ? NonNullable<P> : never;\ntype RuntimeHookSelectorParamName<T extends RuntimeHookName> = keyof RuntimeHookSelectorParamMap<T>;\ntype RuntimeHookSelectorParamValue<\n T extends RuntimeHookName,\n P extends RuntimeHookSelectorParamName<T>,\n> = RuntimeHookSelectorParamMap<T>[P] extends readonly (infer V)[] ? V : never;\n\nconst getNestedValue = (value: unknown, path: readonly string[]): unknown => {\n return path.reduce<unknown>((currentValue, segment) => {\n if (typeof currentValue !== 'object' || currentValue === null) {\n return undefined;\n }\n\n return (currentValue as Record<string, unknown>)[segment];\n }, value);\n};\n\nconst isRuntimeConfigValue = (value: unknown): value is string | number | boolean => {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n};\n\nconst getRuntimeHookConfig = (hookName: string): RuntimeHookMetadata | null => {\n return runtimeHookMetadata[hookName as RuntimeHookName] ?? null;\n};\n\nconst getRuntimeConfigHookNames = (): RuntimeHookName[] => {\n return Object.keys(runtimeHookMetadata) as RuntimeHookName[];\n};\n\nconst getRuntimeConfigSelectorTemplates = (): string[] => {\n return [\n ...new Set(\n Object.values(runtimeHookMetadata).flatMap((hookMetadata) => [\n ...Object.values(hookMetadata.defaultProps),\n ...Object.values(hookMetadata.fields).flatMap(({ selectorTemplates }) => selectorTemplates),\n ]),\n ),\n ];\n};\n\nconst getRuntimeSelectorParamValues = <\n T extends RuntimeHookName,\n P extends RuntimeHookSelectorParamName<T>,\n>(\n hookName: T,\n paramName: P,\n): RuntimeHookSelectorParamValue<T, P>[] => {\n const selectorParamValues = runtimeHookMetadata[hookName].selectorParamValues as\n | Record<string, readonly string[]>\n | undefined;\n const values = selectorParamValues?.[paramName as string] ?? [];\n return [...values] as RuntimeHookSelectorParamValue<T, P>[];\n};\n\nconst expandRuntimeSelectorTemplate = (\n template: string,\n params: RuntimeSelectorParams = {},\n): string => {\n return template.replace(/\\$\\{(\\w+)\\}/g, (match, paramName: string) => params[paramName] ?? match);\n};\n\nconst expandRuntimeSelectors = (hookName: string, template: string): string[] => {\n const placeholders = [...template.matchAll(/\\$\\{(\\w+)\\}/g)].map((match) => match[1]);\n\n if (placeholders.length === 0) {\n return [template];\n }\n\n return placeholders\n .reduce<RuntimeSelectorParams[]>(\n (combinations, placeholder) => {\n const values = getRuntimeSelectorParamValues(\n hookName as RuntimeHookName,\n placeholder as RuntimeHookSelectorParamName<RuntimeHookName>,\n ) as string[];\n if (values.length === 0) {\n return combinations;\n }\n\n return combinations.flatMap((combination) =>\n values.map((value) => ({ ...combination, [placeholder]: value })),\n );\n },\n [{} as RuntimeSelectorParams],\n )\n .map((params) => expandRuntimeSelectorTemplate(template, params));\n};\n\nconst getRuntimeConfigSelectors = (): string[] => {\n return [\n ...new Set(\n getRuntimeConfigHookNames().flatMap((hookName) => {\n const hookConfig = getRuntimeHookConfig(hookName);\n if (!hookConfig) {\n return [];\n }\n\n return [\n ...Object.values(hookConfig.defaultProps),\n ...Object.values(hookConfig.fields).flatMap(({ selectorTemplates }) =>\n selectorTemplates.flatMap((template) => expandRuntimeSelectors(hookName, template)),\n ),\n ];\n }),\n ),\n ];\n};\n\nconst getRuntimeDefaultPropSelector = (\n hookName: string,\n propName: string,\n params: RuntimeSelectorParams = {},\n): string | null => {\n const selector = getRuntimeHookConfig(hookName)?.defaultProps[propName];\n return selector ? expandRuntimeSelectorTemplate(selector, params) : null;\n};\n\nconst getRuntimeDefaultPropValue = (\n config: UniversalTokensConfig,\n hookName: string,\n propName: string,\n): string | number | boolean | undefined => {\n const hookConfig = getRuntimeHookConfig(hookName);\n const configuredValue = getNestedValue(config, hookConfig?.defaultPropSources?.[propName] ?? []);\n\n if (isRuntimeConfigValue(configuredValue)) {\n return configuredValue;\n }\n\n const staticValue = hookConfig?.defaultPropValues?.[propName];\n return staticValue === undefined ? undefined : staticValue;\n};\n\nconst getRuntimeFieldSelector = (\n hookName: string,\n fieldName: string,\n params: RuntimeSelectorParams = {},\n): string | null => {\n const selectorTemplate = getRuntimeHookConfig(hookName)?.fields[fieldName]?.selectorTemplates[0];\n return selectorTemplate ? expandRuntimeSelectorTemplate(selectorTemplate, params) : null;\n};\n\nconst getRuntimeFieldStaticValue = (\n hookName: string,\n fieldName: string,\n): string | number | boolean | null => {\n return getRuntimeHookConfig(hookName)?.fields[fieldName]?.staticValue ?? null;\n};\n\nconst getRuntimeFieldTokenValue = (\n config: UniversalTokensConfig,\n hookName: string,\n fieldName: string,\n params: RuntimeSelectorParams = {},\n): string | number | boolean | undefined => {\n const hookConfig = getRuntimeHookConfig(hookName);\n const tokenConfigPath = hookConfig?.tokenConfigPath;\n const tokenSource = hookConfig?.fields[fieldName]?.tokenSource;\n\n if (!tokenConfigPath || !tokenSource) {\n return undefined;\n }\n\n const variableTemplate = expandRuntimeSelectorTemplate(tokenSource.variableTemplate, params);\n const tokenValue = getNestedValue(config, [...tokenConfigPath, variableTemplate]);\n const rawValue = getNestedValue(tokenValue, tokenSource.valuePath);\n\n if (rawValue === undefined) {\n return undefined;\n }\n\n if (!tokenSource.transformConfigPath) {\n return isRuntimeConfigValue(rawValue) ? rawValue : undefined;\n }\n\n const transformedValue = getNestedValue(\n tokenSource.transformConfigPath.reduce<unknown>((currentValue, segment) => {\n if (typeof currentValue !== 'object' || currentValue === null) {\n return undefined;\n }\n\n return (currentValue as Record<string, unknown>)[segment];\n }, config),\n [String(rawValue)],\n );\n\n return isRuntimeConfigValue(transformedValue) ? transformedValue : undefined;\n};\n\nexport {\n expandRuntimeSelectorTemplate,\n getRuntimeConfigHookNames,\n getRuntimeConfigSelectors,\n getRuntimeConfigSelectorTemplates,\n getRuntimeDefaultPropSelector,\n getRuntimeDefaultPropValue,\n getRuntimeFieldSelector,\n getRuntimeFieldStaticValue,\n getRuntimeFieldTokenValue,\n getRuntimeHookConfig,\n getRuntimeSelectorParamValues,\n};\nexport type {\n RuntimeHookFieldMetadata,\n RuntimeHookFieldTokenSource,\n RuntimeHookMetadata,\n RuntimeSelectorParams,\n};\n"],"mappings":";;AA0BA,MAAM,6BACJ,aACM;AAER,MAAM,sBAAsB,0BAA0B;CACpD,sBAAsB;EACpB,cAAc,EAAE;EAChB,qBAAqB,EACnB,SAAS,CAAC,UAAU,EACrB;EACD,iBAAiB,CAAC,eAAe,YAAY;EAC7C,QAAQ,EACN,iBAAiB;GACf,iBAAiB;GACjB,mBAAmB,CAAC,yCAAyC;GAC7D,aAAa;IACX,kBAAkB;IAClB,WAAW;KAAC;KAAmB;KAAQ;KAAQ;IAChD;GACF,EACF;EACF;CACD,gBAAgB;EACd,cAAc;GACZ,MAAM;GACN,SAAS;GACV;EACD,oBAAoB;GAClB,MAAM;IAAC;IAAS;IAAY;IAAO;GACnC,SAAS;IAAC;IAAS;IAAY;IAAU;GAC1C;EACD,qBAAqB;GACnB,MAAM,CAAC,UAAU;GACjB,SAAS;IAAC;IAAW;IAAS;IAAQ;IAAW;IAAU;GAC5D;EACD,iBAAiB,CAAC,SAAS,YAAY;EACvC,QAAQ;GACN,WAAW;IACT,iBAAiB;IACjB,mBAAmB,CAAC,kBAAkB;IACtC,aAAa;IACd;GACD,UAAU;IACR,iBAAiB;IACjB,mBAAmB,CAAC,iBAAiB;IACrC,aAAa;IACd;GACD,MAAM;IACJ,iBAAiB;IACjB,mBAAmB,CAAC,oBAAoB;IACzC;GACD,SAAS;IACP,iBAAiB;IACjB,mBAAmB,CAAC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AAqB,iBAAiB,GAAG,mBAAmB,KAAA"}
1
+ {"version":3,"file":"hookMetadata.js","names":[],"sources":["../../src/runtimeConfig/hookMetadata.ts"],"sourcesContent":["import type { UniversalTokensConfig } from '@yahoo/uds-config';\n\ninterface RuntimeHookFieldTokenSource {\n variableTemplate: string;\n valuePath: readonly string[];\n transformConfigPath?: readonly string[];\n}\n\ninterface RuntimeHookFieldMetadata {\n bindingSelector: string;\n selectorTemplates: string[];\n staticValue?: string | number | boolean;\n tokenSource?: RuntimeHookFieldTokenSource;\n}\n\ninterface RuntimeHookMetadata {\n defaultProps: Record<string, string>;\n defaultPropSources?: Record<string, readonly string[]>;\n defaultPropValues?: Record<string, string | number | boolean>;\n selectorParamValues?: Record<string, readonly string[]>;\n tokenConfigPath?: readonly string[];\n fields: Record<string, RuntimeHookFieldMetadata>;\n}\n\ntype RuntimeSelectorParams = Record<string, string>;\n\nconst defineRuntimeHookMetadata = <const T extends Record<string, RuntimeHookMetadata>>(\n metadata: T,\n): T => metadata;\n\nconst runtimeHookMetadata = defineRuntimeHookMetadata({\n useBottomSheetConfig: {\n defaultProps: {},\n selectorParamValues: {\n variant: ['default'],\n },\n tokenConfigPath: ['bottomSheet', 'variables'],\n fields: {\n backgroundColor: {\n bindingSelector: 'bottomSheet.backgroundColor',\n selectorTemplates: ['bottomSheet.backgroundColor.${variant}'],\n tokenSource: {\n variableTemplate: 'variant/${variant}/root',\n valuePath: ['backgroundColor', 'rest', 'value'],\n },\n },\n },\n },\n useToastConfig: {\n defaultProps: {\n size: 'toast.defaultSize',\n variant: 'toast.defaultVariant',\n },\n defaultPropSources: {\n size: ['toast', 'defaults', 'size'],\n variant: ['toast', 'defaults', 'variant'],\n },\n selectorParamValues: {\n size: ['default'],\n variant: ['success', 'error', 'info', 'warning', 'loading'],\n },\n tokenConfigPath: ['toast', 'variables'],\n fields: {\n autoClose: {\n bindingSelector: 'toast.autoClose',\n selectorTemplates: ['toast.autoClose'],\n staticValue: 6_000,\n },\n position: {\n bindingSelector: 'toast.position',\n selectorTemplates: ['toast.position'],\n staticValue: 'bottom-center',\n },\n size: {\n bindingSelector: 'toast.defaultSize',\n selectorTemplates: ['toast.defaultSize'],\n },\n variant: {\n bindingSelector: 'toast.defaultVariant',\n selectorTemplates: ['toast.defaultVariant'],\n },\n textVariant: {\n bindingSelector: 'toast.textVariant.${size}',\n selectorTemplates: ['toast.textVariant.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/label',\n valuePath: ['textVariant', 'rest', 'value'],\n },\n },\n textColor: {\n bindingSelector: 'toast.textColor.${variant}',\n selectorTemplates: ['toast.textColor.${variant}'],\n tokenSource: {\n variableTemplate: 'variant/${variant}/root',\n valuePath: ['color', 'rest', 'value'],\n },\n },\n iconSize: {\n bindingSelector: 'toast.iconSize.${size}',\n selectorTemplates: ['toast.iconSize.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/icon',\n valuePath: ['size', 'rest', 'value'],\n },\n },\n buttonSize: {\n bindingSelector: 'toast.buttonSize.${size}',\n selectorTemplates: ['toast.buttonSize.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/actionButton',\n valuePath: ['buttonSize', 'rest', 'value'],\n },\n },\n buttonVariant: {\n bindingSelector: 'toast.buttonVariant.${variant}',\n selectorTemplates: ['toast.buttonVariant.${variant}'],\n tokenSource: {\n variableTemplate: 'variant/${variant}/actionButton',\n valuePath: ['buttonVariant', 'rest', 'value'],\n },\n },\n iconVariant: {\n bindingSelector: 'toast.iconVariant.${variant}',\n selectorTemplates: ['toast.iconVariant.${variant}'],\n tokenSource: {\n variableTemplate: 'variant/${variant}/icon',\n valuePath: ['iconVariant', 'rest', 'value'],\n },\n },\n backgroundColor: {\n bindingSelector: 'toast.backgroundColor',\n selectorTemplates: ['toast.backgroundColor.${variant}'],\n tokenSource: {\n variableTemplate: 'variant/${variant}/root',\n valuePath: ['backgroundColor', 'rest', 'value'],\n },\n },\n },\n },\n useTooltipConfig: {\n defaultProps: {},\n selectorParamValues: {\n size: ['default'],\n },\n tokenConfigPath: ['tooltip', 'variables'],\n fields: {\n animationDuration: {\n bindingSelector: 'tooltip.animationDuration',\n selectorTemplates: ['tooltip.animationDuration'],\n staticValue: 200,\n },\n placement: {\n bindingSelector: 'tooltip.placement',\n selectorTemplates: ['tooltip.placement'],\n staticValue: 'top',\n },\n borderRadius: {\n bindingSelector: 'tooltip.borderRadius',\n selectorTemplates: ['tooltip.borderRadius.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/svg',\n valuePath: ['borderRadius', 'rest', 'value'],\n transformConfigPath: ['scaleMode', 'medium', 'borderRadius'],\n },\n },\n },\n },\n usePopoverConfig: {\n defaultProps: {\n size: 'popover.defaultSize',\n variant: 'popover.defaultVariant',\n },\n defaultPropValues: {\n size: 'default',\n variant: 'default',\n },\n selectorParamValues: {\n size: ['default'],\n },\n tokenConfigPath: ['popover', 'variables'],\n fields: {\n animationDuration: {\n bindingSelector: 'popover.animationDuration',\n selectorTemplates: ['popover.animationDuration'],\n staticValue: 200,\n },\n placement: {\n bindingSelector: 'popover.placement',\n selectorTemplates: ['popover.placement'],\n staticValue: 'top',\n },\n size: {\n bindingSelector: 'popover.defaultSize',\n selectorTemplates: ['popover.defaultSize'],\n },\n variant: {\n bindingSelector: 'popover.defaultVariant',\n selectorTemplates: ['popover.defaultVariant'],\n },\n borderRadius: {\n bindingSelector: 'popover.borderRadius.${size}',\n selectorTemplates: ['popover.borderRadius.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/svgBase',\n valuePath: ['borderRadius', 'rest', 'value'],\n transformConfigPath: ['scaleMode', 'medium', 'borderRadius'],\n },\n },\n gap: {\n bindingSelector: 'popover.gap.${size}',\n selectorTemplates: ['popover.gap.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/contentWrapper',\n valuePath: ['gap', 'rest', 'value'],\n },\n },\n spacingHorizontal: {\n bindingSelector: 'popover.spacingHorizontal.${size}',\n selectorTemplates: ['popover.spacingHorizontal.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/contentWrapper',\n valuePath: ['spacingHorizontal', 'rest', 'value'],\n },\n },\n spacingVertical: {\n bindingSelector: 'popover.spacingVertical.${size}',\n selectorTemplates: ['popover.spacingVertical.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/contentWrapper',\n valuePath: ['spacingVertical', 'rest', 'value'],\n },\n },\n dismissButtonSpacing: {\n bindingSelector: 'popover.dismissButtonSpacing.${size}',\n selectorTemplates: ['popover.dismissButtonSpacing.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/closeIconContainer',\n valuePath: ['spacing', 'rest', 'value'],\n },\n },\n dismissIconSize: {\n bindingSelector: 'popover.dismissIconSize.${size}',\n selectorTemplates: ['popover.dismissIconSize.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/closeIcon',\n valuePath: ['size', 'rest', 'value'],\n transformConfigPath: ['scaleMode', 'medium', 'iconSizes'],\n },\n },\n },\n },\n useModalConfig: {\n defaultProps: {\n size: 'modal.defaultSize',\n variant: 'modal.defaultVariant',\n },\n defaultPropValues: {\n size: 'default',\n variant: 'default',\n },\n selectorParamValues: {\n size: ['default'],\n },\n tokenConfigPath: ['modal', 'variables'],\n fields: {\n size: {\n bindingSelector: 'modal.defaultSize',\n selectorTemplates: ['modal.defaultSize'],\n },\n variant: {\n bindingSelector: 'modal.defaultVariant',\n selectorTemplates: ['modal.defaultVariant'],\n },\n gutter: {\n bindingSelector: 'modal.gutter.${size}',\n selectorTemplates: ['modal.gutter.${size}'],\n tokenSource: {\n variableTemplate: 'size/${size}/scrim',\n valuePath: ['spacing', 'rest', 'value'],\n },\n },\n },\n },\n});\n\ntype RuntimeHookName = keyof typeof runtimeHookMetadata;\ntype RuntimeHookSelectorParamMap<T extends RuntimeHookName> =\n (typeof runtimeHookMetadata)[T] extends { selectorParamValues: infer P } ? NonNullable<P> : never;\ntype RuntimeHookSelectorParamName<T extends RuntimeHookName> = keyof RuntimeHookSelectorParamMap<T>;\ntype RuntimeHookSelectorParamValue<\n T extends RuntimeHookName,\n P extends RuntimeHookSelectorParamName<T>,\n> = RuntimeHookSelectorParamMap<T>[P] extends readonly (infer V)[] ? V : never;\n\nconst getNestedValue = (value: unknown, path: readonly string[]): unknown => {\n return path.reduce<unknown>((currentValue, segment) => {\n if (typeof currentValue !== 'object' || currentValue === null) {\n return undefined;\n }\n\n return (currentValue as Record<string, unknown>)[segment];\n }, value);\n};\n\nconst isRuntimeConfigValue = (value: unknown): value is string | number | boolean => {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n};\n\nconst getRuntimeHookConfig = (hookName: string): RuntimeHookMetadata | null => {\n return runtimeHookMetadata[hookName as RuntimeHookName] ?? null;\n};\n\nconst getRuntimeConfigHookNames = (): RuntimeHookName[] => {\n return Object.keys(runtimeHookMetadata) as RuntimeHookName[];\n};\n\nconst getRuntimeConfigSelectorTemplates = (): string[] => {\n return [\n ...new Set(\n Object.values(runtimeHookMetadata).flatMap((hookMetadata) => [\n ...Object.values(hookMetadata.defaultProps),\n ...Object.values(hookMetadata.fields).flatMap(({ selectorTemplates }) => selectorTemplates),\n ]),\n ),\n ];\n};\n\nconst getRuntimeSelectorParamValues = <\n T extends RuntimeHookName,\n P extends RuntimeHookSelectorParamName<T>,\n>(\n hookName: T,\n paramName: P,\n): RuntimeHookSelectorParamValue<T, P>[] => {\n const selectorParamValues = runtimeHookMetadata[hookName].selectorParamValues as\n | Record<string, readonly string[]>\n | undefined;\n const values = selectorParamValues?.[paramName as string] ?? [];\n return [...values] as RuntimeHookSelectorParamValue<T, P>[];\n};\n\nconst expandRuntimeSelectorTemplate = (\n template: string,\n params: RuntimeSelectorParams = {},\n): string => {\n return template.replace(/\\$\\{(\\w+)\\}/g, (match, paramName: string) => params[paramName] ?? match);\n};\n\nconst expandRuntimeSelectors = (hookName: string, template: string): string[] => {\n const placeholders = [...template.matchAll(/\\$\\{(\\w+)\\}/g)].map((match) => match[1]);\n\n if (placeholders.length === 0) {\n return [template];\n }\n\n return placeholders\n .reduce<RuntimeSelectorParams[]>(\n (combinations, placeholder) => {\n const values = getRuntimeSelectorParamValues(\n hookName as RuntimeHookName,\n placeholder as RuntimeHookSelectorParamName<RuntimeHookName>,\n ) as string[];\n if (values.length === 0) {\n return combinations;\n }\n\n return combinations.flatMap((combination) =>\n values.map((value) => ({ ...combination, [placeholder]: value })),\n );\n },\n [{} as RuntimeSelectorParams],\n )\n .map((params) => expandRuntimeSelectorTemplate(template, params));\n};\n\nconst getRuntimeConfigSelectors = (): string[] => {\n return [\n ...new Set(\n getRuntimeConfigHookNames().flatMap((hookName) => {\n const hookConfig = getRuntimeHookConfig(hookName);\n if (!hookConfig) {\n return [];\n }\n\n return [\n ...Object.values(hookConfig.defaultProps),\n ...Object.values(hookConfig.fields).flatMap(({ selectorTemplates }) =>\n selectorTemplates.flatMap((template) => expandRuntimeSelectors(hookName, template)),\n ),\n ];\n }),\n ),\n ];\n};\n\nconst getRuntimeDefaultPropSelector = (\n hookName: string,\n propName: string,\n params: RuntimeSelectorParams = {},\n): string | null => {\n const selector = getRuntimeHookConfig(hookName)?.defaultProps[propName];\n return selector ? expandRuntimeSelectorTemplate(selector, params) : null;\n};\n\nconst getRuntimeDefaultPropValue = (\n config: UniversalTokensConfig,\n hookName: string,\n propName: string,\n): string | number | boolean | undefined => {\n const hookConfig = getRuntimeHookConfig(hookName);\n const configuredValue = getNestedValue(config, hookConfig?.defaultPropSources?.[propName] ?? []);\n\n if (isRuntimeConfigValue(configuredValue)) {\n return configuredValue;\n }\n\n const staticValue = hookConfig?.defaultPropValues?.[propName];\n return staticValue === undefined ? undefined : staticValue;\n};\n\nconst getRuntimeFieldSelector = (\n hookName: string,\n fieldName: string,\n params: RuntimeSelectorParams = {},\n): string | null => {\n const selectorTemplate = getRuntimeHookConfig(hookName)?.fields[fieldName]?.selectorTemplates[0];\n return selectorTemplate ? expandRuntimeSelectorTemplate(selectorTemplate, params) : null;\n};\n\nconst getRuntimeFieldStaticValue = (\n hookName: string,\n fieldName: string,\n): string | number | boolean | null => {\n return getRuntimeHookConfig(hookName)?.fields[fieldName]?.staticValue ?? null;\n};\n\nconst getRuntimeFieldTokenValue = (\n config: UniversalTokensConfig,\n hookName: string,\n fieldName: string,\n params: RuntimeSelectorParams = {},\n): string | number | boolean | undefined => {\n const hookConfig = getRuntimeHookConfig(hookName);\n const tokenConfigPath = hookConfig?.tokenConfigPath;\n const tokenSource = hookConfig?.fields[fieldName]?.tokenSource;\n\n if (!tokenConfigPath || !tokenSource) {\n return undefined;\n }\n\n const variableTemplate = expandRuntimeSelectorTemplate(tokenSource.variableTemplate, params);\n const tokenValue = getNestedValue(config, [...tokenConfigPath, variableTemplate]);\n const rawValue = getNestedValue(tokenValue, tokenSource.valuePath);\n\n if (rawValue === undefined) {\n return undefined;\n }\n\n if (!tokenSource.transformConfigPath) {\n return isRuntimeConfigValue(rawValue) ? rawValue : undefined;\n }\n\n const transformedValue = getNestedValue(\n tokenSource.transformConfigPath.reduce<unknown>((currentValue, segment) => {\n if (typeof currentValue !== 'object' || currentValue === null) {\n return undefined;\n }\n\n return (currentValue as Record<string, unknown>)[segment];\n }, config),\n [String(rawValue)],\n );\n\n return isRuntimeConfigValue(transformedValue) ? transformedValue : undefined;\n};\n\nexport {\n expandRuntimeSelectorTemplate,\n getRuntimeConfigHookNames,\n getRuntimeConfigSelectors,\n getRuntimeConfigSelectorTemplates,\n getRuntimeDefaultPropSelector,\n getRuntimeDefaultPropValue,\n getRuntimeFieldSelector,\n getRuntimeFieldStaticValue,\n getRuntimeFieldTokenValue,\n getRuntimeHookConfig,\n getRuntimeSelectorParamValues,\n};\nexport type {\n RuntimeHookFieldMetadata,\n RuntimeHookFieldTokenSource,\n RuntimeHookMetadata,\n RuntimeSelectorParams,\n};\n"],"mappings":";;AA0BA,MAAM,6BACJ,aACM;AAER,MAAM,sBAAsB,0BAA0B;CACpD,sBAAsB;EACpB,cAAc,EAAE;EAChB,qBAAqB,EACnB,SAAS,CAAC,UAAU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kBAAkB,OAAO,GAAG;;AAGtF,MAAM,8BACJ,UACA,cACqC;CACrC,OAAO,qBAAqB,SAAS,EAAE,OAAO,YAAY,eAAe;;AAG3E,MAAM,6BACJ,QACA,UACA,WACA,SAAgC,EAAE,KACQ;CAC1C,MAAM,aAAa,qBAAqB,SAAS;CACjD,MAAM,kBAAkB,YAAY;CACpC,MAAM,cAAc,YAAY,OAAO,YAAY;CAEnD,IAAI,CAAC,mBAAmB,CAAC,aACvB;CAGF,MAAM,mBAAmB,8BAA8B,YAAY,kBAAkB,OAAO;CAE5F,MAAM,WAAW,eADE,eAAe,QAAQ,CAAC,GAAG,iBAAiB,iBAAiB,CACtC,EAAE,YAAY,UAAU;CAElE,IAAI,aAAa,KAAA,GACf;CAGF,IAAI,CAAC,YAAY,qBACf,OAAO,qBAAqB,SAAS,GAAG,WAAW,KAAA;CAGrD,MAAM,mBAAmB,eACvB,YAAY,oBAAoB,QAAiB,cAAc,YAAY;EACzE,IAAI,OAAO,iBAAiB,YAAY,iBAAiB,MACvD;EAGF,OAAQ,aAAyC;IAChD,OAAO,EACV,CAAC,OAAO,SAAS,CAAC,CACnB;CAED,OAAO,qBAAqB,iBAAiB,GAAG,mBAAmB,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"addColorModeVars.js","names":[],"sources":["../../../src/tailwind/base/addColorModeVars.ts"],"sourcesContent":["import { DARK_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME } from '@yahoo/uds-css-tokens';\nimport { DEFAULT_COLOR_MODE } from '@yahoo/uds-modes';\nimport { isString } from 'lodash';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport type { WebTokens } from '../../utils/parseTokens';\nimport { getColorModeStyles } from '../utils/getColorModeStyles';\n\nexport function addColorModeVars(tokens: WebTokens, { addBase, config }: PluginAPI) {\n const styles = getColorModeStyles(tokens);\n\n const parentConfigImportant = config().important;\n const useImportNamespace = isString(parentConfigImportant);\n const rootSelector = useImportNamespace ? parentConfigImportant : ':root';\n\n addBase({\n [rootSelector]: styles[DEFAULT_COLOR_MODE],\n [`.${LIGHT_COLOR_MODE_CLASSNAME}`]: styles.light,\n [`.${DARK_COLOR_MODE_CLASSNAME}`]: styles.dark,\n });\n}\n"],"mappings":";;;;;;AAQA,SAAgB,iBAAiB,QAAmB,EAAE,SAAS,UAAqB;CAClF,MAAM,SAAS,mBAAmB,OAAO;CAEzC,MAAM,wBAAwB,QAAQ,CAAC;AAIvC,SAAQ;GAHmB,SAAS,sBACG,GAAG,wBAAwB,UAGhD,OAAO;GACtB,IAAI,+BAA+B,OAAO;GAC1C,IAAI,8BAA8B,OAAO;EAC3C,CAAC"}
1
+ {"version":3,"file":"addColorModeVars.js","names":[],"sources":["../../../src/tailwind/base/addColorModeVars.ts"],"sourcesContent":["import { DARK_COLOR_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME } from '@yahoo/uds-css-tokens';\nimport { DEFAULT_COLOR_MODE } from '@yahoo/uds-modes';\nimport { isString } from 'lodash';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport type { WebTokens } from '../../utils/parseTokens';\nimport { getColorModeStyles } from '../utils/getColorModeStyles';\n\nexport function addColorModeVars(tokens: WebTokens, { addBase, config }: PluginAPI) {\n const styles = getColorModeStyles(tokens);\n\n const parentConfigImportant = config().important;\n const useImportNamespace = isString(parentConfigImportant);\n const rootSelector = useImportNamespace ? parentConfigImportant : ':root';\n\n addBase({\n [rootSelector]: styles[DEFAULT_COLOR_MODE],\n [`.${LIGHT_COLOR_MODE_CLASSNAME}`]: styles.light,\n [`.${DARK_COLOR_MODE_CLASSNAME}`]: styles.dark,\n });\n}\n"],"mappings":";;;;;;AAQA,SAAgB,iBAAiB,QAAmB,EAAE,SAAS,UAAqB;CAClF,MAAM,SAAS,mBAAmB,OAAO;CAEzC,MAAM,wBAAwB,QAAQ,CAAC;CAIvC,QAAQ;GAHmB,SAAS,sBACG,GAAG,wBAAwB,UAGhD,OAAO;GACtB,IAAI,+BAA+B,OAAO;GAC1C,IAAI,8BAA8B,OAAO;EAC3C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"addColorModeVarsV2.js","names":[],"sources":["../../../src/tailwind/base/addColorModeVarsV2.ts"],"sourcesContent":["import {\n DARK_COLOR_MODE_CLASSNAME,\n INVERT_COLOR_MODE_CLASSNAME,\n LIGHT_COLOR_MODE_CLASSNAME,\n SYSTEM_COLOR_MODE_CLASSNAME,\n} from '@yahoo/uds-css-tokens';\nimport { DEFAULT_COLOR_MODE } from '@yahoo/uds-modes';\nimport { isString } from 'lodash';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport type { WebTokens } from '../../utils/parseTokens';\nimport { getColorModeStyles } from '../utils/getColorModeStyles';\n\nexport function addColorModeVarsV2(tokens: WebTokens, { addBase, config }: PluginAPI) {\n const parentConfigImportant = config().important;\n const useImportNamespace = isString(parentConfigImportant);\n const rootSelector = useImportNamespace ? parentConfigImportant : ':root';\n\n const styles = getColorModeStyles(tokens);\n\n const stylesWithInvert = (key: keyof typeof styles) => {\n const { colorScheme: _, ...stylesDefault } = styles[key];\n\n const { colorScheme: __, ...stylesInvert } = styles[key === 'light' ? 'dark' : 'light'];\n\n return {\n ...stylesDefault,\n [`.${INVERT_COLOR_MODE_CLASSNAME}`]: stylesInvert,\n };\n };\n\n const lightWithInvert = stylesWithInvert('light');\n const darkWithInvert = stylesWithInvert('dark');\n\n addBase({\n [rootSelector]: {\n colorScheme: DEFAULT_COLOR_MODE,\n ...stylesWithInvert(DEFAULT_COLOR_MODE),\n },\n\n [`.${SYSTEM_COLOR_MODE_CLASSNAME}`]: {\n colorScheme: 'light dark',\n '@media (prefers-color-scheme: dark)': darkWithInvert,\n },\n\n [`.${LIGHT_COLOR_MODE_CLASSNAME}`]: {\n colorScheme: 'light',\n ...lightWithInvert,\n // '@media (prefers-color-scheme: dark)': lightWithInvert,\n },\n\n [`.${DARK_COLOR_MODE_CLASSNAME}`]: {\n colorScheme: 'dark',\n ...darkWithInvert,\n },\n });\n}\n"],"mappings":";;;;;;AAaA,SAAgB,mBAAmB,QAAmB,EAAE,SAAS,UAAqB;CACpF,MAAM,wBAAwB,QAAQ,CAAC;CAEvC,MAAM,eADqB,SAAS,sBACG,GAAG,wBAAwB;CAElE,MAAM,SAAS,mBAAmB,OAAO;CAEzC,MAAM,oBAAoB,QAA6B;EACrD,MAAM,EAAE,aAAa,GAAG,GAAG,kBAAkB,OAAO;EAEpD,MAAM,EAAE,aAAa,IAAI,GAAG,iBAAiB,OAAO,QAAQ,UAAU,SAAS;AAE/E,SAAO;GACL,GAAG;IACF,IAAI,gCAAgC;GACtC;;CAGH,MAAM,kBAAkB,iBAAiB,QAAQ;CACjD,MAAM,iBAAiB,iBAAiB,OAAO;AAE/C,SAAQ;GACL,eAAe;GACd,aAAa;GACb,GAAG,iBAAiB,mBAAmB;GACxC;GAEA,IAAI,gCAAgC;GACnC,aAAa;GACb,uCAAuC;GACxC;GAEA,IAAI,+BAA+B;GAClC,aAAa;GACb,GAAG;GAEJ;GAEA,IAAI,8BAA8B;GACjC,aAAa;GACb,GAAG;GACJ;EACF,CAAC"}
1
+ {"version":3,"file":"addColorModeVarsV2.js","names":[],"sources":["../../../src/tailwind/base/addColorModeVarsV2.ts"],"sourcesContent":["import {\n DARK_COLOR_MODE_CLASSNAME,\n INVERT_COLOR_MODE_CLASSNAME,\n LIGHT_COLOR_MODE_CLASSNAME,\n SYSTEM_COLOR_MODE_CLASSNAME,\n} from '@yahoo/uds-css-tokens';\nimport { DEFAULT_COLOR_MODE } from '@yahoo/uds-modes';\nimport { isString } from 'lodash';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport type { WebTokens } from '../../utils/parseTokens';\nimport { getColorModeStyles } from '../utils/getColorModeStyles';\n\nexport function addColorModeVarsV2(tokens: WebTokens, { addBase, config }: PluginAPI) {\n const parentConfigImportant = config().important;\n const useImportNamespace = isString(parentConfigImportant);\n const rootSelector = useImportNamespace ? parentConfigImportant : ':root';\n\n const styles = getColorModeStyles(tokens);\n\n const stylesWithInvert = (key: keyof typeof styles) => {\n const { colorScheme: _, ...stylesDefault } = styles[key];\n\n const { colorScheme: __, ...stylesInvert } = styles[key === 'light' ? 'dark' : 'light'];\n\n return {\n ...stylesDefault,\n [`.${INVERT_COLOR_MODE_CLASSNAME}`]: stylesInvert,\n };\n };\n\n const lightWithInvert = stylesWithInvert('light');\n const darkWithInvert = stylesWithInvert('dark');\n\n addBase({\n [rootSelector]: {\n colorScheme: DEFAULT_COLOR_MODE,\n ...stylesWithInvert(DEFAULT_COLOR_MODE),\n },\n\n [`.${SYSTEM_COLOR_MODE_CLASSNAME}`]: {\n colorScheme: 'light dark',\n '@media (prefers-color-scheme: dark)': darkWithInvert,\n },\n\n [`.${LIGHT_COLOR_MODE_CLASSNAME}`]: {\n colorScheme: 'light',\n ...lightWithInvert,\n // '@media (prefers-color-scheme: dark)': lightWithInvert,\n },\n\n [`.${DARK_COLOR_MODE_CLASSNAME}`]: {\n colorScheme: 'dark',\n ...darkWithInvert,\n },\n });\n}\n"],"mappings":";;;;;;AAaA,SAAgB,mBAAmB,QAAmB,EAAE,SAAS,UAAqB;CACpF,MAAM,wBAAwB,QAAQ,CAAC;CAEvC,MAAM,eADqB,SAAS,sBACG,GAAG,wBAAwB;CAElE,MAAM,SAAS,mBAAmB,OAAO;CAEzC,MAAM,oBAAoB,QAA6B;EACrD,MAAM,EAAE,aAAa,GAAG,GAAG,kBAAkB,OAAO;EAEpD,MAAM,EAAE,aAAa,IAAI,GAAG,iBAAiB,OAAO,QAAQ,UAAU,SAAS;EAE/E,OAAO;GACL,GAAG;IACF,IAAI,gCAAgC;GACtC;;CAGH,MAAM,kBAAkB,iBAAiB,QAAQ;CACjD,MAAM,iBAAiB,iBAAiB,OAAO;CAE/C,QAAQ;GACL,eAAe;GACd,aAAa;GACb,GAAG,iBAAiB,mBAAmB;GACxC;GAEA,IAAI,gCAAgC;GACnC,aAAa;GACb,uCAAuC;GACxC;GAEA,IAAI,+BAA+B;GAClC,aAAa;GACb,GAAG;GAEJ;GAEA,IAAI,8BAA8B;GACjC,aAAa;GACb,GAAG;GACJ;EACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"addFontFaceDeclarations.js","names":[],"sources":["../../../src/tailwind/base/addFontFaceDeclarations.ts"],"sourcesContent":["import type { FontID } from '@yahoo/uds-fonts';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport { getFontFaceDeclarations } from '../utils/getFontFaceDeclarations';\n\nexport function addFontFaceDeclarations(fontIds: FontID[], { addBase }: PluginAPI) {\n const declarations = getFontFaceDeclarations(fontIds);\n for (const declaration of declarations) {\n addBase({\n '@font-face': declaration,\n });\n }\n}\n"],"mappings":";;;AAKA,SAAgB,wBAAwB,SAAmB,EAAE,WAAsB;CACjF,MAAM,eAAe,wBAAwB,QAAQ;AACrD,MAAK,MAAM,eAAe,aACxB,SAAQ,EACN,cAAc,aACf,CAAC"}
1
+ {"version":3,"file":"addFontFaceDeclarations.js","names":[],"sources":["../../../src/tailwind/base/addFontFaceDeclarations.ts"],"sourcesContent":["import type { FontID } from '@yahoo/uds-fonts';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport { getFontFaceDeclarations } from '../utils/getFontFaceDeclarations';\n\nexport function addFontFaceDeclarations(fontIds: FontID[], { addBase }: PluginAPI) {\n const declarations = getFontFaceDeclarations(fontIds);\n for (const declaration of declarations) {\n addBase({\n '@font-face': declaration,\n });\n }\n}\n"],"mappings":";;;AAKA,SAAgB,wBAAwB,SAAmB,EAAE,WAAsB;CACjF,MAAM,eAAe,wBAAwB,QAAQ;CACrD,KAAK,MAAM,eAAe,cACxB,QAAQ,EACN,cAAc,aACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"addFontVars.js","names":[],"sources":["../../../src/tailwind/base/addFontVars.ts"],"sourcesContent":["import type { FontConfig } from '@yahoo/uds-types';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport { getFontStyles } from '../utils/getFontStyles';\n\nexport function addFontVars(config: FontConfig, { addBase }: PluginAPI) {\n const styles = getFontStyles(config);\n addBase(styles);\n}\n"],"mappings":";;;AAKA,SAAgB,YAAY,QAAoB,EAAE,WAAsB;AAEtE,SADe,cAAc,OACf,CAAC"}
1
+ {"version":3,"file":"addFontVars.js","names":[],"sources":["../../../src/tailwind/base/addFontVars.ts"],"sourcesContent":["import type { FontConfig } from '@yahoo/uds-types';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport { getFontStyles } from '../utils/getFontStyles';\n\nexport function addFontVars(config: FontConfig, { addBase }: PluginAPI) {\n const styles = getFontStyles(config);\n addBase(styles);\n}\n"],"mappings":";;;AAKA,SAAgB,YAAY,QAAoB,EAAE,WAAsB;CAEtE,QADe,cAAc,OACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"addMotionVars.js","names":[],"sources":["../../../src/tailwind/base/addMotionVars.ts"],"sourcesContent":["import type { MotionConfig } from '@yahoo/uds-types';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport { getMotionStyles } from '../utils/getMotionStyles';\n\nexport function addMotionVars(config: MotionConfig, { addBase }: PluginAPI) {\n const styles = getMotionStyles(config);\n addBase(styles);\n}\n"],"mappings":";;;AAKA,SAAgB,cAAc,QAAsB,EAAE,WAAsB;AAE1E,SADe,gBAAgB,OACjB,CAAC"}
1
+ {"version":3,"file":"addMotionVars.js","names":[],"sources":["../../../src/tailwind/base/addMotionVars.ts"],"sourcesContent":["import type { MotionConfig } from '@yahoo/uds-types';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport { getMotionStyles } from '../utils/getMotionStyles';\n\nexport function addMotionVars(config: MotionConfig, { addBase }: PluginAPI) {\n const styles = getMotionStyles(config);\n addBase(styles);\n}\n"],"mappings":";;;AAKA,SAAgB,cAAc,QAAsB,EAAE,WAAsB;CAE1E,QADe,gBAAgB,OACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"addScaleModeVars.js","names":[],"sources":["../../../src/tailwind/base/addScaleModeVars.ts"],"sourcesContent":["import {\n LARGE_SCALE_MODE_CLASSNAME,\n MEDIUM_SCALE_MODE_CLASSNAME,\n SMALL_SCALE_MODE_CLASSNAME,\n XLARGE_SCALE_MODE_CLASSNAME,\n XSMALL_SCALE_MODE_CLASSNAME,\n XXLARGE_SCALE_MODE_CLASSNAME,\n XXXLARGE_SCALE_MODE_CLASSNAME,\n} from '@yahoo/uds-css-tokens';\nimport { DEFAULT_SCALE_MODE } from '@yahoo/uds-modes';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport type { WebTokens } from '../../utils/parseTokens';\nimport { getScaleModeStyles } from '../utils/getScaleModeStyles';\n\nexport function addScaleModeVars(tokens: WebTokens, { addBase }: PluginAPI) {\n const styles = getScaleModeStyles(tokens);\n\n addBase({\n ...styles[DEFAULT_SCALE_MODE],\n [`.${XSMALL_SCALE_MODE_CLASSNAME}`]: styles.xSmall,\n [`.${SMALL_SCALE_MODE_CLASSNAME}`]: styles.small,\n [`.${MEDIUM_SCALE_MODE_CLASSNAME}`]: styles.medium,\n [`.${LARGE_SCALE_MODE_CLASSNAME}`]: styles.large,\n [`.${XLARGE_SCALE_MODE_CLASSNAME}`]: styles.xLarge,\n [`.${XXLARGE_SCALE_MODE_CLASSNAME}`]: styles.xxLarge,\n [`.${XXXLARGE_SCALE_MODE_CLASSNAME}`]: styles.xxxLarge,\n });\n}\n"],"mappings":";;;;;AAeA,SAAgB,iBAAiB,QAAmB,EAAE,WAAsB;CAC1E,MAAM,SAAS,mBAAmB,OAAO;AAEzC,SAAQ;EACN,GAAG,OAAO;GACT,IAAI,gCAAgC,OAAO;GAC3C,IAAI,+BAA+B,OAAO;GAC1C,IAAI,gCAAgC,OAAO;GAC3C,IAAI,+BAA+B,OAAO;GAC1C,IAAI,gCAAgC,OAAO;GAC3C,IAAI,iCAAiC,OAAO;GAC5C,IAAI,kCAAkC,OAAO;EAC/C,CAAC"}
1
+ {"version":3,"file":"addScaleModeVars.js","names":[],"sources":["../../../src/tailwind/base/addScaleModeVars.ts"],"sourcesContent":["import {\n LARGE_SCALE_MODE_CLASSNAME,\n MEDIUM_SCALE_MODE_CLASSNAME,\n SMALL_SCALE_MODE_CLASSNAME,\n XLARGE_SCALE_MODE_CLASSNAME,\n XSMALL_SCALE_MODE_CLASSNAME,\n XXLARGE_SCALE_MODE_CLASSNAME,\n XXXLARGE_SCALE_MODE_CLASSNAME,\n} from '@yahoo/uds-css-tokens';\nimport { DEFAULT_SCALE_MODE } from '@yahoo/uds-modes';\nimport type { PluginAPI } from 'tailwindcss/types/config';\n\nimport type { WebTokens } from '../../utils/parseTokens';\nimport { getScaleModeStyles } from '../utils/getScaleModeStyles';\n\nexport function addScaleModeVars(tokens: WebTokens, { addBase }: PluginAPI) {\n const styles = getScaleModeStyles(tokens);\n\n addBase({\n ...styles[DEFAULT_SCALE_MODE],\n [`.${XSMALL_SCALE_MODE_CLASSNAME}`]: styles.xSmall,\n [`.${SMALL_SCALE_MODE_CLASSNAME}`]: styles.small,\n [`.${MEDIUM_SCALE_MODE_CLASSNAME}`]: styles.medium,\n [`.${LARGE_SCALE_MODE_CLASSNAME}`]: styles.large,\n [`.${XLARGE_SCALE_MODE_CLASSNAME}`]: styles.xLarge,\n [`.${XXLARGE_SCALE_MODE_CLASSNAME}`]: styles.xxLarge,\n [`.${XXXLARGE_SCALE_MODE_CLASSNAME}`]: styles.xxxLarge,\n });\n}\n"],"mappings":";;;;;AAeA,SAAgB,iBAAiB,QAAmB,EAAE,WAAsB;CAC1E,MAAM,SAAS,mBAAmB,OAAO;CAEzC,QAAQ;EACN,GAAG,OAAO;GACT,IAAI,gCAAgC,OAAO;GAC3C,IAAI,+BAA+B,OAAO;GAC1C,IAAI,gCAAgC,OAAO;GAC3C,IAAI,+BAA+B,OAAO;GAC1C,IAAI,gCAAgC,OAAO;GAC3C,IAAI,iCAAiC,OAAO;GAC5C,IAAI,kCAAkC,OAAO;EAC/C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getFocusRingStyles.js","names":[],"sources":["../../../src/tailwind/components/getFocusRingStyles.ts"],"sourcesContent":["import { PSEUDO_STYLE_SELECTOR_MAP } from '@yahoo/uds-css-tokens';\n\nimport type { CssStyleObject } from './types';\n\n// Using css vars so consumers have a css only path to customize\nconst ringStyles = {\n outlineOffset: 'var(--uds-outline-offset)',\n outlineWidth: 'var(--uds-outline-width)',\n outlineColor: 'var(--uds-outline-color)',\n outlineStyle: 'var(--uds-outline-style)',\n};\n\n/**\n * Generates focus ring styles using CSS variables.\n * The CSS variable values (--uds-outline-*) are set per color mode via parseTokens/UdsThemeProvider.\n */\nfunction getFocusRingStyles() {\n return {\n /** Apply styles */\n [`.uds-ring${PSEUDO_STYLE_SELECTOR_MAP.focused}:not(:disabled)`]: ringStyles,\n [`.focused .uds-ring:not(:disabled)`]: ringStyles,\n [`.uds-ring.uds-ring-within${PSEUDO_STYLE_SELECTOR_MAP.focusedWithin}:not(:disabled)`]:\n ringStyles,\n } as CssStyleObject;\n}\n\nexport { getFocusRingStyles };\n"],"mappings":";;;AAKA,MAAM,aAAa;CACjB,eAAe;CACf,cAAc;CACd,cAAc;CACd,cAAc;CACf;;;;;AAMD,SAAS,qBAAqB;AAC5B,QAAO;;GAEJ,YAAY,0BAA0B,QAAQ,mBAAmB;GACjE,sCAAsC;GACtC,4BAA4B,0BAA0B,cAAc,mBACnE;EACH"}
1
+ {"version":3,"file":"getFocusRingStyles.js","names":[],"sources":["../../../src/tailwind/components/getFocusRingStyles.ts"],"sourcesContent":["import { PSEUDO_STYLE_SELECTOR_MAP } from '@yahoo/uds-css-tokens';\n\nimport type { CssStyleObject } from './types';\n\n// Using css vars so consumers have a css only path to customize\nconst ringStyles = {\n outlineOffset: 'var(--uds-outline-offset)',\n outlineWidth: 'var(--uds-outline-width)',\n outlineColor: 'var(--uds-outline-color)',\n outlineStyle: 'var(--uds-outline-style)',\n};\n\n/**\n * Generates focus ring styles using CSS variables.\n * The CSS variable values (--uds-outline-*) are set per color mode via parseTokens/UdsThemeProvider.\n */\nfunction getFocusRingStyles() {\n return {\n /** Apply styles */\n [`.uds-ring${PSEUDO_STYLE_SELECTOR_MAP.focused}:not(:disabled)`]: ringStyles,\n [`.focused .uds-ring:not(:disabled)`]: ringStyles,\n [`.uds-ring.uds-ring-within${PSEUDO_STYLE_SELECTOR_MAP.focusedWithin}:not(:disabled)`]:\n ringStyles,\n } as CssStyleObject;\n}\n\nexport { getFocusRingStyles };\n"],"mappings":";;;AAKA,MAAM,aAAa;CACjB,eAAe;CACf,cAAc;CACd,cAAc;CACd,cAAc;CACf;;;;;AAMD,SAAS,qBAAqB;CAC5B,OAAO;;GAEJ,YAAY,0BAA0B,QAAQ,mBAAmB;GACjE,sCAAsC;GACtC,4BAA4B,0BAA0B,cAAc,mBACnE;EACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"getHitTargetStyles.js","names":[],"sources":["../../../src/tailwind/components/getHitTargetStyles.ts"],"sourcesContent":["import type { CssStyleObject } from './types';\n\nconst MINIMUM_TAP_TARGET = '44px';\nfunction getHitTargetStyles() {\n return {\n ['.uds-hit-target']: {\n position: 'relative',\n },\n ['.uds-hit-target::before']: {\n '@media (hover: none)': {\n content: `''`,\n position: 'absolute',\n top: '50%',\n left: '50%',\n width: `max(${MINIMUM_TAP_TARGET}, 100%)`,\n height: `max(${MINIMUM_TAP_TARGET}, 100%)`,\n transform: 'translate(-50%, -50%)',\n },\n },\n } as CssStyleObject;\n}\n\nexport { getHitTargetStyles, MINIMUM_TAP_TARGET };\n"],"mappings":";;AAEA,MAAM,qBAAqB;AAC3B,SAAS,qBAAqB;AAC5B,QAAO;GACJ,oBAAoB,EACnB,UAAU,YACX;GACA,4BAA4B,EAC3B,wBAAwB;GACtB,SAAS;GACT,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO,OAAO,mBAAmB;GACjC,QAAQ,OAAO,mBAAmB;GAClC,WAAW;GACZ,EACF;EACF"}
1
+ {"version":3,"file":"getHitTargetStyles.js","names":[],"sources":["../../../src/tailwind/components/getHitTargetStyles.ts"],"sourcesContent":["import type { CssStyleObject } from './types';\n\nconst MINIMUM_TAP_TARGET = '44px';\nfunction getHitTargetStyles() {\n return {\n ['.uds-hit-target']: {\n position: 'relative',\n },\n ['.uds-hit-target::before']: {\n '@media (hover: none)': {\n content: `''`,\n position: 'absolute',\n top: '50%',\n left: '50%',\n width: `max(${MINIMUM_TAP_TARGET}, 100%)`,\n height: `max(${MINIMUM_TAP_TARGET}, 100%)`,\n transform: 'translate(-50%, -50%)',\n },\n },\n } as CssStyleObject;\n}\n\nexport { getHitTargetStyles, MINIMUM_TAP_TARGET };\n"],"mappings":";;AAEA,MAAM,qBAAqB;AAC3B,SAAS,qBAAqB;CAC5B,OAAO;GACJ,oBAAoB,EACnB,UAAU,YACX;GACA,4BAA4B,EAC3B,wBAAwB;GACtB,SAAS;GACT,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO,OAAO,mBAAmB;GACjC,QAAQ,OAAO,mBAAmB;GAClC,WAAW;GACZ,EACF;EACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"getIconStyles.js","names":[],"sources":["../../../src/tailwind/components/getIconStyles.ts"],"sourcesContent":["import type { CssStyleObject } from './types';\n\n/**\n * Generates icon styles for light/dark mode using CSS variables\n */\nfunction getIconStyles() {\n return {\n '.uds-light-mode-icon': { display: 'var(--uds-light-mode-icon, inline)' },\n '.uds-dark-mode-icon': { display: 'var(--uds-dark-mode-icon, none)' },\n } as CssStyleObject;\n}\n\nexport { getIconStyles };\n"],"mappings":";;;;;AAKA,SAAS,gBAAgB;AACvB,QAAO;EACL,wBAAwB,EAAE,SAAS,sCAAsC;EACzE,uBAAuB,EAAE,SAAS,mCAAmC;EACtE"}
1
+ {"version":3,"file":"getIconStyles.js","names":[],"sources":["../../../src/tailwind/components/getIconStyles.ts"],"sourcesContent":["import type { CssStyleObject } from './types';\n\n/**\n * Generates icon styles for light/dark mode using CSS variables\n */\nfunction getIconStyles() {\n return {\n '.uds-light-mode-icon': { display: 'var(--uds-light-mode-icon, inline)' },\n '.uds-dark-mode-icon': { display: 'var(--uds-dark-mode-icon, none)' },\n } as CssStyleObject;\n}\n\nexport { getIconStyles };\n"],"mappings":";;;;;AAKA,SAAS,gBAAgB;CACvB,OAAO;EACL,wBAAwB,EAAE,SAAS,sCAAsC;EACzE,uBAAuB,EAAE,SAAS,mCAAmC;EACtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"getInputStyles.js","names":[],"sources":["../../../src/tailwind/components/getInputStyles.ts"],"sourcesContent":["import type { CssStyleObject } from './types';\n\n/**\n * Generates input styles\n */\nfunction getInputStyles() {\n return {\n ['.uds-input[list]::-webkit-calendar-picker-indicator']: {\n blockSize: '100% !important', // Fix datalist dropdown arrow positioning.\n },\n ['.uds-input::-webkit-datetime-edit']: {\n color: `rgb(var(--uds-foreground-color-muted))`,\n },\n ['.uds-input::-webkit-calendar-picker-indicator']: {\n display: 'none',\n },\n } as CssStyleObject;\n}\n\nexport { getInputStyles };\n"],"mappings":";;;;;AAKA,SAAS,iBAAiB;AACxB,QAAO;GACJ,wDAAwD,EACvD,WAAW,mBACZ;GACA,sCAAsC,EACrC,OAAO,0CACR;GACA,kDAAkD,EACjD,SAAS,QACV;EACF"}
1
+ {"version":3,"file":"getInputStyles.js","names":[],"sources":["../../../src/tailwind/components/getInputStyles.ts"],"sourcesContent":["import type { CssStyleObject } from './types';\n\n/**\n * Generates input styles\n */\nfunction getInputStyles() {\n return {\n ['.uds-input[list]::-webkit-calendar-picker-indicator']: {\n blockSize: '100% !important', // Fix datalist dropdown arrow positioning.\n },\n ['.uds-input::-webkit-datetime-edit']: {\n color: `rgb(var(--uds-foreground-color-muted))`,\n },\n ['.uds-input::-webkit-calendar-picker-indicator']: {\n display: 'none',\n },\n } as CssStyleObject;\n}\n\nexport { getInputStyles };\n"],"mappings":";;;;;AAKA,SAAS,iBAAiB;CACxB,OAAO;GACJ,wDAAwD,EACvD,WAAW,mBACZ;GACA,sCAAsC,EACrC,OAAO,0CACR;GACA,kDAAkD,EACjD,SAAS,QACV;EACF"}