@yahoo/uds 3.126.0 → 3.127.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 +25 -0
- package/dist/automated-config/dist/generated/autoVariants.d.cts +7 -0
- package/dist/automated-config/dist/generated/autoVariants.d.ts +7 -0
- package/dist/automated-config/dist/generated/autoVariants.js +25 -0
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +3181 -0
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +305 -1
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +305 -1
- package/dist/automated-config/dist/generated/generatedConfigs.js +3180 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +754 -0
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +3 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +3 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +754 -0
- package/dist/automated-config/dist/properties.cjs +12 -0
- package/dist/automated-config/dist/properties.d.cts +4 -0
- package/dist/automated-config/dist/properties.d.ts +4 -0
- package/dist/automated-config/dist/properties.js +12 -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/index.cjs +103 -6
- package/dist/automated-config/dist/utils/index.js +103 -6
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
- package/dist/components/client/Tabs/Tab.cjs +80 -0
- package/dist/components/client/Tabs/Tab.d.cts +20 -0
- package/dist/components/client/Tabs/Tab.d.ts +21 -0
- package/dist/components/client/Tabs/Tab.js +78 -0
- package/dist/components/client/Tabs/TabList.cjs +132 -0
- package/dist/components/client/Tabs/TabList.d.cts +9 -0
- package/dist/components/client/Tabs/TabList.d.ts +10 -0
- package/dist/components/client/Tabs/TabList.js +130 -0
- package/dist/components/client/Tabs/TabPanel.cjs +22 -0
- package/dist/components/client/Tabs/TabPanel.d.cts +9 -0
- package/dist/components/client/Tabs/TabPanel.d.ts +10 -0
- package/dist/components/client/Tabs/TabPanel.js +20 -0
- package/dist/components/client/Tabs/Tabs.cjs +53 -0
- package/dist/components/client/Tabs/Tabs.d.cts +45 -0
- package/dist/components/client/Tabs/Tabs.d.ts +46 -0
- package/dist/components/client/Tabs/Tabs.js +51 -0
- package/dist/components/client/Tabs/index.cjs +12 -0
- package/dist/components/client/Tabs/index.d.cts +7 -0
- package/dist/components/client/Tabs/index.d.ts +8 -0
- package/dist/components/client/Tabs/index.js +8 -0
- package/dist/components/client/Tabs/tabsContext.cjs +18 -0
- package/dist/components/client/Tabs/tabsContext.d.cts +15 -0
- package/dist/components/client/Tabs/tabsContext.d.ts +16 -0
- package/dist/components/client/Tabs/tabsContext.js +15 -0
- package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +5 -5
- package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +5 -5
- package/dist/components/client/index.cjs +8 -0
- package/dist/components/client/index.d.cts +7 -1
- package/dist/components/client/index.d.ts +7 -1
- package/dist/components/client/index.js +5 -1
- package/dist/components/experimental/client/index.cjs +0 -5
- package/dist/components/experimental/client/index.d.cts +1 -2
- package/dist/components/experimental/client/index.d.ts +1 -2
- package/dist/components/experimental/client/index.js +1 -2
- package/dist/components/experimental/index.cjs +0 -9
- package/dist/components/experimental/index.d.cts +1 -2
- package/dist/components/experimental/index.d.ts +1 -2
- package/dist/components/experimental/index.js +1 -6
- package/dist/components/index.cjs +12 -0
- package/dist/components/index.d.cts +6 -1
- package/dist/components/index.d.ts +6 -1
- package/dist/components/index.js +9 -1
- package/dist/config/dist/index.cjs +824 -2
- package/dist/config/dist/index.js +824 -2
- package/dist/index.cjs +10 -0
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +6 -2
- package/dist/styles/styler.d.cts +59 -52
- package/dist/styles/styler.d.ts +59 -52
- package/dist/styles/variants.d.cts +29 -0
- package/dist/styles/variants.d.ts +29 -0
- package/dist/tailwind/dist/automated-config/dist/generated/autoVariants.cjs +25 -0
- package/dist/tailwind/dist/automated-config/dist/generated/autoVariants.js +25 -0
- package/dist/tailwind/dist/automated-config/dist/generated/autoVariants.js.map +1 -1
- package/dist/tailwind/dist/automated-config/dist/generated/generatedConfigs.cjs +3181 -0
- package/dist/tailwind/dist/automated-config/dist/generated/generatedConfigs.js +3180 -1
- package/dist/tailwind/dist/automated-config/dist/generated/generatedConfigs.js.map +1 -1
- package/dist/tailwind/dist/automated-config/dist/properties.cjs +12 -0
- package/dist/tailwind/dist/automated-config/dist/properties.js +12 -0
- package/dist/tailwind/dist/automated-config/dist/properties.js.map +1 -1
- package/dist/tailwind/dist/automated-config/dist/utils/index.cjs +103 -6
- package/dist/tailwind/dist/automated-config/dist/utils/index.js +103 -6
- package/dist/tailwind/dist/automated-config/dist/utils/index.js.map +1 -1
- package/dist/tailwind/dist/config/dist/index.cjs +824 -2
- package/dist/tailwind/dist/config/dist/index.js +824 -2
- package/dist/tailwind/dist/config/dist/index.js.map +1 -1
- package/dist/tailwind/dist/css/utils.cjs +3 -1
- package/dist/tailwind/dist/css/utils.js +3 -1
- package/dist/tailwind/dist/css/utils.js.map +1 -1
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.cjs +36 -2
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js +36 -2
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js.map +1 -1
- package/dist/tailwind/dist/tailwind/plugins/components.cjs +2 -0
- package/dist/tailwind/dist/tailwind/plugins/components.js +3 -1
- package/dist/tailwind/dist/tailwind/plugins/components.js.map +1 -1
- package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.cts +4 -4
- package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.ts +4 -4
- package/dist/tailwind/dist/types/dist/index.d.cts.map +1 -1
- package/dist/tailwind/dist/types/dist/index.d.ts.map +1 -1
- package/dist/tokens/automation/configs/index.cjs +2 -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 +2 -0
- package/dist/tokens/automation/index.d.cts +2 -2
- package/dist/tokens/automation/index.d.ts +2 -2
- package/dist/tokens/automation/index.js +2 -2
- package/dist/tokens/index.cjs +2 -0
- package/dist/tokens/index.d.cts +3 -3
- package/dist/tokens/index.d.ts +3 -3
- package/dist/tokens/index.js +2 -2
- package/dist/tokens/types.d.cts +2 -2
- package/dist/tokens/types.d.ts +2 -2
- package/dist/types/dist/index.d.cts +52 -1
- package/dist/types/dist/index.d.ts +52 -1
- package/dist/uds/generated/componentData.cjs +1197 -1089
- package/dist/uds/generated/componentData.js +1180 -1090
- package/dist/uds/generated/tailwindPurge.cjs +22 -43
- package/dist/uds/generated/tailwindPurge.js +22 -43
- package/generated/componentData.json +1759 -1649
- package/generated/tailwindPurge.ts +4 -4
- package/package.json +1 -1
- package/dist/components/experimental/client/Tabs.cjs +0 -76
- package/dist/components/experimental/client/Tabs.d.cts +0 -31
- package/dist/components/experimental/client/Tabs.d.ts +0 -32
- package/dist/components/experimental/client/Tabs.js +0 -71
|
@@ -155,6 +155,11 @@ const strokeWidth = {
|
|
|
155
155
|
name: "strokeWidth",
|
|
156
156
|
cssProperties: "stroke-width"
|
|
157
157
|
};
|
|
158
|
+
const underlineWidth = {
|
|
159
|
+
...borderWidth,
|
|
160
|
+
name: "underlineWidth",
|
|
161
|
+
cssProperties: "border-bottom-width"
|
|
162
|
+
};
|
|
158
163
|
const borderColor = {
|
|
159
164
|
name: "borderColor",
|
|
160
165
|
cssProperties: "border-color",
|
|
@@ -175,6 +180,11 @@ const stroke = {
|
|
|
175
180
|
name: "stroke",
|
|
176
181
|
cssProperties: "stroke"
|
|
177
182
|
};
|
|
183
|
+
const underlineColor = {
|
|
184
|
+
...borderColor,
|
|
185
|
+
name: "underlineColor",
|
|
186
|
+
cssProperties: "border-bottom-color"
|
|
187
|
+
};
|
|
178
188
|
const outlineWidth = {
|
|
179
189
|
name: "outlineWidth",
|
|
180
190
|
cssProperties: "outline-width",
|
|
@@ -328,10 +338,12 @@ const opacity = {
|
|
|
328
338
|
const publicProperties = {
|
|
329
339
|
backgroundColor,
|
|
330
340
|
borderWidth,
|
|
341
|
+
underlineWidth,
|
|
331
342
|
strokeWidth,
|
|
332
343
|
borderRadius,
|
|
333
344
|
borderRadiusVar,
|
|
334
345
|
borderColor,
|
|
346
|
+
underlineColor,
|
|
335
347
|
stroke,
|
|
336
348
|
buttonSize: {
|
|
337
349
|
name: "buttonSize",
|
|
@@ -25,10 +25,12 @@ interface ConfigurableProperty<T extends AllPossibleProperties, CVR = unknown> {
|
|
|
25
25
|
declare const publicProperties: {
|
|
26
26
|
readonly backgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases", unknown>;
|
|
27
27
|
readonly borderWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
28
|
+
readonly underlineWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
28
29
|
readonly strokeWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
29
30
|
readonly borderRadius: ConfigurableProperty<"borderRadii", unknown>;
|
|
30
31
|
readonly borderRadiusVar: ConfigurableProperty<"borderRadii", unknown>;
|
|
31
32
|
readonly borderColor: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
33
|
+
readonly underlineColor: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
32
34
|
readonly stroke: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
33
35
|
readonly buttonSize: ConfigurableProperty<"buttonSizes", unknown>;
|
|
34
36
|
readonly buttonVariant: ConfigurableProperty<"buttonVariantsFlat", unknown>;
|
|
@@ -71,10 +73,12 @@ declare const configurableProperties: {
|
|
|
71
73
|
solidOutline: ConfigurableProperty<never, unknown>;
|
|
72
74
|
backgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases", unknown>;
|
|
73
75
|
borderWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
76
|
+
underlineWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
74
77
|
strokeWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
75
78
|
borderRadius: ConfigurableProperty<"borderRadii", unknown>;
|
|
76
79
|
borderRadiusVar: ConfigurableProperty<"borderRadii", unknown>;
|
|
77
80
|
borderColor: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
81
|
+
underlineColor: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
78
82
|
stroke: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
79
83
|
buttonSize: ConfigurableProperty<"buttonSizes", unknown>;
|
|
80
84
|
buttonVariant: ConfigurableProperty<"buttonVariantsFlat", unknown>;
|
|
@@ -25,10 +25,12 @@ interface ConfigurableProperty<T extends AllPossibleProperties, CVR = unknown> {
|
|
|
25
25
|
declare const publicProperties: {
|
|
26
26
|
readonly backgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases", unknown>;
|
|
27
27
|
readonly borderWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
28
|
+
readonly underlineWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
28
29
|
readonly strokeWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
29
30
|
readonly borderRadius: ConfigurableProperty<"borderRadii", unknown>;
|
|
30
31
|
readonly borderRadiusVar: ConfigurableProperty<"borderRadii", unknown>;
|
|
31
32
|
readonly borderColor: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
33
|
+
readonly underlineColor: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
32
34
|
readonly stroke: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
33
35
|
readonly buttonSize: ConfigurableProperty<"buttonSizes", unknown>;
|
|
34
36
|
readonly buttonVariant: ConfigurableProperty<"buttonVariantsFlat", unknown>;
|
|
@@ -71,10 +73,12 @@ declare const configurableProperties: {
|
|
|
71
73
|
solidOutline: ConfigurableProperty<never, unknown>;
|
|
72
74
|
backgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases", unknown>;
|
|
73
75
|
borderWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
76
|
+
underlineWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
74
77
|
strokeWidth: ConfigurableProperty<"elevationAliases" | "borderWidths" | "spacingAliases", unknown>;
|
|
75
78
|
borderRadius: ConfigurableProperty<"borderRadii", unknown>;
|
|
76
79
|
borderRadiusVar: ConfigurableProperty<"borderRadii", unknown>;
|
|
77
80
|
borderColor: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
81
|
+
underlineColor: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
78
82
|
stroke: ConfigurableProperty<"spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors", unknown>;
|
|
79
83
|
buttonSize: ConfigurableProperty<"buttonSizes", unknown>;
|
|
80
84
|
buttonVariant: ConfigurableProperty<"buttonVariantsFlat", unknown>;
|
|
@@ -155,6 +155,11 @@ const strokeWidth = {
|
|
|
155
155
|
name: "strokeWidth",
|
|
156
156
|
cssProperties: "stroke-width"
|
|
157
157
|
};
|
|
158
|
+
const underlineWidth = {
|
|
159
|
+
...borderWidth,
|
|
160
|
+
name: "underlineWidth",
|
|
161
|
+
cssProperties: "border-bottom-width"
|
|
162
|
+
};
|
|
158
163
|
const borderColor = {
|
|
159
164
|
name: "borderColor",
|
|
160
165
|
cssProperties: "border-color",
|
|
@@ -175,6 +180,11 @@ const stroke = {
|
|
|
175
180
|
name: "stroke",
|
|
176
181
|
cssProperties: "stroke"
|
|
177
182
|
};
|
|
183
|
+
const underlineColor = {
|
|
184
|
+
...borderColor,
|
|
185
|
+
name: "underlineColor",
|
|
186
|
+
cssProperties: "border-bottom-color"
|
|
187
|
+
};
|
|
178
188
|
const outlineWidth = {
|
|
179
189
|
name: "outlineWidth",
|
|
180
190
|
cssProperties: "outline-width",
|
|
@@ -328,10 +338,12 @@ const opacity = {
|
|
|
328
338
|
const publicProperties = {
|
|
329
339
|
backgroundColor,
|
|
330
340
|
borderWidth,
|
|
341
|
+
underlineWidth,
|
|
331
342
|
strokeWidth,
|
|
332
343
|
borderRadius,
|
|
333
344
|
borderRadiusVar,
|
|
334
345
|
borderColor,
|
|
346
|
+
underlineColor,
|
|
335
347
|
stroke,
|
|
336
348
|
buttonSize: {
|
|
337
349
|
name: "buttonSize",
|
|
@@ -11,8 +11,8 @@ import { SelectedConfigurableProperty } from "../properties.cjs";
|
|
|
11
11
|
* @returns A Record of layer names to their properties, or null if no properties are found
|
|
12
12
|
*/
|
|
13
13
|
declare function getConfigVariantProperties(variant?: VariantConfig): {
|
|
14
|
-
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
15
|
-
root: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
14
|
+
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -11,8 +11,8 @@ import { SelectedConfigurableProperty } from "../properties.js";
|
|
|
11
11
|
* @returns A Record of layer names to their properties, or null if no properties are found
|
|
12
12
|
*/
|
|
13
13
|
declare function getConfigVariantProperties(variant?: VariantConfig): {
|
|
14
|
-
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
15
|
-
root: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
14
|
+
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -24,6 +24,16 @@ const CSS_LINE_HEIGHT = "line-height";
|
|
|
24
24
|
const CSS_BORDER_WIDTH = "border-width";
|
|
25
25
|
const CSS_BORDER_COLOR = "border-color";
|
|
26
26
|
const CSS_BOX_SHADOW = "box-shadow";
|
|
27
|
+
const CSS_BORDER_TOP_WIDTH = "border-top-width";
|
|
28
|
+
const CSS_BORDER_RIGHT_WIDTH = "border-right-width";
|
|
29
|
+
const CSS_BORDER_BOTTOM_WIDTH = "border-bottom-width";
|
|
30
|
+
const CSS_BORDER_LEFT_WIDTH = "border-left-width";
|
|
31
|
+
const CSS_BORDER_TOP_COLOR = "border-top-color";
|
|
32
|
+
const CSS_BORDER_RIGHT_COLOR = "border-right-color";
|
|
33
|
+
const CSS_BORDER_BOTTOM_COLOR = "border-bottom-color";
|
|
34
|
+
const CSS_BORDER_LEFT_COLOR = "border-left-color";
|
|
35
|
+
const CSS_TAB_UNDERLINE_WIDTH = "--uds-tab-underline-width";
|
|
36
|
+
const CSS_TAB_UNDERLINE_COLOR = "--uds-tab-underline-color";
|
|
27
37
|
function deepMerge(target, source) {
|
|
28
38
|
return (0, lodash_es.mergeWith)({}, target, source);
|
|
29
39
|
}
|
|
@@ -39,6 +49,14 @@ const COMPONENTS_WITH_SHADOW_BORDERS = [
|
|
|
39
49
|
{
|
|
40
50
|
componentName: "chip",
|
|
41
51
|
layer: "root"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
componentName: "tab",
|
|
55
|
+
layer: "root"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
componentName: "tabs",
|
|
59
|
+
layer: "root"
|
|
42
60
|
}
|
|
43
61
|
];
|
|
44
62
|
/**
|
|
@@ -99,19 +117,48 @@ function getButtonLineHeightWithIconMinimum({ lineHeight, schema, iconLayerKey,
|
|
|
99
117
|
* @example
|
|
100
118
|
* Input: { border-width: '2px', border-color: 'red', box-shadow: '0 2px 4px rgba(0,0,0,0.1)' }
|
|
101
119
|
* Output: { box-shadow: 'inset 0 0 0 2px red, 0 2px 4px rgba(0,0,0,0.1)' }
|
|
120
|
+
* Renders borders using inset box-shadows instead of CSS border widths.
|
|
121
|
+
* This preserves visual borders without affecting layout dimensions.
|
|
102
122
|
*/
|
|
103
123
|
function applyBoxShadowBorder(classStyles) {
|
|
104
|
-
const borderWidth = classStyles[CSS_BORDER_WIDTH];
|
|
105
|
-
const borderColor = classStyles[CSS_BORDER_COLOR];
|
|
106
|
-
if (!borderWidth || !borderColor) return classStyles;
|
|
107
124
|
const stripImportant = (value) => value.replace(/\s*!important\s*$/, "");
|
|
108
125
|
const hasImportant = (value) => value?.includes("!important") ?? false;
|
|
109
|
-
const
|
|
110
|
-
const
|
|
126
|
+
const isZeroWidth = (value) => !value || /^(0|0px|0rem|0em|0%)$/i.test(stripImportant(value).trim());
|
|
127
|
+
const negateLength = (value) => {
|
|
128
|
+
const normalized = stripImportant(value).trim();
|
|
129
|
+
if (/^(0|0px|0rem|0em|0%)$/i.test(normalized)) return "0";
|
|
130
|
+
return `calc(${normalized} * -1)`;
|
|
131
|
+
};
|
|
132
|
+
const borderWidth = classStyles[CSS_BORDER_WIDTH];
|
|
133
|
+
const borderColor = classStyles[CSS_BORDER_COLOR];
|
|
134
|
+
const topWidth = classStyles[CSS_BORDER_TOP_WIDTH] ?? borderWidth;
|
|
135
|
+
const rightWidth = classStyles[CSS_BORDER_RIGHT_WIDTH] ?? borderWidth;
|
|
136
|
+
const bottomWidth = classStyles[CSS_BORDER_BOTTOM_WIDTH] ?? borderWidth;
|
|
137
|
+
const leftWidth = classStyles[CSS_BORDER_LEFT_WIDTH] ?? borderWidth;
|
|
138
|
+
const topColor = classStyles[CSS_BORDER_TOP_COLOR] ?? borderColor;
|
|
139
|
+
const rightColor = classStyles[CSS_BORDER_RIGHT_COLOR] ?? borderColor;
|
|
140
|
+
const bottomColor = classStyles[CSS_BORDER_BOTTOM_COLOR] ?? borderColor;
|
|
141
|
+
const leftColor = classStyles[CSS_BORDER_LEFT_COLOR] ?? borderColor;
|
|
142
|
+
const borderLayers = [];
|
|
143
|
+
if (!isZeroWidth(topWidth) && topColor) borderLayers.push(`inset 0 ${stripImportant(topWidth)} 0 0 ${stripImportant(topColor)}`);
|
|
144
|
+
if (!isZeroWidth(rightWidth) && rightColor) borderLayers.push(`inset ${negateLength(rightWidth)} 0 0 0 ${stripImportant(rightColor)}`);
|
|
145
|
+
if (!isZeroWidth(bottomWidth) && bottomColor) borderLayers.push(`inset 0 ${negateLength(bottomWidth)} 0 0 ${stripImportant(bottomColor)}`);
|
|
146
|
+
if (!isZeroWidth(leftWidth) && leftColor) borderLayers.push(`inset ${stripImportant(leftWidth)} 0 0 0 ${stripImportant(leftColor)}`);
|
|
147
|
+
if (borderLayers.length === 0) return classStyles;
|
|
148
|
+
const layers = [...borderLayers, classStyles[CSS_BOX_SHADOW] && stripImportant(classStyles[CSS_BOX_SHADOW])].filter(Boolean);
|
|
149
|
+
const needsImportant = hasImportant(topWidth) || hasImportant(rightWidth) || hasImportant(bottomWidth) || hasImportant(leftWidth) || hasImportant(topColor) || hasImportant(rightColor) || hasImportant(bottomColor) || hasImportant(leftColor) || hasImportant(borderWidth) || hasImportant(borderColor) || hasImportant(classStyles[CSS_BOX_SHADOW]);
|
|
111
150
|
const newStyles = { ...classStyles };
|
|
112
151
|
newStyles[CSS_BOX_SHADOW] = layers.join(", ") + (needsImportant ? " !important" : "");
|
|
113
152
|
delete newStyles[CSS_BORDER_WIDTH];
|
|
114
153
|
delete newStyles[CSS_BORDER_COLOR];
|
|
154
|
+
delete newStyles[CSS_BORDER_TOP_WIDTH];
|
|
155
|
+
delete newStyles[CSS_BORDER_RIGHT_WIDTH];
|
|
156
|
+
delete newStyles[CSS_BORDER_BOTTOM_WIDTH];
|
|
157
|
+
delete newStyles[CSS_BORDER_LEFT_WIDTH];
|
|
158
|
+
delete newStyles[CSS_BORDER_TOP_COLOR];
|
|
159
|
+
delete newStyles[CSS_BORDER_RIGHT_COLOR];
|
|
160
|
+
delete newStyles[CSS_BORDER_BOTTOM_COLOR];
|
|
161
|
+
delete newStyles[CSS_BORDER_LEFT_COLOR];
|
|
115
162
|
return newStyles;
|
|
116
163
|
}
|
|
117
164
|
function generateClassName({ componentName, subComponentName, variantKey, variantValue, componentStateKey, componentStateValue, layer, layerOptionalPseudoSelector }) {
|
|
@@ -266,6 +313,43 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
266
313
|
});
|
|
267
314
|
}
|
|
268
315
|
}
|
|
316
|
+
if ((componentName === "tabs" || componentName === "tab") && layer === "root") {
|
|
317
|
+
const schemaVariablesForKey = schema?.variables?.[schemaKey];
|
|
318
|
+
if (propertyKey === "borderWidth" && schemaVariablesForKey?.underlineWidth) {
|
|
319
|
+
const borderWidth = cssDeclarations[CSS_BORDER_WIDTH];
|
|
320
|
+
if (borderWidth) {
|
|
321
|
+
cssDeclarations[CSS_BORDER_TOP_WIDTH] = borderWidth;
|
|
322
|
+
cssDeclarations[CSS_BORDER_RIGHT_WIDTH] = borderWidth;
|
|
323
|
+
cssDeclarations[CSS_BORDER_BOTTOM_WIDTH] = borderWidth;
|
|
324
|
+
cssDeclarations[CSS_BORDER_LEFT_WIDTH] = borderWidth;
|
|
325
|
+
delete cssDeclarations[CSS_BORDER_WIDTH];
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (propertyKey === "borderColor" && schemaVariablesForKey?.underlineColor) {
|
|
329
|
+
const borderColor = cssDeclarations[CSS_BORDER_COLOR];
|
|
330
|
+
if (borderColor) {
|
|
331
|
+
cssDeclarations[CSS_BORDER_TOP_COLOR] = borderColor;
|
|
332
|
+
cssDeclarations[CSS_BORDER_RIGHT_COLOR] = borderColor;
|
|
333
|
+
cssDeclarations[CSS_BORDER_BOTTOM_COLOR] = borderColor;
|
|
334
|
+
cssDeclarations[CSS_BORDER_LEFT_COLOR] = borderColor;
|
|
335
|
+
delete cssDeclarations[CSS_BORDER_COLOR];
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (propertyKey === "underlineWidth") {
|
|
339
|
+
const underlineWidth = cssDeclarations[CSS_BORDER_BOTTOM_WIDTH];
|
|
340
|
+
if (underlineWidth) {
|
|
341
|
+
cssDeclarations[CSS_TAB_UNDERLINE_WIDTH] = underlineWidth;
|
|
342
|
+
delete cssDeclarations[CSS_BORDER_BOTTOM_WIDTH];
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (propertyKey === "underlineColor") {
|
|
346
|
+
const underlineColor = cssDeclarations[CSS_BORDER_BOTTOM_COLOR];
|
|
347
|
+
if (underlineColor) {
|
|
348
|
+
cssDeclarations[CSS_TAB_UNDERLINE_COLOR] = underlineColor;
|
|
349
|
+
delete cssDeclarations[CSS_BORDER_BOTTOM_COLOR];
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
269
353
|
if (!styles[fullClassName]) styles[fullClassName] = {
|
|
270
354
|
...cssDeclarations,
|
|
271
355
|
...styles[fullClassName]
|
|
@@ -407,7 +491,20 @@ function generateConfigStyles(config, schema, theme, previewOptions) {
|
|
|
407
491
|
*/
|
|
408
492
|
const toApply = COMPONENTS_WITH_SHADOW_BORDERS.find((c) => c.componentName === componentName);
|
|
409
493
|
if (toApply) {
|
|
410
|
-
for (const className in styles) if (className.includes(`-${toApply.layer}`.toLowerCase()))
|
|
494
|
+
for (const className in styles) if (className.includes(`-${toApply.layer}`.toLowerCase())) {
|
|
495
|
+
const raw = styles[className];
|
|
496
|
+
if (toApply.componentName === "tab") {
|
|
497
|
+
const tabUnderlineWidth = raw[CSS_TAB_UNDERLINE_WIDTH];
|
|
498
|
+
const tabUnderlineColor = raw[CSS_TAB_UNDERLINE_COLOR];
|
|
499
|
+
const withoutTabUnderline = { ...raw };
|
|
500
|
+
delete withoutTabUnderline[CSS_TAB_UNDERLINE_WIDTH];
|
|
501
|
+
delete withoutTabUnderline[CSS_TAB_UNDERLINE_COLOR];
|
|
502
|
+
const merged = applyBoxShadowBorder(withoutTabUnderline);
|
|
503
|
+
if (tabUnderlineWidth !== void 0) merged[CSS_TAB_UNDERLINE_WIDTH] = tabUnderlineWidth;
|
|
504
|
+
if (tabUnderlineColor !== void 0) merged[CSS_TAB_UNDERLINE_COLOR] = tabUnderlineColor;
|
|
505
|
+
styles[className] = merged;
|
|
506
|
+
} else styles[className] = applyBoxShadowBorder(raw);
|
|
507
|
+
}
|
|
411
508
|
}
|
|
412
509
|
return styles;
|
|
413
510
|
}
|
|
@@ -23,6 +23,16 @@ const CSS_LINE_HEIGHT = "line-height";
|
|
|
23
23
|
const CSS_BORDER_WIDTH = "border-width";
|
|
24
24
|
const CSS_BORDER_COLOR = "border-color";
|
|
25
25
|
const CSS_BOX_SHADOW = "box-shadow";
|
|
26
|
+
const CSS_BORDER_TOP_WIDTH = "border-top-width";
|
|
27
|
+
const CSS_BORDER_RIGHT_WIDTH = "border-right-width";
|
|
28
|
+
const CSS_BORDER_BOTTOM_WIDTH = "border-bottom-width";
|
|
29
|
+
const CSS_BORDER_LEFT_WIDTH = "border-left-width";
|
|
30
|
+
const CSS_BORDER_TOP_COLOR = "border-top-color";
|
|
31
|
+
const CSS_BORDER_RIGHT_COLOR = "border-right-color";
|
|
32
|
+
const CSS_BORDER_BOTTOM_COLOR = "border-bottom-color";
|
|
33
|
+
const CSS_BORDER_LEFT_COLOR = "border-left-color";
|
|
34
|
+
const CSS_TAB_UNDERLINE_WIDTH = "--uds-tab-underline-width";
|
|
35
|
+
const CSS_TAB_UNDERLINE_COLOR = "--uds-tab-underline-color";
|
|
26
36
|
function deepMerge(target, source) {
|
|
27
37
|
return mergeWith({}, target, source);
|
|
28
38
|
}
|
|
@@ -38,6 +48,14 @@ const COMPONENTS_WITH_SHADOW_BORDERS = [
|
|
|
38
48
|
{
|
|
39
49
|
componentName: "chip",
|
|
40
50
|
layer: "root"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
componentName: "tab",
|
|
54
|
+
layer: "root"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
componentName: "tabs",
|
|
58
|
+
layer: "root"
|
|
41
59
|
}
|
|
42
60
|
];
|
|
43
61
|
/**
|
|
@@ -98,19 +116,48 @@ function getButtonLineHeightWithIconMinimum({ lineHeight, schema, iconLayerKey,
|
|
|
98
116
|
* @example
|
|
99
117
|
* Input: { border-width: '2px', border-color: 'red', box-shadow: '0 2px 4px rgba(0,0,0,0.1)' }
|
|
100
118
|
* Output: { box-shadow: 'inset 0 0 0 2px red, 0 2px 4px rgba(0,0,0,0.1)' }
|
|
119
|
+
* Renders borders using inset box-shadows instead of CSS border widths.
|
|
120
|
+
* This preserves visual borders without affecting layout dimensions.
|
|
101
121
|
*/
|
|
102
122
|
function applyBoxShadowBorder(classStyles) {
|
|
103
|
-
const borderWidth = classStyles[CSS_BORDER_WIDTH];
|
|
104
|
-
const borderColor = classStyles[CSS_BORDER_COLOR];
|
|
105
|
-
if (!borderWidth || !borderColor) return classStyles;
|
|
106
123
|
const stripImportant = (value) => value.replace(/\s*!important\s*$/, "");
|
|
107
124
|
const hasImportant = (value) => value?.includes("!important") ?? false;
|
|
108
|
-
const
|
|
109
|
-
const
|
|
125
|
+
const isZeroWidth = (value) => !value || /^(0|0px|0rem|0em|0%)$/i.test(stripImportant(value).trim());
|
|
126
|
+
const negateLength = (value) => {
|
|
127
|
+
const normalized = stripImportant(value).trim();
|
|
128
|
+
if (/^(0|0px|0rem|0em|0%)$/i.test(normalized)) return "0";
|
|
129
|
+
return `calc(${normalized} * -1)`;
|
|
130
|
+
};
|
|
131
|
+
const borderWidth = classStyles[CSS_BORDER_WIDTH];
|
|
132
|
+
const borderColor = classStyles[CSS_BORDER_COLOR];
|
|
133
|
+
const topWidth = classStyles[CSS_BORDER_TOP_WIDTH] ?? borderWidth;
|
|
134
|
+
const rightWidth = classStyles[CSS_BORDER_RIGHT_WIDTH] ?? borderWidth;
|
|
135
|
+
const bottomWidth = classStyles[CSS_BORDER_BOTTOM_WIDTH] ?? borderWidth;
|
|
136
|
+
const leftWidth = classStyles[CSS_BORDER_LEFT_WIDTH] ?? borderWidth;
|
|
137
|
+
const topColor = classStyles[CSS_BORDER_TOP_COLOR] ?? borderColor;
|
|
138
|
+
const rightColor = classStyles[CSS_BORDER_RIGHT_COLOR] ?? borderColor;
|
|
139
|
+
const bottomColor = classStyles[CSS_BORDER_BOTTOM_COLOR] ?? borderColor;
|
|
140
|
+
const leftColor = classStyles[CSS_BORDER_LEFT_COLOR] ?? borderColor;
|
|
141
|
+
const borderLayers = [];
|
|
142
|
+
if (!isZeroWidth(topWidth) && topColor) borderLayers.push(`inset 0 ${stripImportant(topWidth)} 0 0 ${stripImportant(topColor)}`);
|
|
143
|
+
if (!isZeroWidth(rightWidth) && rightColor) borderLayers.push(`inset ${negateLength(rightWidth)} 0 0 0 ${stripImportant(rightColor)}`);
|
|
144
|
+
if (!isZeroWidth(bottomWidth) && bottomColor) borderLayers.push(`inset 0 ${negateLength(bottomWidth)} 0 0 ${stripImportant(bottomColor)}`);
|
|
145
|
+
if (!isZeroWidth(leftWidth) && leftColor) borderLayers.push(`inset ${stripImportant(leftWidth)} 0 0 0 ${stripImportant(leftColor)}`);
|
|
146
|
+
if (borderLayers.length === 0) return classStyles;
|
|
147
|
+
const layers = [...borderLayers, classStyles[CSS_BOX_SHADOW] && stripImportant(classStyles[CSS_BOX_SHADOW])].filter(Boolean);
|
|
148
|
+
const needsImportant = hasImportant(topWidth) || hasImportant(rightWidth) || hasImportant(bottomWidth) || hasImportant(leftWidth) || hasImportant(topColor) || hasImportant(rightColor) || hasImportant(bottomColor) || hasImportant(leftColor) || hasImportant(borderWidth) || hasImportant(borderColor) || hasImportant(classStyles[CSS_BOX_SHADOW]);
|
|
110
149
|
const newStyles = { ...classStyles };
|
|
111
150
|
newStyles[CSS_BOX_SHADOW] = layers.join(", ") + (needsImportant ? " !important" : "");
|
|
112
151
|
delete newStyles[CSS_BORDER_WIDTH];
|
|
113
152
|
delete newStyles[CSS_BORDER_COLOR];
|
|
153
|
+
delete newStyles[CSS_BORDER_TOP_WIDTH];
|
|
154
|
+
delete newStyles[CSS_BORDER_RIGHT_WIDTH];
|
|
155
|
+
delete newStyles[CSS_BORDER_BOTTOM_WIDTH];
|
|
156
|
+
delete newStyles[CSS_BORDER_LEFT_WIDTH];
|
|
157
|
+
delete newStyles[CSS_BORDER_TOP_COLOR];
|
|
158
|
+
delete newStyles[CSS_BORDER_RIGHT_COLOR];
|
|
159
|
+
delete newStyles[CSS_BORDER_BOTTOM_COLOR];
|
|
160
|
+
delete newStyles[CSS_BORDER_LEFT_COLOR];
|
|
114
161
|
return newStyles;
|
|
115
162
|
}
|
|
116
163
|
function generateClassName({ componentName, subComponentName, variantKey, variantValue, componentStateKey, componentStateValue, layer, layerOptionalPseudoSelector }) {
|
|
@@ -265,6 +312,43 @@ function generateDeclaration({ componentName, subComponentName, variantKey, vari
|
|
|
265
312
|
});
|
|
266
313
|
}
|
|
267
314
|
}
|
|
315
|
+
if ((componentName === "tabs" || componentName === "tab") && layer === "root") {
|
|
316
|
+
const schemaVariablesForKey = schema?.variables?.[schemaKey];
|
|
317
|
+
if (propertyKey === "borderWidth" && schemaVariablesForKey?.underlineWidth) {
|
|
318
|
+
const borderWidth = cssDeclarations[CSS_BORDER_WIDTH];
|
|
319
|
+
if (borderWidth) {
|
|
320
|
+
cssDeclarations[CSS_BORDER_TOP_WIDTH] = borderWidth;
|
|
321
|
+
cssDeclarations[CSS_BORDER_RIGHT_WIDTH] = borderWidth;
|
|
322
|
+
cssDeclarations[CSS_BORDER_BOTTOM_WIDTH] = borderWidth;
|
|
323
|
+
cssDeclarations[CSS_BORDER_LEFT_WIDTH] = borderWidth;
|
|
324
|
+
delete cssDeclarations[CSS_BORDER_WIDTH];
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if (propertyKey === "borderColor" && schemaVariablesForKey?.underlineColor) {
|
|
328
|
+
const borderColor = cssDeclarations[CSS_BORDER_COLOR];
|
|
329
|
+
if (borderColor) {
|
|
330
|
+
cssDeclarations[CSS_BORDER_TOP_COLOR] = borderColor;
|
|
331
|
+
cssDeclarations[CSS_BORDER_RIGHT_COLOR] = borderColor;
|
|
332
|
+
cssDeclarations[CSS_BORDER_BOTTOM_COLOR] = borderColor;
|
|
333
|
+
cssDeclarations[CSS_BORDER_LEFT_COLOR] = borderColor;
|
|
334
|
+
delete cssDeclarations[CSS_BORDER_COLOR];
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if (propertyKey === "underlineWidth") {
|
|
338
|
+
const underlineWidth = cssDeclarations[CSS_BORDER_BOTTOM_WIDTH];
|
|
339
|
+
if (underlineWidth) {
|
|
340
|
+
cssDeclarations[CSS_TAB_UNDERLINE_WIDTH] = underlineWidth;
|
|
341
|
+
delete cssDeclarations[CSS_BORDER_BOTTOM_WIDTH];
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if (propertyKey === "underlineColor") {
|
|
345
|
+
const underlineColor = cssDeclarations[CSS_BORDER_BOTTOM_COLOR];
|
|
346
|
+
if (underlineColor) {
|
|
347
|
+
cssDeclarations[CSS_TAB_UNDERLINE_COLOR] = underlineColor;
|
|
348
|
+
delete cssDeclarations[CSS_BORDER_BOTTOM_COLOR];
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
268
352
|
if (!styles[fullClassName]) styles[fullClassName] = {
|
|
269
353
|
...cssDeclarations,
|
|
270
354
|
...styles[fullClassName]
|
|
@@ -406,7 +490,20 @@ function generateConfigStyles(config, schema, theme, previewOptions) {
|
|
|
406
490
|
*/
|
|
407
491
|
const toApply = COMPONENTS_WITH_SHADOW_BORDERS.find((c) => c.componentName === componentName);
|
|
408
492
|
if (toApply) {
|
|
409
|
-
for (const className in styles) if (className.includes(`-${toApply.layer}`.toLowerCase()))
|
|
493
|
+
for (const className in styles) if (className.includes(`-${toApply.layer}`.toLowerCase())) {
|
|
494
|
+
const raw = styles[className];
|
|
495
|
+
if (toApply.componentName === "tab") {
|
|
496
|
+
const tabUnderlineWidth = raw[CSS_TAB_UNDERLINE_WIDTH];
|
|
497
|
+
const tabUnderlineColor = raw[CSS_TAB_UNDERLINE_COLOR];
|
|
498
|
+
const withoutTabUnderline = { ...raw };
|
|
499
|
+
delete withoutTabUnderline[CSS_TAB_UNDERLINE_WIDTH];
|
|
500
|
+
delete withoutTabUnderline[CSS_TAB_UNDERLINE_COLOR];
|
|
501
|
+
const merged = applyBoxShadowBorder(withoutTabUnderline);
|
|
502
|
+
if (tabUnderlineWidth !== void 0) merged[CSS_TAB_UNDERLINE_WIDTH] = tabUnderlineWidth;
|
|
503
|
+
if (tabUnderlineColor !== void 0) merged[CSS_TAB_UNDERLINE_COLOR] = tabUnderlineColor;
|
|
504
|
+
styles[className] = merged;
|
|
505
|
+
} else styles[className] = applyBoxShadowBorder(raw);
|
|
506
|
+
}
|
|
410
507
|
}
|
|
411
508
|
return styles;
|
|
412
509
|
}
|
|
@@ -88,6 +88,6 @@ interface MenuItemCheckboxProps extends Omit<PressableProps, 'asChild'>, HtmlBut
|
|
|
88
88
|
*
|
|
89
89
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item)
|
|
90
90
|
**/
|
|
91
|
-
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "
|
|
91
|
+
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "rootProps" | "hideEndIcon" | "active"> & react.RefAttributes<HTMLDivElement>>;
|
|
92
92
|
//#endregion
|
|
93
93
|
export { MenuItemCheckbox, type MenuItemCheckboxProps };
|
|
@@ -89,6 +89,6 @@ interface MenuItemCheckboxProps extends Omit<PressableProps, 'asChild'>, HtmlBut
|
|
|
89
89
|
*
|
|
90
90
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item)
|
|
91
91
|
**/
|
|
92
|
-
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "
|
|
92
|
+
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "rootProps" | "hideEndIcon" | "active"> & react.RefAttributes<HTMLDivElement>>;
|
|
93
93
|
//#endregion
|
|
94
94
|
export { MenuItemCheckbox, type MenuItemCheckboxProps };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
|
+
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
6
|
+
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
7
|
+
const require_components_Text = require('../../Text.cjs');
|
|
8
|
+
const require_components_client_Tabs_tabsContext = require('./tabsContext.cjs');
|
|
9
|
+
let react = require("react");
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let _ariakit_react = require("@ariakit/react");
|
|
12
|
+
|
|
13
|
+
//#region src/components/client/Tabs/Tab.tsx
|
|
14
|
+
/** Matches {@link TabList} sliding-indicator underline (token CSS variables on the tab root). */
|
|
15
|
+
const tabRootUnderlineClassName = require_styles_styler.cx("pointer-events-none absolute bottom-0 left-0 right-0", "h-[var(--uds-tab-underline-width,0px)] bg-[var(--uds-tab-underline-color,transparent)]", "transition-[height,background-color] duration-[240ms] ease-[cubic-bezier(0.2,0,0,1)]");
|
|
16
|
+
function Tab({ value, children, startIcon, endIcon, disabled, asChild = false, className }) {
|
|
17
|
+
const generatedId = (0, react.useId)();
|
|
18
|
+
const uid = value ?? `uds-tab-${generatedId}`;
|
|
19
|
+
const { variant, disableMotion } = require_components_client_Tabs_tabsContext.useTabsContext();
|
|
20
|
+
const store = (0, _ariakit_react.useTabContext)();
|
|
21
|
+
if (!store) throw new Error("Tab must be wrapped in a Tabs component");
|
|
22
|
+
const selectedId = (0, _ariakit_react.useStoreState)(store, "selectedId");
|
|
23
|
+
const activeState = disabled || selectedId !== uid ? "off" : "on";
|
|
24
|
+
const rootBaseClass = require_styles_styler.getStyles({
|
|
25
|
+
tabSizeRoot: "default",
|
|
26
|
+
tabVariantRoot: variant,
|
|
27
|
+
tabVariantActiveRoot: "off"
|
|
28
|
+
});
|
|
29
|
+
const rootOnClass = require_styles_styler.getStyles({
|
|
30
|
+
tabSizeRoot: "default",
|
|
31
|
+
tabVariantRoot: variant,
|
|
32
|
+
tabVariantActiveRoot: "on"
|
|
33
|
+
});
|
|
34
|
+
const configClass = activeState === "on" ? require_styles_styler.cx(rootOnClass, !disableMotion && require_styles_styler.cx("!bg-transparent", "!shadow-none")) : rootBaseClass;
|
|
35
|
+
const iconConfigClass = require_styles_styler.getStyles({
|
|
36
|
+
tabSizeIcon: "default",
|
|
37
|
+
tabVariantIcon: variant,
|
|
38
|
+
tabVariantActiveIcon: activeState
|
|
39
|
+
});
|
|
40
|
+
const tabClass = require_styles_styler.cx(configClass, "inline-flex items-center shrink-0 box-border relative", !disableMotion && "z-[1]", "cursor-pointer select-none whitespace-nowrap", !disabled && "uds-ring", disabled && "opacity-50 cursor-default pointer-events-none", "border-solid border-b-solid", "transition-colors duration-[240ms] ease-[cubic-bezier(0.2,0,0,1)]", className);
|
|
41
|
+
const resolvedContent = asChild && (0, react.isValidElement)(children) ? children.props.children ?? null : children;
|
|
42
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_ariakit_react.Tab, {
|
|
43
|
+
id: uid,
|
|
44
|
+
disabled,
|
|
45
|
+
className: tabClass,
|
|
46
|
+
render: asChild && (0, react.isValidElement)(children) ? children : void 0,
|
|
47
|
+
children: [
|
|
48
|
+
!(activeState === "on" && !disableMotion) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49
|
+
"aria-hidden": true,
|
|
50
|
+
className: tabRootUnderlineClassName
|
|
51
|
+
}) : null,
|
|
52
|
+
startIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
53
|
+
icon: startIcon,
|
|
54
|
+
iconProps: {
|
|
55
|
+
size: "sm",
|
|
56
|
+
color: "current"
|
|
57
|
+
},
|
|
58
|
+
className: iconConfigClass
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
61
|
+
variant: "inherit",
|
|
62
|
+
as: "span",
|
|
63
|
+
color: "current",
|
|
64
|
+
children: resolvedContent
|
|
65
|
+
}),
|
|
66
|
+
endIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
67
|
+
icon: endIcon,
|
|
68
|
+
iconProps: {
|
|
69
|
+
size: "sm",
|
|
70
|
+
color: "current"
|
|
71
|
+
},
|
|
72
|
+
className: iconConfigClass
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
Tab.displayName = "Tab";
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
exports.Tab = Tab;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabProps } from "../../../types/dist/index.cjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/client/Tabs/Tab.d.ts
|
|
6
|
+
type TabProps = UniversalTabProps;
|
|
7
|
+
declare function Tab({
|
|
8
|
+
value,
|
|
9
|
+
children,
|
|
10
|
+
startIcon,
|
|
11
|
+
endIcon,
|
|
12
|
+
disabled,
|
|
13
|
+
asChild,
|
|
14
|
+
className
|
|
15
|
+
}: TabProps): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
declare namespace Tab {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Tab, type TabProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { UniversalTabProps } from "../../../types/dist/index.js";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/client/Tabs/Tab.d.ts
|
|
7
|
+
type TabProps = UniversalTabProps;
|
|
8
|
+
declare function Tab({
|
|
9
|
+
value,
|
|
10
|
+
children,
|
|
11
|
+
startIcon,
|
|
12
|
+
endIcon,
|
|
13
|
+
disabled,
|
|
14
|
+
asChild,
|
|
15
|
+
className
|
|
16
|
+
}: TabProps): react_jsx_runtime0.JSX.Element;
|
|
17
|
+
declare namespace Tab {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Tab, type TabProps };
|