@yahoo/uds-v5-wip 1.53.0 → 1.55.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 (43) hide show
  1. package/dist/config/dist/Props.d.ts +0 -5
  2. package/dist/config/dist/component-config.d.ts +79 -42
  3. package/dist/config/dist/component-refs.d.ts +0 -13
  4. package/dist/config/dist/component-resolution.d.ts +1 -1
  5. package/dist/config/dist/consts/defaultColors.d.ts +1 -2
  6. package/dist/config/dist/createComponent.js +1 -1
  7. package/dist/config/dist/createConfig.d.ts +0 -12
  8. package/dist/config/dist/createConfig.js +11 -3
  9. package/dist/config/dist/defineComponent.d.ts +0 -7
  10. package/dist/config/dist/defineStyleProp.d.ts +1 -31
  11. package/dist/config/dist/index.d.ts +2 -2
  12. package/dist/config/dist/index.js +0 -1
  13. package/dist/config/dist/refs.js +16 -8
  14. package/dist/config/dist/resolveStyleProp.d.ts +0 -7
  15. package/dist/config/dist/serialize.d.ts +1 -2
  16. package/dist/config/dist/style-prop-runtime.d.ts +1 -0
  17. package/dist/config/dist/types/css-values.d.ts +1 -2
  18. package/dist/config/dist/types.d.ts +1 -2
  19. package/dist/config.d.ts +185 -185
  20. package/dist/core/dist/createComponent.js +1 -1
  21. package/dist/core/dist/getStyles.js +1 -1
  22. package/dist/foundational-presets/dist/defaultPreset.d.ts +186 -185
  23. package/dist/foundational-presets/dist/motion.d.ts +2 -1
  24. package/dist/loader/dist/packages/core/dist/getStyles.js +1 -1
  25. package/dist/remotion/dist/components/image-slide.d.ts +2 -1
  26. package/dist/remotion/dist/components/image-slide.js +3 -3
  27. package/dist/remotion/dist/components/index.js +7 -7
  28. package/dist/remotion/dist/components/lower-third.d.ts +2 -1
  29. package/dist/remotion/dist/components/lower-third.js +5 -5
  30. package/dist/remotion/dist/components/quote-card.d.ts +2 -1
  31. package/dist/remotion/dist/components/quote-card.js +4 -4
  32. package/dist/remotion/dist/components/split-screen.d.ts +2 -1
  33. package/dist/remotion/dist/components/split-screen.js +7 -7
  34. package/dist/remotion/dist/components/stat-card.d.ts +2 -1
  35. package/dist/remotion/dist/components/stat-card.js +3 -3
  36. package/dist/remotion/dist/components/text-overlay.d.ts +2 -1
  37. package/dist/remotion/dist/components/text-overlay.js +2 -2
  38. package/dist/remotion/dist/components/title-card.d.ts +2 -1
  39. package/dist/remotion/dist/components/title-card.js +3 -3
  40. package/dist/remotion/dist/components/typing-text.d.ts +2 -1
  41. package/dist/remotion/dist/components/typing-text.js +3 -3
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +3 -3
@@ -3,7 +3,6 @@ import { ComponentConfigValue, HtmlTag, LayerInput, PropBinding } from "./compon
3
3
  import { ComponentPropsWithoutRef, HTMLAttributes, JSX } from "react";
4
4
 
5
5
  //#region ../config/dist/Props.d.ts
6
- //#region src/Props.d.ts
7
6
  /**
8
7
  * Resolve the native HTML-attribute surface for the config's root tag.
9
8
  *
@@ -66,9 +65,5 @@ interface DataAttrs {
66
65
  type Props<TConfig extends ComponentConfigValue<Record<string, LayerInput>, Record<string, PropBinding>, HtmlTag | undefined>> = TConfig extends ComponentConfigValue<Record<string, LayerInput>, infer TProps extends Record<string, PropBinding>, infer TTag extends HtmlTag | undefined> ? Prettify<PropsFromConfig<TProps> & Omit<ElementProps<TTag>, keyof TProps> & DataAttrs & {
67
66
  as?: string;
68
67
  }> : never;
69
- /**
70
- * `Props<typeof boxConfig>` for the common 'use the config's inferred
71
- * type' invocation. Keeps `box.tsx` from having to repeat the generic.
72
- */
73
68
  //#endregion
74
69
  export { Props };
@@ -1,8 +1,8 @@
1
1
  import { ComponentRef, CompositeRef, RegisteredComponents, StylePropRef } from "./component-refs.js";
2
+ import * as React$1 from "react";
2
3
  import { ReactNode } from "react";
3
4
 
4
5
  //#region ../config/dist/component-config.d.ts
