@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
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
|
|
2
|
+
import { AtomicState, INTERACTIVE_ATOMICS, InteractiveAtomic, MAX_MODIFIERS_PER_COMPOUND, MODIFIER_ATOMICS, ModifierAtomic, isAtomicState, isInteractiveAtomic, isModifierAtomic } from "../types/StateAxis.cjs";
|
|
2
3
|
import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.cjs";
|
|
3
|
-
import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.cjs";
|
|
4
4
|
import { ConfigurablePropertiesName, SelectedConfigurableProperty, configurableProperties } from "../properties.cjs";
|
|
5
|
+
import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.cjs";
|
|
6
|
+
import { VariableState } from "../types/ConfigSchema.cjs";
|
|
5
7
|
import { ComponentSchema, buildConfigSchema, findFixtureType, findFixtureTypeForValue } from "./buildConfigSchema.cjs";
|
|
8
|
+
import { canonicalizeStateKey, splitStateKey } from "./canonicalizeStateKey.cjs";
|
|
6
9
|
import { cartesianProduct } from "./cartesianProduct.cjs";
|
|
7
10
|
import { coalesceConfigVariant } from "./coalesceConfigVariant.cjs";
|
|
8
11
|
import { getConfigDefaultValue, isConfigDefaultValue } from "./defaults.cjs";
|
|
9
12
|
import { generateDefaultClassName } from "./generateDefaultClassName.cjs";
|
|
10
13
|
import { generateKeyFromFlatConfigPath } from "./generateKeyFromFlatConfigPath.cjs";
|
|
11
14
|
import { generateSchemaKey } from "./generateSchemaKey.cjs";
|
|
15
|
+
import { getConfigComponentVariant } from "./getConfigComponentVariant.cjs";
|
|
12
16
|
import { getConfigVariantComponentStates, getConfigVariantComponentStatesMatrix } from "./getConfigVariantComponentStatesMatrix.cjs";
|
|
13
17
|
import { getConfigVariantProperties } from "./getConfigVariantProperties.cjs";
|
|
14
18
|
import { getConfigVariantPseudoStates } from "./getConfigVariantPseudoStates.cjs";
|
|
15
19
|
import { getConfigVariants } from "./getConfigVariants.cjs";
|
|
16
20
|
import { PaginationWidthConfig, getPaginationControlWidthPx, syncPaginationWidthVarForSize } from "./getPaginationControlWidthPx.cjs";
|
|
21
|
+
import { getStateDocsClass, getStateSelector, isKnownStateAtom } from "./pseudoStateSelectors.cjs";
|
|
22
|
+
import { resolvePropertyStates } from "./resolvePropertyStates.cjs";
|
|
23
|
+
import { PropertyStates, StateSlot, propertyUsesPerStateEnabled, resolveSlotByCascade } from "./resolveSlotByCascade.cjs";
|
|
17
24
|
import { getConfigSubcomponents } from "./subcomponents.cjs";
|
|
25
|
+
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.cjs";
|
|
18
26
|
|
|
19
27
|
//#region ../automated-config/dist/utils/index.d.ts
|
|
20
28
|
//#region src/utils/index.d.ts
|
|
21
29
|
type ThemeFn = (path: string) => string;
|
|
30
|
+
type EmitMode = 'exhaustive' | 'selective';
|
|
22
31
|
declare const statePseudoMapDocsMode: Record<PossibleStatesWithRest, string>;
|
|
23
32
|
/**
|
|
24
33
|
* Forces button borders to use box-shadow instead of border properties.
|
|
@@ -59,6 +68,15 @@ declare function generateClassName({
|
|
|
59
68
|
layer: string;
|
|
60
69
|
layerOptionalPseudoSelector?: string;
|
|
61
70
|
}): string;
|
|
71
|
+
/**
|
|
72
|
+
* Builds the per-state resolution map for a per-componentState OVERRIDE in
|
|
73
|
+
* exhaustive mode: the universal layer's state map with the override's ENABLED
|
|
74
|
+
* (and `rest`) slots layered on top. An unset or disabled override slot defers
|
|
75
|
+
* to the universal layer's value, so `resolveSlotByCascade` picks the
|
|
76
|
+
* most-specific *enabled* slot across both layers (override winning ties) rather
|
|
77
|
+
* than collapsing every unset state to the override's own `rest`.
|
|
78
|
+
*/
|
|
79
|
+
declare function mergeUniversalUnderOverride(universal: VariableState, override: VariableState): VariableState;
|
|
62
80
|
declare function generateDeclaration({
|
|
63
81
|
componentName,
|
|
64
82
|
subComponentName,
|
|
@@ -71,10 +89,15 @@ declare function generateDeclaration({
|
|
|
71
89
|
schema,
|
|
72
90
|
propertyKey,
|
|
73
91
|
originalPropertyDefinition,
|
|
92
|
+
declaredStates,
|
|
93
|
+
layerUsesAtomicStates,
|
|
74
94
|
theme,
|
|
75
95
|
currentStyles,
|
|
76
96
|
previewOptions,
|
|
77
|
-
excludedPseudoStates
|
|
97
|
+
excludedPseudoStates,
|
|
98
|
+
emit,
|
|
99
|
+
fallbackStateMap,
|
|
100
|
+
bumpRootSpecificity
|
|
78
101
|
}: {
|
|
79
102
|
componentName: string;
|
|
80
103
|
subComponentName?: string;
|
|
@@ -87,25 +110,39 @@ declare function generateDeclaration({
|
|
|
87
110
|
schema: unknown;
|
|
88
111
|
propertyKey: string;
|
|
89
112
|
originalPropertyDefinition: SelectedConfigurableProperty<ConfigurablePropertiesName, any>;
|
|
113
|
+
declaredStates: ReadonlySet<string>;
|
|
114
|
+
layerUsesAtomicStates: boolean;
|
|
90
115
|
theme: ThemeFn;
|
|
91
116
|
currentStyles: Readonly<Record<string, Record<string, string>>>;
|
|
92
117
|
previewOptions?: {
|
|
93
118
|
generatePseudoStateClassModifier?: boolean;
|
|
94
119
|
};
|
|
95
120
|
excludedPseudoStates?: readonly PossibleStates[];
|
|
121
|
+
emit?: EmitMode;
|
|
122
|
+
fallbackStateMap?: VariableState;
|
|
123
|
+
bumpRootSpecificity?: boolean;
|
|
96
124
|
}): Record<string, Record<string, string>>;
|
|
97
125
|
declare function generateConfigStyles<C extends ComponentConfig>(config: C, schema: ComponentSchema<ComponentConfig>, theme: ThemeFn, previewOptions?: {
|
|
98
126
|
generatePseudoStateClassModifier: boolean;
|
|
99
|
-
}): Record<string, Record<string, string>>;
|
|
127
|
+
}, emit?: EmitMode): Record<string, Record<string, string>>;
|
|
100
128
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
129
|
+
* Public entry point. Generates a component's CSS, emitting each declared state
|
|
130
|
+
* as its own rule (one selector per rule) so the cascade is carried entirely by
|
|
131
|
+
* per-rule specificity — which CSS minifiers preserve.
|
|
132
|
+
*
|
|
133
|
+
* An earlier optimization merged rules sharing a declaration block into a single
|
|
134
|
+
* comma-separated selector list (to avoid repeating invariant declarations per
|
|
135
|
+
* state). It was removed: a minifier's forgiving-`:is()` rewrite — applied to a
|
|
136
|
+
* comma-separated list that contains `:has()` when targeting browsers without
|
|
137
|
+
* native `:has()` support — collapses the list to its single highest
|
|
138
|
+
* specificity, inflating the weakest selector (`rest`) above genuinely
|
|
139
|
+
* customized states and corrupting the cascade. Separate rules never form such a
|
|
140
|
+
* list, so minifiers leave their specificity intact. (gzip already collapses the
|
|
141
|
+
* repeated declaration blocks, so the shipped-size cost is minimal.)
|
|
106
142
|
*/
|
|
107
143
|
declare const generateStyles: (config: ComponentConfig, schema: ComponentSchema<ComponentConfig>, theme: ThemeFn, previewOptions: {
|
|
108
144
|
generatePseudoStateClassModifier: boolean;
|
|
145
|
+
emit?: EmitMode;
|
|
109
146
|
}) => Record<string, Record<string, string>>;
|
|
110
147
|
declare function createConfigurableProperty<C extends ConfigurablePropertiesName, O extends string, T extends (typeof configurableProperties)[C]['possibleFixtures'], V extends readonly (readonly unknown[])[] = readonly (readonly unknown[])[]>(prop: {
|
|
111
148
|
name: C;
|
|
@@ -113,8 +150,9 @@ declare function createConfigurableProperty<C extends ConfigurablePropertiesName
|
|
|
113
150
|
values: V;
|
|
114
151
|
defaults: { [K in O]: V[number][number] | (Extract<T[number], ArbitraryFixtures> extends never ? never : InferArbitraryType<Extract<T[number], ArbitraryFixtures>>) };
|
|
115
152
|
label: string;
|
|
116
|
-
skipRestState?: boolean;
|
|
153
|
+
skipRestState?: boolean; /** @deprecated Prefer layer-level `atomicStates` + `excludeAtomics`. */
|
|
117
154
|
pseudoStates?: PossibleStates[];
|
|
155
|
+
excludeAtomics?: AtomicState[];
|
|
118
156
|
supportsCustom?: boolean;
|
|
119
157
|
layerReference?: {
|
|
120
158
|
variablePath: string;
|
|
@@ -143,24 +181,36 @@ declare function createVariantConfigWithComponentStates(config: {
|
|
|
143
181
|
default: string;
|
|
144
182
|
options: readonly string[];
|
|
145
183
|
componentStates: Record<string, ComponentStateConfig>;
|
|
184
|
+
layers?: {
|
|
185
|
+
root: LayerConfig;
|
|
186
|
+
} & Record<string, LayerConfig>;
|
|
146
187
|
}): VariantConfigWithComponentStates;
|
|
147
|
-
declare function createComponentStates
|
|
188
|
+
declare function createComponentStates<T extends {
|
|
148
189
|
label: string;
|
|
149
|
-
options: string[];
|
|
190
|
+
options: readonly string[];
|
|
150
191
|
excludePseudoStatesForOptions?: Partial<Record<string, readonly PossibleStates[]>>;
|
|
151
|
-
layers
|
|
192
|
+
layers?: {
|
|
152
193
|
root: LayerConfig;
|
|
153
194
|
} & Record<string, LayerConfig>;
|
|
154
|
-
}):
|
|
155
|
-
declare function createLayerConfig
|
|
195
|
+
}>(config: T): T;
|
|
196
|
+
declare function createLayerConfig<T extends {
|
|
156
197
|
label: string;
|
|
157
198
|
pseudoSelector?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Atomic states this layer can style. Properties on the layer pick up rest,
|
|
201
|
+
* each declared atom, and every auto-generated compound up to
|
|
202
|
+
* `MAX_MODIFIERS_PER_COMPOUND` modifiers optionally combined with one
|
|
203
|
+
* interactive (skipping pairs the browser suppresses). Properties opt out
|
|
204
|
+
* of individual atoms via `excludeAtomics`. See {@link LayerConfig} for the
|
|
205
|
+
* full breakdown.
|
|
206
|
+
*/
|
|
207
|
+
atomicStates?: AtomicState[];
|
|
158
208
|
properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
|
|
159
|
-
}):
|
|
209
|
+
}>(config: T): T;
|
|
160
210
|
declare function createSubComponentConfig(config: {
|
|
161
211
|
label: string;
|
|
162
212
|
description: string;
|
|
163
213
|
variants: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
|
|
164
214
|
}): SubComponentConfig; //#endregion
|
|
165
215
|
//#endregion
|
|
166
|
-
export { applyBoxShadowBorder, createComponentStates, createConfigurableProperty, createLayerConfig, createSubComponentConfig, createVariantConfig, createVariantConfigWithComponentStates, createVariantConfigWithProperties, generateClassName, generateConfigStyles, generateDeclaration, generateStyles, statePseudoMapDocsMode };
|
|
216
|
+
export { EmitMode, applyBoxShadowBorder, createComponentStates, createConfigurableProperty, createLayerConfig, createSubComponentConfig, createVariantConfig, createVariantConfigWithComponentStates, createVariantConfigWithProperties, generateClassName, generateConfigStyles, generateDeclaration, generateStyles, mergeUniversalUnderOverride, statePseudoMapDocsMode };
|
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
|
|
2
|
+
import { AtomicState, INTERACTIVE_ATOMICS, InteractiveAtomic, MAX_MODIFIERS_PER_COMPOUND, MODIFIER_ATOMICS, ModifierAtomic, isAtomicState, isInteractiveAtomic, isModifierAtomic } from "../types/StateAxis.js";
|
|
2
3
|
import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.js";
|
|
3
|
-
import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.js";
|
|
4
4
|
import { ConfigurablePropertiesName, SelectedConfigurableProperty, configurableProperties } from "../properties.js";
|
|
5
|
+
import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.js";
|
|
6
|
+
import { VariableState } from "../types/ConfigSchema.js";
|
|
5
7
|
import { ComponentSchema, buildConfigSchema, findFixtureType, findFixtureTypeForValue } from "./buildConfigSchema.js";
|
|
8
|
+
import { canonicalizeStateKey, splitStateKey } from "./canonicalizeStateKey.js";
|
|
6
9
|
import { cartesianProduct } from "./cartesianProduct.js";
|
|
7
10
|
import { coalesceConfigVariant } from "./coalesceConfigVariant.js";
|
|
8
11
|
import { getConfigDefaultValue, isConfigDefaultValue } from "./defaults.js";
|
|
9
12
|
import { generateDefaultClassName } from "./generateDefaultClassName.js";
|
|
10
13
|
import { generateKeyFromFlatConfigPath } from "./generateKeyFromFlatConfigPath.js";
|
|
11
14
|
import { generateSchemaKey } from "./generateSchemaKey.js";
|
|
15
|
+
import { getConfigComponentVariant } from "./getConfigComponentVariant.js";
|
|
12
16
|
import { getConfigVariantComponentStates, getConfigVariantComponentStatesMatrix } from "./getConfigVariantComponentStatesMatrix.js";
|
|
13
17
|
import { getConfigVariantProperties } from "./getConfigVariantProperties.js";
|
|
14
18
|
import { getConfigVariantPseudoStates } from "./getConfigVariantPseudoStates.js";
|
|
15
19
|
import { getConfigVariants } from "./getConfigVariants.js";
|
|
16
20
|
import { PaginationWidthConfig, getPaginationControlWidthPx, syncPaginationWidthVarForSize } from "./getPaginationControlWidthPx.js";
|
|
21
|
+
import { getStateDocsClass, getStateSelector, isKnownStateAtom } from "./pseudoStateSelectors.js";
|
|
22
|
+
import { resolvePropertyStates } from "./resolvePropertyStates.js";
|
|
23
|
+
import { PropertyStates, StateSlot, propertyUsesPerStateEnabled, resolveSlotByCascade } from "./resolveSlotByCascade.js";
|
|
17
24
|
import { getConfigSubcomponents } from "./subcomponents.js";
|
|
25
|
+
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.js";
|
|
18
26
|
|
|
19
27
|
//#region ../automated-config/dist/utils/index.d.ts
|
|
20
28
|
//#region src/utils/index.d.ts
|
|
21
29
|
type ThemeFn = (path: string) => string;
|
|
30
|
+
type EmitMode = 'exhaustive' | 'selective';
|
|
22
31
|
declare const statePseudoMapDocsMode: Record<PossibleStatesWithRest, string>;
|
|
23
32
|
/**
|
|
24
33
|
* Forces button borders to use box-shadow instead of border properties.
|
|
@@ -59,6 +68,15 @@ declare function generateClassName({
|
|
|
59
68
|
layer: string;
|
|
60
69
|
layerOptionalPseudoSelector?: string;
|
|
61
70
|
}): string;
|
|
71
|
+
/**
|
|
72
|
+
* Builds the per-state resolution map for a per-componentState OVERRIDE in
|
|
73
|
+
* exhaustive mode: the universal layer's state map with the override's ENABLED
|
|
74
|
+
* (and `rest`) slots layered on top. An unset or disabled override slot defers
|
|
75
|
+
* to the universal layer's value, so `resolveSlotByCascade` picks the
|
|
76
|
+
* most-specific *enabled* slot across both layers (override winning ties) rather
|
|
77
|
+
* than collapsing every unset state to the override's own `rest`.
|
|
78
|
+
*/
|
|
79
|
+
declare function mergeUniversalUnderOverride(universal: VariableState, override: VariableState): VariableState;
|
|
62
80
|
declare function generateDeclaration({
|
|
63
81
|
componentName,
|
|
64
82
|
subComponentName,
|
|
@@ -71,10 +89,15 @@ declare function generateDeclaration({
|
|
|
71
89
|
schema,
|
|
72
90
|
propertyKey,
|
|
73
91
|
originalPropertyDefinition,
|
|
92
|
+
declaredStates,
|
|
93
|
+
layerUsesAtomicStates,
|
|
74
94
|
theme,
|
|
75
95
|
currentStyles,
|
|
76
96
|
previewOptions,
|
|
77
|
-
excludedPseudoStates
|
|
97
|
+
excludedPseudoStates,
|
|
98
|
+
emit,
|
|
99
|
+
fallbackStateMap,
|
|
100
|
+
bumpRootSpecificity
|
|
78
101
|
}: {
|
|
79
102
|
componentName: string;
|
|
80
103
|
subComponentName?: string;
|
|
@@ -87,25 +110,39 @@ declare function generateDeclaration({
|
|
|
87
110
|
schema: unknown;
|
|
88
111
|
propertyKey: string;
|
|
89
112
|
originalPropertyDefinition: SelectedConfigurableProperty<ConfigurablePropertiesName, any>;
|
|
113
|
+
declaredStates: ReadonlySet<string>;
|
|
114
|
+
layerUsesAtomicStates: boolean;
|
|
90
115
|
theme: ThemeFn;
|
|
91
116
|
currentStyles: Readonly<Record<string, Record<string, string>>>;
|
|
92
117
|
previewOptions?: {
|
|
93
118
|
generatePseudoStateClassModifier?: boolean;
|
|
94
119
|
};
|
|
95
120
|
excludedPseudoStates?: readonly PossibleStates[];
|
|
121
|
+
emit?: EmitMode;
|
|
122
|
+
fallbackStateMap?: VariableState;
|
|
123
|
+
bumpRootSpecificity?: boolean;
|
|
96
124
|
}): Record<string, Record<string, string>>;
|
|
97
125
|
declare function generateConfigStyles<C extends ComponentConfig>(config: C, schema: ComponentSchema<ComponentConfig>, theme: ThemeFn, previewOptions?: {
|
|
98
126
|
generatePseudoStateClassModifier: boolean;
|
|
99
|
-
}): Record<string, Record<string, string>>;
|
|
127
|
+
}, emit?: EmitMode): Record<string, Record<string, string>>;
|
|
100
128
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
129
|
+
* Public entry point. Generates a component's CSS, emitting each declared state
|
|
130
|
+
* as its own rule (one selector per rule) so the cascade is carried entirely by
|
|
131
|
+
* per-rule specificity — which CSS minifiers preserve.
|
|
132
|
+
*
|
|
133
|
+
* An earlier optimization merged rules sharing a declaration block into a single
|
|
134
|
+
* comma-separated selector list (to avoid repeating invariant declarations per
|
|
135
|
+
* state). It was removed: a minifier's forgiving-`:is()` rewrite — applied to a
|
|
136
|
+
* comma-separated list that contains `:has()` when targeting browsers without
|
|
137
|
+
* native `:has()` support — collapses the list to its single highest
|
|
138
|
+
* specificity, inflating the weakest selector (`rest`) above genuinely
|
|
139
|
+
* customized states and corrupting the cascade. Separate rules never form such a
|
|
140
|
+
* list, so minifiers leave their specificity intact. (gzip already collapses the
|
|
141
|
+
* repeated declaration blocks, so the shipped-size cost is minimal.)
|
|
106
142
|
*/
|
|
107
143
|
declare const generateStyles: (config: ComponentConfig, schema: ComponentSchema<ComponentConfig>, theme: ThemeFn, previewOptions: {
|
|
108
144
|
generatePseudoStateClassModifier: boolean;
|
|
145
|
+
emit?: EmitMode;
|
|
109
146
|
}) => Record<string, Record<string, string>>;
|
|
110
147
|
declare function createConfigurableProperty<C extends ConfigurablePropertiesName, O extends string, T extends (typeof configurableProperties)[C]['possibleFixtures'], V extends readonly (readonly unknown[])[] = readonly (readonly unknown[])[]>(prop: {
|
|
111
148
|
name: C;
|
|
@@ -113,8 +150,9 @@ declare function createConfigurableProperty<C extends ConfigurablePropertiesName
|
|
|
113
150
|
values: V;
|
|
114
151
|
defaults: { [K in O]: V[number][number] | (Extract<T[number], ArbitraryFixtures> extends never ? never : InferArbitraryType<Extract<T[number], ArbitraryFixtures>>) };
|
|
115
152
|
label: string;
|
|
116
|
-
skipRestState?: boolean;
|
|
153
|
+
skipRestState?: boolean; /** @deprecated Prefer layer-level `atomicStates` + `excludeAtomics`. */
|
|
117
154
|
pseudoStates?: PossibleStates[];
|
|
155
|
+
excludeAtomics?: AtomicState[];
|
|
118
156
|
supportsCustom?: boolean;
|
|
119
157
|
layerReference?: {
|
|
120
158
|
variablePath: string;
|
|
@@ -143,24 +181,36 @@ declare function createVariantConfigWithComponentStates(config: {
|
|
|
143
181
|
default: string;
|
|
144
182
|
options: readonly string[];
|
|
145
183
|
componentStates: Record<string, ComponentStateConfig>;
|
|
184
|
+
layers?: {
|
|
185
|
+
root: LayerConfig;
|
|
186
|
+
} & Record<string, LayerConfig>;
|
|
146
187
|
}): VariantConfigWithComponentStates;
|
|
147
|
-
declare function createComponentStates
|
|
188
|
+
declare function createComponentStates<T extends {
|
|
148
189
|
label: string;
|
|
149
|
-
options: string[];
|
|
190
|
+
options: readonly string[];
|
|
150
191
|
excludePseudoStatesForOptions?: Partial<Record<string, readonly PossibleStates[]>>;
|
|
151
|
-
layers
|
|
192
|
+
layers?: {
|
|
152
193
|
root: LayerConfig;
|
|
153
194
|
} & Record<string, LayerConfig>;
|
|
154
|
-
}):
|
|
155
|
-
declare function createLayerConfig
|
|
195
|
+
}>(config: T): T;
|
|
196
|
+
declare function createLayerConfig<T extends {
|
|
156
197
|
label: string;
|
|
157
198
|
pseudoSelector?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Atomic states this layer can style. Properties on the layer pick up rest,
|
|
201
|
+
* each declared atom, and every auto-generated compound up to
|
|
202
|
+
* `MAX_MODIFIERS_PER_COMPOUND` modifiers optionally combined with one
|
|
203
|
+
* interactive (skipping pairs the browser suppresses). Properties opt out
|
|
204
|
+
* of individual atoms via `excludeAtomics`. See {@link LayerConfig} for the
|
|
205
|
+
* full breakdown.
|
|
206
|
+
*/
|
|
207
|
+
atomicStates?: AtomicState[];
|
|
158
208
|
properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
|
|
159
|
-
}):
|
|
209
|
+
}>(config: T): T;
|
|
160
210
|
declare function createSubComponentConfig(config: {
|
|
161
211
|
label: string;
|
|
162
212
|
description: string;
|
|
163
213
|
variants: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
|
|
164
214
|
}): SubComponentConfig; //#endregion
|
|
165
215
|
//#endregion
|
|
166
|
-
export { applyBoxShadowBorder, createComponentStates, createConfigurableProperty, createLayerConfig, createSubComponentConfig, createVariantConfig, createVariantConfigWithComponentStates, createVariantConfigWithProperties, generateClassName, generateConfigStyles, generateDeclaration, generateStyles, statePseudoMapDocsMode };
|
|
216
|
+
export { EmitMode, applyBoxShadowBorder, createComponentStates, createConfigurableProperty, createLayerConfig, createSubComponentConfig, createVariantConfig, createVariantConfigWithComponentStates, createVariantConfigWithProperties, generateClassName, generateConfigStyles, generateDeclaration, generateStyles, mergeUniversalUnderOverride, statePseudoMapDocsMode };
|