@yahoo/uds 3.157.0 → 3.158.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automated-config/dist/generated/autoVariants.cjs +26 -0
- package/dist/automated-config/dist/generated/autoVariants.d.cts +17 -0
- package/dist/automated-config/dist/generated/autoVariants.d.ts +17 -0
- package/dist/automated-config/dist/generated/autoVariants.js +26 -0
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +3287 -596
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +350 -12
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +350 -12
- package/dist/automated-config/dist/generated/generatedConfigs.js +3285 -597
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +276 -45
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +8 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +8 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +276 -45
- package/dist/automated-config/dist/properties.cjs +8 -1
- package/dist/automated-config/dist/properties.d.cts +8 -0
- package/dist/automated-config/dist/properties.d.ts +8 -0
- package/dist/automated-config/dist/properties.js +8 -1
- package/dist/automated-config/dist/types/ComponentConfig.d.cts +3 -1
- package/dist/automated-config/dist/types/ComponentConfig.d.ts +3 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.cjs +48 -33
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +14 -4
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +14 -4
- package/dist/automated-config/dist/utils/buildConfigSchema.js +49 -34
- package/dist/automated-config/dist/utils/componentStatePseudoStates.cjs +4 -0
- package/dist/automated-config/dist/utils/componentStatePseudoStates.js +4 -1
- package/dist/automated-config/dist/utils/getButtonControlHeight.cjs +129 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.d.cts +133 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.d.ts +133 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.js +122 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.cjs +114 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.d.cts +78 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.d.ts +78 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.js +108 -0
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.cjs +5 -2
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.js +6 -3
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.cjs +110 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.d.cts +19 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.d.ts +19 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.js +108 -0
- package/dist/automated-config/dist/utils/index.cjs +106 -33
- package/dist/automated-config/dist/utils/index.d.cts +16 -4
- package/dist/automated-config/dist/utils/index.d.ts +16 -4
- package/dist/automated-config/dist/utils/index.js +107 -34
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.cjs +15 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.d.cts +20 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.d.ts +20 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.js +15 -0
- package/dist/automated-config/dist/utils/pseudoStateSelectors.cjs +6 -3
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.cts +1 -1
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.ts +1 -1
- package/dist/automated-config/dist/utils/pseudoStateSelectors.js +6 -3
- package/dist/components/client/Button.cjs +3 -3
- package/dist/components/client/Button.js +3 -3
- package/dist/components/client/Input/Input.cjs +1 -1
- package/dist/components/client/Input/Input.js +1 -1
- package/dist/components/client/Menu/Menu.Item.cjs +1 -0
- package/dist/components/client/Menu/Menu.Item.js +1 -0
- package/dist/components/client/Select/Select.cjs +179 -0
- package/dist/components/client/Select/Select.d.cts +55 -0
- package/dist/components/client/Select/Select.d.ts +56 -0
- package/dist/components/client/Select/Select.js +176 -0
- package/dist/components/client/Select/SelectContent.cjs +75 -0
- package/dist/components/client/Select/SelectContent.d.cts +44 -0
- package/dist/components/client/Select/SelectContent.d.ts +45 -0
- package/dist/components/client/Select/SelectContent.js +73 -0
- package/dist/components/client/Select/SelectDivider.cjs +63 -0
- package/dist/components/client/Select/SelectDivider.d.cts +44 -0
- package/dist/components/client/Select/SelectDivider.d.ts +45 -0
- package/dist/components/client/Select/SelectDivider.js +61 -0
- package/dist/components/client/Select/SelectHelpText.cjs +51 -0
- package/dist/components/client/Select/SelectHelpText.d.cts +27 -0
- package/dist/components/client/Select/SelectHelpText.d.ts +28 -0
- package/dist/components/client/Select/SelectHelpText.js +48 -0
- package/dist/components/client/Select/SelectItem.cjs +172 -0
- package/dist/components/client/Select/SelectItem.d.cts +29 -0
- package/dist/components/client/Select/SelectItem.d.ts +30 -0
- package/dist/components/client/Select/SelectItem.js +170 -0
- package/dist/components/client/Select/SelectTrigger.cjs +138 -0
- package/dist/components/client/Select/SelectTrigger.d.cts +27 -0
- package/dist/components/client/Select/SelectTrigger.d.ts +28 -0
- package/dist/components/client/Select/SelectTrigger.js +136 -0
- package/dist/components/client/Select/SelectValue.cjs +28 -0
- package/dist/components/client/Select/SelectValue.d.cts +19 -0
- package/dist/components/client/Select/SelectValue.d.ts +20 -0
- package/dist/components/client/Select/SelectValue.js +26 -0
- package/dist/components/client/Select/index.cjs +11 -0
- package/dist/components/client/Select/index.d.cts +6 -0
- package/dist/components/client/Select/index.d.ts +7 -0
- package/dist/components/client/Select/index.js +7 -0
- package/dist/components/client/Select/selectContext.cjs +20 -0
- package/dist/components/client/Select/selectContext.d.cts +23 -0
- package/dist/components/client/Select/selectContext.d.ts +24 -0
- package/dist/components/client/Select/selectContext.js +16 -0
- package/dist/components/client/Select/selectFieldStyles.cjs +85 -0
- package/dist/components/client/Select/selectFieldStyles.d.cts +37 -0
- package/dist/components/client/Select/selectFieldStyles.d.ts +38 -0
- package/dist/components/client/Select/selectFieldStyles.js +75 -0
- package/dist/components/client/index.cjs +8 -0
- package/dist/components/client/index.d.cts +5 -1
- package/dist/components/client/index.d.ts +5 -1
- package/dist/components/client/index.js +5 -1
- package/dist/components/index.cjs +8 -0
- package/dist/components/index.d.cts +5 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +5 -1
- package/dist/config/dist/index.cjs +383 -73
- package/dist/config/dist/index.js +383 -73
- package/dist/css/dist/css/utils.cjs +3 -0
- package/dist/css/dist/css/utils.js +3 -0
- package/dist/css/dist/packages/automated-config/dist/properties.cjs +8 -1
- package/dist/css/dist/packages/automated-config/dist/properties.js +8 -1
- package/dist/css/dist/packages/config/dist/index.cjs +383 -73
- package/dist/css/dist/packages/config/dist/index.js +383 -73
- package/dist/css-tokens/dist/index.cjs +2 -0
- package/dist/css-tokens/dist/index.d.cts +2 -1
- package/dist/css-tokens/dist/index.d.ts +2 -1
- package/dist/css-tokens/dist/index.js +2 -1
- package/dist/index.cjs +34 -0
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +11 -3
- package/dist/styles/styler.d.cts +29 -12
- package/dist/styles/styler.d.ts +29 -12
- package/dist/styles/variants.d.cts +54 -0
- package/dist/styles/variants.d.ts +54 -0
- package/dist/tailwind/utils/index.cjs +3 -0
- package/dist/tailwind/utils/index.d.cts +2 -1
- package/dist/tailwind/utils/index.d.ts +2 -1
- package/dist/tailwind/utils/index.js +2 -1
- package/dist/tailwind-internal/dist/base/addColorModeVars.cjs +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVars.js +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVarsV2.cjs +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVarsV2.js +1 -1
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.cjs +74 -6
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.d.cts +14 -0
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.d.ts +14 -0
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.js +74 -7
- package/dist/tailwind-internal/dist/components/getResponsiveTextStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/components/getResponsiveTextStyles.js +1 -1
- package/dist/tailwind-internal/dist/index.d.cts +1 -0
- package/dist/tailwind-internal/dist/index.d.ts +1 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.cjs +3287 -596
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +3285 -597
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.cjs +8 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.js +8 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.cjs +4 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.js +4 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.cjs +126 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.js +123 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.cjs +20 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.js +20 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +103 -33
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +104 -34
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.cjs +6 -3
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.js +6 -3
- package/dist/tailwind-internal/dist/packages/config/dist/index.cjs +383 -73
- package/dist/tailwind-internal/dist/packages/config/dist/index.js +383 -73
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.cjs +12 -10
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.js +3 -2
- package/dist/tailwind-internal/dist/plugins/a11y.cjs +6 -2
- package/dist/tailwind-internal/dist/plugins/a11y.js +6 -2
- package/dist/tailwind-internal/dist/plugins/blurBgFallback.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/blurBgFallback.js +1 -1
- package/dist/tailwind-internal/dist/plugins/borderRadius.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/borderRadius.js +1 -1
- package/dist/tailwind-internal/dist/plugins/borderWidth.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/borderWidth.js +1 -1
- package/dist/tailwind-internal/dist/plugins/colors.cjs +2 -2
- package/dist/tailwind-internal/dist/plugins/colors.js +2 -2
- package/dist/tailwind-internal/dist/plugins/components.cjs +5 -2
- package/dist/tailwind-internal/dist/plugins/components.js +6 -3
- package/dist/tailwind-internal/dist/plugins/elevation.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/elevation.js +1 -1
- package/dist/tailwind-internal/dist/plugins/shadows.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/shadows.js +1 -1
- package/dist/tailwind-internal/dist/plugins/typography.cjs +2 -2
- package/dist/tailwind-internal/dist/plugins/typography.js +2 -2
- package/dist/tailwind-internal/dist/utils/getElevationStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getElevationStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getFontStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getFontStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getMotionStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getMotionStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowPresetValues.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowPresetValues.js +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/parseTokens.cjs +2 -2
- package/dist/tailwind-internal/dist/utils/parseTokens.js +2 -2
- package/dist/tokens/automation/configs/index.cjs +3 -0
- package/dist/tokens/automation/configs/index.d.cts +2 -2
- package/dist/tokens/automation/configs/index.d.ts +2 -2
- package/dist/tokens/automation/configs/index.js +2 -2
- package/dist/tokens/automation/index.cjs +25 -0
- package/dist/tokens/automation/index.d.cts +6 -2
- package/dist/tokens/automation/index.d.ts +6 -2
- package/dist/tokens/automation/index.js +6 -2
- package/dist/tokens/consts/cssTokens.cjs +1 -0
- package/dist/tokens/consts/cssTokens.d.cts +2 -2
- package/dist/tokens/consts/cssTokens.d.ts +2 -2
- package/dist/tokens/consts/cssTokens.js +2 -2
- package/dist/tokens/index.cjs +26 -0
- package/dist/tokens/index.d.cts +8 -4
- package/dist/tokens/index.d.ts +8 -4
- package/dist/tokens/index.js +7 -3
- package/dist/tokens/types.d.cts +2 -2
- package/dist/tokens/types.d.ts +2 -2
- package/dist/types/dist/index.d.cts +36 -1
- package/dist/types/dist/index.d.ts +36 -1
- package/dist/uds/generated/componentData.cjs +718 -308
- package/dist/uds/generated/componentData.js +718 -308
- package/dist/uds/generated/migrationSchemaVersion.cjs +1 -1
- package/dist/uds/generated/migrationSchemaVersion.js +1 -1
- package/dist/uds/generated/tailwindPurge.cjs +1501 -315
- package/dist/uds/generated/tailwindPurge.js +1501 -315
- package/generated/componentData.json +897 -398
- package/generated/migrationSchemaVersion.ts +1 -1
- package/generated/tailwindPurge.ts +4 -4
- package/package.json +1 -1
|
@@ -3,12 +3,13 @@ import { BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED,
|
|
|
3
3
|
import { mapTextVariantFixtureToValue } from "../mapTextVariantFixtureToValue.js";
|
|
4
4
|
import { configurableProperties } from "../properties.js";
|
|
5
5
|
import { INTERACTIVE_ATOMICS, MODIFIER_ATOMICS, comparePriority } from "../types/StateAxis.js";
|
|
6
|
-
import { getExcludedPseudoStatesForComponentStateOption } from "./componentStatePseudoStates.js";
|
|
6
|
+
import { getExcludedLayersForComponentStateOption, getExcludedPseudoStatesForComponentStateOption } from "./componentStatePseudoStates.js";
|
|
7
7
|
import { generateSchemaKey } from "./generateSchemaKey.js";
|
|
8
8
|
import { atomicAndCompoundStateKeys, resolvePropertyStates } from "./resolvePropertyStates.js";
|
|
9
9
|
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.js";
|
|
10
10
|
import { findFixtureTypeForValue } from "./buildConfigSchema.js";
|
|
11
11
|
import { generateDefaultClassName } from "./generateDefaultClassName.js";
|
|
12
|
+
import { applyButtonControlHeightDeclarations, applyIconButtonControlHeightDeclarations, getButtonContentLineHeight } from "./getButtonControlHeight.js";
|
|
12
13
|
import { getStateDocsClass, getStateSelector } from "./pseudoStateSelectors.js";
|
|
13
14
|
import { resolveSlotByCascade } from "./resolveSlotByCascade.js";
|
|
14
15
|
import { isFunction, mergeWith } from "lodash-es";
|
|
@@ -74,7 +75,8 @@ const COMPONENTS_WITH_SHADOW_BORDERS = [
|
|
|
74
75
|
const LEGACY_STATE_KEYS = [
|
|
75
76
|
"disabled",
|
|
76
77
|
"focused",
|
|
77
|
-
"focused-keyboard"
|
|
78
|
+
"focused-keyboard",
|
|
79
|
+
"selected"
|
|
78
80
|
];
|
|
79
81
|
/**
|
|
80
82
|
* Enumerates every canonical state key the system supports: rest, every atom,
|
|
@@ -115,15 +117,9 @@ function buildStateRecord(transform) {
|
|
|
115
117
|
}
|
|
116
118
|
buildStateRecord(getStateDocsClass);
|
|
117
119
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* @returns Enhanced line-height CSS value with max(), or original value if icon size unavailable
|
|
120
|
+
* Layout line-height for button root: icon size only (not textVariant line-height).
|
|
121
|
+
* @see getButtonContentLineHeight
|
|
121
122
|
*/
|
|
122
|
-
function getButtonLineHeightWithIconMinimum({ lineHeight, schema, iconLayerKey, state, theme }) {
|
|
123
|
-
const iconSizeValue = schema.variables?.[iconLayerKey]?.size?.[state]?.value;
|
|
124
|
-
if (iconSizeValue) return `max(${lineHeight}, ${theme(configurableProperties.iconSize.twThemePath("iconSizes", iconSizeValue))})`;
|
|
125
|
-
return lineHeight;
|
|
126
|
-
}
|
|
127
123
|
/**
|
|
128
124
|
* Shared pagination control content size: max(icon size, text line-height).
|
|
129
125
|
* Keeps page numbers and prev/next icons vertically centered when typography exceeds icon height.
|
|
@@ -244,6 +240,14 @@ function generateClassName({ componentName, subComponentName, variantKey, varian
|
|
|
244
240
|
if (layerOptionalPseudoSelector) className = `${className}${layerOptionalPseudoSelector}`;
|
|
245
241
|
return className.replaceAll(/\s+/g, "-");
|
|
246
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Select triggers carry `uds-ring-shadow` and draw focus via the focus-ring tokens.
|
|
245
|
+
* Input wrappers still use `focus-within` border styling, so exclude `.uds-ring` and
|
|
246
|
+
* `.uds-select-field-trigger` descendants from those rules.
|
|
247
|
+
*/
|
|
248
|
+
function getLayerClassSelector(layer, className, componentName, propertyStateSelector) {
|
|
249
|
+
return componentName === "input" && (layer === "inputWrapperDynamic" || layer === "inputWrapper") && propertyStateSelector.includes("focus-within") ? `.${className}:not(.uds-ring):not(.uds-select-field-trigger)` : `.${className}`;
|
|
250
|
+
}
|
|
247
251
|
const getTheCssPropertyValue = (schema, theme, propertyName, schemaStateValue, existingValue, originalPropertyDefinition) => {
|
|
248
252
|
const { value, type } = schemaStateValue;
|
|
249
253
|
const propertyConfig = configurableProperties[propertyName];
|
|
@@ -305,8 +309,16 @@ function selectiveEmittedStates(stateMap, orderedStateKeys, emittableStates) {
|
|
|
305
309
|
}
|
|
306
310
|
return emitted;
|
|
307
311
|
}
|
|
308
|
-
function generateDeclaration({ componentName, subComponentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, componentStateKey, componentStateValue, schema, propertyKey, originalPropertyDefinition, declaredStates, layerUsesAtomicStates, theme, currentStyles, previewOptions, excludedPseudoStates = [], emit, fallbackStateMap, bumpRootSpecificity }) {
|
|
312
|
+
function generateDeclaration({ componentName, subComponentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, componentStateKey, componentStateValue, schema, propertyKey, originalPropertyDefinition, declaredStates, layerUsesAtomicStates, theme, currentStyles, previewOptions, excludedPseudoStates = [], emit, fallbackStateMap, bumpRootSpecificity, buttonHeightReferenceSchema }) {
|
|
309
313
|
const shouldUseExhaustive = (emit ?? "exhaustive") === "exhaustive" && layerUsesAtomicStates;
|
|
314
|
+
const { cssProperties: configuredCssProperties, extendedProperties: configuredExtendedGetter } = configurableProperties[originalPropertyDefinition.name];
|
|
315
|
+
const configuredExtendedProperties = isFunction(configuredExtendedGetter) ? configuredExtendedGetter({
|
|
316
|
+
componentName,
|
|
317
|
+
subComponentName,
|
|
318
|
+
layer,
|
|
319
|
+
propertyKey
|
|
320
|
+
}) : configuredExtendedGetter;
|
|
321
|
+
if (!(typeof configuredCssProperties === "string" && configuredCssProperties.length > 0 || Array.isArray(configuredCssProperties) && configuredCssProperties.length > 0 || Array.isArray(configuredExtendedProperties) && configuredExtendedProperties.length > 0)) return {};
|
|
310
322
|
const schemaKey = generateSchemaKey({
|
|
311
323
|
variantKey,
|
|
312
324
|
variantValue,
|
|
@@ -335,7 +347,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
335
347
|
for (const propStateStr of orderedStateKeys) {
|
|
336
348
|
if (!emittableStates.has(propStateStr)) continue;
|
|
337
349
|
const propertyState = propStateStr;
|
|
338
|
-
|
|
350
|
+
let propertyStateSelector = getStateSelector(propertyState);
|
|
351
|
+
if (componentName === "selectitem" && propertyState === "focused") propertyStateSelector = ":is(:focus, [data-active-item])";
|
|
339
352
|
const schemaValueForState = shouldUseExhaustive || layerUsesAtomicStates ? resolveSlotByCascade(propStateStr, resolutionStates) : propertyStateMap[propertyState];
|
|
340
353
|
if (!schemaValueForState) continue;
|
|
341
354
|
if (!shouldUseExhaustive) {
|
|
@@ -394,7 +407,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
394
407
|
layerOptionalPseudoSelector,
|
|
395
408
|
subComponentName
|
|
396
409
|
});
|
|
397
|
-
|
|
410
|
+
const layerClassSelector = getLayerClassSelector(layer, className, componentName, propertyStateSelector);
|
|
411
|
+
fullClassName = `.${rootVariantClassName}${propertyStateSelector}.${rootVariantClassNameWithComponentState} ${layerClassSelector}`;
|
|
398
412
|
} else {
|
|
399
413
|
className = generateClassName({
|
|
400
414
|
componentName,
|
|
@@ -404,7 +418,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
404
418
|
layerOptionalPseudoSelector,
|
|
405
419
|
subComponentName
|
|
406
420
|
});
|
|
407
|
-
|
|
421
|
+
const layerClassSelector = getLayerClassSelector(layer, className, componentName, propertyStateSelector);
|
|
422
|
+
fullClassName = bumpRootSpecificity ? `.${rootVariantClassName}.${rootVariantClassName}${propertyStateSelector} ${layerClassSelector}` : `.${rootVariantClassName}${propertyStateSelector} ${layerClassSelector}`;
|
|
408
423
|
}
|
|
409
424
|
}
|
|
410
425
|
const { cssProperties, extendedProperties: extendedPropertiesGetter } = configurableProperties[originalPropertyDefinition.name];
|
|
@@ -441,6 +456,28 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
441
456
|
*/
|
|
442
457
|
if (componentName === "button" && layer === "root") {
|
|
443
458
|
if (propertyKey === CSS_GAP) cssDeclarations[BUTTON_GAP_VAR] = cssDeclarations[CSS_GAP];
|
|
459
|
+
if (propertyKey === "spacingVertical") {
|
|
460
|
+
const paddingVertical = cssDeclarations["padding-top"];
|
|
461
|
+
if (paddingVertical) applyButtonControlHeightDeclarations({
|
|
462
|
+
cssDeclarations,
|
|
463
|
+
paddingVertical,
|
|
464
|
+
schema,
|
|
465
|
+
rootLayerKey: generateSchemaKey({
|
|
466
|
+
variantKey,
|
|
467
|
+
variantValue,
|
|
468
|
+
layer: "root",
|
|
469
|
+
subComponentName
|
|
470
|
+
}),
|
|
471
|
+
iconLayerKey: generateSchemaKey({
|
|
472
|
+
variantKey,
|
|
473
|
+
variantValue,
|
|
474
|
+
layer: "icon",
|
|
475
|
+
subComponentName
|
|
476
|
+
}),
|
|
477
|
+
state: propertyState,
|
|
478
|
+
theme
|
|
479
|
+
});
|
|
480
|
+
}
|
|
444
481
|
if (propertyKey === "scaleEffect" && propertyState === "hover") {
|
|
445
482
|
const rootClassName = `.${className}`;
|
|
446
483
|
const renderValue = (schemaValue) => configurableProperties.scaleEffect.customValueRenderer?.(schemaValue, schema, () => "") ?? "1";
|
|
@@ -449,17 +486,39 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
449
486
|
if (propertyStateMap.hover) styles[rootClassName][BUTTON_SCALE_EFFECT_HOVER] = renderValue(propertyStateMap.hover);
|
|
450
487
|
if (propertyStateMap.pressed) styles[rootClassName][BUTTON_SCALE_EFFECT_PRESSED] = renderValue(propertyStateMap.pressed);
|
|
451
488
|
}
|
|
452
|
-
if (cssDeclarations[CSS_LINE_HEIGHT]) {
|
|
453
|
-
|
|
489
|
+
if (cssDeclarations[CSS_LINE_HEIGHT]) cssDeclarations[CSS_LINE_HEIGHT] = getButtonContentLineHeight({
|
|
490
|
+
schema,
|
|
491
|
+
rootLayerKey: generateSchemaKey({
|
|
492
|
+
variantKey,
|
|
493
|
+
variantValue,
|
|
494
|
+
layer: "root",
|
|
495
|
+
subComponentName
|
|
496
|
+
}),
|
|
497
|
+
iconLayerKey: generateSchemaKey({
|
|
454
498
|
variantKey,
|
|
455
499
|
variantValue,
|
|
456
500
|
layer: "icon",
|
|
457
501
|
subComponentName
|
|
458
|
-
})
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
502
|
+
}),
|
|
503
|
+
state: propertyState,
|
|
504
|
+
theme
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
if (componentName === "iconbutton" && layer === "root") {
|
|
508
|
+
if (propertyKey === "spacing") {
|
|
509
|
+
const paddingVertical = cssDeclarations[CSS_PADDING];
|
|
510
|
+
if (paddingVertical) applyIconButtonControlHeightDeclarations({
|
|
511
|
+
cssDeclarations,
|
|
512
|
+
paddingVertical,
|
|
513
|
+
iconButtonSchema: schema,
|
|
514
|
+
buttonHeightReferenceSchema,
|
|
515
|
+
variantValue,
|
|
516
|
+
iconLayerKey: generateSchemaKey({
|
|
517
|
+
variantKey,
|
|
518
|
+
variantValue,
|
|
519
|
+
layer: "icon",
|
|
520
|
+
subComponentName
|
|
521
|
+
}),
|
|
463
522
|
state: propertyState,
|
|
464
523
|
theme
|
|
465
524
|
});
|
|
@@ -501,8 +560,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
501
560
|
});
|
|
502
561
|
}
|
|
503
562
|
}
|
|
563
|
+
if (propertyKey === "borderRadius" && cssDeclarations[CSS_BORDER_RADIUS] && (componentName === "paddlenav" && layer === "root" || componentName === "input" && layer === "inputWrapperDynamic")) cssDeclarations[NESTED_BORDER_RADIUS_SIZE_VAR] = cssDeclarations[CSS_BORDER_RADIUS];
|
|
504
564
|
if (componentName === "paddlenav" && layer === "root") {
|
|
505
|
-
if (propertyKey === "borderRadius" && cssDeclarations[CSS_BORDER_RADIUS]) cssDeclarations[NESTED_BORDER_RADIUS_SIZE_VAR] = cssDeclarations[CSS_BORDER_RADIUS];
|
|
506
565
|
if (propertyKey === "borderWidth" && cssDeclarations[CSS_BORDER_WIDTH]) cssDeclarations[NESTED_BORDER_RADIUS_WIDTH_VAR] = cssDeclarations[CSS_BORDER_WIDTH];
|
|
507
566
|
}
|
|
508
567
|
if ((componentName === "tabs" || componentName === "tab") && layer === "root") {
|
|
@@ -638,7 +697,7 @@ function emitSchemaOverrideStyles({ componentName, subComponentName, variantKey,
|
|
|
638
697
|
* layers express the variant's universal baseline, with per-state overrides
|
|
639
698
|
* winning via class-compound specificity).
|
|
640
699
|
*/
|
|
641
|
-
function emitUniversalLayers({ componentName, subComponentName, variantKey, variantOption, layers, schema, theme, previewOptions, emit, currentStyles, bumpRootSpecificity }) {
|
|
700
|
+
function emitUniversalLayers({ componentName, subComponentName, variantKey, variantOption, layers, schema, theme, previewOptions, emit, currentStyles, bumpRootSpecificity, buttonHeightReferenceSchema }) {
|
|
642
701
|
let styles = currentStyles;
|
|
643
702
|
const variables = schema.variables;
|
|
644
703
|
for (const layerKey in layers) {
|
|
@@ -669,14 +728,15 @@ function emitUniversalLayers({ componentName, subComponentName, variantKey, vari
|
|
|
669
728
|
currentStyles: styles,
|
|
670
729
|
previewOptions,
|
|
671
730
|
emit,
|
|
672
|
-
bumpRootSpecificity
|
|
731
|
+
bumpRootSpecificity,
|
|
732
|
+
buttonHeightReferenceSchema
|
|
673
733
|
});
|
|
674
734
|
styles = deepMerge(styles, declarations);
|
|
675
735
|
}
|
|
676
736
|
}
|
|
677
737
|
return styles;
|
|
678
738
|
}
|
|
679
|
-
function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
739
|
+
function generateConfigStyles(config, schema, theme, previewOptions, emit, generateStylesContext) {
|
|
680
740
|
const componentName = config.label.toLowerCase();
|
|
681
741
|
let styles = {};
|
|
682
742
|
for (const variantKey in config.variants) {
|
|
@@ -692,14 +752,17 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
692
752
|
previewOptions,
|
|
693
753
|
emit,
|
|
694
754
|
currentStyles: styles,
|
|
695
|
-
bumpRootSpecificity: true
|
|
755
|
+
bumpRootSpecificity: true,
|
|
756
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
696
757
|
});
|
|
697
758
|
const componentStates = variantConfig.componentStates;
|
|
698
759
|
for (const componentStateKey in componentStates) {
|
|
699
760
|
const componentState = componentStates[componentStateKey];
|
|
700
761
|
for (const componentStateOption of componentState.options) {
|
|
701
762
|
const excludedPseudoStates = getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption);
|
|
763
|
+
const excludedLayers = new Set(getExcludedLayersForComponentStateOption(componentState, componentStateOption));
|
|
702
764
|
for (const layerKey in componentState.layers) {
|
|
765
|
+
if (excludedLayers.has(layerKey)) continue;
|
|
703
766
|
const layer = componentState.layers[layerKey];
|
|
704
767
|
for (const propertyKey in layer.properties) {
|
|
705
768
|
const originalPropertyDefinition = layer.properties[propertyKey];
|
|
@@ -720,7 +783,8 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
720
783
|
currentStyles: styles,
|
|
721
784
|
previewOptions,
|
|
722
785
|
excludedPseudoStates,
|
|
723
|
-
emit
|
|
786
|
+
emit,
|
|
787
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
724
788
|
});
|
|
725
789
|
styles = deepMerge(styles, declarations);
|
|
726
790
|
}
|
|
@@ -747,7 +811,8 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
747
811
|
theme,
|
|
748
812
|
previewOptions,
|
|
749
813
|
emit,
|
|
750
|
-
currentStyles: styles
|
|
814
|
+
currentStyles: styles,
|
|
815
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
751
816
|
});
|
|
752
817
|
}
|
|
753
818
|
if (config.subComponents) {
|
|
@@ -766,14 +831,17 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
766
831
|
previewOptions,
|
|
767
832
|
emit,
|
|
768
833
|
currentStyles: styles,
|
|
769
|
-
bumpRootSpecificity: true
|
|
834
|
+
bumpRootSpecificity: true,
|
|
835
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
770
836
|
});
|
|
771
837
|
const componentStates = variantConfig.componentStates;
|
|
772
838
|
for (const componentStateKey in componentStates) {
|
|
773
839
|
const componentState = componentStates[componentStateKey];
|
|
774
840
|
for (const componentStateOption of componentState.options) {
|
|
775
841
|
const excludedPseudoStates = getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption);
|
|
842
|
+
const excludedLayers = new Set(getExcludedLayersForComponentStateOption(componentState, componentStateOption));
|
|
776
843
|
for (const layerKey in componentState.layers) {
|
|
844
|
+
if (excludedLayers.has(layerKey)) continue;
|
|
777
845
|
const layer = componentState.layers[layerKey];
|
|
778
846
|
for (const propertyKey in layer.properties) {
|
|
779
847
|
const originalPropertyDefinition = layer.properties[propertyKey];
|
|
@@ -795,7 +863,8 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
795
863
|
currentStyles: styles,
|
|
796
864
|
previewOptions,
|
|
797
865
|
excludedPseudoStates,
|
|
798
|
-
emit
|
|
866
|
+
emit,
|
|
867
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
799
868
|
});
|
|
800
869
|
styles = deepMerge(styles, declarations);
|
|
801
870
|
}
|
|
@@ -824,7 +893,8 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
824
893
|
theme,
|
|
825
894
|
previewOptions,
|
|
826
895
|
emit,
|
|
827
|
-
currentStyles: styles
|
|
896
|
+
currentStyles: styles,
|
|
897
|
+
buttonHeightReferenceSchema: generateStylesContext?.buttonHeightReferenceSchema
|
|
828
898
|
});
|
|
829
899
|
}
|
|
830
900
|
}
|
|
@@ -858,8 +928,8 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit) {
|
|
|
858
928
|
* @param previewOptions - Options for generating preview mode class modifiers
|
|
859
929
|
* @returns CSS styles object with grouped selectors for default aliases
|
|
860
930
|
*/
|
|
861
|
-
const generateStylesInner = (config, schema, theme, previewOptions) => {
|
|
862
|
-
const styles = generateConfigStyles(config, schema, theme, previewOptions, previewOptions.emit ?? "exhaustive");
|
|
931
|
+
const generateStylesInner = (config, schema, theme, previewOptions, generateStylesContext) => {
|
|
932
|
+
const styles = generateConfigStyles(config, schema, theme, previewOptions, previewOptions.emit ?? "exhaustive", generateStylesContext);
|
|
863
933
|
if (!config.variants && !config.subComponents) return styles;
|
|
864
934
|
const componentName = config.label.toLowerCase();
|
|
865
935
|
if (componentName !== "button" && componentName !== "iconbutton") return styles;
|
|
@@ -940,6 +1010,6 @@ const generateStylesInner = (config, schema, theme, previewOptions) => {
|
|
|
940
1010
|
* list, so minifiers leave their specificity intact. (gzip already collapses the
|
|
941
1011
|
* repeated declaration blocks, so the shipped-size cost is minimal.)
|
|
942
1012
|
*/
|
|
943
|
-
const generateStyles = (config, schema, theme, previewOptions) => generateStylesInner(config, schema, theme, previewOptions);
|
|
1013
|
+
const generateStyles = (config, schema, theme, previewOptions, generateStylesContext) => generateStylesInner(config, schema, theme, previewOptions, generateStylesContext);
|
|
944
1014
|
//#endregion
|
|
945
1015
|
export { generateStyles };
|
package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.cjs
CHANGED
|
@@ -7,7 +7,8 @@ const require_canonicalizeStateKey = require("./canonicalizeStateKey.cjs");
|
|
|
7
7
|
const LEGACY_STATE_ATOMS = new Set([
|
|
8
8
|
"disabled",
|
|
9
9
|
"focused",
|
|
10
|
-
"focused-keyboard"
|
|
10
|
+
"focused-keyboard",
|
|
11
|
+
"selected"
|
|
11
12
|
]);
|
|
12
13
|
function isKnownStateAtom(atom) {
|
|
13
14
|
return require_StateAxis.isAtomicState(atom) || LEGACY_STATE_ATOMS.has(atom);
|
|
@@ -65,7 +66,8 @@ const ATOMIC_SELECTORS = {
|
|
|
65
66
|
readonly: ":has(:read-only:where(input, textarea))",
|
|
66
67
|
invalid: ":has([aria-invalid=\"true\"])",
|
|
67
68
|
"placeholder-shown": ":has(:placeholder-shown)",
|
|
68
|
-
autofill: ":has(:autofill, :-webkit-autofill)"
|
|
69
|
+
autofill: ":has(:autofill, :-webkit-autofill)",
|
|
70
|
+
selected: "[aria-selected=\"true\"]"
|
|
69
71
|
};
|
|
70
72
|
const ATOMIC_DOCS_CLASSES = {
|
|
71
73
|
hover: "hover",
|
|
@@ -79,7 +81,8 @@ const ATOMIC_DOCS_CLASSES = {
|
|
|
79
81
|
readonly: "input-readonly",
|
|
80
82
|
invalid: "has-input-invalid",
|
|
81
83
|
"placeholder-shown": "has-input-placeholder-shown",
|
|
82
|
-
autofill: "has-input-autofill"
|
|
84
|
+
autofill: "has-input-autofill",
|
|
85
|
+
selected: "aria-selected"
|
|
83
86
|
};
|
|
84
87
|
/**
|
|
85
88
|
* Returns the CSS pseudo-selector string for a state key.
|
package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.js
CHANGED
|
@@ -7,7 +7,8 @@ import { splitStateKey } from "./canonicalizeStateKey.js";
|
|
|
7
7
|
const LEGACY_STATE_ATOMS = new Set([
|
|
8
8
|
"disabled",
|
|
9
9
|
"focused",
|
|
10
|
-
"focused-keyboard"
|
|
10
|
+
"focused-keyboard",
|
|
11
|
+
"selected"
|
|
11
12
|
]);
|
|
12
13
|
function isKnownStateAtom(atom) {
|
|
13
14
|
return isAtomicState(atom) || LEGACY_STATE_ATOMS.has(atom);
|
|
@@ -65,7 +66,8 @@ const ATOMIC_SELECTORS = {
|
|
|
65
66
|
readonly: ":has(:read-only:where(input, textarea))",
|
|
66
67
|
invalid: ":has([aria-invalid=\"true\"])",
|
|
67
68
|
"placeholder-shown": ":has(:placeholder-shown)",
|
|
68
|
-
autofill: ":has(:autofill, :-webkit-autofill)"
|
|
69
|
+
autofill: ":has(:autofill, :-webkit-autofill)",
|
|
70
|
+
selected: "[aria-selected=\"true\"]"
|
|
69
71
|
};
|
|
70
72
|
const ATOMIC_DOCS_CLASSES = {
|
|
71
73
|
hover: "hover",
|
|
@@ -79,7 +81,8 @@ const ATOMIC_DOCS_CLASSES = {
|
|
|
79
81
|
readonly: "input-readonly",
|
|
80
82
|
invalid: "has-input-invalid",
|
|
81
83
|
"placeholder-shown": "has-input-placeholder-shown",
|
|
82
|
-
autofill: "has-input-autofill"
|
|
84
|
+
autofill: "has-input-autofill",
|
|
85
|
+
selected: "aria-selected"
|
|
83
86
|
};
|
|
84
87
|
/**
|
|
85
88
|
* Returns the CSS pseudo-selector string for a state key.
|