@yahoo/uds 3.157.0 → 3.158.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 +26 -0
- package/dist/automated-config/dist/generated/autoVariants.d.cts +17 -0
- package/dist/automated-config/dist/generated/autoVariants.d.ts +17 -0
- package/dist/automated-config/dist/generated/autoVariants.js +26 -0
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +3287 -596
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +350 -12
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +350 -12
- package/dist/automated-config/dist/generated/generatedConfigs.js +3285 -597
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +276 -45
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +8 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +8 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +276 -45
- package/dist/automated-config/dist/properties.cjs +8 -1
- package/dist/automated-config/dist/properties.d.cts +8 -0
- package/dist/automated-config/dist/properties.d.ts +8 -0
- package/dist/automated-config/dist/properties.js +8 -1
- package/dist/automated-config/dist/types/ComponentConfig.d.cts +3 -1
- package/dist/automated-config/dist/types/ComponentConfig.d.ts +3 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.cjs +48 -33
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +14 -4
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +14 -4
- package/dist/automated-config/dist/utils/buildConfigSchema.js +49 -34
- package/dist/automated-config/dist/utils/componentStatePseudoStates.cjs +4 -0
- package/dist/automated-config/dist/utils/componentStatePseudoStates.js +4 -1
- 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/getConfigVariantProperties.d.cts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.cjs +5 -2
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.js +6 -3
- 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 +106 -33
- package/dist/automated-config/dist/utils/index.d.cts +16 -4
- package/dist/automated-config/dist/utils/index.d.ts +16 -4
- package/dist/automated-config/dist/utils/index.js +107 -34
- 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 +6 -3
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.cts +1 -1
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.ts +1 -1
- package/dist/automated-config/dist/utils/pseudoStateSelectors.js +6 -3
- package/dist/components/client/Button.cjs +3 -3
- package/dist/components/client/Button.js +3 -3
- package/dist/components/client/Input/Input.cjs +1 -1
- package/dist/components/client/Input/Input.js +1 -1
- package/dist/components/client/Menu/Menu.Item.cjs +1 -0
- package/dist/components/client/Menu/Menu.Item.js +1 -0
- package/dist/components/client/Select/Select.cjs +179 -0
- package/dist/components/client/Select/Select.d.cts +55 -0
- package/dist/components/client/Select/Select.d.ts +56 -0
- package/dist/components/client/Select/Select.js +176 -0
- package/dist/components/client/Select/SelectContent.cjs +75 -0
- package/dist/components/client/Select/SelectContent.d.cts +44 -0
- package/dist/components/client/Select/SelectContent.d.ts +45 -0
- package/dist/components/client/Select/SelectContent.js +73 -0
- package/dist/components/client/Select/SelectDivider.cjs +63 -0
- package/dist/components/client/Select/SelectDivider.d.cts +44 -0
- package/dist/components/client/Select/SelectDivider.d.ts +45 -0
- package/dist/components/client/Select/SelectDivider.js +61 -0
- package/dist/components/client/Select/SelectHelpText.cjs +51 -0
- package/dist/components/client/Select/SelectHelpText.d.cts +27 -0
- package/dist/components/client/Select/SelectHelpText.d.ts +28 -0
- package/dist/components/client/Select/SelectHelpText.js +48 -0
- package/dist/components/client/Select/SelectItem.cjs +172 -0
- package/dist/components/client/Select/SelectItem.d.cts +29 -0
- package/dist/components/client/Select/SelectItem.d.ts +30 -0
- package/dist/components/client/Select/SelectItem.js +170 -0
- package/dist/components/client/Select/SelectTrigger.cjs +138 -0
- package/dist/components/client/Select/SelectTrigger.d.cts +27 -0
- package/dist/components/client/Select/SelectTrigger.d.ts +28 -0
- package/dist/components/client/Select/SelectTrigger.js +136 -0
- package/dist/components/client/Select/SelectValue.cjs +28 -0
- package/dist/components/client/Select/SelectValue.d.cts +19 -0
- package/dist/components/client/Select/SelectValue.d.ts +20 -0
- package/dist/components/client/Select/SelectValue.js +26 -0
- package/dist/components/client/Select/index.cjs +11 -0
- package/dist/components/client/Select/index.d.cts +6 -0
- package/dist/components/client/Select/index.d.ts +7 -0
- package/dist/components/client/Select/index.js +7 -0
- package/dist/components/client/Select/selectContext.cjs +20 -0
- package/dist/components/client/Select/selectContext.d.cts +23 -0
- package/dist/components/client/Select/selectContext.d.ts +24 -0
- package/dist/components/client/Select/selectContext.js +16 -0
- package/dist/components/client/Select/selectFieldStyles.cjs +85 -0
- package/dist/components/client/Select/selectFieldStyles.d.cts +37 -0
- package/dist/components/client/Select/selectFieldStyles.d.ts +38 -0
- package/dist/components/client/Select/selectFieldStyles.js +75 -0
- package/dist/components/client/index.cjs +8 -0
- package/dist/components/client/index.d.cts +5 -1
- package/dist/components/client/index.d.ts +5 -1
- package/dist/components/client/index.js +5 -1
- package/dist/components/index.cjs +8 -0
- package/dist/components/index.d.cts +5 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +5 -1
- package/dist/config/dist/index.cjs +383 -73
- package/dist/config/dist/index.js +383 -73
- package/dist/css/dist/css/utils.cjs +3 -0
- package/dist/css/dist/css/utils.js +3 -0
- package/dist/css/dist/packages/automated-config/dist/properties.cjs +8 -1
- package/dist/css/dist/packages/automated-config/dist/properties.js +8 -1
- package/dist/css/dist/packages/config/dist/index.cjs +383 -73
- package/dist/css/dist/packages/config/dist/index.js +383 -73
- 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 +34 -0
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +11 -3
- package/dist/styles/styler.d.cts +29 -12
- package/dist/styles/styler.d.ts +29 -12
- package/dist/styles/variants.d.cts +54 -0
- package/dist/styles/variants.d.ts +54 -0
- package/dist/tailwind/utils/index.cjs +3 -0
- package/dist/tailwind/utils/index.d.cts +2 -1
- package/dist/tailwind/utils/index.d.ts +2 -1
- package/dist/tailwind/utils/index.js +2 -1
- package/dist/tailwind-internal/dist/base/addColorModeVars.cjs +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVars.js +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVarsV2.cjs +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVarsV2.js +1 -1
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.cjs +74 -6
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.d.cts +14 -0
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.d.ts +14 -0
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.js +74 -7
- package/dist/tailwind-internal/dist/components/getResponsiveTextStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/components/getResponsiveTextStyles.js +1 -1
- package/dist/tailwind-internal/dist/index.d.cts +1 -0
- package/dist/tailwind-internal/dist/index.d.ts +1 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.cjs +3287 -596
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +3285 -597
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.cjs +8 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.js +8 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.cjs +4 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.js +4 -1
- 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 +103 -33
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +104 -34
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.cjs +6 -3
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.js +6 -3
- package/dist/tailwind-internal/dist/packages/config/dist/index.cjs +383 -73
- package/dist/tailwind-internal/dist/packages/config/dist/index.js +383 -73
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.cjs +12 -10
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.js +3 -2
- package/dist/tailwind-internal/dist/plugins/a11y.cjs +6 -2
- package/dist/tailwind-internal/dist/plugins/a11y.js +6 -2
- package/dist/tailwind-internal/dist/plugins/blurBgFallback.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/blurBgFallback.js +1 -1
- package/dist/tailwind-internal/dist/plugins/borderRadius.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/borderRadius.js +1 -1
- package/dist/tailwind-internal/dist/plugins/borderWidth.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/borderWidth.js +1 -1
- package/dist/tailwind-internal/dist/plugins/colors.cjs +2 -2
- package/dist/tailwind-internal/dist/plugins/colors.js +2 -2
- package/dist/tailwind-internal/dist/plugins/components.cjs +5 -2
- package/dist/tailwind-internal/dist/plugins/components.js +6 -3
- package/dist/tailwind-internal/dist/plugins/elevation.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/elevation.js +1 -1
- package/dist/tailwind-internal/dist/plugins/shadows.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/shadows.js +1 -1
- package/dist/tailwind-internal/dist/plugins/typography.cjs +2 -2
- package/dist/tailwind-internal/dist/plugins/typography.js +2 -2
- package/dist/tailwind-internal/dist/utils/getElevationStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getElevationStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getFontStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getFontStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getMotionStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getMotionStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowPresetValues.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowPresetValues.js +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/parseTokens.cjs +2 -2
- package/dist/tailwind-internal/dist/utils/parseTokens.js +2 -2
- package/dist/tokens/automation/configs/index.cjs +3 -0
- 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 +25 -0
- package/dist/tokens/automation/index.d.cts +6 -2
- package/dist/tokens/automation/index.d.ts +6 -2
- package/dist/tokens/automation/index.js +6 -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 +26 -0
- package/dist/tokens/index.d.cts +8 -4
- package/dist/tokens/index.d.ts +8 -4
- package/dist/tokens/index.js +7 -3
- package/dist/tokens/types.d.cts +2 -2
- package/dist/tokens/types.d.ts +2 -2
- package/dist/types/dist/index.d.cts +36 -1
- package/dist/types/dist/index.d.ts +36 -1
- package/dist/uds/generated/componentData.cjs +718 -308
- package/dist/uds/generated/componentData.js +718 -308
- package/dist/uds/generated/migrationSchemaVersion.cjs +1 -1
- package/dist/uds/generated/migrationSchemaVersion.js +1 -1
- package/dist/uds/generated/tailwindPurge.cjs +1501 -315
- package/dist/uds/generated/tailwindPurge.js +1501 -315
- package/generated/componentData.json +897 -398
- package/generated/migrationSchemaVersion.ts +1 -1
- package/generated/tailwindPurge.ts +4 -4
- package/package.json +1 -1
|
@@ -434,6 +434,12 @@ const paginationWidthVar = {
|
|
|
434
434
|
possibleFixtures: ["positiveIntegers"],
|
|
435
435
|
twThemePath: (_, value) => `${value}px`
|
|
436
436
|
};
|
|
437
|
+
const controlHeight = {
|
|
438
|
+
name: "controlHeight",
|
|
439
|
+
cssProperties: [],
|
|
440
|
+
possibleFixtures: ["positiveIntegers"],
|
|
441
|
+
twThemePath: (_, value) => `${value}px`
|
|
442
|
+
};
|
|
437
443
|
const publicProperties = {
|
|
438
444
|
backgroundColor,
|
|
439
445
|
borderWidth,
|
|
@@ -530,7 +536,8 @@ const publicProperties = {
|
|
|
530
536
|
twThemePath: () => "",
|
|
531
537
|
customValueRenderer: ({ value }) => `${String(value)}%`
|
|
532
538
|
},
|
|
533
|
-
paginationWidthVar
|
|
539
|
+
paginationWidthVar,
|
|
540
|
+
controlHeight
|
|
534
541
|
};
|
|
535
542
|
const internalProperties = {
|
|
536
543
|
outlineWidth,
|
|
@@ -434,6 +434,12 @@ const paginationWidthVar = {
|
|
|
434
434
|
possibleFixtures: ["positiveIntegers"],
|
|
435
435
|
twThemePath: (_, value) => `${value}px`
|
|
436
436
|
};
|
|
437
|
+
const controlHeight = {
|
|
438
|
+
name: "controlHeight",
|
|
439
|
+
cssProperties: [],
|
|
440
|
+
possibleFixtures: ["positiveIntegers"],
|
|
441
|
+
twThemePath: (_, value) => `${value}px`
|
|
442
|
+
};
|
|
437
443
|
const publicProperties = {
|
|
438
444
|
backgroundColor,
|
|
439
445
|
borderWidth,
|
|
@@ -530,7 +536,8 @@ const publicProperties = {
|
|
|
530
536
|
twThemePath: () => "",
|
|
531
537
|
customValueRenderer: ({ value }) => `${String(value)}%`
|
|
532
538
|
},
|
|
533
|
-
paginationWidthVar
|
|
539
|
+
paginationWidthVar,
|
|
540
|
+
controlHeight
|
|
534
541
|
};
|
|
535
542
|
const internalProperties = {
|
|
536
543
|
outlineWidth,
|
|
@@ -5,5 +5,9 @@
|
|
|
5
5
|
function getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption) {
|
|
6
6
|
return componentState.excludePseudoStatesForOptions?.[componentStateOption] ?? [];
|
|
7
7
|
}
|
|
8
|
+
function getExcludedLayersForComponentStateOption(componentState, componentStateOption) {
|
|
9
|
+
return componentState.excludeLayersForOptions?.[componentStateOption] ?? [];
|
|
10
|
+
}
|
|
8
11
|
//#endregion
|
|
12
|
+
exports.getExcludedLayersForComponentStateOption = getExcludedLayersForComponentStateOption;
|
|
9
13
|
exports.getExcludedPseudoStatesForComponentStateOption = getExcludedPseudoStatesForComponentStateOption;
|
|
@@ -5,5 +5,8 @@
|
|
|
5
5
|
function getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption) {
|
|
6
6
|
return componentState.excludePseudoStatesForOptions?.[componentStateOption] ?? [];
|
|
7
7
|
}
|
|
8
|
+
function getExcludedLayersForComponentStateOption(componentState, componentStateOption) {
|
|
9
|
+
return componentState.excludeLayersForOptions?.[componentStateOption] ?? [];
|
|
10
|
+
}
|
|
8
11
|
//#endregion
|
|
9
|
-
export { getExcludedPseudoStatesForComponentStateOption };
|
|
12
|
+
export { getExcludedLayersForComponentStateOption, getExcludedPseudoStatesForComponentStateOption };
|
package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.cjs
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
const require_index = require("../../../css-tokens/dist/index.cjs");
|
|
3
|
+
const require_mapTextVariantFixtureToValue = require("../mapTextVariantFixtureToValue.cjs");
|
|
4
|
+
const require_properties = require("../properties.cjs");
|
|
5
|
+
const require_iconButtonMatchButtonHeight = require("./iconButtonMatchButtonHeight.cjs");
|
|
6
|
+
//#region ../tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.js
|
|
7
|
+
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
8
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
9
|
+
/** Sizes where IconButton control height should match Button. */
|
|
10
|
+
const SHARED_BUTTON_ICONBUTTON_SIZES = new Set([
|
|
11
|
+
"xs",
|
|
12
|
+
"sm",
|
|
13
|
+
"md",
|
|
14
|
+
"lg"
|
|
15
|
+
]);
|
|
16
|
+
function getButtonIconSizeVar({ schema, iconLayerKey, state, theme }) {
|
|
17
|
+
const iconSizeValue = schema.variables?.[iconLayerKey]?.size?.[state]?.value;
|
|
18
|
+
if (typeof iconSizeValue === "string" && iconSizeValue) return theme(require_properties.configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Button content box: max(icon size, text line-height).
|
|
22
|
+
* Matches Figma auto-layout and keeps IconButton height aligned with Button.
|
|
23
|
+
*/
|
|
24
|
+
function getButtonControlContentSize({ schema, rootLayerKey, iconLayerKey, state, theme }) {
|
|
25
|
+
const iconSizeVar = getButtonIconSizeVar({
|
|
26
|
+
schema,
|
|
27
|
+
iconLayerKey,
|
|
28
|
+
state,
|
|
29
|
+
theme
|
|
30
|
+
});
|
|
31
|
+
const textVariantValue = schema.variables?.[rootLayerKey]?.textVariant?.[state]?.value;
|
|
32
|
+
if (iconSizeVar && typeof textVariantValue === "string" && textVariantValue) return `max(${iconSizeVar}, ${theme(require_mapTextVariantFixtureToValue.mapTextVariantFixtureToValue("lineHeight")("textVariants", textVariantValue))})`;
|
|
33
|
+
if (iconSizeVar) return iconSizeVar;
|
|
34
|
+
}
|
|
35
|
+
/** `round(up, …, 1px)` matches Math.ceil in getButtonControlHeightPx and Figma hug height. */
|
|
36
|
+
function formatControlHeightCalc(calcExpression) {
|
|
37
|
+
return `round(up, ${calcExpression}, 1px)`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Button control height: vertical padding on both sides plus max(icon size, text line-height).
|
|
41
|
+
*/
|
|
42
|
+
function getButtonControlHeight({ paddingVertical, schema, rootLayerKey, iconLayerKey, state, theme }) {
|
|
43
|
+
const contentSize = getButtonControlContentSize({
|
|
44
|
+
schema,
|
|
45
|
+
rootLayerKey,
|
|
46
|
+
iconLayerKey,
|
|
47
|
+
state,
|
|
48
|
+
theme
|
|
49
|
+
});
|
|
50
|
+
if (!contentSize) return;
|
|
51
|
+
return formatControlHeightCalc(`calc(2 * ${paddingVertical} + ${contentSize})`);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* IconButton control height: uniform padding plus icon size only (no typography).
|
|
55
|
+
*/
|
|
56
|
+
function getIconButtonControlHeight({ paddingVertical, schema, iconLayerKey, state, theme }) {
|
|
57
|
+
const iconSizeVar = getButtonIconSizeVar({
|
|
58
|
+
schema,
|
|
59
|
+
iconLayerKey,
|
|
60
|
+
state,
|
|
61
|
+
theme
|
|
62
|
+
});
|
|
63
|
+
if (!iconSizeVar) return;
|
|
64
|
+
return formatControlHeightCalc(`calc(2 * ${paddingVertical} + ${iconSizeVar})`);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Layout line-height for button root: max(icon size, text line-height).
|
|
68
|
+
*/
|
|
69
|
+
function getButtonContentLineHeight({ schema, rootLayerKey, iconLayerKey, state, theme }) {
|
|
70
|
+
return getButtonControlContentSize({
|
|
71
|
+
schema,
|
|
72
|
+
rootLayerKey,
|
|
73
|
+
iconLayerKey,
|
|
74
|
+
state,
|
|
75
|
+
theme
|
|
76
|
+
}) ?? "1em";
|
|
77
|
+
}
|
|
78
|
+
function applyButtonControlHeightDeclarations({ cssDeclarations, paddingVertical, schema, rootLayerKey, iconLayerKey, state, theme }) {
|
|
79
|
+
const controlHeight = rootLayerKey ? getButtonControlHeight({
|
|
80
|
+
paddingVertical,
|
|
81
|
+
schema,
|
|
82
|
+
rootLayerKey,
|
|
83
|
+
iconLayerKey,
|
|
84
|
+
state,
|
|
85
|
+
theme
|
|
86
|
+
}) : getIconButtonControlHeight({
|
|
87
|
+
paddingVertical,
|
|
88
|
+
schema,
|
|
89
|
+
iconLayerKey,
|
|
90
|
+
state,
|
|
91
|
+
theme
|
|
92
|
+
});
|
|
93
|
+
if (controlHeight) {
|
|
94
|
+
cssDeclarations[require_index.BUTTON_CONTROL_HEIGHT_VAR] = controlHeight;
|
|
95
|
+
cssDeclarations.height = `var(${require_index.BUTTON_CONTROL_HEIGHT_VAR})`;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function applyIconButtonSquareDimensions(cssDeclarations) {
|
|
99
|
+
if (cssDeclarations[require_index.BUTTON_CONTROL_HEIGHT_VAR]) cssDeclarations.width = `var(${require_index.BUTTON_CONTROL_HEIGHT_VAR})`;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* IconButton height for xs–lg mirrors Button (padding + max(icon, line-height)).
|
|
103
|
+
* xl uses icon-only height from IconButton tokens.
|
|
104
|
+
*/
|
|
105
|
+
function applyIconButtonControlHeightDeclarations({ cssDeclarations, paddingVertical, iconButtonSchema, buttonHeightReferenceSchema, variantValue, iconLayerKey: _iconLayerKey, state, theme }) {
|
|
106
|
+
if (buttonHeightReferenceSchema && SHARED_BUTTON_ICONBUTTON_SIZES.has(variantValue) && require_iconButtonMatchButtonHeight.isIconButtonMatchButtonHeightEnabled(iconButtonSchema, variantValue)) {
|
|
107
|
+
const buttonRootLayerKey = `size/${variantValue}/root`;
|
|
108
|
+
const buttonIconLayerKey = `size/${variantValue}/icon`;
|
|
109
|
+
const buttonSpacingValue = buttonHeightReferenceSchema.variables?.[buttonRootLayerKey]?.spacingVertical?.[state]?.value;
|
|
110
|
+
applyButtonControlHeightDeclarations({
|
|
111
|
+
cssDeclarations,
|
|
112
|
+
paddingVertical: typeof buttonSpacingValue === "string" && buttonSpacingValue ? theme(require_properties.configurableProperties.spacingVertical.twThemePath("spacingAliases", buttonSpacingValue)) : paddingVertical,
|
|
113
|
+
schema: buttonHeightReferenceSchema,
|
|
114
|
+
rootLayerKey: buttonRootLayerKey,
|
|
115
|
+
iconLayerKey: buttonIconLayerKey,
|
|
116
|
+
state,
|
|
117
|
+
theme
|
|
118
|
+
});
|
|
119
|
+
applyIconButtonSquareDimensions(cssDeclarations);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
exports.SHARED_BUTTON_ICONBUTTON_SIZES = SHARED_BUTTON_ICONBUTTON_SIZES;
|
|
124
|
+
exports.applyButtonControlHeightDeclarations = applyButtonControlHeightDeclarations;
|
|
125
|
+
exports.applyIconButtonControlHeightDeclarations = applyIconButtonControlHeightDeclarations;
|
|
126
|
+
exports.getButtonContentLineHeight = getButtonContentLineHeight;
|
package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { BUTTON_CONTROL_HEIGHT_VAR } from "../../../css-tokens/dist/index.js";
|
|
3
|
+
import { mapTextVariantFixtureToValue } from "../mapTextVariantFixtureToValue.js";
|
|
4
|
+
import { configurableProperties } from "../properties.js";
|
|
5
|
+
import { isIconButtonMatchButtonHeightEnabled } from "./iconButtonMatchButtonHeight.js";
|
|
6
|
+
//#region ../tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.js
|
|
7
|
+
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
8
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
9
|
+
/** Sizes where IconButton control height should match Button. */
|
|
10
|
+
const SHARED_BUTTON_ICONBUTTON_SIZES = new Set([
|
|
11
|
+
"xs",
|
|
12
|
+
"sm",
|
|
13
|
+
"md",
|
|
14
|
+
"lg"
|
|
15
|
+
]);
|
|
16
|
+
function getButtonIconSizeVar({ schema, iconLayerKey, state, theme }) {
|
|
17
|
+
const iconSizeValue = schema.variables?.[iconLayerKey]?.size?.[state]?.value;
|
|
18
|
+
if (typeof iconSizeValue === "string" && iconSizeValue) return theme(configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Button content box: max(icon size, text line-height).
|
|
22
|
+
* Matches Figma auto-layout and keeps IconButton height aligned with Button.
|
|
23
|
+
*/
|
|
24
|
+
function getButtonControlContentSize({ schema, rootLayerKey, iconLayerKey, state, theme }) {
|
|
25
|
+
const iconSizeVar = getButtonIconSizeVar({
|
|
26
|
+
schema,
|
|
27
|
+
iconLayerKey,
|
|
28
|
+
state,
|
|
29
|
+
theme
|
|
30
|
+
});
|
|
31
|
+
const textVariantValue = schema.variables?.[rootLayerKey]?.textVariant?.[state]?.value;
|
|
32
|
+
if (iconSizeVar && typeof textVariantValue === "string" && textVariantValue) return `max(${iconSizeVar}, ${theme(mapTextVariantFixtureToValue("lineHeight")("textVariants", textVariantValue))})`;
|
|
33
|
+
if (iconSizeVar) return iconSizeVar;
|
|
34
|
+
}
|
|
35
|
+
/** `round(up, …, 1px)` matches Math.ceil in getButtonControlHeightPx and Figma hug height. */
|
|
36
|
+
function formatControlHeightCalc(calcExpression) {
|
|
37
|
+
return `round(up, ${calcExpression}, 1px)`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Button control height: vertical padding on both sides plus max(icon size, text line-height).
|
|
41
|
+
*/
|
|
42
|
+
function getButtonControlHeight({ paddingVertical, schema, rootLayerKey, iconLayerKey, state, theme }) {
|
|
43
|
+
const contentSize = getButtonControlContentSize({
|
|
44
|
+
schema,
|
|
45
|
+
rootLayerKey,
|
|
46
|
+
iconLayerKey,
|
|
47
|
+
state,
|
|
48
|
+
theme
|
|
49
|
+
});
|
|
50
|
+
if (!contentSize) return;
|
|
51
|
+
return formatControlHeightCalc(`calc(2 * ${paddingVertical} + ${contentSize})`);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* IconButton control height: uniform padding plus icon size only (no typography).
|
|
55
|
+
*/
|
|
56
|
+
function getIconButtonControlHeight({ paddingVertical, schema, iconLayerKey, state, theme }) {
|
|
57
|
+
const iconSizeVar = getButtonIconSizeVar({
|
|
58
|
+
schema,
|
|
59
|
+
iconLayerKey,
|
|
60
|
+
state,
|
|
61
|
+
theme
|
|
62
|
+
});
|
|
63
|
+
if (!iconSizeVar) return;
|
|
64
|
+
return formatControlHeightCalc(`calc(2 * ${paddingVertical} + ${iconSizeVar})`);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Layout line-height for button root: max(icon size, text line-height).
|
|
68
|
+
*/
|
|
69
|
+
function getButtonContentLineHeight({ schema, rootLayerKey, iconLayerKey, state, theme }) {
|
|
70
|
+
return getButtonControlContentSize({
|
|
71
|
+
schema,
|
|
72
|
+
rootLayerKey,
|
|
73
|
+
iconLayerKey,
|
|
74
|
+
state,
|
|
75
|
+
theme
|
|
76
|
+
}) ?? "1em";
|
|
77
|
+
}
|
|
78
|
+
function applyButtonControlHeightDeclarations({ cssDeclarations, paddingVertical, schema, rootLayerKey, iconLayerKey, state, theme }) {
|
|
79
|
+
const controlHeight = rootLayerKey ? getButtonControlHeight({
|
|
80
|
+
paddingVertical,
|
|
81
|
+
schema,
|
|
82
|
+
rootLayerKey,
|
|
83
|
+
iconLayerKey,
|
|
84
|
+
state,
|
|
85
|
+
theme
|
|
86
|
+
}) : getIconButtonControlHeight({
|
|
87
|
+
paddingVertical,
|
|
88
|
+
schema,
|
|
89
|
+
iconLayerKey,
|
|
90
|
+
state,
|
|
91
|
+
theme
|
|
92
|
+
});
|
|
93
|
+
if (controlHeight) {
|
|
94
|
+
cssDeclarations[BUTTON_CONTROL_HEIGHT_VAR] = controlHeight;
|
|
95
|
+
cssDeclarations.height = `var(${BUTTON_CONTROL_HEIGHT_VAR})`;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function applyIconButtonSquareDimensions(cssDeclarations) {
|
|
99
|
+
if (cssDeclarations[BUTTON_CONTROL_HEIGHT_VAR]) cssDeclarations.width = `var(${BUTTON_CONTROL_HEIGHT_VAR})`;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* IconButton height for xs–lg mirrors Button (padding + max(icon, line-height)).
|
|
103
|
+
* xl uses icon-only height from IconButton tokens.
|
|
104
|
+
*/
|
|
105
|
+
function applyIconButtonControlHeightDeclarations({ cssDeclarations, paddingVertical, iconButtonSchema, buttonHeightReferenceSchema, variantValue, iconLayerKey: _iconLayerKey, state, theme }) {
|
|
106
|
+
if (buttonHeightReferenceSchema && SHARED_BUTTON_ICONBUTTON_SIZES.has(variantValue) && isIconButtonMatchButtonHeightEnabled(iconButtonSchema, variantValue)) {
|
|
107
|
+
const buttonRootLayerKey = `size/${variantValue}/root`;
|
|
108
|
+
const buttonIconLayerKey = `size/${variantValue}/icon`;
|
|
109
|
+
const buttonSpacingValue = buttonHeightReferenceSchema.variables?.[buttonRootLayerKey]?.spacingVertical?.[state]?.value;
|
|
110
|
+
applyButtonControlHeightDeclarations({
|
|
111
|
+
cssDeclarations,
|
|
112
|
+
paddingVertical: typeof buttonSpacingValue === "string" && buttonSpacingValue ? theme(configurableProperties.spacingVertical.twThemePath("spacingAliases", buttonSpacingValue)) : paddingVertical,
|
|
113
|
+
schema: buttonHeightReferenceSchema,
|
|
114
|
+
rootLayerKey: buttonRootLayerKey,
|
|
115
|
+
iconLayerKey: buttonIconLayerKey,
|
|
116
|
+
state,
|
|
117
|
+
theme
|
|
118
|
+
});
|
|
119
|
+
applyIconButtonSquareDimensions(cssDeclarations);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
export { SHARED_BUTTON_ICONBUTTON_SIZES, applyButtonControlHeightDeclarations, applyIconButtonControlHeightDeclarations, getButtonContentLineHeight };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
const require_getButtonControlHeight = require("./getButtonControlHeight.cjs");
|
|
3
|
+
//#region ../tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.js
|
|
4
|
+
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
5
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
6
|
+
function asMatchButtonHeightConfig(config) {
|
|
7
|
+
return config;
|
|
8
|
+
}
|
|
9
|
+
function getMatchButtonHeightMap(config) {
|
|
10
|
+
return config.iconButton?.matchButtonHeight ?? config.matchButtonHeight;
|
|
11
|
+
}
|
|
12
|
+
function isMatchButtonHeightSize(size) {
|
|
13
|
+
return require_getButtonControlHeight.SHARED_BUTTON_ICONBUTTON_SIZES.has(size);
|
|
14
|
+
}
|
|
15
|
+
function isIconButtonMatchButtonHeightEnabled(config, size) {
|
|
16
|
+
if (!isMatchButtonHeightSize(size)) return false;
|
|
17
|
+
return getMatchButtonHeightMap(asMatchButtonHeightConfig(config))?.[size] === true;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.isIconButtonMatchButtonHeightEnabled = isIconButtonMatchButtonHeightEnabled;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { SHARED_BUTTON_ICONBUTTON_SIZES } from "./getButtonControlHeight.js";
|
|
3
|
+
//#region ../tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.js
|
|
4
|
+
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
5
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
6
|
+
function asMatchButtonHeightConfig(config) {
|
|
7
|
+
return config;
|
|
8
|
+
}
|
|
9
|
+
function getMatchButtonHeightMap(config) {
|
|
10
|
+
return config.iconButton?.matchButtonHeight ?? config.matchButtonHeight;
|
|
11
|
+
}
|
|
12
|
+
function isMatchButtonHeightSize(size) {
|
|
13
|
+
return SHARED_BUTTON_ICONBUTTON_SIZES.has(size);
|
|
14
|
+
}
|
|
15
|
+
function isIconButtonMatchButtonHeightEnabled(config, size) {
|
|
16
|
+
if (!isMatchButtonHeightSize(size)) return false;
|
|
17
|
+
return getMatchButtonHeightMap(asMatchButtonHeightConfig(config))?.[size] === true;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { isIconButtonMatchButtonHeightEnabled };
|
|
@@ -10,6 +10,7 @@ const require_resolvePropertyStates = require("./resolvePropertyStates.cjs");
|
|
|
10
10
|
const require_variantConfigGuards = require("./variantConfigGuards.cjs");
|
|
11
11
|
const require_buildConfigSchema = require("./buildConfigSchema.cjs");
|
|
12
12
|
const require_generateDefaultClassName = require("./generateDefaultClassName.cjs");
|
|
13
|
+
const require_getButtonControlHeight = require("./getButtonControlHeight.cjs");
|
|
13
14
|
const require_pseudoStateSelectors = require("./pseudoStateSelectors.cjs");
|
|
14
15
|
const require_resolveSlotByCascade = require("./resolveSlotByCascade.cjs");
|
|
15
16
|
let lodash_es = require("lodash-es");
|
|
@@ -75,7 +76,8 @@ const COMPONENTS_WITH_SHADOW_BORDERS = [
|
|
|
75
76
|
const LEGACY_STATE_KEYS = [
|
|
76
77
|
"disabled",
|
|
77
78
|
"focused",
|
|
78
|
-
"focused-keyboard"
|
|
79
|
+
"focused-keyboard",
|
|
80
|
+
"selected"
|
|
79
81
|
];
|
|
80
82
|
/**
|
|
81
83
|
* Enumerates every canonical state key the system supports: rest, every atom,
|
|
@@ -116,15 +118,9 @@ function buildStateRecord(transform) {
|
|
|
116
118
|
}
|
|
117
119
|
buildStateRecord(require_pseudoStateSelectors.getStateDocsClass);
|
|
118
120
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* @returns Enhanced line-height CSS value with max(), or original value if icon size unavailable
|
|
121
|
+
* Layout line-height for button root: icon size only (not textVariant line-height).
|
|
122
|
+
* @see getButtonContentLineHeight
|
|
122
123
|
*/
|
|
123
|
-
function getButtonLineHeightWithIconMinimum({ lineHeight, schema, iconLayerKey, state, theme }) {
|
|
124
|
-
const iconSizeValue = schema.variables?.[iconLayerKey]?.size?.[state]?.value;
|
|
125
|
-
if (iconSizeValue) return `max(${lineHeight}, ${theme(require_properties.configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue))})`;
|
|
126
|
-
return lineHeight;
|
|
127
|
-
}
|
|
128
124
|
/**
|
|
129
125
|
* Shared pagination control content size: max(icon size, text line-height).
|
|
130
126
|
* Keeps page numbers and prev/next icons vertically centered when typography exceeds icon height.
|
|
@@ -245,6 +241,14 @@ function generateClassName({ componentName, subComponentName, variantKey, varian
|
|
|
245
241
|
if (layerOptionalPseudoSelector) className = `${className}${layerOptionalPseudoSelector}`;
|
|
246
242
|
return className.replaceAll(/\s+/g, "-");
|
|
247
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Select triggers carry `uds-ring-shadow` and draw focus via the focus-ring tokens.
|
|
246
|
+
* Input wrappers still use `focus-within` border styling, so exclude `.uds-ring` and
|
|
247
|
+
* `.uds-select-field-trigger` descendants from those rules.
|
|
248
|
+
*/
|
|
249
|
+
function getLayerClassSelector(layer, className, componentName, propertyStateSelector) {
|
|
250
|
+
return componentName === "input" && (layer === "inputWrapperDynamic" || layer === "inputWrapper") && propertyStateSelector.includes("focus-within") ? `.${className}:not(.uds-ring):not(.uds-select-field-trigger)` : `.${className}`;
|
|
251
|
+
}
|
|
248
252
|
const getTheCssPropertyValue = (schema, theme, propertyName, schemaStateValue, existingValue, originalPropertyDefinition) => {
|
|
249
253
|
const { value, type } = schemaStateValue;
|
|
250
254
|
const propertyConfig = require_properties.configurableProperties[propertyName];
|
|
@@ -306,8 +310,16 @@ function selectiveEmittedStates(stateMap, orderedStateKeys, emittableStates) {
|
|
|
306
310
|
}
|
|
307
311
|
return emitted;
|
|
308
312
|
}
|
|
309
|
-
function generateDeclaration({ componentName, subComponentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, componentStateKey, componentStateValue, schema, propertyKey, originalPropertyDefinition, declaredStates, layerUsesAtomicStates, theme, currentStyles, previewOptions, excludedPseudoStates = [], emit, fallbackStateMap, bumpRootSpecificity }) {
|
|
313
|
+
function generateDeclaration({ componentName, subComponentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, componentStateKey, componentStateValue, schema, propertyKey, originalPropertyDefinition, declaredStates, layerUsesAtomicStates, theme, currentStyles, previewOptions, excludedPseudoStates = [], emit, fallbackStateMap, bumpRootSpecificity, buttonHeightReferenceSchema }) {
|
|
310
314
|
const shouldUseExhaustive = (emit ?? "exhaustive") === "exhaustive" && layerUsesAtomicStates;
|
|
315
|
+
const { cssProperties: configuredCssProperties, extendedProperties: configuredExtendedGetter } = require_properties.configurableProperties[originalPropertyDefinition.name];
|
|
316
|
+
const configuredExtendedProperties = (0, lodash_es.isFunction)(configuredExtendedGetter) ? configuredExtendedGetter({
|
|
317
|
+
componentName,
|
|
318
|
+
subComponentName,
|
|
319
|
+
layer,
|
|
320
|
+
propertyKey
|
|
321
|
+
}) : configuredExtendedGetter;
|
|
322
|
+
if (!(typeof configuredCssProperties === "string" && configuredCssProperties.length > 0 || Array.isArray(configuredCssProperties) && configuredCssProperties.length > 0 || Array.isArray(configuredExtendedProperties) && configuredExtendedProperties.length > 0)) return {};
|
|
311
323
|
const schemaKey = require_generateSchemaKey.generateSchemaKey({
|
|
312
324
|
variantKey,
|
|
313
325
|
variantValue,
|
|
@@ -336,7 +348,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
336
348
|
for (const propStateStr of orderedStateKeys) {
|
|
337
349
|
if (!emittableStates.has(propStateStr)) continue;
|
|
338
350
|
const propertyState = propStateStr;
|
|
339
|
-
|
|
351
|
+
let propertyStateSelector = require_pseudoStateSelectors.getStateSelector(propertyState);
|
|
352
|
+
if (componentName === "selectitem" && propertyState === "focused") propertyStateSelector = ":is(:focus, [data-active-item])";
|
|
340
353
|
const schemaValueForState = shouldUseExhaustive || layerUsesAtomicStates ? require_resolveSlotByCascade.resolveSlotByCascade(propStateStr, resolutionStates) : propertyStateMap[propertyState];
|
|
341
354
|
if (!schemaValueForState) continue;
|
|
342
355
|
if (!shouldUseExhaustive) {
|
|
@@ -395,7 +408,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
395
408
|
layerOptionalPseudoSelector,
|
|
396
409
|
subComponentName
|
|
397
410
|
});
|
|
398
|
-
|
|
411
|
+
const layerClassSelector = getLayerClassSelector(layer, className, componentName, propertyStateSelector);
|
|
412
|
+
fullClassName = `.${rootVariantClassName}${propertyStateSelector}.${rootVariantClassNameWithComponentState} ${layerClassSelector}`;
|
|
399
413
|
} else {
|
|
400
414
|
className = generateClassName({
|
|
401
415
|
componentName,
|
|
@@ -405,7 +419,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
405
419
|
layerOptionalPseudoSelector,
|
|
406
420
|
subComponentName
|
|
407
421
|
});
|
|
408
|
-
|
|
422
|
+
const layerClassSelector = getLayerClassSelector(layer, className, componentName, propertyStateSelector);
|
|
423
|
+
fullClassName = bumpRootSpecificity ? `.${rootVariantClassName}.${rootVariantClassName}${propertyStateSelector} ${layerClassSelector}` : `.${rootVariantClassName}${propertyStateSelector} ${layerClassSelector}`;
|
|
409
424
|
}
|
|
410
425
|
}
|
|
411
426
|
const { cssProperties, extendedProperties: extendedPropertiesGetter } = require_properties.configurableProperties[originalPropertyDefinition.name];
|
|
@@ -442,6 +457,28 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
442
457
|
*/
|
|
443
458
|
if (componentName === "button" && layer === "root") {
|
|
444
459
|
if (propertyKey === CSS_GAP) cssDeclarations[require_index.BUTTON_GAP_VAR] = cssDeclarations[CSS_GAP];
|
|
460
|
+
if (propertyKey === "spacingVertical") {
|
|
461
|
+
const paddingVertical = cssDeclarations["padding-top"];
|
|
462
|
+
if (paddingVertical) require_getButtonControlHeight.applyButtonControlHeightDeclarations({
|
|
463
|
+
cssDeclarations,
|
|
464
|
+
paddingVertical,
|
|
465
|
+
schema,
|
|
466
|
+
rootLayerKey: require_generateSchemaKey.generateSchemaKey({
|
|
467
|
+
variantKey,
|
|
468
|
+
variantValue,
|
|
469
|
+
layer: "root",
|
|
470
|
+
subComponentName
|
|
471
|
+
}),
|
|
472
|
+
iconLayerKey: require_generateSchemaKey.generateSchemaKey({
|
|
473
|
+
variantKey,
|
|
474
|
+
variantValue,
|
|
475
|
+
layer: "icon",
|
|
476
|
+
subComponentName
|
|
477
|
+
}),
|
|
478
|
+
state: propertyState,
|
|
479
|
+
theme
|
|
480
|
+
});
|
|
481
|
+
}
|
|
445
482
|
if (propertyKey === "scaleEffect" && propertyState === "hover") {
|
|
446
483
|
const rootClassName = `.${className}`;
|
|
447
484
|
const renderValue = (schemaValue) => require_properties.configurableProperties.scaleEffect.customValueRenderer?.(schemaValue, schema, () => "") ?? "1";
|
|
@@ -450,17 +487,39 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
450
487
|
if (propertyStateMap.hover) styles[rootClassName][require_index.BUTTON_SCALE_EFFECT_HOVER] = renderValue(propertyStateMap.hover);
|
|
451
488
|
if (propertyStateMap.pressed) styles[rootClassName][require_index.BUTTON_SCALE_EFFECT_PRESSED] = renderValue(propertyStateMap.pressed);
|
|
452
489
|
}
|
|
453
|
-
if (cssDeclarations[CSS_LINE_HEIGHT]) {
|
|
454
|
-
|
|
490
|
+
if (cssDeclarations[CSS_LINE_HEIGHT]) cssDeclarations[CSS_LINE_HEIGHT] = require_getButtonControlHeight.getButtonContentLineHeight({
|
|
491
|
+
schema,
|
|
492
|
+
rootLayerKey: require_generateSchemaKey.generateSchemaKey({
|
|
493
|
+
variantKey,
|
|
494
|
+
variantValue,
|
|
495
|
+
layer: "root",
|
|
496
|
+
subComponentName
|
|
497
|
+
}),
|
|
498
|
+
iconLayerKey: require_generateSchemaKey.generateSchemaKey({
|
|
455
499
|
variantKey,
|
|
456
500
|
variantValue,
|
|
457
501
|
layer: "icon",
|
|
458
502
|
subComponentName
|
|
459
|
-
})
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
503
|
+
}),
|
|
504
|
+
state: propertyState,
|
|
505
|
+
theme
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
if (componentName === "iconbutton" && layer === "root") {
|
|
509
|
+
if (propertyKey === "spacing") {
|
|
510
|
+
const paddingVertical = cssDeclarations[CSS_PADDING];
|
|
511
|
+
if (paddingVertical) require_getButtonControlHeight.applyIconButtonControlHeightDeclarations({
|
|
512
|
+
cssDeclarations,
|
|
513
|
+
paddingVertical,
|
|
514
|
+
iconButtonSchema: schema,
|
|
515
|
+
buttonHeightReferenceSchema,
|
|
516
|
+
variantValue,
|
|
517
|
+
iconLayerKey: require_generateSchemaKey.generateSchemaKey({
|
|
518
|
+
variantKey,
|
|
519
|
+
variantValue,
|
|
520
|
+
layer: "icon",
|
|
521
|
+
subComponentName
|
|
522
|
+
}),
|
|
464
523
|
state: propertyState,
|
|
465
524
|
theme
|
|
466
525
|
});
|
|
@@ -502,8 +561,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
502
561
|
});
|
|
503
562
|
}
|
|
504
563
|
}
|
|
564
|
+
if (propertyKey === "borderRadius" && cssDeclarations[CSS_BORDER_RADIUS] && (componentName === "paddlenav" && layer === "root" || componentName === "input" && layer === "inputWrapperDynamic")) cssDeclarations[NESTED_BORDER_RADIUS_SIZE_VAR] = cssDeclarations[CSS_BORDER_RADIUS];
|
|
505
565
|
if (componentName === "paddlenav" && layer === "root") {
|
|
506
|
-
if (propertyKey === "borderRadius" && cssDeclarations[CSS_BORDER_RADIUS]) cssDeclarations[NESTED_BORDER_RADIUS_SIZE_VAR] = cssDeclarations[CSS_BORDER_RADIUS];
|
|
507
566
|
if (propertyKey === "borderWidth" && cssDeclarations[CSS_BORDER_WIDTH]) cssDeclarations[NESTED_BORDER_RADIUS_WIDTH_VAR] = cssDeclarations[CSS_BORDER_WIDTH];
|
|
508
567
|
}
|
|
509
568
|
if ((componentName === "tabs" || componentName === "tab") && layer === "root") {
|
|
@@ -639,7 +698,7 @@ function emitSchemaOverrideStyles({ componentName, subComponentName, variantKey,
|
|
|
639
698
|
* layers express the variant's universal baseline, with per-state overrides
|
|
640
699
|
* winning via class-compound specificity).
|
|
641
700
|
*/
|
|
642
|
-
function emitUniversalLayers({ componentName, subComponentName, variantKey, variantOption, layers, schema, theme, previewOptions, emit, currentStyles, bumpRootSpecificity }) {
|
|
701
|
+
function emitUniversalLayers({ componentName, subComponentName, variantKey, variantOption, layers, schema, theme, previewOptions, emit, currentStyles, bumpRootSpecificity, buttonHeightReferenceSchema }) {
|
|
643
702
|
let styles = currentStyles;
|
|
644
703
|
const variables = schema.variables;
|
|
645
704
|
for (const layerKey in layers) {
|
|
@@ -670,14 +729,15 @@ function emitUniversalLayers({ componentName, subComponentName, variantKey, vari
|
|
|
670
729
|
currentStyles: styles,
|
|
671
730
|
previewOptions,
|
|
672
731
|
emit,
|
|
673
|
-
bumpRootSpecificity
|
|
732
|
+
bumpRootSpecificity,
|
|
733
|
+
buttonHeightReferenceSchema
|
|
674
734
|
});
|
|
675
735
|
styles = deepMerge(styles, declarations);
|
|
676
736
|
}
|
|
677
737
|
}
|
|
678
738
|
return styles;
|
|
679
739
|
}
|
|
680
|
-
function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
740
|
+
function generateConfigStyles(config, schema, theme, previewOptions, emit, generateStylesContext) {
|
|
681
741
|
const componentName = config.label.toLowerCase();
|
|
682
742
|
let styles = {};
|
|
683
743
|
for (const variantKey in config.variants) {
|
|
@@ -693,14 +753,17 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
693
753
|
previewOptions,
|
|
694
754
|
emit,
|
|
695
755
|
currentStyles: styles,
|
|
696
|
-
bumpRootSpecificity: true
|
|
756
|
+
bumpRootSpecificity: true,
|
|
757
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
697
758
|
});
|
|
698
759
|
const componentStates = variantConfig.componentStates;
|
|
699
760
|
for (const componentStateKey in componentStates) {
|
|
700
761
|
const componentState = componentStates[componentStateKey];
|
|
701
762
|
for (const componentStateOption of componentState.options) {
|
|
702
763
|
const excludedPseudoStates = require_componentStatePseudoStates.getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption);
|
|
764
|
+
const excludedLayers = new Set(require_componentStatePseudoStates.getExcludedLayersForComponentStateOption(componentState, componentStateOption));
|
|
703
765
|
for (const layerKey in componentState.layers) {
|
|
766
|
+
if (excludedLayers.has(layerKey)) continue;
|
|
704
767
|
const layer = componentState.layers[layerKey];
|
|
705
768
|
for (const propertyKey in layer.properties) {
|
|
706
769
|
const originalPropertyDefinition = layer.properties[propertyKey];
|
|
@@ -721,7 +784,8 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
721
784
|
currentStyles: styles,
|
|
722
785
|
previewOptions,
|
|
723
786
|
excludedPseudoStates,
|
|
724
|
-
emit
|
|
787
|
+
emit,
|
|
788
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
725
789
|
});
|
|
726
790
|
styles = deepMerge(styles, declarations);
|
|
727
791
|
}
|
|
@@ -748,7 +812,8 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
748
812
|
theme,
|
|
749
813
|
previewOptions,
|
|
750
814
|
emit,
|
|
751
|
-
currentStyles: styles
|
|
815
|
+
currentStyles: styles,
|
|
816
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
752
817
|
});
|
|
753
818
|
}
|
|
754
819
|
if (config.subComponents) {
|
|
@@ -767,14 +832,17 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
767
832
|
previewOptions,
|
|
768
833
|
emit,
|
|
769
834
|
currentStyles: styles,
|
|
770
|
-
bumpRootSpecificity: true
|
|
835
|
+
bumpRootSpecificity: true,
|
|
836
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
771
837
|
});
|
|
772
838
|
const componentStates = variantConfig.componentStates;
|
|
773
839
|
for (const componentStateKey in componentStates) {
|
|
774
840
|
const componentState = componentStates[componentStateKey];
|
|
775
841
|
for (const componentStateOption of componentState.options) {
|
|
776
842
|
const excludedPseudoStates = require_componentStatePseudoStates.getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption);
|
|
843
|
+
const excludedLayers = new Set(require_componentStatePseudoStates.getExcludedLayersForComponentStateOption(componentState, componentStateOption));
|
|
777
844
|
for (const layerKey in componentState.layers) {
|
|
845
|
+
if (excludedLayers.has(layerKey)) continue;
|
|
778
846
|
const layer = componentState.layers[layerKey];
|
|
779
847
|
for (const propertyKey in layer.properties) {
|
|
780
848
|
const originalPropertyDefinition = layer.properties[propertyKey];
|
|
@@ -796,7 +864,8 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
796
864
|
currentStyles: styles,
|
|
797
865
|
previewOptions,
|
|
798
866
|
excludedPseudoStates,
|
|
799
|
-
emit
|
|
867
|
+
emit,
|
|
868
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
800
869
|
});
|
|
801
870
|
styles = deepMerge(styles, declarations);
|
|
802
871
|
}
|
|
@@ -825,7 +894,8 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
825
894
|
theme,
|
|
826
895
|
previewOptions,
|
|
827
896
|
emit,
|
|
828
|
-
currentStyles: styles
|
|
897
|
+
currentStyles: styles,
|
|
898
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
829
899
|
});
|
|
830
900
|
}
|
|
831
901
|
}
|
|
@@ -859,8 +929,8 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
859
929
|
* @param previewOptions - Options for generating preview mode class modifiers
|
|
860
930
|
* @returns CSS styles object with grouped selectors for default aliases
|
|
861
931
|
*/
|
|
862
|
-
const generateStylesInner = (config, schema, theme, previewOptions) => {
|
|
863
|
-
const styles = generateConfigStyles(config, schema, theme, previewOptions, previewOptions.emit ?? "exhaustive");
|
|
932
|
+
const generateStylesInner = (config, schema, theme, previewOptions, generateStylesContext) => {
|
|
933
|
+
const styles = generateConfigStyles(config, schema, theme, previewOptions, previewOptions.emit ?? "exhaustive", generateStylesContext);
|
|
864
934
|
if (!config.variants && !config.subComponents) return styles;
|
|
865
935
|
const componentName = config.label.toLowerCase();
|
|
866
936
|
if (componentName !== "button" && componentName !== "iconbutton") return styles;
|
|
@@ -941,6 +1011,6 @@ const generateStylesInner = (config, schema, theme, previewOptions) => {
|
|
|
941
1011
|
* list, so minifiers leave their specificity intact. (gzip already collapses the
|
|
942
1012
|
* repeated declaration blocks, so the shipped-size cost is minimal.)
|
|
943
1013
|
*/
|
|
944
|
-
const generateStyles = (config, schema, theme, previewOptions) => generateStylesInner(config, schema, theme, previewOptions);
|
|
1014
|
+
const generateStyles = (config, schema, theme, previewOptions, generateStylesContext) => generateStylesInner(config, schema, theme, previewOptions, generateStylesContext);
|
|
945
1015
|
//#endregion
|
|
946
1016
|
exports.generateStyles = generateStyles;
|