@yahoo/uds 3.167.0 → 3.168.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.
Files changed (49) hide show
  1. package/dist/automated-config/dist/generated/generatedConfigs.cjs +92 -46
  2. package/dist/automated-config/dist/generated/generatedConfigs.d.cts +46 -0
  3. package/dist/automated-config/dist/generated/generatedConfigs.d.ts +46 -0
  4. package/dist/automated-config/dist/generated/generatedConfigs.js +92 -46
  5. package/dist/automated-config/dist/types/ComponentConfig.d.cts +24 -1
  6. package/dist/automated-config/dist/types/ComponentConfig.d.ts +24 -1
  7. package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
  8. package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
  9. package/dist/automated-config/dist/utils/index.cjs +32 -3
  10. package/dist/automated-config/dist/utils/index.d.cts +9 -1
  11. package/dist/automated-config/dist/utils/index.d.ts +9 -1
  12. package/dist/automated-config/dist/utils/index.js +33 -4
  13. package/dist/components/IconSlot.cjs +29 -0
  14. package/dist/components/IconSlot.js +29 -0
  15. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +1 -1
  16. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +1 -1
  17. package/dist/css-tokens/dist/index.cjs +26 -0
  18. package/dist/css-tokens/dist/index.d.cts +25 -1
  19. package/dist/css-tokens/dist/index.d.ts +25 -1
  20. package/dist/css-tokens/dist/index.js +25 -1
  21. package/dist/index.cjs +2 -0
  22. package/dist/index.d.cts +3 -3
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.js +2 -2
  25. package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.cjs +92 -46
  26. package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +92 -46
  27. package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +32 -3
  28. package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +33 -4
  29. package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.cjs +26 -0
  30. package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.js +25 -1
  31. package/dist/tailwind-internal/dist/utils/getShadowStyles.d.cts +2 -2
  32. package/dist/tailwind-internal/dist/utils/getShadowStyles.d.ts +2 -2
  33. package/dist/tokens/consts/cssTokens.cjs +2 -0
  34. package/dist/tokens/consts/cssTokens.d.cts +2 -2
  35. package/dist/tokens/consts/cssTokens.d.ts +2 -2
  36. package/dist/tokens/consts/cssTokens.js +2 -2
  37. package/dist/tokens/index.cjs +2 -0
  38. package/dist/tokens/index.d.cts +3 -3
  39. package/dist/tokens/index.d.ts +3 -3
  40. package/dist/tokens/index.js +2 -2
  41. package/dist/tokens/types.d.cts +2 -2
  42. package/dist/tokens/types.d.ts +2 -2
  43. package/dist/uds/generated/componentData.cjs +2570 -2570
  44. package/dist/uds/generated/componentData.js +2570 -2570
  45. package/dist/uds/generated/tailwindPurge.cjs +2 -1
  46. package/dist/uds/generated/tailwindPurge.js +2 -1
  47. package/generated/componentData.json +3299 -3299
  48. package/generated/tailwindPurge.ts +1 -1
  49. package/package.json +1 -1
