@yahoo/uds 3.156.2 → 3.157.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automated-config/dist/generated/autoVariants.cjs +9 -4
- package/dist/automated-config/dist/generated/autoVariants.d.cts +2 -1
- package/dist/automated-config/dist/generated/autoVariants.d.ts +2 -1
- package/dist/automated-config/dist/generated/autoVariants.js +9 -4
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +3078 -3089
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +158 -141
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +158 -141
- package/dist/automated-config/dist/generated/generatedConfigs.js +3078 -3089
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +1217 -491
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +4 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +4 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +1217 -491
- package/dist/automated-config/dist/properties.cjs +9 -2
- package/dist/automated-config/dist/properties.d.cts +23 -0
- package/dist/automated-config/dist/properties.d.ts +23 -0
- package/dist/automated-config/dist/properties.js +9 -2
- package/dist/automated-config/dist/types/ComponentConfig.d.cts +77 -4
- package/dist/automated-config/dist/types/ComponentConfig.d.ts +77 -4
- package/dist/automated-config/dist/types/ConfigSchema.d.cts +14 -2
- package/dist/automated-config/dist/types/ConfigSchema.d.ts +14 -2
- package/dist/automated-config/dist/types/StateAxis.cjs +90 -0
- package/dist/automated-config/dist/types/StateAxis.d.cts +70 -0
- package/dist/automated-config/dist/types/StateAxis.d.ts +70 -0
- package/dist/automated-config/dist/types/StateAxis.js +84 -0
- package/dist/automated-config/dist/utils/buildConfigSchema.cjs +105 -82
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +41 -12
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +41 -12
- package/dist/automated-config/dist/utils/buildConfigSchema.js +106 -83
- package/dist/automated-config/dist/utils/canonicalizeStateKey.cjs +32 -0
- package/dist/automated-config/dist/utils/canonicalizeStateKey.d.cts +48 -0
- package/dist/automated-config/dist/utils/canonicalizeStateKey.d.ts +48 -0
- package/dist/automated-config/dist/utils/canonicalizeStateKey.js +31 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.cjs +129 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.d.cts +133 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.d.ts +133 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.js +122 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.cjs +114 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.d.cts +78 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.d.ts +78 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.js +108 -0
- package/dist/automated-config/dist/utils/getConfigComponentVariant.d.cts +8 -0
- package/dist/automated-config/dist/utils/getConfigComponentVariant.d.ts +8 -0
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +3 -3
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +3 -3
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.cjs +12 -5
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.d.cts +8 -1
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.d.ts +8 -1
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.js +12 -5
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.cjs +110 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.d.cts +19 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.d.ts +19 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.js +108 -0
- package/dist/automated-config/dist/utils/index.cjs +478 -111
- package/dist/automated-config/dist/utils/index.d.cts +76 -15
- package/dist/automated-config/dist/utils/index.d.ts +76 -15
- package/dist/automated-config/dist/utils/index.js +479 -113
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.cjs +15 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.d.cts +20 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.d.ts +20 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.js +15 -0
- package/dist/automated-config/dist/utils/pseudoStateSelectors.cjs +122 -0
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.cts +80 -0
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.ts +80 -0
- package/dist/automated-config/dist/utils/pseudoStateSelectors.js +120 -0
- package/dist/automated-config/dist/utils/resolvePropertyStates.cjs +131 -0
- package/dist/automated-config/dist/utils/resolvePropertyStates.d.cts +49 -0
- package/dist/automated-config/dist/utils/resolvePropertyStates.d.ts +49 -0
- package/dist/automated-config/dist/utils/resolvePropertyStates.js +130 -0
- package/dist/automated-config/dist/utils/resolveSlotByCascade.cjs +118 -0
- package/dist/automated-config/dist/utils/resolveSlotByCascade.d.cts +68 -0
- package/dist/automated-config/dist/utils/resolveSlotByCascade.d.ts +68 -0
- package/dist/automated-config/dist/utils/resolveSlotByCascade.js +117 -0
- package/dist/automated-config/dist/utils/variantConfigGuards.d.cts +13 -0
- package/dist/automated-config/dist/utils/variantConfigGuards.d.ts +13 -0
- package/dist/components/client/Button.cjs +3 -3
- package/dist/components/client/Button.js +3 -3
- package/dist/components/client/Input/Input.cjs +42 -6
- package/dist/components/client/Input/Input.d.cts +13 -0
- package/dist/components/client/Input/Input.d.ts +13 -0
- package/dist/components/client/Input/Input.js +42 -6
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
- package/dist/config/dist/index.cjs +224 -553
- package/dist/config/dist/index.js +224 -553
- package/dist/css/dist/commands/css.cjs +1 -0
- package/dist/css/dist/commands/css.helpers.cjs +6 -0
- package/dist/css/dist/commands/css.helpers.js +6 -0
- package/dist/css/dist/commands/css.js +1 -0
- package/dist/css/dist/css/generate.cjs +4 -2
- package/dist/css/dist/css/generate.d.cts +28 -0
- package/dist/css/dist/css/generate.d.ts +28 -0
- package/dist/css/dist/css/generate.helpers.cjs +5 -1
- package/dist/css/dist/css/generate.helpers.js +6 -2
- package/dist/css/dist/css/generate.js +4 -2
- package/dist/css/dist/css/postcss.cjs +81 -0
- package/dist/css/dist/css/postcss.helpers.cjs +60 -0
- package/dist/css/dist/css/postcss.helpers.js +59 -1
- package/dist/css/dist/css/postcss.js +82 -2
- package/dist/css/dist/css/runner.cjs +12 -2
- package/dist/css/dist/css/runner.js +12 -2
- package/dist/css/dist/css/theme.d.cts +6 -0
- package/dist/css/dist/css/theme.d.ts +6 -0
- package/dist/css/dist/packages/automated-config/dist/properties.cjs +9 -2
- package/dist/css/dist/packages/automated-config/dist/properties.js +9 -2
- package/dist/css/dist/packages/automated-config/dist/utils/index.d.cts +6 -0
- package/dist/css/dist/packages/automated-config/dist/utils/index.d.ts +6 -0
- package/dist/css/dist/packages/config/dist/index.cjs +224 -553
- package/dist/css/dist/packages/config/dist/index.js +224 -553
- package/dist/css/dist/utils/optimizeCSS.cjs +59 -0
- package/dist/css/dist/utils/optimizeCSS.js +59 -0
- package/dist/css-tokens/dist/index.cjs +2 -0
- package/dist/css-tokens/dist/index.d.cts +2 -1
- package/dist/css-tokens/dist/index.d.ts +2 -1
- package/dist/css-tokens/dist/index.js +2 -1
- package/dist/index.cjs +48 -0
- package/dist/index.d.cts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +14 -3
- package/dist/styles/styler.d.cts +8 -7
- package/dist/styles/styler.d.ts +8 -7
- package/dist/styles/variants.d.cts +9 -4
- package/dist/styles/variants.d.ts +9 -4
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.cjs +3078 -3089
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +3078 -3089
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.cjs +9 -2
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.js +9 -2
- package/dist/tailwind-internal/dist/packages/automated-config/dist/types/StateAxis.cjs +81 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/types/StateAxis.js +76 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/canonicalizeStateKey.cjs +33 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/canonicalizeStateKey.js +32 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.cjs +0 -7
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.js +1 -7
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.cjs +126 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.js +123 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.cjs +20 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.js +20 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +422 -111
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.d.cts +6 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.d.ts +6 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +423 -112
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.cjs +122 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.js +121 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/resolvePropertyStates.cjs +132 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/resolvePropertyStates.js +131 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/resolveSlotByCascade.cjs +95 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/resolveSlotByCascade.js +95 -0
- package/dist/tailwind-internal/dist/packages/config/dist/index.cjs +224 -553
- package/dist/tailwind-internal/dist/packages/config/dist/index.js +224 -553
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.cjs +2 -0
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.js +2 -1
- package/dist/tailwind-internal/dist/plugins/components.cjs +28 -24
- package/dist/tailwind-internal/dist/plugins/components.js +28 -24
- package/dist/tailwind-internal/dist/utils/composeTailwindPlugins.d.cts +3 -0
- package/dist/tailwind-internal/dist/utils/composeTailwindPlugins.d.ts +3 -0
- package/dist/tailwind-internal/dist/utils/getShadowStyles.d.cts +2 -2
- package/dist/tailwind-internal/dist/utils/getShadowStyles.d.ts +2 -2
- package/dist/tokens/automation/index.cjs +47 -0
- package/dist/tokens/automation/index.d.cts +13 -2
- package/dist/tokens/automation/index.d.ts +13 -2
- package/dist/tokens/automation/index.js +13 -2
- package/dist/tokens/consts/cssTokens.cjs +1 -0
- package/dist/tokens/consts/cssTokens.d.cts +2 -2
- package/dist/tokens/consts/cssTokens.d.ts +2 -2
- package/dist/tokens/consts/cssTokens.js +2 -2
- package/dist/tokens/index.cjs +48 -0
- package/dist/tokens/index.d.cts +15 -4
- package/dist/tokens/index.d.ts +15 -4
- package/dist/tokens/index.js +14 -3
- package/dist/tokens/types.d.cts +1 -1
- package/dist/tokens/types.d.ts +1 -1
- package/dist/uds/generated/componentData.cjs +2177 -2172
- package/dist/uds/generated/componentData.js +2177 -2172
- package/dist/uds/generated/migrationSchemaVersion.cjs +1 -1
- package/dist/uds/generated/migrationSchemaVersion.js +1 -1
- package/dist/uds/generated/tailwindPurge.cjs +79 -78
- package/dist/uds/generated/tailwindPurge.js +79 -78
- package/generated/componentData.json +2718 -2713
- package/generated/migrationSchemaVersion.ts +1 -1
- package/generated/tailwindPurge.ts +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { VariantConfig } from "../types/ComponentConfig.cjs";
|
|
3
2
|
import { SelectedConfigurableProperty } from "../properties.cjs";
|
|
3
|
+
import { VariantConfig } from "../types/ComponentConfig.cjs";
|
|
4
4
|
|
|
5
5
|
//#region ../automated-config/dist/utils/getConfigVariantProperties.d.ts
|
|
6
6
|
//#region src/utils/getConfigVariantProperties.d.ts
|
|
@@ -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<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar", 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 "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
-
root: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar", 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 "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
14
|
+
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar" | "controlHeight", 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 "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar" | "controlHeight", 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 "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { VariantConfig } from "../types/ComponentConfig.js";
|
|
3
2
|
import { SelectedConfigurableProperty } from "../properties.js";
|
|
3
|
+
import { VariantConfig } from "../types/ComponentConfig.js";
|
|
4
4
|
|
|
5
5
|
//#region ../automated-config/dist/utils/getConfigVariantProperties.d.ts
|
|
6
6
|
//#region src/utils/getConfigVariantProperties.d.ts
|
|
@@ -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<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar", 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 "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
-
root: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar", 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 "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
14
|
+
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar" | "controlHeight", 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 "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar" | "controlHeight", 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 "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
const require_componentStatePseudoStates = require("./componentStatePseudoStates.cjs");
|
|
3
|
+
const require_resolvePropertyStates = require("./resolvePropertyStates.cjs");
|
|
3
4
|
const require_variantConfigGuards = require("./variantConfigGuards.cjs");
|
|
4
5
|
const require_getConfigComponentVariant = require("./getConfigComponentVariant.cjs");
|
|
5
6
|
//#region ../automated-config/dist/utils/getConfigVariantPseudoStates.js
|
|
6
7
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Returns a map of state key → reactive properties for a variant. The state
|
|
10
|
+
* set comes from `resolvePropertyStates` — rest, atoms, and auto-generated
|
|
11
|
+
* compounds (modifier × interactive, modifier × modifier × interactive,
|
|
12
|
+
* etc.). The Configurator's StateBuilder caps user composition at the same
|
|
13
|
+
* depth, so every selectable state is in this map.
|
|
14
|
+
*/
|
|
8
15
|
function getConfigVariantPseudoStates(config, variantKey, state, subComponentName, componentStateValue) {
|
|
9
16
|
const componentVariant = require_getConfigComponentVariant.getConfigComponentVariant(config, variantKey, subComponentName);
|
|
10
17
|
if (!componentVariant) return null;
|
|
@@ -13,21 +20,21 @@ function getConfigVariantPseudoStates(config, variantKey, state, subComponentNam
|
|
|
13
20
|
const stateLayers = require_variantConfigGuards.isVariantConfigWithComponentStates(componentVariant) && state ? Object.entries(componentVariant.componentStates[state].layers ?? {}) : [];
|
|
14
21
|
return [...variantLayers, ...stateLayers].flatMap(([layerKey, layer]) => Object.entries(layer.properties).map(([propertyKey, property]) => [
|
|
15
22
|
layerKey,
|
|
23
|
+
layer,
|
|
16
24
|
propertyKey,
|
|
17
25
|
property
|
|
18
|
-
])).flatMap(([layerKey, propertyKey, property]) =>
|
|
26
|
+
])).flatMap(([layerKey, layer, propertyKey, property]) => require_componentStatePseudoStates.filterPseudoStatesByExclusion(require_resolvePropertyStates.resolvePropertyStates(layer, property), excludedPseudoStates).map((pseudoState) => [
|
|
19
27
|
layerKey,
|
|
20
28
|
propertyKey,
|
|
21
29
|
property,
|
|
22
30
|
pseudoState
|
|
23
31
|
])).reduce((acc, [layerKey, propertyKey, property, pseudoState]) => {
|
|
24
32
|
acc[pseudoState] = acc[pseudoState] ?? [];
|
|
25
|
-
|
|
33
|
+
acc[pseudoState].push([
|
|
26
34
|
layerKey,
|
|
27
35
|
propertyKey,
|
|
28
36
|
property
|
|
29
|
-
];
|
|
30
|
-
acc[pseudoState].push(info);
|
|
37
|
+
]);
|
|
31
38
|
return acc;
|
|
32
39
|
}, {});
|
|
33
40
|
}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import { ComponentConfig, PossibleStatesWithRest } from "../types/ComponentConfig.cjs";
|
|
3
2
|
import { SelectedConfigurableProperty } from "../properties.cjs";
|
|
3
|
+
import { ComponentConfig, PossibleStatesWithRest } from "../types/ComponentConfig.cjs";
|
|
4
4
|
|
|
5
5
|
//#region ../automated-config/dist/utils/getConfigVariantPseudoStates.d.ts
|
|
6
6
|
//#region src/utils/getConfigVariantPseudoStates.d.ts
|
|
7
7
|
type GenericProperty = SelectedConfigurableProperty<any, any>;
|
|
8
8
|
type InfoTuple = [string, string, GenericProperty];
|
|
9
|
+
/**
|
|
10
|
+
* Returns a map of state key → reactive properties for a variant. The state
|
|
11
|
+
* set comes from `resolvePropertyStates` — rest, atoms, and auto-generated
|
|
12
|
+
* compounds (modifier × interactive, modifier × modifier × interactive,
|
|
13
|
+
* etc.). The Configurator's StateBuilder caps user composition at the same
|
|
14
|
+
* depth, so every selectable state is in this map.
|
|
15
|
+
*/
|
|
9
16
|
declare function getConfigVariantPseudoStates<C extends ComponentConfig>(config: C, variantKey: string, state?: string, subComponentName?: string, componentStateValue?: string): Record<PossibleStatesWithRest, InfoTuple[]> | null; //#endregion
|
|
10
17
|
//#endregion
|
|
11
18
|
export { getConfigVariantPseudoStates };
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import { ComponentConfig, PossibleStatesWithRest } from "../types/ComponentConfig.js";
|
|
3
2
|
import { SelectedConfigurableProperty } from "../properties.js";
|
|
3
|
+
import { ComponentConfig, PossibleStatesWithRest } from "../types/ComponentConfig.js";
|
|
4
4
|
|
|
5
5
|
//#region ../automated-config/dist/utils/getConfigVariantPseudoStates.d.ts
|
|
6
6
|
//#region src/utils/getConfigVariantPseudoStates.d.ts
|
|
7
7
|
type GenericProperty = SelectedConfigurableProperty<any, any>;
|
|
8
8
|
type InfoTuple = [string, string, GenericProperty];
|
|
9
|
+
/**
|
|
10
|
+
* Returns a map of state key → reactive properties for a variant. The state
|
|
11
|
+
* set comes from `resolvePropertyStates` — rest, atoms, and auto-generated
|
|
12
|
+
* compounds (modifier × interactive, modifier × modifier × interactive,
|
|
13
|
+
* etc.). The Configurator's StateBuilder caps user composition at the same
|
|
14
|
+
* depth, so every selectable state is in this map.
|
|
15
|
+
*/
|
|
9
16
|
declare function getConfigVariantPseudoStates<C extends ComponentConfig>(config: C, variantKey: string, state?: string, subComponentName?: string, componentStateValue?: string): Record<PossibleStatesWithRest, InfoTuple[]> | null; //#endregion
|
|
10
17
|
//#endregion
|
|
11
18
|
export { getConfigVariantPseudoStates };
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { filterPseudoStatesByExclusion, getExcludedPseudoStatesForComponentStateOption } from "./componentStatePseudoStates.js";
|
|
3
|
+
import { resolvePropertyStates } from "./resolvePropertyStates.js";
|
|
3
4
|
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.js";
|
|
4
5
|
import { getConfigComponentVariant } from "./getConfigComponentVariant.js";
|
|
5
6
|
//#region ../automated-config/dist/utils/getConfigVariantPseudoStates.js
|
|
6
7
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Returns a map of state key → reactive properties for a variant. The state
|
|
10
|
+
* set comes from `resolvePropertyStates` — rest, atoms, and auto-generated
|
|
11
|
+
* compounds (modifier × interactive, modifier × modifier × interactive,
|
|
12
|
+
* etc.). The Configurator's StateBuilder caps user composition at the same
|
|
13
|
+
* depth, so every selectable state is in this map.
|
|
14
|
+
*/
|
|
8
15
|
function getConfigVariantPseudoStates(config, variantKey, state, subComponentName, componentStateValue) {
|
|
9
16
|
const componentVariant = getConfigComponentVariant(config, variantKey, subComponentName);
|
|
10
17
|
if (!componentVariant) return null;
|
|
@@ -13,21 +20,21 @@ function getConfigVariantPseudoStates(config, variantKey, state, subComponentNam
|
|
|
13
20
|
const stateLayers = isVariantConfigWithComponentStates(componentVariant) && state ? Object.entries(componentVariant.componentStates[state].layers ?? {}) : [];
|
|
14
21
|
return [...variantLayers, ...stateLayers].flatMap(([layerKey, layer]) => Object.entries(layer.properties).map(([propertyKey, property]) => [
|
|
15
22
|
layerKey,
|
|
23
|
+
layer,
|
|
16
24
|
propertyKey,
|
|
17
25
|
property
|
|
18
|
-
])).flatMap(([layerKey, propertyKey, property]) =>
|
|
26
|
+
])).flatMap(([layerKey, layer, propertyKey, property]) => filterPseudoStatesByExclusion(resolvePropertyStates(layer, property), excludedPseudoStates).map((pseudoState) => [
|
|
19
27
|
layerKey,
|
|
20
28
|
propertyKey,
|
|
21
29
|
property,
|
|
22
30
|
pseudoState
|
|
23
31
|
])).reduce((acc, [layerKey, propertyKey, property, pseudoState]) => {
|
|
24
32
|
acc[pseudoState] = acc[pseudoState] ?? [];
|
|
25
|
-
|
|
33
|
+
acc[pseudoState].push([
|
|
26
34
|
layerKey,
|
|
27
35
|
propertyKey,
|
|
28
36
|
property
|
|
29
|
-
];
|
|
30
|
-
acc[pseudoState].push(info);
|
|
37
|
+
]);
|
|
31
38
|
return acc;
|
|
32
39
|
}, {});
|
|
33
40
|
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
const require_getButtonControlHeight = require("./getButtonControlHeight.cjs");
|
|
3
|
+
const require_getButtonControlHeightPx = require("./getButtonControlHeightPx.cjs");
|
|
4
|
+
//#region ../automated-config/dist/utils/iconButtonMatchButtonHeight.js
|
|
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 getIconButtonVariables(config) {
|
|
13
|
+
return config.iconButton?.variables ?? config.variables;
|
|
14
|
+
}
|
|
15
|
+
function isMatchButtonHeightSize(size) {
|
|
16
|
+
return require_getButtonControlHeight.SHARED_BUTTON_ICONBUTTON_SIZES.has(size);
|
|
17
|
+
}
|
|
18
|
+
function isIconButtonMatchButtonHeightEnabled(config, size) {
|
|
19
|
+
if (!isMatchButtonHeightSize(size)) return false;
|
|
20
|
+
return getMatchButtonHeightMap(asMatchButtonHeightConfig(config))?.[size] === true;
|
|
21
|
+
}
|
|
22
|
+
function getIconButtonSpacingRestValue(config, size) {
|
|
23
|
+
const rootKey = `size/${size}/root`;
|
|
24
|
+
const value = (getIconButtonVariables(config)?.[rootKey]?.spacing)?.rest?.value;
|
|
25
|
+
return typeof value === "string" ? value : void 0;
|
|
26
|
+
}
|
|
27
|
+
function setIconButtonSpacingRestValue(config, size, spacing) {
|
|
28
|
+
const matchConfig = asMatchButtonHeightConfig(config);
|
|
29
|
+
const rootKey = `size/${size}/root`;
|
|
30
|
+
const iconButton = matchConfig.iconButton ?? { variables: {} };
|
|
31
|
+
const existingRoot = iconButton.variables?.[rootKey] ?? {};
|
|
32
|
+
return {
|
|
33
|
+
...config,
|
|
34
|
+
iconButton: {
|
|
35
|
+
...iconButton,
|
|
36
|
+
variables: {
|
|
37
|
+
...iconButton.variables,
|
|
38
|
+
[rootKey]: {
|
|
39
|
+
...existingRoot,
|
|
40
|
+
spacing: { rest: {
|
|
41
|
+
type: "spacingAliases",
|
|
42
|
+
value: spacing,
|
|
43
|
+
valueType: "alias"
|
|
44
|
+
} }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function removeIconButtonControlHeight(config, size) {
|
|
51
|
+
const matchConfig = asMatchButtonHeightConfig(config);
|
|
52
|
+
const rootKey = `size/${size}/root`;
|
|
53
|
+
const iconButton = matchConfig.iconButton;
|
|
54
|
+
const rootLayer = iconButton?.variables?.[rootKey];
|
|
55
|
+
if (!rootLayer?.controlHeight) return config;
|
|
56
|
+
const { controlHeight: _, ...restRoot } = rootLayer;
|
|
57
|
+
return {
|
|
58
|
+
...config,
|
|
59
|
+
iconButton: {
|
|
60
|
+
...iconButton,
|
|
61
|
+
variables: {
|
|
62
|
+
...iconButton?.variables,
|
|
63
|
+
[rootKey]: restRoot
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function enableIconButtonMatchButtonHeight(config, size) {
|
|
69
|
+
const matchConfig = asMatchButtonHeightConfig(config);
|
|
70
|
+
const currentSpacing = getIconButtonSpacingRestValue(matchConfig, size);
|
|
71
|
+
const iconButton = {
|
|
72
|
+
...matchConfig.iconButton,
|
|
73
|
+
matchButtonHeight: {
|
|
74
|
+
...matchConfig.iconButton?.matchButtonHeight,
|
|
75
|
+
[size]: true
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
if (currentSpacing !== void 0) iconButton.spacingBeforeMatchButtonHeight = {
|
|
79
|
+
...matchConfig.iconButton?.spacingBeforeMatchButtonHeight,
|
|
80
|
+
[size]: currentSpacing
|
|
81
|
+
};
|
|
82
|
+
let nextConfig = {
|
|
83
|
+
...config,
|
|
84
|
+
iconButton
|
|
85
|
+
};
|
|
86
|
+
nextConfig = require_getButtonControlHeightPx.syncButtonControlHeightVarForSize(nextConfig, size);
|
|
87
|
+
return nextConfig;
|
|
88
|
+
}
|
|
89
|
+
function disableIconButtonMatchButtonHeight(config, size) {
|
|
90
|
+
const spacingSnapshot = asMatchButtonHeightConfig(config).iconButton?.spacingBeforeMatchButtonHeight?.[size];
|
|
91
|
+
let nextConfig = removeIconButtonControlHeight(config, size);
|
|
92
|
+
if (spacingSnapshot !== void 0) nextConfig = setIconButtonSpacingRestValue(nextConfig, size, spacingSnapshot);
|
|
93
|
+
nextConfig = require_getButtonControlHeightPx.syncIconButtonOnlyControlHeightVarForSize(nextConfig, size);
|
|
94
|
+
const nextMatchConfig = asMatchButtonHeightConfig(nextConfig);
|
|
95
|
+
const { [size]: _removedFlag, ...remainingMatchButtonHeight } = nextMatchConfig.iconButton?.matchButtonHeight ?? {};
|
|
96
|
+
const { [size]: _removedSnapshot, ...remainingSpacingSnapshot } = nextMatchConfig.iconButton?.spacingBeforeMatchButtonHeight ?? {};
|
|
97
|
+
const iconButton = { ...nextMatchConfig.iconButton };
|
|
98
|
+
if (Object.keys(remainingMatchButtonHeight).length > 0) iconButton.matchButtonHeight = remainingMatchButtonHeight;
|
|
99
|
+
else delete iconButton.matchButtonHeight;
|
|
100
|
+
if (Object.keys(remainingSpacingSnapshot).length > 0) iconButton.spacingBeforeMatchButtonHeight = remainingSpacingSnapshot;
|
|
101
|
+
else delete iconButton.spacingBeforeMatchButtonHeight;
|
|
102
|
+
return {
|
|
103
|
+
...nextConfig,
|
|
104
|
+
iconButton
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
exports.disableIconButtonMatchButtonHeight = disableIconButtonMatchButtonHeight;
|
|
109
|
+
exports.enableIconButtonMatchButtonHeight = enableIconButtonMatchButtonHeight;
|
|
110
|
+
exports.isIconButtonMatchButtonHeightEnabled = isIconButtonMatchButtonHeightEnabled;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import { ButtonSize } from "../../../types/dist/index.cjs";
|
|
3
|
+
|
|
4
|
+
//#region ../automated-config/dist/utils/iconButtonMatchButtonHeight.d.ts
|
|
5
|
+
//#region src/utils/iconButtonMatchButtonHeight.d.ts
|
|
6
|
+
type IconButtonMatchButtonHeightSize = ButtonSize;
|
|
7
|
+
type IconButtonMatchButtonHeightConfig = {
|
|
8
|
+
iconButton?: {
|
|
9
|
+
matchButtonHeight?: Partial<Record<IconButtonMatchButtonHeightSize, true>>;
|
|
10
|
+
spacingBeforeMatchButtonHeight?: Partial<Record<IconButtonMatchButtonHeightSize, string>>;
|
|
11
|
+
variables?: Record<string, Record<string, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
matchButtonHeight?: Partial<Record<IconButtonMatchButtonHeightSize, true>>;
|
|
14
|
+
};
|
|
15
|
+
declare function isIconButtonMatchButtonHeightEnabled(config: object, size: string): boolean;
|
|
16
|
+
declare function enableIconButtonMatchButtonHeight<T extends object>(config: T, size: IconButtonMatchButtonHeightSize): T;
|
|
17
|
+
declare function disableIconButtonMatchButtonHeight<T extends object>(config: T, size: IconButtonMatchButtonHeightSize): T; //#endregion
|
|
18
|
+
//#endregion
|
|
19
|
+
export { IconButtonMatchButtonHeightConfig, IconButtonMatchButtonHeightSize, disableIconButtonMatchButtonHeight, enableIconButtonMatchButtonHeight, isIconButtonMatchButtonHeightEnabled };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import { ButtonSize } from "../../../types/dist/index.js";
|
|
3
|
+
|
|
4
|
+
//#region ../automated-config/dist/utils/iconButtonMatchButtonHeight.d.ts
|
|
5
|
+
//#region src/utils/iconButtonMatchButtonHeight.d.ts
|
|
6
|
+
type IconButtonMatchButtonHeightSize = ButtonSize;
|
|
7
|
+
type IconButtonMatchButtonHeightConfig = {
|
|
8
|
+
iconButton?: {
|
|
9
|
+
matchButtonHeight?: Partial<Record<IconButtonMatchButtonHeightSize, true>>;
|
|
10
|
+
spacingBeforeMatchButtonHeight?: Partial<Record<IconButtonMatchButtonHeightSize, string>>;
|
|
11
|
+
variables?: Record<string, Record<string, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
matchButtonHeight?: Partial<Record<IconButtonMatchButtonHeightSize, true>>;
|
|
14
|
+
};
|
|
15
|
+
declare function isIconButtonMatchButtonHeightEnabled(config: object, size: string): boolean;
|
|
16
|
+
declare function enableIconButtonMatchButtonHeight<T extends object>(config: T, size: IconButtonMatchButtonHeightSize): T;
|
|
17
|
+
declare function disableIconButtonMatchButtonHeight<T extends object>(config: T, size: IconButtonMatchButtonHeightSize): T; //#endregion
|
|
18
|
+
//#endregion
|
|
19
|
+
export { IconButtonMatchButtonHeightConfig, IconButtonMatchButtonHeightSize, disableIconButtonMatchButtonHeight, enableIconButtonMatchButtonHeight, isIconButtonMatchButtonHeightEnabled };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { SHARED_BUTTON_ICONBUTTON_SIZES } from "./getButtonControlHeight.js";
|
|
3
|
+
import { syncButtonControlHeightVarForSize, syncIconButtonOnlyControlHeightVarForSize } from "./getButtonControlHeightPx.js";
|
|
4
|
+
//#region ../automated-config/dist/utils/iconButtonMatchButtonHeight.js
|
|
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 getIconButtonVariables(config) {
|
|
13
|
+
return config.iconButton?.variables ?? config.variables;
|
|
14
|
+
}
|
|
15
|
+
function isMatchButtonHeightSize(size) {
|
|
16
|
+
return SHARED_BUTTON_ICONBUTTON_SIZES.has(size);
|
|
17
|
+
}
|
|
18
|
+
function isIconButtonMatchButtonHeightEnabled(config, size) {
|
|
19
|
+
if (!isMatchButtonHeightSize(size)) return false;
|
|
20
|
+
return getMatchButtonHeightMap(asMatchButtonHeightConfig(config))?.[size] === true;
|
|
21
|
+
}
|
|
22
|
+
function getIconButtonSpacingRestValue(config, size) {
|
|
23
|
+
const rootKey = `size/${size}/root`;
|
|
24
|
+
const value = (getIconButtonVariables(config)?.[rootKey]?.spacing)?.rest?.value;
|
|
25
|
+
return typeof value === "string" ? value : void 0;
|
|
26
|
+
}
|
|
27
|
+
function setIconButtonSpacingRestValue(config, size, spacing) {
|
|
28
|
+
const matchConfig = asMatchButtonHeightConfig(config);
|
|
29
|
+
const rootKey = `size/${size}/root`;
|
|
30
|
+
const iconButton = matchConfig.iconButton ?? { variables: {} };
|
|
31
|
+
const existingRoot = iconButton.variables?.[rootKey] ?? {};
|
|
32
|
+
return {
|
|
33
|
+
...config,
|
|
34
|
+
iconButton: {
|
|
35
|
+
...iconButton,
|
|
36
|
+
variables: {
|
|
37
|
+
...iconButton.variables,
|
|
38
|
+
[rootKey]: {
|
|
39
|
+
...existingRoot,
|
|
40
|
+
spacing: { rest: {
|
|
41
|
+
type: "spacingAliases",
|
|
42
|
+
value: spacing,
|
|
43
|
+
valueType: "alias"
|
|
44
|
+
} }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function removeIconButtonControlHeight(config, size) {
|
|
51
|
+
const matchConfig = asMatchButtonHeightConfig(config);
|
|
52
|
+
const rootKey = `size/${size}/root`;
|
|
53
|
+
const iconButton = matchConfig.iconButton;
|
|
54
|
+
const rootLayer = iconButton?.variables?.[rootKey];
|
|
55
|
+
if (!rootLayer?.controlHeight) return config;
|
|
56
|
+
const { controlHeight: _, ...restRoot } = rootLayer;
|
|
57
|
+
return {
|
|
58
|
+
...config,
|
|
59
|
+
iconButton: {
|
|
60
|
+
...iconButton,
|
|
61
|
+
variables: {
|
|
62
|
+
...iconButton?.variables,
|
|
63
|
+
[rootKey]: restRoot
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function enableIconButtonMatchButtonHeight(config, size) {
|
|
69
|
+
const matchConfig = asMatchButtonHeightConfig(config);
|
|
70
|
+
const currentSpacing = getIconButtonSpacingRestValue(matchConfig, size);
|
|
71
|
+
const iconButton = {
|
|
72
|
+
...matchConfig.iconButton,
|
|
73
|
+
matchButtonHeight: {
|
|
74
|
+
...matchConfig.iconButton?.matchButtonHeight,
|
|
75
|
+
[size]: true
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
if (currentSpacing !== void 0) iconButton.spacingBeforeMatchButtonHeight = {
|
|
79
|
+
...matchConfig.iconButton?.spacingBeforeMatchButtonHeight,
|
|
80
|
+
[size]: currentSpacing
|
|
81
|
+
};
|
|
82
|
+
let nextConfig = {
|
|
83
|
+
...config,
|
|
84
|
+
iconButton
|
|
85
|
+
};
|
|
86
|
+
nextConfig = syncButtonControlHeightVarForSize(nextConfig, size);
|
|
87
|
+
return nextConfig;
|
|
88
|
+
}
|
|
89
|
+
function disableIconButtonMatchButtonHeight(config, size) {
|
|
90
|
+
const spacingSnapshot = asMatchButtonHeightConfig(config).iconButton?.spacingBeforeMatchButtonHeight?.[size];
|
|
91
|
+
let nextConfig = removeIconButtonControlHeight(config, size);
|
|
92
|
+
if (spacingSnapshot !== void 0) nextConfig = setIconButtonSpacingRestValue(nextConfig, size, spacingSnapshot);
|
|
93
|
+
nextConfig = syncIconButtonOnlyControlHeightVarForSize(nextConfig, size);
|
|
94
|
+
const nextMatchConfig = asMatchButtonHeightConfig(nextConfig);
|
|
95
|
+
const { [size]: _removedFlag, ...remainingMatchButtonHeight } = nextMatchConfig.iconButton?.matchButtonHeight ?? {};
|
|
96
|
+
const { [size]: _removedSnapshot, ...remainingSpacingSnapshot } = nextMatchConfig.iconButton?.spacingBeforeMatchButtonHeight ?? {};
|
|
97
|
+
const iconButton = { ...nextMatchConfig.iconButton };
|
|
98
|
+
if (Object.keys(remainingMatchButtonHeight).length > 0) iconButton.matchButtonHeight = remainingMatchButtonHeight;
|
|
99
|
+
else delete iconButton.matchButtonHeight;
|
|
100
|
+
if (Object.keys(remainingSpacingSnapshot).length > 0) iconButton.spacingBeforeMatchButtonHeight = remainingSpacingSnapshot;
|
|
101
|
+
else delete iconButton.spacingBeforeMatchButtonHeight;
|
|
102
|
+
return {
|
|
103
|
+
...nextConfig,
|
|
104
|
+
iconButton
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { disableIconButtonMatchButtonHeight, enableIconButtonMatchButtonHeight, isIconButtonMatchButtonHeightEnabled };
|