@yahoo/uds 3.162.1 → 3.163.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/utils/getConfigVariantProperties.d.cts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
- package/dist/cli/commands/sync.cjs +1 -1
- package/dist/cli/commands/sync.js +1 -1
- package/dist/cli/dist/commands/editor-rules.cjs +1 -1
- package/dist/cli/dist/commands/editor-rules.js +1 -1
- package/dist/cli/dist/utils/rules/config.cjs +1 -1
- package/dist/cli/dist/utils/rules/config.js +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +1 -1
- package/dist/components/client/Switch/Switch.cjs +5 -2
- package/dist/components/client/Switch/Switch.js +5 -2
- package/dist/components/client/Switch/switchStyles.cjs +2 -2
- package/dist/components/client/Switch/switchStyles.js +2 -2
- package/dist/css/dist/css/generate.cjs +4 -4
- package/dist/css/dist/css/generate.helpers.cjs +9 -19
- package/dist/css/dist/css/generate.helpers.js +4 -13
- package/dist/css/dist/css/generate.js +3 -3
- package/dist/css/dist/css/nodeUtils.cjs +3 -3
- package/dist/css/dist/css/nodeUtils.js +2 -2
- package/dist/css/dist/css/runner.cjs +2 -2
- package/dist/css/dist/css/runner.js +2 -2
- package/dist/css/dist/css/theme.d.cts +1 -1
- package/dist/css/dist/css/theme.d.ts +1 -1
- package/dist/css/dist/postcss/pruneVars.cjs +53 -0
- package/dist/css/dist/postcss/pruneVars.d.cts +33 -0
- package/dist/css/dist/postcss/pruneVars.d.ts +33 -0
- package/dist/css/dist/postcss/pruneVars.js +50 -0
- package/dist/css/dist/postcss.d.cts +3 -0
- package/dist/css/dist/postcss.d.ts +3 -0
- package/dist/css/dist/purger/optimized/ast/expressions.cjs +2 -2
- package/dist/css/dist/purger/optimized/ast/expressions.js +1 -1
- package/dist/css/dist/purger/optimized/purge.cjs +3 -3
- package/dist/css/dist/purger/optimized/purge.js +2 -2
- package/dist/css/dist/purger/optimized/utils/safelist.cjs +1 -1
- package/dist/css/dist/purger/optimized/utils/safelist.js +1 -1
- package/dist/hooks/useRtl.cjs +4 -8
- package/dist/hooks/useRtl.js +4 -8
- package/dist/postcss.cjs +4 -0
- package/dist/postcss.d.cts +4 -0
- package/dist/postcss.d.ts +4 -0
- package/dist/postcss.js +3 -0
- package/dist/styles/styler.d.cts +5 -5
- package/dist/styles/styler.d.ts +5 -5
- package/dist/tailwind-internal/dist/utils/entryPoints.cjs +2 -2
- package/dist/tailwind-internal/dist/utils/entryPoints.js +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowStyles.d.cts +2 -2
- package/dist/tailwind-internal/dist/utils/getShadowStyles.d.ts +2 -2
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/LICENSE +1 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/README.md +6 -10
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/at-rule.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/comment.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/container.d.ts +1 -6
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/container.js +81 -34
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/css-syntax-error.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/declaration.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/document.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/fromJSON.d.ts +1 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/fromJSON.js +76 -23
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/input.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/input.js +22 -5
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/lazy-result.d.ts +3 -4
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/lazy-result.js +68 -13
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/list.d.ts +1 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/map-generator.js +9 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/no-work-result.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/no-work-result.js +3 -4
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/node.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/node.js +105 -60
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/parse.d.ts +1 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/parser.js +37 -30
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/postcss.d.mts +0 -3
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/postcss.d.ts +10 -4
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/previous-map.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/previous-map.js +32 -6
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/processor.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/processor.js +1 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/result.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/root.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/rule.d.ts +12 -12
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/stringifier.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/stringifier.js +118 -32
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/stringify.d.ts +1 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/tokenize.js +4 -0
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/warning.d.ts +0 -1
- package/dist/tailwind-internal/dist/vendor/node_modules/postcss/package.json +44 -44
- package/dist/tailwind-v3/dist/purger/legacy/purgeCSS.cjs +1 -1
- package/dist/tailwind-v3/dist/purger/legacy/purgeCSS.js +1 -1
- package/dist/uds/generated/componentData.cjs +142 -140
- package/dist/uds/generated/componentData.js +142 -140
- package/dist/uds/generated/tailwindPurge.cjs +1 -1
- package/dist/uds/generated/tailwindPurge.js +1 -1
- package/dist/uds/package.cjs +11 -1
- package/dist/uds/package.js +11 -1
- package/generated/componentData.json +186 -184
- package/generated/tailwindPurge.ts +1 -1
- package/package.json +12 -2
|
@@ -11,8 +11,8 @@ import { VariantConfig } from "../types/ComponentConfig.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<"backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontFamily" | "fontSize" | "fontVariationSettings" | "lineHeight" | "textTransform" | "letterSpacing" | "gap" | "color" | "opacity" | "fillOpacity" | "fontWeight" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar" | "controlHeight", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontFamily" | "fontSize" | "fontVariationSettings" | "lineHeight" | "textTransform" | "letterSpacing" | "gap" | "color" | "opacity" | "fillOpacity" | "fontWeight" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar" | "controlHeight", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -11,8 +11,8 @@ import { VariantConfig } from "../types/ComponentConfig.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<"backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontFamily" | "fontSize" | "fontVariationSettings" | "lineHeight" | "textTransform" | "letterSpacing" | "gap" | "color" | "opacity" | "fillOpacity" | "fontWeight" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar" | "controlHeight", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontFamily" | "fontSize" | "fontVariationSettings" | "lineHeight" | "textTransform" | "letterSpacing" | "gap" | "color" | "opacity" | "fillOpacity" | "fontWeight" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity" | "paginationWidthVar" | "controlHeight", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -14,9 +14,9 @@ const require_colors = require("../dist/lib/colors.cjs");
|
|
|
14
14
|
const require_print = require("../dist/lib/print.cjs");
|
|
15
15
|
const require_box = require("../dist/lib/box.cjs");
|
|
16
16
|
const require_migrationSchemaVersion = require("../../uds/generated/migrationSchemaVersion.cjs");
|
|
17
|
+
let node_fs = require("node:fs");
|
|
17
18
|
let node_path = require("node:path");
|
|
18
19
|
node_path = require_runtime.__toESM(node_path, 1);
|
|
19
|
-
let node_fs = require("node:fs");
|
|
20
20
|
let _yahoo_uds_package_json = require("@yahoo/uds/package.json");
|
|
21
21
|
_yahoo_uds_package_json = require_runtime.__toESM(_yahoo_uds_package_json, 1);
|
|
22
22
|
//#region src/cli/commands/sync.ts
|
|
@@ -12,8 +12,8 @@ import { bold, cyan, green, magenta, red, yellow } from "../dist/lib/colors.js";
|
|
|
12
12
|
import { print } from "../dist/lib/print.js";
|
|
13
13
|
import { printBox } from "../dist/lib/box.js";
|
|
14
14
|
import { MIGRATION_SCHEMA_VERSION } from "../../uds/generated/migrationSchemaVersion.js";
|
|
15
|
-
import path from "node:path";
|
|
16
15
|
import { writeFileSync } from "node:fs";
|
|
16
|
+
import path from "node:path";
|
|
17
17
|
import packageJSON from "@yahoo/uds/package.json" with { type: "json" };
|
|
18
18
|
//#region src/cli/commands/sync.ts
|
|
19
19
|
const PRODUCTION_ENDPOINT = "https://config.uds.build";
|
|
@@ -4,8 +4,8 @@ const require_analytics = require("../utils/analytics.cjs");
|
|
|
4
4
|
const require_config = require("../utils/rules/config.cjs");
|
|
5
5
|
const require_colors = require("../lib/colors.cjs");
|
|
6
6
|
const require_print = require("../lib/print.cjs");
|
|
7
|
-
let node_path = require("node:path");
|
|
8
7
|
let node_fs = require("node:fs");
|
|
8
|
+
let node_path = require("node:path");
|
|
9
9
|
//#region ../cli/dist/commands/editor-rules.mjs
|
|
10
10
|
/*! © 2026 Yahoo, Inc. UDS CLI v0.0.0-development */
|
|
11
11
|
var editor_rules_default = {
|
|
@@ -3,8 +3,8 @@ import { trackEvent } from "../utils/analytics.js";
|
|
|
3
3
|
import { getAvailableEditors, getEditorConfig, getRuleContent } from "../utils/rules/config.js";
|
|
4
4
|
import { blue, green, red, yellow } from "../lib/colors.js";
|
|
5
5
|
import { print } from "../lib/print.js";
|
|
6
|
-
import { join } from "node:path";
|
|
7
6
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
8
|
//#region ../cli/dist/commands/editor-rules.mjs
|
|
9
9
|
/*! © 2026 Yahoo, Inc. UDS CLI v0.0.0-development */
|
|
10
10
|
var editor_rules_default = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
let node_fs = require("node:fs");
|
|
3
4
|
let node_path = require("node:path");
|
|
4
5
|
let node_url = require("node:url");
|
|
5
|
-
let node_fs = require("node:fs");
|
|
6
6
|
//#region ../cli/dist/utils/rules/config.mjs
|
|
7
7
|
/*! © 2026 Yahoo, Inc. UDS CLI v0.0.0-development */
|
|
8
8
|
const __dirname$1 = (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
3
|
import { dirname, join } from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
//#region ../cli/dist/utils/rules/config.mjs
|
|
6
6
|
/*! © 2026 Yahoo, Inc. UDS CLI v0.0.0-development */
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
@@ -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: ("
|
|
32
|
+
ariaKitPlacement: ("bottom-start" | "bottom-end" | "top-start" | "top-end" | ("bottom" | "left" | "right" | "top") | "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: ("
|
|
33
|
+
ariaKitPlacement: ("bottom-start" | "bottom-end" | "top-start" | "top-end" | ("bottom" | "left" | "right" | "top") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
|
|
34
34
|
animationDuration: number;
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
@@ -7,6 +7,7 @@ const require_components_IconSlot = require("../../IconSlot.cjs");
|
|
|
7
7
|
const require_components_Box = require("../../Box.cjs");
|
|
8
8
|
const require_hooks_usePrefersReducedMotion = require("../../../hooks/usePrefersReducedMotion.cjs");
|
|
9
9
|
const require_components_client_SpringMotionConfig = require("../SpringMotionConfig.cjs");
|
|
10
|
+
const require_hooks_useRtl = require("../../../hooks/useRtl.cjs");
|
|
10
11
|
const require_components_client_Switch_SwitchBase = require("./SwitchBase.cjs");
|
|
11
12
|
let react = require("react");
|
|
12
13
|
react = require_runtime.__toESM(react);
|
|
@@ -46,6 +47,7 @@ const toggleTransition = {
|
|
|
46
47
|
**/
|
|
47
48
|
const Switch = (0, react.forwardRef)(function Switch({ reduceMotion: forceReduceMotion, ...props }, parentRef) {
|
|
48
49
|
const prefersReducedMotion = require_hooks_usePrefersReducedMotion.usePrefersReducedMotion();
|
|
50
|
+
const isRtl = require_hooks_useRtl.useRtl();
|
|
49
51
|
const reduceMotion = forceReduceMotion ? "always" : "user";
|
|
50
52
|
const cssAnimationDuration = prefersReducedMotion || forceReduceMotion ? "duration-0" : "duration-120";
|
|
51
53
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Switch_SwitchBase.SwitchBase, {
|
|
@@ -54,14 +56,15 @@ const Switch = (0, react.forwardRef)(function Switch({ reduceMotion: forceReduce
|
|
|
54
56
|
cssAnimationDuration,
|
|
55
57
|
enableHoverTracking: true,
|
|
56
58
|
renderHandle: ({ size, isOn, isOnX, showHoverEffect, disabled, onIcon, offIcon, cssAnimationDuration, handleSlotProps }) => {
|
|
59
|
+
const onX = isRtl ? `-${isOnX}` : isOnX;
|
|
57
60
|
const motionInitialAndAnimate = {
|
|
58
61
|
initial: {
|
|
59
62
|
scale: 1,
|
|
60
|
-
x: isOn ?
|
|
63
|
+
x: isOn ? onX : 0
|
|
61
64
|
},
|
|
62
65
|
animate: {
|
|
63
66
|
scale: showHoverEffect ? 1.05 : 1,
|
|
64
|
-
x: isOn ?
|
|
67
|
+
x: isOn ? onX : 0
|
|
65
68
|
}
|
|
66
69
|
};
|
|
67
70
|
const classNames = {
|
|
@@ -5,6 +5,7 @@ import { IconSlot } from "../../IconSlot.js";
|
|
|
5
5
|
import { Box } from "../../Box.js";
|
|
6
6
|
import { usePrefersReducedMotion } from "../../../hooks/usePrefersReducedMotion.js";
|
|
7
7
|
import { SpringMotionConfig } from "../SpringMotionConfig.js";
|
|
8
|
+
import { useRtl } from "../../../hooks/useRtl.js";
|
|
8
9
|
import { SwitchBase } from "./SwitchBase.js";
|
|
9
10
|
import { forwardRef } from "react";
|
|
10
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -42,6 +43,7 @@ const toggleTransition = {
|
|
|
42
43
|
**/
|
|
43
44
|
const Switch = forwardRef(function Switch({ reduceMotion: forceReduceMotion, ...props }, parentRef) {
|
|
44
45
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
46
|
+
const isRtl = useRtl();
|
|
45
47
|
const reduceMotion = forceReduceMotion ? "always" : "user";
|
|
46
48
|
const cssAnimationDuration = prefersReducedMotion || forceReduceMotion ? "duration-0" : "duration-120";
|
|
47
49
|
return /* @__PURE__ */ jsx(SwitchBase, {
|
|
@@ -50,14 +52,15 @@ const Switch = forwardRef(function Switch({ reduceMotion: forceReduceMotion, ...
|
|
|
50
52
|
cssAnimationDuration,
|
|
51
53
|
enableHoverTracking: true,
|
|
52
54
|
renderHandle: ({ size, isOn, isOnX, showHoverEffect, disabled, onIcon, offIcon, cssAnimationDuration, handleSlotProps }) => {
|
|
55
|
+
const onX = isRtl ? `-${isOnX}` : isOnX;
|
|
53
56
|
const motionInitialAndAnimate = {
|
|
54
57
|
initial: {
|
|
55
58
|
scale: 1,
|
|
56
|
-
x: isOn ?
|
|
59
|
+
x: isOn ? onX : 0
|
|
57
60
|
},
|
|
58
61
|
animate: {
|
|
59
62
|
scale: showHoverEffect ? 1.05 : 1,
|
|
60
|
-
x: isOn ?
|
|
63
|
+
x: isOn ? onX : 0
|
|
61
64
|
}
|
|
62
65
|
};
|
|
63
66
|
const classNames = {
|
|
@@ -6,11 +6,11 @@ const require_styles_styler = require("../../../styles/styler.cjs");
|
|
|
6
6
|
const SIZE_MAP = {
|
|
7
7
|
md: {
|
|
8
8
|
isOnX: "1.25rem",
|
|
9
|
-
isOnTranslateClass: require_styles_styler.cx("translate-x-[1.25rem]")
|
|
9
|
+
isOnTranslateClass: require_styles_styler.cx("translate-x-[1.25rem]", "rtl:translate-x-[-1.25rem]")
|
|
10
10
|
},
|
|
11
11
|
sm: {
|
|
12
12
|
isOnX: "0.75rem",
|
|
13
|
-
isOnTranslateClass: require_styles_styler.cx("translate-x-[0.75rem]")
|
|
13
|
+
isOnTranslateClass: require_styles_styler.cx("translate-x-[0.75rem]", "rtl:translate-x-[-0.75rem]")
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
//#endregion
|
|
@@ -5,11 +5,11 @@ import { cx } from "../../../styles/styler.js";
|
|
|
5
5
|
const SIZE_MAP = {
|
|
6
6
|
md: {
|
|
7
7
|
isOnX: "1.25rem",
|
|
8
|
-
isOnTranslateClass: cx("translate-x-[1.25rem]")
|
|
8
|
+
isOnTranslateClass: cx("translate-x-[1.25rem]", "rtl:translate-x-[-1.25rem]")
|
|
9
9
|
},
|
|
10
10
|
sm: {
|
|
11
11
|
isOnX: "0.75rem",
|
|
12
|
-
isOnTranslateClass: cx("translate-x-[0.75rem]")
|
|
12
|
+
isOnTranslateClass: cx("translate-x-[0.75rem]", "rtl:translate-x-[-0.75rem]")
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_utils = require("./utils.cjs");
|
|
4
|
+
const require_entryPoints = require("../../../tailwind-internal/dist/utils/entryPoints.cjs");
|
|
3
5
|
const require_colors = require("../packages/cli/dist/lib/colors.cjs");
|
|
4
6
|
const require_print = require("../packages/cli/dist/lib/print.cjs");
|
|
5
7
|
const require_perf = require("./perf.cjs");
|
|
6
|
-
const require_entryPoints = require("../../../tailwind-internal/dist/utils/entryPoints.cjs");
|
|
7
8
|
const require_nodeUtils = require("./nodeUtils.cjs");
|
|
8
9
|
const require_spinner = require("../packages/cli/dist/lib/spinner.cjs");
|
|
9
10
|
const require_index = require("../packages/config/dist/index.cjs");
|
|
10
11
|
const require_safelist = require("../purger/optimized/utils/safelist.cjs");
|
|
11
|
-
const require_utils = require("./utils.cjs");
|
|
12
12
|
const require_generate_helpers = require("./generate.helpers.cjs");
|
|
13
|
-
let node_path = require("node:path");
|
|
14
|
-
node_path = require_runtime.__toESM(node_path, 1);
|
|
15
13
|
let node_fs = require("node:fs");
|
|
16
14
|
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
15
|
+
let node_path = require("node:path");
|
|
16
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
17
17
|
let node_zlib = require("node:zlib");
|
|
18
18
|
let postcss = require("postcss");
|
|
19
19
|
postcss = require_runtime.__toESM(postcss, 1);
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_safelist = require("../packages/icons/src/safelist.cjs");
|
|
4
|
+
const require_utils = require("./utils.cjs");
|
|
3
5
|
const require_getIconStyles = require("../../../tailwind-internal/dist/components/getIconStyles.cjs");
|
|
4
6
|
const require_tailwindPlugin = require("../../../tailwind-internal/dist/tailwindPlugin.cjs");
|
|
5
7
|
const require_entryPoints = require("../../../tailwind-internal/dist/utils/entryPoints.cjs");
|
|
6
|
-
const
|
|
7
|
-
const require_safelist = require("../purger/optimized/utils/safelist.cjs");
|
|
8
|
+
const require_pruneVars = require("../postcss/pruneVars.cjs");
|
|
9
|
+
const require_safelist$1 = require("../purger/optimized/utils/safelist.cjs");
|
|
8
10
|
const require_runner_helpers = require("./runner.helpers.cjs");
|
|
9
|
-
const require_utils = require("./utils.cjs");
|
|
10
|
-
const require_safelist$1 = require("../packages/icons/src/safelist.cjs");
|
|
11
11
|
const require_optimizeCSS = require("../utils/optimizeCSS.cjs");
|
|
12
12
|
const require_postcss = require("./postcss.cjs");
|
|
13
|
+
let node_fs = require("node:fs");
|
|
14
|
+
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
13
15
|
let node_path = require("node:path");
|
|
14
16
|
node_path = require_runtime.__toESM(node_path, 1);
|
|
15
17
|
let node_url = require("node:url");
|
|
16
|
-
let node_fs = require("node:fs");
|
|
17
|
-
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
18
18
|
let postcss = require("postcss");
|
|
19
19
|
postcss = require_runtime.__toESM(postcss, 1);
|
|
20
20
|
let autoprefixer = require("autoprefixer");
|
|
21
21
|
autoprefixer = require_runtime.__toESM(autoprefixer, 1);
|
|
22
|
-
let postcss_prune_var = require("postcss-prune-var");
|
|
23
|
-
postcss_prune_var = require_runtime.__toESM(postcss_prune_var, 1);
|
|
24
22
|
let postcss_scope = require("postcss-scope");
|
|
25
23
|
postcss_scope = require_runtime.__toESM(postcss_scope, 1);
|
|
26
24
|
//#region ../css/dist/css/generate.helpers.mjs
|
|
@@ -28,7 +26,7 @@ postcss_scope = require_runtime.__toESM(postcss_scope, 1);
|
|
|
28
26
|
const getPruneVarSafelist = (cssOptions) => {
|
|
29
27
|
const pruneVars = cssOptions?.optimization?.pruneVars;
|
|
30
28
|
const configuredSafelist = pruneVars && typeof pruneVars === "object" ? pruneVars.safelist ?? [] : [];
|
|
31
|
-
return [...require_safelist
|
|
29
|
+
return [...require_safelist.iconPruneVarsSafelist, ...configuredSafelist];
|
|
32
30
|
};
|
|
33
31
|
const getCssFeatureFlags = (cssOptions) => {
|
|
34
32
|
const optimizationConfig = cssOptions?.optimization;
|
|
@@ -58,7 +56,7 @@ const loadTailwindcss = async () => {
|
|
|
58
56
|
throw new Error("Unable to locate a Tailwind CSS runtime for UDS CSS generation.");
|
|
59
57
|
};
|
|
60
58
|
const getInternalSafelistRawContent = (safelist) => {
|
|
61
|
-
const internalClasses = new Set(require_safelist.getInternalSafelistClasses());
|
|
59
|
+
const internalClasses = new Set(require_safelist$1.getInternalSafelistClasses());
|
|
62
60
|
const matchedInternalClasses = safelist.filter((entry) => typeof entry === "string" && internalClasses.has(entry));
|
|
63
61
|
if (matchedInternalClasses.length === 0) return [];
|
|
64
62
|
return [`<div class="${matchedInternalClasses.join(" ")}"></div>`];
|
|
@@ -86,17 +84,9 @@ const createTailwindPlugin = async (options) => {
|
|
|
86
84
|
})]
|
|
87
85
|
});
|
|
88
86
|
};
|
|
89
|
-
const getPruneVarPlugins = (safeVarPrefixes) => {
|
|
90
|
-
if (safeVarPrefixes.length === 0) return [(0, postcss_prune_var.default)()];
|
|
91
|
-
return [
|
|
92
|
-
require_postcssPreserveVars.preserveVars({ preserve: safeVarPrefixes }),
|
|
93
|
-
(0, postcss_prune_var.default)(),
|
|
94
|
-
require_postcssPreserveVars.preserveVarsCleanup()
|
|
95
|
-
];
|
|
96
|
-
};
|
|
97
87
|
const buildPostcssPlugins = (options) => {
|
|
98
88
|
const plugins = [options.tailwindPlugin, (0, autoprefixer.default)()];
|
|
99
|
-
if (options.shouldPruneVars) plugins.push(...getPruneVarPlugins(options.safeVarPrefixes));
|
|
89
|
+
if (options.shouldPruneVars) plugins.push(...require_pruneVars.getPruneVarPlugins(options.safeVarPrefixes));
|
|
100
90
|
if (options.scopeClass) plugins.push((0, postcss_scope.default)(options.scopeClass));
|
|
101
91
|
const otherBoundaryScopes = options.otherBoundaryScopes ?? [];
|
|
102
92
|
if (otherBoundaryScopes.length > 0) plugins.push(require_postcss.appendIsolationExclusionPlugin(otherBoundaryScopes));
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { iconPruneVarsSafelist } from "../packages/icons/src/safelist.js";
|
|
3
|
+
import { formatBytes } from "./utils.js";
|
|
2
4
|
import { getIconStyles } from "../../../tailwind-internal/dist/components/getIconStyles.js";
|
|
3
5
|
import { tailwindPlugin } from "../../../tailwind-internal/dist/tailwindPlugin.js";
|
|
4
6
|
import { hasAllowedEntryFileExtension } from "../../../tailwind-internal/dist/utils/entryPoints.js";
|
|
5
|
-
import {
|
|
7
|
+
import { getPruneVarPlugins } from "../postcss/pruneVars.js";
|
|
6
8
|
import { getInternalSafelistClasses } from "../purger/optimized/utils/safelist.js";
|
|
7
9
|
import { formatCssDuration } from "./runner.helpers.js";
|
|
8
|
-
import { formatBytes } from "./utils.js";
|
|
9
|
-
import { iconPruneVarsSafelist } from "../packages/icons/src/safelist.js";
|
|
10
10
|
import { optimizeCSS } from "../utils/optimizeCSS.js";
|
|
11
11
|
import { appendIsolationExclusionPlugin, fixScopedColorModeSelectorsPlugin, fixScopedSelfOrParentSelectorsPlugin } from "./postcss.js";
|
|
12
|
+
import fs from "node:fs";
|
|
12
13
|
import path from "node:path";
|
|
13
14
|
import { fileURLToPath } from "node:url";
|
|
14
|
-
import fs from "node:fs";
|
|
15
15
|
import postcss from "postcss";
|
|
16
16
|
import autoprefixer from "autoprefixer";
|
|
17
|
-
import pruneVar from "postcss-prune-var";
|
|
18
17
|
import postcssScope from "postcss-scope";
|
|
19
18
|
//#region ../css/dist/css/generate.helpers.mjs
|
|
20
19
|
/*! © 2026 Yahoo, Inc. UDS CSS v0.0.0-development */
|
|
@@ -79,14 +78,6 @@ const createTailwindPlugin = async (options) => {
|
|
|
79
78
|
})]
|
|
80
79
|
});
|
|
81
80
|
};
|
|
82
|
-
const getPruneVarPlugins = (safeVarPrefixes) => {
|
|
83
|
-
if (safeVarPrefixes.length === 0) return [pruneVar()];
|
|
84
|
-
return [
|
|
85
|
-
preserveVars({ preserve: safeVarPrefixes }),
|
|
86
|
-
pruneVar(),
|
|
87
|
-
preserveVarsCleanup()
|
|
88
|
-
];
|
|
89
|
-
};
|
|
90
81
|
const buildPostcssPlugins = (options) => {
|
|
91
82
|
const plugins = [options.tailwindPlugin, autoprefixer()];
|
|
92
83
|
if (options.shouldPruneVars) plugins.push(...getPruneVarPlugins(options.safeVarPrefixes));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { extractRuntimeConfigValues, extractVariantDefaults, getConfigurableCssVariables, getMotionVarPrefixes } from "./utils.js";
|
|
3
|
+
import { resolveEntryPaths } from "../../../tailwind-internal/dist/utils/entryPoints.js";
|
|
2
4
|
import { cyan, magenta, yellow } from "../packages/cli/dist/lib/colors.js";
|
|
3
5
|
import { print } from "../packages/cli/dist/lib/print.js";
|
|
4
6
|
import { measureAsync } from "./perf.js";
|
|
5
|
-
import { resolveEntryPaths } from "../../../tailwind-internal/dist/utils/entryPoints.js";
|
|
6
7
|
import { loadConfigFile, scanDirectoriesForSafelist } from "./nodeUtils.js";
|
|
7
8
|
import { spinStop } from "../packages/cli/dist/lib/spinner.js";
|
|
8
9
|
import { defaultTokensConfig } from "../packages/config/dist/index.js";
|
|
9
10
|
import { deduplicateSafelist, getInternalSafelistClasses, getThemeAndScaleClasses } from "../purger/optimized/utils/safelist.js";
|
|
10
|
-
import { extractRuntimeConfigValues, extractVariantDefaults, getConfigurableCssVariables, getMotionVarPrefixes } from "./utils.js";
|
|
11
11
|
import { applyScopedColorModeFix, buildPostcssPlugins, createTailwindPlugin, getCssFeatureFlags, getInternalIconModeCss, optimizeGeneratedCss, printSimpleModeStats } from "./generate.helpers.js";
|
|
12
|
-
import path from "node:path";
|
|
13
12
|
import fs from "node:fs";
|
|
13
|
+
import path from "node:path";
|
|
14
14
|
import { gzipSync } from "node:zlib";
|
|
15
15
|
import postcss from "postcss";
|
|
16
16
|
//#region ../css/dist/css/generate.mjs
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_entryPoints = require("../../../tailwind-internal/dist/utils/entryPoints.cjs");
|
|
3
4
|
const require_colors = require("../packages/cli/dist/lib/colors.cjs");
|
|
4
5
|
const require_print = require("../packages/cli/dist/lib/print.cjs");
|
|
5
6
|
const require_perf = require("./perf.cjs");
|
|
6
7
|
const require_purgeFromCode = require("../purger/optimized/purgeFromCode.cjs");
|
|
7
|
-
const require_entryPoints = require("../../../tailwind-internal/dist/utils/entryPoints.cjs");
|
|
8
8
|
const require_files = require("../purger/optimized/utils/files.cjs");
|
|
9
|
-
let node_path = require("node:path");
|
|
10
|
-
node_path = require_runtime.__toESM(node_path, 1);
|
|
11
9
|
let node_fs = require("node:fs");
|
|
12
10
|
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
11
|
+
let node_path = require("node:path");
|
|
12
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
13
13
|
let fast_glob = require("fast-glob");
|
|
14
14
|
fast_glob = require_runtime.__toESM(fast_glob, 1);
|
|
15
15
|
let node_module = require("node:module");
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { formatEntryValue } from "../../../tailwind-internal/dist/utils/entryPoints.js";
|
|
2
3
|
import { cyan, green, magenta, red } from "../packages/cli/dist/lib/colors.js";
|
|
3
4
|
import { print } from "../packages/cli/dist/lib/print.js";
|
|
4
5
|
import { measureAsync } from "./perf.js";
|
|
5
6
|
import { purgeFromCodeOptimized, resolveWrapperSpreadSafelist } from "../purger/optimized/purgeFromCode.js";
|
|
6
|
-
import { formatEntryValue } from "../../../tailwind-internal/dist/utils/entryPoints.js";
|
|
7
7
|
import { DEV_FILE_IGNORE_GLOBS } from "../purger/optimized/utils/files.js";
|
|
8
|
-
import path from "node:path";
|
|
9
8
|
import fs from "node:fs";
|
|
9
|
+
import path from "node:path";
|
|
10
10
|
import fg from "fast-glob";
|
|
11
11
|
import { createRequire } from "node:module";
|
|
12
12
|
//#region ../css/dist/css/nodeUtils.mjs
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_utils = require("./utils.cjs");
|
|
4
|
+
const require_entryPoints = require("../../../tailwind-internal/dist/utils/entryPoints.cjs");
|
|
3
5
|
const require_colors = require("../packages/cli/dist/lib/colors.cjs");
|
|
4
6
|
const require_print = require("../packages/cli/dist/lib/print.cjs");
|
|
5
7
|
const require_perf = require("./perf.cjs");
|
|
6
|
-
const require_entryPoints = require("../../../tailwind-internal/dist/utils/entryPoints.cjs");
|
|
7
8
|
const require_files = require("../purger/optimized/utils/files.cjs");
|
|
8
9
|
const require_nodeUtils = require("./nodeUtils.cjs");
|
|
9
10
|
const require_spinner = require("../packages/cli/dist/lib/spinner.cjs");
|
|
@@ -11,7 +12,6 @@ const require_logger = require("../packages/cli/dist/lib/logger.cjs");
|
|
|
11
12
|
const require_index = require("../packages/config/dist/index.cjs");
|
|
12
13
|
const require_safelist = require("../purger/optimized/utils/safelist.cjs");
|
|
13
14
|
const require_runner_helpers = require("./runner.helpers.cjs");
|
|
14
|
-
const require_utils = require("./utils.cjs");
|
|
15
15
|
const require_generate_helpers = require("./generate.helpers.cjs");
|
|
16
16
|
const require_generate = require("./generate.cjs");
|
|
17
17
|
const require_workerPool = require("./workerPool.cjs");
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { extractRuntimeConfigValues, extractVariantDefaults, formatBytes, getConfigurableCssVariables, getMotionVarPrefixes } from "./utils.js";
|
|
3
|
+
import { resolveEntryPaths } from "../../../tailwind-internal/dist/utils/entryPoints.js";
|
|
2
4
|
import { gray, green, magenta } from "../packages/cli/dist/lib/colors.js";
|
|
3
5
|
import { print } from "../packages/cli/dist/lib/print.js";
|
|
4
6
|
import { captureMemory, clearTimings, measureAsync, printPerfSummary } from "./perf.js";
|
|
5
|
-
import { resolveEntryPaths } from "../../../tailwind-internal/dist/utils/entryPoints.js";
|
|
6
7
|
import { TEST_FILE_IGNORE_GLOBS } from "../purger/optimized/utils/files.js";
|
|
7
8
|
import { findPackageRoot, findPackageSourceDir, getPackageUdsScope, loadConfigFile, scanDirectoriesForSafelist, scanDirectoryForSafelist } from "./nodeUtils.js";
|
|
8
9
|
import { spinStart, spinStop } from "../packages/cli/dist/lib/spinner.js";
|
|
@@ -10,7 +11,6 @@ import { createLogger } from "../packages/cli/dist/lib/logger.js";
|
|
|
10
11
|
import { defaultTokensConfig } from "../packages/config/dist/index.js";
|
|
11
12
|
import { deduplicateSafelist, getInternalSafelistClasses, getThemeAndScaleClasses } from "../purger/optimized/utils/safelist.js";
|
|
12
13
|
import { formatCssDuration, getMainCssSummaryMessage, getOutputFileSection, getScanSummaryMessage, getScopedCssSummaryMessage, getVerboseScanFileList, getWatchDirectoryGroups } from "./runner.helpers.js";
|
|
13
|
-
import { extractRuntimeConfigValues, extractVariantDefaults, formatBytes, getConfigurableCssVariables, getMotionVarPrefixes } from "./utils.js";
|
|
14
14
|
import { getPruneVarSafelist } from "./generate.helpers.js";
|
|
15
15
|
import { generateCSS, generateSimpleModeCSS } from "./generate.js";
|
|
16
16
|
import { createWorkerPool } from "./workerPool.js";
|
|
@@ -104,4 +104,4 @@ type UDSThemeConfigInput = UDSThemeConfig | ((ctx: UDSThemeContext) => UDSThemeC
|
|
|
104
104
|
*/
|
|
105
105
|
declare const defineTheme: (config: UDSThemeConfigInput) => UDSThemeConfigInput; //#endregion
|
|
106
106
|
//#endregion
|
|
107
|
-
export { type UDSCSSOptimizationOptions, type UDSThemeConfig, type UDSThemeConfigInput, type UDSThemeContext, defineTheme };
|
|
107
|
+
export { type UDSCSSOptimizationOptions, type UDSCSSPruneVarsOptions, type UDSCSSVarSafelistPattern, type UDSThemeConfig, type UDSThemeConfigInput, type UDSThemeContext, defineTheme };
|
|
@@ -104,4 +104,4 @@ type UDSThemeConfigInput = UDSThemeConfig | ((ctx: UDSThemeContext) => UDSThemeC
|
|
|
104
104
|
*/
|
|
105
105
|
declare const defineTheme: (config: UDSThemeConfigInput) => UDSThemeConfigInput; //#endregion
|
|
106
106
|
//#endregion
|
|
107
|
-
export { type UDSCSSOptimizationOptions, type UDSThemeConfig, type UDSThemeConfigInput, type UDSThemeContext, defineTheme };
|
|
107
|
+
export { type UDSCSSOptimizationOptions, type UDSCSSPruneVarsOptions, type UDSCSSVarSafelistPattern, type UDSThemeConfig, type UDSThemeConfigInput, type UDSThemeContext, defineTheme };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_safelist = require("../packages/icons/src/safelist.cjs");
|
|
4
|
+
const require_utils = require("../css/utils.cjs");
|
|
5
|
+
const require_postcssPreserveVars = require("../../../tailwind-internal/dist/utils/postcssPreserveVars.cjs");
|
|
6
|
+
let postcss_prune_var = require("postcss-prune-var");
|
|
7
|
+
postcss_prune_var = require_runtime.__toESM(postcss_prune_var, 1);
|
|
8
|
+
//#region ../css/dist/postcss/pruneVars.mjs
|
|
9
|
+
/*! © 2026 Yahoo, Inc. UDS CSS v0.0.0-development */
|
|
10
|
+
/**
|
|
11
|
+
* Build the preserve → prune → cleanup PostCSS plugin sequence used to remove
|
|
12
|
+
* unused CSS variables. Used internally by the `uds css` command; consumers
|
|
13
|
+
* should use {@link udsPruneVars} instead.
|
|
14
|
+
*/
|
|
15
|
+
const getPruneVarPlugins = (safeVarPrefixes) => {
|
|
16
|
+
if (safeVarPrefixes.length === 0) return [(0, postcss_prune_var.default)()];
|
|
17
|
+
return [
|
|
18
|
+
require_postcssPreserveVars.preserveVars({ preserve: safeVarPrefixes }),
|
|
19
|
+
(0, postcss_prune_var.default)(),
|
|
20
|
+
require_postcssPreserveVars.preserveVarsCleanup()
|
|
21
|
+
];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Ready-to-use PostCSS plugin that removes unused UDS token CSS variables
|
|
25
|
+
* (and any other unused CSS variables) from generated CSS.
|
|
26
|
+
*
|
|
27
|
+
* Runtime-configurable UDS variables and icon color variables are always
|
|
28
|
+
* preserved. Additional variables can be preserved via the `safelist` option
|
|
29
|
+
* using string prefixes or regular expressions.
|
|
30
|
+
*
|
|
31
|
+
* Must run after all CSS has been generated (e.g. after Tailwind).
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```js
|
|
35
|
+
* // postcss.config.js
|
|
36
|
+
* const { udsPruneVars } = require('@yahoo/uds/postcss');
|
|
37
|
+
*
|
|
38
|
+
* module.exports = {
|
|
39
|
+
* plugins: [udsPruneVars({ safelist: ['--app-theme-'] })],
|
|
40
|
+
* };
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
const udsPruneVars = (options = {}) => ({
|
|
44
|
+
postcssPlugin: "uds-prune-vars",
|
|
45
|
+
plugins: getPruneVarPlugins([
|
|
46
|
+
...require_utils.getConfigurableCssVariables(),
|
|
47
|
+
...require_safelist.iconPruneVarsSafelist,
|
|
48
|
+
...options.safelist ?? []
|
|
49
|
+
])
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
exports.getPruneVarPlugins = getPruneVarPlugins;
|
|
53
|
+
exports.udsPruneVars = udsPruneVars;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
import { UDSCSSPruneVarsOptions } from "../css/theme.cjs";
|
|
3
|
+
import { AcceptedPlugin } from "postcss";
|
|
4
|
+
|
|
5
|
+
//#region ../css/dist/postcss/pruneVars.d.mts
|
|
6
|
+
//#region src/postcss/pruneVars.d.ts
|
|
7
|
+
interface UDSPruneVarsPlugin {
|
|
8
|
+
postcssPlugin: 'uds-prune-vars';
|
|
9
|
+
plugins: AcceptedPlugin[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Ready-to-use PostCSS plugin that removes unused UDS token CSS variables
|
|
13
|
+
* (and any other unused CSS variables) from generated CSS.
|
|
14
|
+
*
|
|
15
|
+
* Runtime-configurable UDS variables and icon color variables are always
|
|
16
|
+
* preserved. Additional variables can be preserved via the `safelist` option
|
|
17
|
+
* using string prefixes or regular expressions.
|
|
18
|
+
*
|
|
19
|
+
* Must run after all CSS has been generated (e.g. after Tailwind).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```js
|
|
23
|
+
* // postcss.config.js
|
|
24
|
+
* const { udsPruneVars } = require('@yahoo/uds/postcss');
|
|
25
|
+
*
|
|
26
|
+
* module.exports = {
|
|
27
|
+
* plugins: [udsPruneVars({ safelist: ['--app-theme-'] })],
|
|
28
|
+
* };
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare const udsPruneVars: (options?: UDSCSSPruneVarsOptions) => UDSPruneVarsPlugin; //#endregion
|
|
32
|
+
//#endregion
|
|
33
|
+
export { type UDSPruneVarsPlugin, udsPruneVars };
|