styled-components-to-stylex-codemod 0.0.37 → 0.0.39

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.
@@ -104,6 +104,21 @@ function isPrettierIgnoreComment(body) {
104
104
  return /^\s*prettier-ignore\s*$/.test(body);
105
105
  }
106
106
  /**
107
+ * Returns true if a comment body is only a visual marker for a styles section.
108
+ * These markers describe the old styled-components grouping, not emitted StyleX code.
109
+ */
110
+ function isStyleSectionMarkerComment(body) {
111
+ const marker = body.trim().replace(/^[-\s]+/, "").replace(/[-\s]+$/, "").trim().toLowerCase();
112
+ return /^(?:styled\s*-?\s*components?|styles?)$/.test(marker);
113
+ }
114
+ function getCommentBody(comment) {
115
+ const c = comment && typeof comment === "object" ? comment : {};
116
+ return typeof c.value === "string" ? c.value : "";
117
+ }
118
+ function isJSDocBlockComment(comment) {
119
+ return (comment && typeof comment === "object" ? comment : {}).type === "CommentBlock" && getCommentBody(comment).trimStart().startsWith("*");
120
+ }
121
+ /**
107
122
  * Normalizes whitespace in a CSS value string.
108
123
  * Collapses all sequences of whitespace (including newlines) to single spaces
109
124
  * and trims leading/trailing whitespace.
@@ -125,4 +140,4 @@ function hasTopLevelMatch(value, pattern) {
125
140
  return false;
126
141
  }
127
142
  //#endregion
128
- export { isPrettierIgnoreComment as a, kebabToCamelCase as c, normalizeWhitespace as d, sanitizeIdentifier as f, isBackgroundImageValue as i, looksLikeLength as l, capitalize as n, isSingleBackgroundComponent as o, escapeRegex as r, isValidIdentifierName as s, camelToKebabCase as t, lowerFirst as u };
143
+ export { isBackgroundImageValue as a, isSingleBackgroundComponent as c, kebabToCamelCase as d, looksLikeLength as f, sanitizeIdentifier as h, getCommentBody as i, isStyleSectionMarkerComment as l, normalizeWhitespace as m, capitalize as n, isJSDocBlockComment as o, lowerFirst as p, escapeRegex as r, isPrettierIgnoreComment as s, camelToKebabCase as t, isValidIdentifierName as u };
@@ -39,6 +39,12 @@ type CssVariableResolveContext = {
39
39
  name: string;
40
40
  fallback?: string;
41
41
  definedValue?: string;
42
+ /**
43
+ * CSS property being set (when available).
44
+ * Useful for adapters that need to resolve CSS-variable-backed tokens to
45
+ * assignable literals for properties typed as literal unions (e.g. "cursor").
46
+ */
47
+ cssProperty?: string;
42
48
  /**
43
49
  * Absolute path of the file currently being transformed.
44
50
  * Useful for adapter logic that wants to branch by caller file.
@@ -215,6 +221,15 @@ type ResolveValueResult = {
215
221
  * Meaningful for `{ kind: "importedValue" }` and `{ kind: "theme" }` with `indexedLookup`.
216
222
  */
217
223
  usage?: "props";
224
+ /**
225
+ * Optional raw CSS text for imported values that resolve to StyleX style objects.
226
+ *
227
+ * When provided alongside `usage: "props"`, the codemod can expand the CSS
228
+ * declarations under nested selectors such as `:focus-visible`. Without this,
229
+ * imported StyleX object values are treated as opaque and are only safe at the
230
+ * base selector.
231
+ */
232
+ cssText?: string;
218
233
  /**
219
234
  * When `usage` is `"props"` and the resolved expression should be indexed with a
220
235
  * dynamic prop value (e.g., `$colorMixins.backgroundColor[propValue]`):
@@ -398,10 +413,11 @@ interface ResolveBaseComponentResult {
398
413
  * Context for `adapter.resolveSelector(...)`.
399
414
  *
400
415
  * This handles patterns like `${screenSize.phone} { ... }` where an imported
401
- * value is used as a CSS selector (typically a media query helper).
416
+ * value is used as a CSS selector (typically a media query helper), and
417
+ * `@media (min-width: ${breakpoint}px)` where an imported value is used inside
418
+ * a media query.
402
419
  */
