@yahoo/uds 3.102.0 → 3.103.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 +11 -1
- package/dist/automated-config/dist/generated/autoVariants.d.cts +10 -0
- package/dist/automated-config/dist/generated/autoVariants.d.ts +10 -0
- package/dist/automated-config/dist/generated/autoVariants.js +11 -1
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +1695 -1
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +419 -189
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +419 -189
- package/dist/automated-config/dist/generated/generatedConfigs.js +1694 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +99 -0
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +2 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +2 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +99 -0
- package/dist/automated-config/dist/properties.cjs +152 -89
- package/dist/automated-config/dist/properties.d.cts +25 -4
- package/dist/automated-config/dist/properties.d.ts +25 -4
- package/dist/automated-config/dist/properties.js +153 -90
- package/dist/automated-config/dist/utils/buildConfigSchema.cjs +5 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +2 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +2 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.js +5 -1
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
- package/dist/automated-config/dist/utils/index.cjs +4 -4
- package/dist/automated-config/dist/utils/index.d.cts +6 -1
- package/dist/automated-config/dist/utils/index.d.ts +6 -1
- package/dist/automated-config/dist/utils/index.js +4 -4
- package/dist/cli/commands/sync.cjs +5 -1
- package/dist/cli/commands/sync.js +5 -1
- package/dist/components/client/Button.js +2 -2
- package/dist/components/client/Toast/Toast.cjs +1 -1
- package/dist/components/client/Toast/Toast.d.cts +1 -1
- package/dist/components/client/Toast/Toast.d.ts +1 -1
- package/dist/components/client/Toast/Toast.js +1 -1
- package/dist/components/client/Tooltip/Tooltip.cjs +65 -0
- package/dist/components/client/Tooltip/Tooltip.d.cts +45 -0
- package/dist/components/client/Tooltip/Tooltip.d.ts +45 -0
- package/dist/components/client/Tooltip/Tooltip.js +63 -0
- package/dist/components/client/Tooltip/TooltipContent.cjs +188 -0
- package/dist/components/client/Tooltip/TooltipContent.d.cts +8 -0
- package/dist/components/client/Tooltip/TooltipContent.d.ts +8 -0
- package/dist/components/client/Tooltip/TooltipContent.js +186 -0
- package/dist/components/client/Tooltip/TooltipTrigger.cjs +20 -0
- package/dist/components/client/Tooltip/TooltipTrigger.d.cts +14 -0
- package/dist/components/client/Tooltip/TooltipTrigger.d.ts +14 -0
- package/dist/components/client/Tooltip/TooltipTrigger.js +18 -0
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.cjs +40 -0
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.cts +28 -0
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.ts +28 -0
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.js +37 -0
- package/dist/components/client/Tooltip/index.cjs +12 -0
- package/dist/components/client/Tooltip/index.d.cts +7 -0
- package/dist/components/client/Tooltip/index.d.ts +7 -0
- package/dist/components/client/Tooltip/index.js +8 -0
- package/dist/components/client/Tooltip/tooltipContext.cjs +12 -0
- package/dist/components/client/Tooltip/tooltipContext.d.cts +12 -0
- package/dist/components/client/Tooltip/tooltipContext.d.ts +12 -0
- package/dist/components/client/Tooltip/tooltipContext.js +10 -0
- package/dist/components/client/Tooltip/useTooltipContent.cjs +186 -0
- package/dist/components/client/Tooltip/useTooltipContent.d.cts +66 -0
- package/dist/components/client/Tooltip/useTooltipContent.d.ts +66 -0
- package/dist/components/client/Tooltip/useTooltipContent.js +184 -0
- package/dist/components/client/Tooltip/util.cjs +248 -0
- package/dist/components/client/Tooltip/util.d.cts +118 -0
- package/dist/components/client/Tooltip/util.d.ts +118 -0
- package/dist/components/client/Tooltip/util.js +240 -0
- package/dist/components/client/index.cjs +8 -0
- package/dist/components/client/index.d.cts +7 -1
- package/dist/components/client/index.d.ts +7 -1
- package/dist/components/client/index.js +5 -1
- package/dist/components/client/providers/UDSConfigProvider.cjs +6 -2
- package/dist/components/client/providers/UDSConfigProvider.d.cts +2 -1
- package/dist/components/client/providers/UDSConfigProvider.d.ts +2 -1
- package/dist/components/client/providers/UDSConfigProvider.js +6 -2
- package/dist/components/index.cjs +12 -0
- package/dist/components/index.d.cts +6 -1
- package/dist/components/index.d.ts +6 -1
- package/dist/components/index.js +9 -1
- package/dist/config/dist/index.cjs +18797 -18698
- package/dist/config/dist/index.js +18797 -18698
- 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/fixtures/dist/arbitrary.d.cts +11 -0
- package/dist/fixtures/dist/arbitrary.d.ts +11 -0
- package/dist/fixtures/dist/index.cjs +27 -1
- package/dist/fixtures/dist/index.d.cts +17 -3
- package/dist/fixtures/dist/index.d.ts +17 -3
- package/dist/fixtures/dist/index.js +26 -2
- package/dist/fixtures/index.cjs +6 -1
- package/dist/fixtures/index.d.cts +4 -2
- package/dist/fixtures/index.d.ts +4 -2
- package/dist/fixtures/index.js +3 -2
- package/dist/fixtures/src/arbitrary.cjs +23 -0
- package/dist/fixtures/src/arbitrary.d.cts +15 -0
- package/dist/fixtures/src/arbitrary.d.ts +15 -0
- package/dist/fixtures/src/arbitrary.js +18 -0
- package/dist/fixtures/src/util.cjs +26 -0
- package/dist/fixtures/src/util.d.cts +9 -0
- package/dist/fixtures/src/util.d.ts +9 -0
- package/dist/fixtures/src/util.js +25 -0
- package/dist/index.cjs +15 -3
- package/dist/index.d.cts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +11 -6
- package/dist/runtime/index.cjs +2 -0
- package/dist/runtime/index.d.cts +2 -1
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.js +2 -1
- package/dist/runtime/tooltipConfig.cjs +33 -0
- package/dist/runtime/tooltipConfig.d.cts +20 -0
- package/dist/runtime/tooltipConfig.d.ts +20 -0
- package/dist/runtime/tooltipConfig.js +32 -0
- package/dist/runtime/udsConfig.cjs +3 -1
- package/dist/runtime/udsConfig.d.cts +2 -0
- package/dist/runtime/udsConfig.d.ts +2 -0
- package/dist/runtime/udsConfig.js +3 -1
- package/dist/styles/styler.d.cts +53 -43
- package/dist/styles/styler.d.ts +53 -43
- package/dist/styles/variants.d.cts +30 -0
- package/dist/styles/variants.d.ts +30 -0
- package/dist/tailwind/dist/plugin.cjs +2 -1
- package/dist/tailwind/dist/plugin.js +2 -1
- package/dist/tailwind/dist/tailwind/plugins/blurBgFallback.cjs +30 -0
- package/dist/tailwind/dist/tailwind/plugins/blurBgFallback.js +28 -0
- package/dist/tailwind/dist/tailwind/plugins/components.cjs +1 -0
- package/dist/tailwind/dist/tailwind/plugins/components.js +2 -1
- package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.cts +4 -4
- package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.ts +4 -4
- package/dist/tokens/automation/configs/index.cjs +2 -1
- package/dist/tokens/automation/configs/index.d.cts +2 -2
- package/dist/tokens/automation/configs/index.d.ts +2 -2
- package/dist/tokens/automation/configs/index.js +2 -2
- package/dist/tokens/automation/index.cjs +1 -0
- package/dist/tokens/automation/index.d.cts +2 -2
- package/dist/tokens/automation/index.d.ts +2 -2
- package/dist/tokens/automation/index.js +2 -2
- package/dist/tokens/automation/properties.d.cts +2 -2
- package/dist/tokens/automation/properties.d.ts +2 -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 +2 -0
- package/dist/tokens/index.d.cts +4 -4
- package/dist/tokens/index.d.ts +4 -4
- package/dist/tokens/index.js +3 -3
- package/dist/tokens/types.d.cts +2 -2
- package/dist/tokens/types.d.ts +2 -2
- package/dist/types/dist/index.d.cts +37 -2
- package/dist/types/dist/index.d.ts +37 -2
- package/dist/uds/generated/tailwindPurge.cjs +90 -60
- package/dist/uds/generated/tailwindPurge.js +90 -60
- package/dist/uds/package.cjs +1 -0
- package/dist/uds/package.js +1 -0
- package/package.json +2 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { ShadowPreset } from "../../types/dist/index.js";
|
|
3
|
+
import { ArbitraryFixtures, InferArbitraryType } from "../../fixtures/dist/index.js";
|
|
3
4
|
import { AllPossibleProperties, PossibleStates } from "./types/ComponentConfig.js";
|
|
4
5
|
import { SchemaStateValue } from "./types/ConfigSchema.js";
|
|
5
6
|
|
|
@@ -15,17 +16,20 @@ interface ConfigurableProperty<T extends AllPossibleProperties, CVR = unknown> {
|
|
|
15
16
|
name: string;
|
|
16
17
|
cssProperties: string | string[];
|
|
17
18
|
twThemePath: (fixtureType: T, value: string) => string;
|
|
18
|
-
possibleFixtures: T[];
|
|
19
|
+
possibleFixtures: readonly T[];
|
|
19
20
|
extendedProperties?: ExtendablePropertiesName[] | ((context: ComponentConfigContext) => ExtendablePropertiesName[] | undefined | false);
|
|
20
|
-
customValueRenderer?: (schemaStateValue: SchemaStateValue<CVR>, schema: unknown, themeGetter: (path: string) => string) => string;
|
|
21
|
+
customValueRenderer?: (schemaStateValue: SchemaStateValue<CVR>, schema: unknown, themeGetter: (path: string) => string, originalPropertyDefinition?: SelectedConfigurableProperty<ConfigurablePropertiesName, any>) => string;
|
|
21
22
|
concatenate?: boolean;
|
|
22
23
|
concatenationDelimiter?: string;
|
|
23
24
|
}
|
|
24
25
|
declare const publicProperties: {
|
|
25
26
|
readonly backgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases", unknown>;
|
|
26
27
|
readonly borderWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
28
|
+
readonly strokeWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
27
29
|
readonly borderRadius: ConfigurableProperty<"borderRadii", unknown>;
|
|
30
|
+
readonly borderRadiusVar: ConfigurableProperty<"borderRadii", unknown>;
|
|
28
31
|
readonly borderColor: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
32
|
+
readonly stroke: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
29
33
|
readonly buttonSize: ConfigurableProperty<"buttonSizes", unknown>;
|
|
30
34
|
readonly buttonVariant: ConfigurableProperty<"buttonVariantsFlat", unknown>;
|
|
31
35
|
readonly fontFamily: ConfigurableProperty<"textVariants", unknown>;
|
|
@@ -37,6 +41,7 @@ declare const publicProperties: {
|
|
|
37
41
|
readonly gap: ConfigurableProperty<"spacingAliases", unknown>;
|
|
38
42
|
readonly color: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors", unknown>;
|
|
39
43
|
readonly opacity: ConfigurableProperty<"opacitySteps", unknown>;
|
|
44
|
+
readonly fillOpacity: ConfigurableProperty<"opacitySteps", unknown>;
|
|
40
45
|
readonly fontWeight: ConfigurableProperty<"textVariants", unknown>;
|
|
41
46
|
readonly iconSize: ConfigurableProperty<"iconSizes", unknown>;
|
|
42
47
|
readonly spacing: ConfigurableProperty<"spacingAliases", unknown>;
|
|
@@ -46,10 +51,14 @@ declare const publicProperties: {
|
|
|
46
51
|
readonly textVariant: ConfigurableProperty<"textVariants", unknown>;
|
|
47
52
|
readonly textDecorationLine: ConfigurableProperty<"textDecorationLines", unknown>;
|
|
48
53
|
readonly shadow: ConfigurableProperty<"elevationAliases" | "shadowVariants" | "shadowVariantConfig", string | [] | [ShadowPreset] | [ShadowPreset, ShadowPreset] | [ShadowPreset, ShadowPreset, ShadowPreset]>;
|
|
54
|
+
readonly shadowVar: ConfigurableProperty<"elevationAliases" | "shadowVariants" | "shadowVariantConfig", string | [] | [ShadowPreset] | [ShadowPreset, ShadowPreset] | [ShadowPreset, ShadowPreset, ShadowPreset]>;
|
|
49
55
|
readonly insetShadow: ConfigurableProperty<"shadowVariantConfig" | "shadowVariantsWithInvert", string | [] | [ShadowPreset] | [ShadowPreset, ShadowPreset] | [ShadowPreset, ShadowPreset, ShadowPreset]>;
|
|
50
56
|
readonly height: ConfigurableProperty<"spacingAliases", unknown>;
|
|
51
57
|
readonly width: ConfigurableProperty<"spacingAliases", unknown>;
|
|
52
58
|
readonly scaleEffect: ConfigurableProperty<"scaleEffects", unknown>;
|
|
59
|
+
readonly backdropBlur: ConfigurableProperty<"positiveIntegers", unknown>;
|
|
60
|
+
readonly blurBackgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases", unknown>;
|
|
61
|
+
readonly blurBackgroundColorFallback: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases", unknown>;
|
|
53
62
|
};
|
|
54
63
|
declare const configurableProperties: {
|
|
55
64
|
outlineWidth: ConfigurableProperty<"borderWidths" | "spacingAliases", unknown>;
|
|
@@ -58,8 +67,11 @@ declare const configurableProperties: {
|
|
|
58
67
|
solidOutline: ConfigurableProperty<never, unknown>;
|
|
59
68
|
backgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases", unknown>;
|
|
60
69
|
borderWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
70
|
+
strokeWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
61
71
|
borderRadius: ConfigurableProperty<"borderRadii", unknown>;
|
|
72
|
+
borderRadiusVar: ConfigurableProperty<"borderRadii", unknown>;
|
|
62
73
|
borderColor: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
74
|
+
stroke: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
63
75
|
buttonSize: ConfigurableProperty<"buttonSizes", unknown>;
|
|
64
76
|
buttonVariant: ConfigurableProperty<"buttonVariantsFlat", unknown>;
|
|
65
77
|
fontFamily: ConfigurableProperty<"textVariants", unknown>;
|
|
@@ -71,6 +83,7 @@ declare const configurableProperties: {
|
|
|
71
83
|
gap: ConfigurableProperty<"spacingAliases", unknown>;
|
|
72
84
|
color: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors", unknown>;
|
|
73
85
|
opacity: ConfigurableProperty<"opacitySteps", unknown>;
|
|
86
|
+
fillOpacity: ConfigurableProperty<"opacitySteps", unknown>;
|
|
74
87
|
fontWeight: ConfigurableProperty<"textVariants", unknown>;
|
|
75
88
|
iconSize: ConfigurableProperty<"iconSizes", unknown>;
|
|
76
89
|
spacing: ConfigurableProperty<"spacingAliases", unknown>;
|
|
@@ -80,10 +93,14 @@ declare const configurableProperties: {
|
|
|
80
93
|
textVariant: ConfigurableProperty<"textVariants", unknown>;
|
|
81
94
|
textDecorationLine: ConfigurableProperty<"textDecorationLines", unknown>;
|
|
82
95
|
shadow: ConfigurableProperty<"elevationAliases" | "shadowVariants" | "shadowVariantConfig", string | [] | [ShadowPreset] | [ShadowPreset, ShadowPreset] | [ShadowPreset, ShadowPreset, ShadowPreset]>;
|
|
96
|
+
shadowVar: ConfigurableProperty<"elevationAliases" | "shadowVariants" | "shadowVariantConfig", string | [] | [ShadowPreset] | [ShadowPreset, ShadowPreset] | [ShadowPreset, ShadowPreset, ShadowPreset]>;
|
|
83
97
|
insetShadow: ConfigurableProperty<"shadowVariantConfig" | "shadowVariantsWithInvert", string | [] | [ShadowPreset] | [ShadowPreset, ShadowPreset] | [ShadowPreset, ShadowPreset, ShadowPreset]>;
|
|
84
98
|
height: ConfigurableProperty<"spacingAliases", unknown>;
|
|
85
99
|
width: ConfigurableProperty<"spacingAliases", unknown>;
|
|
86
100
|
scaleEffect: ConfigurableProperty<"scaleEffects", unknown>;
|
|
101
|
+
backdropBlur: ConfigurableProperty<"positiveIntegers", unknown>;
|
|
102
|
+
blurBackgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases", unknown>;
|
|
103
|
+
blurBackgroundColorFallback: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases", unknown>;
|
|
87
104
|
};
|
|
88
105
|
type ExtendablePropertiesName = keyof typeof configurableProperties;
|
|
89
106
|
type ConfigurablePropertiesName = keyof typeof publicProperties;
|
|
@@ -95,7 +112,11 @@ interface SelectedConfigurableProperty<C extends ConfigurablePropertiesName, O e
|
|
|
95
112
|
skipRestState?: boolean;
|
|
96
113
|
pseudoStates?: PossibleStates[];
|
|
97
114
|
supportsCustom?: boolean;
|
|
98
|
-
|
|
115
|
+
layerReference?: {
|
|
116
|
+
variablePath: string;
|
|
117
|
+
propertyName: string;
|
|
118
|
+
};
|
|
119
|
+
defaults: { [K in O]: V[number][number] | (Extract<T[number], ArbitraryFixtures> extends never ? never : InferArbitraryType<Extract<T[number], ArbitraryFixtures>>) };
|
|
99
120
|
} //#endregion
|
|
100
121
|
//#endregion
|
|
101
|
-
export { type ComponentConfigContext, type ConfigurablePropertiesName, type ExtendablePropertiesName, type SelectedConfigurableProperty, configurableProperties };
|
|
122
|
+
export { type ComponentConfigContext, type ConfigurablePropertiesName, type ConfigurableProperty, type ExtendablePropertiesName, type SelectedConfigurableProperty, configurableProperties };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
import { BUTTON_SCALE_EFFECT, getShadowLayerValue, textVariantsSafe } from "../../css-tokens/dist/index.js";
|
|
2
|
+
import { BACKGROUND_BLUR_COLOR_PREFIX, BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX, BORDER_RADIUS_PREFIX, BUTTON_SCALE_EFFECT, DROP_SHADOW_PREFIX, getShadowLayerValue, textVariantsSafe } from "../../css-tokens/dist/index.js";
|
|
3
3
|
import { mapTextVariantFixtureToValue } from "./mapTextVariantFixtureToValue.js";
|
|
4
4
|
import { assertUnreachable } from "./utils/assertUnreachable.js";
|
|
5
5
|
import { mapColorFixtureToValue } from "./utils/mapColorFixtureToValue.js";
|
|
@@ -148,6 +148,11 @@ const borderWidth = {
|
|
|
148
148
|
return false;
|
|
149
149
|
}
|
|
150
150
|
};
|
|
151
|
+
const strokeWidth = {
|
|
152
|
+
...borderWidth,
|
|
153
|
+
name: "strokeWidth",
|
|
154
|
+
cssProperties: "stroke-width"
|
|
155
|
+
};
|
|
151
156
|
const borderColor = {
|
|
152
157
|
name: "borderColor",
|
|
153
158
|
cssProperties: "border-color",
|
|
@@ -163,6 +168,11 @@ const borderColor = {
|
|
|
163
168
|
return false;
|
|
164
169
|
}
|
|
165
170
|
};
|
|
171
|
+
const stroke = {
|
|
172
|
+
...borderColor,
|
|
173
|
+
name: "stroke",
|
|
174
|
+
cssProperties: "stroke"
|
|
175
|
+
};
|
|
166
176
|
const outlineWidth = {
|
|
167
177
|
name: "outlineWidth",
|
|
168
178
|
cssProperties: "outline-width",
|
|
@@ -195,16 +205,109 @@ const outlineColor = {
|
|
|
195
205
|
"linePaletteColors"
|
|
196
206
|
]
|
|
197
207
|
};
|
|
208
|
+
const borderRadius = {
|
|
209
|
+
name: "borderRadius",
|
|
210
|
+
cssProperties: "border-radius",
|
|
211
|
+
twThemePath: (_, value) => `udsBorderRadius.${value}`,
|
|
212
|
+
possibleFixtures: ["borderRadii"]
|
|
213
|
+
};
|
|
214
|
+
const borderRadiusVar = {
|
|
215
|
+
...borderRadius,
|
|
216
|
+
name: "borderRadiusVar",
|
|
217
|
+
cssProperties: `--${BORDER_RADIUS_PREFIX}`
|
|
218
|
+
};
|
|
219
|
+
const spacing = {
|
|
220
|
+
name: "spacing",
|
|
221
|
+
cssProperties: "padding",
|
|
222
|
+
twThemePath: (_, value) => `spacing[${value}]`,
|
|
223
|
+
possibleFixtures: ["spacingAliases"]
|
|
224
|
+
};
|
|
225
|
+
const spacingHorizontal = {
|
|
226
|
+
name: "spacingHorizontal",
|
|
227
|
+
cssProperties: ["padding-right", "padding-left"],
|
|
228
|
+
twThemePath: (_, value) => `spacing[${value}]`,
|
|
229
|
+
possibleFixtures: ["spacingAliases"]
|
|
230
|
+
};
|
|
231
|
+
const spacingVertical = {
|
|
232
|
+
name: "spacingVertical",
|
|
233
|
+
cssProperties: ["padding-top", "padding-bottom"],
|
|
234
|
+
twThemePath: (_, value) => `spacing[${value}]`,
|
|
235
|
+
possibleFixtures: ["spacingAliases"]
|
|
236
|
+
};
|
|
237
|
+
const height = {
|
|
238
|
+
name: "height",
|
|
239
|
+
cssProperties: "height",
|
|
240
|
+
twThemePath: (_, value) => {
|
|
241
|
+
return `height[${value}]`;
|
|
242
|
+
},
|
|
243
|
+
possibleFixtures: ["spacingAliases"]
|
|
244
|
+
};
|
|
245
|
+
const width = {
|
|
246
|
+
name: "width",
|
|
247
|
+
cssProperties: "width",
|
|
248
|
+
twThemePath: (_, value) => {
|
|
249
|
+
return `width[${value}]`;
|
|
250
|
+
},
|
|
251
|
+
possibleFixtures: ["spacingAliases"]
|
|
252
|
+
};
|
|
253
|
+
const shadow = {
|
|
254
|
+
name: "drop shadow",
|
|
255
|
+
cssProperties: "box-shadow",
|
|
256
|
+
twThemePath: () => {
|
|
257
|
+
return ``;
|
|
258
|
+
},
|
|
259
|
+
concatenate: true,
|
|
260
|
+
customValueRenderer: (schemaValue) => {
|
|
261
|
+
const shadowType = "drop";
|
|
262
|
+
const noneValue = "0 0 0 transparent";
|
|
263
|
+
if (schemaValue.valueType === "alias") {
|
|
264
|
+
const noneValue = "0 0 0 transparent";
|
|
265
|
+
if (schemaValue.value === "none") return noneValue;
|
|
266
|
+
if (schemaValue.value !== "custom") return `var(--uds-${shadowType}-shadow-${schemaValue.value})`;
|
|
267
|
+
} else if (schemaValue.valueType === "custom") return schemaValue.value.map((preset, index) => getShadowLayerValue({
|
|
268
|
+
preset,
|
|
269
|
+
shadowType,
|
|
270
|
+
prefix: index > 0 ? `${index + 1}` : void 0
|
|
271
|
+
}))?.join(", ") || noneValue;
|
|
272
|
+
throw new Error("Invalid valueType");
|
|
273
|
+
},
|
|
274
|
+
possibleFixtures: [
|
|
275
|
+
"shadowVariants",
|
|
276
|
+
"shadowVariantConfig",
|
|
277
|
+
"elevationAliases"
|
|
278
|
+
]
|
|
279
|
+
};
|
|
280
|
+
const insetShadow = {
|
|
281
|
+
name: "inset shadow",
|
|
282
|
+
cssProperties: "box-shadow",
|
|
283
|
+
twThemePath: () => {
|
|
284
|
+
return ``;
|
|
285
|
+
},
|
|
286
|
+
concatenate: true,
|
|
287
|
+
customValueRenderer: (schemaValue) => {
|
|
288
|
+
const shadowType = "inset";
|
|
289
|
+
const noneValue = "0 0 0 transparent";
|
|
290
|
+
if (schemaValue.valueType === "alias") {
|
|
291
|
+
const noneValue = "0 0 0 transparent";
|
|
292
|
+
if (schemaValue.value === "none") return noneValue;
|
|
293
|
+
if (schemaValue.value !== "custom") return `var(--uds-${shadowType}-shadow-${schemaValue.value})`;
|
|
294
|
+
} else if (schemaValue.valueType === "custom") return schemaValue.value.map((preset, index) => getShadowLayerValue({
|
|
295
|
+
preset,
|
|
296
|
+
shadowType,
|
|
297
|
+
prefix: index > 0 ? `${index + 1}` : void 0
|
|
298
|
+
}))?.join(", ") || noneValue;
|
|
299
|
+
throw new Error("Invalid valueType");
|
|
300
|
+
},
|
|
301
|
+
possibleFixtures: ["shadowVariantsWithInvert"]
|
|
302
|
+
};
|
|
198
303
|
const publicProperties = {
|
|
199
304
|
backgroundColor,
|
|
200
305
|
borderWidth,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
twThemePath: (_, value) => `udsBorderRadius.${value}`,
|
|
205
|
-
possibleFixtures: ["borderRadii"]
|
|
206
|
-
},
|
|
306
|
+
strokeWidth,
|
|
307
|
+
borderRadius,
|
|
308
|
+
borderRadiusVar,
|
|
207
309
|
borderColor,
|
|
310
|
+
stroke,
|
|
208
311
|
buttonSize: {
|
|
209
312
|
name: "buttonSize",
|
|
210
313
|
cssProperties: "--uds-button-size",
|
|
@@ -241,6 +344,12 @@ const publicProperties = {
|
|
|
241
344
|
twThemePath: (_, value) => `opacity[${value}]`,
|
|
242
345
|
possibleFixtures: ["opacitySteps"]
|
|
243
346
|
},
|
|
347
|
+
fillOpacity: {
|
|
348
|
+
name: "fillOpacity",
|
|
349
|
+
cssProperties: "fill-opacity",
|
|
350
|
+
twThemePath: (_, value) => `opacity[${value}]`,
|
|
351
|
+
possibleFixtures: ["opacitySteps"]
|
|
352
|
+
},
|
|
244
353
|
fontWeight,
|
|
245
354
|
iconSize: {
|
|
246
355
|
name: "iconSize",
|
|
@@ -248,12 +357,7 @@ const publicProperties = {
|
|
|
248
357
|
twThemePath: (_, value) => `sizing.icon.${value}`,
|
|
249
358
|
possibleFixtures: ["iconSizes"]
|
|
250
359
|
},
|
|
251
|
-
spacing
|
|
252
|
-
name: "spacing",
|
|
253
|
-
cssProperties: "padding",
|
|
254
|
-
twThemePath: (_, value) => `spacing[${value}]`,
|
|
255
|
-
possibleFixtures: ["spacingAliases"]
|
|
256
|
-
},
|
|
360
|
+
spacing,
|
|
257
361
|
iconVariant: {
|
|
258
362
|
name: "iconVariant",
|
|
259
363
|
cssProperties: "--uds-icon-variant",
|
|
@@ -265,86 +369,19 @@ const publicProperties = {
|
|
|
265
369
|
return String(schemaValue.value);
|
|
266
370
|
}
|
|
267
371
|
},
|
|
268
|
-
spacingHorizontal
|
|
269
|
-
|
|
270
|
-
cssProperties: ["padding-right", "padding-left"],
|
|
271
|
-
twThemePath: (_, value) => `spacing[${value}]`,
|
|
272
|
-
possibleFixtures: ["spacingAliases"]
|
|
273
|
-
},
|
|
274
|
-
spacingVertical: {
|
|
275
|
-
name: "spacingVertical",
|
|
276
|
-
cssProperties: ["padding-top", "padding-bottom"],
|
|
277
|
-
twThemePath: (_, value) => `spacing[${value}]`,
|
|
278
|
-
possibleFixtures: ["spacingAliases"]
|
|
279
|
-
},
|
|
372
|
+
spacingHorizontal,
|
|
373
|
+
spacingVertical,
|
|
280
374
|
textVariant,
|
|
281
375
|
textDecorationLine,
|
|
282
|
-
shadow
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
},
|
|
288
|
-
concatenate: true,
|
|
289
|
-
customValueRenderer: (schemaValue) => {
|
|
290
|
-
const shadowType = "drop";
|
|
291
|
-
const noneValue = "0 0 0 transparent";
|
|
292
|
-
if (schemaValue.valueType === "alias") {
|
|
293
|
-
const noneValue = "0 0 0 transparent";
|
|
294
|
-
if (schemaValue.value === "none") return noneValue;
|
|
295
|
-
if (schemaValue.value !== "custom") return `var(--uds-${shadowType}-shadow-${schemaValue.value})`;
|
|
296
|
-
} else if (schemaValue.valueType === "custom") return schemaValue.value.map((preset, index) => getShadowLayerValue({
|
|
297
|
-
preset,
|
|
298
|
-
shadowType,
|
|
299
|
-
prefix: index > 0 ? `${index + 1}` : void 0
|
|
300
|
-
}))?.join(", ") || noneValue;
|
|
301
|
-
throw new Error("Invalid valueType");
|
|
302
|
-
},
|
|
303
|
-
possibleFixtures: [
|
|
304
|
-
"shadowVariants",
|
|
305
|
-
"shadowVariantConfig",
|
|
306
|
-
"elevationAliases"
|
|
307
|
-
]
|
|
308
|
-
},
|
|
309
|
-
insetShadow: {
|
|
310
|
-
name: "inset shadow",
|
|
311
|
-
cssProperties: "box-shadow",
|
|
312
|
-
twThemePath: () => {
|
|
313
|
-
return ``;
|
|
314
|
-
},
|
|
315
|
-
concatenate: true,
|
|
316
|
-
customValueRenderer: (schemaValue) => {
|
|
317
|
-
const shadowType = "inset";
|
|
318
|
-
const noneValue = "0 0 0 transparent";
|
|
319
|
-
if (schemaValue.valueType === "alias") {
|
|
320
|
-
const noneValue = "0 0 0 transparent";
|
|
321
|
-
if (schemaValue.value === "none") return noneValue;
|
|
322
|
-
if (schemaValue.value !== "custom") return `var(--uds-${shadowType}-shadow-${schemaValue.value})`;
|
|
323
|
-
} else if (schemaValue.valueType === "custom") return schemaValue.value.map((preset, index) => getShadowLayerValue({
|
|
324
|
-
preset,
|
|
325
|
-
shadowType,
|
|
326
|
-
prefix: index > 0 ? `${index + 1}` : void 0
|
|
327
|
-
}))?.join(", ") || noneValue;
|
|
328
|
-
throw new Error("Invalid valueType");
|
|
329
|
-
},
|
|
330
|
-
possibleFixtures: ["shadowVariantsWithInvert"]
|
|
331
|
-
},
|
|
332
|
-
height: {
|
|
333
|
-
name: "height",
|
|
334
|
-
cssProperties: "height",
|
|
335
|
-
twThemePath: (_, value) => {
|
|
336
|
-
return `height[${value}]`;
|
|
337
|
-
},
|
|
338
|
-
possibleFixtures: ["spacingAliases"]
|
|
339
|
-
},
|
|
340
|
-
width: {
|
|
341
|
-
name: "width",
|
|
342
|
-
cssProperties: "width",
|
|
343
|
-
twThemePath: (_, value) => {
|
|
344
|
-
return `width[${value}]`;
|
|
345
|
-
},
|
|
346
|
-
possibleFixtures: ["spacingAliases"]
|
|
376
|
+
shadow,
|
|
377
|
+
shadowVar: {
|
|
378
|
+
...shadow,
|
|
379
|
+
name: "shadowVar",
|
|
380
|
+
cssProperties: `--${DROP_SHADOW_PREFIX}`
|
|
347
381
|
},
|
|
382
|
+
insetShadow,
|
|
383
|
+
height,
|
|
384
|
+
width,
|
|
348
385
|
scaleEffect: {
|
|
349
386
|
name: "scaleEffect",
|
|
350
387
|
cssProperties: BUTTON_SCALE_EFFECT,
|
|
@@ -357,6 +394,32 @@ const publicProperties = {
|
|
|
357
394
|
const stringValue = String(value);
|
|
358
395
|
return String(SCALE_EFFECTS[stringValue] ?? SCALE_EFFECTS.none);
|
|
359
396
|
}
|
|
397
|
+
},
|
|
398
|
+
backdropBlur: {
|
|
399
|
+
name: "backdropBlur",
|
|
400
|
+
possibleFixtures: ["positiveIntegers"],
|
|
401
|
+
cssProperties: "--uds-backdrop-blur",
|
|
402
|
+
twThemePath: () => {
|
|
403
|
+
return ``;
|
|
404
|
+
},
|
|
405
|
+
customValueRenderer: (schemaValue, schema, _theme, originalPropertyDefinition) => {
|
|
406
|
+
if (originalPropertyDefinition && originalPropertyDefinition.layerReference) {
|
|
407
|
+
const { variablePath, propertyName } = originalPropertyDefinition.layerReference;
|
|
408
|
+
const property = schema.variables[variablePath][propertyName].rest;
|
|
409
|
+
if (property.type === "elevationAliases") return `var(--uds-background-blur-radius-${property.value})`;
|
|
410
|
+
}
|
|
411
|
+
return `blur(${schemaValue.value}px)`;
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
blurBackgroundColor: {
|
|
415
|
+
...backgroundColor,
|
|
416
|
+
name: "blurBackgroundColor",
|
|
417
|
+
cssProperties: `--${BACKGROUND_BLUR_COLOR_PREFIX}`
|
|
418
|
+
},
|
|
419
|
+
blurBackgroundColorFallback: {
|
|
420
|
+
...backgroundColor,
|
|
421
|
+
name: "blurBackgroundColorFallback",
|
|
422
|
+
cssProperties: `--${BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX}`
|
|
360
423
|
}
|
|
361
424
|
};
|
|
362
425
|
const internalProperties = {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
const require_generateSchemaKey = require('./generateSchemaKey.cjs');
|
|
3
3
|
const require_variantConfigGuards = require('./variantConfigGuards.cjs');
|
|
4
|
+
const require_util = require('../../../fixtures/src/util.cjs');
|
|
4
5
|
|
|
5
6
|
//#region ../automated-config/dist/utils/buildConfigSchema.js
|
|
6
7
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
@@ -8,7 +9,10 @@ const require_variantConfigGuards = require('./variantConfigGuards.cjs');
|
|
|
8
9
|
function findFixtureType(property, variantKey) {
|
|
9
10
|
const defaultValue = property.defaults[variantKey];
|
|
10
11
|
const index = property.values.findIndex((arr) => arr.includes(defaultValue));
|
|
11
|
-
|
|
12
|
+
const fixtureType = property.typeOfFixture[index === -1 ? 0 : index];
|
|
13
|
+
const arbitraryFixture = require_util.getArbitraryFixture(fixtureType);
|
|
14
|
+
if (arbitraryFixture && !require_util.validateArbitraryValue(arbitraryFixture, defaultValue)) throw new Error(`Invalid default value "${defaultValue}" for property "${property.name}" (variant "${variantKey}"): does not satisfy ${fixtureType} constraints`);
|
|
15
|
+
return fixtureType;
|
|
12
16
|
}
|
|
13
17
|
/** Builds component schema from ComponentConfig at runtime */
|
|
14
18
|
function buildConfigSchema(config) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { ElevationAlias, ShadowVariant, ShadowVariantConfig, ShadowVariantWithInvert } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.cjs";
|
|
3
4
|
import { AllPossibleProperties, ComponentConfig, LayerConfig, PossibleStates, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.cjs";
|
|
4
5
|
import { SchemaStateValue } from "../types/ConfigSchema.cjs";
|
|
5
6
|
import { ConfigurablePropertiesName, SelectedConfigurableProperty } from "../properties.cjs";
|
|
@@ -13,7 +14,7 @@ type InferredDefaults<C extends ComponentConfig> = (C['variants'] extends NonNul
|
|
|
13
14
|
type InferredPropertySchema<Prop extends SelectedConfigurableProperty<ConfigurablePropertiesName, string>> = {
|
|
14
15
|
type: Prop['typeOfFixture'][number];
|
|
15
16
|
valueType: 'alias' | 'custom';
|
|
16
|
-
value: Prop['name'] extends 'shadow' ? ShadowVariant | ShadowVariantConfig | ElevationAlias : Prop['name'] extends 'insetShadow' ? ShadowVariantWithInvert | ShadowVariantConfig : Prop['values'][number][number];
|
|
17
|
+
value: Prop['name'] extends 'shadow' ? ShadowVariant | ShadowVariantConfig | ElevationAlias : Prop['name'] extends 'insetShadow' ? ShadowVariantWithInvert | ShadowVariantConfig : Prop['values'][number][number] | (Extract<Prop['typeOfFixture'][number], ArbitraryFixtures> extends never ? never : InferArbitraryType<Extract<Prop['typeOfFixture'][number], ArbitraryFixtures>>);
|
|
17
18
|
};
|
|
18
19
|
/** Infers state-to-schema mappings for a property (rest, hover, pressed, focus, etc.) */
|
|
19
20
|
type InferredPropertyStates<Prop extends SelectedConfigurableProperty<ConfigurablePropertiesName, string>> = (Prop['skipRestState'] extends true ? {} : {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { ElevationAlias, ShadowVariant, ShadowVariantConfig, ShadowVariantWithInvert } from "../../../types/dist/index.js";
|
|
3
|
+
import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.js";
|
|
3
4
|
import { AllPossibleProperties, ComponentConfig, LayerConfig, PossibleStates, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.js";
|
|
4
5
|
import { SchemaStateValue } from "../types/ConfigSchema.js";
|
|
5
6
|
import { ConfigurablePropertiesName, SelectedConfigurableProperty } from "../properties.js";
|
|
@@ -13,7 +14,7 @@ type InferredDefaults<C extends ComponentConfig> = (C['variants'] extends NonNul
|
|
|
13
14
|
type InferredPropertySchema<Prop extends SelectedConfigurableProperty<ConfigurablePropertiesName, string>> = {
|
|
14
15
|
type: Prop['typeOfFixture'][number];
|
|
15
16
|
valueType: 'alias' | 'custom';
|
|
16
|
-
value: Prop['name'] extends 'shadow' ? ShadowVariant | ShadowVariantConfig | ElevationAlias : Prop['name'] extends 'insetShadow' ? ShadowVariantWithInvert | ShadowVariantConfig : Prop['values'][number][number];
|
|
17
|
+
value: Prop['name'] extends 'shadow' ? ShadowVariant | ShadowVariantConfig | ElevationAlias : Prop['name'] extends 'insetShadow' ? ShadowVariantWithInvert | ShadowVariantConfig : Prop['values'][number][number] | (Extract<Prop['typeOfFixture'][number], ArbitraryFixtures> extends never ? never : InferArbitraryType<Extract<Prop['typeOfFixture'][number], ArbitraryFixtures>>);
|
|
17
18
|
};
|
|
18
19
|
/** Infers state-to-schema mappings for a property (rest, hover, pressed, focus, etc.) */
|
|
19
20
|
type InferredPropertyStates<Prop extends SelectedConfigurableProperty<ConfigurablePropertiesName, string>> = (Prop['skipRestState'] extends true ? {} : {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { generateSchemaKey } from "./generateSchemaKey.js";
|
|
3
3
|
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.js";
|
|
4
|
+
import { getArbitraryFixture, validateArbitraryValue } from "../../../fixtures/src/util.js";
|
|
4
5
|
|
|
5
6
|
//#region ../automated-config/dist/utils/buildConfigSchema.js
|
|
6
7
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
@@ -8,7 +9,10 @@ import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } fro
|
|
|
8
9
|
function findFixtureType(property, variantKey) {
|
|
9
10
|
const defaultValue = property.defaults[variantKey];
|
|
10
11
|
const index = property.values.findIndex((arr) => arr.includes(defaultValue));
|
|
11
|
-
|
|
12
|
+
const fixtureType = property.typeOfFixture[index === -1 ? 0 : index];
|
|
13
|
+
const arbitraryFixture = getArbitraryFixture(fixtureType);
|
|
14
|
+
if (arbitraryFixture && !validateArbitraryValue(arbitraryFixture, defaultValue)) throw new Error(`Invalid default value "${defaultValue}" for property "${property.name}" (variant "${variantKey}"): does not satisfy ${fixtureType} constraints`);
|
|
15
|
+
return fixtureType;
|
|
12
16
|
}
|
|
13
17
|
/** Builds component schema from ComponentConfig at runtime */
|
|
14
18
|
function buildConfigSchema(config) {
|
|
@@ -11,8 +11,8 @@ import { SelectedConfigurableProperty } from "../properties.cjs";
|
|
|
11
11
|
* @returns A Record of layer names to their properties, or null if no properties are found
|
|
12
12
|
*/
|
|
13
13
|
declare function getConfigVariantProperties(variant?: VariantConfig): {
|
|
14
|
-
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
15
|
-
root: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
14
|
+
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "spacingHorizontal" | "spacingVertical" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "spacingHorizontal" | "spacingVertical" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -11,8 +11,8 @@ import { SelectedConfigurableProperty } from "../properties.js";
|
|
|
11
11
|
* @returns A Record of layer names to their properties, or null if no properties are found
|
|
12
12
|
*/
|
|
13
13
|
declare function getConfigVariantProperties(variant?: VariantConfig): {
|
|
14
|
-
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
15
|
-
root: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
14
|
+
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "spacingHorizontal" | "spacingVertical" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "spacingHorizontal" | "spacingVertical" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -115,11 +115,11 @@ function generateClassName({ componentName, subComponentName, variantKey, varian
|
|
|
115
115
|
if (layerOptionalPseudoSelector) className = `${className}${layerOptionalPseudoSelector}`;
|
|
116
116
|
return className.replaceAll(/\s+/g, "-");
|
|
117
117
|
}
|
|
118
|
-
const getTheCssPropertyValue = (schema, theme, propertyName, schemaStateValue, existingValue) => {
|
|
118
|
+
const getTheCssPropertyValue = (schema, theme, propertyName, schemaStateValue, existingValue, originalPropertyDefinition) => {
|
|
119
119
|
const { value, type } = schemaStateValue;
|
|
120
120
|
const propertyConfig = require_properties.configurableProperties[propertyName];
|
|
121
121
|
let newValue;
|
|
122
|
-
if (propertyConfig.customValueRenderer) newValue = propertyConfig.customValueRenderer(schemaStateValue, schema, theme);
|
|
122
|
+
if (propertyConfig.customValueRenderer) newValue = propertyConfig.customValueRenderer(schemaStateValue, schema, theme, originalPropertyDefinition);
|
|
123
123
|
else {
|
|
124
124
|
const safeTwThemePath = propertyConfig.twThemePath;
|
|
125
125
|
newValue = theme(safeTwThemePath(type, String(value)));
|
|
@@ -222,10 +222,10 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
222
222
|
}
|
|
223
223
|
} else if (typeof cssProperties === "string") {
|
|
224
224
|
const existingValue = currentStyles?.[fullClassName]?.[cssProperties];
|
|
225
|
-
cssDeclarations[cssProperties] = getTheCssPropertyValue(schema, theme, originalPropertyDefinition.name, schemaValueForState, existingValue);
|
|
225
|
+
cssDeclarations[cssProperties] = getTheCssPropertyValue(schema, theme, originalPropertyDefinition.name, schemaValueForState, existingValue, originalPropertyDefinition);
|
|
226
226
|
} else if (Array.isArray(cssProperties)) for (const cssProp of cssProperties) {
|
|
227
227
|
const existingValue = currentStyles?.[fullClassName]?.[cssProp];
|
|
228
|
-
cssDeclarations[cssProp] = getTheCssPropertyValue(schema, theme, originalPropertyDefinition.name, schemaValueForState, existingValue);
|
|
228
|
+
cssDeclarations[cssProp] = getTheCssPropertyValue(schema, theme, originalPropertyDefinition.name, schemaValueForState, existingValue, originalPropertyDefinition);
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
231
231
|
* Button root layer workarounds & enhancements.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
|
+
import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.cjs";
|
|
2
3
|
import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.cjs";
|
|
3
4
|
import { ConfigurablePropertiesName, SelectedConfigurableProperty, configurableProperties } from "../properties.cjs";
|
|
4
5
|
import { ComponentSchema, buildConfigSchema, findFixtureType } from "./buildConfigSchema.cjs";
|
|
@@ -87,11 +88,15 @@ declare function createConfigurableProperty<C extends ConfigurablePropertiesName
|
|
|
87
88
|
name: C;
|
|
88
89
|
typeOfFixture: T;
|
|
89
90
|
values: V;
|
|
90
|
-
defaults: { [K in O]: V[number][number] };
|
|
91
|
+
defaults: { [K in O]: V[number][number] | (Extract<T[number], ArbitraryFixtures> extends never ? never : InferArbitraryType<Extract<T[number], ArbitraryFixtures>>) };
|
|
91
92
|
label: string;
|
|
92
93
|
skipRestState?: boolean;
|
|
93
94
|
pseudoStates?: PossibleStates[];
|
|
94
95
|
supportsCustom?: boolean;
|
|
96
|
+
layerReference?: {
|
|
97
|
+
variablePath: string;
|
|
98
|
+
propertyName: string;
|
|
99
|
+
};
|
|
95
100
|
}): SelectedConfigurableProperty<C, O, T, V>;
|
|
96
101
|
declare function createVariantConfig(config: {
|
|
97
102
|
label: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
|
+
import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.js";
|
|
2
3
|
import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.js";
|
|
3
4
|
import { ConfigurablePropertiesName, SelectedConfigurableProperty, configurableProperties } from "../properties.js";
|
|
4
5
|
import { ComponentSchema, buildConfigSchema, findFixtureType } from "./buildConfigSchema.js";
|
|
@@ -87,11 +88,15 @@ declare function createConfigurableProperty<C extends ConfigurablePropertiesName
|
|
|
87
88
|
name: C;
|
|
88
89
|
typeOfFixture: T;
|
|
89
90
|
values: V;
|
|
90
|
-
defaults: { [K in O]: V[number][number] };
|
|
91
|
+
defaults: { [K in O]: V[number][number] | (Extract<T[number], ArbitraryFixtures> extends never ? never : InferArbitraryType<Extract<T[number], ArbitraryFixtures>>) };
|
|
91
92
|
label: string;
|
|
92
93
|
skipRestState?: boolean;
|
|
93
94
|
pseudoStates?: PossibleStates[];
|
|
94
95
|
supportsCustom?: boolean;
|
|
96
|
+
layerReference?: {
|
|
97
|
+
variablePath: string;
|
|
98
|
+
propertyName: string;
|
|
99
|
+
};
|
|
95
100
|
}): SelectedConfigurableProperty<C, O, T, V>;
|
|
96
101
|
declare function createVariantConfig(config: {
|
|
97
102
|
label: string;
|
|
@@ -111,11 +111,11 @@ function generateClassName({ componentName, subComponentName, variantKey, varian
|
|
|
111
111
|
if (layerOptionalPseudoSelector) className = `${className}${layerOptionalPseudoSelector}`;
|
|
112
112
|
return className.replaceAll(/\s+/g, "-");
|
|
113
113
|
}
|
|
114
|
-
const getTheCssPropertyValue = (schema, theme, propertyName, schemaStateValue, existingValue) => {
|
|
114
|
+
const getTheCssPropertyValue = (schema, theme, propertyName, schemaStateValue, existingValue, originalPropertyDefinition) => {
|
|
115
115
|
const { value, type } = schemaStateValue;
|
|
116
116
|
const propertyConfig = configurableProperties[propertyName];
|
|
117
117
|
let newValue;
|
|
118
|
-
if (propertyConfig.customValueRenderer) newValue = propertyConfig.customValueRenderer(schemaStateValue, schema, theme);
|
|
118
|
+
if (propertyConfig.customValueRenderer) newValue = propertyConfig.customValueRenderer(schemaStateValue, schema, theme, originalPropertyDefinition);
|
|
119
119
|
else {
|
|
120
120
|
const safeTwThemePath = propertyConfig.twThemePath;
|
|
121
121
|
newValue = theme(safeTwThemePath(type, String(value)));
|
|
@@ -218,10 +218,10 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
218
218
|
}
|
|
219
219
|
} else if (typeof cssProperties === "string") {
|
|
220
220
|
const existingValue = currentStyles?.[fullClassName]?.[cssProperties];
|
|
221
|
-
cssDeclarations[cssProperties] = getTheCssPropertyValue(schema, theme, originalPropertyDefinition.name, schemaValueForState, existingValue);
|
|
221
|
+
cssDeclarations[cssProperties] = getTheCssPropertyValue(schema, theme, originalPropertyDefinition.name, schemaValueForState, existingValue, originalPropertyDefinition);
|
|
222
222
|
} else if (Array.isArray(cssProperties)) for (const cssProp of cssProperties) {
|
|
223
223
|
const existingValue = currentStyles?.[fullClassName]?.[cssProp];
|
|
224
|
-
cssDeclarations[cssProp] = getTheCssPropertyValue(schema, theme, originalPropertyDefinition.name, schemaValueForState, existingValue);
|
|
224
|
+
cssDeclarations[cssProp] = getTheCssPropertyValue(schema, theme, originalPropertyDefinition.name, schemaValueForState, existingValue, originalPropertyDefinition);
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
227
227
|
* Button root layer workarounds & enhancements.
|