@yahoo/uds 3.171.1 → 3.172.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 (26) hide show
  1. package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
  2. package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
  3. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +1 -1
  4. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +1 -1
  5. package/dist/css/dist/purger/optimized/ast/expressions.cjs +278 -278
  6. package/dist/css/dist/purger/optimized/ast/expressions.js +278 -278
  7. package/dist/css/dist/purger/optimized/ast/jsx.cjs +67 -36
  8. package/dist/css/dist/purger/optimized/ast/jsx.js +67 -35
  9. package/dist/css/dist/purger/optimized/ast/oxc.cjs +265 -0
  10. package/dist/css/dist/purger/optimized/ast/oxc.js +253 -0
  11. package/dist/css/dist/purger/optimized/ast/props.cjs +21 -15
  12. package/dist/css/dist/purger/optimized/ast/props.js +21 -14
  13. package/dist/css/dist/purger/optimized/ast/spread.cjs +19 -19
  14. package/dist/css/dist/purger/optimized/ast/spread.js +19 -18
  15. package/dist/css/dist/purger/optimized/purgeFromCode.cjs +86 -101
  16. package/dist/css/dist/purger/optimized/purgeFromCode.js +86 -100
  17. package/dist/tailwind-internal/dist/utils/getShadowStyles.d.cts +2 -2
  18. package/dist/tailwind-internal/dist/utils/getShadowStyles.d.ts +2 -2
  19. package/dist/tailwind-v3/dist/purger/legacy/purgeCSS.cjs +1 -1
  20. package/dist/tailwind-v3/dist/purger/legacy/purgeCSS.js +1 -1
  21. package/dist/uds/generated/componentData.cjs +450 -450
  22. package/dist/uds/generated/componentData.js +450 -450
  23. package/dist/uds/package.cjs +2 -0
  24. package/dist/uds/package.js +2 -0
  25. package/generated/componentData.json +1049 -1049
  26. package/package.json +3 -1
@@ -1,10 +1,9 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- require("../../../../_virtual/_rolldown/runtime.cjs");
3
2
  const require_perf = require("../../css/perf.cjs");
3
+ const require_oxc = require("./ast/oxc.cjs");
4
4
  const require_expressions = require("./ast/expressions.cjs");
5
5
  const require_jsx = require("./ast/jsx.cjs");
6
6
  const require_spread = require("./ast/spread.cjs");
7
- let ts_morph = require("ts-morph");
8
7
  //#region ../css/dist/purger/optimized/purgeFromCode.mjs
9
8
  /*! © 2026 Yahoo, Inc. UDS CSS v0.0.0-development */
