@yahoo/uds-create-config 3.0.9 → 3.1.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.
@@ -1,5 +1,6 @@
1
1
  import { CopyPlan } from "../entities/system/copy-plan.js";
2
- import { Ref } from "../framework/utils/refs.js";
2
+ import { ExtendableRef, Ref } from "../framework/utils/refs.js";
3
+ import { CreateInput } from "../framework/utils/field-schema.js";
3
4
  import { DerivedEntityClass } from "../framework/defineDerivedEntity.js";
4
5
  import { SubEntityClass } from "../framework/defineSubEntity.js";
5
6
  import { ComponentContractOf, PathOf } from "../framework/registered.js";
@@ -838,7 +839,7 @@ declare const System: ConfigClass<{
838
839
  __ref: _$zod.ZodString;
839
840
  }, _$zod_v4_core0.$strip>>;
840
841
  }, _$zod_v4_core0.$strip>, "modifier", Record<never, never>, Record<never, never>, false>;
841
- styleProps: EntityClass<_$zod.ZodObject<{
842
+ styleProps: Omit<EntityClass<_$zod.ZodObject<{
842
843
  properties: _$zod.ZodArray<_$zod.ZodString>;
843
844
  values: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodType<StylePropValue, unknown, _$zod_v4_core0.$ZodTypeInternals<StylePropValue, unknown>>>>;
844
845
  responsive: _$zod.ZodDefault<_$zod.ZodBoolean>;
@@ -864,7 +865,19 @@ declare const System: ConfigClass<{
864
865
  data: Record<string, unknown>;
865
866
  } | undefined;
866
867
  };
867
- }, Record<never, never>, false>;
868
+ }, Record<never, never>, false>, "ref"> & {
869
+ ref<const Path extends PathOf<"style-property">>(path: Path): ReturnType<(path: string) => ExtendableRef<Partial<CreateInput<_$zod.ZodObject<{
870
+ properties: _$zod.ZodArray<_$zod.ZodString>;
871
+ values: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodType<StylePropValue, unknown, _$zod_v4_core0.$ZodTypeInternals<StylePropValue, unknown>>>>;
872
+ responsive: _$zod.ZodDefault<_$zod.ZodBoolean>;
873
+ classPrefix: _$zod.ZodOptional<_$zod.ZodString>;
874
+ arbitrary: _$zod.ZodDefault<_$zod.ZodBoolean>;
875
+ negates: _$zod.ZodDefault<_$zod.ZodBoolean>;
876
+ opacityOf: _$zod.ZodOptional<_$zod.ZodLazy<_$zod.ZodType<Ref, unknown, _$zod_v4_core0.$ZodTypeInternals<Ref, unknown>>>>;
877
+ }, _$zod_v4_core0.$strip>>>>> & {
878
+ readonly __ref: `style-property:${Path}`;
879
+ };
880
+ };
868
881
  composites: EntityClass<_$zod.ZodObject<{
869
882
  styles: SubEntityClass<_$zod.ZodType<StyleValue, unknown, _$zod_v4_core0.$ZodTypeInternals<StyleValue, unknown>>>;
870
883
  }, _$zod_v4_core0.$strip>, _$zod.ZodObject<Record<never, never>, _$zod_v4_core0.$strip>, "composite", Record<never, never>, Record<never, never>, false>;
@@ -2213,7 +2226,7 @@ declare const System: ConfigClass<{
2213
2226
  __ref: _$zod.ZodString;
2214
2227
  }, _$zod_v4_core0.$strip>>;
2215
2228
  }, _$zod_v4_core0.$strip>, "modifier", Record<never, never>, Record<never, never>, false>;
2216
- styleProps: EntityClass<_$zod.ZodObject<{
2229
+ styleProps: Omit<EntityClass<_$zod.ZodObject<{
2217
2230
  properties: _$zod.ZodArray<_$zod.ZodString>;
2218
2231
  values: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodType<StylePropValue, unknown, _$zod_v4_core0.$ZodTypeInternals<StylePropValue, unknown>>>>;
2219
2232
  responsive: _$zod.ZodDefault<_$zod.ZodBoolean>;
@@ -2239,7 +2252,19 @@ declare const System: ConfigClass<{
2239
2252
  data: Record<string, unknown>;
2240
2253
  } | undefined;
2241
2254
  };
2242
- }, Record<never, never>, false>;
2255
+ }, Record<never, never>, false>, "ref"> & {
2256
+ ref<const Path extends PathOf<"style-property">>(path: Path): ReturnType<(path: string) => ExtendableRef<Partial<CreateInput<_$zod.ZodObject<{
2257
+ properties: _$zod.ZodArray<_$zod.ZodString>;
2258
+ values: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodType<StylePropValue, unknown, _$zod_v4_core0.$ZodTypeInternals<StylePropValue, unknown>>>>;
2259
+ responsive: _$zod.ZodDefault<_$zod.ZodBoolean>;
2260
+ classPrefix: _$zod.ZodOptional<_$zod.ZodString>;
2261
+ arbitrary: _$zod.ZodDefault<_$zod.ZodBoolean>;
2262
+ negates: _$zod.ZodDefault<_$zod.ZodBoolean>;
2263
+ opacityOf: _$zod.ZodOptional<_$zod.ZodLazy<_$zod.ZodType<Ref, unknown, _$zod_v4_core0.$ZodTypeInternals<Ref, unknown>>>>;
2264
+ }, _$zod_v4_core0.$strip>>>>> & {
2265
+ readonly __ref: `style-property:${Path}`;
2266
+ };
2267
+ };
2243
2268
  composites: EntityClass<_$zod.ZodObject<{
2244
2269
  styles: SubEntityClass<_$zod.ZodType<StyleValue, unknown, _$zod_v4_core0.$ZodTypeInternals<StyleValue, unknown>>>;
2245
2270
  }, _$zod_v4_core0.$strip>, _$zod.ZodObject<Record<never, never>, _$zod_v4_core0.$strip>, "composite", Record<never, never>, Record<never, never>, false>;
@@ -5,7 +5,7 @@ import { EntityClass } from "../../framework/defineEntity.js";
5
5
  import { Config } from "../../framework/Config.js";
6
6
  import { ComputedInput } from "../../framework/registry.js";
7
7
  import { StyleValue } from "./style-bag.js";
8
- import { ComponentPropsOf, LayerMap, PropMap, RenderArgs, StyleRuleInput } from "./defineComponent.js";
8
+ import { AsInput, ComponentPropsOf, LayerMap, PropMap, RenderArgs, StyleRuleInput } from "./defineComponent.js";
9
9
  import { z } from "zod";
10
10
 
11
11
  //#region src/entities/system/Component.d.ts
@@ -1272,8 +1272,9 @@ type ForwardedLayerNames<Contract, Delta> = ResolvedForwards<Contract, Delta> ex
1272
1272
  * only `{ __ref, extend }`. */