5
- //#region src/component-config.d.ts
6
6
  /**
7
7
  * HTML tag literal. The TypeScript type is `string` (any tag name);
8
8
  * runtime renders it via `React.createElement(tag, ...)`.
@@ -15,14 +15,28 @@ type HtmlTag = string;
15
15
  /**
16
16
  * Object form for a primitive (HTML-tag) layer that needs locked attrs
17
17
  * or default CSS-property values.
18
+ *
19
+ * Distributive mapped union over `keyof React.JSX.IntrinsicElements` so
20
+ * `attrs` is narrowed to the HTML props valid for the chosen `tag` at
21
+ * the call site — `{ tag: 'a', attrs: { href: '/x' } }` type-checks;
22
+ * `{ tag: 'div', attrs: { href: '/x' } }` does not. `defaultProps`
23
+ * stays loosely typed: it carries style-prop-keyed CSS declarations
24
+ * (incl. `_hover`/`_focus`/etc. modifier keys) that feed the @utility
25
+ * codegen, NOT HTML props.
18
26
  */
19
- interface PrimitiveLayer {
20
- tag: HtmlTag;
21
- /** HTML attributes always applied to this layer (e.g. `role="alert"`). */
22
- attrs?: Record<string, unknown>;
23
- /** Default style-prop values for this layer. */
27
+ type PrimitiveLayer = { [T in keyof React$1.JSX.IntrinsicElements]: {
28
+ tag: T; /** HTML attributes always applied to this layer (e.g. `role="alert"`). */
29
+ attrs?: Partial<React$1.ComponentPropsWithoutRef<T>>;
30
+ /**
31
+ * Default per-layer CSS declarations. Keys are style-prop names (or
32
+ * raw CSS properties when no registered style prop applies); values
33
+ * are token refs (`'{spacing/4}'`), alias names, or literal CSS.
34
+ * Modifier keys (`_hover`, `_focus`, `_dataDisabled`, ...) nest the
35
+ * same shape recursively. Codegen compiles this into a single
36
+ * `@utility componentName-layerName { ... }` block.
37
+ */
24
38
  defaultProps?: Record<string, unknown>;
25
- }
39
+ } }[keyof React$1.JSX.IntrinsicElements];
26
40
  /**
27
41
  * Object form for a layer that's a composed React component (registered
28
42
  * via `.registerComponents({...})`). The `component` field is a brace-ref
@@ -95,19 +109,28 @@ interface CompositeBinding {
95
109
  layers: Record<string, string>;
96
110
  }
97
111
  /**
98
- * Forward a JSX prop value to one of the component's layers as an
99
- * existing surface key. If the target layer is a primitive, `from` is
100
- * an HTML attr / event name; if it's a composed component, `from` is
101
- * one of that component's existing props.
112
+ * Authoring-site form of `ForwardBinding`, narrowed against the
113
+ * component's own layer map. Distributes over `keyof TLayers` so:
102
114
  *
103
- * `from` is a bare string (no braces) — the absence of `styleProp` /
104
- * `composite` keys is how the framework discriminates this shape from
105
- * the registered-binding shapes.
115
+ * - `layer` is constrained to one of the declared layer names.
116
+ * - `from` is constrained by the target layer's shape:
117
+ * **ComposedLayer** (`{ component: '{Box}' }`) → one of the
118
+ * wrapped component's exposed JSX props (looked up against
119
+ * `RegisteredComponents['Box']`), so `{ layer: 'label', from:
120
+ * 'variant' }` only type-checks if Text registers `variant`.
121
+ * • **PrimitiveLayer / bare HTML tag** → any string (HTML attr or
122
+ * event name; type-precision here would require pulling
123
+ * `JSX.IntrinsicElements[tag]`, deferred).
124
+ *
125
+ * Structurally extends `ForwardBinding` so the runtime's type-guard
126
+ * (`isForwardBinding`) still recognizes typed entries.
106
127
  */
107
- interface ForwardBinding {
108
- layer: string;
109
- from: string;
110
- }
128
+ type TypedForwardBinding<TLayers extends Record<string, LayerInput>> = { [K in keyof TLayers & string]: {
129
+ layer: K;
130
+ from: TLayers[K] extends {
131
+ component: `{${infer C}}`;
132
+ } ? C extends keyof RegisteredComponents ? keyof RegisteredComponents[C] & string : string : string;
133
+ } }[keyof TLayers & string];
111
134
  /**
112
135
  * Boolean prop — toggled on/off, no value beyond presence. Useful for
113
136
  * `loading`, `disabled`, `selected`. Each layer's bundle gets a
@@ -143,30 +166,28 @@ type StylePropShorthand = StylePropRef;
143
166
  * `{ layer, styleProp }` binding — no shorthand. The shorthand
144
167
  * `'{bg}'` is allowed only in the primitive form's props (see
145
168
  * `PrimitivePropBinding`).
169
+ *
170
+ * Generic over `TLayers` so `TypedForwardBinding` can narrow the
171
+ * `layer` + `from` fields against the component's own layer map.
172
+ * Consumers that don't know the layer map (read-side helpers,
173
+ * `bindRender`) parameterize with the wide default
174
+ * `Record<string, LayerInput>` and get the loose `ForwardBinding`.
146
175
  */