10
9
  /**
@@ -52,13 +51,6 @@ const resolveComponentInfo = (name) => {
52
51
  const mappedName = componentNameLookup?.[normalized];
53
52
  if (mappedName && componentCache) return componentCache[mappedName];
54
53
  };
55
- const getModuleSpecifierValue = (importDecl) => {
56
- return importDecl.getModuleSpecifierValue() ?? importDecl.getModuleSpecifier().getText().replace(/^['"]|['"]$/g, "");
57
- };
58
- const isTypeOnlyNamedImport = (importDecl, importName) => {
59
- if (importDecl.isTypeOnly()) return true;
60
- return importDecl.getNamedImports().find((namedImport) => namedImport.getName() === importName)?.isTypeOnly() ?? false;
61
- };
62
54
  const isUdsComponentModule = (moduleSpecifier) => {
63
55
  const cleaned = moduleSpecifier.replace(/^['"]|['"]$/g, "");
64
56
  return cleaned === "@yahoo/uds" || cleaned.startsWith("@yahoo/uds/");
@@ -134,27 +126,27 @@ const resolveRuntimeSelectorValues = (selectorTemplate, componentInfo, userProps
134
126
  return value === void 0 ? [] : [String(value)];
135
127
  });
136
128
  };
137
- const extractClassNamePrimitives = (sourceFile) => {
129
+ const extractClassNamePrimitives = (source) => {
138
130
  const classes = [];
139
- sourceFile.getDescendantsOfKind(ts_morph.SyntaxKind.JsxAttribute).forEach((attr) => {
140
- if (attr.getNameNode().getText() !== "className") return;
141
- const initializer = attr.getInitializer();
131
+ source.jsxAttributes.forEach((attr) => {
132
+ if (require_oxc.getJsxAttributeName(source, attr) !== "className") return;
133
+ const initializer = attr.value;
142
134
  if (!initializer) return;
143
135
  const values = [];
144
- if (ts_morph.Node.isStringLiteral(initializer)) values.push(initializer.getLiteralText());
145
- else if (ts_morph.Node.isJsxExpression(initializer)) {
146
- const expr = initializer.getExpression();
147
- if (expr) values.push(...require_expressions.extractStringLiterals(expr));
136
+ if (require_oxc.isStringLiteral(initializer)) values.push(require_oxc.getStringLiteralValue(initializer));
137
+ else if (initializer.type === "JSXExpressionContainer") {
138
+ const expr = initializer.expression;
139
+ if (expr && expr.type !== "JSXEmptyExpression") values.push(...require_expressions.extractStringLiterals(expr, source));
148
140
  }
149
141
  values.forEach((raw) => {
150
142
  classes.push(...raw.split(/\s+/).filter(Boolean));
151
143
  });
152
144
  });
153
- sourceFile.getDescendantsOfKind(ts_morph.SyntaxKind.PropertyAssignment).forEach((prop) => {
154
- if (prop.getName() !== "className") return;
155
- const initializer = prop.getInitializer();
145
+ source.objectProperties.forEach((prop) => {
146
+ if (prop.shorthand || require_oxc.getPropertyName(source, prop) !== "className") return;
147
+ const initializer = prop.value;
156
148
  if (!initializer) return;
157
- require_expressions.extractStringLiterals(initializer).forEach((raw) => {
149
+ require_expressions.extractStringLiterals(initializer, source).forEach((raw) => {
158
150
  classes.push(...raw.split(/\s+/).filter(Boolean));
159
151
  });
160
152
  });
@@ -184,8 +176,7 @@ const purgeFromCodeOptimized = async (code, options) => {
184
176
  unresolvedWrapperSpreads: []
185
177
  };
186
178
  const projectCreateStart = performance.now();
187
- const project = new ts_morph.Project({ useInMemoryFileSystem: true });
188
- const sourceFile = project.createSourceFile(options.filePath ?? "input.tsx", code, { overwrite: true });
179
+ const source = require_oxc.parseSource(options.filePath ?? "input.tsx", code);
189
180
  const projectCreateMs = performance.now() - projectCreateStart;
190
181
  const stats = {
191
182
  filesScanned: 1,
@@ -196,17 +187,16 @@ const purgeFromCodeOptimized = async (code, options) => {
196
187
  expressionsResolved: 0
197
188
  };
198
189
  const purgeContext = {
199
- project,
190
+ sources: [source],
200
191
  componentUsageCache: /* @__PURE__ */ new Map(),
201
192
  spreadCache: /* @__PURE__ */ new Map(),
202
- udsImportingFiles: /* @__PURE__ */ new Set(),
203
193
  stats
204
194
  };
205
195
  const importParseStart = performance.now();
206
196
  const imports = [];