403
- type SelectorResolveContext = {
404
- kind: "selectorInterpolation";
420
+ type BaseSelectorResolveContext = {
405
421
  /**
406
422
  * Imported name of the binding used in the interpolation.
407
423
  * Example: `import { screenSize } from "./lib"` -> importedName: "screenSize"
@@ -429,6 +445,35 @@ type SelectorResolveContext = {
429
445
  column: number;
430
446
  };
431
447
  };
448
+ type SelectorResolveContext = (BaseSelectorResolveContext & {
449
+ kind: "selectorInterpolation";
450
+ }) | (BaseSelectorResolveContext & {
451
+ kind: "mediaQueryInterpolation";
452
+ /**
453
+ * Context for an interpolation inside an at-rule such as
454
+ * `@media (min-width: ${breakpoint}px)`.
455
+ */
456
+ mediaQuery: {
457
+ /**
458
+ * Full at-rule text with interpolation slots preserved as
459
+ * `__SC_EXPR_N__` placeholders.
460
+ * Example: `@media (min-width: __SC_EXPR_0__px)`.
461
+ */
462
+ atRule: string; /** Placeholder slot id for this interpolation. */
463
+ slotId: number; /** Static at-rule text before the interpolation placeholder. */
464
+ before: string; /** Static at-rule text after the interpolation placeholder. */
465
+ after: string;
466
+ /**
467
+ * Parsed media feature for common range features like
468
+ * `(min-width: ${value}px)` and `(max-width: ${value}px)`.
469
+ */
470
+ feature?: {
471
+ modifier?: "min" | "max";
472
+ name: string;
473
+ unit?: string;
474
+ };
475
+ };
476
+ });
432
477
  /**
433
478
  * Result for `adapter.resolveSelector(...)`.
434
479
  *
@@ -610,7 +655,8 @@ interface Adapter {
610
655
  * - `{ directional: [...] }` for shorthand properties (e.g., `padding`) whose token
611
656
  * resolves to a multi-value string. Each entry specifies a longhand property and expression.
612
657
  * - Optionally return `{ dropDefinition: true }` for css variables to remove the local `--x: ...` definition.
613
- * - `undefined` to bail/skip the file (for cssVariable: keeps the original `var(...)` unchanged)
658
+ * - `undefined` to bail/skip the file (for cssVariable: keeps the original
659
+ * custom property declaration or `var(...)` unchanged)
614
660
  */
615
661
  resolveValue: (context: ResolveValueContext) => ResolveValueResult | ResolveValueDirectionalResult | undefined;
616
662
  /**
@@ -632,10 +678,13 @@ interface Adapter {
632
678
  */
633
679
  resolveCall: (context: CallResolveContext) => CallResolveResult | undefined;