147
- type VerbosePropBinding = StylePropBinding | SingleLayerCompositeBinding | CompositeBinding | ForwardBinding | BoolMarker | EnumMarker<any>;
176
+ type VerbosePropBinding<TLayers extends Record<string, LayerInput> = Record<string, LayerInput>> = StylePropBinding | SingleLayerCompositeBinding | CompositeBinding | TypedForwardBinding<TLayers> | BoolMarker | EnumMarker<any>;
148
177
  /**
149
178
  * All allowed shapes for a single entry in the primitive form's `props`
150
179
  * block. Primitive form adds the `StylePropShorthand` brace-ref
151
180
  * (`'{bg}'`) on top of every verbose form — the root layer is
152
181
  * unambiguous so the shorthand resolves trivially.
153
182
  */
154
- type PrimitivePropBinding = StylePropShorthand | VerbosePropBinding;
183
+ type PrimitivePropBinding<TLayers extends Record<string, LayerInput> = Record<string, LayerInput>> = StylePropShorthand | VerbosePropBinding<TLayers>;
155
184
  /**
156
185
  * Union of every legal prop-binding shape across both forms. Read-side
157
186
  * helpers (`Props<TConfig>`, runtime resolution) accept this widest
158
187
  * union; authoring-side input types (`ComponentConfigInput`) take the
159
188
  * tighter `VerbosePropBinding`.
160
189
  */
161
- type PropBinding = PrimitivePropBinding;
162
- /**
163
- * Marker for a boolean JSX prop. Use inside the `props` block:
164
- *
165
- * props: {
166
- * loading: bool(),
167
- * disabled: bool(),
168
- * }
169
- */
190
+ type PropBinding<TLayers extends Record<string, LayerInput> = Record<string, LayerInput>> = PrimitivePropBinding<TLayers>;
170
191
  /**
171
192
  * Names of prop bindings that participate in matrix/strip iteration —
172
193
  * i.e. props authored as `enums({...})` or `bool()`. Other prop bindings
@@ -231,14 +252,29 @@ type Examples<TProps extends Record<string, unknown> = Record<string, unknown>>
231
252
  default: ExampleEntry<IterableAxisOf<TProps>>;
232
253
  } & Record<string, ExampleEntry<IterableAxisOf<TProps>>>;
233
254
  /**
234
- * The architecture-doc-target component config. Distinct from today's
235
- * `SingleComponentDef` (`base` + `variants` shape) this is the
236
- * pure-data, layers-first shape the new `defineComponent` accepts.
255
+ * A compound-variant entry applies a per-layer style override when
256
+ * *all* `conditions` match the incoming JSX props. Mirrors the legacy
257
+ * `compoundVariants: [{ conditions, styles }]` shape (see
258
+ * `componentCompoundClass()` for the emitted class name).
259
+ *
260
+ * compoundVariants: [
261
+ * {
262
+ * conditions: { size: 'sm', variant: 'brand' },
263
+ * styles: { root: { boxShadow: '{shadow/sm}' } },
264
+ * },
265
+ * ]
237
266
  *
238
- * `TLayers` is inferred from the `layers` block so prop bindings can
239
- * narrow their `layer` field against the component's actual layer
240
- * names; typos surface at the authoring site.
267
+ * `conditions` keys are JSX-prop names that resolve to `enums()` /
268
+ * `bool()` markers in the `props` block; values are the variant values
269
+ * (or `'true'` / `'false'` for bools) that must all match for the entry
270
+ * to apply. Codegen emits one `@utility componentName-layerName--<sorted
271
+ * conditions>` block per (layer); runtime appends that class when
272
+ * conditions match.
241
273
  */
274
+ interface CompoundVariant {
275
+ conditions: Record<string, string>;
276
+ styles: Record<string, Record<string, unknown>>;
277
+ }
242
278
  /**
243
279
  * Branded shape returned by `defineComponent({...})`. Carries `layers`,
244
280
  * `props`, AND a phantom `__tag` slot as const-narrowed types so
@@ -255,24 +291,25 @@ type Examples<TProps extends Record<string, unknown> = Record<string, unknown>>
255
291
  * When the root isn't a literal tag (brace-ref / composed layer), it's
256
292
  * `undefined` and `Props<TConfig>` falls back to `HTMLAttributes<HTMLElement>`.
257
293
  *
258
- * The component's name is supplied at registration time, not here.
294
+ * `__componentName` is a non-enumerable runtime slot assigned by
295
+ * `.registerComponents({ Name: config })` — the key becomes the name.
296
+ * The renderer reads it to emit `componentName-layerName` @utility
297
+ * classes onto each layer's bundle (matching the classes codegen emits
298
+ * from the same `defaultProps`). Absent until registered.
259
299
  */