207
- sourceFile.getImportDeclarations().forEach((importDecl) => {
208
- if (isUdsComponentModule(getModuleSpecifierValue(importDecl))) importDecl.getNamedImports().forEach((namedImport) => {
209
- if (!namedImport.isTypeOnly() && !importDecl.isTypeOnly()) imports.push(namedImport.getName());
197
+ source.staticImports.forEach((staticImport) => {
198
+ if (isUdsComponentModule(staticImport.moduleRequest.value)) staticImport.entries.forEach((entry) => {
199
+ if (entry.importName.kind === "Name" && entry.importName.name && !entry.isType) imports.push(entry.importName.name);
210
200
  });
211
201
  });
212
202
  const importParseMs = performance.now() - importParseStart;
@@ -216,17 +206,16 @@ const purgeFromCodeOptimized = async (code, options) => {
216
206
  const unresolvedWrapperSpreads = [];
217
207
  const referencedComponents = /* @__PURE__ */ new Set();
218
208
  const getStylesExtractStart = performance.now();
219
- const getStylesProps = extractGetStylesCalls(sourceFile, stats, variants);
209
+ const getStylesProps = extractGetStylesCalls(source, stats, variants);
220
210
  const getStylesExtractMs = performance.now() - getStylesExtractStart;
221
211
  const jsxAnalysisStart = performance.now();
222
- const jsxElementsCache = sourceFile.getDescendants().filter((node) => ts_morph.Node.isJsxOpeningElement(node) || ts_morph.Node.isJsxSelfClosingElement(node));
223
212
  imports.forEach((imp) => {
224
- findComponentReferences(sourceFile, imp, jsxElementsCache).forEach((reference) => {
225
- const componentName = reference.getTagNameNode().getText() || imp;
213
+ findComponentReferences(source, imp).forEach((reference) => {
214
+ const componentName = require_oxc.getJsxTagName(source, reference) || imp;
226
215
  referencedComponents.add(componentName);
227
216
  const propsMap = componentProps.get(componentName) ?? /* @__PURE__ */ new Map();
228
217
  const unresolvedSpreadProps = componentUnresolvedSpreadProps.get(componentName) ?? /* @__PURE__ */ new Set();
229
- const { props, unknownSpreadWrappers } = extractPropsFromReference(reference, stats, sourceFile, purgeContext);
218
+ const { props, unknownSpreadWrappers } = extractPropsFromReference(reference, stats, source, purgeContext);
230
219
  props.forEach(({ propName, values, fromSpread }) => {
231
220
  if (values.length > 0) {
232
221
  const existing = propsMap.get(propName) ?? /* @__PURE__ */ new Set();
@@ -382,7 +371,7 @@ const purgeFromCodeOptimized = async (code, options) => {
382
371
  });
383
372
  });
384
373
  });
385
- if (options.includeAllClassNamePrimitives) safelist.push(...extractClassNamePrimitives(sourceFile));
374
+ if (options.includeAllClassNamePrimitives) safelist.push(...extractClassNamePrimitives(source));
386
375
  const finalSafelist = [...new Set(safelist)].sort();
387
376
  const safelistGenerationMs = performance.now() - safelistGenStart;
388
377
  stats.timeMs = Math.round(performance.now() - startTime);
@@ -405,15 +394,14 @@ const purgeFromCodeOptimized = async (code, options) => {
405
394
  /**
406
395
  * Find JSX references for a component in the source file
407
396
  */
408
- const findComponentReferences = (sourceFile, componentName, jsxElementsCache) => {
397
+ const findComponentReferences = (source, componentName) => {
409
398
  const references = [];
410
399
  const seenTags = /* @__PURE__ */ new Set();
411
- const allJsxElements = jsxElementsCache ?? sourceFile.getDescendants().filter((node) => ts_morph.Node.isJsxOpeningElement(node) || ts_morph.Node.isJsxSelfClosingElement(node));
412
400
  const collectMatchingTags = (localName) => {
413
- for (const node of allJsxElements) {
414
- const tagName = node.getTagNameNode().getText();
401
+ for (const node of source.jsxElements) {
402
+ const tagName = require_oxc.getJsxTagName(source, node);
415
403
  if (tagName === localName || tagName.startsWith(`${localName}.`)) {
416
- const key = `${tagName}:${node.getStart()}`;
404
+ const key = `${tagName}:${node.start}`;
417
405
  if (!seenTags.has(key)) {
418
406
  seenTags.add(key);
419
407
  references.push(node);
@@ -421,11 +409,11 @@ const findComponentReferences = (sourceFile, componentName, jsxElementsCache) =>
421
409
  }
422
410
  }
423
411
  };
424
- sourceFile.getImportDeclarations().forEach((importDecl) => {
425
- if (!isUdsComponentModule(getModuleSpecifierValue(importDecl))) return;
426
- importDecl.getNamedImports().forEach((namedImport) => {
427
- if (namedImport.getName() !== componentName || isTypeOnlyNamedImport(importDecl, componentName)) return;
428
- collectMatchingTags(namedImport.getAliasNode()?.getText() ?? componentName);
412
+ source.staticImports.forEach((staticImport) => {
413
+ if (!isUdsComponentModule(staticImport.moduleRequest.value)) return;
414
+ staticImport.entries.forEach((entry) => {
415
+ if (entry.importName.kind !== "Name" || entry.importName.name !== componentName || entry.isType) return;
416
+ collectMatchingTags(entry.localName.value);
429
417
  });
430
418
  });
431
419
  return references;
@@ -439,22 +427,21 @@ const findComponentReferences = (sourceFile, componentName, jsxElementsCache) =>
439
427
  * 3. Otherwise the spread is unknown: reported via `unknownSpreadWrappers` so the
440
428
  * caller can over-include variant classes and emit cross-file metadata.
441
429
  */
442
- const extractPropsFromReference = (reference, stats, sourceFile, purgeContext) => {
430
+ const extractPropsFromReference = (reference, stats, source, purgeContext) => {
443
431
  const props = [];
444
432
  const unknownSpreadWrappers = [];
445
- reference.getAttributes().forEach((attr) => {
446
- if (attr.asKind(ts_morph.SyntaxKind.JsxAttribute)) {
447
- const jsxAttr = attr.asKindOrThrow(ts_morph.SyntaxKind.JsxAttribute);
448
- const propName = jsxAttr.getNameNode().getText();
433
+ reference.attributes.forEach((attr) => {
434
+ if (attr.type === "JSXAttribute") {
435
+ const propName = require_oxc.getJsxAttributeName(source, attr);
449
436
  const values = [];
450
- const initializer = jsxAttr.getInitializer();
451
- if (initializer && ts_morph.Node.isStringLiteral(initializer)) {
452
- values.push(initializer.getLiteralText());
437
+ const initializer = attr.value;
438
+ if (initializer && require_oxc.isStringLiteral(initializer)) {
439
+ values.push(require_oxc.getStringLiteralValue(initializer));
453
440
  stats.expressionsResolved++;
454
- } else if (initializer && initializer.asKind(ts_morph.SyntaxKind.JsxExpression)) {
455
- const expression = initializer.asKindOrThrow(ts_morph.SyntaxKind.JsxExpression).getExpression();
456
- if (expression) {
457
- const resolved = require_expressions.extractStringLiterals(expression);
441
+ } else if (initializer && initializer.type === "JSXExpressionContainer") {
442
+ const expression = initializer.expression;
443
+ if (expression && expression.type !== "JSXEmptyExpression") {
444
+ const resolved = require_expressions.extractStringLiterals(expression, source);
458
445
  values.push(...resolved);
459
446
  if (resolved.length > 0) stats.expressionsResolved++;
460
447
  }
@@ -465,9 +452,10 @@ const extractPropsFromReference = (reference, stats, sourceFile, purgeContext) =
465
452
  fromSpread: false
466
453
  });
467
454
  }
468
- if (attr.asKind(ts_morph.SyntaxKind.JsxSpreadAttribute)) {
469
- const spreadName = attr.asKindOrThrow(ts_morph.SyntaxKind.JsxSpreadAttribute).getExpression().getText();
470
- const resolvedSpreadProps = traceSpreadInFile(spreadName, sourceFile);
455
+ if (attr.type === "JSXSpreadAttribute") {
456
+ const expression = attr.argument;
457
+ const spreadName = require_oxc.getText(source, expression);
458
+ const resolvedSpreadProps = traceSpreadInFile(spreadName, source);
471
459
  if (resolvedSpreadProps.length > 0) {
472
460
  stats.spreadsTraced++;
473
461
  resolvedSpreadProps.forEach(([propName, values]) => {
@@ -479,7 +467,7 @@ const extractPropsFromReference = (reference, stats, sourceFile, purgeContext) =
479
467
  });
480
468
  return;
481
469
  }
482
- const usageResolved = require_spread.resolveSpreadFromUsages(reference, spreadName, purgeContext);
470
+ const usageResolved = require_spread.resolveSpreadFromUsages(reference, spreadName, source, purgeContext);
483
471
  if (usageResolved) {
484
472
  usageResolved.forEach((values, propName) => {
485
473
  props.push({
@@ -491,7 +479,7 @@ const extractPropsFromReference = (reference, stats, sourceFile, purgeContext) =
491
479
  return;
492
480
  }
493
481
  stats.spreadsUnresolved++;
494
- const parentInfo = require_jsx.getParentComponentInfo(reference);
482
+ const parentInfo = require_jsx.getParentComponentInfo(reference, source);
495
483
  const isWrapperParamSpread = parentInfo && (parentInfo.spreadRestIdentifier === spreadName || parentInfo.paramIdentifier === spreadName);
496
484
  unknownSpreadWrappers.push(isWrapperParamSpread ? parentInfo.componentName : void 0);
497
485
  }
@@ -504,19 +492,18 @@ const extractPropsFromReference = (reference, stats, sourceFile, purgeContext) =
504
492
  /**
505
493
  * Trace spread props to their source within the same file.
506
494
  */
507
- const traceSpreadInFile = (spreadName, sourceFile) => {
495
+ const traceSpreadInFile = (spreadName, source) => {
508
496
  const props = /* @__PURE__ */ new Map();
509
- const varDecl = sourceFile.getDescendantsOfKind(ts_morph.SyntaxKind.VariableDeclaration).find((declaration) => declaration.getName() === spreadName);
497
+ const varDecl = source.variableDeclarators.find((declaration) => declaration.id.type === "Identifier" && declaration.id.name === spreadName);
510
498
  if (!varDecl) return [];
511
- const initializer = varDecl.getInitializer();
499
+ const initializer = varDecl.init;
512
500
  if (!initializer) return [];
513
501
  getSpreadObjectLiteralCandidates(initializer).forEach((objLiteral) => {
514
- objLiteral.getProperties().forEach((prop) => {
515
- if (!prop.asKind(ts_morph.SyntaxKind.PropertyAssignment)) return;
516
- const propAssign = prop.asKindOrThrow(ts_morph.SyntaxKind.PropertyAssignment);
517
- const propName = propAssign.getName();
518
- const propInit = propAssign.getInitializer();
519
- const values = propInit ? require_expressions.extractStringLiterals(propInit) : [];
502
+ objLiteral.properties.forEach((prop) => {
503
+ if (prop.type !== "Property" || prop.shorthand) return;
504
+ const propName = require_oxc.getPropertyName(source, prop);
505
+ const propInit = prop.value;
506
+ const values = propInit ? require_expressions.extractStringLiterals(propInit, source) : [];
520
507
  const existingValues = props.get(propName) ?? /* @__PURE__ */ new Set();
521
508
  values.forEach((value) => existingValues.add(value));
522
509
  props.set(propName, existingValues);
@@ -525,10 +512,10 @@ const traceSpreadInFile = (spreadName, sourceFile) => {
525
512
  return [...props.entries()].map(([propName, values]) => [propName, [...values]]);
526
513
  };
527
514
  const getSpreadObjectLiteralCandidates = (node) => {
528
- if (ts_morph.Node.isObjectLiteralExpression(node)) return [node];
529
- if (ts_morph.Node.isParenthesizedExpression(node)) return getSpreadObjectLiteralCandidates(node.getExpression());
530
- if (ts_morph.Node.isAsExpression(node) || ts_morph.Node.isTypeAssertion(node) || ts_morph.Node.isSatisfiesExpression(node)) return getSpreadObjectLiteralCandidates(node.getExpression());
531
- if (ts_morph.Node.isConditionalExpression(node)) return [...getSpreadObjectLiteralCandidates(node.getWhenTrue()), ...getSpreadObjectLiteralCandidates(node.getWhenFalse())];
515
+ if (node.type === "ObjectExpression") return [node];
516
+ if (node.type === "ParenthesizedExpression") return getSpreadObjectLiteralCandidates(node.expression);
517
+ if (node.type === "TSAsExpression" || node.type === "TSTypeAssertion" || node.type === "TSSatisfiesExpression") return getSpreadObjectLiteralCandidates(node.expression);
518
+ if (node.type === "ConditionalExpression") return [...getSpreadObjectLiteralCandidates(node.consequent), ...getSpreadObjectLiteralCandidates(node.alternate)];
532
519
  return [];
533
520
  };
534
521
  /**
@@ -536,22 +523,22 @@ const getSpreadObjectLiteralCandidates = (node) => {
536
523
  * This handles cases like:
537
524
  * const styles = getStyles({ backgroundColor: 'brand', spacing: '4' });
538
525
  */
539
- const extractGetStylesCalls = (sourceFile, stats, variants) => {
526
+ const extractGetStylesCalls = (source, stats, variants) => {
540
527
  const props = /* @__PURE__ */ new Map();
541
528
  const VALID_VARIANTS = new Set(Object.keys(variants));
542
- sourceFile.getDescendantsOfKind(ts_morph.SyntaxKind.CallExpression).forEach((call) => {
543
- if (call.getExpression().getText() !== "getStyles") return;
544
- const args = call.getArguments();
529
+ source.callExpressions.forEach((call) => {
530
+ if (require_oxc.getText(source, call.callee) !== "getStyles") return;
531
+ const args = call.arguments;
545
532
  if (args.length === 0) return;
546
533
  const firstArg = args[0];
547
- if (!firstArg.asKind(ts_morph.SyntaxKind.ObjectLiteralExpression)) return;
548
- firstArg.asKindOrThrow(ts_morph.SyntaxKind.ObjectLiteralExpression).getProperties().forEach((prop) => {
549
- if (prop.asKind(ts_morph.SyntaxKind.PropertyAssignment)) {
550
- const propAssign = prop.asKindOrThrow(ts_morph.SyntaxKind.PropertyAssignment);
551
- const propName = propAssign.getName();
552
- const propInit = propAssign.getInitializer();
534
+ if (firstArg.type !== "ObjectExpression") return;
535
+ firstArg.properties.forEach((prop) => {
536
+ if (prop.type !== "Property") return;
537
+ if (!prop.shorthand) {
538
+ const propName = require_oxc.getPropertyName(source, prop);
539
+ const propInit = prop.value;
553
540
  if (propInit && VALID_VARIANTS.has(propName)) {
554
- const values = require_expressions.extractStringLiterals(propInit);
541
+ const values = require_expressions.extractStringLiterals(propInit, source);
555
542
  if (values.length > 0) {
556
543
  const existing = props.get(propName) ?? /* @__PURE__ */ new Set();
557
544
  values.forEach((v) => existing.add(v));
@@ -559,11 +546,10 @@ const extractGetStylesCalls = (sourceFile, stats, variants) => {
559
546
  stats.expressionsResolved++;
560
547
  }
561
548
  }
562
- } else if (prop.asKind(ts_morph.SyntaxKind.ShorthandPropertyAssignment)) {
563
- const shorthand = prop.asKindOrThrow(ts_morph.SyntaxKind.ShorthandPropertyAssignment);
564
- const propName = shorthand.getName();
549
+ } else {
550
+ const propName = require_oxc.getPropertyName(source, prop);
565
551
  if (VALID_VARIANTS.has(propName)) {
566
- const values = require_expressions.extractStringLiterals(shorthand.getNameNode());
552
+ const values = require_expressions.extractStringLiterals(prop.value, source);
567
553
  if (values.length > 0) {
568
554
  const existing = props.get(propName) ?? /* @__PURE__ */ new Set();
569
555
  values.forEach((v) => existing.add(v));
@@ -619,21 +605,20 @@ const resolveWrapperSpreadSafelist = (wrapperSpreads, sources, variants) => {
619
605
  const wrapperNames = [...targetsByWrapper.keys()];
620
606
  const usageProps = /* @__PURE__ */ new Map();
621
607
  sources.filter((code) => wrapperNames.some((name) => code.includes(`<${name}`))).forEach((code) => {
622
- new ts_morph.Project({ useInMemoryFileSystem: true }).createSourceFile("wrapper-usage.tsx", code, { overwrite: true }).getDescendants().forEach((node) => {
623
- if (!ts_morph.Node.isJsxOpeningElement(node) && !ts_morph.Node.isJsxSelfClosingElement(node)) return;
624
- const tagName = node.getTagNameNode().getText();
608
+ const source = require_oxc.parseSource("wrapper-usage.tsx", code);
609
+ source.jsxElements.forEach((node) => {
610
+ const tagName = require_oxc.getJsxTagName(source, node);
625
611
  if (!targetsByWrapper.has(tagName)) return;
626
612
  const propsMap = usageProps.get(tagName) ?? /* @__PURE__ */ new Map();
627
- node.getAttributes().forEach((attr) => {
628
- const jsxAttr = attr.asKind(ts_morph.SyntaxKind.JsxAttribute);
629
- if (!jsxAttr) return;
630
- const propName = jsxAttr.getNameNode().getText();
613
+ node.attributes.forEach((attr) => {
614
+ if (attr.type !== "JSXAttribute") return;
615
+ const propName = require_oxc.getJsxAttributeName(source, attr);
631
616
  const values = [];
632
- const initializer = jsxAttr.getInitializer();
633
- if (initializer && ts_morph.Node.isStringLiteral(initializer)) values.push(initializer.getLiteralText());
634
- else if (initializer && ts_morph.Node.isJsxExpression(initializer)) {
635
- const expression = initializer.getExpression();
636
- if (expression) values.push(...require_expressions.extractStringLiterals(expression));
617
+ const initializer = attr.value;
618
+ if (initializer && require_oxc.isStringLiteral(initializer)) values.push(require_oxc.getStringLiteralValue(initializer));
619
+ else if (initializer && initializer.type === "JSXExpressionContainer") {
620
+ const expression = initializer.expression;
621
+ if (expression && expression.type !== "JSXEmptyExpression") values.push(...require_expressions.extractStringLiterals(expression, source));
637
622
  }
638
623
  if (values.length === 0) return;
639
624
  const existing = propsMap.get(propName) ?? /* @__PURE__ */ new Set();