634
680
  /**
635
- * Resolver for interpolations used in selector position.
681
+ * Resolver for interpolations used in selector position and media query
682
+ * placeholders.
636
683
  *
637
684
  * This handles patterns like `${screenSize.phone} { ... }` where an imported
638
- * value is used as a CSS selector (typically a media query helper), and
685
+ * value is used as a CSS selector (typically a media query helper),
686
+ * `@media (min-width: ${breakpoint}px)` where an imported value is used inside
687
+ * a media query, and
639
688
  * `&:${highlight}` where an imported value picks a pseudo-class.
640
689
  *
641
690
  * Return:
@@ -838,6 +887,8 @@ interface AdapterInput {
838
887
  * // - { kind: "media", expr, imports } for media queries (e.g., breakpoints.phone)
839
888
  * // - { kind: "pseudoAlias", values, styleSelectorExpr?, imports? } for pseudo-class expansion
840
889
  * // - undefined to bail/skip the file
890
+ * // For @media placeholders, check ctx.kind === "mediaQueryInterpolation" and
891
+ * // use ctx.mediaQuery.feature to choose the correct defineConsts media key.
841
892
  * void ctx;
842
893
  * },
843
894
  *
@@ -870,7 +921,7 @@ declare function defineAdapter<T extends AdapterInput>(adapter: T): T;
870
921
  //#endregion
871
922
  //#region src/internal/logger.d.ts
872
923
  type Severity = "info" | "warning" | "error";
873
- type WarningType = "`css` helper function switch must return css templates in all branches" | "`css` helper usage as a function call (css(...)) is not supported" | "`css` helper used outside of a styled component template cannot be statically transformed" | "Adapter helper call in border interpolation did not resolve to a single CSS value" | "Adapter resolveCall returned an unparseable styles expression" | "Adapter resolveCall returned an unparseable value expression" | "Adapter resolveCall returned StyleX styles for helper call where a CSS value was expected" | "Adapter resolveCall returned undefined for helper call" | "Adapter resolveBaseComponent threw an error" | "Adapter resolved StyleX styles cannot be applied under nested selectors/at-rules" | "Adapter resolved StyleX styles inside pseudo selector but did not provide cssText for property expansion — add cssText to resolveCall result to enable pseudo-wrapping" | 'Adapter resolveCall cssText could not be parsed as CSS declarations — expected semicolon-separated property: value pairs (e.g. "white-space: nowrap; overflow: hidden;")' | "Adapter resolveValue returned an unparseable value expression" | "Adapter resolveValue returned undefined for imported value" | "Arrow function: body is not a recognized pattern (expected ternary, logical, call, or member expression)" | "Arrow function: conditional branches could not be resolved to static or theme values" | "Arrow function: helper call body is not supported" | "Arrow function: indexed theme lookup pattern not matched" | "Arrow function: logical expression pattern not supported" | "Arrow function: prop access cannot be converted to style function for this CSS property" | "Arrow function: theme access path could not be resolved" | "Component selectors like `${OtherComponent}:hover &` are not directly representable in StyleX. Manual refactor is required" | "Conditional `css` block: !important is not supported in StyleX" | "Conditional `css` block: @-rules (e.g., @media, @supports) are not supported" | "CSS block contains unsupported at-rule (only @media and @container are supported; @supports, etc. require manual handling)" | "Conditional `css` block: dynamic interpolation could not be resolved to a single component prop" | "Conditional `css` block: failed to parse expression" | "Conditional `css` block: missing CSS property name" | "Conditional `css` block: missing interpolation expression" | "Conditional `css` block: mixed static/dynamic values with non-theme expressions cannot be safely transformed" | "Conditional `css` block: multiple interpolation slots in a single property value" | "Conditional `css` block: ternary branch value could not be resolved (imported values require adapter support)" | "Conditional `css` block: ternary expressions inside pseudo selectors are not supported" | "Conditional `css` block: media query interpolation must be a simple imported reference (expressions like `value + 1` are not supported)" | "Conditional `css` block: unsupported selector" | "Directional border helper styles are not supported" | "Multi-slot border interpolation could not be resolved" | "Resolved border helper value could not be expanded to longhand properties" | "Resolved conditional border variant could not be expanded to longhand properties" | "createGlobalStyle is not supported in StyleX. Global styles should be handled separately (e.g., in a CSS file or using CSS reset libraries)" | "Failed to parse theme expressions" | "Heterogeneous background values (mix of gradients and colors) not currently supported" | "Higher-order styled factory wrappers (e.g. hoc(styled)) are not supported" | "Imported CSS helper mixins: cannot determine inherited properties for correct pseudo selector handling" | "Local helper function returns CSS that cannot be decomposed into individual properties" | "Local helper function computes CSS values that cannot be statically traced to the component prop" | "Unsupported background shorthand: multiple components cannot be mapped to a single StyleX longhand" | "Styled-components specificity hacks like `&&` / `&&&` are not representable in StyleX" | "Theme-dependent block-level conditional could not be fully resolved (branches may contain dynamic interpolations)" | "Theme-dependant call expression could not be resolved (e.g. theme helper calls like theme.highlight() are not supported)" | "Theme value with fallback (props.theme.X ?? / || default) cannot be resolved statically — use adapter.resolveValue to map theme paths to StyleX tokens" | "Theme-dependent nested prop access requires a project-specific theme source (e.g. useTheme())" | "Theme-dependent template literals require a project-specific theme source (e.g. useTheme())" | "Theme prop overrides on styled components are not supported" | "Universal selectors (`*`) are currently unsupported" | "Unsupported call expression (expected imported helper(...) or imported helper(...)(...))" | "Unsupported conditional test in shouldForwardProp" | "Unsupported shouldForwardProp pattern (only !prop.startsWith(), ![].includes(prop), and prop !== are supported)" | "Unsupported interpolation: arrow function" | "Unsupported interpolation: call expression" | "Unsupported interpolation: identifier" | "Unsupported interpolation: member expression" | "Unsupported interpolation: property" | "Unsupported interpolation: unknown" | "Unsupported nested conditional interpolation" | "Unsupported prop-based inline style expression cannot be safely inlined" | "Unsupported prop-based inline style props.theme access is not supported" | "Unsupported selector interpolation: imported value in selector position" | "Unsupported: media query interpolation must be a simple imported reference (expressions like `value + 1` are not supported)" | "Unsupported selector: class selector" | "Unsupported selector: comma-separated selectors must all be simple pseudos or pseudo-elements" | "Unsupported selector: descendant pseudo selector (space before pseudo)" | "Unsupported selector: adjacent sibling combinator" | "Unsupported selector: descendant/child/sibling selector" | "Unsupported selector: interpolated pseudo selector" | "Unsupported selector: sibling combinator" | "Unsupported selector: unresolved interpolation in sibling selector" | "Unsupported selector: ambiguous element selector" | "Unsupported selector: attribute selector on unsupported element" | "Unsupported selector: element selector on exported component" | "Unsupported selector: element selector with combined ancestor and child pseudos" | "Unsupported selector: element selector with dynamic children" | "Unsupported selector: element selector with plain intrinsic children" | "Unsupported selector: element selector pseudo collision" | "Unsupported selector: cross-file component selector target has no JSX usage in this file" | "Unsupported selector: unresolved interpolation in cross-file component selector" | "Unsupported selector: unresolved interpolation in descendant component selector" | "Unsupported selector: unresolved interpolation in element selector" | "Unsupported selector: unresolved interpolation in reverse component selector" | "Unsupported selector: unresolved interpolation in cross-component sibling selector" | "Unsupported selector: grouped reverse selector references different components" | "Unsupported selector: computed media query inside ancestor attribute selector" | "Unsupported selector: computed media query inside cross-component sibling selector" | "Unsupported selector: computed media query inside sibling selector" | "Unsupported selector: computed media query inside :has() component selector" | "Unsupported selector: cross-file :has() component selector not yet supported" | "Unsupported selector: unresolved interpolation in :has() component selector" | "Unsupported selector: unknown component selector" | "Unsupported css`` mixin: after-base mixin style is not a plain object" | "Unsupported css`` mixin: nested contextual conditions in after-base mixin" | "Unsupported css`` mixin: cannot infer base default for after-base contextual override (base value is non-literal)" | "css`` helper function interpolation references closure variable that cannot be hoisted" | "Using styled-components components as mixins is not supported; use css`` mixins or strings instead" | "styled(ImportedComponent) wraps a component whose file uses styled-components — convert the base component's file first to avoid CSS cascade conflicts" | "Partial transform would have a StyleX leaf wrap a styled-components base — the extending component was transformed but its base was not, so the leaf's StyleX overrides cannot reliably beat the base's styled-components styles" | "Transient $-prefixed props renamed on exported component — update consumer call sites to use the new prop names" | "Shorthand property has an opaque value that StyleX will expand to longhands — use `directional` in resolveValue to return separate longhand tokens" | "animation shorthand contains a var() with no classifiable fallback — its longhand position cannot be determined statically; bind the variable to a specific longhand (e.g. animation-duration: var(--x)) instead";
924
+ type WarningType = "`css` helper function switch must return css templates in all branches" | "`css` helper usage as a function call (css(...)) is not supported" | "`css` helper used outside of a styled component template cannot be statically transformed" | "Adapter helper call in border interpolation did not resolve to a single CSS value" | "Adapter resolveCall returned an unparseable styles expression" | "Adapter resolveCall returned an unparseable value expression" | "Adapter resolveCall returned StyleX styles for helper call where a CSS value was expected" | "Adapter resolveCall returned undefined for helper call" | "Adapter resolveBaseComponent threw an error" | "Adapter resolved StyleX styles cannot be applied under nested selectors/at-rules" | "Adapter resolved StyleX styles inside pseudo selector but did not provide cssText for property expansion — add cssText to resolveCall result to enable pseudo-wrapping" | 'Adapter resolveCall cssText could not be parsed as CSS declarations — expected semicolon-separated property: value pairs (e.g. "white-space: nowrap; overflow: hidden;")' | "Adapter resolveValue returned an unparseable value expression" | "Adapter resolveValue returned undefined for imported value" | "Arrow function: body is not a recognized pattern (expected ternary, logical, call, or member expression)" | "Arrow function: conditional branches could not be resolved to static or theme values" | "Arrow function: helper call body is not supported" | "Arrow function: indexed theme lookup pattern not matched" | "Arrow function: logical expression pattern not supported" | "Arrow function: prop access cannot be converted to style function for this CSS property" | "Arrow function: theme access path could not be resolved" | "Component selectors like `${OtherComponent}:hover &` are not directly representable in StyleX. Manual refactor is required" | "Conditional `css` block: !important is not supported in StyleX" | "Conditional `css` block: @-rules (e.g., @media, @supports) are not supported" | "CSS block contains unsupported at-rule (only @media and @container are supported; @supports, etc. require manual handling)" | "Conditional `css` block: dynamic interpolation could not be resolved to a single component prop" | "Conditional `css` block: failed to parse expression" | "Conditional `css` block: missing CSS property name" | "Conditional `css` block: missing interpolation expression" | "Conditional `css` block: mixed static/dynamic values with non-theme expressions cannot be safely transformed" | "Conditional `css` block: multiple interpolation slots in a single property value" | "Conditional `css` block: ternary branch value could not be resolved (imported values require adapter support)" | "Conditional `css` block: ternary expressions inside pseudo selectors are not supported" | "Conditional `css` block: media query interpolation must be a simple imported reference (expressions like `value + 1` are not supported)" | "Conditional `css` block: unsupported selector" | "Directional border helper styles are not supported" | "Multi-slot border interpolation could not be resolved" | "Resolved border helper value could not be expanded to longhand properties" | "Resolved conditional border variant could not be expanded to longhand properties" | "createGlobalStyle is not supported in StyleX. Global styles should be handled separately (e.g., in a CSS file or using CSS reset libraries)" | "Failed to parse theme expressions" | "Heterogeneous background values (mix of gradients and colors) not currently supported" | "Higher-order styled factory wrappers (e.g. hoc(styled)) are not supported" | "Imported CSS helper mixins: cannot determine inherited properties for correct pseudo selector handling" | "Local helper function returns CSS that cannot be decomposed into individual properties" | "Local helper function computes CSS values that cannot be statically traced to the component prop" | "Unsupported background shorthand: multiple components cannot be mapped to a single StyleX longhand" | "Styled-components specificity hacks like `&&` / `&&&` are not representable in StyleX" | "Theme-dependent block-level conditional could not be fully resolved (branches may contain dynamic interpolations)" | "Theme-dependant call expression could not be resolved (e.g. theme helper calls like theme.highlight() are not supported)" | "Theme value with fallback (props.theme.X ?? / || default) cannot be resolved statically — use adapter.resolveValue to map theme paths to StyleX tokens" | "Theme-dependent nested prop access requires a project-specific theme source (e.g. useTheme())" | "Theme-dependent template literals require a project-specific theme source (e.g. useTheme())" | "Theme prop overrides on styled components are not supported" | "Universal selectors (`*`) are currently unsupported" | "Unsupported call expression (expected imported helper(...) or imported helper(...)(...))" | "Unsupported conditional test in shouldForwardProp" | "Unsupported shouldForwardProp pattern (only !prop.startsWith(), ![].includes(prop), and prop !== are supported)" | "Unsupported interpolation: arrow function" | "Unsupported interpolation: call expression" | "Unsupported interpolation: identifier" | "Unsupported interpolation: member expression" | "Unsupported interpolation: property" | "Unsupported interpolation: unknown" | "Unsupported nested conditional interpolation" | "Unsupported prop-based inline style expression cannot be safely inlined" | "Unsupported prop-based inline style props.theme access is not supported" | "Unsupported selector interpolation: imported value in selector position" | "Unsupported: media query interpolation must be a simple imported reference (expressions like `value + 1` are not supported)" | "Unsupported selector: class selector" | "Unsupported selector: comma-separated selectors must all be simple pseudos or pseudo-elements" | "Unsupported selector: descendant pseudo selector (space before pseudo)" | "Unsupported selector: adjacent sibling combinator" | "Unsupported selector: descendant/child/sibling selector" | "Unsupported selector: conditional css block inside pseudo-element selector" | "Unsupported selector: interpolated pseudo selector" | "Unsupported selector: pseudo-class on pseudo-element selector" | "Unsupported selector: unsupported pseudo-element" | "Unsupported selector: sibling combinator" | "Unsupported selector: unresolved interpolation in sibling selector" | "Unsupported selector: ambiguous element selector" | "Unsupported selector: attribute selector on unsupported element" | "Unsupported selector: element selector on exported component" | "Unsupported selector: element selector with combined ancestor and child pseudos" | "Unsupported selector: element selector with dynamic children" | "Unsupported selector: element selector with plain intrinsic children" | "Unsupported selector: element selector pseudo collision" | "Unsupported selector: cross-file component selector target has no JSX usage in this file" | "Unsupported selector: unresolved interpolation in cross-file component selector" | "Unsupported selector: unresolved interpolation in descendant component selector" | "Unsupported selector: unresolved interpolation in element selector" | "Unsupported selector: unresolved interpolation in reverse component selector" | "Unsupported selector: unresolved interpolation in cross-component sibling selector" | "Unsupported selector: grouped reverse selector references different components" | "Unsupported selector: computed media query inside ancestor attribute selector" | "Unsupported selector: computed media query inside cross-component sibling selector" | "Unsupported selector: computed media query inside sibling selector" | "Unsupported selector: computed media query inside :has() component selector" | "Unsupported selector: cross-file :has() component selector not yet supported" | "Unsupported selector: unresolved interpolation in :has() component selector" | "Unsupported selector: unknown component selector" | "Unsupported selector: component selector with child pseudo" | "Unsupported selector: component selector target has no patchable JSX usage under selector parent" | "Unsupported selector: compound pseudo selector" | "Unsupported css`` mixin: after-base mixin style is not a plain object" | "Unsupported css`` mixin: nested contextual conditions in after-base mixin" | "Unsupported css`` mixin: cannot infer base default for after-base contextual override (base value is non-literal)" | "css`` helper function interpolation references closure variable that cannot be hoisted" | "Using styled-components components as mixins is not supported; use css`` mixins or strings instead" | "styled(ImportedComponent) wraps a component whose file uses styled-components — convert the base component's file first to avoid CSS cascade conflicts" | "Partial transform would have a StyleX leaf wrap a styled-components base — the extending component was transformed but its base was not, so the leaf's StyleX overrides cannot reliably beat the base's styled-components styles" | "Transient $-prefixed props renamed on exported component — update consumer call sites to use the new prop names" | "Shorthand property has an opaque value that StyleX will expand to longhands — use `directional` in resolveValue to return separate longhand tokens" | "animation shorthand contains a var() with no classifiable fallback — its longhand position cannot be determined statically; bind the variable to a specific longhand (e.g. animation-duration: var(--x)) instead";
874
925
  interface WarningLog {
875
926
  severity: Severity;
876
927
  type: WarningType;
@@ -891,6 +942,10 @@ interface SidecarFile {
891
942
  /** Absolute file path for writing. Undefined = default local sidecar next to the source file. */