260
300
  interface ComponentConfigValue<TLayers extends Record<string, LayerInput>, TProps extends Record<string, PropBinding> = Record<string, PropBinding>, TTag extends HtmlTag | undefined = RootTag<TLayers>> {
261
301
  readonly __kind: 'componentConfig';
262
302
  readonly __tag?: TTag;
303
+ readonly __componentName?: string;
263
304
  readonly layers: TLayers;
264
305
  readonly props?: TProps;
265
306
  readonly defaultProps?: Record<string, unknown>;
307
+ readonly compoundVariants?: CompoundVariant[];
266
308
  /**
267
309
  * Component examples — see {@link Examples}. Carried through from
268
310
  * `ComponentConfigInput.examples`.
269
311
  */
270
312
  readonly examples?: Examples<TProps>;
271
313
  }
272
- /**
273
- * The bundle passed to the render function for each layer — a ready-to-
274
- * spread object with `className` and any forwarded attrs. The render
275
- * function destructures `props.<layerName>` into the JSX position.
276
- */
277
314
  //#endregion
278
- export { BoolMarker, ComponentConfigValue, ComposedLayer, CompositeBinding, EnumMarker, ForwardBinding, HtmlTag, LayerInput, PrimitiveLayer, PrimitivePropBinding, PropBinding, RootTag, SingleLayerCompositeBinding, StylePropBinding, StylePropShorthand, VerbosePropBinding };
315
+ export { BoolMarker, ComponentConfigValue, ComposedLayer, CompositeBinding, CompoundVariant, EnumMarker, HtmlTag, LayerInput, PrimitiveLayer, PrimitivePropBinding, PropBinding, RootTag, SingleLayerCompositeBinding, StylePropBinding, StylePropShorthand, VerbosePropBinding };
@@ -1,5 +1,4 @@
1
1
  //#region ../config/dist/component-refs.d.ts
2
- //#region src/component-refs.d.ts
3
2
  /**
4
3
  * Augmentable registries + template-literal ref types for the
5
4
  * component-API surface.
@@ -64,14 +63,6 @@ interface RegisteredStyleProps {}
64
63
  * call.
65
64
  */
66
65
  interface RegisteredComposites {}
67
- /**
68
- * Registered motion-preset names. Each key is the preset identifier
69
- * (`'{fadeIn}'`); value is `void`.
70
- *
71
- * Populated by codegen from `uds.config.ts`'s `.defineMotion({...})`
72
- * (motion has no separate `.registerMotion` step today; the entries
73
- * come directly from `defineMotion` keys).
74
- */
75
66
  /**
76
67
  * Brace-wrapped reference to a registered React component. Falls open
77
68
  * to `'{${string}}'` when the registry is unaugmented (e.g. inside
@@ -90,9 +81,5 @@ type StylePropRef = [keyof RegisteredStyleProps] extends [never] ? `{${string}}`
90
81
  * when unaugmented.
91
82
  */
92
83
  type CompositeRef = [keyof RegisteredComposites] extends [never] ? `{${string}}` : `{${Extract<keyof RegisteredComposites, string>}}`;
93
- /**
94
- * Brace-wrapped reference to a registered motion preset. Falls open
95
- * when unaugmented.
96
- */
97
84
  //#endregion
98
85
  export { ComponentRef, CompositeRef, RegisteredComponents, RegisteredComposites, RegisteredStyleProps, StylePropRef };
@@ -1 +1 @@
1
- export { };
1
+ import { ComponentsConfig } from "@uds/types";
@@ -1,5 +1,4 @@
1
1
  //#region ../config/dist/consts/defaultColors.d.ts
2
- //#region src/consts/defaultColors.d.ts
3
2
  declare const defaultColors: {
4
3
  inherit: string;
5
4
  current: string;
@@ -248,6 +247,6 @@ declare const defaultColors: {
248
247
  'rose-800': string;
249
248
  'rose-900': string;
250
249
  'rose-950': string;
251
- }; //#endregion
250
+ };
252
251
  //#endregion
253
252
  export { defaultColors };
