@yahoo/uds-v5-wip 1.61.0 → 1.62.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.
- package/dist/config/dist/AssetGroup.d.ts +75 -0
- package/dist/config/dist/AssetGroup.js +114 -0
- package/dist/config/dist/Component.d.ts +309 -0
- package/dist/config/dist/Component.js +897 -0
- package/dist/config/dist/ComponentGroup.d.ts +21 -0
- package/dist/config/dist/ComponentGroup.js +46 -0
- package/dist/config/dist/CompositeStyle.d.ts +28 -0
- package/dist/config/dist/CompositeStyle.js +52 -0
- package/dist/config/dist/Config.d.ts +422 -0
- package/dist/config/dist/Config.js +1426 -0
- package/dist/config/dist/Mode.d.ts +42 -0
- package/dist/config/dist/Mode.js +81 -0
- package/dist/config/dist/Modifier.d.ts +52 -0
- package/dist/config/dist/Modifier.js +97 -0
- package/dist/config/dist/MotionDef.d.ts +50 -0
- package/dist/config/dist/MotionDef.js +97 -0
- package/dist/config/dist/Props.d.ts +235 -126
- package/dist/config/dist/Provider.d.ts +21 -0
- package/dist/config/dist/Provider.js +14 -0
- package/dist/config/dist/StyleProp.d.ts +113 -0
- package/dist/config/dist/StyleProp.js +197 -0
- package/dist/config/dist/Token.d.ts +56 -0
- package/dist/config/dist/Token.js +112 -0
- package/dist/config/dist/TokenGroup.d.ts +33 -0
- package/dist/config/dist/TokenGroup.js +68 -0
- package/dist/config/dist/asset-kind.d.ts +56 -0
- package/dist/config/dist/asset-kind.js +29 -0
- package/dist/config/dist/brands.d.ts +31 -0
- package/dist/config/dist/brands.js +20 -0
- package/dist/config/dist/captureCallerPath.d.ts +49 -0
- package/dist/config/dist/captureCallerPath.js +95 -0
- package/dist/config/dist/colorExpressions.d.ts +132 -0
- package/dist/config/dist/colorExpressions.js +148 -0
- package/dist/config/dist/defineAssetGroup.d.ts +158 -0
- package/dist/config/dist/defineAssetGroup.js +263 -0
- package/dist/config/dist/defineProvider.d.ts +30 -0
- package/dist/config/dist/defineProvider.js +60 -0
- package/dist/config/dist/element-marker.d.ts +55 -0
- package/dist/config/dist/element-marker.js +113 -0
- package/dist/config/dist/entity-utils.d.ts +27 -0
- package/dist/config/dist/entity-utils.js +105 -0
- package/dist/config/dist/factories.d.ts +707 -0
- package/dist/config/dist/factories.js +393 -0
- package/dist/config/dist/foreign-component-name.js +42 -0
- package/dist/config/dist/index.d.ts +30 -21
- package/dist/config/dist/index.js +26 -14
- package/dist/config/dist/interpolate.d.ts +21 -0
- package/dist/config/dist/interpolate.js +10 -0
- package/dist/config/dist/markers.d.ts +218 -0
- package/dist/config/dist/markers.js +67 -0
- package/dist/config/dist/refs.d.ts +143 -69
- package/dist/config/dist/refs.js +95 -113
- package/dist/config/dist/token-override-rows.d.ts +67 -0
- package/dist/config/dist/token-override-rows.js +223 -0
- package/dist/config/dist/tokenValueType.js +138 -0
- package/dist/config/dist/types/css-properties.d.ts +132 -122
- package/dist/config/dist/types/css-property-keywords.d.ts +157 -0
- package/dist/config/dist/types/css-property-keywords.js +616 -0
- package/dist/config/dist/types/css-values.d.ts +18 -16
- package/dist/config/dist/types.d.ts +688 -66
- package/dist/config/dist/units.d.ts +15 -0
- package/dist/config/dist/units.js +16 -0
- package/dist/config.d.ts +31 -22
- package/dist/config.js +28 -16
- package/dist/loader/dist/loader/artifacts.js +26 -9
- package/dist/loader/dist/loader.d.ts +11 -23
- package/dist/loader/dist/loader.js +54 -99
- package/dist/loader/dist/next.js +3 -3
- package/dist/loader/dist/transform-runner.js +1 -8
- package/dist/loader/dist/unplugin.d.ts +2 -2
- package/dist/loader/dist/unplugin.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/dist/index.js +1 -0
- package/dist/utils/dist/motion-utils/resolveMotionState.d.ts +35 -0
- package/dist/utils/dist/motion-utils/resolveMotionState.js +33 -0
- package/dist/utils/dist/string-utils/componentClassName.d.ts +41 -8
- package/dist/utils/dist/string-utils/componentClassName.js +48 -11
- package/dist/utils.d.ts +3 -2
- package/dist/utils.js +3 -2
- package/package.json +3 -3
- package/dist/codegen/dist/loader/getLoaderArtifacts.js +0 -2
- package/dist/config/dist/bindRender.d.ts +0 -16
- package/dist/config/dist/bindRender.js +0 -310
- package/dist/config/dist/className.d.ts +0 -54
- package/dist/config/dist/className.js +0 -77
- package/dist/config/dist/component-config.d.ts +0 -862
- package/dist/config/dist/component-config.js +0 -163
- package/dist/config/dist/component-refs.d.ts +0 -121
- package/dist/config/dist/createConfig.d.ts +0 -456
- package/dist/config/dist/createConfig.js +0 -503
- package/dist/config/dist/createStyler.d.ts +0 -35
- package/dist/config/dist/createStyler.js +0 -93
- package/dist/config/dist/defineComponent.d.ts +0 -317
- package/dist/config/dist/defineComponent.js +0 -264
- package/dist/config/dist/defineCompositeStyle.d.ts +0 -93
- package/dist/config/dist/defineCompositeStyle.js +0 -18
- package/dist/config/dist/defineMotionConfig.d.ts +0 -152
- package/dist/config/dist/definePreview.d.ts +0 -45
- package/dist/config/dist/definePreview.js +0 -35
- package/dist/config/dist/defineStyleProp.d.ts +0 -289
- package/dist/config/dist/defineStyleProp.js +0 -61
- package/dist/config/dist/merge-utils.js +0 -51
- package/dist/config/dist/propertyAcceptedTypes.d.ts +0 -19
- package/dist/config/dist/propertyAcceptedTypes.js +0 -220
- package/dist/config/dist/resolveCompoundProps.d.ts +0 -65
- package/dist/config/dist/resolveCompoundProps.js +0 -120
- package/dist/config/dist/resolveStyleProp.d.ts +0 -157
- package/dist/config/dist/resolveStyleProp.js +0 -260
- package/dist/config/dist/runtime-registry.js +0 -37
- package/dist/config/dist/serialize.d.ts +0 -47
- package/dist/config/dist/serialize.js +0 -111
- package/dist/config/dist/sniffTokenType.d.ts +0 -7
- package/dist/config/dist/sniffTokenType.js +0 -67
- package/dist/config/dist/style-prop-runtime.d.ts +0 -75
- package/dist/config/dist/style-prop-runtime.js +0 -390
- package/dist/loader/dist/loader/internal-meta.js +0 -59
- package/dist/loader/dist/loader/lower-new-api-primitive.js +0 -252
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
//#region ../config/dist/component-config.js
|
|
2
|
-
/**
|
|
3
|
-
* Marker for a boolean JSX prop. Use inside the `props` block:
|
|
4
|
-
*
|
|
5
|
-
* props: {
|
|
6
|
-
* loading: bool(),
|
|
7
|
-
* disabled: bool(),
|
|
8
|
-
* }
|
|
9
|
-
*
|
|
10
|
-
* Drives both the TS type (consumer sees `loading?: boolean`) and the
|
|
11
|
-
* Studio design panel control (toggle).
|
|
12
|
-
*/
|
|
13
|
-
function bool() {
|
|
14
|
-
return { __kind: "bool" };
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Marker for a string-valued JSX prop. Parallel to `bool()` — emits
|
|
18
|
-
* `data-<kebab-name>="<value>"` on each layer's bundle so CSS can
|
|
19
|
-
* target the rendered value. Use inside the `props` block:
|
|
20
|
-
*
|
|
21
|
-
* props: {
|
|
22
|
-
* kind: string(),
|
|
23
|
-
* tone: string(),
|
|
24
|
-
* }
|
|
25
|
-
*
|
|
26
|
-
* Drives both the TS type (consumer sees `kind?: string`) and the
|
|
27
|
-
* Studio design panel control (text input).
|
|
28
|
-
*/
|
|
29
|
-
function string() {
|
|
30
|
-
return { __kind: "string" };
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Bind a registered style prop. Single string arg defaults to the
|
|
34
|
-
* root layer; chain `.on(layerName)` to target a non-root layer:
|
|
35
|
-
*
|
|
36
|
-
* props: {
|
|
37
|
-
* bg: styleProp('bg'), // root layer
|
|
38
|
-
* textColor: styleProp('color').on('label'), // label layer
|
|
39
|
-
* }
|
|
40
|
-
*
|
|
41
|
-
* The `__kind: 'styleProp'` discriminator lets the design panel render
|
|
42
|
-
* a color/token picker (driven by the registered style prop's value
|
|
43
|
-
* space) and lets codegen scan props uniformly off the marker shape.
|
|
44
|
-
*/
|
|
45
|
-
function styleProp(ref) {
|
|
46
|
-
return buildStylePropMarker("root", ref);
|
|
47
|
-
}
|
|
48
|
-
function buildStylePropMarker(layer, ref) {
|
|
49
|
-
return {
|
|
50
|
-
__kind: "styleProp",
|
|
51
|
-
layer,
|
|
52
|
-
ref,
|
|
53
|
-
on(name) {
|
|
54
|
-
return buildStylePropMarker(name, ref);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Token-reference marker for style values. Use inside `base`, enum
|
|
60
|
-
* entries, and `compoundProps` overrides:
|
|
61
|
-
*
|
|
62
|
-
* base: { root: { bg: token('bg/brand') } }
|
|
63
|
-
* props: {
|
|
64
|
-
* variant: enums({
|
|
65
|
-
* brand: { root: { color: token('color/on-brand') } },
|
|
66
|
-
* }),
|
|
67
|
-
* }
|
|
68
|
-
*
|
|
69
|
-
* Codegen and runtime detect the `__kind: 'token'` discriminator and
|
|
70
|
-
* resolve the `ref` to `var(--<prefix>-<ns>-<name>)`. The design
|
|
71
|
-
* panel uses the same discriminator to offer a token picker.
|
|
72
|
-
*/
|
|
73
|
-
function token(ref) {
|
|
74
|
-
return {
|
|
75
|
-
__kind: "token",
|
|
76
|
-
ref
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Token-group reference for `defineStyleProp({ values: [...] })`. Pulls
|
|
81
|
-
* every token in the named namespace into the style prop's accepted
|
|
82
|
-
* value set. The resolver expands the group at registration time:
|
|
83
|
-
*
|
|
84
|
-
* defineStyleProp({
|
|
85
|
-
* cssProperty: 'padding',
|
|
86
|
-
* classPrefix: 'p',
|
|
87
|
-
* values: [tokenGroup('spacing')], // → p-1, p-2, p-3, …
|
|
88
|
-
* })
|
|
89
|
-
*
|
|
90
|
-
* The `__kind: 'tokenGroup'` discriminator lets codegen and the design
|
|
91
|
-
* panel branch on group references without parsing strings.
|
|
92
|
-
*/
|
|
93
|
-
function tokenGroup(group) {
|
|
94
|
-
return {
|
|
95
|
-
__kind: "tokenGroup",
|
|
96
|
-
group
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Marker for an enum-valued JSX prop. Each value maps to a per-layer
|
|
101
|
-
* style override. Use inside the `props` block:
|
|
102
|
-
*
|
|
103
|
-
* props: {
|
|
104
|
-
* variant: enums({
|
|
105
|
-
* brand: { root: { bg: '{bg/brand}', color: '{color/on-brand}' } },
|
|
106
|
-
* ghost: { root: { color: '{color/on-primary}' } },
|
|
107
|
-
* }),
|
|
108
|
-
* }
|
|
109
|
-
*
|
|
110
|
-
* The shape of each value mirrors a partial layer-style map keyed by
|
|
111
|
-
* the component's own layer names.
|
|
112
|
-
*/
|
|
113
|
-
function enums(values) {
|
|
114
|
-
return {
|
|
115
|
-
__kind: "enum",
|
|
116
|
-
values
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function composite(ref) {
|
|
120
|
-
return {
|
|
121
|
-
__kind: "composite",
|
|
122
|
-
ref
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
function slot(path, options) {
|
|
126
|
-
if (path === void 0) return {
|
|
127
|
-
__kind: "slot",
|
|
128
|
-
layer: "",
|
|
129
|
-
prop: "children"
|
|
130
|
-
};
|
|
131
|
-
if (options) return {
|
|
132
|
-
__kind: "slot",
|
|
133
|
-
layer: path,
|
|
134
|
-
prop: options.prop
|
|
135
|
-
};
|
|
136
|
-
const slashIdx = path.indexOf("/");
|
|
137
|
-
if (slashIdx === -1) return {
|
|
138
|
-
__kind: "slot",
|
|
139
|
-
layer: path,
|
|
140
|
-
prop: "children"
|
|
141
|
-
};
|
|
142
|
-
return {
|
|
143
|
-
__kind: "slot",
|
|
144
|
-
layer: path.slice(0, slashIdx),
|
|
145
|
-
prop: path.slice(slashIdx + 1)
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Marker factory — use inside `compoundProps[].layers.<layer>` to hide
|
|
150
|
-
* a layer entirely when the entry's `when` clause matches.
|
|
151
|
-
*
|
|
152
|
-
* compoundProps: [
|
|
153
|
-
* {
|
|
154
|
-
* when: { variant: 'compact' },
|
|
155
|
-
* layers: { endIcon: hidden() },
|
|
156
|
-
* },
|
|
157
|
-
* ]
|
|
158
|
-
*/
|
|
159
|
-
function hidden() {
|
|
160
|
-
return { __kind: "hidden" };
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
export { bool, composite, enums, hidden, slot, string, styleProp, token, tokenGroup };
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
//#region ../config/dist/component-refs.d.ts
|
|
2
|
-
//#region src/component-refs.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Augmentable registries + ref types for the component-API surface.
|
|
5
|
-
*
|
|
6
|
-
* Codegen runs `uds build` and populates the four interfaces below in
|
|
7
|
-
* each consumer app's `.uds/uds-env.d.ts`. The ref types derived from
|
|
8
|
-
* them narrow helper arguments against what's actually registered —
|
|
9
|
-
* `composite('elevation')` typechecks only if `elevation` is a real
|
|
10
|
-
* `RegisteredComposites` key, `styleProp('bg')` only if `bg` is a real
|
|
11
|
-
* `RegisteredStyleProps` key, etc.
|
|
12
|
-
*
|
|
13
|
-
* Without the augmentation loaded (e.g. inside `@uds/config`'s own
|
|
14
|
-
* test files), each registry is `{}` and the corresponding ref type
|
|
15
|
-
* falls open to `string`. Helpers downstream are expected to fail
|
|
16
|
-
* open in that case so package-internal authoring sites don't all
|
|
17
|
-
* error.
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Registered components. Each key is the registered component name
|
|
21
|
-
* (e.g. `Box`, `Text`); each value is the component's resolved prop
|
|
22
|
-
* shape, e.g.
|
|
23
|
-
*
|
|
24
|
-
* export interface RegisteredComponents {
|
|
25
|
-
* Box2: {
|
|
26
|
-
* backgroundColor: RegisteredStyleProps['bg'];
|
|
27
|
-
* color: RegisteredStyleProps['color'];
|
|
28
|
-
* };
|
|
29
|
-
* Spinner: {};
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* Composed layers use `Partial<RegisteredComponents[K]>` on
|
|
33
|
-
* `defaultProps` for type-safe completion when nesting components
|
|
34
|
-
* inside other components' configs.
|
|
35
|
-
*
|
|
36
|
-
* Populated by codegen from `uds.config.ts`'s `.registerComponents({...})`
|
|
37
|
-
* call.
|
|
38
|
-
*/
|
|
39
|
-
interface RegisteredComponents {}
|
|
40
|
-
/**
|
|
41
|
-
* Registered style props. Key is the JSX prop name; value is the
|
|
42
|
-
* string-literal union of allowed token names for that prop, e.g.
|
|
43
|
-
*
|
|
44
|
-
* export interface RegisteredStyleProps {
|
|
45
|
-
* bg: 'brand' | 'accent' | 'primary';
|
|
46
|
-
* color: 'brand' | 'on-brand';
|
|
47
|
-
* }
|
|
48
|
-
*
|
|
49
|
-
* Components reference these directly when wiring JSX-prop types:
|
|
50
|
-
* `bg?: RegisteredStyleProps['bg']`. Downstream `Props<TConfig>`
|
|
51
|
-
* resolves `styleProp('bg')` markers against this map.
|
|
52
|
-
*
|
|
53
|
-
* Populated by codegen from `uds.config.ts`'s `.registerStyleProps({...})`
|
|
54
|
-
* call. A `never` value means the prop registered no tokens
|
|
55
|
-
* (arbitrary-only); the consumer should widen those to `string`.
|
|
56
|
-
*/
|
|
57
|
-
interface RegisteredStyleProps {}
|
|
58
|
-
/**
|
|
59
|
-
* Registered composite-style names. Each key is the composite
|
|
60
|
-
* identifier (e.g. `elevation`, `severity`); value is `void`.
|
|
61
|
-
*
|
|
62
|
-
* Populated by codegen from `uds.config.ts`'s `.registerComposites({...})`
|
|
63
|
-
* call.
|
|
64
|
-
*/
|
|
65
|
-
interface RegisteredComposites {}
|
|
66
|
-
/**
|
|
67
|
-
* Registered motion-preset names. Each key is the preset identifier
|
|
68
|
-
* (e.g. `fadeIn`); value is `void`.
|
|
69
|
-
*
|
|
70
|
-
* Populated by codegen from `uds.config.ts`'s `.defineMotion({...})`
|
|
71
|
-
* (motion has no separate `.registerMotion` step today; the entries
|
|
72
|
-
* come directly from `defineMotion` keys).
|
|
73
|
-
*/
|
|
74
|
-
interface RegisteredMotion {}
|
|
75
|
-
/**
|
|
76
|
-
* Registered `_<modifier>` props (`_hover`, `_focus`, `_dark`,
|
|
77
|
-
* `_pressed`, `_ariaSelected`, …). Each key is the modifier name; the
|
|
78
|
-
* value is `Partial<T>` so authoring sites get autocomplete against
|
|
79
|
-
* the component's own prop surface inside the modifier block:
|
|
80
|
-
*
|
|
81
|
-
* <Box _hover={{ bg: 'brand', color: 'on-brand' }} />
|
|
82
|
-
*
|
|
83
|
-
* Populated by codegen — `BUILT_IN_PSEUDO` from
|
|
84
|
-
* `style-prop-runtime.ts` (all standard pseudo classes) merged with
|
|
85
|
-
* config-defined mode modifiers (`_dark`, `_sm`, …) and any custom
|
|
86
|
-
* modifiers registered via `.defineModifiers({...})`. The base
|
|
87
|
-
* interface here stays empty so without the augmentation loaded
|
|
88
|
-
* (inside `@uds/config`'s own tests) the modifier surface
|
|
89
|
-
* gracefully collapses to nothing — same fail-open pattern as the
|
|
90
|
-
* other registries above.
|
|
91
|
-
*
|
|
92
|
-
* Referenced by `Props<TConfig>` to narrow modifier keys; the
|
|
93
|
-
* codegen-emitted `Registered${Name}Props` type aliases reference
|
|
94
|
-
* this interface directly for the same narrowing.
|
|
95
|
-
*/
|
|
96
|
-
interface RegisteredModifiers<T> {}
|
|
97
|
-
/**
|
|
98
|
-
* Brace-wrapped reference to a registered React component. Falls open
|
|
99
|
-
* to `'{${string}}'` when the registry is unaugmented (e.g. inside
|
|
100
|
-
* `@uds/config`'s own tests, where codegen hasn't populated the
|
|
101
|
-
* interface). Consumer apps load the codegen-emitted augmentation and
|
|
102
|
-
* get narrow `'{Box}' | '{Text}' | …` autocomplete.
|
|
103
|
-
*/
|
|
104
|
-
type ComponentRef = [keyof RegisteredComponents] extends [never] ? `{${string}}` : `{${Extract<keyof RegisteredComponents, string>}}`;
|
|
105
|
-
/**
|
|
106
|
-
* Brace-wrapped reference to a registered style prop. Falls open when
|
|
107
|
-
* unaugmented (see {@link ComponentRef}).
|
|
108
|
-
*/
|
|
109
|
-
type StylePropRef = [keyof RegisteredStyleProps] extends [never] ? `{${string}}` : `{${Extract<keyof RegisteredStyleProps, string>}}`;
|
|
110
|
-
/**
|
|
111
|
-
* Brace-wrapped reference to a registered composite style. Falls open
|
|
112
|
-
* when unaugmented.
|
|
113
|
-
*/
|
|
114
|
-
type CompositeRef = [keyof RegisteredComposites] extends [never] ? `{${string}}` : `{${Extract<keyof RegisteredComposites, string>}}`;
|
|
115
|
-
/**
|
|
116
|
-
* Brace-wrapped reference to a registered motion preset. Falls open
|
|
117
|
-
* when unaugmented.
|
|
118
|
-
*/
|
|
119
|
-
type MotionRef = [keyof RegisteredMotion] extends [never] ? `{${string}}` : `{${Extract<keyof RegisteredMotion, string>}}`; //#endregion
|
|
120
|
-
//#endregion
|
|
121
|
-
export { ComponentRef, CompositeRef, MotionRef, RegisteredComponents, RegisteredComposites, RegisteredModifiers, RegisteredMotion, RegisteredStyleProps, StylePropRef };
|