1273
1273
  type ExtendedComponentRef<Contract = ComponentContractOf<string>, Delta extends ComponentRefDelta = ComponentRefDelta, Extra = Record<never, never>> = ExtendedRef<Delta> & {
1274
1274
  /** Phantom component signature: codegen replaces the authoring value before it is rendered, but
1275
- * this lets `ComponentProps<typeof Button>` see the inherited and locally replaced contract. */
1276
- (props: ComponentPropsOf<ResolvedLayers<Contract, Delta>, ResolvedProps<Contract, Delta>, ResolvedDefaults<Contract, Delta>, Extra, ForwardedLayerNames<Contract, Delta>>): null;
1275
+ * this lets `ComponentProps<typeof Button>` see the inherited and locally replaced contract. Generic
1276
+ * over a call site's `as`, the same way `ComponentBuilder`'s is. */
1277
+ <As extends AsInput = never>(props: ComponentPropsOf<ResolvedLayers<Contract, Delta>, ResolvedProps<Contract, Delta>, ResolvedDefaults<Contract, Delta>, Extra, ForwardedLayerNames<Contract, Delta>, As>): null;
1277
1278
  render<E = Extra>(fn: (args: RenderArgs<ResolvedLayers<Contract, Delta>, ResolvedProps<Contract, Delta>> & E) => unknown): ExtendedComponentRef<Contract, Delta, E>;
1278
1279
  /**
1279
1280
  * Style rules for the extension, typed against the layers it ends up with — the linked contract's,
@@ -1,4 +1,5 @@
1
1
  import { Ref } from "../../framework/utils/refs.js";
2
+ import { PathOf } from "../../framework/registered.js";
2
3
  import { EntityClass } from "../../framework/defineEntity.js";
3
4
  import { Config } from "../../framework/Config.js";
4
5
  import { z } from "zod";
@@ -90,7 +91,7 @@ declare function classifyStylePropValue({
90
91
  }): StylePropValueKind;
91
92
  /** StyleProperty (`flex/direction`) — a prop a component can expose, mapped to a CSS
92
93
  * property with an allowed value set. Grouping (`flex`) is emergent from the path. */
93
- declare const StyleProperty: EntityClass<z.ZodObject<{
94
+ declare const StylePropertyEntity: EntityClass<z.ZodObject<{
94
95
  properties: z.ZodArray<z.ZodString>;
95
96
  values: z.ZodOptional<z.ZodArray<z.ZodType<StylePropValue, unknown, z.core.$ZodTypeInternals<StylePropValue, unknown>>>>;
96
97
  responsive: z.ZodDefault<z.ZodBoolean>;
@@ -117,6 +118,17 @@ declare const StyleProperty: EntityClass<z.ZodObject<{
117
118
  } | undefined;
118
119
  };
119
120
  }, Record<never, never>, false>;
121
+ /**
122
+ * `StyleProperty.ref('bg')` with the path kept literal in its type, so a component prop declared as
123
+ * the ref is typed by the property it points at: `bg: StyleProperty.ref('bg')` offers the registered
124
+ * `bg` values, and `columns: StyleProperty.ref('gridTemplateColumns')` offers the target's rather
125
+ * than the name's. The value is the base ref unchanged; only the type narrows.
126
+ */
127
+ declare const StyleProperty: Omit<typeof StylePropertyEntity, "ref"> & {
128
+ ref<const Path extends PathOf<"style-property">>(path: Path): ReturnType<typeof StylePropertyEntity.ref> & {
129
+ readonly __ref: `style-property:${Path}`;
130
+ };
131
+ };
120
132
  /** `flexDirection` → `flex-direction`. A name already spelled as CSS comes back unchanged. */
121
133
  declare function toCssPropertyName(property: string): string;
122
134
  /**
@@ -397,7 +397,7 @@ function freePath(config, path) {
397
397
  }
398
398
  /** StyleProperty (`flex/direction`) — a prop a component can expose, mapped to a CSS
399
399
  * property with an allowed value set. Grouping (`flex`) is emergent from the path. */
400
- const StyleProperty = defineEntity({
400
+ const StylePropertyEntity = defineEntity({
401
401
  kind: "style-property",
402
402
  label: "Style property",
403
403
  labelPlural: "Style properties",
@@ -418,6 +418,13 @@ const StyleProperty = defineEntity({
418
418
  }
419
419
  }
420
420
  });
421
+ /**
422
+ * `StyleProperty.ref('bg')` with the path kept literal in its type, so a component prop declared as
423
+ * the ref is typed by the property it points at: `bg: StyleProperty.ref('bg')` offers the registered
424
+ * `bg` values, and `columns: StyleProperty.ref('gridTemplateColumns')` offers the target's rather
425
+ * than the name's. The value is the base ref unchanged; only the type narrows.
426
+ */
427
+ const StyleProperty = Object.assign(StylePropertyEntity, {});
421
428
  /** `flexDirection` → `flex-direction`. A name already spelled as CSS comes back unchanged. */
422
429
  function toCssPropertyName(property) {
423
430
  return property.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
@@ -1,8 +1,9 @@
1
1
  import { Ref as Ref$1 } from "../../framework/utils/refs.js";
2
+ import { RegisteredModifiers, RegisteredStyleProps } from "../../framework/registered.js";
2
3
  import { Authored } from "../../framework/authoring.js";
3
4
  import { StyleValue } from "./style-bag.js";
4
5
  import { VariantValues } from "./Component.js";
5
- import { ComponentPropsWithoutRef, ElementType, JSX, ReactNode, Ref } from "react";
6
+ import { AllHTMLAttributes, ComponentPropsWithRef, ElementType, JSX, ReactNode, Ref } from "react";
6
7
 
7
8
  //#region src/entities/system/defineComponent.d.ts
8
9
  /**
@@ -220,6 +221,23 @@ interface StyleRuleInput<L extends LayerMap> {
220
221
  }
221
222
  /** The TS type one prop declaration produces on the rendered component. */
222
223
  type ValueOf<D> = D extends readonly (infer Member)[] ? Member : D extends {
224
+ __ref: `style-property:${infer Target}`;
225
+ } ? StylePropValue<Target> : D extends {
226
+ type: 'styleProperty';
227
+ value: {
228
+ __ref: `style-property:${infer Target}`;
229
+ };
230
+ } ? StylePropValue<Target> : ValueOfDeclaration<D>;
231
+ /**
232
+ * A style prop's values, read off the registry by the path the declaration points at. By the target
233
+ * and not the prop's own name, since a component may expose a property under a name of its own —
234
+ * `Grid`'s `columns` is `gridTemplateColumns`, and `columns` is itself a different CSS property.
235
+ * Unregistered — before a build, or a path the build did not emit — it is `unknown`, as any other
236
+ * declaration the type cannot resolve.
237
+ */
238
+ type StylePropValue<Target extends string> = Target extends keyof RegisteredStyleProps ? RegisteredStyleProps[Target] : unknown;
239
+ /** The declaration arms of {@link ValueOf}, after the two ref arms. */
240
+ type ValueOfDeclaration<D> = D extends {
223
241
  type: 'variant';
224
242
  value: infer V;
225
243
  } ? V extends readonly (infer Member)[] ? Member : V extends VariantValues ? keyof V & string : string : D extends {
@@ -248,14 +266,15 @@ type Declared<T> = { [K in keyof T as string extends K ? never : number extends
248
266
  * props it DROPS from what it inherits — gone from the surface entirely. */
249
267
  type DeclaredProps<P> = { [K in keyof P as P[K] extends null ? never : K]: ValueOf<P[K]> };
250
268
  /**
251
- * The props the rendered ELEMENT contributes.
269
+ * The props the rendered ELEMENT contributes, `ref` included.
252
270
  *
253
271
  * That element's React props are part of the component's surface — `<Pressable onClick={e => …}>`
254
272
  * types `e` because `Pressable` renders a `button`. Left out, every handler a consumer passed fell
255
273
  * into the open index signature and its parameter had no contextual type, which turned ~75 untouched
256
- * call sites into implicit-`any` errors.
274
+ * call sites into implicit-`any` errors. The `ref` is the element's for the same reason: a
275
+ * `useRef<HTMLDivElement>` handed to an `<Box as="img">` is a mistake the element can name.
257
276
  */
258
- type ElementPropsOf<Element> = Element extends keyof JSX.IntrinsicElements ? ComponentPropsWithoutRef<Element> : Element extends ((props: infer PropsOfComponent) => unknown) ? Declared<PropsOfComponent> : Record<never, never>;
277
+ type ElementPropsOf<Element> = Element extends keyof JSX.IntrinsicElements ? Without<ComponentPropsWithRef<Element>, keyof RegisteredStyleProps> : Element extends ((props: infer PropsOfComponent) => unknown) ? Declared<PropsOfComponent> : Record<never, never>;
259
278
  /**
260
279
  * Which element that is: the one a `defaultProps.as` FIXES, else the root layer.
261
280
  *
@@ -264,10 +283,102 @@ type ElementPropsOf<Element> = Element extends keyof JSX.IntrinsicElements ? Com
264
283
  * `as` is what a component PINS: `Input` is a Box in every other respect and an `<input>` in this
265
284
  * one, so the layer stays the component it extends while `as` names the tag. Reading only the layer
266
285
  * typed `Input`'s `onChange` against a `div` and lost `event.target.value` at every call site.
286
+ *
287
+ * A call site's own `as` outranks both — see {@link RenderedElementOf}.
267
288
  */
268
289
  type ElementOf<L extends LayerMap, D> = D extends {
269
290
  as: infer As;
270
291
  } ? As : L['root'];
292
+ /**
293
+ * Whether an `as` names an element at all. `never` is a call that wrote none, and a `string` is a tag
294
+ * computed at runtime, which could be any of them. An `as` as wide as `ElementType` says nothing
295
+ * either: `React.ComponentProps<typeof Box>` reads the phantom signature with every type parameter
296
+ * at its constraint, and a consumer's `BoxProps` has to come out as the fixed element's surface, not
297
+ * a union over every tag.
298
+ */
299
+ type NamesNoElement<As> = [As] extends [never] ? true : string extends As ? true : [ElementType] extends [As] ? true : false;
300
+ /**
301
+ * What a call site may write as `as`: a tag, a component, or a `string` it computes. A computed tag
302
+ * names no element in particular, so the surface stays the fixed element's.
303
+ */
304
+ type AsInput = ElementType | string;
305
+ /**
306
+ * A union folded into one object type, so a union of tags contributes every member's props at once.
307
+ * Distributed, `<Box as={tag}>` with `tag: 'p' | 'span'` would type `onClick` as one of two handlers,
308
+ * and a union of function types gives the handler's parameter no contextual type at all.
309
+ */
310
+ type UnionToIntersection<U> = (U extends unknown ? (member: U) => void : never) extends ((member: infer I) => void) ? I : never;
311
+ /** One element's contribution, a union of tags folded into one object type. */
312
+ type ElementSurface<Element> = UnionToIntersection<ElementPropsOf<Element>>;
313
+ /**
314
+ * What the root layer contributes to the surface.
315
+ *
316
+ * When the element that renders is the root layer, its props. When `as` names another — pinned by
317
+ * `defaultProps` or written at the call site — the root's surface with its element's props swapped
318
+ * for the rendered element's: `Anchor` is a `Text` that renders an `<a>`, so it keeps Text's
319
+ * `variant` and takes the anchor's `href` and `onClick` in place of the paragraph's. Replaced rather
320
+ * than intersected, or a handler is typed against both elements when only one renders. A style
321
+ * prop the root declares is not an element key (see {@link ElementPropsOf}), so it survives the swap.
322
+ */
323
+ type RootSurface<L extends LayerMap, D, As> = [RenderedElementOf<L, D, As>] extends [L['root']] ? ElementSurface<L['root']> : Without<ElementSurface<L['root']>, keyof ElementSurface<RenderedElementOf<L, D, As>>> & ElementSurface<RenderedElementOf<L, D, As>>;
324
+ /**
325
+ * The element one call renders: what its `as` names, else what the component fixes.
326
+ *
327
+ * The call site's `as` replaces the fixed element rather than adding to it. Intersected instead, a
328
+ * handler on `<Box as="button">` would be typed against `HTMLButtonElement | HTMLDivElement` and
329
+ * `ref` against both, though the div is never rendered.
330
+ */
331
+ type RenderedElementOf<L extends LayerMap, D, As> = NamesNoElement<As> extends true ? ElementOf<L, D> : As;
332
+ /**
333
+ * The declared props a call site must write: declared `required: true` and given no default. A
334
+ * default supplies the value when the call site doesn't, so the surface stops asking for it.
335
+ */
336
+ type RequiredKey<P, D> = { [K in keyof P]: P[K] extends {
337
+ required: true;
338
+ } ? K extends keyof D ? never : K : never }[keyof P];
339
+ /**
340
+ * The declared props as a consumer sees them: optional, except the ones {@link RequiredKey} names,
341
+ * which the second half adds back without `?`. A key the render extra redefines is left to the
342
+ * extra.
343
+ *
344
+ * Two halves rather than one mapped type with an `as` clause, because the callable `defineComponent`
345
+ * is checked against its interface by relating two generic signatures, and a name type that reads
346
+ * `P` is not identical on the two sides of that comparison — a name type reading only `E` is.
347
+ */
348
+ type ConsumerDeclaredProps<P, D, E> = Without<Partial<DeclaredProps<P>>, Redefined<E>> & { [K in Exclude<RequiredKey<P, D>, Redefined<E>>]-?: K extends keyof DeclaredProps<P> ? DeclaredProps<P>[K] : never };
349
+ /**
350
+ * The keys a render extra redefines: the ones it names. An open extra (`extends Record<string,
351
+ * unknown>`) names nothing through its index signature, but a key it declares beside that signature
352
+ * still counts — `ColorArea`'s `onChange` takes a colour, not a change event, whatever its root's does.
353
+ */
354
+ type Redefined<E> = keyof Declared<E>;
355
+ /**
356
+ * Whether the system's build has filled the registry. Before it has, nothing about style props can
357
+ * be said, and every surface that depends on them stays open — an unbuilt consumer compiles the way
358
+ * the registry promises.
359
+ */
360
+ type Registered = [keyof RegisteredStyleProps] extends [never] ? false : true;
361
+ /** Every style prop the system registers, typed by the values it registers. */
362
+ type StyleProps = { [K in keyof RegisteredStyleProps]?: RegisteredStyleProps[K] };
363
+ /**
364
+ * A modifier's block: the same style props, applied under its condition. One level deep, because
365
+ * the runtime reads one — a block inside a block is a key it hands to the element.
366
+ */
367
+ type ModifierProps = { [K in keyof RegisteredModifiers]?: StyleProps };
368
+ /** The per-layer override channel the emitted module reads, keyed by this component's layers. */
369
+ type LayerProps<L extends LayerMap> = {
370
+ layerProps?: Partial<Record<keyof L & string, Record<string, unknown>>>;
371
+ };
372
+ /**
373
+ * What reaches a component without being declared: the system's style props, its modifiers, and the
374
+ * layer override channel. Named, so an excess-property check runs and `<Box colour="brand">` is
375
+ * refused as the typo it is, and so `Omit<ComponentProps<typeof Button>, 'size'>` keeps its remaining
376
+ * keys instead of collapsing to `unknown` over an index signature.
377
+ *
378
+ * Open before the build: which names are style props is the system's to say, and until its emitted
379
+ * types say it, anything may be one.
380
+ */
381
+ type OpenTail<L extends LayerMap> = Registered extends true ? StyleProps & ModifierProps & LayerProps<L> : Record<string, unknown>;
271
382
  /**
272
383
  * The props a consumer may pass — the declared ones, the rendered element's, and the style props.
273
384
  *
@@ -277,19 +388,47 @@ type ElementOf<L extends LayerMap, D> = D extends {
277
388
  * `size="sm"` failed with "string is not assignable to undefined" — an empty intersection, which is
278
389
  * the type saying no value could ever satisfy both.
279
390
  *
280
- * Open at the end on purpose: a component's style-prop surface is the system's, not this file's.
391
+ * `As` is the element a call site picks (`never` when it picks none), see {@link AsPropsOf}.
392
+ *
393
+ * Ends in {@link OpenTail}: the system's own surface, open until the system's build has named it.
394
+ */
395
+ type ComponentPropsOf<L extends LayerMap, P extends PropMap, D = Record<never, never>, E = Record<never, never>, F extends string = never, As = never> = ConsumerDeclaredProps<P, D, E> & Partial<E> & Redeclared<RootSurface<L, D, As>, P, E> & Redeclared<ForwardedPropsOf<L, F>, P, E> & AsPropsOf<As, P, E> & Redeclared<OpenTail<L>, P, E>;
396
+ /**
397
+ * `T` less the keys the component declares and the keys its render extra names — each taken out on
398
+ * its own, because {@link Without} leaves `T` whole when the key set is open, and an open render
399
+ * extra (`extends Record<string, unknown>`) must not stop the declared props from shadowing.
281
400
  */
282
- type ComponentPropsOf<L extends LayerMap, P extends PropMap, D = Record<never, never>, E = Record<never, never>, F extends string = never> = Without<Partial<DeclaredProps<P>>, keyof E> & Partial<E> & Omit<ElementPropsOf<ElementOf<L, D>>, keyof P | keyof E> & Omit<ForwardedPropsOf<L, F>, keyof P | keyof E> & Record<string, unknown>;
401
+ type Redeclared<T, P, E> = Without<Without<T, keyof P>, Redefined<E>>;
283
402
  /**
284
- * The element a call site picks with `as`, and the props that element brings — the polymorphic half
285
- * of the phantom signature. `<Box<'img', ImgHTMLAttributes<HTMLImageElement>> as="img" src=…>` names
286
- * the element (and, optionally, the attribute surface it wants typed) as type arguments, the way v1's
287
- * generated components took them. Without it a consumer's `<Box<'button'>>` was "Expected 0 type
288
- * arguments" at every site that had compiled for a year.
403
+ * The polymorphic half of the phantom signature: `as` itself, plus the refusal of attributes that
404
+ * belong to some other element.
405
+ *
406
+ * `As` is inferred from the `as` a call site writes, so `<Box as="img" src alt ref>` types `src`,
407
+ * `alt` and `ref` as an image's with no type argument. It may still be given one —
408
+ * `<Box<'img', ImgHTMLAttributes<HTMLImageElement>>>` is how v1's generated components took it.
409
+ *
410
+ * With no `as` there is nothing here, and `ComponentProps<typeof Box>` reads the fixed element alone.
289
411
  */
290
412
  type AsPropsOf<As, P, E> = [As] extends [never] ? Record<never, never> : {
291
413
  as?: As;
292
- } & ([As] extends [keyof JSX.IntrinsicElements] ? Omit<ComponentPropsWithoutRef<As>, keyof P | keyof E> : Record<never, never>);
414
+ } & ForeignAttributesOf<As, P, E>;
415
+ /** The attribute names across a union of tags — distributed, so `'a' | 'button'` keeps `href`. */
416
+ type IntrinsicAttributeNames<As> = As extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[As] : never;
417
+ /**
418
+ * The HTML attributes the element named by `as` does NOT take, each typed `never`.
419
+ *
420
+ * The surface is open at the end, so `<Box as="img" href>` would otherwise pass with `href: unknown`
421
+ * and reach the `<img>` as an attribute nothing reads. Refusing an attribute is only right when it
422
+ * is one — a name the component declares, a render extra, and a style prop the system registers are
423
+ * all excluded, since `width` on a `<span>` is a style prop the consumer meant, not a stray
424
+ * attribute. So is `as` itself, which `<link>` happens to take as an attribute. A component `as` is
425
+ * left alone: its props are its own to name.
426
+ *
427
+ * Nothing is refused until the system's build has filled {@link RegisteredStyleProps}: before that
428
+ * there is no telling a stray attribute from a style prop, and an unbuilt consumer compiles the way
429
+ * the registry promises.
430
+ */
431
+ type ForeignAttributesOf<As, P, E> = Registered extends false ? Record<never, never> : [As] extends [keyof JSX.IntrinsicElements] ? { [K in Exclude<keyof AllHTMLAttributes<HTMLElement>, 'as' | IntrinsicAttributeNames<As> | keyof P | keyof E | keyof RegisteredStyleProps>]?: never } : Record<never, never>;
293
432
  /**
294
433
  * The props a component picks up from the layers it FORWARDS.
295
434
  *
@@ -353,13 +492,14 @@ F extends string = never> extends Authored {
353
492
  * emitted module), but `export type ButtonProps = ComponentProps<typeof Button>` is how a consumer
354
493
  * names its props, and that reads this type.
355
494
  *
356
- * Two signatures. The GENERIC one takes the element a call site picks (`<Box<'img', Attrs>>`) — see
357
- * {@link AsPropsOf}. The plain one stays LAST, because `React.ComponentProps<typeof Box>` infers
358
- * from the last overload, and a consumer's `BoxProps` must not widen into a union over every
359
- * intrinsic element the moment `as` becomes typeable.
495
+ * One signature, generic over the element a call site picks with `as` — see {@link AsPropsOf}.
496
+ * A second, plain overload would take every call the generic one refuses: the surface is open at
497
+ * the end, so `<Box as="img" src={3}>` would compile through it with `src: unknown`.
498
+ *
499
+ * `Extra` is only ever given as a type argument. Inferred from the call, a spread of a union of
500
+ * prop bags would make it one member of the union, and the other member would then fail against it.
360
501
  */
361
- <As extends ElementType = never, Extra = Record<never, never>>(props: ComponentPropsOf<L, P, D, E, F> & AsPropsOf<As, P, E> & Partial<Extra>): null;
362
- (props: ComponentPropsOf<L, P, D, E, F>): null;
502
+ <As extends AsInput = never, Extra = Record<never, never>>(props: ComponentPropsOf<L, P, D, E, F, As> & Partial<NoInfer<Extra>>): null;
363
503
  readonly kind: 'component';
364
504
  /** The authored body, readable so codegen can pair it with the render found in the source. */
365
505
  readonly body: Record<string, unknown>;
@@ -467,8 +607,17 @@ interface DefineComponent {
467
607
  /** The whole body at once, for a component with nothing to narrow step by step. */
468
608
  (body?: Record<string, unknown>): AuthoredComponent;
469
609
  layers<const L extends LayerMap>(layers: L): ComponentBuilder<L, Record<never, never>>;
470
- props<const P extends PropMap<LayerPath>>(props: P & NoInfer<{ [K in keyof P]: Exact<P[K], AuthoredProp<LayerPath>> }>): ComponentBuilder<LayerMap, P>;
610
+ props: typeof definePropsFirst;
471
611
  }
612
+ /**
613
+ * `defineComponent.props({…})`, with no layers named yet. Declared as a function so the object below
614
+ * carries this exact type: two generic signatures compared structurally infer one's `P` as the
615
+ * other's `P & NoInfer<…>`, and the required half of the surface does not relate across that.
616
+ *
617
+ * The type argument is explicit so the builder does not INFER `P2` from an already-exact value: it
618
+ * would then apply the guard over its own output, which nothing satisfies.
619
+ */
620
+ declare function definePropsFirst<const P extends PropMap<LayerPath>>(props: P & NoInfer<{ [K in keyof P]: Exact<P[K], AuthoredProp<LayerPath>> }>): ComponentBuilder<LayerMap, P>;
472
621
  declare const defineComponent: DefineComponent;
473
622
  //#endregion
474
- export { AuthoredComponent, AuthoredProp, ComponentBuilder, ComponentPropsOf, LayerElement, LayerMap, PropDecl, PropMap, RenderArgs, StyleRuleInput, defineComponent };
623
+ export { AsInput, AuthoredComponent, AuthoredProp, ComponentBuilder, ComponentPropsOf, LayerElement, LayerMap, PropDecl, PropMap, RenderArgs, StyleRuleInput, defineComponent };
@@ -338,9 +338,20 @@ function defineComponentImpl(bodyOrElement) {
338
338
  if (typeof bodyOrElement === "string" || isRef(bodyOrElement)) return build({ layers: { root: bodyOrElement } });
339
339
  return build(bodyOrElement ?? {});
340
340
  }
341
+ /**
342
+ * `defineComponent.props({…})`, with no layers named yet. Declared as a function so the object below
343
+ * carries this exact type: two generic signatures compared structurally infer one's `P` as the
344
+ * other's `P & NoInfer<…>`, and the required half of the surface does not relate across that.
345
+ *
346
+ * The type argument is explicit so the builder does not INFER `P2` from an already-exact value: it
347
+ * would then apply the guard over its own output, which nothing satisfies.
348
+ */
349
+ function definePropsFirst(props) {
350
+ return build({}).props(props);
351
+ }
341
352
  const defineComponent = Object.assign(defineComponentImpl, {
342
353
  layers: (layers) => build({}).layers(layers),
343
- props: (props) => build({}).props(props)
354
+ props: definePropsFirst
344
355
  });
345
356
  //#endregion
346
357
  export { defineComponent };
@@ -28,6 +28,14 @@ interface RegisteredPaths {}
28
28
  * prop allows off-system values). What a component's JSX props are typed against.
29
29
  */
30
30
  interface RegisteredStyleProps {}
31
+ /**
32
+ * Modifier prop → `true`, under the name a call site writes (`_hover`, `_dark`). A modifier's value
33
+ * is a block of style props applied under its condition, so the key is all the registry needs.
34
+ *
35
+ * Filled by the same emitted file as {@link RegisteredStyleProps}, and read only once that one is:
36
+ * a component's prop surface closes over both together.
37
+ */
38
+ interface RegisteredModifiers {}
31
39
  /**
32
40
  * Accessor name → the entity class that accessor addresses. Filled per config:
33
41
  *
@@ -92,4 +100,4 @@ type PathOf<K extends string> = K extends keyof RegisteredPaths ? RegisteredPath
92
100
  /** The value type for a style prop — its registered union, else `string`. */
93
101
  type ValueOf<P extends string> = P extends keyof RegisteredStyleProps ? RegisteredStyleProps[P] extends string | number ? RegisteredStyleProps[P] : string : string;
94
102
  //#endregion
95
- export { ComponentContractOf, PathOf, RegisteredComponentContracts, RegisteredEntities, RegisteredPaths, RegisteredStyleProps, ValueOf };
103
+ export { ComponentContractOf, PathOf, RegisteredComponentContracts, RegisteredEntities, RegisteredModifiers, RegisteredPaths, RegisteredStyleProps, ValueOf };
@@ -6,8 +6,15 @@ interface Ref {
6
6
  }
7
7
  /** A ref as the authoring API returns it. The method is non-enumerable, so an ordinary ref remains
8
8
  * exactly `{ __ref }` in JSON and anywhere that walks its data. Calling it produces the explicit
9
- * wire value below: a base ref plus the sparse fields this config owns. */
10
- type ExtendableRef<Delta extends Record<string, unknown>> = Ref & {
9
+ * wire value below: a base ref plus the sparse fields this config owns.
10
+ *
11
+ * `Marker` is the `kind:path` string as written, kept literal so a declaration that holds the ref
12
+ * can be typed by what it points at: `bg: StyleProperty.ref('bg')` reads its values off the
13
+ * registered `bg`, and an alias like `columns: StyleProperty.ref('gridTemplateColumns')` reads the
14
+ * target's, not the name's. */
15
+ type ExtendableRef<Delta extends Record<string, unknown>, Marker extends string = string> = {
16
+ readonly __ref: Marker;
17
+ } & {
11
18
  extend(delta: Delta): ExtendedRef<Delta>;
12
19
  };
13
20
  /** A linked entity plus the sparse local fields layered over it. `extend` is data here, not the
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ import { CreateInput, FieldsSchema, declaredField, deriveCreateSchema, deriveUpd
12
12
  import { ComputedMap, DeriveMembers, DerivedEntityClass, defineDerivedEntity } from "./framework/defineDerivedEntity.js";
13
13
  import { DerivedOp, OpHandler, SchemaEntry, UserSchemas } from "./framework/schemas.js";
14
14
  import { SubEntityClass, defineSubEntity } from "./framework/defineSubEntity.js";
15
- import { ComponentContractOf, PathOf, RegisteredComponentContracts, RegisteredEntities, RegisteredPaths, RegisteredStyleProps, ValueOf } from "./framework/registered.js";
15
+ import { ComponentContractOf, PathOf, RegisteredComponentContracts, RegisteredEntities, RegisteredModifiers, RegisteredPaths, RegisteredStyleProps, ValueOf } from "./framework/registered.js";
16
16
  import { LocalOverlay, SerializedSourceAnswer, SourceAnswer, SourceResolution, SourceResolutionSchemas, SourceResolver, SourceState, UNREACHABLE, resolutionSchema, sourceUnreachable } from "./framework/sources.js";
17
17
  import { Authored, isAuthored } from "./framework/authoring.js";
18
18
  import { GROUP, GroupBody, brandGroup, isGroupBody } from "./framework/utils/group.js";
@@ -37,7 +37,7 @@ import { ColorValue, DerivedColor, Gradient, alpha, darken, isDerivedColor, isGr
37
37
  import { NativeToken, nativeTokenValue } from "./entities/native/NativeToken.js";
38
38
  import { CANVAS_ROLES, CanvasRole, CanvasRoleName } from "./entities/system/CanvasRole.js";
39
39
  import { StyleValue } from "./entities/system/style-bag.js";
40
- import { AuthoredComponent, AuthoredProp, ComponentBuilder, ComponentPropsOf, LayerElement, LayerMap, PropDecl, PropMap, RenderArgs, StyleRuleInput, defineComponent } from "./entities/system/defineComponent.js";
40
+ import { AsInput, AuthoredComponent, AuthoredProp, ComponentBuilder, ComponentPropsOf, LayerElement, LayerMap, PropDecl, PropMap, RenderArgs, StyleRuleInput, defineComponent } from "./entities/system/defineComponent.js";
41
41
  import { AuthoredPropBody, Component, ComponentBody, ComponentElementBody, ComponentPropBody, ComponentReference, ComponentStyleBody, ElementVisibility, ElementVisibilityInput, ExtendedComponentRef, ProjectedVisibility, VariantValueBody, VariantValues, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef } from "./entities/system/Component.js";
42
42
  import { Composite } from "./entities/system/Composite.js";
43
43
  import { ComponentModuleSource, ComponentRegistryImport, ComponentRegistryImportBinding, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports } from "./entities/system/component-module.js";
@@ -87,4 +87,4 @@ import { valueLeavesOf, valueSchemaOf } from "./framework/value-domain.js";
87
87
  import { views } from "./framework/views-facade.js";
88
88
  import { RN_STYLE_KEYS } from "./react-native/style-keys.generated.js";
89
89
  import { namedSlotTargets } from "./spec/empty-node-slots.js";
90
- export { AI_LANES, AiChat, AiFlow, type AiFlowOrigin, AiGeneration, type AiLane, AiMessage, type AiMultiAgentMode, type AnySystemConfig, type AttachedSources, type Authored, type AuthoredComponent, type AuthoredProp, type AuthoredPropBody, type AuthoringSignatureOptions, BUILD_DEFAULTS, type BreakOutcome, type BreakPlan, type BreakPlanInput, type BreakPlanRow, type BreakReach, BuildSection, CANVAS_ROLES, CONFIG_OPERATION_KIND, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, Canvas, CanvasConfig, CanvasRole, type CanvasRoleName, CanvasSection, type Change, type ChangeHook, type ChangeTarget, type ChildrenPolicy, type Collection, type ColorValue, Component, type ComponentBody, type ComponentBuilder, type ComponentContractOf, type ComponentElementBody, type ComponentModuleSource, type ComponentPropBody, type ComponentPropsOf, type ComponentReference, type ComponentRegistryImport, type ComponentRegistryImportBinding, type ComponentRuleClass, type ComponentSpec, type ComponentSpecs, type ComponentStyleBody, Composite, type ComputedFields, type ComputedInput, type ComputedMap, Config, type ConfigClass, type ConfigEdit, ConfigFormatError, type ConfigInstance, type ConfigIssue, type ConfigIssueCode, type ConfigKind, type ConfigOp, ConfigRejection, ConfigSession, type ConfigSessionOptions, type ConfigSink, type ConfigSource, type CopyPlan, type CopyPlanInput, type CopyPlanRow, type CreateInput, type CssGrammar, type CssPrefix, type CssPropertyEntry, CssSection, DERIVED_MUTATIONS, type DanglingDirective, type DanglingLocalRef, type DanglingRef, type DeclaredRuntimeModule, type DeletePlan, type DeriveMembers, type DerivedColor, type DerivedEntityClass, type DerivedOp, Device, type DraftSource, ENTITY_PATH_MESSAGE, EXPORT_MEMBER, type Edition, type ElementVisibility, type ElementVisibilityInput, Entity, type EntityAddress, type EntityChange, type EntityClass, type EntityKind, type EntityMap, type ExpandOptions, type ExpansionResult, type ExtendedComponentRef, type ExtendedRef, type FieldsSchema, File, Font, FontFile, type ForwardClaims, GROUP, GUIDANCE_LANES, GlobalStyle, type Gradient, type GroupBody, Guidance, type GuidanceLane, type GuidanceScope, type GuidanceSegment, GuidanceStyle, type GuidanceStyleBody, type HasSnapshot, type HydrationOptions, ICON_METADATA_FORMATS, Icon, type IconLibrary, type IconMemberMetadata, type IconMetadataAdapter, type IconMetadataDeclaration, type IconMetadataFile, type IconMetadataFormat, type IdentifiedOp, type InferredRename, type ItemOf, type KindSignature, type KindSlice, LINK_SLUG, LINK_SLUG_MESSAGE, type LayerElement, type LayerMap, type LayerStyleOptions, type LeafAddress, type LinkArrival, type LinkDeclaration, type LinkPaths, type LinkPlan, type LinkPlanInput, LinkedSystem, type LinkedSystemResolver, type LinkedSystemState, type ListOptions, type LiveConfig, type LocalOverlay, MINTED, MODIFIER_CATEGORIES, type MisdeclaredOverlay, Modifier, type ModifierCategory, type ModifierGroupMeta, Motion, NATIVE_ACTIVATIONS, type NativeActivation, NativeModifier, NativeSettings, NativeStyleProperty, NativeToken, Node, type OpHandler, type OpInput, Operation, type OverlayVerb, type OverrideCondition, type OwnedRecords, PLAYGROUND_DEFAULTS, Package, Page, type Patch, type PathOf, type PinDirective, type PinOptions, type PinOptionsField, type Plan, type PlanImpact, type PlanOp, PlaygroundSection, type PreviewMatrix, type ProjectedVisibility, type PropDecl, type PropDeclaration, type PropMap, RN_STYLE_KEYS, ReactNativeSystem, type ReactNativeSystemConfig, type RebaseConflict, type RebaseOrigin, type RebaseResult, type RecordedSource, type RedundantQualifier, type Ref, type RefGraph, type RefGraphEntry, type RefIndex, type RefIndexChange, type RefMember, type RefTarget, type RegisteredComponentContracts, type RegisteredEntities, type RegisteredPaths, type RegisteredStyleProps, type RenamePlan, type RenderArgs, type RenderElement, type RenderSpec, type RenderedTarget, type ResolveValueTypeInput, type ResolvedSource, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, type SchemaEntry, type SchemaMigration, SchemaVersionTooNew, type SerializedConfig, type SerializedSourceAnswer, Settings, type SignatureOptions, type SkippedOp, type SlotTarget, Snapshot, type Source, type SourceAnswer, type SourceChange, type SourceMap, type SourceResolution, type SourceResolutionSchemas, type SourceResolver, type SourceRowState, type SourceState, type SourceUnavailable, type SourcesBySlug, type SourcesOf, type SpecNode, type SplitStyleProps, type StampedPatch, type StoredConfig, type StoredPreviewCondition, type StylePropEntry, type StylePropLeaf, type StylePropValue, type StylePropValueCtx, type StylePropValueKind, StyleProperty, type StylePropertyItem, type StyleRuleInput, type StyleValue, type SubEntityClass, type SubPatch, type SurfaceCompositeProp, type SurfaceProp, type SurfacePropKind, type SurfaceScalarProp, type SurfaceSlotProp, type SurfaceStylePropertyProp, type SurfaceVariantProp, System, type SystemConfig, SystemSection, SystemSource, Token, type TokenBinding, type TokenBody, type TokenMatch, Tool, type TraverseOptions, type TreeNode, UNREACHABLE, type UnadoptedDirective, type UnknownStyleLeaf, type UnlinkPlan, type UnlinkPlanInput, type UnreadableBorrow, type UnstatableCondition, type UpgradedDraft, type UserSchemas, VOID_ELEMENTS, type ValueOf, type ValueType, type VariantValueBody, type VariantValues, type VisibilityOperator, type VisibilityTerm, WEB_ACTIVATIONS, type WalkOptions, type WebActivation, addressOf, alpha, applyPathDelta, assetType, authoredBag, authoredValue, authoringSignatures, baseOf, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, canonicalWhen, changeOf, changeValueAt, changesOf, childrenPolicy, className, classPrefixOf, classifyStylePropValue, collectRefs, componentClassBase, componentCompositeClasses, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentRegistryImports, componentRuleClasses, componentSpec, createCanvasConfig, createSliceMemo, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declaredField, declaredPropRouting, declaredRuntimeModules, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, editOp, entityRefOf, entryKeyOf, expandComponent, expandSpec, fieldKeys, fontFamilyStack, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forwardClaims, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, guidanceReaches, guidanceScopeOf, guidanceTextOf, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, inferredRenames, inputOf, instanceSpec, intoName, isAuthored, isBinaryAsset, isConfigFormatError, isConfigRejection, isCssProperty, isDeclaredElementProp, isDerivedColor, isEntityPath, isExtendedRef, isForceModeProp, isGradient, isGroupBody, isLinkSlug, isMintedRow, isNativeConfig, isPlainObject, isRef, isSystemConfig, kebabComponent, kindOf, kindsOf, layerCompositeProps, layerRef, layerStyles, leafAddresses, leafVerb, leavesOfStylePropValue, lighten, linearGradient, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, namedFields, namedSlotTargets, nativeTokenValue, negatedCssValue, normalizeName, opOf, opVerb, opacityPercentage, opsForKind, orRef, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, ownValues, ownerOf, ownsItsValues, packageKey, packageName, partsOf, pathDelta, pathOf, pathSegments, planBreak, planCopy, planLink, planUnlink, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propOwner, propValueDomain, propValueFromAxis, redundantQualifiers, ref, refGraphOf, refLeaf, refSchema, registerSchemaMigrations, renderDerivedColor, renderGradient, renderSignature, renderStyleValue, renderedElement, renderedTarget, resolutionSchema, resolveComponentProps, resolveFieldValue, resolveIconLibrary, resolveInputDir, resolveOutDir, resolveRegistryDir, resolveTokenValue, resolveTokenValueUnder, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rnStyleKey, rootLayerOf, routedBag, routedProp, routedPropIn, routesContent, ruleApplies, ruleCondition, runChangeHooks, schemaVersionOf, searchEntities, searchTokens, setAtPath, signatureOf, slotTargetsOf, sniffValueType, sourceEntries, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specWithResolvedVisibility, splitRef, splitStyleProps, stamp, styleAliasesOf, styleDeclarations, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, toCssPropertyName, tokenBinding, touchedFields, unadoptedDirectives, unknownStyleLeaves, unreadableBorrows, unstatableConditions, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueLeavesOf, valueRef, valueSchemaOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, withoutTruthyTerm };
90
+ export { AI_LANES, AiChat, AiFlow, type AiFlowOrigin, AiGeneration, type AiLane, AiMessage, type AiMultiAgentMode, type AnySystemConfig, type AsInput, type AttachedSources, type Authored, type AuthoredComponent, type AuthoredProp, type AuthoredPropBody, type AuthoringSignatureOptions, BUILD_DEFAULTS, type BreakOutcome, type BreakPlan, type BreakPlanInput, type BreakPlanRow, type BreakReach, BuildSection, CANVAS_ROLES, CONFIG_OPERATION_KIND, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, Canvas, CanvasConfig, CanvasRole, type CanvasRoleName, CanvasSection, type Change, type ChangeHook, type ChangeTarget, type ChildrenPolicy, type Collection, type ColorValue, Component, type ComponentBody, type ComponentBuilder, type ComponentContractOf, type ComponentElementBody, type ComponentModuleSource, type ComponentPropBody, type ComponentPropsOf, type ComponentReference, type ComponentRegistryImport, type ComponentRegistryImportBinding, type ComponentRuleClass, type ComponentSpec, type ComponentSpecs, type ComponentStyleBody, Composite, type ComputedFields, type ComputedInput, type ComputedMap, Config, type ConfigClass, type ConfigEdit, ConfigFormatError, type ConfigInstance, type ConfigIssue, type ConfigIssueCode, type ConfigKind, type ConfigOp, ConfigRejection, ConfigSession, type ConfigSessionOptions, type ConfigSink, type ConfigSource, type CopyPlan, type CopyPlanInput, type CopyPlanRow, type CreateInput, type CssGrammar, type CssPrefix, type CssPropertyEntry, CssSection, DERIVED_MUTATIONS, type DanglingDirective, type DanglingLocalRef, type DanglingRef, type DeclaredRuntimeModule, type DeletePlan, type DeriveMembers, type DerivedColor, type DerivedEntityClass, type DerivedOp, Device, type DraftSource, ENTITY_PATH_MESSAGE, EXPORT_MEMBER, type Edition, type ElementVisibility, type ElementVisibilityInput, Entity, type EntityAddress, type EntityChange, type EntityClass, type EntityKind, type EntityMap, type ExpandOptions, type ExpansionResult, type ExtendedComponentRef, type ExtendedRef, type FieldsSchema, File, Font, FontFile, type ForwardClaims, GROUP, GUIDANCE_LANES, GlobalStyle, type Gradient, type GroupBody, Guidance, type GuidanceLane, type GuidanceScope, type GuidanceSegment, GuidanceStyle, type GuidanceStyleBody, type HasSnapshot, type HydrationOptions, ICON_METADATA_FORMATS, Icon, type IconLibrary, type IconMemberMetadata, type IconMetadataAdapter, type IconMetadataDeclaration, type IconMetadataFile, type IconMetadataFormat, type IdentifiedOp, type InferredRename, type ItemOf, type KindSignature, type KindSlice, LINK_SLUG, LINK_SLUG_MESSAGE, type LayerElement, type LayerMap, type LayerStyleOptions, type LeafAddress, type LinkArrival, type LinkDeclaration, type LinkPaths, type LinkPlan, type LinkPlanInput, LinkedSystem, type LinkedSystemResolver, type LinkedSystemState, type ListOptions, type LiveConfig, type LocalOverlay, MINTED, MODIFIER_CATEGORIES, type MisdeclaredOverlay, Modifier, type ModifierCategory, type ModifierGroupMeta, Motion, NATIVE_ACTIVATIONS, type NativeActivation, NativeModifier, NativeSettings, NativeStyleProperty, NativeToken, Node, type OpHandler, type OpInput, Operation, type OverlayVerb, type OverrideCondition, type OwnedRecords, PLAYGROUND_DEFAULTS, Package, Page, type Patch, type PathOf, type PinDirective, type PinOptions, type PinOptionsField, type Plan, type PlanImpact, type PlanOp, PlaygroundSection, type PreviewMatrix, type ProjectedVisibility, type PropDecl, type PropDeclaration, type PropMap, RN_STYLE_KEYS, ReactNativeSystem, type ReactNativeSystemConfig, type RebaseConflict, type RebaseOrigin, type RebaseResult, type RecordedSource, type RedundantQualifier, type Ref, type RefGraph, type RefGraphEntry, type RefIndex, type RefIndexChange, type RefMember, type RefTarget, type RegisteredComponentContracts, type RegisteredEntities, type RegisteredModifiers, type RegisteredPaths, type RegisteredStyleProps, type RenamePlan, type RenderArgs, type RenderElement, type RenderSpec, type RenderedTarget, type ResolveValueTypeInput, type ResolvedSource, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, type SchemaEntry, type SchemaMigration, SchemaVersionTooNew, type SerializedConfig, type SerializedSourceAnswer, Settings, type SignatureOptions, type SkippedOp, type SlotTarget, Snapshot, type Source, type SourceAnswer, type SourceChange, type SourceMap, type SourceResolution, type SourceResolutionSchemas, type SourceResolver, type SourceRowState, type SourceState, type SourceUnavailable, type SourcesBySlug, type SourcesOf, type SpecNode, type SplitStyleProps, type StampedPatch, type StoredConfig, type StoredPreviewCondition, type StylePropEntry, type StylePropLeaf, type StylePropValue, type StylePropValueCtx, type StylePropValueKind, StyleProperty, type StylePropertyItem, type StyleRuleInput, type StyleValue, type SubEntityClass, type SubPatch, type SurfaceCompositeProp, type SurfaceProp, type SurfacePropKind, type SurfaceScalarProp, type SurfaceSlotProp, type SurfaceStylePropertyProp, type SurfaceVariantProp, System, type SystemConfig, SystemSection, SystemSource, Token, type TokenBinding, type TokenBody, type TokenMatch, Tool, type TraverseOptions, type TreeNode, UNREACHABLE, type UnadoptedDirective, type UnknownStyleLeaf, type UnlinkPlan, type UnlinkPlanInput, type UnreadableBorrow, type UnstatableCondition, type UpgradedDraft, type UserSchemas, VOID_ELEMENTS, type ValueOf, type ValueType, type VariantValueBody, type VariantValues, type VisibilityOperator, type VisibilityTerm, WEB_ACTIVATIONS, type WalkOptions, type WebActivation, addressOf, alpha, applyPathDelta, assetType, authoredBag, authoredValue, authoringSignatures, baseOf, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, canonicalWhen, changeOf, changeValueAt, changesOf, childrenPolicy, className, classPrefixOf, classifyStylePropValue, collectRefs, componentClassBase, componentCompositeClasses, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentRegistryImports, componentRuleClasses, componentSpec, createCanvasConfig, createSliceMemo, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declaredField, declaredPropRouting, declaredRuntimeModules, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, editOp, entityRefOf, entryKeyOf, expandComponent, expandSpec, fieldKeys, fontFamilyStack, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forwardClaims, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, guidanceReaches, guidanceScopeOf, guidanceTextOf, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, inferredRenames, inputOf, instanceSpec, intoName, isAuthored, isBinaryAsset, isConfigFormatError, isConfigRejection, isCssProperty, isDeclaredElementProp, isDerivedColor, isEntityPath, isExtendedRef, isForceModeProp, isGradient, isGroupBody, isLinkSlug, isMintedRow, isNativeConfig, isPlainObject, isRef, isSystemConfig, kebabComponent, kindOf, kindsOf, layerCompositeProps, layerRef, layerStyles, leafAddresses, leafVerb, leavesOfStylePropValue, lighten, linearGradient, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, namedFields, namedSlotTargets, nativeTokenValue, negatedCssValue, normalizeName, opOf, opVerb, opacityPercentage, opsForKind, orRef, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, ownValues, ownerOf, ownsItsValues, packageKey, packageName, partsOf, pathDelta, pathOf, pathSegments, planBreak, planCopy, planLink, planUnlink, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propOwner, propValueDomain, propValueFromAxis, redundantQualifiers, ref, refGraphOf, refLeaf, refSchema, registerSchemaMigrations, renderDerivedColor, renderGradient, renderSignature, renderStyleValue, renderedElement, renderedTarget, resolutionSchema, resolveComponentProps, resolveFieldValue, resolveIconLibrary, resolveInputDir, resolveOutDir, resolveRegistryDir, resolveTokenValue, resolveTokenValueUnder, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rnStyleKey, rootLayerOf, routedBag, routedProp, routedPropIn, routesContent, ruleApplies, ruleCondition, runChangeHooks, schemaVersionOf, searchEntities, searchTokens, setAtPath, signatureOf, slotTargetsOf, sniffValueType, sourceEntries, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specWithResolvedVisibility, splitRef, splitStyleProps, stamp, styleAliasesOf, styleDeclarations, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, toCssPropertyName, tokenBinding, touchedFields, unadoptedDirectives, unknownStyleLeaves, unreadableBorrows, unstatableConditions, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueLeavesOf, valueRef, valueSchemaOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, withoutTruthyTerm };
@@ -1,5 +1,6 @@
1
1
  import { CopyPlan } from "../../entities/system/copy-plan.js";
2
- import { Ref } from "../../framework/utils/refs.js";
2
+ import { ExtendableRef, Ref } from "../../framework/utils/refs.js";
3
+ import { CreateInput } from "../../framework/utils/field-schema.js";
3
4
  import { DerivedEntityClass } from "../../framework/defineDerivedEntity.js";
4
5
  import { SubEntityClass } from "../../framework/defineSubEntity.js";
5
6
  import { ComponentContractOf, PathOf } from "../../framework/registered.js";
@@ -1012,7 +1013,7 @@ declare function loadV1Artifact(studio: V1Artifact, options?: LoadV1Options): Co
1012
1013
  __ref: _$zod.ZodString;
1013
1014
  }, _$zod_v4_core0.$strip>>;
1014
1015
  }, _$zod_v4_core0.$strip>, "modifier", Record<never, never>, Record<never, never>, false>;
1015
- styleProps: EntityClass<_$zod.ZodObject<{
1016
+ styleProps: Omit<EntityClass<_$zod.ZodObject<{
1016
1017
  properties: _$zod.ZodArray<_$zod.ZodString>;
1017
1018
  values: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodType<StylePropValue, unknown, _$zod_v4_core0.$ZodTypeInternals<StylePropValue, unknown>>>>;
1018
1019
  responsive: _$zod.ZodDefault<_$zod.ZodBoolean>;
@@ -1038,7 +1039,19 @@ declare function loadV1Artifact(studio: V1Artifact, options?: LoadV1Options): Co
1038
1039
  data: Record<string, unknown>;
1039
1040
  } | undefined;
1040
1041
  };
1041
- }, Record<never, never>, false>;
1042
+ }, Record<never, never>, false>, "ref"> & {
1043
+ ref<const Path extends PathOf<"style-property">>(path: Path): ReturnType<(path: string) => ExtendableRef<Partial<CreateInput<_$zod.ZodObject<{
1044
+ properties: _$zod.ZodArray<_$zod.ZodString>;
1045
+ values: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodType<StylePropValue, unknown, _$zod_v4_core0.$ZodTypeInternals<StylePropValue, unknown>>>>;
1046
+ responsive: _$zod.ZodDefault<_$zod.ZodBoolean>;
1047
+ classPrefix: _$zod.ZodOptional<_$zod.ZodString>;
1048
+ arbitrary: _$zod.ZodDefault<_$zod.ZodBoolean>;
1049
+ negates: _$zod.ZodDefault<_$zod.ZodBoolean>;
1050
+ opacityOf: _$zod.ZodOptional<_$zod.ZodLazy<_$zod.ZodType<Ref, unknown, _$zod_v4_core0.$ZodTypeInternals<Ref, unknown>>>>;
1051
+ }, _$zod_v4_core0.$strip>>>>> & {
1052
+ readonly __ref: `style-property:${Path}`;
1053
+ };
1054
+ };
1042
1055
  composites: EntityClass<_$zod.ZodObject<{
1043
1056
  styles: SubEntityClass<_$zod.ZodType<StyleValue, unknown, _$zod_v4_core0.$ZodTypeInternals<StyleValue, unknown>>>;
1044
1057
  }, _$zod_v4_core0.$strip>, _$zod.ZodObject<Record<never, never>, _$zod_v4_core0.$strip>, "composite", Record<never, never>, Record<never, never>, false>;