@@ -1 +1 @@
1
- import "react";
1
+ import "../../utils/dist/index.js";
@@ -6,7 +6,6 @@ import { ResolvedStyleProp } from "./resolveStyleProp.js";
6
6
  import { BaseModifierProp, ComponentsConfig, CompositeStylesConfig, ConfigurableProp, ModifierProp, MotionPreset, RemotionComponentDef, RemotionConfig, RemotionTransitionDef } from "@uds/types";
7
7
 
8
8
  //#region ../config/dist/createConfig.d.ts
9
- //#region src/createConfig.d.ts
10
9
  type MotionPresetsDef = Record<string, MotionPreset>;
11
10
  type MotionAliasValue<TMotion> = TMotion extends Record<string, infer V> ? Extract<V, string> : never;
12
11
  type EmptyMotion = {};
@@ -79,12 +78,6 @@ type GetModifierFromInput<I extends ModesInput> = { [SetKey in keyof I]: { [OptK
79
78
  } ? M extends ModifierNameShape ? M : never : OptKey extends string ? `_${OptKey}` : never }[keyof I[SetKey]['options']] }[keyof I];
80
79
  /** Reject any input whose derived/explicit modifiers collide with reserved names. */
81
80
  type CheckForReservedModifiersInput<I extends ModesInput> = true extends HasReservedModifier<GetModifierFromInput<I>> ? 'ERROR: Cannot use reserved modifier names from ModifierProp. Please use a different modifier name.' : I;
