@yahoo/uds 3.156.2 → 3.157.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +3078 -3089
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +158 -141
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +158 -141
- package/dist/automated-config/dist/generated/generatedConfigs.js +3078 -3089
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +1217 -491
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +4 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +4 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +1217 -491
- package/dist/automated-config/dist/properties.cjs +9 -2
- package/dist/automated-config/dist/properties.d.cts +23 -0
- package/dist/automated-config/dist/properties.d.ts +23 -0
- package/dist/automated-config/dist/properties.js +9 -2
- 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 +105 -82
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +41 -12
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +41 -12
- package/dist/automated-config/dist/utils/buildConfigSchema.js +106 -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/getButtonControlHeight.cjs +129 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.d.cts +133 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.d.ts +133 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.js +122 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.cjs +114 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.d.cts +78 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.d.ts +78 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.js +108 -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/iconButtonMatchButtonHeight.cjs +110 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.d.cts +19 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.d.ts +19 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.js +108 -0
- package/dist/automated-config/dist/utils/index.cjs +478 -111
- package/dist/automated-config/dist/utils/index.d.cts +76 -15
- package/dist/automated-config/dist/utils/index.d.ts +76 -15
- package/dist/automated-config/dist/utils/index.js +479 -113
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.cjs +15 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.d.cts +20 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.d.ts +20 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.js +15 -0
- 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/Button.cjs +3 -3
- package/dist/components/client/Button.js +3 -3
- 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/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
- package/dist/config/dist/index.cjs +224 -553
- package/dist/config/dist/index.js +224 -553
- 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 +9 -2
- package/dist/css/dist/packages/automated-config/dist/properties.js +9 -2
- 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 +224 -553
- package/dist/css/dist/packages/config/dist/index.js +224 -553
- package/dist/css/dist/utils/optimizeCSS.cjs +59 -0
- package/dist/css/dist/utils/optimizeCSS.js +59 -0
- package/dist/css-tokens/dist/index.cjs +2 -0
- package/dist/css-tokens/dist/index.d.cts +2 -1
- package/dist/css-tokens/dist/index.d.ts +2 -1
- package/dist/css-tokens/dist/index.js +2 -1
- package/dist/index.cjs +48 -0
- package/dist/index.d.cts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +14 -3
- package/dist/styles/styler.d.cts +8 -7
- package/dist/styles/styler.d.ts +8 -7
- 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 +3078 -3089
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +3078 -3089
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.cjs +9 -2
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.js +9 -2
- 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/getButtonControlHeight.cjs +126 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.js +123 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.cjs +20 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.js +20 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +422 -111
- 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 +423 -112
- 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 +224 -553
- package/dist/tailwind-internal/dist/packages/config/dist/index.js +224 -553
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.cjs +2 -0
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.js +2 -1
- 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 +47 -0
- package/dist/tokens/automation/index.d.cts +13 -2
- package/dist/tokens/automation/index.d.ts +13 -2
- package/dist/tokens/automation/index.js +13 -2
- package/dist/tokens/consts/cssTokens.cjs +1 -0
- package/dist/tokens/consts/cssTokens.d.cts +2 -2
- package/dist/tokens/consts/cssTokens.d.ts +2 -2
- package/dist/tokens/consts/cssTokens.js +2 -2
- package/dist/tokens/index.cjs +48 -0
- package/dist/tokens/index.d.cts +15 -4
- package/dist/tokens/index.d.ts +15 -4
- package/dist/tokens/index.js +14 -3
- package/dist/tokens/types.d.cts +1 -1
- package/dist/tokens/types.d.ts +1 -1
- package/dist/uds/generated/componentData.cjs +2177 -2172
- package/dist/uds/generated/componentData.js +2177 -2172
- 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 +2718 -2713
- package/generated/migrationSchemaVersion.ts +1 -1
- package/generated/tailwindPurge.ts +2 -2
- package/package.json +1 -1
|
@@ -1,24 +1,37 @@
|
|
|
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 { IconButtonMatchButtonHeightConfig, IconButtonMatchButtonHeightSize, disableIconButtonMatchButtonHeight, enableIconButtonMatchButtonHeight, isIconButtonMatchButtonHeightEnabled } from "./iconButtonMatchButtonHeight.cjs";
|
|
16
|
+
import { ButtonControlSchema, SHARED_BUTTON_ICONBUTTON_SIZES, applyButtonControlHeightDeclarations, applyIconButtonControlHeightDeclarations, getButtonContentLineHeight, getButtonControlContentSize, getButtonControlHeight, getButtonIconSizeVar, getIconButtonControlHeight } from "./getButtonControlHeight.cjs";
|
|
17
|
+
import { getButtonControlHeightPx, getIconButtonControlHeightPx, getIconButtonOnlyControlHeightPx, syncButtonControlHeightVarForSize, syncIconButtonControlHeightVarForSize, syncIconButtonOnlyControlHeightVarForSize } from "./getButtonControlHeightPx.cjs";
|
|
18
|
+
import { getConfigComponentVariant } from "./getConfigComponentVariant.cjs";
|
|
12
19
|
import { getConfigVariantComponentStates, getConfigVariantComponentStatesMatrix } from "./getConfigVariantComponentStatesMatrix.cjs";
|
|
13
20
|
import { getConfigVariantProperties } from "./getConfigVariantProperties.cjs";
|
|
14
21
|
import { getConfigVariantPseudoStates } from "./getConfigVariantPseudoStates.cjs";
|
|
15
22
|
import { getConfigVariants } from "./getConfigVariants.cjs";
|
|
16
23
|
import { PaginationWidthConfig, getPaginationControlWidthPx, syncPaginationWidthVarForSize } from "./getPaginationControlWidthPx.cjs";
|
|
24
|
+
import { isConfiguratorPropertyVisible } from "./isConfiguratorPropertyVisible.cjs";
|
|
25
|
+
import { getStateDocsClass, getStateSelector, isKnownStateAtom } from "./pseudoStateSelectors.cjs";
|
|
26
|
+
import { resolvePropertyStates } from "./resolvePropertyStates.cjs";
|
|
27
|
+
import { PropertyStates, StateSlot, propertyUsesPerStateEnabled, resolveSlotByCascade } from "./resolveSlotByCascade.cjs";
|
|
17
28
|
import { getConfigSubcomponents } from "./subcomponents.cjs";
|
|
29
|
+
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.cjs";
|
|
18
30
|
|
|
19
31
|
//#region ../automated-config/dist/utils/index.d.ts
|
|
20
32
|
//#region src/utils/index.d.ts
|
|
21
33
|
type ThemeFn = (path: string) => string;
|
|
34
|
+
type EmitMode = 'exhaustive' | 'selective';
|
|
22
35
|
declare const statePseudoMapDocsMode: Record<PossibleStatesWithRest, string>;
|
|
23
36
|
/**
|
|
24
37
|
* Forces button borders to use box-shadow instead of border properties.
|
|
@@ -59,6 +72,15 @@ declare function generateClassName({
|
|
|
59
72
|
layer: string;
|
|
60
73
|
layerOptionalPseudoSelector?: string;
|
|
61
74
|
}): string;
|
|
75
|
+
/**
|
|
76
|
+
* Builds the per-state resolution map for a per-componentState OVERRIDE in
|
|
77
|
+
* exhaustive mode: the universal layer's state map with the override's ENABLED
|
|
78
|
+
* (and `rest`) slots layered on top. An unset or disabled override slot defers
|
|
79
|
+
* to the universal layer's value, so `resolveSlotByCascade` picks the
|
|
80
|
+
* most-specific *enabled* slot across both layers (override winning ties) rather
|
|
81
|
+
* than collapsing every unset state to the override's own `rest`.
|
|
82
|
+
*/
|
|
83
|
+
declare function mergeUniversalUnderOverride(universal: VariableState, override: VariableState): VariableState;
|
|
62
84
|
declare function generateDeclaration({
|
|
63
85
|
componentName,
|
|
64
86
|
subComponentName,
|
|
@@ -71,10 +93,16 @@ declare function generateDeclaration({
|
|
|
71
93
|
schema,
|
|
72
94
|
propertyKey,
|
|
73
95
|
originalPropertyDefinition,
|
|
96
|
+
declaredStates,
|
|
97
|
+
layerUsesAtomicStates,
|
|
74
98
|
theme,
|
|
75
99
|
currentStyles,
|
|
76
100
|
previewOptions,
|
|
77
|
-
excludedPseudoStates
|
|
101
|
+
excludedPseudoStates,
|
|
102
|
+
emit,
|
|
103
|
+
fallbackStateMap,
|
|
104
|
+
bumpRootSpecificity,
|
|
105
|
+
buttonHeightReferenceSchema
|
|
78
106
|
}: {
|
|
79
107
|
componentName: string;
|
|
80
108
|
subComponentName?: string;
|
|
@@ -87,25 +115,44 @@ declare function generateDeclaration({
|
|
|
87
115
|
schema: unknown;
|
|
88
116
|
propertyKey: string;
|
|
89
117
|
originalPropertyDefinition: SelectedConfigurableProperty<ConfigurablePropertiesName, any>;
|
|
118
|
+
declaredStates: ReadonlySet<string>;
|
|
119
|
+
layerUsesAtomicStates: boolean;
|
|
90
120
|
theme: ThemeFn;
|
|
91
121
|
currentStyles: Readonly<Record<string, Record<string, string>>>;
|
|
92
122
|
previewOptions?: {
|
|
93
123
|
generatePseudoStateClassModifier?: boolean;
|
|
94
124
|
};
|
|
95
125
|
excludedPseudoStates?: readonly PossibleStates[];
|
|
126
|
+
emit?: EmitMode;
|
|
127
|
+
fallbackStateMap?: VariableState;
|
|
128
|
+
bumpRootSpecificity?: boolean;
|
|
129
|
+
buttonHeightReferenceSchema?: ButtonControlSchema;
|
|
96
130
|
}): Record<string, Record<string, string>>;
|
|
97
131
|
declare function generateConfigStyles<C extends ComponentConfig>(config: C, schema: ComponentSchema<ComponentConfig>, theme: ThemeFn, previewOptions?: {
|
|
98
|
-
generatePseudoStateClassModifier
|
|
132
|
+
generatePseudoStateClassModifier?: boolean;
|
|
133
|
+
}, emit?: EmitMode, generateStylesContext?: {
|
|
134
|
+
buttonHeightReferenceSchema?: ButtonControlSchema;
|
|
99
135
|
}): Record<string, Record<string, string>>;
|
|
100
136
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
137
|
+
* Public entry point. Generates a component's CSS, emitting each declared state
|
|
138
|
+
* as its own rule (one selector per rule) so the cascade is carried entirely by
|
|
139
|
+
* per-rule specificity — which CSS minifiers preserve.
|
|
140
|
+
*
|
|
141
|
+
* An earlier optimization merged rules sharing a declaration block into a single
|
|
142
|
+
* comma-separated selector list (to avoid repeating invariant declarations per
|
|
143
|
+
* state). It was removed: a minifier's forgiving-`:is()` rewrite — applied to a
|
|
144
|
+
* comma-separated list that contains `:has()` when targeting browsers without
|
|
145
|
+
* native `:has()` support — collapses the list to its single highest
|
|
146
|
+
* specificity, inflating the weakest selector (`rest`) above genuinely
|
|
147
|
+
* customized states and corrupting the cascade. Separate rules never form such a
|
|
148
|
+
* list, so minifiers leave their specificity intact. (gzip already collapses the
|
|
149
|
+
* repeated declaration blocks, so the shipped-size cost is minimal.)
|
|
106
150
|
*/
|
|
107
151
|
declare const generateStyles: (config: ComponentConfig, schema: ComponentSchema<ComponentConfig>, theme: ThemeFn, previewOptions: {
|
|
108
152
|
generatePseudoStateClassModifier: boolean;
|
|
153
|
+
emit?: EmitMode;
|
|
154
|
+
}, generateStylesContext?: {
|
|
155
|
+
buttonHeightReferenceSchema?: ButtonControlSchema;
|
|
109
156
|
}) => Record<string, Record<string, string>>;
|
|
110
157
|
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
158
|
name: C;
|
|
@@ -114,7 +161,9 @@ declare function createConfigurableProperty<C extends ConfigurablePropertiesName
|
|
|
114
161
|
defaults: { [K in O]: V[number][number] | (Extract<T[number], ArbitraryFixtures> extends never ? never : InferArbitraryType<Extract<T[number], ArbitraryFixtures>>) };
|
|
115
162
|
label: string;
|
|
116
163
|
skipRestState?: boolean;
|
|
164
|
+
optionalInDefaultSchema?: boolean; /** @deprecated Prefer layer-level `atomicStates` + `excludeAtomics`. */
|
|
117
165
|
pseudoStates?: PossibleStates[];
|
|
166
|
+
excludeAtomics?: AtomicState[];
|
|
118
167
|
supportsCustom?: boolean;
|
|
119
168
|
layerReference?: {
|
|
120
169
|
variablePath: string;
|
|
@@ -143,24 +192,36 @@ declare function createVariantConfigWithComponentStates(config: {
|
|
|
143
192
|
default: string;
|
|
144
193
|
options: readonly string[];
|
|
145
194
|
componentStates: Record<string, ComponentStateConfig>;
|
|
195
|
+
layers?: {
|
|
196
|
+
root: LayerConfig;
|
|
197
|
+
} & Record<string, LayerConfig>;
|
|
146
198
|
}): VariantConfigWithComponentStates;
|
|
147
|
-
declare function createComponentStates
|
|
199
|
+
declare function createComponentStates<T extends {
|
|
148
200
|
label: string;
|
|
149
|
-
options: string[];
|
|
201
|
+
options: readonly string[];
|
|
150
202
|
excludePseudoStatesForOptions?: Partial<Record<string, readonly PossibleStates[]>>;
|
|
151
|
-
layers
|
|
203
|
+
layers?: {
|
|
152
204
|
root: LayerConfig;
|
|
153
205
|
} & Record<string, LayerConfig>;
|
|
154
|
-
}):
|
|
155
|
-
declare function createLayerConfig
|
|
206
|
+
}>(config: T): T;
|
|
207
|
+
declare function createLayerConfig<T extends {
|
|
156
208
|
label: string;
|
|
157
209
|
pseudoSelector?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Atomic states this layer can style. Properties on the layer pick up rest,
|
|
212
|
+
* each declared atom, and every auto-generated compound up to
|
|
213
|
+
* `MAX_MODIFIERS_PER_COMPOUND` modifiers optionally combined with one
|
|
214
|
+
* interactive (skipping pairs the browser suppresses). Properties opt out
|
|
215
|
+
* of individual atoms via `excludeAtomics`. See {@link LayerConfig} for the
|
|
216
|
+
* full breakdown.
|
|
217
|
+
*/
|
|
218
|
+
atomicStates?: AtomicState[];
|
|
158
219
|
properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
|
|
159
|
-
}):
|
|
220
|
+
}>(config: T): T;
|
|
160
221
|
declare function createSubComponentConfig(config: {
|
|
161
222
|
label: string;
|
|
162
223
|
description: string;
|
|
163
224
|
variants: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
|
|
164
225
|
}): SubComponentConfig; //#endregion
|
|
165
226
|
//#endregion
|
|
166
|
-
export { applyBoxShadowBorder, createComponentStates, createConfigurableProperty, createLayerConfig, createSubComponentConfig, createVariantConfig, createVariantConfigWithComponentStates, createVariantConfigWithProperties, generateClassName, generateConfigStyles, generateDeclaration, generateStyles, statePseudoMapDocsMode };
|
|
227
|
+
export { EmitMode, applyBoxShadowBorder, createComponentStates, createConfigurableProperty, createLayerConfig, createSubComponentConfig, createVariantConfig, createVariantConfigWithComponentStates, createVariantConfigWithProperties, generateClassName, generateConfigStyles, generateDeclaration, generateStyles, mergeUniversalUnderOverride, statePseudoMapDocsMode };
|
|
@@ -1,24 +1,37 @@
|
|
|
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 { IconButtonMatchButtonHeightConfig, IconButtonMatchButtonHeightSize, disableIconButtonMatchButtonHeight, enableIconButtonMatchButtonHeight, isIconButtonMatchButtonHeightEnabled } from "./iconButtonMatchButtonHeight.js";
|
|
16
|
+
import { ButtonControlSchema, SHARED_BUTTON_ICONBUTTON_SIZES, applyButtonControlHeightDeclarations, applyIconButtonControlHeightDeclarations, getButtonContentLineHeight, getButtonControlContentSize, getButtonControlHeight, getButtonIconSizeVar, getIconButtonControlHeight } from "./getButtonControlHeight.js";
|
|
17
|
+
import { getButtonControlHeightPx, getIconButtonControlHeightPx, getIconButtonOnlyControlHeightPx, syncButtonControlHeightVarForSize, syncIconButtonControlHeightVarForSize, syncIconButtonOnlyControlHeightVarForSize } from "./getButtonControlHeightPx.js";
|
|
18
|
+
import { getConfigComponentVariant } from "./getConfigComponentVariant.js";
|
|
12
19
|
import { getConfigVariantComponentStates, getConfigVariantComponentStatesMatrix } from "./getConfigVariantComponentStatesMatrix.js";
|
|
13
20
|
import { getConfigVariantProperties } from "./getConfigVariantProperties.js";
|
|
14
21
|
import { getConfigVariantPseudoStates } from "./getConfigVariantPseudoStates.js";
|
|
15
22
|
import { getConfigVariants } from "./getConfigVariants.js";
|
|
16
23
|
import { PaginationWidthConfig, getPaginationControlWidthPx, syncPaginationWidthVarForSize } from "./getPaginationControlWidthPx.js";
|
|
24
|
+
import { isConfiguratorPropertyVisible } from "./isConfiguratorPropertyVisible.js";
|
|
25
|
+
import { getStateDocsClass, getStateSelector, isKnownStateAtom } from "./pseudoStateSelectors.js";
|
|
26
|
+
import { resolvePropertyStates } from "./resolvePropertyStates.js";
|
|
27
|
+
import { PropertyStates, StateSlot, propertyUsesPerStateEnabled, resolveSlotByCascade } from "./resolveSlotByCascade.js";
|
|
17
28
|
import { getConfigSubcomponents } from "./subcomponents.js";
|
|
29
|
+
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.js";
|
|
18
30
|
|
|
19
31
|
//#region ../automated-config/dist/utils/index.d.ts
|
|
20
32
|
//#region src/utils/index.d.ts
|
|
21
33
|
type ThemeFn = (path: string) => string;
|
|
34
|
+
type EmitMode = 'exhaustive' | 'selective';
|
|
22
35
|
declare const statePseudoMapDocsMode: Record<PossibleStatesWithRest, string>;
|
|
23
36
|
/**
|
|
24
37
|
* Forces button borders to use box-shadow instead of border properties.
|
|
@@ -59,6 +72,15 @@ declare function generateClassName({
|
|
|
59
72
|
layer: string;
|
|
60
73
|
layerOptionalPseudoSelector?: string;
|
|
61
74
|
}): string;
|
|
75
|
+
/**
|
|
76
|
+
* Builds the per-state resolution map for a per-componentState OVERRIDE in
|
|
77
|
+
* exhaustive mode: the universal layer's state map with the override's ENABLED
|
|
78
|
+
* (and `rest`) slots layered on top. An unset or disabled override slot defers
|
|
79
|
+
* to the universal layer's value, so `resolveSlotByCascade` picks the
|
|
80
|
+
* most-specific *enabled* slot across both layers (override winning ties) rather
|
|
81
|
+
* than collapsing every unset state to the override's own `rest`.
|
|
82
|
+
*/
|
|
83
|
+
declare function mergeUniversalUnderOverride(universal: VariableState, override: VariableState): VariableState;
|
|
62
84
|
declare function generateDeclaration({
|
|
63
85
|
componentName,
|
|
64
86
|
subComponentName,
|
|
@@ -71,10 +93,16 @@ declare function generateDeclaration({
|
|
|
71
93
|
schema,
|
|
72
94
|
propertyKey,
|
|
73
95
|
originalPropertyDefinition,
|
|
96
|
+
declaredStates,
|
|
97
|
+
layerUsesAtomicStates,
|
|
74
98
|
theme,
|
|
75
99
|
currentStyles,
|
|
76
100
|
previewOptions,
|
|
77
|
-
excludedPseudoStates
|
|
101
|
+
excludedPseudoStates,
|
|
102
|
+
emit,
|
|
103
|
+
fallbackStateMap,
|
|
104
|
+
bumpRootSpecificity,
|
|
105
|
+
buttonHeightReferenceSchema
|
|
78
106
|
}: {
|
|
79
107
|
componentName: string;
|
|
80
108
|
subComponentName?: string;
|
|
@@ -87,25 +115,44 @@ declare function generateDeclaration({
|
|
|
87
115
|
schema: unknown;
|
|
88
116
|
propertyKey: string;
|
|
89
117
|
originalPropertyDefinition: SelectedConfigurableProperty<ConfigurablePropertiesName, any>;
|
|
118
|
+
declaredStates: ReadonlySet<string>;
|
|
119
|
+
layerUsesAtomicStates: boolean;
|
|
90
120
|
theme: ThemeFn;
|
|
91
121
|
currentStyles: Readonly<Record<string, Record<string, string>>>;
|
|
92
122
|
previewOptions?: {
|
|
93
123
|
generatePseudoStateClassModifier?: boolean;
|
|
94
124
|
};
|
|
95
125
|
excludedPseudoStates?: readonly PossibleStates[];
|
|
126
|
+
emit?: EmitMode;
|
|
127
|
+
fallbackStateMap?: VariableState;
|
|
128
|
+
bumpRootSpecificity?: boolean;
|
|
129
|
+
buttonHeightReferenceSchema?: ButtonControlSchema;
|
|
96
130
|
}): Record<string, Record<string, string>>;
|
|
97
131
|
declare function generateConfigStyles<C extends ComponentConfig>(config: C, schema: ComponentSchema<ComponentConfig>, theme: ThemeFn, previewOptions?: {
|
|
98
|
-
generatePseudoStateClassModifier
|
|
132
|
+
generatePseudoStateClassModifier?: boolean;
|
|
133
|
+
}, emit?: EmitMode, generateStylesContext?: {
|
|
134
|
+
buttonHeightReferenceSchema?: ButtonControlSchema;
|
|
99
135
|
}): Record<string, Record<string, string>>;
|
|
100
136
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
137
|
+
* Public entry point. Generates a component's CSS, emitting each declared state
|
|
138
|
+
* as its own rule (one selector per rule) so the cascade is carried entirely by
|
|
139
|
+
* per-rule specificity — which CSS minifiers preserve.
|
|
140
|
+
*
|
|
141
|
+
* An earlier optimization merged rules sharing a declaration block into a single
|
|
142
|
+
* comma-separated selector list (to avoid repeating invariant declarations per
|
|
143
|
+
* state). It was removed: a minifier's forgiving-`:is()` rewrite — applied to a
|
|
144
|
+
* comma-separated list that contains `:has()` when targeting browsers without
|
|
145
|
+
* native `:has()` support — collapses the list to its single highest
|
|
146
|
+
* specificity, inflating the weakest selector (`rest`) above genuinely
|
|
147
|
+
* customized states and corrupting the cascade. Separate rules never form such a
|
|
148
|
+
* list, so minifiers leave their specificity intact. (gzip already collapses the
|
|
149
|
+
* repeated declaration blocks, so the shipped-size cost is minimal.)
|
|
106
150
|
*/
|
|
107
151
|
declare const generateStyles: (config: ComponentConfig, schema: ComponentSchema<ComponentConfig>, theme: ThemeFn, previewOptions: {
|
|
108
152
|
generatePseudoStateClassModifier: boolean;
|
|
153
|
+
emit?: EmitMode;
|
|
154
|
+
}, generateStylesContext?: {
|
|
155
|
+
buttonHeightReferenceSchema?: ButtonControlSchema;
|
|
109
156
|
}) => Record<string, Record<string, string>>;
|
|
110
157
|
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
158
|
name: C;
|
|
@@ -114,7 +161,9 @@ declare function createConfigurableProperty<C extends ConfigurablePropertiesName
|
|
|
114
161
|
defaults: { [K in O]: V[number][number] | (Extract<T[number], ArbitraryFixtures> extends never ? never : InferArbitraryType<Extract<T[number], ArbitraryFixtures>>) };
|
|
115
162
|
label: string;
|
|
116
163
|
skipRestState?: boolean;
|
|
164
|
+
optionalInDefaultSchema?: boolean; /** @deprecated Prefer layer-level `atomicStates` + `excludeAtomics`. */
|
|
117
165
|
pseudoStates?: PossibleStates[];
|
|
166
|
+
excludeAtomics?: AtomicState[];
|
|
118
167
|
supportsCustom?: boolean;
|
|
119
168
|
layerReference?: {
|
|
120
169
|
variablePath: string;
|
|
@@ -143,24 +192,36 @@ declare function createVariantConfigWithComponentStates(config: {
|
|
|
143
192
|
default: string;
|
|
144
193
|
options: readonly string[];
|
|
145
194
|
componentStates: Record<string, ComponentStateConfig>;
|
|
195
|
+
layers?: {
|
|
196
|
+
root: LayerConfig;
|
|
197
|
+
} & Record<string, LayerConfig>;
|
|
146
198
|
}): VariantConfigWithComponentStates;
|
|
147
|
-
declare function createComponentStates
|
|
199
|
+
declare function createComponentStates<T extends {
|
|
148
200
|
label: string;
|
|
149
|
-
options: string[];
|
|
201
|
+
options: readonly string[];
|
|
150
202
|
excludePseudoStatesForOptions?: Partial<Record<string, readonly PossibleStates[]>>;
|
|
151
|
-
layers
|
|
203
|
+
layers?: {
|
|
152
204
|
root: LayerConfig;
|
|
153
205
|
} & Record<string, LayerConfig>;
|
|
154
|
-
}):
|
|
155
|
-
declare function createLayerConfig
|
|
206
|
+
}>(config: T): T;
|
|
207
|
+
declare function createLayerConfig<T extends {
|
|
156
208
|
label: string;
|
|
157
209
|
pseudoSelector?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Atomic states this layer can style. Properties on the layer pick up rest,
|
|
212
|
+
* each declared atom, and every auto-generated compound up to
|
|
213
|
+
* `MAX_MODIFIERS_PER_COMPOUND` modifiers optionally combined with one
|
|
214
|
+
* interactive (skipping pairs the browser suppresses). Properties opt out
|
|
215
|
+
* of individual atoms via `excludeAtomics`. See {@link LayerConfig} for the
|
|
216
|
+
* full breakdown.
|
|
217
|
+
*/
|
|
218
|
+
atomicStates?: AtomicState[];
|
|
158
219
|
properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
|
|
159
|
-
}):
|
|
220
|
+
}>(config: T): T;
|
|
160
221
|
declare function createSubComponentConfig(config: {
|
|
161
222
|
label: string;
|
|
162
223
|
description: string;
|
|
163
224
|
variants: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
|
|
164
225
|
}): SubComponentConfig; //#endregion
|
|
165
226
|
//#endregion
|
|
166
|
-
export { applyBoxShadowBorder, createComponentStates, createConfigurableProperty, createLayerConfig, createSubComponentConfig, createVariantConfig, createVariantConfigWithComponentStates, createVariantConfigWithProperties, generateClassName, generateConfigStyles, generateDeclaration, generateStyles, statePseudoMapDocsMode };
|
|
227
|
+
export { EmitMode, applyBoxShadowBorder, createComponentStates, createConfigurableProperty, createLayerConfig, createSubComponentConfig, createVariantConfig, createVariantConfigWithComponentStates, createVariantConfigWithProperties, generateClassName, generateConfigStyles, generateDeclaration, generateStyles, mergeUniversalUnderOverride, statePseudoMapDocsMode };
|