@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
|
@@ -281,9 +281,7 @@ const height = {
|
|
|
281
281
|
const width = {
|
|
282
282
|
name: "width",
|
|
283
283
|
cssProperties: "width",
|
|
284
|
-
twThemePath: (_, value) => {
|
|
285
|
-
return `width[${value}]`;
|
|
286
|
-
},
|
|
284
|
+
twThemePath: (_, value) => `width[${value}]`,
|
|
287
285
|
possibleFixtures: ["spacingAliases"]
|
|
288
286
|
};
|
|
289
287
|
const shadow = {
|
|
@@ -347,6 +345,95 @@ const opacity = {
|
|
|
347
345
|
twThemePath: (_, value) => `opacity[${value}]`,
|
|
348
346
|
possibleFixtures: ["opacitySteps"]
|
|
349
347
|
};
|
|
348
|
+
const fillOpacity = {
|
|
349
|
+
name: "fillOpacity",
|
|
350
|
+
cssProperties: "fill-opacity",
|
|
351
|
+
twThemePath: (_, value) => `opacity[${value}]`,
|
|
352
|
+
possibleFixtures: ["opacitySteps"]
|
|
353
|
+
};
|
|
354
|
+
const iconSize = {
|
|
355
|
+
name: "iconSize",
|
|
356
|
+
cssProperties: ["width", "height"],
|
|
357
|
+
twThemePath: (_, value) => `sizing.icon.${value}`,
|
|
358
|
+
possibleFixtures: ["iconSizes"]
|
|
359
|
+
};
|
|
360
|
+
const scaleEffect = {
|
|
361
|
+
name: "scaleEffect",
|
|
362
|
+
cssProperties: BUTTON_SCALE_EFFECT,
|
|
363
|
+
possibleFixtures: ["scaleEffects"],
|
|
364
|
+
twThemePath: () => {
|
|
365
|
+
return ``;
|
|
366
|
+
},
|
|
367
|
+
customValueRenderer: (schemaValue) => {
|
|
368
|
+
const value = schemaValue.value;
|
|
369
|
+
return String(SCALE_EFFECTS[String(value)] ?? SCALE_EFFECTS.none);
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
const blurBackgroundColor = {
|
|
373
|
+
...backgroundColor,
|
|
374
|
+
name: "blurBackgroundColor",
|
|
375
|
+
cssProperties: `--${BACKGROUND_BLUR_COLOR_PREFIX}`
|
|
376
|
+
};
|
|
377
|
+
const backdropBlur = {
|
|
378
|
+
name: "backdropBlur",
|
|
379
|
+
possibleFixtures: ["positiveIntegers"],
|
|
380
|
+
cssProperties: "--uds-backdrop-blur",
|
|
381
|
+
twThemePath: () => {
|
|
382
|
+
return ``;
|
|
383
|
+
},
|
|
384
|
+
customValueRenderer: (schemaValue, schema, _theme, originalPropertyDefinition) => {
|
|
385
|
+
if (originalPropertyDefinition && originalPropertyDefinition.layerReference) {
|
|
386
|
+
const { variablePath, propertyName } = originalPropertyDefinition.layerReference;
|
|
387
|
+
const property = schema.variables[variablePath][propertyName].rest;
|
|
388
|
+
if (property.type === "elevationAliases") return `var(--uds-background-blur-radius-${property.value})`;
|
|
389
|
+
}
|
|
390
|
+
return schemaValue.value === 0 ? "none" : `blur(${schemaValue.value}px)`;
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
const blurBackgroundColorFallback = {
|
|
394
|
+
...backgroundColor,
|
|
395
|
+
name: "blurBackgroundColorFallback",
|
|
396
|
+
cssProperties: `--${BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX}`
|
|
397
|
+
};
|
|
398
|
+
const buttonSize = {
|
|
399
|
+
name: "buttonSize",
|
|
400
|
+
cssProperties: "--uds-button-size",
|
|
401
|
+
possibleFixtures: ["buttonSizes"],
|
|
402
|
+
twThemePath: () => {
|
|
403
|
+
return ``;
|
|
404
|
+
},
|
|
405
|
+
customValueRenderer: (schemaValue) => {
|
|
406
|
+
return String(schemaValue.value);
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
const buttonVariant = {
|
|
410
|
+
name: "buttonVariant",
|
|
411
|
+
cssProperties: "--uds-button-variant",
|
|
412
|
+
possibleFixtures: ["buttonVariantsFlat"],
|
|
413
|
+
twThemePath: () => {
|
|
414
|
+
return ``;
|
|
415
|
+
},
|
|
416
|
+
customValueRenderer: (schemaValue) => {
|
|
417
|
+
return String(schemaValue.value);
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
const iconVariant = {
|
|
421
|
+
name: "iconVariant",
|
|
422
|
+
cssProperties: "--uds-icon-variant",
|
|
423
|
+
possibleFixtures: ["iconVariants"],
|
|
424
|
+
twThemePath: () => {
|
|
425
|
+
return ``;
|
|
426
|
+
},
|
|
427
|
+
customValueRenderer: (schemaValue) => {
|
|
428
|
+
return String(schemaValue.value);
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
const paginationWidthVar = {
|
|
432
|
+
name: "paginationWidthVar",
|
|
433
|
+
cssProperties: "--uds-pagination-control-size",
|
|
434
|
+
possibleFixtures: ["positiveIntegers"],
|
|
435
|
+
twThemePath: (_, value) => `${value}px`
|
|
436
|
+
};
|
|
350
437
|
const publicProperties = {
|
|
351
438
|
backgroundColor,
|
|
352
439
|
borderWidth,
|
|
@@ -357,28 +444,8 @@ const publicProperties = {
|
|
|
357
444
|
borderColor,
|
|
358
445
|
underlineColor,
|
|
359
446
|
stroke,
|
|
360
|
-
buttonSize
|
|
361
|
-
|
|
362
|
-
cssProperties: "--uds-button-size",
|
|
363
|
-
possibleFixtures: ["buttonSizes"],
|
|
364
|
-
twThemePath: () => {
|
|
365
|
-
return ``;
|
|
366
|
-
},
|
|
367
|
-
customValueRenderer: (schemaValue) => {
|
|
368
|
-
return String(schemaValue.value);
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
buttonVariant: {
|
|
372
|
-
name: "buttonVariant",
|
|
373
|
-
cssProperties: "--uds-button-variant",
|
|
374
|
-
possibleFixtures: ["buttonVariantsFlat"],
|
|
375
|
-
twThemePath: () => {
|
|
376
|
-
return ``;
|
|
377
|
-
},
|
|
378
|
-
customValueRenderer: (schemaValue) => {
|
|
379
|
-
return String(schemaValue.value);
|
|
380
|
-
}
|
|
381
|
-
},
|
|
447
|
+
buttonSize,
|
|
448
|
+
buttonVariant,
|
|
382
449
|
fontFamily,
|
|
383
450
|
fontSize,
|
|
384
451
|
fontVariationSettings,
|
|
@@ -388,31 +455,11 @@ const publicProperties = {
|
|
|
388
455
|
gap,
|
|
389
456
|
color,
|
|
390
457
|
opacity,
|
|
391
|
-
fillOpacity
|
|
392
|
-
name: "fillOpacity",
|
|
393
|
-
cssProperties: "fill-opacity",
|
|
394
|
-
twThemePath: (_, value) => `opacity[${value}]`,
|
|
395
|
-
possibleFixtures: ["opacitySteps"]
|
|
396
|
-
},
|
|
458
|
+
fillOpacity,
|
|
397
459
|
fontWeight,
|
|
398
|
-
iconSize
|
|
399
|
-
name: "iconSize",
|
|
400
|
-
cssProperties: ["width", "height"],
|
|
401
|
-
twThemePath: (_, value) => `sizing.icon.${value}`,
|
|
402
|
-
possibleFixtures: ["iconSizes"]
|
|
403
|
-
},
|
|
460
|
+
iconSize,
|
|
404
461
|
spacing,
|
|
405
|
-
iconVariant
|
|
406
|
-
name: "iconVariant",
|
|
407
|
-
cssProperties: "--uds-icon-variant",
|
|
408
|
-
possibleFixtures: ["iconVariants"],
|
|
409
|
-
twThemePath: () => {
|
|
410
|
-
return ``;
|
|
411
|
-
},
|
|
412
|
-
customValueRenderer: (schemaValue) => {
|
|
413
|
-
return String(schemaValue.value);
|
|
414
|
-
}
|
|
415
|
-
},
|
|
462
|
+
iconVariant,
|
|
416
463
|
horizontalMargin,
|
|
417
464
|
bottomMargin,
|
|
418
465
|
spacingHorizontal,
|
|
@@ -454,44 +501,10 @@ const publicProperties = {
|
|
|
454
501
|
},
|
|
455
502
|
height,
|
|
456
503
|
width,
|
|
457
|
-
scaleEffect
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
twThemePath: () => {
|
|
462
|
-
return ``;
|
|
463
|
-
},
|
|
464
|
-
customValueRenderer: (schemaValue) => {
|
|
465
|
-
const value = schemaValue.value;
|
|
466
|
-
return String(SCALE_EFFECTS[String(value)] ?? SCALE_EFFECTS.none);
|
|
467
|
-
}
|
|
468
|
-
},
|
|
469
|
-
backdropBlur: {
|
|
470
|
-
name: "backdropBlur",
|
|
471
|
-
possibleFixtures: ["positiveIntegers"],
|
|
472
|
-
cssProperties: "--uds-backdrop-blur",
|
|
473
|
-
twThemePath: () => {
|
|
474
|
-
return ``;
|
|
475
|
-
},
|
|
476
|
-
customValueRenderer: (schemaValue, schema, _theme, originalPropertyDefinition) => {
|
|
477
|
-
if (originalPropertyDefinition && originalPropertyDefinition.layerReference) {
|
|
478
|
-
const { variablePath, propertyName } = originalPropertyDefinition.layerReference;
|
|
479
|
-
const property = schema.variables[variablePath][propertyName].rest;
|
|
480
|
-
if (property.type === "elevationAliases") return `var(--uds-background-blur-radius-${property.value})`;
|
|
481
|
-
}
|
|
482
|
-
return schemaValue.value === 0 ? "none" : `blur(${schemaValue.value}px)`;
|
|
483
|
-
}
|
|
484
|
-
},
|
|
485
|
-
blurBackgroundColor: {
|
|
486
|
-
...backgroundColor,
|
|
487
|
-
name: "blurBackgroundColor",
|
|
488
|
-
cssProperties: `--${BACKGROUND_BLUR_COLOR_PREFIX}`
|
|
489
|
-
},
|
|
490
|
-
blurBackgroundColorFallback: {
|
|
491
|
-
...backgroundColor,
|
|
492
|
-
name: "blurBackgroundColorFallback",
|
|
493
|
-
cssProperties: `--${BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX}`
|
|
494
|
-
},
|
|
504
|
+
scaleEffect,
|
|
505
|
+
backdropBlur,
|
|
506
|
+
blurBackgroundColor,
|
|
507
|
+
blurBackgroundColorFallback,
|
|
495
508
|
scrimBackgroundColor: {
|
|
496
509
|
name: "scrimBackgroundColor",
|
|
497
510
|
cssProperties: "--uds-scrim-background-color",
|
|
@@ -516,7 +529,8 @@ const publicProperties = {
|
|
|
516
529
|
cssProperties: "--uds-scrim-opacity",
|
|
517
530
|
twThemePath: () => "",
|
|
518
531
|
customValueRenderer: ({ value }) => `${String(value)}%`
|
|
519
|
-
}
|
|
532
|
+
},
|
|
533
|
+
paginationWidthVar
|
|
520
534
|
};
|
|
521
535
|
const internalProperties = {
|
|
522
536
|
outlineWidth,
|
|
@@ -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");
|
|
@@ -11,10 +12,10 @@ let lodash_es = require("lodash-es");
|
|
|
11
12
|
//#region ../tailwind-internal/dist/packages/automated-config/dist/utils/index.js
|
|
12
13
|
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
13
14
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
14
|
-
const CSS_GAP = "gap";
|
|
15
15
|
const CSS_PADDING = "padding";
|
|
16
|
-
const CSS_LINE_HEIGHT = "line-height";
|
|
17
16
|
const PAGINATION_CONTROL_SIZE_VAR = "--uds-pagination-control-size";
|
|
17
|
+
const CSS_GAP = "gap";
|
|
18
|
+
const CSS_LINE_HEIGHT = "line-height";
|
|
18
19
|
const CSS_BORDER_WIDTH = "border-width";
|
|
19
20
|
const CSS_BORDER_RADIUS = "border-radius";
|
|
20
21
|
const CSS_BORDER_COLOR = "border-color";
|
|
@@ -103,13 +104,28 @@ function getButtonLineHeightWithIconMinimum({ lineHeight, schema, iconLayerKey,
|
|
|
103
104
|
return lineHeight;
|
|
104
105
|
}
|
|
105
106
|
/**
|
|
106
|
-
* Shared pagination control
|
|
107
|
-
* Keeps page
|
|
107
|
+
* Shared pagination control content size: max(icon size, text line-height).
|
|
108
|
+
* Keeps page numbers and prev/next icons vertically centered when typography exceeds icon height.
|
|
108
109
|
*/
|
|
109
|
-
function
|
|
110
|
+
function getPaginationControlContentSize({ schema, iconLayerKey, textLayerKey, state, theme }) {
|
|
110
111
|
const iconSizeValue = schema.variables?.[iconLayerKey]?.size?.[state]?.value;
|
|
111
|
-
|
|
112
|
-
return `
|
|
112
|
+
const textVariantValue = schema.variables?.[textLayerKey]?.textVariant?.[state]?.value;
|
|
113
|
+
if (iconSizeValue && textVariantValue) return `max(${theme(require_properties.configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue))}, ${theme(require_mapTextVariantFixtureToValue.mapTextVariantFixtureToValue("lineHeight")("textVariants", textVariantValue))})`;
|
|
114
|
+
if (iconSizeValue) return theme(require_properties.configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue));
|
|
115
|
+
return "1em";
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Shared pagination control size: padding on all sides plus max(icon size, line-height).
|
|
119
|
+
* Used for both width and height so page circles stay square for single-digit labels.
|
|
120
|
+
*/
|
|
121
|
+
function getPaginationControlSize({ padding, schema, iconLayerKey, textLayerKey, state, theme }) {
|
|
122
|
+
return `calc(2 * ${padding} + ${getPaginationControlContentSize({
|
|
123
|
+
schema,
|
|
124
|
+
iconLayerKey,
|
|
125
|
+
textLayerKey,
|
|
126
|
+
state,
|
|
127
|
+
theme
|
|
128
|
+
})})`;
|
|
113
129
|
}
|
|
114
130
|
/**
|
|
115
131
|
* Forces button borders to use box-shadow instead of border properties.
|
|
@@ -353,20 +369,41 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
353
369
|
});
|
|
354
370
|
}
|
|
355
371
|
}
|
|
356
|
-
if (componentName === "pagination" && layer === "item"
|
|
357
|
-
|
|
358
|
-
if (
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
372
|
+
if (componentName === "pagination" && layer === "item") {
|
|
373
|
+
let padding;
|
|
374
|
+
if (propertyKey === "spacing") padding = cssDeclarations[CSS_PADDING];
|
|
375
|
+
else if (propertyKey === "paginationWidthVar") {
|
|
376
|
+
const itemSchemaKey = require_generateSchemaKey.generateSchemaKey({
|
|
377
|
+
variantKey,
|
|
378
|
+
variantValue,
|
|
379
|
+
layer: "item",
|
|
380
|
+
subComponentName
|
|
381
|
+
});
|
|
382
|
+
const paddingValue = schema.variables?.[itemSchemaKey]?.spacing?.[propertyState]?.value;
|
|
383
|
+
if (paddingValue) padding = theme(require_properties.configurableProperties.spacing.twThemePath("spacingAliases", paddingValue));
|
|
384
|
+
}
|
|
385
|
+
if (padding) {
|
|
386
|
+
const iconLayerKey = require_generateSchemaKey.generateSchemaKey({
|
|
362
387
|
variantKey,
|
|
363
388
|
variantValue,
|
|
364
389
|
layer: "icon",
|
|
365
390
|
subComponentName
|
|
366
|
-
})
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
391
|
+
});
|
|
392
|
+
const textLayerKey = require_generateSchemaKey.generateSchemaKey({
|
|
393
|
+
variantKey,
|
|
394
|
+
variantValue,
|
|
395
|
+
layer: "text",
|
|
396
|
+
subComponentName
|
|
397
|
+
});
|
|
398
|
+
cssDeclarations[PAGINATION_CONTROL_SIZE_VAR] = getPaginationControlSize({
|
|
399
|
+
padding,
|
|
400
|
+
schema,
|
|
401
|
+
iconLayerKey,
|
|
402
|
+
textLayerKey,
|
|
403
|
+
state: propertyState,
|
|
404
|
+
theme
|
|
405
|
+
});
|
|
406
|
+
}
|
|
370
407
|
}
|
|
371
408
|
if (componentName === "paddlenav" && layer === "root") {
|
|
372
409
|
if (propertyKey === "borderRadius" && cssDeclarations[CSS_BORDER_RADIUS]) cssDeclarations[NESTED_BORDER_RADIUS_SIZE_VAR] = cssDeclarations[CSS_BORDER_RADIUS];
|
|
@@ -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";
|
|
@@ -10,10 +11,10 @@ import { isFunction, mergeWith } from "lodash-es";
|
|
|
10
11
|
//#region ../tailwind-internal/dist/packages/automated-config/dist/utils/index.js
|
|
11
12
|
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
|
|
12
13
|
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
|
|
13
|
-
const CSS_GAP = "gap";
|
|
14
14
|
const CSS_PADDING = "padding";
|
|
15
|
-
const CSS_LINE_HEIGHT = "line-height";
|
|
16
15
|
const PAGINATION_CONTROL_SIZE_VAR = "--uds-pagination-control-size";
|
|
16
|
+
const CSS_GAP = "gap";
|
|
17
|
+
const CSS_LINE_HEIGHT = "line-height";
|
|
17
18
|
const CSS_BORDER_WIDTH = "border-width";
|
|
18
19
|
const CSS_BORDER_RADIUS = "border-radius";
|
|
19
20
|
const CSS_BORDER_COLOR = "border-color";
|
|
@@ -102,13 +103,28 @@ function getButtonLineHeightWithIconMinimum({ lineHeight, schema, iconLayerKey,
|
|
|
102
103
|
return lineHeight;
|
|
103
104
|
}
|
|
104
105
|
/**
|
|
105
|
-
* Shared pagination control
|
|
106
|
-
* Keeps page
|
|
106
|
+
* Shared pagination control content size: max(icon size, text line-height).
|
|
107
|
+
* Keeps page numbers and prev/next icons vertically centered when typography exceeds icon height.
|
|
107
108
|
*/
|
|
108
|
-
function
|
|
109
|
+
function getPaginationControlContentSize({ schema, iconLayerKey, textLayerKey, state, theme }) {
|
|
109
110
|
const iconSizeValue = schema.variables?.[iconLayerKey]?.size?.[state]?.value;
|
|
110
|
-
|
|
111
|
-
return `
|
|
111
|
+
const textVariantValue = schema.variables?.[textLayerKey]?.textVariant?.[state]?.value;
|
|
112
|
+
if (iconSizeValue && textVariantValue) return `max(${theme(configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue))}, ${theme(mapTextVariantFixtureToValue("lineHeight")("textVariants", textVariantValue))})`;
|
|
113
|
+
if (iconSizeValue) return theme(configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue));
|
|
114
|
+
return "1em";
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Shared pagination control size: padding on all sides plus max(icon size, line-height).
|
|
118
|
+
* Used for both width and height so page circles stay square for single-digit labels.
|
|
119
|
+
*/
|
|
120
|
+
function getPaginationControlSize({ padding, schema, iconLayerKey, textLayerKey, state, theme }) {
|
|
121
|
+
return `calc(2 * ${padding} + ${getPaginationControlContentSize({
|
|
122
|
+
schema,
|
|
123
|
+
iconLayerKey,
|
|
124
|
+
textLayerKey,
|
|
125
|
+
state,
|
|
126
|
+
theme
|
|
127
|
+
})})`;
|
|
112
128
|
}
|
|
113
129
|
/**
|
|
114
130
|
* Forces button borders to use box-shadow instead of border properties.
|
|
@@ -352,20 +368,41 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
352
368
|
});
|
|
353
369
|
}
|
|
354
370
|
}
|
|
355
|
-
if (componentName === "pagination" && layer === "item"
|
|
356
|
-
|
|
357
|
-
if (
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
371
|
+
if (componentName === "pagination" && layer === "item") {
|
|
372
|
+
let padding;
|
|
373
|
+
if (propertyKey === "spacing") padding = cssDeclarations[CSS_PADDING];
|
|
374
|
+
else if (propertyKey === "paginationWidthVar") {
|
|
375
|
+
const itemSchemaKey = generateSchemaKey({
|
|
376
|
+
variantKey,
|
|
377
|
+
variantValue,
|
|
378
|
+
layer: "item",
|
|
379
|
+
subComponentName
|
|
380
|
+
});
|
|
381
|
+
const paddingValue = schema.variables?.[itemSchemaKey]?.spacing?.[propertyState]?.value;
|
|
382
|
+
if (paddingValue) padding = theme(configurableProperties.spacing.twThemePath("spacingAliases", paddingValue));
|
|
383
|
+
}
|
|
384
|
+
if (padding) {
|
|
385
|
+
const iconLayerKey = generateSchemaKey({
|
|
361
386
|
variantKey,
|
|
362
387
|
variantValue,
|
|
363
388
|
layer: "icon",
|
|
364
389
|
subComponentName
|
|
365
|
-
})
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
390
|
+
});
|
|
391
|
+
const textLayerKey = generateSchemaKey({
|
|
392
|
+
variantKey,
|
|
393
|
+
variantValue,
|
|
394
|
+
layer: "text",
|
|
395
|
+
subComponentName
|
|
396
|
+
});
|
|
397
|
+
cssDeclarations[PAGINATION_CONTROL_SIZE_VAR] = getPaginationControlSize({
|
|
398
|
+
padding,
|
|
399
|
+
schema,
|
|
400
|
+
iconLayerKey,
|
|
401
|
+
textLayerKey,
|
|
402
|
+
state: propertyState,
|
|
403
|
+
theme
|
|
404
|
+
});
|
|
405
|
+
}
|
|
369
406
|
}
|
|
370
407
|
if (componentName === "paddlenav" && layer === "root") {
|
|
371
408
|
if (propertyKey === "borderRadius" && cssDeclarations[CSS_BORDER_RADIUS]) cssDeclarations[NESTED_BORDER_RADIUS_SIZE_VAR] = cssDeclarations[CSS_BORDER_RADIUS];
|