82
- /**
83
- * Convert the authored object-keyed input into the internal `ModeGroup[]` shape.
84
- * Derives `_${optionKey}` modifiers when no explicit `modifier` is provided.
85
- * Never sets `default: true` — the new API has no concept of a default option;
86
- * downstream consumers treat "no option active" as the implicit default.
87
- */
88
81
  interface ModifierDef {
89
82
  modifier: ModifierNameShape;
90
83
  selector: string;
@@ -164,7 +157,6 @@ type VarsToTokens<TVars extends VarsConfig> = { [K in keyof TVars]: { [T in Excl
164
157
  type MergeTokens<A, B> = { [K in keyof A | keyof B]: K extends keyof B ? K extends keyof A ? A[K] & B[K] : B[K] : K extends keyof A ? A[K] : never };
165
158
  /** Build a structured token reference object from atomic tokens */
166
159
  declare function buildTokenReference(atomic: AtomicToken<ModifierNameShape>[], configPrefix: string): Record<string, Record<string, string>>;
167
- /** Build a structured composite-styles reference object for use in defineModifiers context */
168
160
  /** Global styles definition — CSS selector → style props */
169
161
  type GlobalStylesDef = Record<string, Record<string, any>>;
170
162
  /** CSS properties for the example wrapper element */
@@ -368,10 +360,6 @@ interface UdsConfig<TModifier extends ModifierNameShape = ModifierProp, TTokens
368
360
  type AnyUdsConfig = UdsConfig<ModifierNameShape, any, any, any, any, any, any>;
369
361
  /** Extract the raw config data from a builder instance */
370
362
  declare function resolveConfig(config: AnyUdsConfig): UdsConfigData;
371
- /**
372
- * Resolve configuration with all token references replaced by their raw values.
373
- * Useful for tools that need the actual values (e.g. anatomy generation).
374
- */
375
363
  declare function createConfigBuilder<TModifier extends ModifierNameShape = ModifierProp, TTokens = EmptyTokens, TMotion = EmptyMotion, TExt extends Record<string, any> = {}, TCompositeStyles = EmptyCompositeStyles, TModeModifiers extends ModifierNameShape = never, TVars extends VarsConfig = EmptyVars>(data: UdsConfigData, extensions?: TExt): UdsConfig<TModifier, TTokens, TMotion, TExt, TCompositeStyles, TModeModifiers, TVars> & TExt;
376
364
  interface InterpolateMarker {
377
365
  __type: 'interpolate';
@@ -4,10 +4,10 @@ import "../../utils/dist/index.js";
4
4
  import { getConfigurablePropMapping } from "../../core/dist/configurable-prop-helpers.js";
5
5
  import "../../core/dist/index.js";
6
6
  import { buildMotionReference, resolveComponentMotionAliases, validateComponentVariants } from "./component-resolution.js";
7
- import { setRegisteredStyleProps } from "./runtime-registry.js";
8
7
  import { applyPresetToData, deepMerge, mergeAtomic } from "./preset-merge.js";
9
8
  import { resolveTokenType, sniffTokenTypeFromValue } from "./resolveTokenTypes.js";
10
9
  import { resolveStyleProp } from "./resolveStyleProp.js";
10
+ import { setRegisteredStyleProps } from "./runtime-registry.js";
11
11
  //#region ../config/dist/createConfig.js
12
12
  /** biome-ignore-all lint/suspicious/noExplicitAny: necessary for dynamic builder to work correctly */
13
13
  /**
@@ -449,8 +449,16 @@ function createConfigBuilder(data, extensions) {
449
449
  },
450
450
  registerComponents(configs) {
451
451
  const normalized = {};
452
- for (const [name, entry] of Object.entries(configs)) if (typeof entry === "function" && "__config" in entry) normalized[name] = entry.__config;
453
- else normalized[name] = entry;
452
+ for (const [name, entry] of Object.entries(configs)) {
453
+ const config = typeof entry === "function" && "__config" in entry ? entry.__config : entry;
454
+ Object.defineProperty(config, "__componentName", {
455
+ enumerable: false,
456
+ configurable: true,
457
+ writable: true,
458
+ value: name
459
+ });
460
+ normalized[name] = config;
461
+ }
454
462
  return next({ componentConfigs: {
455
463
  ...data.componentConfigs ?? {},
456
464
  ...normalized
@@ -3,7 +3,6 @@ import { Props } from "./Props.js";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  //#region ../config/dist/defineComponent.d.ts
6
- //#region src/defineComponent.d.ts
7
6
  /**
8
7
  * A React component bound to a `defineComponent` config, with the
9
8
  * source config attached as a phantom type slot. Tools (codegen,
@@ -14,11 +13,5 @@ import { ReactNode } from "react";
14
13
  type BoundComponent<TConfig extends ComponentConfigValue<Record<string, LayerInput>, any, HtmlTag | undefined>, TExtra extends Record<string, unknown> = {}> = React.FC<Props<TConfig> & TExtra> & {
15
14
  readonly __config: TConfig;
16
15
  };
17
- /**
18
- * A `defineComponent({...})` config value with a `.render(fn)` builder
19
- * method bolted on. The builder is non-enumerable so JSON serialization
20
- * still produces pure data — codegen can read `__kind`, `layers`,
21
- * `props`, and `defaultProps` without seeing the render hook.
22
- */
23
16
  //#endregion
24
17
  export { BoundComponent };
@@ -1,4 +1,4 @@
1
- import { CssValueTypeName } from "./types/css-values.js";
1
+ import { CssValue, CssValueTypeName } from "./types/css-values.js";
2
2
 
3
3
  //#region ../config/dist/defineStyleProp.d.ts
4
4
  /** Runtime input type for `toCss` based on the entry's `type`. */
@@ -22,31 +22,10 @@ type ArbitraryEntry = { [T in CssValueTypeName]: {
22
22
  * - An array of {@link ArbitraryEntry} for multi-shape acceptance.
23
23
  */
24
24
  type ArbitrarySpec = CssValueTypeName | readonly ArbitraryEntry[];
25
- /**
26
- * The literal-keyword subset of values a property accepts, derived from
27
- * {@link CssPropertyValues}[P]. For custom CSS properties (`--*`) the value
28
- * type is governed by the required `cssType` field instead, so any string
29
- * is accepted at the type level.
30
- */
31
25
  type StylePropMetadata = {
32
26
  label?: string;
33
27
  description?: string;
34
28
  };
35
- /**
36
- * A finalized style prop. Returned by `defineStyleProp(spec)` (or the
37
- * `.metadata({...})` chain). Consumers wrap these in
38
- * `uds.registerStyleProps({ <propName>: ... })`.
39
- *
40
- * `cssProperty` is passed through verbatim from the authored input:
41
- * - **string** — a direct prop writing one CSS property.
42
- * - **`readonly string[]`** — a fan-out prop writing every CSS
43
- * property in the list (e.g. `borderRadiusStart` covering both
44
- * start-side corners).
45
- *
46
- * Readers that need iteration normalize at the call site
47
- * (`Array.isArray(p) ? p : [p]`); readers that only need the primary
48
- * use the string directly or `Array.isArray(p) ? p[0] : p`.
49
- */
50
29
  /**
51
30
  * Internal shape attached to a {@link StyleProp} by `.withOpacity()`.
52
31
  * The resolver inspects this at `resolveConfig` time to synthesize a
@@ -80,14 +59,5 @@ interface AnyStyleProp {
80
59
  readonly metadata: StylePropMetadata;
81
60
  readonly opacityPair?: OpacityPairSpec;
82
61
  }
83
- /**
84
- * Return shape of {@link defineStyleProp}. The `metadata` field doubles as
85
- * a callable chain: read it to access `{ label?, description? }` (both
86
- * optional, so an unset metadata reads `undefined` for either field) or
87
- * call it as `.metadata({ label, description })` to attach metadata and
88
- * get back a plain {@link StyleProp}. A function satisfies the
89
- * {@link StylePropMetadata} structural shape because both fields are
90
- * optional, so the dual nature is type-safe.
91
- */
92
62
  //#endregion
93
63
  export { AnyStyleProp, ArbitraryEntry, ArbitrarySpec, StylePropMetadata };
@@ -1,12 +1,12 @@
1
1
  import { ComponentRef, CompositeRef, RegisteredComponents, RegisteredComposites, RegisteredStyleProps, StylePropRef } from "./component-refs.js";
2
- import { BoolMarker, ComponentConfigValue, ComposedLayer, CompositeBinding, EnumMarker, ForwardBinding, HtmlTag, LayerInput, PrimitiveLayer, PrimitivePropBinding, PropBinding, RootTag, SingleLayerCompositeBinding, StylePropBinding, StylePropShorthand, VerbosePropBinding } from "./component-config.js";
2
+ import { BoolMarker, ComponentConfigValue, ComposedLayer, CompositeBinding, CompoundVariant, EnumMarker, HtmlTag, LayerInput, PrimitiveLayer, PrimitivePropBinding, PropBinding, RootTag, SingleLayerCompositeBinding, StylePropBinding, StylePropShorthand, VerbosePropBinding } from "./component-config.js";
3
3
  import { Props } from "./Props.js";
4
4
  import { BoundComponent } from "./defineComponent.js";
5
5
  import { ColorFn, ColorKeyword, CssAngle, CssColor, CssLength, CssPercentage, CssRatio, CssTime, CssValue, CssValueTypeName, HexColor, HslColor, RgbColor } from "./types/css-values.js";
6
6
  import { AnyStyleProp, ArbitraryEntry, ArbitrarySpec, StylePropMetadata } from "./defineStyleProp.js";
7
7
  import { TokenType, VarGroupDef, VarTokenDef, VarsConfig } from "./types.js";
8
- import { AtomicToken, BuildOptions, CheckForReservedModifiersInput, ComponentConfig, DefineComponentInput, DefineComponentMotionInput, ExampleDef, ExampleEntryDef, ExampleLayoutStyles, GetModifierFromInput, GlobalStylesDef, InterpolateMarker, ModeGroup, ModeOption, ModeOptionInput, ModeSetInput, ModesInput, ModifierDef, MotionPresetsDef, SingleComponentDef, UdsConfig, UdsConfigData, buildTokenReference, createConfigBuilder, darker, lighter, resolveConfig } from "./createConfig.js";
9
8
  import { ResolvedStyleProp, ResolvedToken } from "./resolveStyleProp.js";
9
+ import { AtomicToken, BuildOptions, CheckForReservedModifiersInput, ComponentConfig, DefineComponentInput, DefineComponentMotionInput, ExampleDef, ExampleEntryDef, ExampleLayoutStyles, GetModifierFromInput, GlobalStylesDef, InterpolateMarker, ModeGroup, ModeOption, ModeOptionInput, ModeSetInput, ModesInput, ModifierDef, MotionPresetsDef, SingleComponentDef, UdsConfig, UdsConfigData, buildTokenReference, createConfigBuilder, darker, lighter, resolveConfig } from "./createConfig.js";
10
10
  import { defaultColors } from "./consts/defaultColors.js";
11
11
  import { SerializedConfig, TokenRef, buildReverseMap, deserializeConfig, serializeConfig } from "./serialize.js";
12
12
  import { ComponentsConfig as ComponentsConfig$1 } from "@uds/types";
@@ -1,6 +1,5 @@
1
1
  import "./component-resolution.js";
2
2
  import "./consts/defaultColors.js";
3
- import "./createComponent.js";
4
3
  import "./propertyAcceptedTypes.js";
5
4
  import "./refs.js";
6
5
  import "./resolveTokenTypes.js";
@@ -27,22 +27,30 @@ import "../../utils/dist/index.js";
27
27
  * still resolves to `var(--uds-color-brand)`, regardless of whether the
28
28
  * brand value itself is a literal or a ref.
29
29
  */
30
- const REF_PATTERN = /^\{([^/{}]+)\/([^{}]+)\}$/;
30
+ const REF_PATTERN = /^\{([^{}]+)\}$/;
31
31
  /**
32
32
  * Parse a value as a token ref. Returns `null` when the value isn't a
33
33
  * brace-wrapped ref of the form `{namespace/name}`. The `name` portion
34
34
  * may contain additional slashes — only the first slash is treated as
35
35
  * the namespace separator.
36
+ *
37
+ * Color-modifier values (`darken` / `lighten`) are a structured object
38
+ * form, not a string-encoded suffix. See {@link TokenWithModifier}.
36
39
  */
37
40
  function parseTokenRef(value) {
38
- const match = REF_PATTERN.exec(value);
39
- if (!match) return null;
40
- const namespace = match[1];
41
- const name = match[2];
42
- if (!namespace || !name) return null;
41
+ const outer = REF_PATTERN.exec(value);
42
+ if (!outer) return null;
43
+ const body = outer[1];
44
+ if (!body) return null;
45
+ return parseRefBody(body);
46
+ }
47
+ function parseRefBody(body) {
48
+ if (body.includes("{") || body.includes("}")) return null;
49
+ const slashIdx = body.indexOf("/");
50
+ if (slashIdx <= 0 || slashIdx >= body.length - 1) return null;
43
51
  return {
44
- namespace,
45
- name
52
+ namespace: body.slice(0, slashIdx),
53
+ name: body.slice(slashIdx + 1)
46
54
  };
47
55
  }
48
56
  /**
@@ -1,7 +1,6 @@
1
1
  import { CssValueTypeName } from "./types/css-values.js";
2
2
  import { ArbitrarySpec, StylePropMetadata } from "./defineStyleProp.js";
3
3
  //#region ../config/dist/resolveStyleProp.d.ts
4
- //#region src/resolveStyleProp.d.ts
5
4
  interface ResolvedToken {
6
5
  /** The token's raw key, e.g. `'brand'`. */
7
6
  readonly name: string;
@@ -78,11 +77,5 @@ interface ResolvedStyleProp {
78
77
  readonly arbitrary: ArbitrarySpec | undefined;
79
78
  readonly metadata: StylePropMetadata;
80
79
  }
81
- /**
82
- * Structurally-loose input shape for the resolver. Any `StyleProp<P>` from
83
- * `defineStyleProp` is assignable to this. Defined locally so the
84
- * resolver's signature doesn't expand `ValuesEntry<P>` over the full CSS
85
- * property union (TS2590).
86
- */
87
80
  //#endregion
88
81
  export { ResolvedStyleProp, ResolvedToken };
@@ -3,7 +3,6 @@ import { AtomicToken, ExampleDef, ModeGroup, ModifierDef, MotionPresetsDef, UdsC
3
3
  import { CompositeStylesConfig } from "@uds/types";
4
4
 
5
5
  //#region ../config/dist/serialize.d.ts
6
- //#region src/serialize.d.ts
7
6
  type ModifierNameShape = `_${string}`;
8
7
  type TokenRef = {
9
8
  $ref: string;
@@ -68,6 +67,6 @@ declare function serializeConfig(config: UdsConfig): SerializedConfig;
68
67
  * Resolves `$ref` markers back to `var()` strings using the atomic token
69
68
  * definitions, then reconstructs the builder chain.
70
69
  */
71
- declare function deserializeConfig(data: SerializedConfig): UdsConfig; //#endregion
70
+ declare function deserializeConfig(data: SerializedConfig): UdsConfig;
72
71
  //#endregion
73
72
  export { SerializedConfig, TokenRef, buildReverseMap, deserializeConfig, serializeConfig };
@@ -0,0 +1 @@
1
+ export { };
@@ -1,5 +1,4 @@
1
1
  //#region ../config/dist/types/css-values.d.ts
2
- //#region src/types/css-values.d.ts
3
2
  /**
4
3
  * CSS value-type primitives — building blocks used by {@link CssPropertyValues}
5
4
  * in `./css-properties` and by `defineStyleProp` to constrain authored values.
@@ -56,6 +55,6 @@ type CssValue = {
56
55
  ident: string;
57
56
  string: string;
58
57
  };
59
- type CssValueTypeName = keyof CssValue; //#endregion
58
+ type CssValueTypeName = keyof CssValue;
60
59
  //#endregion
61
60
  export { ColorFn, ColorKeyword, CssAngle, CssColor, CssLength, CssPercentage, CssRatio, CssTime, CssValue, CssValueTypeName, HexColor, HslColor, RgbColor };
@@ -1,5 +1,4 @@
1
1
  //#region ../config/dist/types.d.ts
2
- //#region src/types.d.ts
3
2
  /**
4
3
  * Scalar DTCG-aligned token types. Composite types (shadow, gradient,
5
4
  * typography, border, transition, cubicBezier) are intentionally deferred
@@ -67,6 +66,6 @@ type VarGroupDef<M extends `_${string}` = `_${string}`> = {
67
66
  * spacing: { $type: 'dimension', 1: { value: '0.25rem' }, 2: { value: '0.5rem' } },
68
67
  * }
69
68
  */
70
- type VarsConfig<M extends `_${string}` = `_${string}`> = Record<string, VarGroupDef<M>>; //#endregion
69
+ type VarsConfig<M extends `_${string}` = `_${string}`> = Record<string, VarGroupDef<M>>;
71
70
  //#endregion
72
71
  export { TokenType, VarGroupDef, VarTokenDef, VarsConfig };