@yahoo/uds 3.114.0-beta.3 → 3.114.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 +3 -0
- package/dist/automated-config/dist/generated/autoVariants.d.cts +3 -0
- package/dist/automated-config/dist/generated/autoVariants.d.ts +3 -0
- package/dist/automated-config/dist/generated/autoVariants.js +3 -0
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +1883 -0
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +175 -1
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +175 -1
- package/dist/automated-config/dist/generated/generatedConfigs.js +1882 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +84 -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 +84 -0
- package/dist/automated-config/dist/mapTextVariantFixtureToValue.cjs +1 -12
- package/dist/automated-config/dist/mapTextVariantFixtureToValue.js +1 -12
- package/dist/automated-config/dist/properties.cjs +58 -12
- package/dist/automated-config/dist/properties.d.cts +8 -0
- package/dist/automated-config/dist/properties.d.ts +8 -0
- package/dist/automated-config/dist/properties.js +58 -12
- 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 +7 -1
- package/dist/cli/commands/sync.d.cts +1 -1
- package/dist/cli/commands/sync.d.ts +1 -1
- package/dist/cli/commands/sync.js +7 -1
- package/dist/cli/commands/version.cjs +2 -0
- package/dist/cli/commands/version.d.cts +1 -1
- package/dist/cli/commands/version.d.ts +1 -1
- package/dist/cli/commands/version.js +2 -0
- package/dist/cli/dist/cli.cjs +1 -1
- package/dist/cli/dist/cli.js +1 -1
- package/dist/cli/dist/commands/editor-rules.cjs +2 -2
- package/dist/cli/dist/commands/editor-rules.js +2 -2
- package/dist/cli/dist/utils/rules/config.cjs +1 -1
- package/dist/cli/dist/utils/rules/config.js +1 -1
- package/dist/cli/runner.cjs +2 -11
- package/dist/cli/runner.js +2 -11
- package/dist/components/Scrim.cjs +28 -0
- package/dist/components/Scrim.d.cts +14 -0
- package/dist/components/Scrim.d.ts +14 -0
- package/dist/components/Scrim.js +26 -0
- package/dist/components/client/BottomSheet/BottomSheet.cjs +209 -0
- package/dist/components/client/BottomSheet/BottomSheet.d.cts +77 -0
- package/dist/components/client/BottomSheet/BottomSheet.d.ts +77 -0
- package/dist/components/client/BottomSheet/BottomSheet.js +207 -0
- package/dist/components/client/BottomSheet/BottomSheetContent.cjs +26 -0
- package/dist/components/client/BottomSheet/BottomSheetContent.d.cts +15 -0
- package/dist/components/client/BottomSheet/BottomSheetContent.d.ts +15 -0
- package/dist/components/client/BottomSheet/BottomSheetContent.js +24 -0
- package/dist/components/client/BottomSheet/BottomSheetDismiss.cjs +15 -0
- package/dist/components/client/BottomSheet/BottomSheetDismiss.d.cts +12 -0
- package/dist/components/client/BottomSheet/BottomSheetDismiss.d.ts +12 -0
- package/dist/components/client/BottomSheet/BottomSheetDismiss.js +13 -0
- package/dist/components/client/BottomSheet/BottomSheetHandle.cjs +30 -0
- package/dist/components/client/BottomSheet/BottomSheetHandle.d.cts +19 -0
- package/dist/components/client/BottomSheet/BottomSheetHandle.d.ts +19 -0
- package/dist/components/client/BottomSheet/BottomSheetHandle.js +28 -0
- package/dist/components/client/BottomSheet/BottomSheetHeader.cjs +42 -0
- package/dist/components/client/BottomSheet/BottomSheetHeader.d.cts +18 -0
- package/dist/components/client/BottomSheet/BottomSheetHeader.d.ts +18 -0
- package/dist/components/client/BottomSheet/BottomSheetHeader.js +40 -0
- package/dist/components/client/BottomSheet/BottomSheetProvider.cjs +21 -0
- package/dist/components/client/BottomSheet/BottomSheetProvider.d.cts +19 -0
- package/dist/components/client/BottomSheet/BottomSheetProvider.d.ts +19 -0
- package/dist/components/client/BottomSheet/BottomSheetProvider.js +19 -0
- package/dist/components/client/BottomSheet/BottomSheetTrigger.cjs +15 -0
- package/dist/components/client/BottomSheet/BottomSheetTrigger.d.cts +12 -0
- package/dist/components/client/BottomSheet/BottomSheetTrigger.d.ts +12 -0
- package/dist/components/client/BottomSheet/BottomSheetTrigger.js +13 -0
- package/dist/components/client/BottomSheet/UDSBottomSheetConfigProvider.cjs +32 -0
- package/dist/components/client/BottomSheet/UDSBottomSheetConfigProvider.d.cts +22 -0
- package/dist/components/client/BottomSheet/UDSBottomSheetConfigProvider.d.ts +22 -0
- package/dist/components/client/BottomSheet/UDSBottomSheetConfigProvider.js +29 -0
- package/dist/components/client/BottomSheet/index.cjs +22 -0
- package/dist/components/client/BottomSheet/index.d.cts +10 -0
- package/dist/components/client/BottomSheet/index.d.ts +10 -0
- package/dist/components/client/BottomSheet/index.js +12 -0
- package/dist/components/client/BottomSheet/useBottomSheetDrag.cjs +188 -0
- package/dist/components/client/BottomSheet/useBottomSheetDrag.d.cts +44 -0
- package/dist/components/client/BottomSheet/useBottomSheetDrag.d.ts +44 -0
- package/dist/components/client/BottomSheet/useBottomSheetDrag.js +185 -0
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.cjs +138 -0
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.d.cts +46 -0
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.d.ts +46 -0
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.js +135 -0
- package/dist/components/client/BottomSheet/useBottomSheetStore.cjs +34 -0
- package/dist/components/client/BottomSheet/useBottomSheetStore.d.cts +38 -0
- package/dist/components/client/BottomSheet/useBottomSheetStore.d.ts +38 -0
- package/dist/components/client/BottomSheet/useBottomSheetStore.js +31 -0
- package/dist/components/client/BottomSheet/useBottomSheetStoreInternal.cjs +17 -0
- package/dist/components/client/BottomSheet/useBottomSheetStoreInternal.d.cts +13 -0
- package/dist/components/client/BottomSheet/useBottomSheetStoreInternal.d.ts +13 -0
- package/dist/components/client/BottomSheet/useBottomSheetStoreInternal.js +15 -0
- package/dist/components/client/BottomSheet/useExpansionMargins.cjs +89 -0
- package/dist/components/client/BottomSheet/useExpansionMargins.d.cts +34 -0
- package/dist/components/client/BottomSheet/useExpansionMargins.d.ts +34 -0
- package/dist/components/client/BottomSheet/useExpansionMargins.js +87 -0
- package/dist/components/client/BottomSheet/useViewportHeight.cjs +32 -0
- package/dist/components/client/BottomSheet/useViewportHeight.d.cts +9 -0
- package/dist/components/client/BottomSheet/useViewportHeight.d.ts +9 -0
- package/dist/components/client/BottomSheet/useViewportHeight.js +30 -0
- package/dist/components/client/BottomSheet/useVirtualKeyboard.cjs +48 -0
- package/dist/components/client/BottomSheet/useVirtualKeyboard.d.cts +10 -0
- package/dist/components/client/BottomSheet/useVirtualKeyboard.d.ts +10 -0
- package/dist/components/client/BottomSheet/useVirtualKeyboard.js +46 -0
- package/dist/components/client/BottomSheet/utils.cjs +128 -0
- package/dist/components/client/BottomSheet/utils.d.cts +61 -0
- package/dist/components/client/BottomSheet/utils.d.ts +61 -0
- package/dist/components/client/BottomSheet/utils.js +118 -0
- package/dist/components/client/Menu/Menu.Content.cjs +1 -1
- package/dist/components/client/Menu/Menu.Content.js +1 -1
- package/dist/components/client/Menu/Menu.index.d.cts +1 -1
- package/dist/components/client/index.cjs +16 -0
- package/dist/components/client/index.d.cts +10 -1
- package/dist/components/client/index.d.ts +10 -1
- package/dist/components/client/index.js +9 -1
- package/dist/components/client/providers/UDSConfigProvider.cjs +10 -6
- package/dist/components/client/providers/UDSConfigProvider.d.cts +1 -0
- package/dist/components/client/providers/UDSConfigProvider.d.ts +1 -0
- package/dist/components/client/providers/UDSConfigProvider.js +10 -6
- package/dist/components/index.cjs +24 -0
- package/dist/components/index.d.cts +9 -1
- package/dist/components/index.d.ts +9 -1
- package/dist/components/index.js +17 -1
- package/dist/config/dist/index.cjs +110 -2
- package/dist/config/dist/index.js +110 -2
- package/dist/fixtures/dist/index.cjs +103 -0
- package/dist/fixtures/dist/index.d.cts +3 -2
- package/dist/fixtures/dist/index.d.ts +3 -2
- package/dist/fixtures/dist/index.js +103 -1
- package/dist/fixtures/index.cjs +1 -0
- package/dist/fixtures/index.d.cts +2 -2
- package/dist/fixtures/index.d.ts +2 -2
- package/dist/fixtures/index.js +2 -2
- package/dist/index.cjs +20 -2
- package/dist/index.d.cts +12 -5
- package/dist/index.d.ts +12 -5
- package/dist/index.js +11 -3
- package/dist/runtime/bottomSheetConfig.cjs +11 -0
- package/dist/runtime/bottomSheetConfig.d.cts +15 -0
- package/dist/runtime/bottomSheetConfig.d.ts +15 -0
- package/dist/runtime/bottomSheetConfig.js +9 -0
- package/dist/runtime/index.cjs +2 -0
- package/dist/runtime/index.d.cts +2 -1
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.js +2 -1
- package/dist/runtime/udsConfig.cjs +2 -0
- package/dist/runtime/udsConfig.d.cts +2 -0
- package/dist/runtime/udsConfig.d.ts +2 -0
- package/dist/runtime/udsConfig.js +2 -0
- package/dist/styles/styler.d.cts +20 -17
- package/dist/styles/styler.d.ts +24 -21
- package/dist/styles/variants.cjs +278 -278
- package/dist/styles/variants.d.cts +9 -0
- package/dist/styles/variants.d.ts +9 -0
- package/dist/styles/variants.js +278 -278
- package/dist/tailwind/dist/commands/generateComponentData.cjs +31 -33
- package/dist/tailwind/dist/commands/generateComponentData.d.ts +1 -1
- package/dist/tailwind/dist/commands/generateComponentData.js +31 -33
- package/dist/tailwind/dist/commands/generatePurgeCSSData.d.ts +1 -1
- package/dist/tailwind/dist/commands/purge.cjs +4 -3
- package/dist/tailwind/dist/commands/purge.d.ts +1 -1
- package/dist/tailwind/dist/commands/purge.js +4 -3
- package/dist/tailwind/dist/index.d.cts +0 -1
- package/dist/tailwind/dist/index.d.ts +3 -5
- package/dist/tailwind/dist/purger/legacy/purgeCSS.cjs +3 -4
- package/dist/tailwind/dist/purger/legacy/purgeCSS.js +3 -4
- package/dist/tailwind/dist/purger/optimized/ast/expressions.cjs +125 -122
- package/dist/tailwind/dist/purger/optimized/ast/expressions.js +125 -122
- package/dist/tailwind/dist/purger/optimized/ast/jsx.cjs +8 -1
- package/dist/tailwind/dist/purger/optimized/ast/jsx.js +8 -1
- package/dist/tailwind/dist/purger/optimized/purge.cjs +10 -11
- package/dist/tailwind/dist/purger/optimized/purge.js +9 -10
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.cjs +127 -238
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.js +127 -238
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.cjs +261 -353
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js +261 -352
- package/dist/tailwind/dist/purger/optimized/utils/files.cjs +3 -4
- package/dist/tailwind/dist/purger/optimized/utils/files.js +3 -4
- package/dist/tailwind/dist/purger/optimized/utils/safelist.cjs +21 -13
- package/dist/tailwind/dist/purger/optimized/utils/safelist.js +21 -13
- 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/typography.cjs +13 -41
- package/dist/tailwind/dist/tailwind/plugins/typography.js +13 -41
- package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.cjs +2 -4
- package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.d.cts +1 -10
- package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.d.ts +1 -10
- package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.js +2 -4
- package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.cts +1 -1
- package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.ts +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/utils/tsMorph.cjs +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 +76 -1
- package/dist/types/dist/index.d.ts +76 -1
- package/dist/uds/generated/componentData.cjs +1195 -990
- package/dist/uds/generated/componentData.js +1130 -979
- package/dist/uds/generated/tailwindPurge.cjs +57 -29
- package/dist/uds/generated/tailwindPurge.js +57 -29
- package/dist/uds/package.cjs +4 -10
- package/dist/uds/package.js +4 -10
- package/package.json +4 -7
- package/dist/cli/dist/lib/logger.cjs +0 -66
- package/dist/cli/dist/lib/logger.js +0 -66
- package/dist/tailwind/dist/commands/css.cjs +0 -79
- package/dist/tailwind/dist/commands/css.d.ts +0 -3
- package/dist/tailwind/dist/commands/css.helpers.cjs +0 -32
- package/dist/tailwind/dist/commands/css.helpers.js +0 -28
- package/dist/tailwind/dist/commands/css.js +0 -79
- package/dist/tailwind/dist/css/generate.cjs +0 -120
- package/dist/tailwind/dist/css/generate.d.cts +0 -30
- package/dist/tailwind/dist/css/generate.d.ts +0 -31
- package/dist/tailwind/dist/css/generate.helpers.cjs +0 -112
- package/dist/tailwind/dist/css/generate.helpers.js +0 -100
- package/dist/tailwind/dist/css/generate.js +0 -115
- package/dist/tailwind/dist/css/postcss.cjs +0 -35
- package/dist/tailwind/dist/css/postcss.helpers.cjs +0 -27
- package/dist/tailwind/dist/css/postcss.helpers.js +0 -26
- package/dist/tailwind/dist/css/postcss.js +0 -35
- package/dist/tailwind/dist/css/runner.cjs +0 -278
- package/dist/tailwind/dist/css/runner.helpers.cjs +0 -26
- package/dist/tailwind/dist/css/runner.helpers.js +0 -23
- package/dist/tailwind/dist/css/runner.js +0 -275
- package/dist/tailwind/dist/css/theme.cjs +0 -12
- package/dist/tailwind/dist/css/theme.d.cts +0 -66
- package/dist/tailwind/dist/css/theme.d.ts +0 -66
- package/dist/tailwind/dist/css/theme.js +0 -11
- package/dist/tailwind/dist/css/utils.cjs +0 -234
- package/dist/tailwind/dist/css/utils.js +0 -223
- package/dist/tailwind/dist/utils/optimizeCSS.cjs +0 -405
- package/dist/tailwind/dist/utils/optimizeCSS.js +0 -403
- package/dist/tailwind/dist/utils/postcssPreserveVars.cjs +0 -67
- package/dist/tailwind/dist/utils/postcssPreserveVars.js +0 -65
- package/generated/componentData.json +0 -2417
- package/generated/tailwindPurge.ts +0 -4560
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
const require_colors = require('./colors.cjs');
|
|
3
|
-
const require_print = require('./print.cjs');
|
|
4
|
-
const require_spinner = require('./spinner.cjs');
|
|
5
|
-
|
|
6
|
-
//#region ../cli/dist/lib/logger.mjs
|
|
7
|
-
/*! © 2026 Yahoo, Inc. UDS CLI v0.0.0-development */
|
|
8
|
-
/**
|
|
9
|
-
* Logger utility for CLI commands.
|
|
10
|
-
* Centralizes logging behavior with support for silent mode.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Create a logger instance with optional silent mode.
|
|
14
|
-
* When silent, all logging methods become no-ops.
|
|
15
|
-
*/
|
|
16
|
-
function createLogger(options = {}) {
|
|
17
|
-
const isSilent = options.silent ?? false;
|
|
18
|
-
return {
|
|
19
|
-
isSilent,
|
|
20
|
-
print: (message) => {
|
|
21
|
-
if (!isSilent) require_print.print(message);
|
|
22
|
-
},
|
|
23
|
-
printAlways: (message) => {
|
|
24
|
-
require_print.print(message);
|
|
25
|
-
},
|
|
26
|
-
spinStart: (message) => {
|
|
27
|
-
if (!isSilent) require_spinner.spinStart(message);
|
|
28
|
-
},
|
|
29
|
-
spinStop: (icon, message) => {
|
|
30
|
-
if (!isSilent) require_spinner.spinStop(icon, message);
|
|
31
|
-
},
|
|
32
|
-
success: (message) => {
|
|
33
|
-
if (!isSilent) require_print.print(require_colors.green(`✅ ${message}`));
|
|
34
|
-
},
|
|
35
|
-
warn: (message) => {
|
|
36
|
-
if (!isSilent) require_print.print(require_colors.yellow(`⚠️ ${message}`));
|
|
37
|
-
},
|
|
38
|
-
error: (message) => {
|
|
39
|
-
require_print.print(require_colors.red(`❌ ${message}`));
|
|
40
|
-
},
|
|
41
|
-
info: (message) => {
|
|
42
|
-
if (!isSilent) require_print.print(require_colors.cyan(message));
|
|
43
|
-
},
|
|
44
|
-
label: (label, value) => {
|
|
45
|
-
if (!isSilent) require_print.print(`${require_colors.magenta(label)} ${require_colors.cyan(value)}`);
|
|
46
|
-
},
|
|
47
|
-
listItem: (text) => {
|
|
48
|
-
if (!isSilent) require_print.print(` ${require_colors.gray("•")} ${text}`);
|
|
49
|
-
},
|
|
50
|
-
timestamp: (message, color = "green") => {
|
|
51
|
-
if (isSilent) return;
|
|
52
|
-
const time = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
53
|
-
const colorFn = color === "green" ? require_colors.green : color === "yellow" ? require_colors.yellow : require_colors.red;
|
|
54
|
-
require_print.print(`${require_colors.gray(`[${time}]`)} ${colorFn(message)}`);
|
|
55
|
-
},
|
|
56
|
-
newline: () => {
|
|
57
|
-
if (!isSilent) require_print.print("");
|
|
58
|
-
},
|
|
59
|
-
child: (childOptions = {}) => {
|
|
60
|
-
return createLogger({ silent: childOptions.silent ?? isSilent });
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
exports.createLogger = createLogger;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
import { cyan, gray, green, magenta, red, yellow } from "./colors.js";
|
|
3
|
-
import { print } from "./print.js";
|
|
4
|
-
import { spinStart, spinStop } from "./spinner.js";
|
|
5
|
-
|
|
6
|
-
//#region ../cli/dist/lib/logger.mjs
|
|
7
|
-
/*! © 2026 Yahoo, Inc. UDS CLI v0.0.0-development */
|
|
8
|
-
/**
|
|
9
|
-
* Logger utility for CLI commands.
|
|
10
|
-
* Centralizes logging behavior with support for silent mode.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Create a logger instance with optional silent mode.
|
|
14
|
-
* When silent, all logging methods become no-ops.
|
|
15
|
-
*/
|
|
16
|
-
function createLogger(options = {}) {
|
|
17
|
-
const isSilent = options.silent ?? false;
|
|
18
|
-
return {
|
|
19
|
-
isSilent,
|
|
20
|
-
print: (message) => {
|
|
21
|
-
if (!isSilent) print(message);
|
|
22
|
-
},
|
|
23
|
-
printAlways: (message) => {
|
|
24
|
-
print(message);
|
|
25
|
-
},
|
|
26
|
-
spinStart: (message) => {
|
|
27
|
-
if (!isSilent) spinStart(message);
|
|
28
|
-
},
|
|
29
|
-
spinStop: (icon, message) => {
|
|
30
|
-
if (!isSilent) spinStop(icon, message);
|
|
31
|
-
},
|
|
32
|
-
success: (message) => {
|
|
33
|
-
if (!isSilent) print(green(`✅ ${message}`));
|
|
34
|
-
},
|
|
35
|
-
warn: (message) => {
|
|
36
|
-
if (!isSilent) print(yellow(`⚠️ ${message}`));
|
|
37
|
-
},
|
|
38
|
-
error: (message) => {
|
|
39
|
-
print(red(`❌ ${message}`));
|
|
40
|
-
},
|
|
41
|
-
info: (message) => {
|
|
42
|
-
if (!isSilent) print(cyan(message));
|
|
43
|
-
},
|
|
44
|
-
label: (label, value) => {
|
|
45
|
-
if (!isSilent) print(`${magenta(label)} ${cyan(value)}`);
|
|
46
|
-
},
|
|
47
|
-
listItem: (text) => {
|
|
48
|
-
if (!isSilent) print(` ${gray("•")} ${text}`);
|
|
49
|
-
},
|
|
50
|
-
timestamp: (message, color = "green") => {
|
|
51
|
-
if (isSilent) return;
|
|
52
|
-
const time = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
53
|
-
const colorFn = color === "green" ? green : color === "yellow" ? yellow : red;
|
|
54
|
-
print(`${gray(`[${time}]`)} ${colorFn(message)}`);
|
|
55
|
-
},
|
|
56
|
-
newline: () => {
|
|
57
|
-
if (!isSilent) print("");
|
|
58
|
-
},
|
|
59
|
-
child: (childOptions = {}) => {
|
|
60
|
-
return createLogger({ silent: childOptions.silent ?? isSilent });
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
export { createLogger };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
const require_colors = require('../../../cli/dist/lib/colors.cjs');
|
|
3
|
-
const require_print = require('../../../cli/dist/lib/print.cjs');
|
|
4
|
-
const require_utils = require('../css/utils.cjs');
|
|
5
|
-
const require_runner = require('../css/runner.cjs');
|
|
6
|
-
const require_css_helpers = require('./css.helpers.cjs');
|
|
7
|
-
|
|
8
|
-
//#region ../tailwind/dist/commands/css.js
|
|
9
|
-
/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
|
|
10
|
-
const showHelp = () => {
|
|
11
|
-
require_print.print("");
|
|
12
|
-
require_print.print(`${require_colors.green("uds css")} - Generate CSS for app`);
|
|
13
|
-
require_print.print("");
|
|
14
|
-
require_print.print(`${require_colors.magenta("Usage:")}`);
|
|
15
|
-
require_print.print(` ${require_colors.cyan("uds css")} [options]`);
|
|
16
|
-
require_print.print(` ${require_colors.cyan("uds css init")} [options]`);
|
|
17
|
-
require_print.print("");
|
|
18
|
-
require_print.print(`${require_colors.magenta("Commands:")}`);
|
|
19
|
-
require_print.print(` ${require_colors.cyan("init")} Create a new uds.theme.ts file`);
|
|
20
|
-
require_print.print("");
|
|
21
|
-
require_print.print(`${require_colors.magenta("Options:")}`);
|
|
22
|
-
require_print.print(` ${require_colors.cyan("--entry <path>")} Entry directory to scan (default: /src/)`);
|
|
23
|
-
require_print.print(` ${require_colors.cyan("--outFile <path>")} Output CSS file (default: dist/uds.css)`);
|
|
24
|
-
require_print.print(` ${require_colors.cyan("--config <path>")} Path to uds.config.ts for tokens`);
|
|
25
|
-
require_print.print(` ${require_colors.cyan("--theme <path>")} Path to uds.theme.ts (default: uds.theme.ts)`);
|
|
26
|
-
require_print.print(` ${require_colors.cyan("--watch, -w")} Watch for file changes and regenerate`);
|
|
27
|
-
require_print.print(` ${require_colors.cyan("--silent, -s")} Suppress output logging`);
|
|
28
|
-
require_print.print(` ${require_colors.cyan("--force")} Overwrite existing uds.theme.ts (for init)`);
|
|
29
|
-
require_print.print(` ${require_colors.cyan("--help, -h")} Show this help message`);
|
|
30
|
-
require_print.print("");
|
|
31
|
-
require_print.print(`${require_colors.magenta("Initialize theme config:")}`);
|
|
32
|
-
require_print.print(` ${require_colors.gray("uds css init")}`);
|
|
33
|
-
require_print.print("");
|
|
34
|
-
require_print.print(`${require_colors.magenta("Simple mode")} (no uds.theme.ts):`);
|
|
35
|
-
require_print.print(` ${require_colors.gray("uds css --entry ./src --outFile dist/uds.css")}`);
|
|
36
|
-
require_print.print("");
|
|
37
|
-
require_print.print(`${require_colors.magenta("Theme mode")} (with uds.theme.ts):`);
|
|
38
|
-
require_print.print(` ${require_colors.gray("uds css --theme uds.theme.ts --outFile dist/uds.css")}`);
|
|
39
|
-
require_print.print("");
|
|
40
|
-
require_print.print(`${require_colors.magenta("Example uds.theme.ts:")}`);
|
|
41
|
-
require_print.print(require_colors.gray(` import { defineTheme } from '@yahoo/uds';
|
|
42
|
-
|
|
43
|
-
export default defineTheme({
|
|
44
|
-
config: './uds.config.ts',
|
|
45
|
-
entry: './src',
|
|
46
|
-
colorModes: ['dark'],
|
|
47
|
-
css: {
|
|
48
|
-
preflight: true,
|
|
49
|
-
fontFaceDeclarations: true,
|
|
50
|
-
enableSystemColorMode: false, // Auto dark mode via prefers-color-scheme
|
|
51
|
-
disableOverrideTailwindTheme: true // Don't merge into Tailwind defaults
|
|
52
|
-
}
|
|
53
|
-
});`));
|
|
54
|
-
require_print.print("");
|
|
55
|
-
};
|
|
56
|
-
const makeCSSCommand = (getContext) => ({
|
|
57
|
-
name: "css",
|
|
58
|
-
description: "Generate CSS for app",
|
|
59
|
-
tag: "hidden",
|
|
60
|
-
run: async (props) => {
|
|
61
|
-
const { variants, autoVariants, componentData } = await getContext();
|
|
62
|
-
if (require_css_helpers.shouldShowHelp(props.options)) {
|
|
63
|
-
showHelp();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (require_css_helpers.isInitCommand(props.first)) {
|
|
67
|
-
await require_utils.scaffoldThemeConfig(require_css_helpers.getCssInitOptions(props.options));
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
await require_runner.runCssCommand(require_css_helpers.getCssRunOptions(process.cwd(), props.options), {
|
|
71
|
-
variants,
|
|
72
|
-
autoVariants,
|
|
73
|
-
componentData
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
//#endregion
|
|
79
|
-
exports.makeCSSCommand = makeCSSCommand;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
|
|
3
|
-
//#region ../tailwind/dist/commands/css.helpers.js
|
|
4
|
-
/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
|
|
5
|
-
const isTruthyFlag = (value) => value === true || value === "true";
|
|
6
|
-
const stringOption = (value) => typeof value === "string" ? value : void 0;
|
|
7
|
-
const shouldShowHelp = (options) => isTruthyFlag(options.help) || isTruthyFlag(options.h);
|
|
8
|
-
const isInitCommand = (firstArg) => firstArg === "init";
|
|
9
|
-
const getCssInitOptions = (options) => ({
|
|
10
|
-
force: isTruthyFlag(options.force),
|
|
11
|
-
configPath: stringOption(options.config),
|
|
12
|
-
entry: stringOption(options.entry),
|
|
13
|
-
outputPath: stringOption(options.outFile)
|
|
14
|
-
});
|
|
15
|
-
const getCssRunOptions = (workspaceDir, options) => {
|
|
16
|
-
return {
|
|
17
|
-
workspaceDir,
|
|
18
|
-
outFile: stringOption(options.outFile) ?? "dist/uds.css",
|
|
19
|
-
themeConfigPath: stringOption(options.theme) ?? "uds.theme.ts",
|
|
20
|
-
scope: stringOption(options.scope),
|
|
21
|
-
entryOption: stringOption(options.entry),
|
|
22
|
-
configOption: stringOption(options.config),
|
|
23
|
-
watch: isTruthyFlag(options.watch) || isTruthyFlag(options.w),
|
|
24
|
-
silent: isTruthyFlag(options.silent) || isTruthyFlag(options.s)
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
exports.getCssInitOptions = getCssInitOptions;
|
|
30
|
-
exports.getCssRunOptions = getCssRunOptions;
|
|
31
|
-
exports.isInitCommand = isInitCommand;
|
|
32
|
-
exports.shouldShowHelp = shouldShowHelp;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
//#region ../tailwind/dist/commands/css.helpers.js
|
|
3
|
-
/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
|
|
4
|
-
const isTruthyFlag = (value) => value === true || value === "true";
|
|
5
|
-
const stringOption = (value) => typeof value === "string" ? value : void 0;
|
|
6
|
-
const shouldShowHelp = (options) => isTruthyFlag(options.help) || isTruthyFlag(options.h);
|
|
7
|
-
const isInitCommand = (firstArg) => firstArg === "init";
|
|
8
|
-
const getCssInitOptions = (options) => ({
|
|
9
|
-
force: isTruthyFlag(options.force),
|
|
10
|
-
configPath: stringOption(options.config),
|
|
11
|
-
entry: stringOption(options.entry),
|
|
12
|
-
outputPath: stringOption(options.outFile)
|
|
13
|
-
});
|
|
14
|
-
const getCssRunOptions = (workspaceDir, options) => {
|
|
15
|
-
return {
|
|
16
|
-
workspaceDir,
|
|
17
|
-
outFile: stringOption(options.outFile) ?? "dist/uds.css",
|
|
18
|
-
themeConfigPath: stringOption(options.theme) ?? "uds.theme.ts",
|
|
19
|
-
scope: stringOption(options.scope),
|
|
20
|
-
entryOption: stringOption(options.entry),
|
|
21
|
-
configOption: stringOption(options.config),
|
|
22
|
-
watch: isTruthyFlag(options.watch) || isTruthyFlag(options.w),
|
|
23
|
-
silent: isTruthyFlag(options.silent) || isTruthyFlag(options.s)
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export { getCssInitOptions, getCssRunOptions, isInitCommand, shouldShowHelp };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
import { cyan, gray, green, magenta } from "../../../cli/dist/lib/colors.js";
|
|
3
|
-
import { print } from "../../../cli/dist/lib/print.js";
|
|
4
|
-
import { scaffoldThemeConfig } from "../css/utils.js";
|
|
5
|
-
import { runCssCommand } from "../css/runner.js";
|
|
6
|
-
import { getCssInitOptions, getCssRunOptions, isInitCommand, shouldShowHelp } from "./css.helpers.js";
|
|
7
|
-
|
|
8
|
-
//#region ../tailwind/dist/commands/css.js
|
|
9
|
-
/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
|
|
10
|
-
const showHelp = () => {
|
|
11
|
-
print("");
|
|
12
|
-
print(`${green("uds css")} - Generate CSS for app`);
|
|
13
|
-
print("");
|
|
14
|
-
print(`${magenta("Usage:")}`);
|
|
15
|
-
print(` ${cyan("uds css")} [options]`);
|
|
16
|
-
print(` ${cyan("uds css init")} [options]`);
|
|
17
|
-
print("");
|
|
18
|
-
print(`${magenta("Commands:")}`);
|
|
19
|
-
print(` ${cyan("init")} Create a new uds.theme.ts file`);
|
|
20
|
-
print("");
|
|
21
|
-
print(`${magenta("Options:")}`);
|
|
22
|
-
print(` ${cyan("--entry <path>")} Entry directory to scan (default: /src/)`);
|
|
23
|
-
print(` ${cyan("--outFile <path>")} Output CSS file (default: dist/uds.css)`);
|
|
24
|
-
print(` ${cyan("--config <path>")} Path to uds.config.ts for tokens`);
|
|
25
|
-
print(` ${cyan("--theme <path>")} Path to uds.theme.ts (default: uds.theme.ts)`);
|
|
26
|
-
print(` ${cyan("--watch, -w")} Watch for file changes and regenerate`);
|
|
27
|
-
print(` ${cyan("--silent, -s")} Suppress output logging`);
|
|
28
|
-
print(` ${cyan("--force")} Overwrite existing uds.theme.ts (for init)`);
|
|
29
|
-
print(` ${cyan("--help, -h")} Show this help message`);
|
|
30
|
-
print("");
|
|
31
|
-
print(`${magenta("Initialize theme config:")}`);
|
|
32
|
-
print(` ${gray("uds css init")}`);
|
|
33
|
-
print("");
|
|
34
|
-
print(`${magenta("Simple mode")} (no uds.theme.ts):`);
|
|
35
|
-
print(` ${gray("uds css --entry ./src --outFile dist/uds.css")}`);
|
|
36
|
-
print("");
|
|
37
|
-
print(`${magenta("Theme mode")} (with uds.theme.ts):`);
|
|
38
|
-
print(` ${gray("uds css --theme uds.theme.ts --outFile dist/uds.css")}`);
|
|
39
|
-
print("");
|
|
40
|
-
print(`${magenta("Example uds.theme.ts:")}`);
|
|
41
|
-
print(gray(` import { defineTheme } from '@yahoo/uds';
|
|
42
|
-
|
|
43
|
-
export default defineTheme({
|
|
44
|
-
config: './uds.config.ts',
|
|
45
|
-
entry: './src',
|
|
46
|
-
colorModes: ['dark'],
|
|
47
|
-
css: {
|
|
48
|
-
preflight: true,
|
|
49
|
-
fontFaceDeclarations: true,
|
|
50
|
-
enableSystemColorMode: false, // Auto dark mode via prefers-color-scheme
|
|
51
|
-
disableOverrideTailwindTheme: true // Don't merge into Tailwind defaults
|
|
52
|
-
}
|
|
53
|
-
});`));
|
|
54
|
-
print("");
|
|
55
|
-
};
|
|
56
|
-
const makeCSSCommand = (getContext) => ({
|
|
57
|
-
name: "css",
|
|
58
|
-
description: "Generate CSS for app",
|
|
59
|
-
tag: "hidden",
|
|
60
|
-
run: async (props) => {
|
|
61
|
-
const { variants, autoVariants, componentData } = await getContext();
|
|
62
|
-
if (shouldShowHelp(props.options)) {
|
|
63
|
-
showHelp();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (isInitCommand(props.first)) {
|
|
67
|
-
await scaffoldThemeConfig(getCssInitOptions(props.options));
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
await runCssCommand(getCssRunOptions(process.cwd(), props.options), {
|
|
71
|
-
variants,
|
|
72
|
-
autoVariants,
|
|
73
|
-
componentData
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
//#endregion
|
|
79
|
-
export { makeCSSCommand };
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_index = require('../../../config/dist/index.cjs');
|
|
4
|
-
const require_colors = require('../../../cli/dist/lib/colors.cjs');
|
|
5
|
-
const require_print = require('../../../cli/dist/lib/print.cjs');
|
|
6
|
-
const require_spinner = require('../../../cli/dist/lib/spinner.cjs');
|
|
7
|
-
const require_utils = require('./utils.cjs');
|
|
8
|
-
const require_safelist = require('../purger/optimized/utils/safelist.cjs');
|
|
9
|
-
const require_generate_helpers = require('./generate.helpers.cjs');
|
|
10
|
-
let node_fs = require("node:fs");
|
|
11
|
-
node_fs = require_runtime.__toESM(node_fs);
|
|
12
|
-
let node_path = require("node:path");
|
|
13
|
-
node_path = require_runtime.__toESM(node_path);
|
|
14
|
-
let node_zlib = require("node:zlib");
|
|
15
|
-
let postcss = require("postcss");
|
|
16
|
-
postcss = require_runtime.__toESM(postcss);
|
|
17
|
-
|
|
18
|
-
//#region ../tailwind/dist/css/generate.js
|
|
19
|
-
/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
|
|
20
|
-
const normalizeScope = (scope) => {
|
|
21
|
-
const trimmedScope = scope?.trim();
|
|
22
|
-
return trimmedScope ? trimmedScope : void 0;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Generate CSS from a safelist using Tailwind + PostCSS
|
|
26
|
-
* @param safelist - UDS component classes to include
|
|
27
|
-
* @param config - Token configuration
|
|
28
|
-
* @param options - Additional options
|
|
29
|
-
*/
|
|
30
|
-
const generateCSS = async (safelist, config, options) => {
|
|
31
|
-
const sourceCSS = "@tailwind base; @tailwind components; @tailwind utilities";
|
|
32
|
-
const contentDir = options?.contentDir ?? node_path.default.join(process.cwd(), "src");
|
|
33
|
-
const cssFlags = require_generate_helpers.getCssFeatureFlags(options?.cssOptions);
|
|
34
|
-
const optimizationConfig = options?.cssOptions?.optimization;
|
|
35
|
-
const scopeClass = normalizeScope(options?.scope) ?? normalizeScope(options?.cssOptions?.scope);
|
|
36
|
-
let css = await require_generate_helpers.applyScopedColorModeFix((await (0, postcss.default)(require_generate_helpers.buildPostcssPlugins({
|
|
37
|
-
tailwindPlugin: require_generate_helpers.createTailwindPlugin({
|
|
38
|
-
contentDir,
|
|
39
|
-
safelist,
|
|
40
|
-
config,
|
|
41
|
-
enablePreflight: cssFlags.enablePreflight,
|
|
42
|
-
enableFontFaceDeclarations: cssFlags.enableFontFaceDeclarations
|
|
43
|
-
}),
|
|
44
|
-
shouldPruneVars: cssFlags.shouldPruneVars,
|
|
45
|
-
safeVarPrefixes: options?.safeVarPrefixes ?? [],
|
|
46
|
-
scopeClass
|
|
47
|
-
})).process(sourceCSS, { from: void 0 })).css, scopeClass);
|
|
48
|
-
const optimizedCss = await require_generate_helpers.optimizeGeneratedCss({
|
|
49
|
-
css,
|
|
50
|
-
shouldOptimize: cssFlags.shouldOptimize,
|
|
51
|
-
optimizationConfig,
|
|
52
|
-
referenceCss: options?.referenceCss,
|
|
53
|
-
scopeClass
|
|
54
|
-
});
|
|
55
|
-
css = optimizedCss.css;
|
|
56
|
-
const sizeBytes = Buffer.byteLength(css, "utf8");
|
|
57
|
-
const sizeGzipBytes = (0, node_zlib.gzipSync)(css).length;
|
|
58
|
-
return {
|
|
59
|
-
css,
|
|
60
|
-
sizeBytes,
|
|
61
|
-
sizeGzipBytes,
|
|
62
|
-
classCount: safelist.length,
|
|
63
|
-
optimizationStats: optimizedCss.optimizationStats
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Generate CSS in simple mode (no uds.theme.ts)
|
|
68
|
-
*/
|
|
69
|
-
const generateSimpleModeCSS = async (options) => {
|
|
70
|
-
const isWatch = options.isWatch === true;
|
|
71
|
-
const shouldLogStats = !(options.silent === true) && !isWatch;
|
|
72
|
-
const startTime = performance.now();
|
|
73
|
-
const colorModes = ["dark"];
|
|
74
|
-
let tokensConfig = require_index.defaultTokensConfig;
|
|
75
|
-
if (options.configPath) {
|
|
76
|
-
const loadedConfig = await require_utils.loadConfigFile(options.configPath);
|
|
77
|
-
if (loadedConfig) tokensConfig = loadedConfig;
|
|
78
|
-
else if (shouldLogStats) require_spinner.spinStop("⚠️", `Config file not found: ${options.configPath}, using defaults`);
|
|
79
|
-
}
|
|
80
|
-
const variantDefaults = require_utils.extractVariantDefaults(tokensConfig);
|
|
81
|
-
const entryDir = node_path.default.join(options.workspaceDir, options.entry);
|
|
82
|
-
const scanResult = await require_utils.scanDirectoryForSafelist(entryDir, colorModes, options.variants, options.autoVariants, options.componentData, variantDefaults);
|
|
83
|
-
const totalFilesScanned = scanResult.filesScanned;
|
|
84
|
-
const allClasses = [...scanResult.safelist];
|
|
85
|
-
const allComponents = new Set(scanResult.components);
|
|
86
|
-
const packageDirs = [entryDir];
|
|
87
|
-
const cssResult = await generateCSS(require_safelist.deduplicateSafelist([...allClasses, ...require_safelist.getThemeAndScaleClasses(colorModes)]), tokensConfig, {
|
|
88
|
-
scope: options.scope,
|
|
89
|
-
contentDir: entryDir,
|
|
90
|
-
safeVarPrefixes: [...require_utils.getMotionVarPrefixes(options.componentData, [...allComponents]), ...require_utils.getConfigurableCssVariables()]
|
|
91
|
-
});
|
|
92
|
-
const outputPath = node_path.default.isAbsolute(options.outFile) ? options.outFile : node_path.default.join(options.workspaceDir, options.outFile);
|
|
93
|
-
const outputDir = node_path.default.dirname(outputPath);
|
|
94
|
-
if (!node_fs.default.existsSync(outputDir)) node_fs.default.mkdirSync(outputDir, { recursive: true });
|
|
95
|
-
node_fs.default.writeFileSync(outputPath, cssResult.css);
|
|
96
|
-
const duration = Math.round(performance.now() - startTime);
|
|
97
|
-
if (shouldLogStats) require_generate_helpers.printSimpleModeStats({
|
|
98
|
-
outputPath,
|
|
99
|
-
totalFilesScanned,
|
|
100
|
-
classCount: cssResult.classCount,
|
|
101
|
-
sizeBytes: cssResult.sizeBytes,
|
|
102
|
-
sizeGzipBytes: cssResult.sizeGzipBytes,
|
|
103
|
-
duration,
|
|
104
|
-
scope: options.scope,
|
|
105
|
-
optimizationStats: cssResult.optimizationStats,
|
|
106
|
-
print: require_print.print,
|
|
107
|
-
magenta: require_colors.magenta,
|
|
108
|
-
cyan: require_colors.cyan,
|
|
109
|
-
yellow: require_colors.yellow
|
|
110
|
-
});
|
|
111
|
-
return {
|
|
112
|
-
success: true,
|
|
113
|
-
outputPath,
|
|
114
|
-
packageDirs
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
//#endregion
|
|
119
|
-
exports.generateCSS = generateCSS;
|
|
120
|
-
exports.generateSimpleModeCSS = generateSimpleModeCSS;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import "../../../config/dist/index.cjs";
|
|
3
|
-
import { UDSCSSOptimizationOptions } from "./theme.cjs";
|
|
4
|
-
import { SafelistConfig } from "tailwindcss/types/config";
|
|
5
|
-
|
|
6
|
-
//#region ../tailwind/dist/css/generate.d.ts
|
|
7
|
-
//#region src/css/generate.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* CSS generation options for uds.theme.ts
|
|
10
|
-
*/
|
|
11
|
-
interface UDSCSSOptions {
|
|
12
|
-
/** CSS scope wrapper class (optional) */
|
|
13
|
-
scope?: string;
|
|
14
|
-
/** Safelist of CSS classes to always include */
|
|
15
|
-
safelist?: SafelistConfig[];
|
|
16
|
-
/** CSS optimization settings */
|
|
17
|
-
optimization?: UDSCSSOptimizationOptions;
|
|
18
|
-
/** Include Tailwind preflight/reset styles (default: true) */
|
|
19
|
-
preflight?: boolean;
|
|
20
|
-
/** Include @font-face declarations (default: true) */
|
|
21
|
-
fontFaceDeclarations?: boolean;
|
|
22
|
-
/** Debounce delay (ms) for watch mode regenerations */
|
|
23
|
-
watchDebounce?: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Options for generateCSS function
|
|
27
|
-
*/
|
|
28
|
-
//#endregion
|
|
29
|
-
//#endregion
|
|
30
|
-
export { type UDSCSSOptions };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import "../../../config/dist/index.js";
|
|
3
|
-
import "../commands/generateComponentData.js";
|
|
4
|
-
import { UDSCSSOptimizationOptions } from "./theme.js";
|
|
5
|
-
import { SafelistConfig } from "tailwindcss/types/config";
|
|
6
|
-
|
|
7
|
-
//#region ../tailwind/dist/css/generate.d.ts
|
|
8
|
-
//#region src/css/generate.d.ts
|
|
9
|
-
/**
|
|
10
|
-
* CSS generation options for uds.theme.ts
|
|
11
|
-
*/
|
|
12
|
-
interface UDSCSSOptions {
|
|
13
|
-
/** CSS scope wrapper class (optional) */
|
|
14
|
-
scope?: string;
|
|
15
|
-
/** Safelist of CSS classes to always include */
|
|
16
|
-
safelist?: SafelistConfig[];
|
|
17
|
-
/** CSS optimization settings */
|
|
18
|
-
optimization?: UDSCSSOptimizationOptions;
|
|
19
|
-
/** Include Tailwind preflight/reset styles (default: true) */
|
|
20
|
-
preflight?: boolean;
|
|
21
|
-
/** Include @font-face declarations (default: true) */
|
|
22
|
-
fontFaceDeclarations?: boolean;
|
|
23
|
-
/** Debounce delay (ms) for watch mode regenerations */
|
|
24
|
-
watchDebounce?: number;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Options for generateCSS function
|
|
28
|
-
*/
|
|
29
|
-
//#endregion
|
|
30
|
-
//#endregion
|
|
31
|
-
export { type UDSCSSOptions };
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_utils = require('./utils.cjs');
|
|
4
|
-
const require_plugin = require('../plugin.cjs');
|
|
5
|
-
const require_optimizeCSS = require('../utils/optimizeCSS.cjs');
|
|
6
|
-
const require_postcssPreserveVars = require('../utils/postcssPreserveVars.cjs');
|
|
7
|
-
const require_postcss = require('./postcss.cjs');
|
|
8
|
-
let node_path = require("node:path");
|
|
9
|
-
node_path = require_runtime.__toESM(node_path);
|
|
10
|
-
let postcss = require("postcss");
|
|
11
|
-
postcss = require_runtime.__toESM(postcss);
|
|
12
|
-
let autoprefixer = require("autoprefixer");
|
|
13
|
-
autoprefixer = require_runtime.__toESM(autoprefixer);
|
|
14
|
-
let postcss_prune_var = require("postcss-prune-var");
|
|
15
|
-
postcss_prune_var = require_runtime.__toESM(postcss_prune_var);
|
|
16
|
-
let postcss_scope = require("postcss-scope");
|
|
17
|
-
postcss_scope = require_runtime.__toESM(postcss_scope);
|
|
18
|
-
let tailwindcss = require("tailwindcss");
|
|
19
|
-
tailwindcss = require_runtime.__toESM(tailwindcss);
|
|
20
|
-
|
|
21
|
-
//#region ../tailwind/dist/css/generate.helpers.js
|
|
22
|
-
/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
|
|
23
|
-
const getCssFeatureFlags = (cssOptions) => {
|
|
24
|
-
const optimizationConfig = cssOptions?.optimization;
|
|
25
|
-
const shouldOptimize = optimizationConfig?.enabled !== false;
|
|
26
|
-
return {
|
|
27
|
-
enablePreflight: cssOptions?.preflight !== false,
|
|
28
|
-
enableFontFaceDeclarations: cssOptions?.fontFaceDeclarations !== false,
|
|
29
|
-
shouldOptimize,
|
|
30
|
-
shouldPruneVars: shouldOptimize && optimizationConfig?.pruneVars !== false
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
const getContentGlobs = (contentDir) => [node_path.default.join(contentDir, "**/*.{js,jsx,ts,tsx}")];
|
|
34
|
-
const createTailwindPlugin = (options) => {
|
|
35
|
-
return (0, tailwindcss.default)({
|
|
36
|
-
content: getContentGlobs(options.contentDir),
|
|
37
|
-
safelist: options.safelist,
|
|
38
|
-
corePlugins: { preflight: options.enablePreflight },
|
|
39
|
-
plugins: [require_plugin.tailwindPlugin({
|
|
40
|
-
config: options.config,
|
|
41
|
-
disableFontFaceDeclarations: !options.enableFontFaceDeclarations,
|
|
42
|
-
ignorePluginSafelists: true
|
|
43
|
-
})]
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
const getPruneVarPlugins = (safeVarPrefixes) => {
|
|
47
|
-
if (safeVarPrefixes.length === 0) return [(0, postcss_prune_var.default)()];
|
|
48
|
-
return [
|
|
49
|
-
require_postcssPreserveVars.preserveVars({ preserve: safeVarPrefixes }),
|
|
50
|
-
(0, postcss_prune_var.default)(),
|
|
51
|
-
require_postcssPreserveVars.preserveVarsCleanup()
|
|
52
|
-
];
|
|
53
|
-
};
|
|
54
|
-
const buildPostcssPlugins = (options) => {
|
|
55
|
-
const plugins = [options.tailwindPlugin, (0, autoprefixer.default)()];
|
|
56
|
-
if (options.shouldPruneVars) plugins.push(...getPruneVarPlugins(options.safeVarPrefixes));
|
|
57
|
-
if (options.scopeClass) plugins.push((0, postcss_scope.default)(options.scopeClass));
|
|
58
|
-
return plugins;
|
|
59
|
-
};
|
|
60
|
-
const applyScopedColorModeFix = async (css, scopeClass) => {
|
|
61
|
-
if (!scopeClass) return css;
|
|
62
|
-
return (await (0, postcss.default)([require_postcss.fixScopedColorModeSelectorsPlugin(scopeClass)]).process(css, { from: void 0 })).css;
|
|
63
|
-
};
|
|
64
|
-
const optimizeGeneratedCss = async (options) => {
|
|
65
|
-
if (!options.shouldOptimize) return { css: options.css };
|
|
66
|
-
const optimizationOptions = {
|
|
67
|
-
removeUnusedFonts: options.optimizationConfig?.removeUnusedFonts,
|
|
68
|
-
removeEmptyRules: options.optimizationConfig?.removeEmptyRules,
|
|
69
|
-
aggregateDuplicateSelectors: options.optimizationConfig?.aggregateDuplicateSelectors,
|
|
70
|
-
referenceCss: options.referenceCss,
|
|
71
|
-
scopeClass: options.scopeClass
|
|
72
|
-
};
|
|
73
|
-
const optimized = await require_optimizeCSS.optimizeCSS(options.css, optimizationOptions);
|
|
74
|
-
return {
|
|
75
|
-
css: optimized.css,
|
|
76
|
-
optimizationStats: {
|
|
77
|
-
originalSize: optimized.stats.originalSize,
|
|
78
|
-
originalSizeGzip: optimized.stats.originalSizeGzip,
|
|
79
|
-
fontFacesRemoved: optimized.stats.fontFacesRemoved,
|
|
80
|
-
emptyRulesRemoved: optimized.stats.emptyRulesRemoved,
|
|
81
|
-
validationErrors: optimized.validation.errors
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
const printSimpleModeStats = (options) => {
|
|
86
|
-
const { print, magenta, cyan, yellow } = options;
|
|
87
|
-
print("");
|
|
88
|
-
print(`${magenta("Output:")} ${cyan(options.outputPath)}`);
|
|
89
|
-
print(`${magenta("Stats:")}`);
|
|
90
|
-
print(` Files scanned: ${options.totalFilesScanned}`);
|
|
91
|
-
print(` Classes: ${options.classCount}`);
|
|
92
|
-
print(` Size: ${require_utils.formatBytes(options.sizeBytes)} (${require_utils.formatBytes(options.sizeGzipBytes)} gzipped)`);
|
|
93
|
-
const optimizationStats = options.optimizationStats;
|
|
94
|
-
if (optimizationStats) {
|
|
95
|
-
const savedBytesGzip = optimizationStats.originalSizeGzip - options.sizeGzipBytes;
|
|
96
|
-
if (savedBytesGzip > 0) print(` Optimized: saved ${require_utils.formatBytes(savedBytesGzip)} gzip (${optimizationStats.fontFacesRemoved} unused @font-face, ${optimizationStats.emptyRulesRemoved} empty rules removed)`);
|
|
97
|
-
if (optimizationStats.validationErrors.length > 0) {
|
|
98
|
-
print(` ${yellow("Validation warnings:")}`);
|
|
99
|
-
optimizationStats.validationErrors.forEach((error) => print(` ${yellow("•")} ${error}`));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
print(` Time: ${options.duration}ms`);
|
|
103
|
-
if (options.scope) print(` Scope: ${cyan(options.scope)}`);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
//#endregion
|
|
107
|
-
exports.applyScopedColorModeFix = applyScopedColorModeFix;
|
|
108
|
-
exports.buildPostcssPlugins = buildPostcssPlugins;
|
|
109
|
-
exports.createTailwindPlugin = createTailwindPlugin;
|
|
110
|
-
exports.getCssFeatureFlags = getCssFeatureFlags;
|
|
111
|
-
exports.optimizeGeneratedCss = optimizeGeneratedCss;
|
|
112
|
-
exports.printSimpleModeStats = printSimpleModeStats;
|