@yahoo/uds-create-config 1.9.0 → 1.11.0-v3-import.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.
- package/dist/Component.d.ts +11 -1
- package/dist/Component.js +14 -0
- package/dist/Props.d.ts +18 -5
- package/dist/StyleProp.js +1 -0
- package/dist/asset-value.d.ts +23 -0
- package/dist/asset-value.js +40 -0
- package/dist/defineAssetGroup.d.ts +7 -0
- package/dist/defineAssetGroup.js +19 -1
- package/dist/factories.d.ts +103 -11
- package/dist/factories.js +25 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +4 -3
- package/dist/refs.d.ts +25 -2
- package/dist/refs.js +10 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/css-properties.d.ts +1 -0
- package/dist/types.d.ts +43 -7
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ComponentRef, CompositeRef, ModeRef, TagRef, TokenGroupRef, TokenRef } from "./refs.js";
|
|
1
|
+
import { AssetRef, ComponentRef as ComponentRef$1, CompositeRef, ModeRef, TagRef, TokenGroupRef, TokenRef } from "./refs.js";
|
|
2
2
|
import { ColorExpression } from "./colorExpressions.js";
|
|
3
3
|
import { CssPropertyName, CssPropertyValues } from "./types/css-properties.js";
|
|
4
4
|
import { IconAssetMetadata } from "./defineAssetGroup.js";
|
|
5
|
+
import { ComponentRef, JSX } from "react";
|
|
5
6
|
|
|
6
7
|
//#region src/types.d.ts
|
|
7
8
|
/**
|
|
@@ -21,7 +22,7 @@ type TokenType = string;
|
|
|
21
22
|
* expression to a CSS function call (`color-mix(...)`,
|
|
22
23
|
* `linear-gradient(...)`) via `resolveColorExpression`.
|
|
23
24
|
*/
|
|
24
|
-
type TokenValue = string | number | boolean | TokenRef | ColorExpression;
|
|
25
|
+
type TokenValue = string | number | boolean | TokenRef | AssetRef | ColorExpression;
|
|
25
26
|
type TokenModifierKey = `_${string}`;
|
|
26
27
|
type TokenModifierValue = TokenValue | TokenDefinition;
|
|
27
28
|
/**
|
|
@@ -143,11 +144,16 @@ interface ValueAlias {
|
|
|
143
144
|
* (e.g. `'transparent'` for `border-color`).
|
|
144
145
|
* - `number` — bare numeric values where CSS itself accepts numbers
|
|
145
146
|
* (e.g. `line-clamp: 3`).
|
|
147
|
+
* - `boolean` — a toggle value. `true` emits the bare class prefix as a
|
|
148
|
+
* hook (the runtime `boolAlias` path), `false` emits nothing (off);
|
|
149
|
+
* combine with string entries for a `boolean | 'first' | 'last'`-style
|
|
150
|
+
* surface (e.g. `nestedBorderRadius`). The accompanying `cssProperty`
|
|
151
|
+
* is typically a custom property used only as the class carrier.
|
|
146
152
|
* - `ValueAlias<P>` — `{ alias, value }` pair for Tailwind-style
|
|
147
153
|
* shorthands; the alias appears at the JSX value site and resolves
|
|
148
154
|
* to the underlying CSS keyword at emit time.
|
|
149
155
|
*/
|
|
150
|
-
type ValuesEntry<P extends StylePropProperty = StylePropProperty> = TokenGroupRef | LiteralFor<P> | number | ValueAlias;
|
|
156
|
+
type ValuesEntry<P extends StylePropProperty = StylePropProperty> = TokenGroupRef | LiteralFor<P> | number | boolean | ValueAlias;
|
|
151
157
|
interface ArbitrarySpec {
|
|
152
158
|
type?: TokenType;
|
|
153
159
|
}
|
|
@@ -302,7 +308,7 @@ interface StylePropDefinition<P extends StylePropProperty> {
|
|
|
302
308
|
interface AnyStylePropDefinition {
|
|
303
309
|
cssProperty: StylePropProperty | readonly StylePropProperty[];
|
|
304
310
|
classPrefix: string;
|
|
305
|
-
values?: readonly (TokenGroupRef | string | number | ValueAlias)[];
|
|
311
|
+
values?: readonly (TokenGroupRef | string | number | boolean | ValueAlias)[];
|
|
306
312
|
arbitrary?: ArbitraryInput;
|
|
307
313
|
/** See {@link StylePropDefinition.negative} — emit `calc(<value> * -1)`. */
|
|
308
314
|
negative?: boolean;
|
|
@@ -362,7 +368,7 @@ type MotionDefinitionInput = CssMotionDefinition | JsMotionDefinition;
|
|
|
362
368
|
* code because they round-trip cleanly through JSON.
|
|
363
369
|
*/
|
|
364
370
|
interface LayerWithOverrides {
|
|
365
|
-
tag: string | TagRef | ComponentRef;
|
|
371
|
+
tag: string | TagRef | ComponentRef$1;
|
|
366
372
|
defaultProps?: Record<string, unknown>;
|
|
367
373
|
base?: Record<string, unknown>;
|
|
368
374
|
[key: string]: unknown;
|
|
@@ -387,7 +393,7 @@ interface LayerWithOverrides {
|
|
|
387
393
|
* `Layer.tag` and leaves the remaining fields on the layer entry
|
|
388
394
|
* for codegen to read.
|
|
389
395
|
*/
|
|
390
|
-
type LayerInput = string | TagRef | ComponentRef | ComponentDefinition | LayerWithOverrides;
|
|
396
|
+
type LayerInput = string | TagRef | ComponentRef$1 | ComponentDefinition | LayerWithOverrides;
|
|
391
397
|
type BaseStyles = Record<string, Record<string, unknown>>;
|
|
392
398
|
interface CompoundPropsEntry {
|
|
393
399
|
when: Record<string, unknown>;
|
|
@@ -467,6 +473,22 @@ type RootTag<TLayers> = TLayers extends {
|
|
|
467
473
|
* the narrow forms only kick in when authoring chains thread literal
|
|
468
474
|
* generics through (`defineComponent('div')` → `TTag = 'div'`).
|
|
469
475
|
*/
|
|
476
|
+
/**
|
|
477
|
+
* HTML or SVG tag name used to declare a component's forwarded-ref target
|
|
478
|
+
* element via `.config({ ref: 'button' })`. Opt-in by design: a component that
|
|
479
|
+
* omits `ref` exposes no `ref` prop at all, rather than a guessed default.
|
|
480
|
+
*
|
|
481
|
+
* Sourced from React's `JSX.IntrinsicElements` (not the DOM lib's
|
|
482
|
+
* `HTMLElementTagNameMap`) so it resolves under the Bun tsconfig, whose `lib`
|
|
483
|
+
* omits the DOM tag-name maps.
|
|
484
|
+
*/
|
|
485
|
+
type RefTag = keyof JSX.IntrinsicElements;
|
|
486
|
+
/**
|
|
487
|
+
* Map a {@link RefTag} to its DOM element interface via React's `ComponentRef`
|
|
488
|
+
* — `'div'` → `HTMLDivElement`, `'svg'` → `SVGSVGElement`. Falls back to
|
|
489
|
+
* `HTMLElement` for anything that isn't a known intrinsic tag.
|
|
490
|
+
*/
|
|
491
|
+
type RefElement<Tag> = Tag extends keyof JSX.IntrinsicElements ? ComponentRef<Tag> : HTMLElement;
|
|
470
492
|
interface ComponentDefinition<TLayers extends Record<string, LayerInput> = Record<string, LayerInput>, TProps extends Record<string, PropBinding> = Record<string, PropBinding>, TTag extends string | undefined = string | undefined> {
|
|
471
493
|
layers: TLayers;
|
|
472
494
|
props?: TProps;
|
|
@@ -474,6 +496,13 @@ interface ComponentDefinition<TLayers extends Record<string, LayerInput> = Recor
|
|
|
474
496
|
defaultProps?: Record<string, unknown>;
|
|
475
497
|
compoundProps?: readonly CompoundPropsEntry[];
|
|
476
498
|
motion?: ComponentMotionValue;
|
|
499
|
+
/**
|
|
500
|
+
* Opt-in forwarded-ref target — an HTML/SVG tag name declaring which DOM
|
|
501
|
+
* element a consumer `ref` lands on. Drives the typed `ref?: Ref<...>` on the
|
|
502
|
+
* component's JSX surface and the `ref` arg handed to its render fn. Omit it
|
|
503
|
+
* and the component exposes no `ref` prop (no guessed default element).
|
|
504
|
+
*/
|
|
505
|
+
ref?: RefTag;
|
|
477
506
|
/**
|
|
478
507
|
* Phantom slot — populated only as a type marker (never read at
|
|
479
508
|
* runtime) so `RootTag<TLayers>` callers can fall back to this when
|
|
@@ -607,6 +636,13 @@ interface FontAssetMember {
|
|
|
607
636
|
* JSON the browser loader derives `@font-face` rules from.
|
|
608
637
|
*/
|
|
609
638
|
readonly declarations: readonly Record<string, unknown>[];
|
|
639
|
+
/**
|
|
640
|
+
* Governance flag stamped at registration from the group's `deprecated`
|
|
641
|
+
* FontID list. Deprecated fonts stay fully selectable (no hard block) —
|
|
642
|
+
* this only lets the picker surface a badge. Rides the open index, so it
|
|
643
|
+
* round-trips through serialization with the rest of the record.
|
|
644
|
+
*/
|
|
645
|
+
readonly deprecated?: boolean;
|
|
610
646
|
readonly [key: string]: unknown;
|
|
611
647
|
}
|
|
612
648
|
/**
|
|
@@ -725,4 +761,4 @@ interface SerializedConfig {
|
|
|
725
761
|
providers?: Record<string, Record<string, never>>;
|
|
726
762
|
}
|
|
727
763
|
//#endregion
|
|
728
|
-
export { AnyStylePropDefinition, ArbitraryEntry, ArbitrarySpec, BaseStyles, BuildOptions, ComponentDefinition, ComponentGroupDefinition, ComponentMetadata, ComponentMotionValue, CompositeStyleDefinition, CompositeStyleObject, CompoundPropsEntry, CssMotionDefinition, FontAssetMember, GlobalStylesDef, JsMotionDefinition, LayerInput, LiteralFor, ModeDefinition, ModeOptionDefinition, ModifierDefinition, MotionDefinitionInput, MotionKeyframes, MotionStateKeyframe, MotionTransition, OpacityPairSpec, PreviewDefinition, PropBinding, RootTag, SerializedAssetGroup, SerializedComponent, SerializedComponentGroup, SerializedConfig, SerializedFontAssetGroup, SerializedIconAssetGroup, SerializedTokenGroup, SlotMotion, StylePropDefinition, StylePropMetadata, StylePropProperty, TokenDefinition, TokenGroupDefinition, TokenModifierKey, TokenModifierValue, TokenType, TokenValue, ValuesEntry };
|
|
764
|
+
export { AnyStylePropDefinition, ArbitraryEntry, ArbitrarySpec, BaseStyles, BuildOptions, ComponentDefinition, ComponentGroupDefinition, ComponentMetadata, ComponentMotionValue, CompositeStyleDefinition, CompositeStyleObject, CompoundPropsEntry, CssMotionDefinition, FontAssetMember, GlobalStylesDef, JsMotionDefinition, LayerInput, LiteralFor, ModeDefinition, ModeOptionDefinition, ModifierDefinition, MotionDefinitionInput, MotionKeyframes, MotionStateKeyframe, MotionTransition, OpacityPairSpec, PreviewDefinition, PropBinding, RefElement, RefTag, RootTag, SerializedAssetGroup, SerializedComponent, SerializedComponentGroup, SerializedConfig, SerializedFontAssetGroup, SerializedIconAssetGroup, SerializedTokenGroup, SlotMotion, StylePropDefinition, StylePropMetadata, StylePropProperty, TokenDefinition, TokenGroupDefinition, TokenModifierKey, TokenModifierValue, TokenType, TokenValue, ValuesEntry };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yahoo/uds-create-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0-v3-import.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"files": [
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@babel/parser": "^7.29.0",
|
|
70
70
|
"motion": "^12.35.0",
|
|
71
|
-
"@yahoo/uds-create-utils": "1.
|
|
71
|
+
"@yahoo/uds-create-utils": "1.11.0-v3-import.1"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/types": "^7.29.0",
|