@yahoo/uds-create-config 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/AssetGroup.d.ts +77 -0
  2. package/dist/AssetGroup.js +125 -0
  3. package/dist/Component.d.ts +308 -0
  4. package/dist/Component.js +896 -0
  5. package/dist/ComponentGroup.d.ts +20 -0
  6. package/dist/ComponentGroup.js +46 -0
  7. package/dist/CompositeStyle.d.ts +27 -0
  8. package/dist/CompositeStyle.js +52 -0
  9. package/dist/Config.d.ts +423 -0
  10. package/dist/Config.js +1429 -0
  11. package/dist/Mode.d.ts +41 -0
  12. package/dist/Mode.js +81 -0
  13. package/dist/Modifier.d.ts +51 -0
  14. package/dist/Modifier.js +97 -0
  15. package/dist/MotionDef.d.ts +49 -0
  16. package/dist/MotionDef.js +97 -0
  17. package/dist/Props.d.ts +317 -0
  18. package/dist/Props.js +35 -0
  19. package/dist/Provider.d.ts +20 -0
  20. package/dist/Provider.js +14 -0
  21. package/dist/StyleProp.d.ts +112 -0
  22. package/dist/StyleProp.js +197 -0
  23. package/dist/Token.d.ts +55 -0
  24. package/dist/Token.js +112 -0
  25. package/dist/TokenGroup.d.ts +32 -0
  26. package/dist/TokenGroup.js +68 -0
  27. package/dist/asset-kind.d.ts +55 -0
  28. package/dist/asset-kind.js +29 -0
  29. package/dist/brands.d.ts +30 -0
  30. package/dist/brands.js +20 -0
  31. package/dist/captureCallerPath.d.ts +48 -0
  32. package/dist/captureCallerPath.js +95 -0
  33. package/dist/colorExpressions.d.ts +131 -0
  34. package/dist/colorExpressions.js +148 -0
  35. package/dist/defineAssetGroup.d.ts +166 -0
  36. package/dist/defineAssetGroup.js +264 -0
  37. package/dist/defineProvider.d.ts +29 -0
  38. package/dist/defineProvider.js +60 -0
  39. package/dist/element-marker.d.ts +54 -0
  40. package/dist/element-marker.js +113 -0
  41. package/dist/entity-utils.d.ts +56 -0
  42. package/dist/entity-utils.js +105 -0
  43. package/dist/factories.d.ts +707 -0
  44. package/dist/factories.js +393 -0
  45. package/dist/foreign-component-name.d.ts +21 -0
  46. package/dist/foreign-component-name.js +42 -0
  47. package/dist/index.d.ts +32 -0
  48. package/dist/index.js +28 -0
  49. package/dist/interpolate.d.ts +20 -0
  50. package/dist/interpolate.js +10 -0
  51. package/dist/jsx/__fixtures__/cross-component-preview.d.ts +3 -0
  52. package/dist/jsx/__fixtures__/cross-component-preview.js +15 -0
  53. package/dist/jsx/jsx-dev-runtime.d.ts +15 -0
  54. package/dist/jsx/jsx-dev-runtime.js +11 -0
  55. package/dist/jsx/jsx-runtime.d.ts +48 -0
  56. package/dist/jsx/jsx-runtime.js +305 -0
  57. package/dist/markers.d.ts +217 -0
  58. package/dist/markers.js +67 -0
  59. package/dist/refs.d.ts +158 -0
  60. package/dist/refs.js +104 -0
  61. package/dist/renderer/RendererErrorBoundary.d.ts +26 -0
  62. package/dist/renderer/RendererErrorBoundary.js +30 -0
  63. package/dist/renderer/UdsRenderer.d.ts +80 -0
  64. package/dist/renderer/UdsRenderer.js +33 -0
  65. package/dist/renderer/assetRenderable.d.ts +13 -0
  66. package/dist/renderer/assetRenderable.js +13 -0
  67. package/dist/renderer/index.d.ts +14 -0
  68. package/dist/renderer/index.js +14 -0
  69. package/dist/renderer/makeRegistry.d.ts +34 -0
  70. package/dist/renderer/makeRegistry.js +52 -0
  71. package/dist/renderer/makeUdsRenderer.d.ts +29 -0
  72. package/dist/renderer/makeUdsRenderer.js +35 -0
  73. package/dist/renderer/primitives/FragmentRenderer.d.ts +12 -0
  74. package/dist/renderer/primitives/FragmentRenderer.js +11 -0
  75. package/dist/renderer/primitives/SlotRenderer.d.ts +21 -0
  76. package/dist/renderer/primitives/SlotRenderer.js +20 -0
  77. package/dist/renderer/wrapRegistry.d.ts +64 -0
  78. package/dist/renderer/wrapRegistry.js +39 -0
  79. package/dist/renderer/wrappers/component-slots.d.ts +41 -0
  80. package/dist/renderer/wrappers/component-slots.js +66 -0
  81. package/dist/renderer/wrappers/event-bridge.d.ts +20 -0
  82. package/dist/renderer/wrappers/event-bridge.js +78 -0
  83. package/dist/renderer/wrappers/hex-normalize.d.ts +14 -0
  84. package/dist/renderer/wrappers/hex-normalize.js +35 -0
  85. package/dist/renderer/wrappers/html-aliases.d.ts +24 -0
  86. package/dist/renderer/wrappers/html-aliases.js +62 -0
  87. package/dist/renderer/wrappers/inline-styles.d.ts +16 -0
  88. package/dist/renderer/wrappers/inline-styles.js +104 -0
  89. package/dist/renderer/wrappers/slot-resolution.d.ts +25 -0
  90. package/dist/renderer/wrappers/slot-resolution.js +68 -0
  91. package/dist/renderer/wrappers/void-elements.d.ts +23 -0
  92. package/dist/renderer/wrappers/void-elements.js +28 -0
  93. package/dist/spec/apply-forced-modifiers.d.ts +19 -0
  94. package/dist/spec/apply-forced-modifiers.js +49 -0
  95. package/dist/spec/asset-jsx.d.ts +48 -0
  96. package/dist/spec/asset-jsx.js +48 -0
  97. package/dist/spec/collapse-text-labels.d.ts +44 -0
  98. package/dist/spec/collapse-text-labels.js +107 -0
  99. package/dist/spec/empty-node-slots.d.ts +51 -0
  100. package/dist/spec/empty-node-slots.js +141 -0
  101. package/dist/spec/index.d.ts +10 -0
  102. package/dist/spec/index.js +10 -0
  103. package/dist/spec/jsxToSpec.d.ts +48 -0
  104. package/dist/spec/jsxToSpec.js +506 -0
  105. package/dist/spec/layer-props.d.ts +52 -0
  106. package/dist/spec/layer-props.js +149 -0
  107. package/dist/spec/preview-controls.d.ts +44 -0
  108. package/dist/spec/preview-controls.js +139 -0
  109. package/dist/spec/slot-refs.d.ts +39 -0
  110. package/dist/spec/slot-refs.js +56 -0
  111. package/dist/spec/specToJsx.d.ts +35 -0
  112. package/dist/spec/specToJsx.js +127 -0
  113. package/dist/token-override-rows.d.ts +66 -0
  114. package/dist/token-override-rows.js +223 -0
  115. package/dist/tokenValueType.d.ts +34 -0
  116. package/dist/tokenValueType.js +138 -0
  117. package/dist/tsconfig.tsbuildinfo +1 -0
  118. package/dist/types/css-properties.d.ts +232 -0
  119. package/dist/types/css-properties.js +14 -0
  120. package/dist/types/css-property-keywords.d.ts +156 -0
  121. package/dist/types/css-property-keywords.js +616 -0
  122. package/dist/types/css-values.d.ts +63 -0
  123. package/dist/types/css-values.js +16 -0
  124. package/dist/types.d.ts +708 -0
  125. package/dist/types.js +12 -0
  126. package/dist/units.d.ts +14 -0
  127. package/dist/units.js +16 -0
  128. package/dist/utils/index.d.ts +4 -0
  129. package/dist/utils/index.js +4 -0
  130. package/package.json +81 -0
