@yahoo/uds 3.156.2 → 3.157.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/automated-config/dist/generated/autoVariants.cjs +9 -4
- package/dist/automated-config/dist/generated/autoVariants.d.cts +2 -1
- package/dist/automated-config/dist/generated/autoVariants.d.ts +2 -1
- package/dist/automated-config/dist/generated/autoVariants.js +9 -4
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +3011 -3038
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +143 -140
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +143 -140
- package/dist/automated-config/dist/generated/generatedConfigs.js +3011 -3038
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +1227 -501
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +1227 -501
- package/dist/automated-config/dist/properties.cjs +1 -1
- package/dist/automated-config/dist/properties.d.cts +15 -0
- package/dist/automated-config/dist/properties.d.ts +15 -0
- package/dist/automated-config/dist/properties.js +1 -1
- package/dist/automated-config/dist/types/ComponentConfig.d.cts +77 -4
- package/dist/automated-config/dist/types/ComponentConfig.d.ts +77 -4
- package/dist/automated-config/dist/types/ConfigSchema.d.cts +14 -2
- package/dist/automated-config/dist/types/ConfigSchema.d.ts +14 -2
- package/dist/automated-config/dist/types/StateAxis.cjs +90 -0
- package/dist/automated-config/dist/types/StateAxis.d.cts +70 -0
- package/dist/automated-config/dist/types/StateAxis.d.ts +70 -0
- package/dist/automated-config/dist/types/StateAxis.js +84 -0
- package/dist/automated-config/dist/utils/buildConfigSchema.cjs +98 -82
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +32 -10
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +32 -10
- package/dist/automated-config/dist/utils/buildConfigSchema.js +99 -83
- package/dist/automated-config/dist/utils/canonicalizeStateKey.cjs +32 -0
- package/dist/automated-config/dist/utils/canonicalizeStateKey.d.cts +48 -0
- package/dist/automated-config/dist/utils/canonicalizeStateKey.d.ts +48 -0
- package/dist/automated-config/dist/utils/canonicalizeStateKey.js +31 -0
- package/dist/automated-config/dist/utils/getConfigComponentVariant.d.cts +8 -0
- package/dist/automated-config/dist/utils/getConfigComponentVariant.d.ts +8 -0
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +3 -3
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +3 -3
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.cjs +12 -5
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.d.cts +8 -1
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.d.ts +8 -1
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.js +12 -5
- package/dist/automated-config/dist/utils/index.cjs +407 -97
- package/dist/automated-config/dist/utils/index.d.cts +66 -16
- package/dist/automated-config/dist/utils/index.d.ts +66 -16
- package/dist/automated-config/dist/utils/index.js +408 -99
- package/dist/automated-config/dist/utils/pseudoStateSelectors.cjs +122 -0
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.cts +80 -0
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.ts +80 -0
- package/dist/automated-config/dist/utils/pseudoStateSelectors.js +120 -0
- package/dist/automated-config/dist/utils/resolvePropertyStates.cjs +131 -0
- package/dist/automated-config/dist/utils/resolvePropertyStates.d.cts +49 -0
- package/dist/automated-config/dist/utils/resolvePropertyStates.d.ts +49 -0
- package/dist/automated-config/dist/utils/resolvePropertyStates.js +130 -0
- package/dist/automated-config/dist/utils/resolveSlotByCascade.cjs +118 -0
- package/dist/automated-config/dist/utils/resolveSlotByCascade.d.cts +68 -0
- package/dist/automated-config/dist/utils/resolveSlotByCascade.d.ts +68 -0
- package/dist/automated-config/dist/utils/resolveSlotByCascade.js +117 -0
- package/dist/automated-config/dist/utils/variantConfigGuards.d.cts +13 -0
- package/dist/automated-config/dist/utils/variantConfigGuards.d.ts +13 -0
- package/dist/components/client/Input/Input.cjs +42 -6
- package/dist/components/client/Input/Input.d.cts +13 -0
- package/dist/components/client/Input/Input.d.ts +13 -0
- package/dist/components/client/Input/Input.js +42 -6
- package/dist/config/dist/index.cjs +221 -550
- package/dist/config/dist/index.js +221 -550
- package/dist/css/dist/commands/css.cjs +1 -0
- package/dist/css/dist/commands/css.helpers.cjs +6 -0
- package/dist/css/dist/commands/css.helpers.js +6 -0
- package/dist/css/dist/commands/css.js +1 -0
- package/dist/css/dist/css/generate.cjs +4 -2
- package/dist/css/dist/css/generate.d.cts +28 -0
- package/dist/css/dist/css/generate.d.ts +28 -0
- package/dist/css/dist/css/generate.helpers.cjs +5 -1
- package/dist/css/dist/css/generate.helpers.js +6 -2
- package/dist/css/dist/css/generate.js +4 -2
- package/dist/css/dist/css/postcss.cjs +81 -0
- package/dist/css/dist/css/postcss.helpers.cjs +60 -0
- package/dist/css/dist/css/postcss.helpers.js +59 -1
- package/dist/css/dist/css/postcss.js +82 -2
- package/dist/css/dist/css/runner.cjs +12 -2
- package/dist/css/dist/css/runner.js +12 -2
- package/dist/css/dist/css/theme.d.cts +6 -0
- package/dist/css/dist/css/theme.d.ts +6 -0
- package/dist/css/dist/packages/automated-config/dist/properties.cjs +1 -1
- package/dist/css/dist/packages/automated-config/dist/properties.js +1 -1
- package/dist/css/dist/packages/automated-config/dist/utils/index.d.cts +6 -0
- package/dist/css/dist/packages/automated-config/dist/utils/index.d.ts +6 -0
- package/dist/css/dist/packages/config/dist/index.cjs +221 -550
- package/dist/css/dist/packages/config/dist/index.js +221 -550
- package/dist/css/dist/utils/optimizeCSS.cjs +59 -0
- package/dist/css/dist/utils/optimizeCSS.js +59 -0
- package/dist/index.cjs +25 -0
- package/dist/index.d.cts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +9 -2
- package/dist/styles/styler.d.cts +12 -11
- package/dist/styles/styler.d.ts +12 -11
- package/dist/styles/variants.d.cts +9 -4
- package/dist/styles/variants.d.ts +9 -4
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.cjs +3011 -3038
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +3011 -3038
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.cjs +1 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.js +1 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/types/StateAxis.cjs +81 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/types/StateAxis.js +76 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/canonicalizeStateKey.cjs +33 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/canonicalizeStateKey.js +32 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.cjs +0 -7
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.js +1 -7
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +354 -97
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.d.cts +6 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.d.ts +6 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +355 -98
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.cjs +122 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.js +121 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/resolvePropertyStates.cjs +132 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/resolvePropertyStates.js +131 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/resolveSlotByCascade.cjs +95 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/resolveSlotByCascade.js +95 -0
- package/dist/tailwind-internal/dist/packages/config/dist/index.cjs +221 -550
- package/dist/tailwind-internal/dist/packages/config/dist/index.js +221 -550
- package/dist/tailwind-internal/dist/plugins/components.cjs +28 -24
- package/dist/tailwind-internal/dist/plugins/components.js +28 -24
- package/dist/tailwind-internal/dist/utils/composeTailwindPlugins.d.cts +3 -0
- package/dist/tailwind-internal/dist/utils/composeTailwindPlugins.d.ts +3 -0
- package/dist/tailwind-internal/dist/utils/getShadowStyles.d.cts +2 -2
- package/dist/tailwind-internal/dist/utils/getShadowStyles.d.ts +2 -2
- package/dist/tokens/automation/index.cjs +25 -0
- package/dist/tokens/automation/index.d.cts +9 -2
- package/dist/tokens/automation/index.d.ts +9 -2
- package/dist/tokens/automation/index.js +9 -2
- package/dist/tokens/index.cjs +25 -0
- package/dist/tokens/index.d.cts +10 -3
- package/dist/tokens/index.d.ts +10 -3
- package/dist/tokens/index.js +9 -2
- package/dist/tokens/types.d.cts +1 -1
- package/dist/tokens/types.d.ts +1 -1
- package/dist/uds/generated/componentData.cjs +2202 -2200
- package/dist/uds/generated/componentData.js +2202 -2200
- package/dist/uds/generated/migrationSchemaVersion.cjs +1 -1
- package/dist/uds/generated/migrationSchemaVersion.js +1 -1
- package/dist/uds/generated/tailwindPurge.cjs +79 -78
- package/dist/uds/generated/tailwindPurge.js +79 -78
- package/generated/componentData.json +2720 -2718
- package/generated/migrationSchemaVersion.ts +1 -1
- package/generated/tailwindPurge.ts +2 -2
- package/package.json +1 -1
|
@@ -1,10 +1,75 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
import {
|
|
2
|
+
import { getExcludedPseudoStatesForComponentStateOption } from "./componentStatePseudoStates.js";
|
|
3
3
|
import { generateSchemaKey } from "./generateSchemaKey.js";
|
|
4
|
+
import { resolvePropertyStates } from "./resolvePropertyStates.js";
|
|
4
5
|
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.js";
|
|
5
6
|
import { getArbitraryFixture, validateArbitraryValue } from "../../../fixtures/src/util.js";
|
|
6
7
|
//#region ../automated-config/dist/utils/buildConfigSchema.js
|
|
7
8
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
9
|
+
/**
|
|
10
|
+
* Builds the per-state schema entries for one property on one variant option.
|
|
11
|
+
* Each state slot (rest, hover, invalid&hover, ...) gets the property's
|
|
12
|
+
* default value as a starting point so the Configurator UI has something to
|
|
13
|
+
* render before users tweak.
|
|
14
|
+
*
|
|
15
|
+
* Per-state CSS emission depends on the emit mode (`exhaustive` by default,
|
|
16
|
+
* `selective` opt-in) and on the `isEnabled` flag this builder writes:
|
|
17
|
+
* - `rest` always emits in both modes (no flag needed; CSS gen treats rest
|
|
18
|
+
* as enabled).
|
|
19
|
+
* - Under EXHAUSTIVE (the default) on `atomicStates` layers, every declared
|
|
20
|
+
* non-rest state emits a rule regardless of `isEnabled`; its value is
|
|
21
|
+
* cascade-resolved (see `resolveSlotByCascade`), so there are no gaps.
|
|
22
|
+
* `isEnabled` there only selects which value a state resolves to, not
|
|
23
|
+
* whether it emits.
|
|
24
|
+
* - Under SELECTIVE (and legacy `pseudoStates`) emission, non-rest slots
|
|
25
|
+
* emit only when `isEnabled === true`.
|
|
26
|
+
* - `skipRestState` properties have no rest fallback, so every populated
|
|
27
|
+
* state slot must emit; we set `isEnabled: true` on each.
|
|
28
|
+
* - Otherwise, auto-populated non-rest slots ship with no flag — under
|
|
29
|
+
* selective they're off until a designer enables them via the
|
|
30
|
+
* configurator's per-property checkbox (which sets or clears this flag
|
|
31
|
+
* through the setter); under exhaustive they still emit via the cascade.
|
|
32
|
+
*/
|
|
33
|
+
function buildPropertyStateMap(layer, property, variantOption, excludedStates = []) {
|
|
34
|
+
const stateMap = {};
|
|
35
|
+
const excluded = new Set(excludedStates);
|
|
36
|
+
const states = resolvePropertyStates(layer, property);
|
|
37
|
+
const fixtureType = findFixtureType(property, variantOption);
|
|
38
|
+
const value = property.defaults[variantOption];
|
|
39
|
+
const skipRestState = property.skipRestState === true;
|
|
40
|
+
const isTextVariant = propertyVariesOnlyAtRest(property);
|
|
41
|
+
for (const state of states) {
|
|
42
|
+
if (excluded.has(state)) continue;
|
|
43
|
+
if (isTextVariant && state !== "rest") continue;
|
|
44
|
+
stateMap[state] = skipRestState ? {
|
|
45
|
+
type: fixtureType,
|
|
46
|
+
valueType: "alias",
|
|
47
|
+
value,
|
|
48
|
+
isEnabled: true
|
|
49
|
+
} : {
|
|
50
|
+
type: fixtureType,
|
|
51
|
+
valueType: "alias",
|
|
52
|
+
value
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return stateMap;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Whether a property's non-rest slots are stored SPARSELY — never pre-populated
|
|
59
|
+
* by the schema builder, only persisted when a designer authors an explicit
|
|
60
|
+
* per-state override (resolved via the cascade otherwise). `textVariant` is the
|
|
61
|
+
* only such property today: its non-rest "Emphasized" overrides are created
|
|
62
|
+
* lazily in the configurator rather than seeded for every state.
|
|
63
|
+
*
|
|
64
|
+
* Consulted by the schema builder ({@link buildPropertyStateMap}) to keep the
|
|
65
|
+
* stored config compact. CSS emission does NOT special-case these properties:
|
|
66
|
+
* exhaustive emission walks every declared state and resolves each through the
|
|
67
|
+
* cascade (`resolveSlotByCascade`), so an authored non-rest override emits a
|
|
68
|
+
* rule that renders while unauthored states resolve back to rest.
|
|
69
|
+
*/
|
|
70
|
+
function propertyVariesOnlyAtRest(property) {
|
|
71
|
+
return property.name === "textVariant";
|
|
72
|
+
}
|
|
8
73
|
/** Resolves the fixture type by finding which value set contains the given value */
|
|
9
74
|
function findFixtureTypeForValue(property, value) {
|
|
10
75
|
const index = property.values.findIndex((arr) => arr.includes(value));
|
|
@@ -17,13 +82,29 @@ function findFixtureTypeForValue(property, value) {
|
|
|
17
82
|
function findFixtureType(property, variantKey) {
|
|
18
83
|
return findFixtureTypeForValue(property, property.defaults[variantKey]);
|
|
19
84
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Walk a set of layers and emit schema entries keyed by layer (no
|
|
87
|
+
* component-state segment). Shared between `VariantConfigWithProperties` and
|
|
88
|
+
* the optional top-level `layers` field on `VariantConfigWithComponentStates`.
|
|
89
|
+
*/
|
|
90
|
+
function emitUniversalLayerSchema(result, layers, variantKey, variantOption, subComponentName) {
|
|
91
|
+
for (const layerKey in layers) {
|
|
92
|
+
const layer = layers[layerKey];
|
|
93
|
+
const schemaKey = generateSchemaKey({
|
|
94
|
+
variantKey,
|
|
95
|
+
variantValue: variantOption,
|
|
96
|
+
layer: layerKey,
|
|
97
|
+
subComponentName
|
|
98
|
+
});
|
|
99
|
+
result.variables[schemaKey] = {};
|
|
100
|
+
for (const propertyKey in layer.properties) {
|
|
101
|
+
const property = layer.properties[propertyKey];
|
|
102
|
+
result.variables[schemaKey] = {
|
|
103
|
+
...result.variables[schemaKey],
|
|
104
|
+
[propertyKey]: buildPropertyStateMap(layer, property, variantOption)
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
27
108
|
}
|
|
28
109
|
/** Builds component schema from ComponentConfig at runtime */
|
|
29
110
|
function buildConfigSchema(config) {
|
|
@@ -35,6 +116,7 @@ function buildConfigSchema(config) {
|
|
|
35
116
|
for (const variantKey in config.variants) {
|
|
36
117
|
const variantConfig = config.variants[variantKey];
|
|
37
118
|
for (const variantOption of variantConfig.options) if (isVariantConfigWithComponentStates(variantConfig)) {
|
|
119
|
+
if (variantConfig.layers) emitUniversalLayerSchema(result, variantConfig.layers, variantKey, variantOption);
|
|
38
120
|
const componentStates = variantConfig.componentStates;
|
|
39
121
|
for (const componentStateKey in componentStates) {
|
|
40
122
|
const componentState = componentStates[componentStateKey];
|
|
@@ -50,16 +132,9 @@ function buildConfigSchema(config) {
|
|
|
50
132
|
result.variables[schemaKey] = {};
|
|
51
133
|
for (const propertyKey in layer.properties) {
|
|
52
134
|
const property = layer.properties[propertyKey];
|
|
53
|
-
const variableObject = { [propertyKey]: {} };
|
|
54
|
-
if (property?.skipRestState !== true) variableObject[propertyKey] = { rest: {
|
|
55
|
-
type: findFixtureType(property, variantOption),
|
|
56
|
-
valueType: "alias",
|
|
57
|
-
value: property.defaults[variantOption]
|
|
58
|
-
} };
|
|
59
|
-
appendPseudoStateVariables(variableObject, propertyKey, property, variantOption, getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption));
|
|
60
135
|
result.variables[schemaKey] = {
|
|
61
136
|
...result.variables[schemaKey],
|
|
62
|
-
|
|
137
|
+
[propertyKey]: buildPropertyStateMap(layer, property, variantOption, getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption))
|
|
63
138
|
};
|
|
64
139
|
}
|
|
65
140
|
}
|
|
@@ -70,43 +145,16 @@ function buildConfigSchema(config) {
|
|
|
70
145
|
result.variables[variantSchemaKey] = result.variables[variantSchemaKey] ?? {};
|
|
71
146
|
for (const propertyKey in variantConfig.variantProperties) {
|
|
72
147
|
const property = variantConfig.variantProperties[propertyKey];
|
|
73
|
-
const variableObject = { [propertyKey]: {} };
|
|
74
|
-
if (property?.skipRestState !== true) variableObject[propertyKey] = { rest: {
|
|
75
|
-
type: findFixtureType(property, variantOption),
|
|
76
|
-
valueType: "alias",
|
|
77
|
-
value: property.defaults[variantOption]
|
|
78
|
-
} };
|
|
79
|
-
appendPseudoStateVariables(variableObject, propertyKey, property, variantOption);
|
|
80
148
|
result.variables[variantSchemaKey] = {
|
|
81
149
|
...result.variables[variantSchemaKey],
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const layers = variantConfig.layers;
|
|
87
|
-
for (const layerKey in layers) {
|
|
88
|
-
const layer = layers[layerKey];
|
|
89
|
-
const schemaKey = generateSchemaKey({
|
|
90
|
-
variantKey,
|
|
91
|
-
variantValue: variantOption,
|
|
92
|
-
layer: layerKey
|
|
93
|
-
});
|
|
94
|
-
result.variables[schemaKey] = {};
|
|
95
|
-
for (const propertyKey in layer.properties) {
|
|
96
|
-
const property = layer.properties[propertyKey];
|
|
97
|
-
const variableObject = { [propertyKey]: {} };
|
|
98
|
-
if (property?.skipRestState !== true) variableObject[propertyKey] = { rest: {
|
|
99
|
-
type: findFixtureType(property, variantOption),
|
|
100
|
-
valueType: "alias",
|
|
101
|
-
value: property.defaults[variantOption]
|
|
102
|
-
} };
|
|
103
|
-
appendPseudoStateVariables(variableObject, propertyKey, property, variantOption);
|
|
104
|
-
result.variables[schemaKey] = {
|
|
105
|
-
...result.variables[schemaKey],
|
|
106
|
-
...variableObject
|
|
150
|
+
[propertyKey]: buildPropertyStateMap({
|
|
151
|
+
label: "",
|
|
152
|
+
properties: {}
|
|
153
|
+
}, property, variantOption)
|
|
107
154
|
};
|
|
108
155
|
}
|
|
109
156
|
}
|
|
157
|
+
emitUniversalLayerSchema(result, variantConfig.layers, variantKey, variantOption);
|
|
110
158
|
}
|
|
111
159
|
}
|
|
112
160
|
if (config.subComponents) {
|
|
@@ -115,6 +163,7 @@ function buildConfigSchema(config) {
|
|
|
115
163
|
const variantConfig = subComponents[subComponentKey].variants[variantKey];
|
|
116
164
|
result.defaults[variantKey] = variantConfig.default;
|
|
117
165
|
for (const variantOption of variantConfig.options) if (isVariantConfigWithComponentStates(variantConfig)) {
|
|
166
|
+
if (variantConfig.layers) emitUniversalLayerSchema(result, variantConfig.layers, variantKey, variantOption, subComponentKey);
|
|
118
167
|
const componentStates = variantConfig.componentStates;
|
|
119
168
|
for (const componentStateKey in componentStates) {
|
|
120
169
|
const componentState = componentStates[componentStateKey];
|
|
@@ -131,47 +180,14 @@ function buildConfigSchema(config) {
|
|
|
131
180
|
result.variables[schemaKey] = {};
|
|
132
181
|
for (const propertyKey in layer.properties) {
|
|
133
182
|
const property = layer.properties[propertyKey];
|
|
134
|
-
const variableObject = { [propertyKey]: {} };
|
|
135
|
-
if (property?.skipRestState !== true) variableObject[propertyKey] = { rest: {
|
|
136
|
-
type: findFixtureType(property, variantOption),
|
|
137
|
-
valueType: "alias",
|
|
138
|
-
value: property.defaults[variantOption]
|
|
139
|
-
} };
|
|
140
|
-
appendPseudoStateVariables(variableObject, propertyKey, property, variantOption, getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption));
|
|
141
183
|
result.variables[schemaKey] = {
|
|
142
184
|
...result.variables[schemaKey],
|
|
143
|
-
|
|
185
|
+
[propertyKey]: buildPropertyStateMap(layer, property, variantOption, getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption))
|
|
144
186
|
};
|
|
145
187
|
}
|
|
146
188
|
}
|
|
147
189
|
}
|
|
148
|
-
} else if (isVariantConfigWithProperties(variantConfig))
|
|
149
|
-
const layers = variantConfig.layers;
|
|
150
|
-
for (const layerKey in layers) {
|
|
151
|
-
const layer = layers[layerKey];
|
|
152
|
-
const schemaKey = generateSchemaKey({
|
|
153
|
-
variantKey,
|
|
154
|
-
variantValue: variantOption,
|
|
155
|
-
layer: layerKey,
|
|
156
|
-
subComponentName: subComponentKey
|
|
157
|
-
});
|
|
158
|
-
result.variables[schemaKey] = {};
|
|
159
|
-
for (const propertyKey in layer.properties) {
|
|
160
|
-
const property = layer.properties[propertyKey];
|
|
161
|
-
const variableObject = { [propertyKey]: {} };
|
|
162
|
-
if (property?.skipRestState !== true) variableObject[propertyKey] = { rest: {
|
|
163
|
-
type: findFixtureType(property, variantOption),
|
|
164
|
-
valueType: "alias",
|
|
165
|
-
value: property.defaults[variantOption]
|
|
166
|
-
} };
|
|
167
|
-
appendPseudoStateVariables(variableObject, propertyKey, property, variantOption);
|
|
168
|
-
result.variables[schemaKey] = {
|
|
169
|
-
...result.variables[schemaKey],
|
|
170
|
-
...variableObject
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
190
|
+
} else if (isVariantConfigWithProperties(variantConfig)) emitUniversalLayerSchema(result, variantConfig.layers, variantKey, variantOption, subComponentKey);
|
|
175
191
|
}
|
|
176
192
|
}
|
|
177
193
|
return result;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
const require_StateAxis = require("../types/StateAxis.cjs");
|
|
3
|
+
//#region ../automated-config/dist/utils/canonicalizeStateKey.js
|
|
4
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
5
|
+
function canonicalizeStateKey(atoms) {
|
|
6
|
+
if (atoms.length === 0) return "rest";
|
|
7
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8
|
+
const modifiers = [];
|
|
9
|
+
const interactives = [];
|
|
10
|
+
for (const atom of atoms) {
|
|
11
|
+
if (seen.has(atom)) continue;
|
|
12
|
+
seen.add(atom);
|
|
13
|
+
if (require_StateAxis.isModifierAtomic(atom)) modifiers.push(atom);
|
|
14
|
+
else if (require_StateAxis.isInteractiveAtomic(atom)) interactives.push(atom);
|
|
15
|
+
else throw new Error(`canonicalizeStateKey received an unrecognized atom "${atom}". Atoms must be in MODIFIER_ATOMICS or INTERACTIVE_ATOMICS — see StateAxis.`);
|
|
16
|
+
}
|
|
17
|
+
modifiers.sort(require_StateAxis.comparePriority);
|
|
18
|
+
interactives.sort(require_StateAxis.comparePriority);
|
|
19
|
+
const ordered = [...modifiers, ...interactives];
|
|
20
|
+
return ordered.length === 0 ? "rest" : ordered.join("&");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Splits a canonical (or legacy) state key into its atomic parts.
|
|
24
|
+
* `'rest'` and `''` produce an empty array.
|
|
25
|
+
*/
|
|
26
|
+
function splitStateKey(stateKey) {
|
|
27
|
+
if (!stateKey || stateKey === "rest") return [];
|
|
28
|
+
return stateKey.split("&");
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
exports.canonicalizeStateKey = canonicalizeStateKey;
|
|
32
|
+
exports.splitStateKey = splitStateKey;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
import { AtomicState } from "../types/StateAxis.cjs";
|
|
3
|
+
import { PossibleStatesWithRest } from "../types/ComponentConfig.cjs";
|
|
4
|
+
|
|
5
|
+
//#region ../automated-config/dist/utils/canonicalizeStateKey.d.ts
|
|
6
|
+
//#region src/utils/canonicalizeStateKey.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Returns the canonical state-key string for a list of atomic states.
|
|
9
|
+
*
|
|
10
|
+
* Canonical ordering rules:
|
|
11
|
+
* 1. Modifier atomics come first, sorted by `STATE_PRIORITY` (weakest first).
|
|
12
|
+
* 2. Interactive atomics come last, also sorted by `STATE_PRIORITY`. Multiple
|
|
13
|
+
* interactives can co-occur (e.g. `focus-within` + `hover`), so a key may
|
|
14
|
+
* carry more than one.
|
|
15
|
+
* Sorting by priority — not alphabetically — keeps a key's atom order aligned
|
|
16
|
+
* with the emission/cascade order in `resolvePropertyStates` and
|
|
17
|
+
* `resolveSlotByCascade`, so one ordering convention holds end-to-end. (For
|
|
18
|
+
* Input the two orders coincide; they diverge only for atoms like `visited`,
|
|
19
|
+
* `autofill`, or `focus-visible` whose priority rank differs from their
|
|
20
|
+
* alphabetical position.)
|
|
21
|
+
* 3. Duplicates are removed.
|
|
22
|
+
* 4. Unknown atoms throw. Every caller passes atoms already validated via
|
|
23
|
+
* `isModifierAtomic`/`isInteractiveAtomic` (or pulled from
|
|
24
|
+
* `MODIFIER_ATOMICS`/`INTERACTIVE_ATOMICS`), so an unrecognized atom signals
|
|
25
|
+
* a caller bug and fails loudly rather than producing a silent bad key.
|
|
26
|
+
*
|
|
27
|
+
* Examples:
|
|
28
|
+
* canonicalizeStateKey(['hover', 'invalid']) // 'invalid&hover'
|
|
29
|
+
* canonicalizeStateKey(['invalid', 'hover']) // 'invalid&hover' (same)
|
|
30
|
+
* canonicalizeStateKey(['hover']) // 'hover'
|
|
31
|
+
* canonicalizeStateKey([]) // 'rest'
|
|
32
|
+
*
|
|
33
|
+
* The narrow public overload returns `PossibleStatesWithRest` so callers
|
|
34
|
+
* passing known atomics get a usable state-key type back without having to
|
|
35
|
+
* cast the result at the call site. The looser overload remains for callers
|
|
36
|
+
* that may pass unvalidated strings; its return is widened to `string` since
|
|
37
|
+
* those inputs can't guarantee a canonical-key result. The runtime body
|
|
38
|
+
* type-checks against the loose overload and validates atoms at runtime.
|
|
39
|
+
*/
|
|
40
|
+
declare function canonicalizeStateKey(atoms: readonly AtomicState[]): PossibleStatesWithRest;
|
|
41
|
+
declare function canonicalizeStateKey(atoms: readonly string[]): string;
|
|
42
|
+
/**
|
|
43
|
+
* Splits a canonical (or legacy) state key into its atomic parts.
|
|
44
|
+
* `'rest'` and `''` produce an empty array.
|
|
45
|
+
*/
|
|
46
|
+
declare function splitStateKey(stateKey: string): string[]; //#endregion
|
|
47
|
+
//#endregion
|
|
48
|
+
export { canonicalizeStateKey, splitStateKey };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
import { AtomicState } from "../types/StateAxis.js";
|
|
3
|
+
import { PossibleStatesWithRest } from "../types/ComponentConfig.js";
|
|
4
|
+
|
|
5
|
+
//#region ../automated-config/dist/utils/canonicalizeStateKey.d.ts
|
|
6
|
+
//#region src/utils/canonicalizeStateKey.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Returns the canonical state-key string for a list of atomic states.
|
|
9
|
+
*
|
|
10
|
+
* Canonical ordering rules:
|
|
11
|
+
* 1. Modifier atomics come first, sorted by `STATE_PRIORITY` (weakest first).
|
|
12
|
+
* 2. Interactive atomics come last, also sorted by `STATE_PRIORITY`. Multiple
|
|
13
|
+
* interactives can co-occur (e.g. `focus-within` + `hover`), so a key may
|
|
14
|
+
* carry more than one.
|
|
15
|
+
* Sorting by priority — not alphabetically — keeps a key's atom order aligned
|
|
16
|
+
* with the emission/cascade order in `resolvePropertyStates` and
|
|
17
|
+
* `resolveSlotByCascade`, so one ordering convention holds end-to-end. (For
|
|
18
|
+
* Input the two orders coincide; they diverge only for atoms like `visited`,
|
|
19
|
+
* `autofill`, or `focus-visible` whose priority rank differs from their
|
|
20
|
+
* alphabetical position.)
|
|
21
|
+
* 3. Duplicates are removed.
|
|
22
|
+
* 4. Unknown atoms throw. Every caller passes atoms already validated via
|
|
23
|
+
* `isModifierAtomic`/`isInteractiveAtomic` (or pulled from
|
|
24
|
+
* `MODIFIER_ATOMICS`/`INTERACTIVE_ATOMICS`), so an unrecognized atom signals
|
|
25
|
+
* a caller bug and fails loudly rather than producing a silent bad key.
|
|
26
|
+
*
|
|
27
|
+
* Examples:
|
|
28
|
+
* canonicalizeStateKey(['hover', 'invalid']) // 'invalid&hover'
|
|
29
|
+
* canonicalizeStateKey(['invalid', 'hover']) // 'invalid&hover' (same)
|
|
30
|
+
* canonicalizeStateKey(['hover']) // 'hover'
|
|
31
|
+
* canonicalizeStateKey([]) // 'rest'
|
|
32
|
+
*
|
|
33
|
+
* The narrow public overload returns `PossibleStatesWithRest` so callers
|
|
34
|
+
* passing known atomics get a usable state-key type back without having to
|
|
35
|
+
* cast the result at the call site. The looser overload remains for callers
|
|
36
|
+
* that may pass unvalidated strings; its return is widened to `string` since
|
|
37
|
+
* those inputs can't guarantee a canonical-key result. The runtime body
|
|
38
|
+
* type-checks against the loose overload and validates atoms at runtime.
|
|
39
|
+
*/
|
|
40
|
+
declare function canonicalizeStateKey(atoms: readonly AtomicState[]): PossibleStatesWithRest;
|
|
41
|
+
declare function canonicalizeStateKey(atoms: readonly string[]): string;
|
|
42
|
+
/**
|
|
43
|
+
* Splits a canonical (or legacy) state key into its atomic parts.
|
|
44
|
+
* `'rest'` and `''` produce an empty array.
|
|
45
|
+
*/
|
|
46
|
+
declare function splitStateKey(stateKey: string): string[]; //#endregion
|
|
47
|
+
//#endregion
|
|
48
|
+
export { canonicalizeStateKey, splitStateKey };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { comparePriority, isInteractiveAtomic, isModifierAtomic } from "../types/StateAxis.js";
|
|
3
|
+
//#region ../automated-config/dist/utils/canonicalizeStateKey.js
|
|
4
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
5
|
+
function canonicalizeStateKey(atoms) {
|
|
6
|
+
if (atoms.length === 0) return "rest";
|
|
7
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8
|
+
const modifiers = [];
|
|
9
|
+
const interactives = [];
|
|
10
|
+
for (const atom of atoms) {
|
|
11
|
+
if (seen.has(atom)) continue;
|
|
12
|
+
seen.add(atom);
|
|
13
|
+
if (isModifierAtomic(atom)) modifiers.push(atom);
|
|
14
|
+
else if (isInteractiveAtomic(atom)) interactives.push(atom);
|
|
15
|
+
else throw new Error(`canonicalizeStateKey received an unrecognized atom "${atom}". Atoms must be in MODIFIER_ATOMICS or INTERACTIVE_ATOMICS — see StateAxis.`);
|
|
16
|
+
}
|
|
17
|
+
modifiers.sort(comparePriority);
|
|
18
|
+
interactives.sort(comparePriority);
|
|
19
|
+
const ordered = [...modifiers, ...interactives];
|
|
20
|
+
return ordered.length === 0 ? "rest" : ordered.join("&");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Splits a canonical (or legacy) state key into its atomic parts.
|
|
24
|
+
* `'rest'` and `''` produce an empty array.
|
|
25
|
+
*/
|
|
26
|
+
function splitStateKey(stateKey) {
|
|
27
|
+
if (!stateKey || stateKey === "rest") return [];
|
|
28
|
+
return stateKey.split("&");
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { canonicalizeStateKey, splitStateKey };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentConfig, VariantConfig } from "../types/ComponentConfig.cjs";
|
|
3
|
+
|
|
4
|
+
//#region ../automated-config/dist/utils/getConfigComponentVariant.d.ts
|
|
5
|
+
//#region src/utils/getConfigComponentVariant.d.ts
|
|
6
|
+
declare function getConfigComponentVariant<C extends ComponentConfig>(config: C, variantKey: string, subComponentName?: string): VariantConfig<string> | null; //#endregion
|
|
7
|
+
//#endregion
|
|
8
|
+
export { getConfigComponentVariant };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentConfig, VariantConfig } from "../types/ComponentConfig.js";
|
|
3
|
+
|
|
4
|
+
//#region ../automated-config/dist/utils/getConfigComponentVariant.d.ts
|
|
5
|
+
//#region src/utils/getConfigComponentVariant.d.ts
|
|
6
|
+
declare function getConfigComponentVariant<C extends ComponentConfig>(config: C, variantKey: string, subComponentName?: string): VariantConfig<string> | null; //#endregion
|
|
7
|
+
//#endregion
|
|
8
|
+
export { getConfigComponentVariant };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { VariantConfig } from "../types/ComponentConfig.cjs";
|
|
3
2
|
import { SelectedConfigurableProperty } from "../properties.cjs";
|
|
3
|
+
import { VariantConfig } from "../types/ComponentConfig.cjs";
|
|
4
4
|
|
|
5
5
|
//#region ../automated-config/dist/utils/getConfigVariantProperties.d.ts
|
|
6
6
|
//#region src/utils/getConfigVariantProperties.d.ts
|
|
@@ -11,8 +11,8 @@ import { SelectedConfigurableProperty } from "../properties.cjs";
|
|
|
11
11
|
* @returns A Record of layer names to their properties, or null if no properties are found
|
|
12
12
|
*/
|
|
13
13
|
declare function getConfigVariantProperties(variant?: VariantConfig): {
|
|
14
|
-
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
15
|
-
root: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
14
|
+
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontFamily" | "fontSize" | "fontVariationSettings" | "lineHeight" | "textTransform" | "letterSpacing" | "gap" | "color" | "opacity" | "fillOpacity" | "fontWeight" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontFamily" | "fontSize" | "fontVariationSettings" | "lineHeight" | "textTransform" | "letterSpacing" | "gap" | "color" | "opacity" | "fillOpacity" | "fontWeight" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { VariantConfig } from "../types/ComponentConfig.js";
|
|
3
2
|
import { SelectedConfigurableProperty } from "../properties.js";
|
|
3
|
+
import { VariantConfig } from "../types/ComponentConfig.js";
|
|
4
4
|
|
|
5
5
|
//#region ../automated-config/dist/utils/getConfigVariantProperties.d.ts
|
|
6
6
|
//#region src/utils/getConfigVariantProperties.d.ts
|
|
@@ -11,8 +11,8 @@ import { SelectedConfigurableProperty } from "../properties.js";
|
|
|
11
11
|
* @returns A Record of layer names to their properties, or null if no properties are found
|
|
12
12
|
*/
|
|
13
13
|
declare function getConfigVariantProperties(variant?: VariantConfig): {
|
|
14
|
-
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
15
|
-
root: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
14
|
+
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontFamily" | "fontSize" | "fontVariationSettings" | "lineHeight" | "textTransform" | "letterSpacing" | "gap" | "color" | "opacity" | "fillOpacity" | "fontWeight" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontFamily" | "fontSize" | "fontVariationSettings" | "lineHeight" | "textTransform" | "letterSpacing" | "gap" | "color" | "opacity" | "fillOpacity" | "fontWeight" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
const require_componentStatePseudoStates = require("./componentStatePseudoStates.cjs");
|
|
3
|
+
const require_resolvePropertyStates = require("./resolvePropertyStates.cjs");
|
|
3
4
|
const require_variantConfigGuards = require("./variantConfigGuards.cjs");
|
|
4
5
|
const require_getConfigComponentVariant = require("./getConfigComponentVariant.cjs");
|
|
5
6
|
//#region ../automated-config/dist/utils/getConfigVariantPseudoStates.js
|
|
6
7
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Returns a map of state key → reactive properties for a variant. The state
|
|
10
|
+
* set comes from `resolvePropertyStates` — rest, atoms, and auto-generated
|
|
11
|
+
* compounds (modifier × interactive, modifier × modifier × interactive,
|
|
12
|
+
* etc.). The Configurator's StateBuilder caps user composition at the same
|
|
13
|
+
* depth, so every selectable state is in this map.
|
|
14
|
+
*/
|
|
8
15
|
function getConfigVariantPseudoStates(config, variantKey, state, subComponentName, componentStateValue) {
|
|
9
16
|
const componentVariant = require_getConfigComponentVariant.getConfigComponentVariant(config, variantKey, subComponentName);
|
|
10
17
|
if (!componentVariant) return null;
|
|
@@ -13,21 +20,21 @@ function getConfigVariantPseudoStates(config, variantKey, state, subComponentNam
|
|
|
13
20
|
const stateLayers = require_variantConfigGuards.isVariantConfigWithComponentStates(componentVariant) && state ? Object.entries(componentVariant.componentStates[state].layers ?? {}) : [];
|
|
14
21
|
return [...variantLayers, ...stateLayers].flatMap(([layerKey, layer]) => Object.entries(layer.properties).map(([propertyKey, property]) => [
|
|
15
22
|
layerKey,
|
|
23
|
+
layer,
|
|
16
24
|
propertyKey,
|
|
17
25
|
property
|
|
18
|
-
])).flatMap(([layerKey, propertyKey, property]) =>
|
|
26
|
+
])).flatMap(([layerKey, layer, propertyKey, property]) => require_componentStatePseudoStates.filterPseudoStatesByExclusion(require_resolvePropertyStates.resolvePropertyStates(layer, property), excludedPseudoStates).map((pseudoState) => [
|
|
19
27
|
layerKey,
|
|
20
28
|
propertyKey,
|
|
21
29
|
property,
|
|
22
30
|
pseudoState
|
|
23
31
|
])).reduce((acc, [layerKey, propertyKey, property, pseudoState]) => {
|
|
24
32
|
acc[pseudoState] = acc[pseudoState] ?? [];
|
|
25
|
-
|
|
33
|
+
acc[pseudoState].push([
|
|
26
34
|
layerKey,
|
|
27
35
|
propertyKey,
|
|
28
36
|
property
|
|
29
|
-
];
|
|
30
|
-
acc[pseudoState].push(info);
|
|
37
|
+
]);
|
|
31
38
|
return acc;
|
|
32
39
|
}, {});
|
|
33
40
|
}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import { ComponentConfig, PossibleStatesWithRest } from "../types/ComponentConfig.cjs";
|
|
3
2
|
import { SelectedConfigurableProperty } from "../properties.cjs";
|
|
3
|
+
import { ComponentConfig, PossibleStatesWithRest } from "../types/ComponentConfig.cjs";
|
|
4
4
|
|
|
5
5
|
//#region ../automated-config/dist/utils/getConfigVariantPseudoStates.d.ts
|
|
6
6
|
//#region src/utils/getConfigVariantPseudoStates.d.ts
|
|
7
7
|
type GenericProperty = SelectedConfigurableProperty<any, any>;
|
|
8
8
|
type InfoTuple = [string, string, GenericProperty];
|
|
9
|
+
/**
|
|
10
|
+
* Returns a map of state key → reactive properties for a variant. The state
|
|
11
|
+
* set comes from `resolvePropertyStates` — rest, atoms, and auto-generated
|
|
12
|
+
* compounds (modifier × interactive, modifier × modifier × interactive,
|
|
13
|
+
* etc.). The Configurator's StateBuilder caps user composition at the same
|
|
14
|
+
* depth, so every selectable state is in this map.
|
|
15
|
+
*/
|
|
9
16
|
declare function getConfigVariantPseudoStates<C extends ComponentConfig>(config: C, variantKey: string, state?: string, subComponentName?: string, componentStateValue?: string): Record<PossibleStatesWithRest, InfoTuple[]> | null; //#endregion
|
|
10
17
|
//#endregion
|
|
11
18
|
export { getConfigVariantPseudoStates };
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import { ComponentConfig, PossibleStatesWithRest } from "../types/ComponentConfig.js";
|
|
3
2
|
import { SelectedConfigurableProperty } from "../properties.js";
|
|
3
|
+
import { ComponentConfig, PossibleStatesWithRest } from "../types/ComponentConfig.js";
|
|
4
4
|
|
|
5
5
|
//#region ../automated-config/dist/utils/getConfigVariantPseudoStates.d.ts
|
|
6
6
|
//#region src/utils/getConfigVariantPseudoStates.d.ts
|
|
7
7
|
type GenericProperty = SelectedConfigurableProperty<any, any>;
|
|
8
8
|
type InfoTuple = [string, string, GenericProperty];
|
|
9
|
+
/**
|
|
10
|
+
* Returns a map of state key → reactive properties for a variant. The state
|
|
11
|
+
* set comes from `resolvePropertyStates` — rest, atoms, and auto-generated
|
|
12
|
+
* compounds (modifier × interactive, modifier × modifier × interactive,
|
|
13
|
+
* etc.). The Configurator's StateBuilder caps user composition at the same
|
|
14
|
+
* depth, so every selectable state is in this map.
|
|
15
|
+
*/
|
|
9
16
|
declare function getConfigVariantPseudoStates<C extends ComponentConfig>(config: C, variantKey: string, state?: string, subComponentName?: string, componentStateValue?: string): Record<PossibleStatesWithRest, InfoTuple[]> | null; //#endregion
|
|
10
17
|
//#endregion
|
|
11
18
|
export { getConfigVariantPseudoStates };
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { filterPseudoStatesByExclusion, getExcludedPseudoStatesForComponentStateOption } from "./componentStatePseudoStates.js";
|
|
3
|
+
import { resolvePropertyStates } from "./resolvePropertyStates.js";
|
|
3
4
|
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.js";
|
|
4
5
|
import { getConfigComponentVariant } from "./getConfigComponentVariant.js";
|
|
5
6
|
//#region ../automated-config/dist/utils/getConfigVariantPseudoStates.js
|
|
6
7
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Returns a map of state key → reactive properties for a variant. The state
|
|
10
|
+
* set comes from `resolvePropertyStates` — rest, atoms, and auto-generated
|
|
11
|
+
* compounds (modifier × interactive, modifier × modifier × interactive,
|
|
12
|
+
* etc.). The Configurator's StateBuilder caps user composition at the same
|
|
13
|
+
* depth, so every selectable state is in this map.
|
|
14
|
+
*/
|
|
8
15
|
function getConfigVariantPseudoStates(config, variantKey, state, subComponentName, componentStateValue) {
|
|
9
16
|
const componentVariant = getConfigComponentVariant(config, variantKey, subComponentName);
|
|
10
17
|
if (!componentVariant) return null;
|
|
@@ -13,21 +20,21 @@ function getConfigVariantPseudoStates(config, variantKey, state, subComponentNam
|
|
|
13
20
|
const stateLayers = isVariantConfigWithComponentStates(componentVariant) && state ? Object.entries(componentVariant.componentStates[state].layers ?? {}) : [];
|
|
14
21
|
return [...variantLayers, ...stateLayers].flatMap(([layerKey, layer]) => Object.entries(layer.properties).map(([propertyKey, property]) => [
|
|
15
22
|
layerKey,
|
|
23
|
+
layer,
|
|
16
24
|
propertyKey,
|
|
17
25
|
property
|
|
18
|
-
])).flatMap(([layerKey, propertyKey, property]) =>
|
|
26
|
+
])).flatMap(([layerKey, layer, propertyKey, property]) => filterPseudoStatesByExclusion(resolvePropertyStates(layer, property), excludedPseudoStates).map((pseudoState) => [
|
|
19
27
|
layerKey,
|
|
20
28
|
propertyKey,
|
|
21
29
|
property,
|
|
22
30
|
pseudoState
|
|
23
31
|
])).reduce((acc, [layerKey, propertyKey, property, pseudoState]) => {
|
|
24
32
|
acc[pseudoState] = acc[pseudoState] ?? [];
|
|
25
|
-
|
|
33
|
+
acc[pseudoState].push([
|
|
26
34
|
layerKey,
|
|
27
35
|
propertyKey,
|
|
28
36
|
property
|
|
29
|
-
];
|
|
30
|
-
acc[pseudoState].push(info);
|
|
37
|
+
]);
|
|
31
38
|
return acc;
|
|
32
39
|
}, {});
|
|
33
40
|
}
|