@yahoo/uds 3.153.2 → 3.154.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/generatedConfigs.cjs +10 -0
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +10 -0
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +10 -0
- package/dist/automated-config/dist/generated/generatedConfigs.js +10 -0
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +10 -0
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +10 -0
- package/dist/automated-config/dist/properties.cjs +101 -87
- package/dist/automated-config/dist/properties.d.cts +2 -0
- package/dist/automated-config/dist/properties.d.ts +2 -0
- package/dist/automated-config/dist/properties.js +101 -87
- package/dist/automated-config/dist/types/ComponentConfig.d.cts +2 -0
- package/dist/automated-config/dist/types/ComponentConfig.d.ts +2 -0
- package/dist/automated-config/dist/utils/buildConfigSchema.cjs +18 -0
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +5 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +5 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.js +18 -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/getPaginationControlWidthPx.cjs +68 -0
- package/dist/automated-config/dist/utils/getPaginationControlWidthPx.d.cts +49 -0
- package/dist/automated-config/dist/utils/getPaginationControlWidthPx.d.ts +49 -0
- package/dist/automated-config/dist/utils/getPaginationControlWidthPx.js +66 -0
- package/dist/automated-config/dist/utils/index.cjs +55 -17
- package/dist/automated-config/dist/utils/index.d.cts +2 -0
- package/dist/automated-config/dist/utils/index.d.ts +2 -0
- package/dist/automated-config/dist/utils/index.js +55 -17
- package/dist/cli/commands/sync.cjs +21 -4
- package/dist/cli/commands/sync.d.cts +2 -1
- package/dist/cli/commands/sync.d.ts +2 -1
- package/dist/cli/commands/sync.js +21 -5
- 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 +979 -969
- package/dist/config/dist/index.js +979 -969
- package/dist/css/dist/packages/automated-config/dist/properties.cjs +101 -87
- package/dist/css/dist/packages/automated-config/dist/properties.js +101 -87
- package/dist/css/dist/packages/config/dist/index.cjs +979 -969
- package/dist/css/dist/packages/config/dist/index.js +979 -969
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.cjs +10 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +10 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.cjs +101 -87
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.js +101 -87
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +54 -17
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +54 -17
- package/dist/tailwind-internal/dist/packages/config/dist/index.cjs +979 -969
- package/dist/tailwind-internal/dist/packages/config/dist/index.js +979 -969
- package/dist/tokens/automation/index.cjs +3 -0
- package/dist/tokens/automation/index.d.cts +2 -1
- package/dist/tokens/automation/index.d.ts +2 -1
- package/dist/tokens/automation/index.js +2 -1
- package/dist/tokens/index.cjs +3 -0
- package/dist/tokens/index.d.cts +2 -1
- package/dist/tokens/index.d.ts +2 -1
- package/dist/tokens/index.js +2 -1
- package/dist/uds/generated/componentData.cjs +263 -263
- package/dist/uds/generated/componentData.js +263 -263
- package/dist/uds/generated/migrationSchemaVersion.cjs +5 -0
- package/dist/uds/generated/migrationSchemaVersion.js +5 -0
- package/generated/componentData.json +356 -356
- package/generated/migrationSchemaVersion.ts +7 -0
- package/package.json +1 -1
|
@@ -40,8 +40,12 @@ type InferredLayerPropertiesForOption<Layer, ExcludedPseudoStates extends readon
|
|
|
40
40
|
} ? { [PropKey in keyof Props]: InferredPropertyStatesForOption<Props[PropKey], ExcludedPseudoStates> } : {} : {};
|
|
41
41
|
/** Generates schema key → properties mappings for a variant's layers or component states */
|
|
42
42
|
type InferredSchemaMap<VarKey extends string, VarConfig extends VariantConfig, LayersOrStates extends NonNullable<VariantConfigWithComponentStates['componentStates']> | NonNullable<VariantConfigWithProperties['layers']>, Prefix extends string = ''> = LayersOrStates extends NonNullable<VariantConfigWithComponentStates['componentStates']> ? UnionToIntersection<{ [StateKey in keyof OmitIndexSignature<LayersOrStates>]: UnionToIntersection<{ [StateOption in LayersOrStates[StateKey]['options'][number]]: { [LayerKey in keyof OmitIndexSignature<LayersOrStates[StateKey]['layers']> as `${Prefix}${VarKey}/${VarConfig['options'][number]}/${StateKey & string}/${StateOption}/${LayerKey & string}`]: InferredLayerPropertiesForOption<LayersOrStates[StateKey]['layers'][LayerKey], GetExcludedPseudoStatesForOption<LayersOrStates[StateKey], StateOption>> } }[LayersOrStates[StateKey]['options'][number]]> }[keyof OmitIndexSignature<LayersOrStates>]> : { [LayerKey in keyof OmitIndexSignature<LayersOrStates> as `${Prefix}${VarKey}/${VarConfig['options'][number]}/${LayerKey & string}`]: InferredLayerProperties<LayersOrStates[LayerKey]> };
|
|
43
|
+
type InferredVariantLevelProperties<Props extends Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>> = { [PropKey in keyof Props]: InferredPropertyStates<Props[PropKey]> };
|
|
44
|
+
type InferredVariantPropertiesMap<VarKey extends string, VarConfig extends VariantConfigWithProperties, Prefix extends string = ''> = VarConfig extends {
|
|
45
|
+
variantProperties: infer Props extends Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>;
|
|
46
|
+
} ? { [Option in VarConfig['options'][number] as `${Prefix}${VarKey}/${Option}`]: InferredVariantLevelProperties<Props> } : {};
|
|
43
47
|
/** Routes to appropriate schema map generator based on variant configuration type */
|
|
44
|
-
type InferredVariablesFilter<VarKey extends string, VarConfig extends VariantConfig, Prefix extends string = ''> = VarConfig extends VariantConfigWithComponentStates ? InferredSchemaMap<VarKey, VarConfig, VarConfig['componentStates'], Prefix> : VarConfig extends VariantConfigWithProperties ? InferredSchemaMap<VarKey, VarConfig, VarConfig['layers'], Prefix> : {};
|
|
48
|
+
type InferredVariablesFilter<VarKey extends string, VarConfig extends VariantConfig, Prefix extends string = ''> = VarConfig extends VariantConfigWithComponentStates ? InferredSchemaMap<VarKey, VarConfig, VarConfig['componentStates'], Prefix> : VarConfig extends VariantConfigWithProperties ? InferredSchemaMap<VarKey, VarConfig, VarConfig['layers'], Prefix> & InferredVariantPropertiesMap<VarKey, VarConfig, Prefix> : {};
|
|
45
49
|
/** Collects all schema mappings from component variants and subComponents */
|
|
46
50
|
type InferredVariables<C extends ComponentConfig> = (C['variants'] extends NonNullable<ComponentConfig['variants']> ? UnionToIntersection<{ [VarKey in keyof C['variants']]: InferredVariablesFilter<VarKey & string, C['variants'][VarKey]> }[keyof C['variants']]> : {}) & (C['subComponents'] extends NonNullable<ComponentConfig['subComponents']> ? UnionToIntersection<{ [SubCompKey in keyof C['subComponents']]: UnionToIntersection<{ [VarKey in keyof C['subComponents'][SubCompKey]['variants']]: InferredVariablesFilter<VarKey & string, C['subComponents'][SubCompKey]['variants'][VarKey], `${SubCompKey & string}/`> }[keyof C['subComponents'][SubCompKey]['variants']]> }[keyof C['subComponents']]> : {});
|
|
47
51
|
/** Component schema with inferred defaults and variable schema mappings */
|
|
@@ -65,6 +65,24 @@ function buildConfigSchema(config) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
} else if (isVariantConfigWithProperties(variantConfig)) {
|
|
68
|
+
if (variantConfig.variantProperties) {
|
|
69
|
+
const variantSchemaKey = `${variantKey}/${variantOption}`;
|
|
70
|
+
result.variables[variantSchemaKey] = result.variables[variantSchemaKey] ?? {};
|
|
71
|
+
for (const propertyKey in variantConfig.variantProperties) {
|
|
72
|
+
const property = variantConfig.variantProperties[propertyKey];
|
|
73
|
+
const variableObject = { [propertyKey]: {} };
|
|
74
|
+
if (property?.skipRestState !== true) variableObject[propertyKey] = { rest: {
|
|
75
|
+
type: findFixtureType(property, variantOption),
|
|
76
|
+
valueType: "alias",
|
|
77
|
+
value: property.defaults[variantOption]
|
|
78
|
+
} };
|
|
79
|
+
appendPseudoStateVariables(variableObject, propertyKey, property, variantOption);
|
|
80
|
+
result.variables[variantSchemaKey] = {
|
|
81
|
+
...result.variables[variantSchemaKey],
|
|
82
|
+
...variableObject
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
68
86
|
const layers = variantConfig.layers;
|
|
69
87
|
for (const layerKey in layers) {
|
|
70
88
|
const layer = layers[layerKey];
|
|
@@ -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", 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", 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", 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[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -11,8 +11,8 @@ import { SelectedConfigurableProperty } from "../properties.js";
|
|
|
11
11
|
* @returns A Record of layer names to their properties, or null if no properties are found
|
|
12
12
|
*/
|
|
13
13
|
declare function getConfigVariantProperties(variant?: VariantConfig): {
|
|
14
|
-
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"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", 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", 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", 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[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_index = require("../../../fixtures/dist/index.cjs");
|
|
4
|
+
let _yahoo_uds_icons_tokens = require("@yahoo/uds-icons/tokens");
|
|
5
|
+
let lodash_es = require("lodash-es");
|
|
6
|
+
//#region ../automated-config/dist/utils/getPaginationControlWidthPx.js
|
|
7
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
8
|
+
function resolveSpacingPx(config, alias) {
|
|
9
|
+
if (!alias) return 0;
|
|
10
|
+
const scaleValue = (0, lodash_es.get)(config, [
|
|
11
|
+
"scaleMode",
|
|
12
|
+
"large",
|
|
13
|
+
"spacing",
|
|
14
|
+
alias.replace(".", "_")
|
|
15
|
+
]);
|
|
16
|
+
if (typeof scaleValue === "number") return scaleValue;
|
|
17
|
+
return require_index.spacingMap[alias] ?? 0;
|
|
18
|
+
}
|
|
19
|
+
function resolveTypographyPx(config, textVariant, property) {
|
|
20
|
+
if (!textVariant) return 0;
|
|
21
|
+
const typographyConfig = config.typography[textVariant];
|
|
22
|
+
if (!typographyConfig) return 0;
|
|
23
|
+
const defaultBreakpoint = config.globalDefaults.breakpoint;
|
|
24
|
+
const value = defaultBreakpoint === "base" ? typographyConfig[property].base : typographyConfig[property].breakpoints[defaultBreakpoint];
|
|
25
|
+
if (typeof value === "number") return value;
|
|
26
|
+
if (value && typeof value === "object" && "value" in value) return value.value;
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
/** Pixel width/height for pagination page circles and prev/next controls. */
|
|
30
|
+
function getPaginationControlWidthPx(config, size) {
|
|
31
|
+
const pagination = config.pagination;
|
|
32
|
+
if (!pagination?.variables) return 0;
|
|
33
|
+
const variables = pagination.variables;
|
|
34
|
+
const layerPrefix = `size/${size}`;
|
|
35
|
+
const paddingAlias = variables[`${layerPrefix}/item`]?.spacing?.rest?.value;
|
|
36
|
+
const iconSizeAlias = variables[`${layerPrefix}/icon`]?.size?.rest?.value;
|
|
37
|
+
const textVariant = variables[`${layerPrefix}/text`]?.textVariant?.rest?.value;
|
|
38
|
+
const padding = resolveSpacingPx(config, paddingAlias);
|
|
39
|
+
const iconSize = _yahoo_uds_icons_tokens.ICON_SIZE_MAP[iconSizeAlias ?? "sm"] ?? 16;
|
|
40
|
+
const lineHeight = resolveTypographyPx(config, textVariant, "lineHeight");
|
|
41
|
+
return padding * 2 + Math.max(iconSize, lineHeight || iconSize);
|
|
42
|
+
}
|
|
43
|
+
function syncPaginationWidthVarForSize(config, size) {
|
|
44
|
+
const itemKey = `size/${size}/item`;
|
|
45
|
+
const widthPx = getPaginationControlWidthPx(config, size);
|
|
46
|
+
const paginationConfig = config;
|
|
47
|
+
const existingItem = paginationConfig.pagination?.variables?.[itemKey] ?? {};
|
|
48
|
+
return {
|
|
49
|
+
...config,
|
|
50
|
+
pagination: {
|
|
51
|
+
...paginationConfig.pagination,
|
|
52
|
+
variables: {
|
|
53
|
+
...paginationConfig.pagination?.variables,
|
|
54
|
+
[itemKey]: {
|
|
55
|
+
...existingItem,
|
|
56
|
+
paginationWidthVar: { rest: {
|
|
57
|
+
type: "positiveIntegers",
|
|
58
|
+
value: widthPx,
|
|
59
|
+
valueType: "alias"
|
|
60
|
+
} }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
exports.getPaginationControlWidthPx = getPaginationControlWidthPx;
|
|
68
|
+
exports.syncPaginationWidthVarForSize = syncPaginationWidthVarForSize;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
//#region ../automated-config/dist/utils/getPaginationControlWidthPx.d.ts
|
|
3
|
+
//#region src/utils/getPaginationControlWidthPx.d.ts
|
|
4
|
+
type PaginationSize = 'sm' | 'md';
|
|
5
|
+
/** Minimal config shape for deriving pagination control width from layer tokens. */
|
|
6
|
+
type PaginationWidthConfig = {
|
|
7
|
+
pagination?: {
|
|
8
|
+
variables?: Record<string, {
|
|
9
|
+
spacing?: {
|
|
10
|
+
rest?: {
|
|
11
|
+
value?: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
size?: {
|
|
15
|
+
rest?: {
|
|
16
|
+
value?: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
textVariant?: {
|
|
20
|
+
rest?: {
|
|
21
|
+
value?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
typography: Record<string, {
|
|
27
|
+
lineHeight: {
|
|
28
|
+
base: number | {
|
|
29
|
+
value: number;
|
|
30
|
+
};
|
|
31
|
+
breakpoints: Record<string, number | {
|
|
32
|
+
value: number;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
scaleMode: {
|
|
37
|
+
large: {
|
|
38
|
+
spacing: Record<string, number>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
globalDefaults: {
|
|
42
|
+
breakpoint: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** Pixel width/height for pagination page circles and prev/next controls. */
|
|
46
|
+
declare function getPaginationControlWidthPx(config: PaginationWidthConfig, size: PaginationSize): number;
|
|
47
|
+
declare function syncPaginationWidthVarForSize<T extends object>(config: T, size: PaginationSize): T; //#endregion
|
|
48
|
+
//#endregion
|
|
49
|
+
export { PaginationWidthConfig, getPaginationControlWidthPx, syncPaginationWidthVarForSize };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
//#region ../automated-config/dist/utils/getPaginationControlWidthPx.d.ts
|
|
3
|
+
//#region src/utils/getPaginationControlWidthPx.d.ts
|
|
4
|
+
type PaginationSize = 'sm' | 'md';
|
|
5
|
+
/** Minimal config shape for deriving pagination control width from layer tokens. */
|
|
6
|
+
type PaginationWidthConfig = {
|
|
7
|
+
pagination?: {
|
|
8
|
+
variables?: Record<string, {
|
|
9
|
+
spacing?: {
|
|
10
|
+
rest?: {
|
|
11
|
+
value?: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
size?: {
|
|
15
|
+
rest?: {
|
|
16
|
+
value?: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
textVariant?: {
|
|
20
|
+
rest?: {
|
|
21
|
+
value?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
typography: Record<string, {
|
|
27
|
+
lineHeight: {
|
|
28
|
+
base: number | {
|
|
29
|
+
value: number;
|
|
30
|
+
};
|
|
31
|
+
breakpoints: Record<string, number | {
|
|
32
|
+
value: number;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
scaleMode: {
|
|
37
|
+
large: {
|
|
38
|
+
spacing: Record<string, number>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
globalDefaults: {
|
|
42
|
+
breakpoint: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** Pixel width/height for pagination page circles and prev/next controls. */
|
|
46
|
+
declare function getPaginationControlWidthPx(config: PaginationWidthConfig, size: PaginationSize): number;
|
|
47
|
+
declare function syncPaginationWidthVarForSize<T extends object>(config: T, size: PaginationSize): T; //#endregion
|
|
48
|
+
//#endregion
|
|
49
|
+
export { PaginationWidthConfig, getPaginationControlWidthPx, syncPaginationWidthVarForSize };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { spacingMap } from "../../../fixtures/dist/index.js";
|
|
3
|
+
import { get } from "lodash-es";
|
|
4
|
+
import { ICON_SIZE_MAP } from "@yahoo/uds-icons/tokens";
|
|
5
|
+
//#region ../automated-config/dist/utils/getPaginationControlWidthPx.js
|
|
6
|
+
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
7
|
+
function resolveSpacingPx(config, alias) {
|
|
8
|
+
if (!alias) return 0;
|
|
9
|
+
const scaleValue = get(config, [
|
|
10
|
+
"scaleMode",
|
|
11
|
+
"large",
|
|
12
|
+
"spacing",
|
|
13
|
+
alias.replace(".", "_")
|
|
14
|
+
]);
|
|
15
|
+
if (typeof scaleValue === "number") return scaleValue;
|
|
16
|
+
return spacingMap[alias] ?? 0;
|
|
17
|
+
}
|
|
18
|
+
function resolveTypographyPx(config, textVariant, property) {
|
|
19
|
+
if (!textVariant) return 0;
|
|
20
|
+
const typographyConfig = config.typography[textVariant];
|
|
21
|
+
if (!typographyConfig) return 0;
|
|
22
|
+
const defaultBreakpoint = config.globalDefaults.breakpoint;
|
|
23
|
+
const value = defaultBreakpoint === "base" ? typographyConfig[property].base : typographyConfig[property].breakpoints[defaultBreakpoint];
|
|
24
|
+
if (typeof value === "number") return value;
|
|
25
|
+
if (value && typeof value === "object" && "value" in value) return value.value;
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
/** Pixel width/height for pagination page circles and prev/next controls. */
|
|
29
|
+
function getPaginationControlWidthPx(config, size) {
|
|
30
|
+
const pagination = config.pagination;
|
|
31
|
+
if (!pagination?.variables) return 0;
|
|
32
|
+
const variables = pagination.variables;
|
|
33
|
+
const layerPrefix = `size/${size}`;
|
|
34
|
+
const paddingAlias = variables[`${layerPrefix}/item`]?.spacing?.rest?.value;
|
|
35
|
+
const iconSizeAlias = variables[`${layerPrefix}/icon`]?.size?.rest?.value;
|
|
36
|
+
const textVariant = variables[`${layerPrefix}/text`]?.textVariant?.rest?.value;
|
|
37
|
+
const padding = resolveSpacingPx(config, paddingAlias);
|
|
38
|
+
const iconSize = ICON_SIZE_MAP[iconSizeAlias ?? "sm"] ?? 16;
|
|
39
|
+
const lineHeight = resolveTypographyPx(config, textVariant, "lineHeight");
|
|
40
|
+
return padding * 2 + Math.max(iconSize, lineHeight || iconSize);
|
|
41
|
+
}
|
|
42
|
+
function syncPaginationWidthVarForSize(config, size) {
|
|
43
|
+
const itemKey = `size/${size}/item`;
|
|
44
|
+
const widthPx = getPaginationControlWidthPx(config, size);
|
|
45
|
+
const paginationConfig = config;
|
|
46
|
+
const existingItem = paginationConfig.pagination?.variables?.[itemKey] ?? {};
|
|
47
|
+
return {
|
|
48
|
+
...config,
|
|
49
|
+
pagination: {
|
|
50
|
+
...paginationConfig.pagination,
|
|
51
|
+
variables: {
|
|
52
|
+
...paginationConfig.pagination?.variables,
|
|
53
|
+
[itemKey]: {
|
|
54
|
+
...existingItem,
|
|
55
|
+
paginationWidthVar: { rest: {
|
|
56
|
+
type: "positiveIntegers",
|
|
57
|
+
value: widthPx,
|
|
58
|
+
valueType: "alias"
|
|
59
|
+
} }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { getPaginationControlWidthPx, syncPaginationWidthVarForSize };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
3
|
const require_index = require("../../../css-tokens/dist/index.cjs");
|
|
4
|
+
const require_mapTextVariantFixtureToValue = require("../mapTextVariantFixtureToValue.cjs");
|
|
4
5
|
const require_properties = require("../properties.cjs");
|
|
5
6
|
const require_componentStatePseudoStates = require("./componentStatePseudoStates.cjs");
|
|
6
7
|
const require_generateSchemaKey = require("./generateSchemaKey.cjs");
|
|
@@ -16,13 +17,14 @@ require("./getConfigVariantComponentStatesMatrix.cjs");
|
|
|
16
17
|
require("./getConfigVariantProperties.cjs");
|
|
17
18
|
require("./getConfigVariantPseudoStates.cjs");
|
|
18
19
|
require("./getConfigVariants.cjs");
|
|
20
|
+
require("./getPaginationControlWidthPx.cjs");
|
|
19
21
|
let lodash_es = require("lodash-es");
|
|
20
22
|
//#region ../automated-config/dist/utils/index.js
|
|
21
23
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
22
|
-
const CSS_GAP = "gap";
|
|
23
24
|
const CSS_PADDING = "padding";
|
|
24
|
-
const CSS_LINE_HEIGHT = "line-height";
|
|
25
25
|
const PAGINATION_CONTROL_SIZE_VAR = "--uds-pagination-control-size";
|
|
26
|
+
const CSS_GAP = "gap";
|
|
27
|
+
const CSS_LINE_HEIGHT = "line-height";
|
|
26
28
|
const CSS_BORDER_WIDTH = "border-width";
|
|
27
29
|
const CSS_BORDER_RADIUS = "border-radius";
|
|
28
30
|
const CSS_BORDER_COLOR = "border-color";
|
|
@@ -111,13 +113,28 @@ function getButtonLineHeightWithIconMinimum({ lineHeight, schema, iconLayerKey,
|
|
|
111
113
|
return lineHeight;
|
|
112
114
|
}
|
|
113
115
|
/**
|
|
114
|
-
* Shared pagination control
|
|
115
|
-
* Keeps page
|
|
116
|
+
* Shared pagination control content size: max(icon size, text line-height).
|
|
117
|
+
* Keeps page numbers and prev/next icons vertically centered when typography exceeds icon height.
|
|
116
118
|
*/
|
|
117
|
-
function
|
|
119
|
+
function getPaginationControlContentSize({ schema, iconLayerKey, textLayerKey, state, theme }) {
|
|
118
120
|
const iconSizeValue = schema.variables?.[iconLayerKey]?.size?.[state]?.value;
|
|
119
|
-
|
|
120
|
-
return `
|
|
121
|
+
const textVariantValue = schema.variables?.[textLayerKey]?.textVariant?.[state]?.value;
|
|
122
|
+
if (iconSizeValue && textVariantValue) return `max(${theme(require_properties.configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue))}, ${theme(require_mapTextVariantFixtureToValue.mapTextVariantFixtureToValue("lineHeight")("textVariants", textVariantValue))})`;
|
|
123
|
+
if (iconSizeValue) return theme(require_properties.configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue));
|
|
124
|
+
return "1em";
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Shared pagination control size: padding on all sides plus max(icon size, line-height).
|
|
128
|
+
* Used for both width and height so page circles stay square for single-digit labels.
|
|
129
|
+
*/
|
|
130
|
+
function getPaginationControlSize({ padding, schema, iconLayerKey, textLayerKey, state, theme }) {
|
|
131
|
+
return `calc(2 * ${padding} + ${getPaginationControlContentSize({
|
|
132
|
+
schema,
|
|
133
|
+
iconLayerKey,
|
|
134
|
+
textLayerKey,
|
|
135
|
+
state,
|
|
136
|
+
theme
|
|
137
|
+
})})`;
|
|
121
138
|
}
|
|
122
139
|
/**
|
|
123
140
|
* Forces button borders to use box-shadow instead of border properties.
|
|
@@ -361,20 +378,41 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
361
378
|
});
|
|
362
379
|
}
|
|
363
380
|
}
|
|
364
|
-
if (componentName === "pagination" && layer === "item"
|
|
365
|
-
|
|
366
|
-
if (
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
381
|
+
if (componentName === "pagination" && layer === "item") {
|
|
382
|
+
let padding;
|
|
383
|
+
if (propertyKey === "spacing") padding = cssDeclarations[CSS_PADDING];
|
|
384
|
+
else if (propertyKey === "paginationWidthVar") {
|
|
385
|
+
const itemSchemaKey = require_generateSchemaKey.generateSchemaKey({
|
|
386
|
+
variantKey,
|
|
387
|
+
variantValue,
|
|
388
|
+
layer: "item",
|
|
389
|
+
subComponentName
|
|
390
|
+
});
|
|
391
|
+
const paddingValue = schema.variables?.[itemSchemaKey]?.spacing?.[propertyState]?.value;
|
|
392
|
+
if (paddingValue) padding = theme(require_properties.configurableProperties.spacing.twThemePath("spacingAliases", paddingValue));
|
|
393
|
+
}
|
|
394
|
+
if (padding) {
|
|
395
|
+
const iconLayerKey = require_generateSchemaKey.generateSchemaKey({
|
|
370
396
|
variantKey,
|
|
371
397
|
variantValue,
|
|
372
398
|
layer: "icon",
|
|
373
399
|
subComponentName
|
|
374
|
-
})
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
400
|
+
});
|
|
401
|
+
const textLayerKey = require_generateSchemaKey.generateSchemaKey({
|
|
402
|
+
variantKey,
|
|
403
|
+
variantValue,
|
|
404
|
+
layer: "text",
|
|
405
|
+
subComponentName
|
|
406
|
+
});
|
|
407
|
+
cssDeclarations[PAGINATION_CONTROL_SIZE_VAR] = getPaginationControlSize({
|
|
408
|
+
padding,
|
|
409
|
+
schema,
|
|
410
|
+
iconLayerKey,
|
|
411
|
+
textLayerKey,
|
|
412
|
+
state: propertyState,
|
|
413
|
+
theme
|
|
414
|
+
});
|
|
415
|
+
}
|
|
378
416
|
}
|
|
379
417
|
if (componentName === "paddlenav" && layer === "root") {
|
|
380
418
|
if (propertyKey === "borderRadius" && cssDeclarations[CSS_BORDER_RADIUS]) cssDeclarations[NESTED_BORDER_RADIUS_SIZE_VAR] = cssDeclarations[CSS_BORDER_RADIUS];
|
|
@@ -13,6 +13,7 @@ import { getConfigVariantComponentStates, getConfigVariantComponentStatesMatrix
|
|
|
13
13
|
import { getConfigVariantProperties } from "./getConfigVariantProperties.cjs";
|
|
14
14
|
import { getConfigVariantPseudoStates } from "./getConfigVariantPseudoStates.cjs";
|
|
15
15
|
import { getConfigVariants } from "./getConfigVariants.cjs";
|
|
16
|
+
import { PaginationWidthConfig, getPaginationControlWidthPx, syncPaginationWidthVarForSize } from "./getPaginationControlWidthPx.cjs";
|
|
16
17
|
import { getConfigSubcomponents } from "./subcomponents.cjs";
|
|
17
18
|
|
|
18
19
|
//#region ../automated-config/dist/utils/index.d.ts
|
|
@@ -134,6 +135,7 @@ declare function createVariantConfigWithProperties(config: {
|
|
|
134
135
|
layers: {
|
|
135
136
|
root: LayerConfig;
|
|
136
137
|
} & Record<string, LayerConfig>;
|
|
138
|
+
variantProperties?: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
|
|
137
139
|
}): VariantConfigWithProperties;
|
|
138
140
|
declare function createVariantConfigWithComponentStates(config: {
|
|
139
141
|
label: string;
|
|
@@ -13,6 +13,7 @@ import { getConfigVariantComponentStates, getConfigVariantComponentStatesMatrix
|
|
|
13
13
|
import { getConfigVariantProperties } from "./getConfigVariantProperties.js";
|
|
14
14
|
import { getConfigVariantPseudoStates } from "./getConfigVariantPseudoStates.js";
|
|
15
15
|
import { getConfigVariants } from "./getConfigVariants.js";
|
|
16
|
+
import { PaginationWidthConfig, getPaginationControlWidthPx, syncPaginationWidthVarForSize } from "./getPaginationControlWidthPx.js";
|
|
16
17
|
import { getConfigSubcomponents } from "./subcomponents.js";
|
|
17
18
|
|
|
18
19
|
//#region ../automated-config/dist/utils/index.d.ts
|
|
@@ -134,6 +135,7 @@ declare function createVariantConfigWithProperties(config: {
|
|
|
134
135
|
layers: {
|
|
135
136
|
root: LayerConfig;
|
|
136
137
|
} & Record<string, LayerConfig>;
|
|
138
|
+
variantProperties?: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
|
|
137
139
|
}): VariantConfigWithProperties;
|
|
138
140
|
declare function createVariantConfigWithComponentStates(config: {
|
|
139
141
|
label: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST } from "../../../css-tokens/dist/index.js";
|
|
3
|
+
import { mapTextVariantFixtureToValue } from "../mapTextVariantFixtureToValue.js";
|
|
3
4
|
import { configurableProperties } from "../properties.js";
|
|
4
5
|
import { filterPseudoStatesByExclusion, getExcludedPseudoStatesForComponentStateOption } from "./componentStatePseudoStates.js";
|
|
5
6
|
import { generateSchemaKey } from "./generateSchemaKey.js";
|
|
@@ -15,13 +16,14 @@ import "./getConfigVariantComponentStatesMatrix.js";
|
|
|
15
16
|
import "./getConfigVariantProperties.js";
|
|
16
17
|
import "./getConfigVariantPseudoStates.js";
|
|
17
18
|
import "./getConfigVariants.js";
|
|
19
|
+
import "./getPaginationControlWidthPx.js";
|
|
18
20
|
import { isFunction, mergeWith } from "lodash-es";
|
|
19
21
|
//#region ../automated-config/dist/utils/index.js
|
|
20
22
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
21
|
-
const CSS_GAP = "gap";
|
|
22
23
|
const CSS_PADDING = "padding";
|
|
23
|
-
const CSS_LINE_HEIGHT = "line-height";
|
|
24
24
|
const PAGINATION_CONTROL_SIZE_VAR = "--uds-pagination-control-size";
|
|
25
|
+
const CSS_GAP = "gap";
|
|
26
|
+
const CSS_LINE_HEIGHT = "line-height";
|
|
25
27
|
const CSS_BORDER_WIDTH = "border-width";
|
|
26
28
|
const CSS_BORDER_RADIUS = "border-radius";
|
|
27
29
|
const CSS_BORDER_COLOR = "border-color";
|
|
@@ -110,13 +112,28 @@ function getButtonLineHeightWithIconMinimum({ lineHeight, schema, iconLayerKey,
|
|
|
110
112
|
return lineHeight;
|
|
111
113
|
}
|
|
112
114
|
/**
|
|
113
|
-
* Shared pagination control
|
|
114
|
-
* Keeps page
|
|
115
|
+
* Shared pagination control content size: max(icon size, text line-height).
|
|
116
|
+
* Keeps page numbers and prev/next icons vertically centered when typography exceeds icon height.
|
|
115
117
|
*/
|
|
116
|
-
function
|
|
118
|
+
function getPaginationControlContentSize({ schema, iconLayerKey, textLayerKey, state, theme }) {
|
|
117
119
|
const iconSizeValue = schema.variables?.[iconLayerKey]?.size?.[state]?.value;
|
|
118
|
-
|
|
119
|
-
return `
|
|
120
|
+
const textVariantValue = schema.variables?.[textLayerKey]?.textVariant?.[state]?.value;
|
|
121
|
+
if (iconSizeValue && textVariantValue) return `max(${theme(configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue))}, ${theme(mapTextVariantFixtureToValue("lineHeight")("textVariants", textVariantValue))})`;
|
|
122
|
+
if (iconSizeValue) return theme(configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue));
|
|
123
|
+
return "1em";
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Shared pagination control size: padding on all sides plus max(icon size, line-height).
|
|
127
|
+
* Used for both width and height so page circles stay square for single-digit labels.
|
|
128
|
+
*/
|
|
129
|
+
function getPaginationControlSize({ padding, schema, iconLayerKey, textLayerKey, state, theme }) {
|
|
130
|
+
return `calc(2 * ${padding} + ${getPaginationControlContentSize({
|
|
131
|
+
schema,
|
|
132
|
+
iconLayerKey,
|
|
133
|
+
textLayerKey,
|
|
134
|
+
state,
|
|
135
|
+
theme
|
|
136
|
+
})})`;
|
|
120
137
|
}
|
|
121
138
|
/**
|
|
122
139
|
* Forces button borders to use box-shadow instead of border properties.
|
|
@@ -360,20 +377,41 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
360
377
|
});
|
|
361
378
|
}
|
|
362
379
|
}
|
|
363
|
-
if (componentName === "pagination" && layer === "item"
|
|
364
|
-
|
|
365
|
-
if (
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
380
|
+
if (componentName === "pagination" && layer === "item") {
|
|
381
|
+
let padding;
|
|
382
|
+
if (propertyKey === "spacing") padding = cssDeclarations[CSS_PADDING];
|
|
383
|
+
else if (propertyKey === "paginationWidthVar") {
|
|
384
|
+
const itemSchemaKey = generateSchemaKey({
|
|
385
|
+
variantKey,
|
|
386
|
+
variantValue,
|
|
387
|
+
layer: "item",
|
|
388
|
+
subComponentName
|
|
389
|
+
});
|
|
390
|
+
const paddingValue = schema.variables?.[itemSchemaKey]?.spacing?.[propertyState]?.value;
|
|
391
|
+
if (paddingValue) padding = theme(configurableProperties.spacing.twThemePath("spacingAliases", paddingValue));
|
|
392
|
+
}
|
|
393
|
+
if (padding) {
|
|
394
|
+
const iconLayerKey = generateSchemaKey({
|
|
369
395
|
variantKey,
|
|
370
396
|
variantValue,
|
|
371
397
|
layer: "icon",
|
|
372
398
|
subComponentName
|
|
373
|
-
})
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
399
|
+
});
|
|
400
|
+
const textLayerKey = generateSchemaKey({
|
|
401
|
+
variantKey,
|
|
402
|
+
variantValue,
|
|
403
|
+
layer: "text",
|
|
404
|
+
subComponentName
|
|
405
|
+
});
|
|
406
|
+
cssDeclarations[PAGINATION_CONTROL_SIZE_VAR] = getPaginationControlSize({
|
|
407
|
+
padding,
|
|
408
|
+
schema,
|
|
409
|
+
iconLayerKey,
|
|
410
|
+
textLayerKey,
|
|
411
|
+
state: propertyState,
|
|
412
|
+
theme
|
|
413
|
+
});
|
|
414
|
+
}
|
|
377
415
|
}
|
|
378
416
|
if (componentName === "paddlenav" && layer === "root") {
|
|
379
417
|
if (propertyKey === "borderRadius" && cssDeclarations[CSS_BORDER_RADIUS]) cssDeclarations[NESTED_BORDER_RADIUS_SIZE_VAR] = cssDeclarations[CSS_BORDER_RADIUS];
|