@@ -263,6 +263,28 @@ function generateClassName({ componentName, subComponentName, variantKey, varian
263
263
  function getLayerClassSelector(layer, className, componentName, propertyStateSelector) {
264
264
  return componentName === "input" && (layer === "inputWrapperDynamic" || layer === "inputWrapper") && propertyStateSelector.includes("focus-within") ? `.${className}:not(.uds-ring):not(.uds-select-field-trigger)` : `.${className}`;
265
265
  }
266
+ /**
267
+ * Zero-specificity guards for `userOverridableProperties` layers: exclude
268
+ * elements the runtime marked with the matching attribute (set by `IconSlot`
269
+ * when a custom slot icon carries the explicit prop — non-`inherit` `color`
270
+ * or explicit `size`). `:where()` contributes (0,0,0), so the rule's
271
+ * class-count specificity tier — which the whole state cascade relies on — is
272
+ * unchanged; the rule simply stops matching, letting the consumer's own
273
+ * styling win.
274
+ */
275
+ const USER_OVERRIDE_GUARDS = {
276
+ color: `:where(:not([${require_index.ICON_COLOR_OVERRIDE_ATTRIBUTE}]))`,
277
+ iconSize: `:where(:not([${require_index.ICON_SIZE_OVERRIDE_ATTRIBUTE}]))`
278
+ };
279
+ /**
280
+ * Appends a {@link USER_OVERRIDE_GUARDS} guard to a layer class selector,
281
+ * inserting before a pseudo-element (e.g. `::placeholder`) if the layer
282
+ * carries one — a pseudo-class after a pseudo-element is invalid CSS.
283
+ */
284
+ function appendUserOverrideGuard(layerClassSelector, guard) {
285
+ const pseudoElementIndex = layerClassSelector.indexOf("::");
286
+ return pseudoElementIndex === -1 ? `${layerClassSelector}${guard}` : `${layerClassSelector.slice(0, pseudoElementIndex)}${guard}${layerClassSelector.slice(pseudoElementIndex)}`;
287
+ }
266
288
  const getTheCssPropertyValue = (schema, theme, propertyName, schemaStateValue, existingValue, originalPropertyDefinition) => {
267
289
  const { value, type } = schemaStateValue;
268
290
  const propertyConfig = require_properties.configurableProperties[propertyName];
@@ -324,9 +346,10 @@ function selectiveEmittedStates(stateMap, orderedStateKeys, emittableStates) {
324
346
  }
325
347
  return emitted;
326
348
  }
327
- function generateDeclaration({ componentName, subComponentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, componentStateKey, componentStateValue, schema, propertyKey, originalPropertyDefinition, declaredStates, layerUsesAtomicStates, theme, currentStyles, previewOptions, excludedPseudoStates = [], emit, fallbackStateMap, bumpRootSpecificity, buttonHeightReferenceSchema }) {
349
+ function generateDeclaration({ componentName, subComponentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, componentStateKey, componentStateValue, schema, propertyKey, originalPropertyDefinition, declaredStates, layerUsesAtomicStates, userOverridableProperties, theme, currentStyles, previewOptions, excludedPseudoStates = [], emit, fallbackStateMap, bumpRootSpecificity, buttonHeightReferenceSchema }) {
328
350
  const shouldUseExhaustive = (emit ?? "exhaustive") === "exhaustive" && layerUsesAtomicStates;
329
351
  const { cssProperties: configuredCssProperties, extendedProperties: configuredExtendedGetter } = require_properties.configurableProperties[originalPropertyDefinition.name];
352
+ const userOverrideGuard = userOverridableProperties?.includes(originalPropertyDefinition.name) ? USER_OVERRIDE_GUARDS[originalPropertyDefinition.name] : void 0;
330
353
  const configuredExtendedProperties = (0, lodash_es.isFunction)(configuredExtendedGetter) ? configuredExtendedGetter({
331
354
  componentName,
332
355
  subComponentName,
@@ -423,7 +446,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
423
446
  subComponentName
424
447
  });
425
448
  const layerClassSelector = getLayerClassSelector(layer, className, componentName, propertyStateSelector);
426
- fullClassName = `.${rootVariantClassName}${propertyStateSelector}.${rootVariantClassNameWithComponentState} ${layerClassSelector}`;
449
+ const guardedLayerClassSelector = userOverrideGuard ? appendUserOverrideGuard(layerClassSelector, userOverrideGuard) : layerClassSelector;
450
+ fullClassName = `.${rootVariantClassName}${propertyStateSelector}.${rootVariantClassNameWithComponentState} ${guardedLayerClassSelector}`;
427
451
  } else {
428
452
  className = generateClassName({
429
453
  componentName,
@@ -434,7 +458,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
434
458
  subComponentName
435
459
  });
436
460
  const layerClassSelector = getLayerClassSelector(layer, className, componentName, propertyStateSelector);
437
- fullClassName = bumpRootSpecificity ? `.${rootVariantClassName}.${rootVariantClassName}${propertyStateSelector} ${layerClassSelector}` : `.${rootVariantClassName}${propertyStateSelector} ${layerClassSelector}`;
461
+ const guardedLayerClassSelector = userOverrideGuard ? appendUserOverrideGuard(layerClassSelector, userOverrideGuard) : layerClassSelector;
462
+ fullClassName = bumpRootSpecificity ? `.${rootVariantClassName}.${rootVariantClassName}${propertyStateSelector} ${guardedLayerClassSelector}` : `.${rootVariantClassName}${propertyStateSelector} ${guardedLayerClassSelector}`;
438
463
  }
439
464
  }
440
465
  const { cssProperties, extendedProperties: extendedPropertiesGetter } = require_properties.configurableProperties[originalPropertyDefinition.name];
@@ -692,6 +717,7 @@ function emitSchemaOverrideStyles({ componentName, subComponentName, variantKey,
692
717
  originalPropertyDefinition,
693
718
  declaredStates: new Set(require_resolvePropertyStates.resolvePropertyStates(universalLayer, originalPropertyDefinition)),
694
719
  layerUsesAtomicStates: (universalLayer.atomicStates?.length ?? 0) > 0,
720
+ userOverridableProperties: universalLayer.userOverridableProperties,
695
721
  theme,
696
722
  schema,
697
723
  currentStyles: styles,
@@ -738,6 +764,7 @@ function emitUniversalLayers({ componentName, subComponentName, variantKey, vari
738
764
  originalPropertyDefinition,
739
765
  declaredStates: new Set(require_resolvePropertyStates.resolvePropertyStates(layer, originalPropertyDefinition)),
740
766
  layerUsesAtomicStates: (layer.atomicStates?.length ?? 0) > 0,
767
+ userOverridableProperties: layer.userOverridableProperties,
741
768
  theme,
742
769
  schema,
743
770
  currentStyles: styles,
@@ -793,6 +820,7 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit, gener
793
820
  originalPropertyDefinition,
794
821
  declaredStates: new Set(require_resolvePropertyStates.resolvePropertyStates(layer, originalPropertyDefinition)),
795
822
  layerUsesAtomicStates: (layer.atomicStates?.length ?? 0) > 0,
823
+ userOverridableProperties: layer.userOverridableProperties,
796
824
  theme,
797
825
  schema,
798
826
  currentStyles: styles,
@@ -873,6 +901,7 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit, gener
873
901
  originalPropertyDefinition,
874
902
  declaredStates: new Set(require_resolvePropertyStates.resolvePropertyStates(layer, originalPropertyDefinition)),
875
903
  layerUsesAtomicStates: (layer.atomicStates?.length ?? 0) > 0,
904
+ userOverridableProperties: layer.userOverridableProperties,
876
905
  theme,
877
906
  schema,
878
907
  currentStyles: styles,
@@ -2,7 +2,7 @@
2
2
  import { AtomicState, INTERACTIVE_ATOMICS, InteractiveAtomic, MAX_MODIFIERS_PER_COMPOUND, MODIFIER_ATOMICS, ModifierAtomic, isAtomicState, isInteractiveAtomic, isModifierAtomic } from "../types/StateAxis.cjs";
3
3
  import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.cjs";
4
4
  import { ConfigurablePropertiesName, SelectedConfigurableProperty, configurableProperties } from "../properties.cjs";
5
- import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.cjs";
5
+ import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, UserOverridableProperty, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.cjs";
6
6
  import { VariableState } from "../types/ConfigSchema.cjs";
7
7
  import { ComponentSchema, buildConfigSchema, findFixtureType, findFixtureTypeForValue } from "./buildConfigSchema.cjs";
8
8
  import { canonicalizeStateKey, splitStateKey } from "./canonicalizeStateKey.cjs";
@@ -95,6 +95,7 @@ declare function generateDeclaration({
95
95
  originalPropertyDefinition,
96
96
  declaredStates,
97
97
  layerUsesAtomicStates,
98
+ userOverridableProperties,
98
99
  theme,
99
100
  currentStyles,
100
101
  previewOptions,
@@ -117,6 +118,7 @@ declare function generateDeclaration({
117
118
  originalPropertyDefinition: SelectedConfigurableProperty<ConfigurablePropertiesName, any>;
118
119
  declaredStates: ReadonlySet<string>;
119
120
  layerUsesAtomicStates: boolean;
121
+ userOverridableProperties?: readonly string[];
120
122
  theme: ThemeFn;
121
123
  currentStyles: Readonly<Record<string, Record<string, string>>>;
122
124
  previewOptions?: {
@@ -217,6 +219,12 @@ declare function createLayerConfig<T extends {
217
219
  * full breakdown.
218
220
  */
219
221
  atomicStates?: AtomicState[];
222
+ /**
223
+ * Marks the listed properties as consumer-overridable defaults: every
224
+ * emitted rule for them carries the matching zero-specificity
225
+ * `:where(:not([data-uds-icon-*]))` guard. See {@link LayerConfig}.
226
+ */
227
+ userOverridableProperties?: readonly UserOverridableProperty[];
220
228
  properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
221
229
  }>(config: T): T;
222
230
  declare function createSubComponentConfig(config: {
@@ -2,7 +2,7 @@
2
2
  import { AtomicState, INTERACTIVE_ATOMICS, InteractiveAtomic, MAX_MODIFIERS_PER_COMPOUND, MODIFIER_ATOMICS, ModifierAtomic, isAtomicState, isInteractiveAtomic, isModifierAtomic } from "../types/StateAxis.js";
3
3
  import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.js";
4
4
  import { ConfigurablePropertiesName, SelectedConfigurableProperty, configurableProperties } from "../properties.js";
5
- import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.js";
5
+ import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, UserOverridableProperty, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.js";
6
6
  import { VariableState } from "../types/ConfigSchema.js";
7
7
  import { ComponentSchema, buildConfigSchema, findFixtureType, findFixtureTypeForValue } from "./buildConfigSchema.js";
8
8
  import { canonicalizeStateKey, splitStateKey } from "./canonicalizeStateKey.js";
@@ -95,6 +95,7 @@ declare function generateDeclaration({
95
95
  originalPropertyDefinition,
96
96
  declaredStates,
97
97
  layerUsesAtomicStates,
98
+ userOverridableProperties,
98
99
  theme,
99
100
  currentStyles,
100
101
  previewOptions,
@@ -117,6 +118,7 @@ declare function generateDeclaration({
117
118
  originalPropertyDefinition: SelectedConfigurableProperty<ConfigurablePropertiesName, any>;
118
119
  declaredStates: ReadonlySet<string>;
119
120
  layerUsesAtomicStates: boolean;
121
+ userOverridableProperties?: readonly string[];
120
122
  theme: ThemeFn;
121
123
  currentStyles: Readonly<Record<string, Record<string, string>>>;
122
124
  previewOptions?: {
@@ -217,6 +219,12 @@ declare function createLayerConfig<T extends {
217
219
  * full breakdown.
218
220
  */
219
221
  atomicStates?: AtomicState[];
222
+ /**
223
+ * Marks the listed properties as consumer-overridable defaults: every
224
+ * emitted rule for them carries the matching zero-specificity
225
+ * `:where(:not([data-uds-icon-*]))` guard. See {@link LayerConfig}.
226
+ */
227
+ userOverridableProperties?: readonly UserOverridableProperty[];
220
228
  properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
221
229
  }>(config: T): T;
222
230
  declare function createSubComponentConfig(config: {
@@ -1,5 +1,5 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- import { BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST } from "../../../css-tokens/dist/index.js";
2
+ import { BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST, ICON_COLOR_OVERRIDE_ATTRIBUTE, ICON_SIZE_OVERRIDE_ATTRIBUTE } from "../../../css-tokens/dist/index.js";
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";
@@ -262,6 +262,28 @@ function generateClassName({ componentName, subComponentName, variantKey, varian
262
262
  function getLayerClassSelector(layer, className, componentName, propertyStateSelector) {
263
263
  return componentName === "input" && (layer === "inputWrapperDynamic" || layer === "inputWrapper") && propertyStateSelector.includes("focus-within") ? `.${className}:not(.uds-ring):not(.uds-select-field-trigger)` : `.${className}`;
264
264
  }
265
+ /**
266
+ * Zero-specificity guards for `userOverridableProperties` layers: exclude
267
+ * elements the runtime marked with the matching attribute (set by `IconSlot`
268
+ * when a custom slot icon carries the explicit prop — non-`inherit` `color`
269
+ * or explicit `size`). `:where()` contributes (0,0,0), so the rule's
270
+ * class-count specificity tier — which the whole state cascade relies on — is
271
+ * unchanged; the rule simply stops matching, letting the consumer's own
272
+ * styling win.
273
+ */
274
+ const USER_OVERRIDE_GUARDS = {
275
+ color: `:where(:not([${ICON_COLOR_OVERRIDE_ATTRIBUTE}]))`,
276
+ iconSize: `:where(:not([${ICON_SIZE_OVERRIDE_ATTRIBUTE}]))`
277
+ };
278
+ /**
279
+ * Appends a {@link USER_OVERRIDE_GUARDS} guard to a layer class selector,
280
+ * inserting before a pseudo-element (e.g. `::placeholder`) if the layer
281
+ * carries one — a pseudo-class after a pseudo-element is invalid CSS.
282
+ */
283
+ function appendUserOverrideGuard(layerClassSelector, guard) {
284
+ const pseudoElementIndex = layerClassSelector.indexOf("::");
285
+ return pseudoElementIndex === -1 ? `${layerClassSelector}${guard}` : `${layerClassSelector.slice(0, pseudoElementIndex)}${guard}${layerClassSelector.slice(pseudoElementIndex)}`;
286
+ }
265
287
  const getTheCssPropertyValue = (schema, theme, propertyName, schemaStateValue, existingValue, originalPropertyDefinition) => {
266
288
  const { value, type } = schemaStateValue;
267
289
  const propertyConfig = configurableProperties[propertyName];
@@ -323,9 +345,10 @@ function selectiveEmittedStates(stateMap, orderedStateKeys, emittableStates) {
323
345
  }
324
346
  return emitted;
325
347
  }
326
- function generateDeclaration({ componentName, subComponentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, componentStateKey, componentStateValue, schema, propertyKey, originalPropertyDefinition, declaredStates, layerUsesAtomicStates, theme, currentStyles, previewOptions, excludedPseudoStates = [], emit, fallbackStateMap, bumpRootSpecificity, buttonHeightReferenceSchema }) {
348
+ function generateDeclaration({ componentName, subComponentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, componentStateKey, componentStateValue, schema, propertyKey, originalPropertyDefinition, declaredStates, layerUsesAtomicStates, userOverridableProperties, theme, currentStyles, previewOptions, excludedPseudoStates = [], emit, fallbackStateMap, bumpRootSpecificity, buttonHeightReferenceSchema }) {
327
349
  const shouldUseExhaustive = (emit ?? "exhaustive") === "exhaustive" && layerUsesAtomicStates;
328
350
  const { cssProperties: configuredCssProperties, extendedProperties: configuredExtendedGetter } = configurableProperties[originalPropertyDefinition.name];
351
+ const userOverrideGuard = userOverridableProperties?.includes(originalPropertyDefinition.name) ? USER_OVERRIDE_GUARDS[originalPropertyDefinition.name] : void 0;
329
352
  const configuredExtendedProperties = isFunction(configuredExtendedGetter) ? configuredExtendedGetter({
330
353
  componentName,
331
354
  subComponentName,
@@ -422,7 +445,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
422
445
  subComponentName
423
446
  });
424
447
  const layerClassSelector = getLayerClassSelector(layer, className, componentName, propertyStateSelector);
425
- fullClassName = `.${rootVariantClassName}${propertyStateSelector}.${rootVariantClassNameWithComponentState} ${layerClassSelector}`;
448
+ const guardedLayerClassSelector = userOverrideGuard ? appendUserOverrideGuard(layerClassSelector, userOverrideGuard) : layerClassSelector;
449
+ fullClassName = `.${rootVariantClassName}${propertyStateSelector}.${rootVariantClassNameWithComponentState} ${guardedLayerClassSelector}`;
426
450
  } else {
427
451
  className = generateClassName({
428
452
  componentName,
@@ -433,7 +457,8 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
433
457
  subComponentName
434
458
  });
435
459
  const layerClassSelector = getLayerClassSelector(layer, className, componentName, propertyStateSelector);
436
- fullClassName = bumpRootSpecificity ? `.${rootVariantClassName}.${rootVariantClassName}${propertyStateSelector} ${layerClassSelector}` : `.${rootVariantClassName}${propertyStateSelector} ${layerClassSelector}`;
460
+ const guardedLayerClassSelector = userOverrideGuard ? appendUserOverrideGuard(layerClassSelector, userOverrideGuard) : layerClassSelector;
461
+ fullClassName = bumpRootSpecificity ? `.${rootVariantClassName}.${rootVariantClassName}${propertyStateSelector} ${guardedLayerClassSelector}` : `.${rootVariantClassName}${propertyStateSelector} ${guardedLayerClassSelector}`;
437
462
  }
438
463
  }
439
464
  const { cssProperties, extendedProperties: extendedPropertiesGetter } = configurableProperties[originalPropertyDefinition.name];
@@ -691,6 +716,7 @@ function emitSchemaOverrideStyles({ componentName, subComponentName, variantKey,
691
716
  originalPropertyDefinition,
692
717
  declaredStates: new Set(resolvePropertyStates(universalLayer, originalPropertyDefinition)),
693
718
  layerUsesAtomicStates: (universalLayer.atomicStates?.length ?? 0) > 0,
719
+ userOverridableProperties: universalLayer.userOverridableProperties,
694
720
  theme,
695
721
  schema,
696
722
  currentStyles: styles,
@@ -737,6 +763,7 @@ function emitUniversalLayers({ componentName, subComponentName, variantKey, vari
737
763
  originalPropertyDefinition,
738
764
  declaredStates: new Set(resolvePropertyStates(layer, originalPropertyDefinition)),
739
765
  layerUsesAtomicStates: (layer.atomicStates?.length ?? 0) > 0,
766
+ userOverridableProperties: layer.userOverridableProperties,
740
767
  theme,
741
768
  schema,
742
769
  currentStyles: styles,
@@ -792,6 +819,7 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit, gener
792
819
  originalPropertyDefinition,
793
820
  declaredStates: new Set(resolvePropertyStates(layer, originalPropertyDefinition)),
794
821
  layerUsesAtomicStates: (layer.atomicStates?.length ?? 0) > 0,
822
+ userOverridableProperties: layer.userOverridableProperties,
795
823
  theme,
796
824
  schema,
797
825
  currentStyles: styles,
@@ -872,6 +900,7 @@ function generateConfigStyles(config, schema, theme, previewOptions, emit, gener
872
900
  originalPropertyDefinition,
873
901
  declaredStates: new Set(resolvePropertyStates(layer, originalPropertyDefinition)),
874
902
  layerUsesAtomicStates: (layer.atomicStates?.length ?? 0) > 0,
903
+ userOverridableProperties: layer.userOverridableProperties,
875
904
  theme,
876
905
  schema,
877
906
  currentStyles: styles,
@@ -1,6 +1,7 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
4
+ const require_index = require("../css-tokens/dist/index.cjs");
4
5
  const require_styles_styler = require("../styles/styler.cjs");
5
6
  const require_components_Icon = require("./Icon.cjs");
6
7
  let react = require("react");
@@ -10,6 +11,32 @@ let lodash_isFunction_js = require("lodash/isFunction.js");
10
11
  lodash_isFunction_js = require_runtime.__toESM(lodash_isFunction_js);
11
12
  //#region src/components/IconSlot.tsx
12
13
  /**
14
+ * When the consumer's own element carries an explicit non-`inherit` color or
15
+ * an explicit size, mark it with {@link ICON_COLOR_OVERRIDE_ATTRIBUTE} /
16
+ * {@link ICON_SIZE_OVERRIDE_ATTRIBUTE}. Config-generated icon rules for
17
+ * layers that list the property in `userOverridableProperties` exclude
18
+ * marked elements via a zero-specificity `:where(:not([...]))` guard, so the
19
+ * explicit prop wins over the configured value (across ALL configured
20
+ * states) without `!important`. For size, disabling the configured
21
+ * width/height box lets the svg's own attributes (matching the explicit
22
+ * size's artwork and viewBox) govern.
23
+ *
24
+ * Detection intentionally reads the element's OWN props (never `iconProps`):
25
+ * components pass their own defaults through `iconProps` (e.g. Button's
26
+ * `color="current"`, or configured icon sizes routed from runtime config),
27
+ * so only element props signal consumer intent.
28
+ */
29
+ function getUserOverrideAttributes(elProps) {
30
+ let attributes;
31
+ const color = elProps?.color;
32
+ if (typeof color === "string" && color !== "inherit") attributes = { [require_index.ICON_COLOR_OVERRIDE_ATTRIBUTE]: "" };
33
+ if (typeof elProps?.size === "string") attributes = {
34
+ ...attributes,
35
+ [require_index.ICON_SIZE_OVERRIDE_ATTRIBUTE]: ""
36
+ };
37
+ return attributes;
38
+ }
39
+ /**
13
40
  * A helper container to render a SvgIcon, Icon component, or ReactNode.
14
41
  *
15
42
  * Useful in components that use icons and have a startIcon and endIcon. It allows
@@ -41,6 +68,7 @@ const IconSlot = (0, react.memo)(function IconSlot({ icon, iconProps, className:
41
68
  const elProps = iconEl?.props;
42
69
  return (0, react.isValidElement)(iconEl) && (0, react.cloneElement)(iconEl, {
43
70
  ...rest,
71
+ ...getUserOverrideAttributes(elProps),
44
72
  className: require_styles_styler.cx(mergedClassName, elProps?.className)
45
73
  });
46
74
  }
@@ -49,6 +77,7 @@ const IconSlot = (0, react.memo)(function IconSlot({ icon, iconProps, className:
49
77
  ...props,
50
78
  ...elProps,
51
79
  ...rest,
80
+ ...getUserOverrideAttributes(elProps),
52
81
  className: require_styles_styler.cx(mergedClassName, elProps.className)
53
82
  });
54
83
  });
@@ -1,4 +1,5 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
+ import { ICON_COLOR_OVERRIDE_ATTRIBUTE, ICON_SIZE_OVERRIDE_ATTRIBUTE } from "../css-tokens/dist/index.js";
2
3
  import { cx } from "../styles/styler.js";
3
4
  import { Icon } from "./Icon.js";
4
5
  import { cloneElement, isValidElement, memo } from "react";
@@ -6,6 +7,32 @@ import { jsx } from "react/jsx-runtime";
6
7
  import { isFunction } from "lodash-es";
7
8
  //#region src/components/IconSlot.tsx
8
9
  /**
10
+ * When the consumer's own element carries an explicit non-`inherit` color or
11
+ * an explicit size, mark it with {@link ICON_COLOR_OVERRIDE_ATTRIBUTE} /
12
+ * {@link ICON_SIZE_OVERRIDE_ATTRIBUTE}. Config-generated icon rules for
13
+ * layers that list the property in `userOverridableProperties` exclude
14
+ * marked elements via a zero-specificity `:where(:not([...]))` guard, so the
15
+ * explicit prop wins over the configured value (across ALL configured
16
+ * states) without `!important`. For size, disabling the configured
17
+ * width/height box lets the svg's own attributes (matching the explicit
18
+ * size's artwork and viewBox) govern.
19
+ *
20
+ * Detection intentionally reads the element's OWN props (never `iconProps`):
21
+ * components pass their own defaults through `iconProps` (e.g. Button's
22
+ * `color="current"`, or configured icon sizes routed from runtime config),
23
+ * so only element props signal consumer intent.
24
+ */
25
+ function getUserOverrideAttributes(elProps) {
26
+ let attributes;
27
+ const color = elProps?.color;
28
+ if (typeof color === "string" && color !== "inherit") attributes = { [ICON_COLOR_OVERRIDE_ATTRIBUTE]: "" };
29
+ if (typeof elProps?.size === "string") attributes = {
30
+ ...attributes,
31
+ [ICON_SIZE_OVERRIDE_ATTRIBUTE]: ""
32
+ };
33
+ return attributes;
34
+ }
35
+ /**
9
36
  * A helper container to render a SvgIcon, Icon component, or ReactNode.
10
37
  *
11
38
  * Useful in components that use icons and have a startIcon and endIcon. It allows
@@ -37,6 +64,7 @@ const IconSlot = memo(function IconSlot({ icon, iconProps, className: slotClassN
37
64
  const elProps = iconEl?.props;
38
65
  return isValidElement(iconEl) && cloneElement(iconEl, {
39
66
  ...rest,
67
+ ...getUserOverrideAttributes(elProps),
40
68
  className: cx(mergedClassName, elProps?.className)
41
69
  });
42
70
  }
@@ -45,6 +73,7 @@ const IconSlot = memo(function IconSlot({ icon, iconProps, className: slotClassN
45
73
  ...props,
46
74
  ...elProps,
47
75
  ...rest,
76
+ ...getUserOverrideAttributes(elProps),
48
77
  className: cx(mergedClassName, elProps.className)
49
78
  });
50
79
  });
@@ -29,7 +29,7 @@ declare function usePopoverConfig(sizeProp?: PopoverSize | undefined, variantPro
29
29
  gap: SpacingAlias;
30
30
  dismissButtonSpacing: SpacingAlias;
31
31
  dismissIconSize: number;
32
- ariaKitPlacement: ("top-start" | "top-end" | "bottom-start" | "bottom-end" | ("bottom" | "left" | "right" | "top") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
32
+ ariaKitPlacement: ("top-start" | "top-end" | "bottom-start" | "bottom-end" | ("top" | "bottom" | "left" | "right") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
33
33
  animationDuration: number;
34
34
  };
35
35
  //#endregion
@@ -30,7 +30,7 @@ declare function usePopoverConfig(sizeProp?: PopoverSize | undefined, variantPro
30
30
  gap: SpacingAlias;
31
31
  dismissButtonSpacing: SpacingAlias;
32
32
  dismissIconSize: number;
33
- ariaKitPlacement: ("top-start" | "top-end" | "bottom-start" | "bottom-end" | ("bottom" | "left" | "right" | "top") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
33
+ ariaKitPlacement: ("top-start" | "top-end" | "bottom-start" | "bottom-end" | ("top" | "bottom" | "left" | "right") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
34
34
  animationDuration: number;
35
35
  };
36
36
  //#endregion
@@ -49,6 +49,30 @@ const TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES = {
49
49
  xl: "uds-text-xl",
50
50
  "2xl": "uds-text-2xl"
51
51
  };
52
+ /**
53
+ * Set by `IconSlot` (@yahoo/uds) when a consumer passes an explicit,
54
+ * non-`inherit` `color` on a custom slot icon element (e.g.
55
+ * `<Input endIcon={<Icon name={Check} color="positive" />} />`).
56
+ *
57
+ * Config-generated icon color rules for layers that list `color` in
58
+ * `userOverridableProperties` exclude elements carrying this attribute via a
59
+ * zero-specificity `:where(:not([data-uds-icon-color]))` guard, so the
60
+ * consumer's explicit color wins over the configured value without
61
+ * `!important`.
62
+ */
63
+ const ICON_COLOR_OVERRIDE_ATTRIBUTE = `data-uds-icon-color`;
64
+ /**
65
+ * Set by `IconSlot` (@yahoo/uds) when a consumer passes an explicit `size`
66
+ * on a custom slot icon element (e.g.
67
+ * `<Input endIcon={<Icon name={Check} size="lg" />} />`).
68
+ *
69
+ * Config-generated icon size (width/height) rules for layers that list
70
+ * `iconSize` in `userOverridableProperties` exclude elements carrying this
71
+ * attribute via a zero-specificity `:where(:not([data-uds-icon-size]))`
72
+ * guard, so the svg's own width/height attributes (matching the explicit
73
+ * size's artwork and viewBox) govern instead of the configured box.
74
+ */
75
+ const ICON_SIZE_OVERRIDE_ATTRIBUTE = `data-uds-icon-size`;
52
76
  const BUTTON_GAP_VAR = `--uds-button-gap`;
53
77
  const BUTTON_CONTROL_HEIGHT_VAR = `--uds-button-control-height`;
54
78
  const BUTTON_SCALE_EFFECT = `--uds-button-scale-effect`;
@@ -147,6 +171,8 @@ exports.FONT_SIZE_PREFIX = FONT_SIZE_PREFIX;
147
171
  exports.FONT_SLANT_PREFIX = FONT_SLANT_PREFIX;
148
172
  exports.FONT_WEIGHT_PREFIX = FONT_WEIGHT_PREFIX;
149
173
  exports.FONT_WIDTH_PREFIX = FONT_WIDTH_PREFIX;
174
+ exports.ICON_COLOR_OVERRIDE_ATTRIBUTE = ICON_COLOR_OVERRIDE_ATTRIBUTE;
175
+ exports.ICON_SIZE_OVERRIDE_ATTRIBUTE = ICON_SIZE_OVERRIDE_ATTRIBUTE;
150
176
  exports.ICON_SIZE_PREFIX = ICON_SIZE_PREFIX;
151
177
  exports.INSET_SHADOW_PREFIX = INSET_SHADOW_PREFIX;
152
178
  exports.INVERT_COLOR_MODE_CLASSNAME = INVERT_COLOR_MODE_CLASSNAME;
@@ -41,6 +41,30 @@ declare const DEFAULT_COLOR_MODE_CLASSNAME = "uds-color-mode-light";
41
41
  declare const DEFAULT_SCALE_MODE_CLASSNAME = "uds-scale-mode-large";
42
42
  declare const TEXT_RESPONSIVE_CLASSNAME = "uds-text-responsive";
43
43
  declare const TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES: Record<BreakpointWithBase | 'defaultBreakpoint', string>;
44
+ /**
45
+ * Set by `IconSlot` (@yahoo/uds) when a consumer passes an explicit,
46
+ * non-`inherit` `color` on a custom slot icon element (e.g.
47
+ * `<Input endIcon={<Icon name={Check} color="positive" />} />`).
48
+ *
49
+ * Config-generated icon color rules for layers that list `color` in
50
+ * `userOverridableProperties` exclude elements carrying this attribute via a
51
+ * zero-specificity `:where(:not([data-uds-icon-color]))` guard, so the
52
+ * consumer's explicit color wins over the configured value without
53
+ * `!important`.
54
+ */
55
+ declare const ICON_COLOR_OVERRIDE_ATTRIBUTE = "data-uds-icon-color";
56
+ /**
57
+ * Set by `IconSlot` (@yahoo/uds) when a consumer passes an explicit `size`
58
+ * on a custom slot icon element (e.g.
59
+ * `<Input endIcon={<Icon name={Check} size="lg" />} />`).
60
+ *
61
+ * Config-generated icon size (width/height) rules for layers that list
62
+ * `iconSize` in `userOverridableProperties` exclude elements carrying this
63
+ * attribute via a zero-specificity `:where(:not([data-uds-icon-size]))`
64
+ * guard, so the svg's own width/height attributes (matching the explicit
65
+ * size's artwork and viewBox) govern instead of the configured box.
66
+ */
67
+ declare const ICON_SIZE_OVERRIDE_ATTRIBUTE = "data-uds-icon-size";
44
68
  declare const BUTTON_GAP_VAR = "--uds-button-gap";
45
69
  declare const BUTTON_CONTROL_HEIGHT_VAR = "--uds-button-control-height";
46
70
  declare const BUTTON_SCALE_EFFECT = "--uds-button-scale-effect";
@@ -95,4 +119,4 @@ declare function getMotionVar({
95
119
  control
96
120
  }: GetMotionVarParams): string; //#endregion
97
121
  //#endregion
98
- export { AVATAR_SIZE_PREFIX, BACKGROUND_BLUR_COLOR_PREFIX, BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX, BACKGROUND_BLUR_RADIUS_PREFIX, BACKGROUND_COLOR_PREFIX, BORDER_RADIUS_PREFIX, BORDER_WIDTH_PREFIX, BUTTON_CONTROL_HEIGHT_VAR, BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST, DARK_COLOR_MODE_CLASSNAME, DEFAULT_COLOR_MODE_CLASSNAME, DEFAULT_SCALE_MODE_CLASSNAME, DROP_SHADOW_PREFIX, FONT_FAMILY_PREFIX, FONT_SIZE_PREFIX, FONT_SLANT_PREFIX, FONT_WEIGHT_PREFIX, FONT_WIDTH_PREFIX, GetMotionVarParams, ICON_SIZE_PREFIX, INSET_SHADOW_PREFIX, INVERT_COLOR_MODE_CLASSNAME, LARGE_SCALE_MODE_CLASSNAME, LETTER_SPACING_PREFIX, LIGHT_COLOR_MODE_CLASSNAME, LINE_COLOR_PREFIX, LINE_HEIGHT_PREFIX, MEDIUM_SCALE_MODE_CLASSNAME, MOTION_PREFIX, OUTLINE_PREFIX, PSEUDO_STYLE_SELECTOR_MAP, SMALL_SCALE_MODE_CLASSNAME, SPECTRUM_COLOR_PREFIX, SYSTEM_COLOR_MODE_CLASSNAME, TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES, TEXT_RESPONSIVE_CLASSNAME, TEXT_TRANSFORM_PREFIX, UDS_PREFIX, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME, getMotionVar, getShadowLayerValue, textVariantsSafe };
122
+ export { AVATAR_SIZE_PREFIX, BACKGROUND_BLUR_COLOR_PREFIX, BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX, BACKGROUND_BLUR_RADIUS_PREFIX, BACKGROUND_COLOR_PREFIX, BORDER_RADIUS_PREFIX, BORDER_WIDTH_PREFIX, BUTTON_CONTROL_HEIGHT_VAR, BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST, DARK_COLOR_MODE_CLASSNAME, DEFAULT_COLOR_MODE_CLASSNAME, DEFAULT_SCALE_MODE_CLASSNAME, DROP_SHADOW_PREFIX, FONT_FAMILY_PREFIX, FONT_SIZE_PREFIX, FONT_SLANT_PREFIX, FONT_WEIGHT_PREFIX, FONT_WIDTH_PREFIX, GetMotionVarParams, ICON_COLOR_OVERRIDE_ATTRIBUTE, ICON_SIZE_OVERRIDE_ATTRIBUTE, ICON_SIZE_PREFIX, INSET_SHADOW_PREFIX, INVERT_COLOR_MODE_CLASSNAME, LARGE_SCALE_MODE_CLASSNAME, LETTER_SPACING_PREFIX, LIGHT_COLOR_MODE_CLASSNAME, LINE_COLOR_PREFIX, LINE_HEIGHT_PREFIX, MEDIUM_SCALE_MODE_CLASSNAME, MOTION_PREFIX, OUTLINE_PREFIX, PSEUDO_STYLE_SELECTOR_MAP, SMALL_SCALE_MODE_CLASSNAME, SPECTRUM_COLOR_PREFIX, SYSTEM_COLOR_MODE_CLASSNAME, TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES, TEXT_RESPONSIVE_CLASSNAME, TEXT_TRANSFORM_PREFIX, UDS_PREFIX, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME, getMotionVar, getShadowLayerValue, textVariantsSafe };
@@ -41,6 +41,30 @@ declare const DEFAULT_COLOR_MODE_CLASSNAME = "uds-color-mode-light";
41
41
  declare const DEFAULT_SCALE_MODE_CLASSNAME = "uds-scale-mode-large";
42
42
  declare const TEXT_RESPONSIVE_CLASSNAME = "uds-text-responsive";
43
43
  declare const TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES: Record<BreakpointWithBase | 'defaultBreakpoint', string>;
44
+ /**
45
+ * Set by `IconSlot` (@yahoo/uds) when a consumer passes an explicit,
46
+ * non-`inherit` `color` on a custom slot icon element (e.g.
47
+ * `<Input endIcon={<Icon name={Check} color="positive" />} />`).
48
+ *
49
+ * Config-generated icon color rules for layers that list `color` in
50
+ * `userOverridableProperties` exclude elements carrying this attribute via a
51
+ * zero-specificity `:where(:not([data-uds-icon-color]))` guard, so the
52
+ * consumer's explicit color wins over the configured value without
53
+ * `!important`.
54
+ */
55
+ declare const ICON_COLOR_OVERRIDE_ATTRIBUTE = "data-uds-icon-color";
56
+ /**
57
+ * Set by `IconSlot` (@yahoo/uds) when a consumer passes an explicit `size`
58
+ * on a custom slot icon element (e.g.
59
+ * `<Input endIcon={<Icon name={Check} size="lg" />} />`).
60
+ *
61
+ * Config-generated icon size (width/height) rules for layers that list
62
+ * `iconSize` in `userOverridableProperties` exclude elements carrying this
63
+ * attribute via a zero-specificity `:where(:not([data-uds-icon-size]))`
64
+ * guard, so the svg's own width/height attributes (matching the explicit
65
+ * size's artwork and viewBox) govern instead of the configured box.
66
+ */
67
+ declare const ICON_SIZE_OVERRIDE_ATTRIBUTE = "data-uds-icon-size";
44
68
  declare const BUTTON_GAP_VAR = "--uds-button-gap";
45
69
  declare const BUTTON_CONTROL_HEIGHT_VAR = "--uds-button-control-height";
46
70
  declare const BUTTON_SCALE_EFFECT = "--uds-button-scale-effect";
@@ -95,4 +119,4 @@ declare function getMotionVar({
95
119
  control
96
120
  }: GetMotionVarParams): string; //#endregion
97
121
  //#endregion
98
- export { AVATAR_SIZE_PREFIX, BACKGROUND_BLUR_COLOR_PREFIX, BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX, BACKGROUND_BLUR_RADIUS_PREFIX, BACKGROUND_COLOR_PREFIX, BORDER_RADIUS_PREFIX, BORDER_WIDTH_PREFIX, BUTTON_CONTROL_HEIGHT_VAR, BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST, DARK_COLOR_MODE_CLASSNAME, DEFAULT_COLOR_MODE_CLASSNAME, DEFAULT_SCALE_MODE_CLASSNAME, DROP_SHADOW_PREFIX, FONT_FAMILY_PREFIX, FONT_SIZE_PREFIX, FONT_SLANT_PREFIX, FONT_WEIGHT_PREFIX, FONT_WIDTH_PREFIX, GetMotionVarParams, ICON_SIZE_PREFIX, INSET_SHADOW_PREFIX, INVERT_COLOR_MODE_CLASSNAME, LARGE_SCALE_MODE_CLASSNAME, LETTER_SPACING_PREFIX, LIGHT_COLOR_MODE_CLASSNAME, LINE_COLOR_PREFIX, LINE_HEIGHT_PREFIX, MEDIUM_SCALE_MODE_CLASSNAME, MOTION_PREFIX, OUTLINE_PREFIX, PSEUDO_STYLE_SELECTOR_MAP, SMALL_SCALE_MODE_CLASSNAME, SPECTRUM_COLOR_PREFIX, SYSTEM_COLOR_MODE_CLASSNAME, TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES, TEXT_RESPONSIVE_CLASSNAME, TEXT_TRANSFORM_PREFIX, UDS_PREFIX, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME, getMotionVar, getShadowLayerValue, textVariantsSafe };
122
+ export { AVATAR_SIZE_PREFIX, BACKGROUND_BLUR_COLOR_PREFIX, BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX, BACKGROUND_BLUR_RADIUS_PREFIX, BACKGROUND_COLOR_PREFIX, BORDER_RADIUS_PREFIX, BORDER_WIDTH_PREFIX, BUTTON_CONTROL_HEIGHT_VAR, BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST, DARK_COLOR_MODE_CLASSNAME, DEFAULT_COLOR_MODE_CLASSNAME, DEFAULT_SCALE_MODE_CLASSNAME, DROP_SHADOW_PREFIX, FONT_FAMILY_PREFIX, FONT_SIZE_PREFIX, FONT_SLANT_PREFIX, FONT_WEIGHT_PREFIX, FONT_WIDTH_PREFIX, GetMotionVarParams, ICON_COLOR_OVERRIDE_ATTRIBUTE, ICON_SIZE_OVERRIDE_ATTRIBUTE, ICON_SIZE_PREFIX, INSET_SHADOW_PREFIX, INVERT_COLOR_MODE_CLASSNAME, LARGE_SCALE_MODE_CLASSNAME, LETTER_SPACING_PREFIX, LIGHT_COLOR_MODE_CLASSNAME, LINE_COLOR_PREFIX, LINE_HEIGHT_PREFIX, MEDIUM_SCALE_MODE_CLASSNAME, MOTION_PREFIX, OUTLINE_PREFIX, PSEUDO_STYLE_SELECTOR_MAP, SMALL_SCALE_MODE_CLASSNAME, SPECTRUM_COLOR_PREFIX, SYSTEM_COLOR_MODE_CLASSNAME, TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES, TEXT_RESPONSIVE_CLASSNAME, TEXT_TRANSFORM_PREFIX, UDS_PREFIX, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME, getMotionVar, getShadowLayerValue, textVariantsSafe };
@@ -49,6 +49,30 @@ const TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES = {
49
49
  xl: "uds-text-xl",
50
50
  "2xl": "uds-text-2xl"
51
51
  };
52
+ /**
53
+ * Set by `IconSlot` (@yahoo/uds) when a consumer passes an explicit,
54
+ * non-`inherit` `color` on a custom slot icon element (e.g.
55
+ * `<Input endIcon={<Icon name={Check} color="positive" />} />`).
56
+ *
57
+ * Config-generated icon color rules for layers that list `color` in
58
+ * `userOverridableProperties` exclude elements carrying this attribute via a
59
+ * zero-specificity `:where(:not([data-uds-icon-color]))` guard, so the
60
+ * consumer's explicit color wins over the configured value without
61
+ * `!important`.
62
+ */
63
+ const ICON_COLOR_OVERRIDE_ATTRIBUTE = `data-uds-icon-color`;
64
+ /**
65
+ * Set by `IconSlot` (@yahoo/uds) when a consumer passes an explicit `size`
66
+ * on a custom slot icon element (e.g.
67
+ * `<Input endIcon={<Icon name={Check} size="lg" />} />`).
68
+ *
69
+ * Config-generated icon size (width/height) rules for layers that list
70
+ * `iconSize` in `userOverridableProperties` exclude elements carrying this
71
+ * attribute via a zero-specificity `:where(:not([data-uds-icon-size]))`
72
+ * guard, so the svg's own width/height attributes (matching the explicit
73
+ * size's artwork and viewBox) govern instead of the configured box.
74
+ */
75
+ const ICON_SIZE_OVERRIDE_ATTRIBUTE = `data-uds-icon-size`;
52
76
  const BUTTON_GAP_VAR = `--uds-button-gap`;
53
77
  const BUTTON_CONTROL_HEIGHT_VAR = `--uds-button-control-height`;
54
78
  const BUTTON_SCALE_EFFECT = `--uds-button-scale-effect`;
@@ -125,4 +149,4 @@ function getMotionVar({ variant, speed, control }) {
125
149
  ].join("-")}`;
126
150
  }
127
151
  //#endregion
128
- export { AVATAR_SIZE_PREFIX, BACKGROUND_BLUR_COLOR_PREFIX, BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX, BACKGROUND_BLUR_RADIUS_PREFIX, BACKGROUND_COLOR_PREFIX, BORDER_RADIUS_PREFIX, BORDER_WIDTH_PREFIX, BUTTON_CONTROL_HEIGHT_VAR, BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST, DARK_COLOR_MODE_CLASSNAME, DEFAULT_COLOR_MODE_CLASSNAME, DEFAULT_SCALE_MODE_CLASSNAME, DROP_SHADOW_PREFIX, FONT_FAMILY_PREFIX, FONT_SIZE_PREFIX, FONT_SLANT_PREFIX, FONT_WEIGHT_PREFIX, FONT_WIDTH_PREFIX, ICON_SIZE_PREFIX, INSET_SHADOW_PREFIX, INVERT_COLOR_MODE_CLASSNAME, LARGE_SCALE_MODE_CLASSNAME, LETTER_SPACING_PREFIX, LIGHT_COLOR_MODE_CLASSNAME, LINE_COLOR_PREFIX, LINE_HEIGHT_PREFIX, MEDIUM_SCALE_MODE_CLASSNAME, MOTION_PREFIX, OUTLINE_PREFIX, PSEUDO_STYLE_SELECTOR_MAP, SMALL_SCALE_MODE_CLASSNAME, SPECTRUM_COLOR_PREFIX, SYSTEM_COLOR_MODE_CLASSNAME, TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES, TEXT_RESPONSIVE_CLASSNAME, TEXT_TRANSFORM_PREFIX, UDS_PREFIX, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME, getMotionVar, getShadowLayerValue, textVariantsSafe };
152
+ export { AVATAR_SIZE_PREFIX, BACKGROUND_BLUR_COLOR_PREFIX, BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX, BACKGROUND_BLUR_RADIUS_PREFIX, BACKGROUND_COLOR_PREFIX, BORDER_RADIUS_PREFIX, BORDER_WIDTH_PREFIX, BUTTON_CONTROL_HEIGHT_VAR, BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST, DARK_COLOR_MODE_CLASSNAME, DEFAULT_COLOR_MODE_CLASSNAME, DEFAULT_SCALE_MODE_CLASSNAME, DROP_SHADOW_PREFIX, FONT_FAMILY_PREFIX, FONT_SIZE_PREFIX, FONT_SLANT_PREFIX, FONT_WEIGHT_PREFIX, FONT_WIDTH_PREFIX, ICON_COLOR_OVERRIDE_ATTRIBUTE, ICON_SIZE_OVERRIDE_ATTRIBUTE, ICON_SIZE_PREFIX, INSET_SHADOW_PREFIX, INVERT_COLOR_MODE_CLASSNAME, LARGE_SCALE_MODE_CLASSNAME, LETTER_SPACING_PREFIX, LIGHT_COLOR_MODE_CLASSNAME, LINE_COLOR_PREFIX, LINE_HEIGHT_PREFIX, MEDIUM_SCALE_MODE_CLASSNAME, MOTION_PREFIX, OUTLINE_PREFIX, PSEUDO_STYLE_SELECTOR_MAP, SMALL_SCALE_MODE_CLASSNAME, SPECTRUM_COLOR_PREFIX, SYSTEM_COLOR_MODE_CLASSNAME, TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES, TEXT_RESPONSIVE_CLASSNAME, TEXT_TRANSFORM_PREFIX, UDS_PREFIX, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME, getMotionVar, getShadowLayerValue, textVariantsSafe };
package/dist/index.cjs CHANGED
@@ -221,6 +221,8 @@ exports.FONT_WEIGHT_PREFIX = require_index$1.FONT_WEIGHT_PREFIX;
221
221
  exports.FONT_WIDTH_PREFIX = require_index$1.FONT_WIDTH_PREFIX;
222
222
  exports.FormLabel = require_components_FormLabel.FormLabel;
223
223
  exports.HStack = require_components_HStack.HStack;
224
+ exports.ICON_COLOR_OVERRIDE_ATTRIBUTE = require_index$1.ICON_COLOR_OVERRIDE_ATTRIBUTE;
225
+ exports.ICON_SIZE_OVERRIDE_ATTRIBUTE = require_index$1.ICON_SIZE_OVERRIDE_ATTRIBUTE;
224
226
  exports.ICON_SIZE_PREFIX = require_index$1.ICON_SIZE_PREFIX;
225
227
  exports.INSET_SHADOW_PREFIX = require_index$1.INSET_SHADOW_PREFIX;
226
228
  exports.INTERACTIVE_ATOMICS = require_StateAxis.INTERACTIVE_ATOMICS;