@yahoo/uds 3.156.1 → 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/getPaginationControlWidthPx.cjs +1 -1
- package/dist/automated-config/dist/utils/getPaginationControlWidthPx.js +1 -1
- 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 +14 -13
- package/dist/styles/styler.d.ts +14 -13
- 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/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 +2010 -2008
- package/dist/uds/generated/componentData.js +2010 -2008
- 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 +2553 -2551
- package/generated/migrationSchemaVersion.ts +1 -1
- package/generated/tailwindPurge.ts +2 -2
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ const require_index$1 = require("../../motion-tokens/dist/index.cjs");
|
|
|
8
8
|
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
9
9
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
10
10
|
const isInputWrapperCtx = (context) => {
|
|
11
|
-
return context.componentName === "input" && context.layer === "inputWrapper";
|
|
11
|
+
return context.componentName === "input" && (context.layer === "inputWrapper" || context.layer === "inputWrapperDynamic");
|
|
12
12
|
};
|
|
13
13
|
const hexToRgb = (hex) => {
|
|
14
14
|
hex = hex.replace("#", "");
|
|
@@ -8,7 +8,7 @@ import { SCALE_EFFECTS } from "../../motion-tokens/dist/index.js";
|
|
|
8
8
|
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
9
9
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
10
10
|
const isInputWrapperCtx = (context) => {
|
|
11
|
-
return context.componentName === "input" && context.layer === "inputWrapper";
|
|
11
|
+
return context.componentName === "input" && (context.layer === "inputWrapper" || context.layer === "inputWrapperDynamic");
|
|
12
12
|
};
|
|
13
13
|
const hexToRgb = (hex) => {
|
|
14
14
|
hex = hex.replace("#", "");
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
//#region ../tailwind-internal/dist/packages/automated-config/dist/types/StateAxis.js
|
|
3
|
+
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
4
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
5
|
+
/**
|
|
6
|
+
* Atomic-state taxonomy.
|
|
7
|
+
*
|
|
8
|
+
* Every interactive component reacts to a fixed set of "atomic" states, each
|
|
9
|
+
* belonging to one axis:
|
|
10
|
+
*
|
|
11
|
+
* - `interactive` — pointer/keyboard focus signals. At runtime at most one of
|
|
12
|
+
* these is meaningfully "active" at a time on a given element (you can't
|
|
13
|
+
* simultaneously hover and press distinctly enough to style separately, etc.).
|
|
14
|
+
*
|
|
15
|
+
* - `modifier` — semantic flags that can stack independently of each other and
|
|
16
|
+
* of the interactive state. An input can be `invalid` AND `readonly` at the
|
|
17
|
+
* same time, optionally also `hover`ed.
|
|
18
|
+
*
|
|
19
|
+
* Compound states (`'invalid&hover'`, `'invalid&readonly&hover'`, etc.) are
|
|
20
|
+
* built by listing 0..N modifiers followed by 0..1 interactive. The
|
|
21
|
+
* `canonicalizeStateKey` helper enforces this ordering so that, e.g.,
|
|
22
|
+
* `['hover', 'invalid']` and `['invalid', 'hover']` resolve to the same key.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Interactive atomics:
|
|
26
|
+
*
|
|
27
|
+
* - `hover`/`pressed` for pointer interaction.
|
|
28
|
+
* - `focus-within` for containers that wrap a focusable child (e.g. an input
|
|
29
|
+
* wrapper).
|
|
30
|
+
* - `focus-visible` for keyboard-only focus rings on focusable elements.
|
|
31
|
+
*/
|
|
32
|
+
const INTERACTIVE_ATOMICS = [
|
|
33
|
+
"hover",
|
|
34
|
+
"pressed",
|
|
35
|
+
"focus-within",
|
|
36
|
+
"focus-visible"
|
|
37
|
+
];
|
|
38
|
+
const MODIFIER_ATOMICS = [
|
|
39
|
+
"invalid",
|
|
40
|
+
"readonly",
|
|
41
|
+
"placeholder-shown",
|
|
42
|
+
"autofill",
|
|
43
|
+
"visited"
|
|
44
|
+
];
|
|
45
|
+
const INTERACTIVE_ATOMIC_SET = new Set(INTERACTIVE_ATOMICS);
|
|
46
|
+
const MODIFIER_ATOMIC_SET = new Set(MODIFIER_ATOMICS);
|
|
47
|
+
function isInteractiveAtomic(state) {
|
|
48
|
+
return INTERACTIVE_ATOMIC_SET.has(state);
|
|
49
|
+
}
|
|
50
|
+
function isModifierAtomic(state) {
|
|
51
|
+
return MODIFIER_ATOMIC_SET.has(state);
|
|
52
|
+
}
|
|
53
|
+
function isAtomicState(state) {
|
|
54
|
+
return isInteractiveAtomic(state) || isModifierAtomic(state);
|
|
55
|
+
}
|
|
56
|
+
const STATE_PRIORITY_INDEX = new Map([
|
|
57
|
+
"visited",
|
|
58
|
+
"placeholder-shown",
|
|
59
|
+
"autofill",
|
|
60
|
+
"focus-within",
|
|
61
|
+
"focus-visible",
|
|
62
|
+
"hover",
|
|
63
|
+
"pressed",
|
|
64
|
+
"invalid",
|
|
65
|
+
"readonly"
|
|
66
|
+
].map((atom, i) => [atom, i]));
|
|
67
|
+
/**
|
|
68
|
+
* Comparator usable with `Array.prototype.sort`. Atoms not in `STATE_PRIORITY`
|
|
69
|
+
* sort to the front (weakest) — this only triggers for unknown strings; every
|
|
70
|
+
* known `AtomicState` is in the priority array.
|
|
71
|
+
*/
|
|
72
|
+
function comparePriority(a, b) {
|
|
73
|
+
return (STATE_PRIORITY_INDEX.get(a) ?? -1) - (STATE_PRIORITY_INDEX.get(b) ?? -1);
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
exports.INTERACTIVE_ATOMICS = INTERACTIVE_ATOMICS;
|
|
77
|
+
exports.MODIFIER_ATOMICS = MODIFIER_ATOMICS;
|
|
78
|
+
exports.comparePriority = comparePriority;
|
|
79
|
+
exports.isAtomicState = isAtomicState;
|
|
80
|
+
exports.isInteractiveAtomic = isInteractiveAtomic;
|
|
81
|
+
exports.isModifierAtomic = isModifierAtomic;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
//#region ../tailwind-internal/dist/packages/automated-config/dist/types/StateAxis.js
|
|
3
|
+
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
4
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
5
|
+
/**
|
|
6
|
+
* Atomic-state taxonomy.
|
|
7
|
+
*
|
|
8
|
+
* Every interactive component reacts to a fixed set of "atomic" states, each
|
|
9
|
+
* belonging to one axis:
|
|
10
|
+
*
|
|
11
|
+
* - `interactive` — pointer/keyboard focus signals. At runtime at most one of
|
|
12
|
+
* these is meaningfully "active" at a time on a given element (you can't
|
|
13
|
+
* simultaneously hover and press distinctly enough to style separately, etc.).
|
|
14
|
+
*
|
|
15
|
+
* - `modifier` — semantic flags that can stack independently of each other and
|
|
16
|
+
* of the interactive state. An input can be `invalid` AND `readonly` at the
|
|
17
|
+
* same time, optionally also `hover`ed.
|
|
18
|
+
*
|
|
19
|
+
* Compound states (`'invalid&hover'`, `'invalid&readonly&hover'`, etc.) are
|
|
20
|
+
* built by listing 0..N modifiers followed by 0..1 interactive. The
|
|
21
|
+
* `canonicalizeStateKey` helper enforces this ordering so that, e.g.,
|
|
22
|
+
* `['hover', 'invalid']` and `['invalid', 'hover']` resolve to the same key.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Interactive atomics:
|
|
26
|
+
*
|
|
27
|
+
* - `hover`/`pressed` for pointer interaction.
|
|
28
|
+
* - `focus-within` for containers that wrap a focusable child (e.g. an input
|
|
29
|
+
* wrapper).
|
|
30
|
+
* - `focus-visible` for keyboard-only focus rings on focusable elements.
|
|
31
|
+
*/
|
|
32
|
+
const INTERACTIVE_ATOMICS = [
|
|
33
|
+
"hover",
|
|
34
|
+
"pressed",
|
|
35
|
+
"focus-within",
|
|
36
|
+
"focus-visible"
|
|
37
|
+
];
|
|
38
|
+
const MODIFIER_ATOMICS = [
|
|
39
|
+
"invalid",
|
|
40
|
+
"readonly",
|
|
41
|
+
"placeholder-shown",
|
|
42
|
+
"autofill",
|
|
43
|
+
"visited"
|
|
44
|
+
];
|
|
45
|
+
const INTERACTIVE_ATOMIC_SET = new Set(INTERACTIVE_ATOMICS);
|
|
46
|
+
const MODIFIER_ATOMIC_SET = new Set(MODIFIER_ATOMICS);
|
|
47
|
+
function isInteractiveAtomic(state) {
|
|
48
|
+
return INTERACTIVE_ATOMIC_SET.has(state);
|
|
49
|
+
}
|
|
50
|
+
function isModifierAtomic(state) {
|
|
51
|
+
return MODIFIER_ATOMIC_SET.has(state);
|
|
52
|
+
}
|
|
53
|
+
function isAtomicState(state) {
|
|
54
|
+
return isInteractiveAtomic(state) || isModifierAtomic(state);
|
|
55
|
+
}
|
|
56
|
+
const STATE_PRIORITY_INDEX = new Map([
|
|
57
|
+
"visited",
|
|
58
|
+
"placeholder-shown",
|
|
59
|
+
"autofill",
|
|
60
|
+
"focus-within",
|
|
61
|
+
"focus-visible",
|
|
62
|
+
"hover",
|
|
63
|
+
"pressed",
|
|
64
|
+
"invalid",
|
|
65
|
+
"readonly"
|
|
66
|
+
].map((atom, i) => [atom, i]));
|
|
67
|
+
/**
|
|
68
|
+
* Comparator usable with `Array.prototype.sort`. Atoms not in `STATE_PRIORITY`
|
|
69
|
+
* sort to the front (weakest) — this only triggers for unknown strings; every
|
|
70
|
+
* known `AtomicState` is in the priority array.
|
|
71
|
+
*/
|
|
72
|
+
function comparePriority(a, b) {
|
|
73
|
+
return (STATE_PRIORITY_INDEX.get(a) ?? -1) - (STATE_PRIORITY_INDEX.get(b) ?? -1);
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { INTERACTIVE_ATOMICS, MODIFIER_ATOMICS, comparePriority, isAtomicState, isInteractiveAtomic, isModifierAtomic };
|
package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/canonicalizeStateKey.cjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
const require_StateAxis = require("../types/StateAxis.cjs");
|
|
3
|
+
//#region ../tailwind-internal/dist/packages/automated-config/dist/utils/canonicalizeStateKey.js
|
|
4
|
+
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
5
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
6
|
+
function canonicalizeStateKey(atoms) {
|
|
7
|
+
if (atoms.length === 0) return "rest";
|
|
8
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9
|
+
const modifiers = [];
|
|
10
|
+
const interactives = [];
|
|
11
|
+
for (const atom of atoms) {
|
|
12
|
+
if (seen.has(atom)) continue;
|
|
13
|
+
seen.add(atom);
|
|
14
|
+
if (require_StateAxis.isModifierAtomic(atom)) modifiers.push(atom);
|
|
15
|
+
else if (require_StateAxis.isInteractiveAtomic(atom)) interactives.push(atom);
|
|
16
|
+
else throw new Error(`canonicalizeStateKey received an unrecognized atom "${atom}". Atoms must be in MODIFIER_ATOMICS or INTERACTIVE_ATOMICS — see StateAxis.`);
|
|
17
|
+
}
|
|
18
|
+
modifiers.sort(require_StateAxis.comparePriority);
|
|
19
|
+
interactives.sort(require_StateAxis.comparePriority);
|
|
20
|
+
const ordered = [...modifiers, ...interactives];
|
|
21
|
+
return ordered.length === 0 ? "rest" : ordered.join("&");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Splits a canonical (or legacy) state key into its atomic parts.
|
|
25
|
+
* `'rest'` and `''` produce an empty array.
|
|
26
|
+
*/
|
|
27
|
+
function splitStateKey(stateKey) {
|
|
28
|
+
if (!stateKey || stateKey === "rest") return [];
|
|
29
|
+
return stateKey.split("&");
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.canonicalizeStateKey = canonicalizeStateKey;
|
|
33
|
+
exports.splitStateKey = splitStateKey;
|
package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/canonicalizeStateKey.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { comparePriority, isInteractiveAtomic, isModifierAtomic } from "../types/StateAxis.js";
|
|
3
|
+
//#region ../tailwind-internal/dist/packages/automated-config/dist/utils/canonicalizeStateKey.js
|
|
4
|
+
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
5
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
6
|
+
function canonicalizeStateKey(atoms) {
|
|
7
|
+
if (atoms.length === 0) return "rest";
|
|
8
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9
|
+
const modifiers = [];
|
|
10
|
+
const interactives = [];
|
|
11
|
+
for (const atom of atoms) {
|
|
12
|
+
if (seen.has(atom)) continue;
|
|
13
|
+
seen.add(atom);
|
|
14
|
+
if (isModifierAtomic(atom)) modifiers.push(atom);
|
|
15
|
+
else if (isInteractiveAtomic(atom)) interactives.push(atom);
|
|
16
|
+
else throw new Error(`canonicalizeStateKey received an unrecognized atom "${atom}". Atoms must be in MODIFIER_ATOMICS or INTERACTIVE_ATOMICS — see StateAxis.`);
|
|
17
|
+
}
|
|
18
|
+
modifiers.sort(comparePriority);
|
|
19
|
+
interactives.sort(comparePriority);
|
|
20
|
+
const ordered = [...modifiers, ...interactives];
|
|
21
|
+
return ordered.length === 0 ? "rest" : ordered.join("&");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Splits a canonical (or legacy) state key into its atomic parts.
|
|
25
|
+
* `'rest'` and `''` produce an empty array.
|
|
26
|
+
*/
|
|
27
|
+
function splitStateKey(stateKey) {
|
|
28
|
+
if (!stateKey || stateKey === "rest") return [];
|
|
29
|
+
return stateKey.split("&");
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { canonicalizeStateKey, splitStateKey };
|
|
@@ -5,12 +5,5 @@
|
|
|
5
5
|
function getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption) {
|
|
6
6
|
return componentState.excludePseudoStatesForOptions?.[componentStateOption] ?? [];
|
|
7
7
|
}
|
|
8
|
-
function filterPseudoStatesByExclusion(pseudoStates, excludedPseudoStates) {
|
|
9
|
-
if (!pseudoStates) return [];
|
|
10
|
-
if (excludedPseudoStates.length === 0) return [...pseudoStates];
|
|
11
|
-
const excluded = new Set(excludedPseudoStates);
|
|
12
|
-
return pseudoStates.filter((pseudoState) => !excluded.has(pseudoState));
|
|
13
|
-
}
|
|
14
8
|
//#endregion
|
|
15
|
-
exports.filterPseudoStatesByExclusion = filterPseudoStatesByExclusion;
|
|
16
9
|
exports.getExcludedPseudoStatesForComponentStateOption = getExcludedPseudoStatesForComponentStateOption;
|
|
@@ -5,11 +5,5 @@
|
|
|
5
5
|
function getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption) {
|
|
6
6
|
return componentState.excludePseudoStatesForOptions?.[componentStateOption] ?? [];
|
|
7
7
|
}
|
|
8
|
-
function filterPseudoStatesByExclusion(pseudoStates, excludedPseudoStates) {
|
|
9
|
-
if (!pseudoStates) return [];
|
|
10
|
-
if (excludedPseudoStates.length === 0) return [...pseudoStates];
|
|
11
|
-
const excluded = new Set(excludedPseudoStates);
|
|
12
|
-
return pseudoStates.filter((pseudoState) => !excluded.has(pseudoState));
|
|
13
|
-
}
|
|
14
8
|
//#endregion
|
|
15
|
-
export {
|
|
9
|
+
export { getExcludedPseudoStatesForComponentStateOption };
|