892
943
  filePath?: string;
893
944
  }
945
+ interface LocalStylexVarsSidecarFile {
946
+ content: string;
947
+ importPath: string;
948
+ }
894
949
  /**
895
950
  * Result of the transform including any log entries
896
951
  */
@@ -904,6 +959,7 @@ interface TransformResult {
904
959
  bridgeResults?: BridgeComponentResult[];
905
960
  /** Transient prop renames for exported components, keyed by export name. */
906
961
  transientPropRenames?: TransientPropRenameResult[];
962
+ localStylexVarsSidecarFile?: LocalStylexVarsSidecarFile;
907
963
  }
908
964
  /** Describes a transient prop rename on an exported component for consumer patching. */
909
965
  interface TransientPropRenameResult {
@@ -973,6 +1029,8 @@ interface CrossFileInfo {
973
1029
  selectorUsages: CrossFileSelectorUsage[];
974
1030
  /** Component names in this file that need a global selector bridge className (consumer not transformed) */
975
1031
  bridgeComponentNames?: Set<string>;
1032
+ /** Styled component prop usage inventory from the prepass, keyed by local component name. */
1033
+ propUsageByComponent?: Map<string, ComponentPropUsageInfo>;
976
1034
  /** Global map: files that define styled-components → set of local names. Used for cascade conflict detection. */
977
1035
  styledDefFiles?: Map<string, Set<string>>;
978
1036
  /** Global leaf keys from prepass when leaves-only mode is enabled. */
@@ -994,5 +1052,18 @@ interface CrossFileSelectorUsage {
994
1052
  /** Local name of the actual component in the consumer file (for JSX matching) */
995
1053
  bridgeComponentLocalName?: string;
996
1054
  }
1055
+ type StaticPropValue = string | number | boolean;
1056
+ interface PropUsageValueInfo {
1057
+ values: StaticPropValue[];
1058
+ hasUnknown: boolean;
1059
+ usageCount: number;
1060
+ omittedCount: number;
1061
+ }
1062
+ interface ComponentPropUsageInfo {
1063
+ componentName: string;
1064
+ usageCount: number;
1065
+ hasUnknownUsage: boolean;
1066
+ props: Record<string, PropUsageValueInfo>;
1067
+ }
997
1068
  //#endregion
998
1069
  export { CollectedWarning as a, MarkerFileContext as c, TransformResult as i, defineAdapter as l, TransformMode as n, AdapterInput as o, TransformOptions as r, ImportSource as s, BridgeComponentResult as t };
@@ -1,4 +1,4 @@
1
- import { i as TransformResult, r as TransformOptions, t as BridgeComponentResult } from "./transform-types-CY57kiqK.mjs";
1
+ import { i as TransformResult, r as TransformOptions, t as BridgeComponentResult } from "./transform-types-DJpFQ5xm.mjs";
2
2
  import { API, FileInfo, Options } from "jscodeshift";
3
3
 
4
4
  //#region src/transform.d.ts