@yahoo/uds-create-config 1.2.0-v3-import.2 → 1.2.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 +1 -11
- package/dist/Component.js +0 -14
- package/dist/Props.d.ts +5 -18
- package/dist/StyleProp.js +0 -1
- package/dist/factories.d.ts +11 -103
- package/dist/factories.js +1 -25
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/refs.d.ts +1 -2
- package/dist/spec/specToJsx.js +32 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/css-properties.d.ts +0 -1
- package/dist/types.d.ts +6 -35
- package/package.json +4 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ComponentRef
|
|
1
|
+
import { ComponentRef, 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";
|
|
6
5
|
|
|
7
6
|
//#region src/types.d.ts
|
|
8
7
|
/**
|
|
@@ -144,16 +143,11 @@ interface ValueAlias {
|
|
|
144
143
|
* (e.g. `'transparent'` for `border-color`).
|
|
145
144
|
* - `number` — bare numeric values where CSS itself accepts numbers
|
|
146
145
|
* (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.
|
|
152
146
|
* - `ValueAlias<P>` — `{ alias, value }` pair for Tailwind-style
|
|
153
147
|
* shorthands; the alias appears at the JSX value site and resolves
|
|
154
148
|
* to the underlying CSS keyword at emit time.
|
|
155
149
|
*/
|
|
156
|
-
type ValuesEntry<P extends StylePropProperty = StylePropProperty> = TokenGroupRef | LiteralFor<P> | number |
|
|
150
|
+
type ValuesEntry<P extends StylePropProperty = StylePropProperty> = TokenGroupRef | LiteralFor<P> | number | ValueAlias;
|
|
157
151
|
interface ArbitrarySpec {
|
|
158
152
|
type?: TokenType;
|
|
159
153
|
}
|
|
@@ -308,7 +302,7 @@ interface StylePropDefinition<P extends StylePropProperty> {
|
|
|
308
302
|
interface AnyStylePropDefinition {
|
|
309
303
|
cssProperty: StylePropProperty | readonly StylePropProperty[];
|
|
310
304
|
classPrefix: string;
|
|
311
|
-
values?: readonly (TokenGroupRef | string | number |
|
|
305
|
+
values?: readonly (TokenGroupRef | string | number | ValueAlias)[];
|
|
312
306
|
arbitrary?: ArbitraryInput;
|
|
313
307
|
/** See {@link StylePropDefinition.negative} — emit `calc(<value> * -1)`. */
|
|
314
308
|
negative?: boolean;
|
|
@@ -368,7 +362,7 @@ type MotionDefinitionInput = CssMotionDefinition | JsMotionDefinition;
|
|
|
368
362
|
* code because they round-trip cleanly through JSON.
|
|
369
363
|
*/
|
|
370
364
|
interface LayerWithOverrides {
|
|
371
|
-
tag: string | TagRef | ComponentRef
|
|
365
|
+
tag: string | TagRef | ComponentRef;
|
|
372
366
|
defaultProps?: Record<string, unknown>;
|
|
373
367
|
base?: Record<string, unknown>;
|
|
374
368
|
[key: string]: unknown;
|
|
@@ -393,7 +387,7 @@ interface LayerWithOverrides {
|
|
|
393
387
|
* `Layer.tag` and leaves the remaining fields on the layer entry
|
|
394
388
|
* for codegen to read.
|
|
395
389
|
*/
|
|
396
|
-
type LayerInput = string | TagRef | ComponentRef
|
|
390
|
+
type LayerInput = string | TagRef | ComponentRef | ComponentDefinition | LayerWithOverrides;
|
|
397
391
|
type BaseStyles = Record<string, Record<string, unknown>>;
|
|
398
392
|
interface CompoundPropsEntry {
|
|
399
393
|
when: Record<string, unknown>;
|
|
@@ -473,22 +467,6 @@ type RootTag<TLayers> = TLayers extends {
|
|
|
473
467
|
* the narrow forms only kick in when authoring chains thread literal
|
|
474
468
|
* generics through (`defineComponent('div')` → `TTag = 'div'`).
|
|
475
469
|
*/
|
|
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;
|
|
492
470
|
interface ComponentDefinition<TLayers extends Record<string, LayerInput> = Record<string, LayerInput>, TProps extends Record<string, PropBinding> = Record<string, PropBinding>, TTag extends string | undefined = string | undefined> {
|
|
493
471
|
layers: TLayers;
|
|
494
472
|
props?: TProps;
|
|
@@ -496,13 +474,6 @@ interface ComponentDefinition<TLayers extends Record<string, LayerInput> = Recor
|
|
|
496
474
|
defaultProps?: Record<string, unknown>;
|
|
497
475
|
compoundProps?: readonly CompoundPropsEntry[];
|
|
498
476
|
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;
|
|
506
477
|
/**
|
|
507
478
|
* Phantom slot — populated only as a type marker (never read at
|
|
508
479
|
* runtime) so `RootTag<TLayers>` callers can fall back to this when
|
|
@@ -734,4 +705,4 @@ interface SerializedConfig {
|
|
|
734
705
|
providers?: Record<string, Record<string, never>>;
|
|
735
706
|
}
|
|
736
707
|
//#endregion
|
|
737
|
-
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,
|
|
708
|
+
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yahoo/uds-create-config",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"files": [
|
|
@@ -62,17 +62,19 @@
|
|
|
62
62
|
"@json-render/codegen": "^0.19.0",
|
|
63
63
|
"@json-render/core": "^0.19.0",
|
|
64
64
|
"@json-render/react": "^0.19.0",
|
|
65
|
+
"@json-render/yaml": "^0.19.0",
|
|
65
66
|
"react": "^19.2.4"
|
|
66
67
|
},
|
|
67
68
|
"dependencies": {
|
|
68
69
|
"@babel/parser": "^7.29.0",
|
|
69
|
-
"@yahoo/uds-create-utils": "1.2.
|
|
70
|
+
"@yahoo/uds-create-utils": "1.2.1"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
72
73
|
"@babel/types": "^7.29.0",
|
|
73
74
|
"@json-render/codegen": "^0.19.0",
|
|
74
75
|
"@json-render/core": "^0.19.0",
|
|
75
76
|
"@json-render/react": "^0.19.0",
|
|
77
|
+
"@json-render/yaml": "^0.19.0",
|
|
76
78
|
"@types/react": "19.2.14",
|
|
77
79
|
"expect-type": "^1.2.1",
|
|
78
80
|
"react": "^19.2.4",
|