@@ -0,0 +1,77 @@
1
+ import { AssetKind } from "./asset-kind.js";
2
+ import { FontAssetMember, SerializedAssetGroup } from "./types.js";
3
+ import { IconAssetMember, IconAssetMetadata } from "./defineAssetGroup.js";
4
+
5
+ //#region src/AssetGroup.d.ts
6
+ declare class AssetGroup {
7
+ #private;
8
+ /** The slug — the `registerAssetGroups` record key. */
9
+ readonly name: string;
10
+ readonly label: string;
11
+ /** Source-library version shown in the Assets UI (e.g. `2.1.1`). */
12
+ readonly version?: string;
13
+ readonly description?: string;
14
+ readonly assetKind: AssetKind;
15
+ /** Member names — the `${assetName}` segment of each asset's id. */
16
+ readonly assetNames: readonly string[];
17
+ /** Icon class only — named size → px (picker options = keys). */
18
+ readonly sizes?: Readonly<Record<string, number>>;
19
+ /** Icon class only — group-level variant superset. */
20
+ readonly variants?: readonly string[];
21
+ /**
22
+ * Icon class only — the component that authors this group's members
23
+ * (`'Icon'`). One declaration covers both rendering and export: a placed
24
+ * member draws on the canvas by rendering through this component, and a
25
+ * placed asset node serializes to `<Icon name="Trophy" … />` and
26
+ * round-trips back. Absent for a component-less group, whose members
27
+ * render bare and export to the bare member tag.
28
+ */
29
+ readonly component?: string;
30
+ /**
31
+ * Live members keyed by asset name. Present when registered from
32
+ * code; absent on icon groups hydrated from JSON (the serialized
33
+ * icon form is a name list).
34
+ */
35
+ readonly members?: Readonly<Record<string, IconAssetMember | FontAssetMember>>;
36
+ /** Icon class only — per-member harvested `.metadata`. Not serialized (yet). */
37
+ readonly memberMetadata?: Readonly<Record<string, IconAssetMetadata>>;
38
+ constructor(args: {
39
+ name: string;
40
+ label: string;
41
+ version?: string;
42
+ description?: string;
43
+ assetKind: AssetKind;
44
+ assetNames: readonly string[];
45
+ sizes?: Readonly<Record<string, number>>;
46
+ variants?: readonly string[];
47
+ component?: string;
48
+ members?: Readonly<Record<string, IconAssetMember | FontAssetMember>>;
49
+ memberMetadata?: Readonly<Record<string, IconAssetMetadata>>;
50
+ /** Live getter so the namespace resolves correctly regardless of
51
+ * `configure({ namespace })` / registration ordering. */
52
+ namespaceGetter?: () => string | undefined;
53
+ });
54
+ /** The owning system's registry namespace at read time. */
55
+ get namespace(): string | undefined;
56
+ /**
57
+ * Per-asset identity — `${namespace}:asset:${slug}/${assetName}`
58
+ * (`uds:asset:icons/Trophy`). Mirrors `Component.registryKey`: an
59
+ * un-namespaced config produces the bare `asset:${slug}/${name}`
60
+ * form. This string is the spec `type` and the render-registry key;
61
+ * it must NEVER route through `Config.getComponent` (which splits on
62
+ * the first `:` and would silently miss) — resolution is
63
+ * registry-key lookup only.
64
+ */
65
+ assetType(assetName: string): string;
66
+ toJSON(): SerializedAssetGroup & {
67
+ name: string;
68
+ };
69
+ /**
70
+ * Rebuild from the wire format. Icon groups hydrate without live
71
+ * members (names only); font groups hydrate with their full records
72
+ * — they are the serialized form.
73
+ */
74
+ static fromJSON(name: string, json: SerializedAssetGroup, namespaceGetter?: () => string | undefined): AssetGroup;
75
+ }
76
+ //#endregion
77
+ export { AssetGroup };
@@ -0,0 +1,125 @@
1
+ import { compact } from "./entity-utils.js";
2
+ //#region src/AssetGroup.ts
3
+ var AssetGroup = class AssetGroup {
4
+ /** The slug — the `registerAssetGroups` record key. */
5
+ name;
6
+ label;
7
+ /** Source-library version shown in the Assets UI (e.g. `2.1.1`). */
8
+ version;
9
+ description;
10
+ assetKind;
11
+ /** Member names — the `${assetName}` segment of each asset's id. */
12
+ assetNames;
13
+ /** Icon class only — named size → px (picker options = keys). */
14
+ sizes;
15
+ /** Icon class only — group-level variant superset. */
16
+ variants;
17
+ /**
18
+ * Icon class only — the component that authors this group's members
19
+ * (`'Icon'`). One declaration covers both rendering and export: a placed
20
+ * member draws on the canvas by rendering through this component, and a
21
+ * placed asset node serializes to `<Icon name="Trophy" … />` and
22
+ * round-trips back. Absent for a component-less group, whose members
23
+ * render bare and export to the bare member tag.
24
+ */
25
+ component;
26
+ /**
27
+ * Live members keyed by asset name. Present when registered from
28
+ * code; absent on icon groups hydrated from JSON (the serialized
29
+ * icon form is a name list).
30
+ */
31
+ members;
32
+ /** Icon class only — per-member harvested `.metadata`. Not serialized (yet). */
33
+ memberMetadata;
34
+ #namespaceGetter;
35
+ constructor(args) {
36
+ this.name = args.name;
37
+ this.label = args.label;
38
+ this.version = args.version;
39
+ this.description = args.description;
40
+ this.assetKind = args.assetKind;
41
+ this.assetNames = args.assetNames;
42
+ this.sizes = args.sizes;
43
+ this.variants = args.variants;
44
+ this.component = args.component;
45
+ this.members = args.members;
46
+ this.memberMetadata = args.memberMetadata;
47
+ this.#namespaceGetter = args.namespaceGetter;
48
+ }
49
+ /** The owning system's registry namespace at read time. */
50
+ get namespace() {
51
+ return this.#namespaceGetter?.();
52
+ }
53
+ /**
54
+ * Per-asset identity — `${namespace}:asset:${slug}/${assetName}`
55
+ * (`uds:asset:icons/Trophy`). Mirrors `Component.registryKey`: an
56
+ * un-namespaced config produces the bare `asset:${slug}/${name}`
57
+ * form. This string is the spec `type` and the render-registry key;
58
+ * it must NEVER route through `Config.getComponent` (which splits on
59
+ * the first `:` and would silently miss) — resolution is
60
+ * registry-key lookup only.
61
+ */
62
+ assetType(assetName) {
63
+ const bare = `asset:${this.name}/${assetName}`;
64
+ const namespace = this.namespace;
65
+ return namespace === void 0 ? bare : `${namespace}:${bare}`;
66
+ }
67
+ toJSON() {
68
+ if (this.assetKind === "font") return {
69
+ name: this.name,
70
+ assetKind: "font",
71
+ label: this.label,
72
+ ...compact({
73
+ version: this.version,
74
+ description: this.description
75
+ }),
76
+ members: this.members ?? {}
77
+ };
78
+ return {
79
+ name: this.name,
80
+ assetKind: "icon",
81
+ label: this.label,
82
+ ...compact({
83
+ version: this.version,
84
+ description: this.description
85
+ }),
86
+ sizes: this.sizes ?? {},
87
+ variants: this.variants ?? [],
88
+ members: this.assetNames,
89
+ ...compact({ component: this.component }),
90
+ ...compact({ memberMetadata: this.memberMetadata && Object.keys(this.memberMetadata).length > 0 ? this.memberMetadata : void 0 })
91
+ };
92
+ }
93
+ /**
94
+ * Rebuild from the wire format. Icon groups hydrate without live
95
+ * members (names only); font groups hydrate with their full records
96
+ * — they are the serialized form.
97
+ */
98
+ static fromJSON(name, json, namespaceGetter) {
99
+ if (json.assetKind === "font") return new AssetGroup({
100
+ name,
101
+ label: json.label,
102
+ version: json.version,
103
+ description: json.description,
104
+ assetKind: "font",
105
+ assetNames: Object.keys(json.members),
106
+ members: json.members,
107
+ namespaceGetter
108
+ });
109
+ return new AssetGroup({
110
+ name,
111
+ label: json.label,
112
+ version: json.version,
113
+ description: json.description,
114
+ assetKind: "icon",
115
+ assetNames: json.members,
116
+ sizes: json.sizes,
117
+ variants: json.variants,
118
+ component: json.component,
119
+ memberMetadata: json.memberMetadata,
120
+ namespaceGetter
121
+ });
122
+ }
123
+ };
124
+ //#endregion
125
+ export { AssetGroup };
@@ -0,0 +1,308 @@
1
+ import { BaseStyles, ComponentDefinition, ComponentMetadata, ComponentMotionValue, CompoundPropsEntry, LayerInput, PreviewDefinition, PropBinding, SerializedComponent } from "./types.js";
2
+ import { SlotValueType } from "./markers.js";
3
+ import { ComponentClassNames } from "@yahoo/uds-create-utils";
4
+
5
+ //#region src/Component.d.ts
6
+ /**
7
+ * Terminal prop value kinds — what a JSX value actually resolves to at
8
+ * render time. Used both as the discriminant of non-slot `PropInfo`
9
+ * variants and as a slot's `valueType` after walking its forward chain
10
+ * to the terminal binding.
11
+ */
12
+ type PrimitivePropKind = 'string' | 'number' | 'boolean' | 'variant' | 'function';
13
+ /**
14
+ * Slot value kinds — primitives, `'ReactNode'` for children-style slots, and
15
+ * `'composite'` when the forward chain bottoms out at a `composite(...)` ref
16
+ * (so a slot forwarding to a layer's composite prop renders like one).
17
+ */
18
+ type SlotValueKind = PrimitivePropKind | 'ReactNode' | 'composite';
19
+ /** Discriminant for top-level prop bindings (the `kind` field of `PropInfo`). */
20
+ type PropKind = PrimitivePropKind | 'styleProp' | 'slot';
21
+ /**
22
+ * Authoring shape of a component — how it was built, which decides how to
23
+ * author a new one like it:
24
+ * - `primitive` — single layer, no `extendsFrom`, no render fn (`Box`).
25
+ * - `extends` — value-extends another component via `defineComponent(Parent)`
26
+ * (`extendsFrom` is set); inherits the parent's prop surface (`Text`).
27
+ * - `multi-layer` — composed from `.layers({...})` and/or a custom `.render`
28
+ * (more than one layer, or a render fn) (`StudioListItem`, `Accordion`).
29
+ */
30
+ type ComponentKind = 'primitive' | 'extends' | 'multi-layer';
31
+ /** Common fields every `PropInfo` variant carries. */
32
+ interface PropBase {
33
+ /** JSX prop name. */
34
+ name: string;
35
+ /** Authored marker had `.required()` (slot/variant markers only carry this). */
36
+ required: boolean;
37
+ }
38
+ /** Payload for `kind: 'variant'` props. */
39
+ interface VariantInfo {
40
+ /** Declared variant values in authored order. */
41
+ values: readonly (string | number | boolean)[];
42
+ }
43
+ /** Payload for `kind: 'styleProp'` props. */
44
+ interface StylePropInfo {
45
+ /** Style-prop registry key — `'bg'`, `'padding'`, etc. */
46
+ stylePropName: string;
47
+ }
48
+ /** Payload for `kind: 'function'` props. */
49
+ interface FunctionInfo {
50
+ /** Function is an event handler (forwards to an `on*` prop). */
51
+ isEventHandler: boolean;
52
+ }
53
+ /** Payload for `kind: 'composite'` props — bound via `composite('elevation')`. */
54
+ interface CompositeInfo {
55
+ /** Composite-style registry key — `'elevation'`, `'textVariant'`, etc. */
56
+ compositeName: string;
57
+ /** Target layer (defaults to `'root'`). */
58
+ layer?: string;
59
+ }
60
+ /**
61
+ * Payload for `kind: 'slot'` props. `layer` undefined ⇒ open slot
62
+ * (`slot()` with no path). `layerProp` defaults to `'children'` when
63
+ * only a layer name is given. `accepts` is inherited through the
64
+ * forward chain — outer `.accepts()` wins; otherwise the innermost
65
+ * descendant slot's accepts is adopted. `valueType` reports what the
66
+ * JSX value resolves to at render time after walking the forward chain
67
+ * to a non-slot binding.
68
+ *
69
+ * `authoredType` is the kind the author declared via `slot({ type })`
70
+ * (absent when undeclared). It records intent independent of resolution:
71
+ * `derived.acceptsChildNodes` keys on it (a `children` slot the author
72
+ * tagged `'string'` is a text label, not a node-drop target), and it holds
73
+ * even when the forward chain can't resolve `valueType` to a primitive.
74
+ * `valueType` itself now follows a `children` ref into its target and reports
75
+ * what that resolves to — a Text leaf's `'string'`, a node container's
76
+ * `'ReactNode'`. Codegen-emitted prop types come from the JSX markers, not
77
+ * `valueType`, so they never narrow.
78
+ */
79
+ interface SlotInfo {
80
+ layer?: string;
81
+ layerProp: string;
82
+ accepts?: readonly string[];
83
+ /**
84
+ * Slug of the placeable asset group this slot accepts (`slot().accepts(icons)`
85
+ * → `'icons'`), kept separate from the component-name `accepts` list so the
86
+ * designer panel can look the group up in `Config.assetGroups` and show its
87
+ * picker (an icon picker for icon-class groups) instead of the generic
88
+ * component picker. Absent for component-only slots. The config-load guard
89
+ * rejects non-placeable groups, so a slug here is always placeable.
90
+ */
91
+ acceptsAssetGroup?: string;
92
+ valueType: SlotValueKind;
93
+ authoredType?: SlotValueType;
94
+ /**
95
+ * Selectable values when the forward chain bottoms out at a `variant`
96
+ * binding (e.g. forwarding to an inner component's `variant` prop). Lets
97
+ * editing tools render the forwarded prop as a dropdown of the target's
98
+ * variant values instead of a bare string input. Absent for non-variant
99
+ * terminals.
100
+ */
101
+ valueOptions?: readonly (string | number | boolean)[];
102
+ /**
103
+ * Composite-style registry key when the forward chain bottoms out at a
104
+ * `composite(...)` ref (e.g. `slot('root/textVariant')` → an `Anchor` layer's
105
+ * `textVariant: composite('textVariant')`). Mirrors a directly-authored
106
+ * `kind: 'composite'` prop's `compositeName`, so editing tools render the
107
+ * same composite control (and the `textVariant` typography special-case)
108
+ * for the forwarded prop. Absent for non-composite terminals.
109
+ */
110
+ compositeName?: string;
111
+ }
112
+ type PropInfo = (PropBase & {
113
+ kind: 'variant';
114
+ } & VariantInfo) | (PropBase & {
115
+ kind: 'boolean';
116
+ }) | (PropBase & {
117
+ kind: 'string';
118
+ }) | (PropBase & {
119
+ kind: 'number';
120
+ }) | (PropBase & {
121
+ kind: 'styleProp';
122
+ } & StylePropInfo) | (PropBase & {
123
+ kind: 'composite';
124
+ } & CompositeInfo) | (PropBase & {
125
+ kind: 'function';
126
+ } & FunctionInfo) | (PropBase & {
127
+ kind: 'slot';
128
+ } & SlotInfo);
129
+ type ResolvedCompoundOverrides = Record<string, Record<string, unknown>>;
130
+ declare class Layer {
131
+ readonly name: string;
132
+ readonly tag?: LayerInput;
133
+ readonly base?: BaseStyles;
134
+ constructor(args: {
135
+ name: string;
136
+ tag?: LayerInput;
137
+ base?: BaseStyles;
138
+ });
139
+ /**
140
+ * What this layer renders, normalized across the tag's representations:
141
+ * - `{ kind: 'component', ref }` — renders a registered component (`Box`,
142
+ * `Text`), so the layer takes that component's prop surface. The identity
143
+ * survives both in memory (a non-enumerable `__componentName` stamp on the
144
+ * builder) and on the wire (`{ __kind: 'component', ref }` from `fromJSON`).
145
+ * - `{ kind: 'tag', ref }` — renders a bare HTML element (`'div'`).
146
+ * - `undefined` — an inline anonymous builder with no registered identity.
147
+ */
148
+ get renders(): {
149
+ kind: 'component' | 'tag';
150
+ ref: string;
151
+ } | undefined;
152
+ toJSON(): {
153
+ name: string;
154
+ tag?: LayerInput;
155
+ base?: BaseStyles;
156
+ };
157
+ }
158
+ declare class Component {
159
+ #private;
160
+ readonly name: string;
161
+ readonly layers: ReadonlyMap<string, Layer>;
162
+ readonly props: Readonly<Record<string, PropBinding>>;
163
+ readonly base?: BaseStyles;
164
+ readonly defaultProps?: Record<string, unknown>;
165
+ readonly compoundProps?: readonly CompoundPropsEntry[];
166
+ readonly motion?: ComponentMotionValue;
167
+ readonly preview?: PreviewDefinition;
168
+ readonly metadata?: ComponentMetadata;
169
+ /**
170
+ * Absolute path of the file that called `defineComponent('Name', …)`.
171
+ * Captured via the stack walk in `captureCallerPath` and stashed
172
+ * non-enumerably on the authored definition; lifted onto the class
173
+ * here so codegen consumers don't have to thread a separate
174
+ * `componentSourceMap`. `undefined` when the component was hydrated
175
+ * from JSON (no original define call) or built outside the `define*`
176
+ * helpers.
177
+ */
178
+ readonly sourceFilePath?: string;
179
+ /**
180
+ * `true` when the authored definition chained `.render(fn)` — the
181
+ * non-enumerable `__hasRenderFn` flag set by the builder. Codegen
182
+ * needs this to classify single-layer components that ship a custom
183
+ * render fn (e.g. Accordion) into the transform path rather than
184
+ * the inline primitive emitter, so the two paths don't both emit a
185
+ * wrapper FC with the same name.
186
+ */
187
+ readonly hasRenderFn: boolean;
188
+ /**
189
+ * The actual `.render(fn)` callback when `hasRenderFn` is `true`.
190
+ * Lifted from the seed's non-enumerable `__renderFn` so the spec
191
+ * extractor can invoke it under the mock-react plugin to capture
192
+ * the component's internal structure as a Spec. Not used at
193
+ * production render time — the codegen-emitted per-file FC handles
194
+ * that path.
195
+ */
196
+ readonly renderFn?: unknown;
197
+ /**
198
+ * Name of the component this one value-extends from
199
+ * (`defineComponent(Box)` → `'Box'`). Resolved from the non-
200
+ * enumerable `__extendsFrom.__componentName` chain stamped by
201
+ * `defineComponent`'s value-extend branch and `Config.registerComponents`'
202
+ * registration loop. `undefined` for primitives, brace-ref shorthand
203
+ * forms, and JSON-hydrated configs (the wire format doesn't carry
204
+ * this relationship).
205
+ */
206
+ readonly extendsFrom?: string;
207
+ /**
208
+ * Globally-unique lookup key — the spec `type` string a renderer
209
+ * resolves against the registry. When the owning `Config` has a
210
+ * namespace set (`Config.configure({ namespace: 'uds' })`), this is
211
+ * `<namespace>:<name>` (`uds:Badge`); otherwise it's the bare `name`
212
+ * (un-namespaced configs). Read live via a getter so it reflects the
213
+ * namespace regardless of whether `configure` ran before or after the
214
+ * component was registered — mirrors the lazy `prefixGetter` pattern
215
+ * used for token CSS vars.
216
+ *
217
+ * `name` stays the bare authored/display/export identifier; codegen
218
+ * emits a bare-name alias alongside the canonical key so existing
219
+ * specs referencing the bare `name` keep resolving.
220
+ */
221
+ get registryKey(): string;
222
+ constructor(args: {
223
+ name: string;
224
+ definition: ComponentDefinition;
225
+ componentGroup?: string;
226
+ subcomponentOf?: string;
227
+ subcomponents?: readonly string[];
228
+ /** Live getter for the owning Config's namespace — keeps
229
+ * `registryKey` correct regardless of chain-method ordering. */
230
+ namespaceGetter?: () => string | undefined;
231
+ /** Live getter for the owning Config's class-name prefix — feeds
232
+ * `derived.classNames` so emitted CSS selectors + generated TSX
233
+ * classNames share the config's namespace. Read lazily so it
234
+ * reflects `configure({ prefix })` regardless of chain ordering. */
235
+ prefixGetter?: () => string;
236
+ /** Resolves a registered component by name against the owning Config.
237
+ * Lets a slot's forward chain follow a layer that renders another
238
+ * registered component (`{ __kind: 'component', ref }`) into that
239
+ * component's prop surface — without it, the chain can't see the
240
+ * inner props (e.g. after a `fromJSON` round-trip, where layer tags
241
+ * are component refs) and falls back to a `string` value type. */
242
+ componentResolver?: (ref: string) => Component | undefined;
243
+ /** Resolves a `(styleProp, value)` shorthand to a qualified token name
244
+ * (`bg`, `'tertiary'` → `'bg/tertiary'`) against the owning Config's
245
+ * style-prop registry + token groups, or `undefined` when the value
246
+ * isn't a token of one of that prop's groups (a keyword or arbitrary
247
+ * literal). Lets `derived.tokenRefs` capture shorthand token usage
248
+ * structurally — the component knows its style props, but the
249
+ * prop→token-group link lives on the registry. */
250
+ resolveStylePropValueToken?: (styleProp: string, value: string) => string | undefined;
251
+ /** Whether a style key names a registered style prop — gates
252
+ * `derived.stylePropKeywords` so layer keys and marker internals don't
253
+ * read as style-prop keyword values. */
254
+ isStyleProp?: (name: string) => boolean;
255
+ });
256
+ get derived(): {
257
+ readonly layers: readonly Layer[];
258
+ readonly classNames: ComponentClassNames;
259
+ readonly compoundOverrides: ResolvedCompoundOverrides;
260
+ readonly componentGroup?: string;
261
+ readonly subcomponentOf?: string;
262
+ readonly subcomponents?: readonly string[];
263
+ readonly props: readonly PropInfo[];
264
+ readonly stylePropNames: readonly string[];
265
+ /** Qualified token names (`bg/tertiary`, `color/brand`) this component
266
+ * references anywhere in its styling — base, variant styles, and
267
+ * compound overrides, recursing modifier sub-objects and color
268
+ * expressions. Both structured `token(...)` refs and shorthand
269
+ * style-prop values (`bg: 'tertiary'`) are captured, resolved through
270
+ * the registry, so the edge is structural — no CSS-var/string matching.
271
+ * The reverse direction is `Config.getTokenDependents`. */
272
+ readonly tokenRefs: readonly string[];
273
+ /** `(styleProp, token)` pairs — which style prop a referenced token sits
274
+ * under (`bg` → `color/brand`, including refs nested in a color
275
+ * expression). The "actually used with a value from this group" edge that
276
+ * `Config.getTokenGroupUsage` reads, distinct from the registry "allowed
277
+ * in" relation (`getTokenGroupDependents`). */
278
+ readonly stylePropTokenUsages: readonly StylePropTokenUsage[];
279
+ /** The non-token keyword values this component uses (`display`/`flex`,
280
+ * `flexDirection`/`col`) — disjoint from `tokenRefs`, excluding arbitrary
281
+ * bracket literals. Tracks keyword removal-impact; the reverse direction
282
+ * is `dependentsOf({ kind: 'styleProp', name, value })`. */
283
+ readonly stylePropKeywords: readonly StylePropKeyword[];
284
+ readonly kind: ComponentKind;
285
+ readonly acceptsChildren: boolean;
286
+ readonly acceptsChildNodes: boolean;
287
+ prop(propName: string): PropInfo | undefined;
288
+ };
289
+ toJSON(opts?: {
290
+ projectRoot?: string;
291
+ }): SerializedComponent & {
292
+ name: string;
293
+ };
294
+ }
295
+ /** Which style prop a referenced token sits under — `{ styleProp: 'bg',
296
+ * token: 'color/brand' }`. See `Component.derived.stylePropTokenUsages`. */
297
+ interface StylePropTokenUsage {
298
+ readonly styleProp: string;
299
+ readonly token: string;
300
+ }
301
+ /** A non-token keyword value a style prop carries — `{ styleProp: 'display',
302
+ * value: 'flex' }`. See `Component.derived.stylePropKeywords`. */
303
+ interface StylePropKeyword {
304
+ readonly styleProp: string;
305
+ readonly value: string;
306
+ }
307
+ //#endregion
308
+ export { Component, ComponentKind, CompositeInfo, FunctionInfo, Layer, PrimitivePropKind, PropBase, PropInfo, PropKind, ResolvedCompoundOverrides, SlotInfo, SlotValueKind, StylePropInfo, StylePropKeyword, StylePropTokenUsage, VariantInfo };