@yahoo/uds 3.108.2 → 3.109.0-beta.1
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/mapTextVariantFixtureToValue.cjs +12 -1
- package/dist/automated-config/dist/mapTextVariantFixtureToValue.js +12 -1
- package/dist/automated-config/dist/properties.cjs +1 -1
- package/dist/automated-config/dist/properties.js +1 -1
- package/dist/cli/commands/sync.cjs +5 -3
- package/dist/cli/commands/sync.d.cts +1 -1
- package/dist/cli/commands/sync.d.ts +1 -1
- package/dist/cli/commands/sync.js +6 -4
- package/dist/cli/commands/version.cjs +0 -2
- package/dist/cli/commands/version.d.cts +1 -1
- package/dist/cli/commands/version.d.ts +1 -1
- package/dist/cli/commands/version.js +0 -2
- package/dist/cli/dist/cli.cjs +1 -1
- package/dist/cli/dist/cli.js +1 -1
- package/dist/cli/dist/commands/editor-rules.cjs +21 -18
- package/dist/cli/dist/commands/editor-rules.js +21 -18
- package/dist/cli/dist/lib/box.cjs +44 -0
- package/dist/cli/dist/lib/box.js +44 -0
- package/dist/cli/dist/lib/colors.cjs +2 -0
- package/dist/cli/dist/lib/colors.js +2 -1
- package/dist/cli/dist/lib/logger.cjs +66 -0
- package/dist/cli/dist/lib/logger.js +66 -0
- package/dist/cli/dist/utils/rules/config.cjs +137 -53
- package/dist/cli/dist/utils/rules/config.js +137 -54
- package/dist/cli/rules/claude/uds/components.md +50 -0
- package/dist/cli/rules/claude/uds/elevation.md +33 -0
- package/dist/cli/rules/claude/uds/icons.md +4 -0
- package/dist/cli/rules/claude/uds/styling.md +18 -0
- package/dist/cli/rules/claude/uds/tailwind.md +5 -0
- package/dist/cli/runner.cjs +11 -2
- package/dist/cli/runner.js +11 -2
- package/dist/components/client/Avatar/AvatarImage.cjs +1 -0
- package/dist/components/client/Avatar/AvatarImage.js +1 -0
- package/dist/components/client/Chip/ChipDismissible.cjs +1 -1
- package/dist/components/client/Chip/ChipDismissible.js +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
- package/dist/components/client/Toast/Toast.cjs +1 -1
- package/dist/components/client/Toast/Toast.js +1 -1
- package/dist/components/client/Toast/ToastContainer.cjs +5 -1
- package/dist/components/client/Toast/ToastContainer.js +5 -1
- package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +7 -0
- package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +7 -0
- package/dist/components/experimental/Table.cjs +2 -2
- package/dist/components/experimental/Table.js +2 -2
- package/dist/config/dist/index.cjs +22687 -19487
- package/dist/config/dist/index.js +22687 -19487
- package/dist/css-tokens/dist/index.cjs +2 -0
- package/dist/css-tokens/dist/index.d.cts +2 -1
- package/dist/css-tokens/dist/index.d.ts +2 -1
- package/dist/css-tokens/dist/index.js +2 -1
- package/dist/index.cjs +7 -0
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +4 -2
- package/dist/runtime/toastConfig.cjs +2 -1
- package/dist/runtime/toastConfig.d.cts +3 -0
- package/dist/runtime/toastConfig.d.ts +3 -0
- package/dist/runtime/toastConfig.js +2 -1
- package/dist/styles/styler.d.cts +33 -33
- package/dist/styles/styler.d.ts +33 -33
- package/dist/styles/variants.cjs +278 -278
- package/dist/styles/variants.js +278 -278
- package/dist/tailwind/dist/commands/css.cjs +79 -0
- package/dist/tailwind/dist/commands/css.d.ts +3 -0
- package/dist/tailwind/dist/commands/css.helpers.cjs +32 -0
- package/dist/tailwind/dist/commands/css.helpers.js +28 -0
- package/dist/tailwind/dist/commands/css.js +79 -0
- package/dist/tailwind/dist/commands/generateComponentData.cjs +33 -31
- package/dist/tailwind/dist/commands/generateComponentData.d.ts +1 -1
- package/dist/tailwind/dist/commands/generateComponentData.js +33 -31
- package/dist/tailwind/dist/commands/generatePurgeCSSData.d.ts +1 -1
- package/dist/tailwind/dist/commands/purge.cjs +3 -4
- package/dist/tailwind/dist/commands/purge.d.ts +1 -1
- package/dist/tailwind/dist/commands/purge.js +3 -4
- package/dist/tailwind/dist/css/generate.cjs +116 -0
- package/dist/tailwind/dist/css/generate.d.cts +28 -0
- package/dist/tailwind/dist/css/generate.d.ts +29 -0
- package/dist/tailwind/dist/css/generate.helpers.cjs +112 -0
- package/dist/tailwind/dist/css/generate.helpers.js +100 -0
- package/dist/tailwind/dist/css/generate.js +111 -0
- package/dist/tailwind/dist/css/postcss.cjs +35 -0
- package/dist/tailwind/dist/css/postcss.helpers.cjs +27 -0
- package/dist/tailwind/dist/css/postcss.helpers.js +26 -0
- package/dist/tailwind/dist/css/postcss.js +35 -0
- package/dist/tailwind/dist/css/runner.cjs +280 -0
- package/dist/tailwind/dist/css/runner.helpers.cjs +26 -0
- package/dist/tailwind/dist/css/runner.helpers.js +23 -0
- package/dist/tailwind/dist/css/runner.js +277 -0
- package/dist/tailwind/dist/css/theme.cjs +12 -0
- package/dist/tailwind/dist/css/theme.d.cts +66 -0
- package/dist/tailwind/dist/css/theme.d.ts +66 -0
- package/dist/tailwind/dist/css/theme.js +11 -0
- package/dist/tailwind/dist/css/utils.cjs +234 -0
- package/dist/tailwind/dist/css/utils.js +223 -0
- package/dist/tailwind/dist/index.d.cts +1 -0
- package/dist/tailwind/dist/index.d.ts +5 -3
- package/dist/tailwind/dist/purger/legacy/purgeCSS.cjs +4 -3
- package/dist/tailwind/dist/purger/legacy/purgeCSS.js +4 -3
- package/dist/tailwind/dist/purger/optimized/ast/expressions.cjs +122 -125
- package/dist/tailwind/dist/purger/optimized/ast/expressions.js +122 -125
- package/dist/tailwind/dist/purger/optimized/ast/jsx.cjs +1 -8
- package/dist/tailwind/dist/purger/optimized/ast/jsx.js +1 -8
- package/dist/tailwind/dist/purger/optimized/purge.cjs +11 -10
- package/dist/tailwind/dist/purger/optimized/purge.js +10 -9
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.cjs +232 -127
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.js +232 -127
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.cjs +313 -251
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js +313 -251
- package/dist/tailwind/dist/purger/optimized/utils/files.cjs +4 -3
- package/dist/tailwind/dist/purger/optimized/utils/files.js +4 -3
- package/dist/tailwind/dist/purger/optimized/utils/safelist.cjs +13 -21
- package/dist/tailwind/dist/purger/optimized/utils/safelist.js +13 -21
- package/dist/tailwind/dist/tailwind/components/getFocusRingStyles.cjs +3 -8
- package/dist/tailwind/dist/tailwind/components/getFocusRingStyles.js +3 -8
- package/dist/tailwind/dist/tailwind/plugins/a11y.cjs +2 -2
- package/dist/tailwind/dist/tailwind/plugins/a11y.js +2 -2
- package/dist/tailwind/dist/tailwind/plugins/getTailwindAsUdsColors.cjs +16 -11
- package/dist/tailwind/dist/tailwind/plugins/getTailwindAsUdsColors.js +16 -11
- package/dist/tailwind/dist/tailwind/plugins/typography.cjs +41 -13
- package/dist/tailwind/dist/tailwind/plugins/typography.js +41 -13
- package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.cjs +4 -2
- package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.d.cts +10 -1
- package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.d.ts +10 -1
- package/dist/tailwind/dist/tailwind/utils/composeTailwindPlugins.js +4 -2
- package/dist/tailwind/dist/utils/optimizeCSS.cjs +405 -0
- package/dist/tailwind/dist/utils/optimizeCSS.js +403 -0
- package/dist/tailwind/dist/utils/parseTokens.cjs +21 -4
- package/dist/tailwind/dist/utils/parseTokens.d.cts +2 -2
- package/dist/tailwind/dist/utils/parseTokens.d.ts +2 -2
- package/dist/tailwind/dist/utils/parseTokens.js +22 -5
- package/dist/tailwind/dist/utils/postcssPreserveVars.cjs +67 -0
- package/dist/tailwind/dist/utils/postcssPreserveVars.js +65 -0
- package/dist/tailwind/dist/utils/tsMorph.cjs +1 -1
- package/dist/tokens/consts/cssTokens.cjs +1 -0
- package/dist/tokens/consts/cssTokens.d.cts +2 -2
- package/dist/tokens/consts/cssTokens.d.ts +2 -2
- package/dist/tokens/consts/cssTokens.js +2 -2
- package/dist/tokens/index.cjs +5 -0
- package/dist/tokens/index.d.cts +4 -3
- package/dist/tokens/index.d.ts +4 -3
- package/dist/tokens/index.js +3 -2
- package/dist/tokens/types.d.cts +2 -2
- package/dist/tokens/types.d.ts +2 -2
- package/dist/tokens/utils/spectrum.cjs +72 -0
- package/dist/tokens/utils/spectrum.d.cts +37 -0
- package/dist/tokens/utils/spectrum.d.ts +37 -0
- package/dist/tokens/utils/spectrum.js +68 -0
- package/dist/types/dist/index.d.cts +33 -2
- package/dist/types/dist/index.d.ts +33 -2
- package/dist/uds/generated/componentData.cjs +33 -14
- package/dist/uds/generated/componentData.js +33 -14
- package/dist/uds/generated/tailwindPurge.cjs +93 -63
- package/dist/uds/generated/tailwindPurge.js +93 -63
- package/dist/uds/package.cjs +11 -5
- package/dist/uds/package.js +11 -5
- package/dist/utils/isElevationAlias.cjs +12 -0
- package/dist/utils/isElevationAlias.d.cts +7 -0
- package/dist/utils/isElevationAlias.d.ts +7 -0
- package/dist/utils/isElevationAlias.js +11 -0
- package/generated/componentData.json +2397 -0
- package/generated/tailwindPurge.ts +4560 -0
- package/package.json +8 -5
- package/dist/tailwind/dist/tailwind/utils/flattenColorPalette.cjs +0 -8
- package/dist/tailwind/dist/tailwind/utils/flattenColorPalette.js +0 -7
- package/dist/tokens/configs/spectrum.cjs +0 -732
- package/dist/tokens/configs/spectrum.d.cts +0 -9
- package/dist/tokens/configs/spectrum.d.ts +0 -9
- package/dist/tokens/configs/spectrum.js +0 -729
|
@@ -1,74 +1,158 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
const require_runtime = require('../../../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let node_path = require("node:path");
|
|
4
3
|
let node_fs = require("node:fs");
|
|
4
|
+
let node_path = require("node:path");
|
|
5
5
|
let node_url = require("node:url");
|
|
6
6
|
|
|
7
7
|
//#region ../cli/dist/utils/rules/config.mjs
|
|
8
8
|
/*! © 2026 Yahoo, Inc. UDS CLI v0.0.0-development */
|
|
9
9
|
const __dirname$1 = (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
|
|
10
|
-
const EDITOR_CONFIGS = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
10
|
+
const EDITOR_CONFIGS = {
|
|
11
|
+
cursor: {
|
|
12
|
+
name: "Cursor",
|
|
13
|
+
description: "AI-powered coding assistant rules for UDS development",
|
|
14
|
+
rules: [
|
|
15
|
+
{
|
|
16
|
+
name: "UDS Components",
|
|
17
|
+
description: "Component development guidelines and patterns",
|
|
18
|
+
files: [{
|
|
19
|
+
source: "rules/cursor/uds/components.mdc",
|
|
20
|
+
target: ".cursor/rules/uds/components.mdc",
|
|
21
|
+
type: "file"
|
|
22
|
+
}]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "UDS Tailwind",
|
|
26
|
+
description: "Tailwind CSS configuration and setup guidelines",
|
|
27
|
+
files: [{
|
|
28
|
+
source: "rules/cursor/uds/tailwind.mdc",
|
|
29
|
+
target: ".cursor/rules/uds/tailwind.mdc",
|
|
30
|
+
type: "file"
|
|
31
|
+
}]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "UDS Icons",
|
|
35
|
+
description: "Icon usage and documentation guidelines",
|
|
36
|
+
files: [{
|
|
37
|
+
source: "rules/cursor/uds/icons.mdc",
|
|
38
|
+
target: ".cursor/rules/uds/icons.mdc",
|
|
39
|
+
type: "file"
|
|
40
|
+
}]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "UDS Elevation",
|
|
44
|
+
description: "Elevation prop usage for layered surfaces",
|
|
45
|
+
files: [{
|
|
46
|
+
source: "rules/cursor/uds/elevation.mdc",
|
|
47
|
+
target: ".cursor/rules/uds/elevation.mdc",
|
|
48
|
+
type: "file"
|
|
49
|
+
}]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "UDS Styling",
|
|
53
|
+
description: "Color palette and styling guidelines",
|
|
54
|
+
files: [{
|
|
55
|
+
source: "rules/cursor/uds/styling.mdc",
|
|
56
|
+
target: ".cursor/rules/uds/styling.mdc",
|
|
57
|
+
type: "file"
|
|
58
|
+
}]
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
claude: {
|
|
63
|
+
name: "Claude Code",
|
|
64
|
+
description: "AI-powered coding assistant rules for UDS development",
|
|
65
|
+
rules: [
|
|
66
|
+
{
|
|
67
|
+
name: "UDS Components",
|
|
68
|
+
description: "Component development guidelines and patterns",
|
|
69
|
+
files: [{
|
|
70
|
+
source: "rules/claude/uds/components.md",
|
|
71
|
+
target: ".claude/rules/uds/components.md",
|
|
72
|
+
type: "file"
|
|
73
|
+
}]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "UDS Tailwind",
|
|
77
|
+
description: "Tailwind CSS configuration and setup guidelines",
|
|
78
|
+
files: [{
|
|
79
|
+
source: "rules/claude/uds/tailwind.md",
|
|
80
|
+
target: ".claude/rules/uds/tailwind.md",
|
|
81
|
+
type: "file"
|
|
82
|
+
}]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "UDS Icons",
|
|
86
|
+
description: "Icon usage and documentation guidelines",
|
|
87
|
+
files: [{
|
|
88
|
+
source: "rules/claude/uds/icons.md",
|
|
89
|
+
target: ".claude/rules/uds/icons.md",
|
|
90
|
+
type: "file"
|
|
91
|
+
}]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "UDS Elevation",
|
|
95
|
+
description: "Elevation prop usage for layered surfaces",
|
|
96
|
+
files: [{
|
|
97
|
+
source: "rules/claude/uds/elevation.md",
|
|
98
|
+
target: ".claude/rules/uds/elevation.md",
|
|
99
|
+
type: "file"
|
|
100
|
+
}]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "UDS Styling",
|
|
104
|
+
description: "Color palette and styling guidelines",
|
|
105
|
+
files: [{
|
|
106
|
+
source: "rules/claude/uds/styling.md",
|
|
107
|
+
target: ".claude/rules/uds/styling.md",
|
|
108
|
+
type: "file"
|
|
109
|
+
}]
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
};
|
|
61
114
|
function getAvailableEditors() {
|
|
62
115
|
return Object.keys(EDITOR_CONFIGS);
|
|
63
116
|
}
|
|
64
117
|
function getEditorConfig(editor) {
|
|
65
118
|
return EDITOR_CONFIGS[editor];
|
|
66
119
|
}
|
|
120
|
+
const AUTO_GENERATED_HEADER = "<!-- Auto-generated by UDS CLI (`uds editor-rules`). Do not edit manually. -->";
|
|
67
121
|
function getRuleContent(rulePath) {
|
|
68
|
-
return (0, node_fs.readFileSync)((0, node_path.join)(__dirname$1, "..", "..", "..", rulePath), "utf-8");
|
|
122
|
+
return addAutoGeneratedHeader((0, node_fs.readFileSync)((0, node_path.join)(__dirname$1, "..", "..", "..", rulePath), "utf-8"));
|
|
123
|
+
}
|
|
124
|
+
function addAutoGeneratedHeader(content) {
|
|
125
|
+
if (content.startsWith("---\n")) {
|
|
126
|
+
const closingIndex = content.indexOf("\n---\n", 4);
|
|
127
|
+
if (closingIndex !== -1) return `${content.slice(0, closingIndex + 5)}${AUTO_GENERATED_HEADER}\n${content.slice(closingIndex + 5)}`;
|
|
128
|
+
}
|
|
129
|
+
return `${AUTO_GENERATED_HEADER}\n\n${content}`;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Checks which editors have installed UDS rules that are out of date
|
|
133
|
+
* compared to the latest rules shipped with the CLI.
|
|
134
|
+
* Only checks editors whose rule directories already exist.
|
|
135
|
+
*/
|
|
136
|
+
function getEditorsWithStaleRules(projectDir) {
|
|
137
|
+
const staleEditors = [];
|
|
138
|
+
for (const [_editorId, editorConfig] of Object.entries(EDITOR_CONFIGS)) {
|
|
139
|
+
let hasAnyRule = false;
|
|
140
|
+
let hasStaleRule = false;
|
|
141
|
+
for (const rule of editorConfig.rules) for (const file of rule.files) {
|
|
142
|
+
const targetPath = (0, node_path.join)(projectDir, file.target);
|
|
143
|
+
if (!(0, node_fs.existsSync)(targetPath)) continue;
|
|
144
|
+
hasAnyRule = true;
|
|
145
|
+
try {
|
|
146
|
+
if ((0, node_fs.readFileSync)(targetPath, "utf-8") !== getRuleContent(file.source)) hasStaleRule = true;
|
|
147
|
+
} catch {}
|
|
148
|
+
}
|
|
149
|
+
if (hasAnyRule && hasStaleRule) staleEditors.push(editorConfig.name);
|
|
150
|
+
}
|
|
151
|
+
return staleEditors;
|
|
69
152
|
}
|
|
70
153
|
|
|
71
154
|
//#endregion
|
|
72
155
|
exports.getAvailableEditors = getAvailableEditors;
|
|
73
156
|
exports.getEditorConfig = getEditorConfig;
|
|
157
|
+
exports.getEditorsWithStaleRules = getEditorsWithStaleRules;
|
|
74
158
|
exports.getRuleContent = getRuleContent;
|
|
@@ -1,71 +1,154 @@
|
|
|
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
|
-
import { readFileSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
6
|
//#region ../cli/dist/utils/rules/config.mjs
|
|
7
7
|
/*! © 2026 Yahoo, Inc. UDS CLI v0.0.0-development */
|
|
8
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const EDITOR_CONFIGS = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
9
|
+
const EDITOR_CONFIGS = {
|
|
10
|
+
cursor: {
|
|
11
|
+
name: "Cursor",
|
|
12
|
+
description: "AI-powered coding assistant rules for UDS development",
|
|
13
|
+
rules: [
|
|
14
|
+
{
|
|
15
|
+
name: "UDS Components",
|
|
16
|
+
description: "Component development guidelines and patterns",
|
|
17
|
+
files: [{
|
|
18
|
+
source: "rules/cursor/uds/components.mdc",
|
|
19
|
+
target: ".cursor/rules/uds/components.mdc",
|
|
20
|
+
type: "file"
|
|
21
|
+
}]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "UDS Tailwind",
|
|
25
|
+
description: "Tailwind CSS configuration and setup guidelines",
|
|
26
|
+
files: [{
|
|
27
|
+
source: "rules/cursor/uds/tailwind.mdc",
|
|
28
|
+
target: ".cursor/rules/uds/tailwind.mdc",
|
|
29
|
+
type: "file"
|
|
30
|
+
}]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "UDS Icons",
|
|
34
|
+
description: "Icon usage and documentation guidelines",
|
|
35
|
+
files: [{
|
|
36
|
+
source: "rules/cursor/uds/icons.mdc",
|
|
37
|
+
target: ".cursor/rules/uds/icons.mdc",
|
|
38
|
+
type: "file"
|
|
39
|
+
}]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "UDS Elevation",
|
|
43
|
+
description: "Elevation prop usage for layered surfaces",
|
|
44
|
+
files: [{
|
|
45
|
+
source: "rules/cursor/uds/elevation.mdc",
|
|
46
|
+
target: ".cursor/rules/uds/elevation.mdc",
|
|
47
|
+
type: "file"
|
|
48
|
+
}]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "UDS Styling",
|
|
52
|
+
description: "Color palette and styling guidelines",
|
|
53
|
+
files: [{
|
|
54
|
+
source: "rules/cursor/uds/styling.mdc",
|
|
55
|
+
target: ".cursor/rules/uds/styling.mdc",
|
|
56
|
+
type: "file"
|
|
57
|
+
}]
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
claude: {
|
|
62
|
+
name: "Claude Code",
|
|
63
|
+
description: "AI-powered coding assistant rules for UDS development",
|
|
64
|
+
rules: [
|
|
65
|
+
{
|
|
66
|
+
name: "UDS Components",
|
|
67
|
+
description: "Component development guidelines and patterns",
|
|
68
|
+
files: [{
|
|
69
|
+
source: "rules/claude/uds/components.md",
|
|
70
|
+
target: ".claude/rules/uds/components.md",
|
|
71
|
+
type: "file"
|
|
72
|
+
}]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "UDS Tailwind",
|
|
76
|
+
description: "Tailwind CSS configuration and setup guidelines",
|
|
77
|
+
files: [{
|
|
78
|
+
source: "rules/claude/uds/tailwind.md",
|
|
79
|
+
target: ".claude/rules/uds/tailwind.md",
|
|
80
|
+
type: "file"
|
|
81
|
+
}]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "UDS Icons",
|
|
85
|
+
description: "Icon usage and documentation guidelines",
|
|
86
|
+
files: [{
|
|
87
|
+
source: "rules/claude/uds/icons.md",
|
|
88
|
+
target: ".claude/rules/uds/icons.md",
|
|
89
|
+
type: "file"
|
|
90
|
+
}]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "UDS Elevation",
|
|
94
|
+
description: "Elevation prop usage for layered surfaces",
|
|
95
|
+
files: [{
|
|
96
|
+
source: "rules/claude/uds/elevation.md",
|
|
97
|
+
target: ".claude/rules/uds/elevation.md",
|
|
98
|
+
type: "file"
|
|
99
|
+
}]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "UDS Styling",
|
|
103
|
+
description: "Color palette and styling guidelines",
|
|
104
|
+
files: [{
|
|
105
|
+
source: "rules/claude/uds/styling.md",
|
|
106
|
+
target: ".claude/rules/uds/styling.md",
|
|
107
|
+
type: "file"
|
|
108
|
+
}]
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
};
|
|
60
113
|
function getAvailableEditors() {
|
|
61
114
|
return Object.keys(EDITOR_CONFIGS);
|
|
62
115
|
}
|
|
63
116
|
function getEditorConfig(editor) {
|
|
64
117
|
return EDITOR_CONFIGS[editor];
|
|
65
118
|
}
|
|
119
|
+
const AUTO_GENERATED_HEADER = "<!-- Auto-generated by UDS CLI (`uds editor-rules`). Do not edit manually. -->";
|
|
66
120
|
function getRuleContent(rulePath) {
|
|
67
|
-
return readFileSync(join(__dirname, "..", "..", "..", rulePath), "utf-8");
|
|
121
|
+
return addAutoGeneratedHeader(readFileSync(join(__dirname, "..", "..", "..", rulePath), "utf-8"));
|
|
122
|
+
}
|
|
123
|
+
function addAutoGeneratedHeader(content) {
|
|
124
|
+
if (content.startsWith("---\n")) {
|
|
125
|
+
const closingIndex = content.indexOf("\n---\n", 4);
|
|
126
|
+
if (closingIndex !== -1) return `${content.slice(0, closingIndex + 5)}${AUTO_GENERATED_HEADER}\n${content.slice(closingIndex + 5)}`;
|
|
127
|
+
}
|
|
128
|
+
return `${AUTO_GENERATED_HEADER}\n\n${content}`;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Checks which editors have installed UDS rules that are out of date
|
|
132
|
+
* compared to the latest rules shipped with the CLI.
|
|
133
|
+
* Only checks editors whose rule directories already exist.
|
|
134
|
+
*/
|
|
135
|
+
function getEditorsWithStaleRules(projectDir) {
|
|
136
|
+
const staleEditors = [];
|
|
137
|
+
for (const [_editorId, editorConfig] of Object.entries(EDITOR_CONFIGS)) {
|
|
138
|
+
let hasAnyRule = false;
|
|
139
|
+
let hasStaleRule = false;
|
|
140
|
+
for (const rule of editorConfig.rules) for (const file of rule.files) {
|
|
141
|
+
const targetPath = join(projectDir, file.target);
|
|
142
|
+
if (!existsSync(targetPath)) continue;
|
|
143
|
+
hasAnyRule = true;
|
|
144
|
+
try {
|
|
145
|
+
if (readFileSync(targetPath, "utf-8") !== getRuleContent(file.source)) hasStaleRule = true;
|
|
146
|
+
} catch {}
|
|
147
|
+
}
|
|
148
|
+
if (hasAnyRule && hasStaleRule) staleEditors.push(editorConfig.name);
|
|
149
|
+
}
|
|
150
|
+
return staleEditors;
|
|
68
151
|
}
|
|
69
152
|
|
|
70
153
|
//#endregion
|
|
71
|
-
export { getAvailableEditors, getEditorConfig, getRuleContent };
|
|
154
|
+
export { getAvailableEditors, getEditorConfig, getEditorsWithStaleRules, getRuleContent };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# UDS Components
|
|
2
|
+
|
|
3
|
+
## MCP tool usage
|
|
4
|
+
|
|
5
|
+
- Always fetch components type definition using the UDS MCP server
|
|
6
|
+
- Always fetch the possible components from UDS using the UDS MCP server
|
|
7
|
+
- Before using any component, fetch its type definition and documentation examples via the MCP server
|
|
8
|
+
- Use `get_components` to retrieve the full list of exported UDS components
|
|
9
|
+
- Use `get_component_documentation_examples` with a component name (e.g., "tooltip", "toast") to fetch usage docs and examples
|
|
10
|
+
- Use `get_documentation` with path "core-concepts/elevation" for detailed elevation guidance
|
|
11
|
+
|
|
12
|
+
## Never rebuild existing UDS primitives
|
|
13
|
+
|
|
14
|
+
- Before building ANY custom tooltip, toast, notification, popover, dropdown, select, dialog, modal, drawer, sheet, accordion, tabs, alert, snackbar, or banner, call `get_components` first to check if UDS already exports it
|
|
15
|
+
- If a matching component exists, use it and call `get_component_documentation_examples` to learn its API
|
|
16
|
+
- Never recreate functionality that UDS provides — only create custom components when UDS doesn't offer the needed functionality
|
|
17
|
+
|
|
18
|
+
## Use UDS components instead of raw HTML
|
|
19
|
+
|
|
20
|
+
- Always use UDS UI library components instead of raw HTML tags
|
|
21
|
+
- Use `<Text>` instead of `<p>`, `<span>`, `<h1>`–`<h6>`
|
|
22
|
+
- Use `<Button>` instead of `<button>`
|
|
23
|
+
- Use `<Input>` instead of `<input>`
|
|
24
|
+
- Use `<Checkbox>` instead of `<input type="checkbox">`
|
|
25
|
+
- Use `<Radio>` instead of `<input type="radio">`
|
|
26
|
+
- Use `<Switch>` instead of custom toggle components
|
|
27
|
+
- Use `<Link>` instead of `<a>`
|
|
28
|
+
- Use `<Icon>` instead of SVG elements
|
|
29
|
+
- Use `<Tooltip>`, `<TooltipTrigger>`, `<TooltipContent>` instead of custom tooltip implementations
|
|
30
|
+
- Use `createToast()` from `@yahoo/uds` instead of custom toast/notification components
|
|
31
|
+
|
|
32
|
+
## Box constraints
|
|
33
|
+
|
|
34
|
+
- `<Box>` has `display="flex"` by default — use `<VStack>` for vertical stacking, `<HStack>` for horizontal, or `<div>` for simple containers
|
|
35
|
+
- Always set an explicit `display` prop on every `<Box>` (`display="block"` or `display="flex"`). Omitting it causes broken UI.
|
|
36
|
+
- `<Box>` does NOT have a `gap` prop — use `rowGap` or `columnGap` instead. Only `<HStack>` and `<VStack>` have `gap`.
|
|
37
|
+
- Every `<Box>` with `flexDirection="column"` must have `rowGap` specified. Every `<Box>` with `flexDirection="row"` must have `columnGap` specified if spacing between children is needed. The `spacing` prop is for padding only, not gaps.
|
|
38
|
+
|
|
39
|
+
## HStack and VStack constraints
|
|
40
|
+
|
|
41
|
+
- Always set `alignItems` and `justifyContent` on every `<HStack>` and `<VStack>` — never rely on default flex behavior
|
|
42
|
+
- Flexbox alignment values must use full CSS syntax: `"flex-start"` not `"start"`, `"flex-end"` not `"end"`
|
|
43
|
+
- Valid `justifyContent` values: `"flex-start"` | `"flex-end"` | `"center"` | `"space-between"` | `"space-around"` | `"space-evenly"`
|
|
44
|
+
- Valid `alignItems` values: `"flex-start"` | `"flex-end"` | `"center"` | `"baseline"` | `"stretch"`
|
|
45
|
+
|
|
46
|
+
## Styling rules
|
|
47
|
+
|
|
48
|
+
- Box, HStack, and VStack provide TypeScript props for all styling — prefer using props (`backgroundColor`, `spacing`, `borderRadius`, etc.) over Tailwind `className` for UDS design tokens
|
|
49
|
+
- Never override styling properties on components that use `size` and `variant` props (Button, IconButton, Chip, Badge, Avatar, Radio, Checkbox, Menu, Divider, Switch) with Tailwind classes — always use only the available `size` and `variant` options
|
|
50
|
+
- When placing fixed-size components (Button, IconButton, Chip, Badge, Avatar) in a horizontal flex container, add `className="shrink-0"` to prevent them from being compressed
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# UDS Elevation
|
|
2
|
+
|
|
3
|
+
## When to use elevation
|
|
4
|
+
|
|
5
|
+
- Any surface that overlaps or sits on top of another MUST use the `elevation` prop on `<Box>`, `<VStack>`, or `<HStack>`
|
|
6
|
+
- This includes cards, modals, popovers, dropdowns, drawers, toasts, sheets, and floating elements
|
|
7
|
+
|
|
8
|
+
## The elevation scale
|
|
9
|
+
|
|
10
|
+
- `elevation="0"` — Background or flat surfaces
|
|
11
|
+
- `elevation="1"` — Cards, list items, secondary surfaces
|
|
12
|
+
- `elevation="2"` — Floating elements like popovers, dropdowns
|
|
13
|
+
- `elevation="3"` — Modals, sheets, key actions
|
|
14
|
+
- `elevation="4"` — Drawers or toasts
|
|
15
|
+
- `elevation="5"` — System overlays
|
|
16
|
+
|
|
17
|
+
## Always use the shorthand prop
|
|
18
|
+
|
|
19
|
+
- The `elevation` prop is a shorthand that sets `backgroundColor`, `borderColor`, `borderWidth`, and `dropShadow` together in one prop
|
|
20
|
+
- Never use `dropShadow` alone for layered surfaces — it only adds a shadow and misses the required `backgroundColor`, `borderColor`, and `borderWidth` changes
|
|
21
|
+
- Never use individual elevation token props (`backgroundColor="elevation-X"`, `borderColor="elevation-X"`, `borderWidth="elevation-X"`, `dropShadow="elevation-X"`) — always use the shorthand `elevation` prop instead
|
|
22
|
+
- Individual props override the shorthand if needed: `<Box elevation="2" backgroundColor="primary" />`
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
- Wrong: `<Box dropShadow="md" backgroundColor="primary" borderRadius="lg">` (incomplete elevation)
|
|
27
|
+
- Wrong: `<Box backgroundColor="elevation-2" borderColor="elevation-2" borderWidth="elevation-2" dropShadow="elevation-2">` (verbose, use shorthand)
|
|
28
|
+
- Correct: `<Box elevation="1" borderRadius="lg">` (single prop sets all 4 properties)
|
|
29
|
+
- Correct: `<VStack elevation="2" gap="4" alignItems="stretch" justifyContent="flex-start">Popover content</VStack>`
|
|
30
|
+
|
|
31
|
+
## More information
|
|
32
|
+
|
|
33
|
+
- Use `get_documentation` MCP tool with path "core-concepts/elevation" for detailed guidance on applying elevation
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# UDS Styling
|
|
2
|
+
|
|
3
|
+
## Use UDS palette colors only
|
|
4
|
+
|
|
5
|
+
- Only use UDS palette colors — never use raw color values like `bg-white`, `text-white`, `bg-gray-100`, etc.
|
|
6
|
+
- Background colors: `primary`, `secondary`, `brand`, `brand-secondary`, `alert`, `alert-secondary`, `positive`, `positive-secondary`, `warning`, `warning-secondary`, `info`, `info-secondary`
|
|
7
|
+
- Foreground (text/icon) colors: `primary`, `secondary`, `tertiary`, `muted`, `on-color`, `brand`, `alert`, `positive`, `warning`, `info`
|
|
8
|
+
|
|
9
|
+
## Color pairing rules
|
|
10
|
+
|
|
11
|
+
- On dark or brand backgrounds (`brand`, `positive`, `info`, `warning`, `alert`), use `color="on-color"` for text and icons
|
|
12
|
+
- On secondary/lighter background variants (`brand-secondary`, `positive-secondary`, etc.), use the matching semantic color (e.g., `color="brand"` on `backgroundColor="brand-secondary"`)
|
|
13
|
+
- Never use `color="on-color"` on white or light backgrounds — it creates invisible white text
|
|
14
|
+
- Never use a dark semantic color (e.g., `brand`, `positive`) directly on its own secondary background variant as contrast will be poor
|
|
15
|
+
|
|
16
|
+
## General styling
|
|
17
|
+
|
|
18
|
+
- Prefer UDS TypeScript props (`backgroundColor`, `spacing`, `borderRadius`, etc.) over Tailwind `className` for design tokens
|
package/dist/cli/runner.cjs
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_styles_variants = require('../styles/variants.cjs');
|
|
4
4
|
const require_components_index = require('../components/index.cjs');
|
|
5
|
-
const
|
|
5
|
+
const require_css = require('../tailwind/dist/commands/css.cjs');
|
|
6
6
|
const require_generateComponentData = require('../tailwind/dist/commands/generateComponentData.cjs');
|
|
7
7
|
const require_generatePurgeCSSData = require('../tailwind/dist/commands/generatePurgeCSSData.cjs');
|
|
8
8
|
const require_purge = require('../tailwind/dist/commands/purge.cjs');
|
|
9
|
+
const require_cli = require('./dist/cli.cjs');
|
|
9
10
|
const require_package = require('../uds/package.cjs');
|
|
10
11
|
const require_components_experimental_index = require('../components/experimental/index.cjs');
|
|
11
12
|
const require_cli_commands_sync = require('./commands/sync.cjs');
|
|
12
13
|
const require_cli_commands_version = require('./commands/version.cjs');
|
|
13
|
-
let node_path = require("node:path");
|
|
14
14
|
let ts_morph = require("ts-morph");
|
|
15
|
+
let node_path = require("node:path");
|
|
15
16
|
|
|
16
17
|
//#region src/cli/runner.ts
|
|
17
18
|
require_cli.run([
|
|
@@ -44,6 +45,14 @@ require_cli.run([
|
|
|
44
45
|
outputFile: (0, node_path.join)(process.cwd(), "generated/componentData.json")
|
|
45
46
|
};
|
|
46
47
|
}),
|
|
48
|
+
require_css.makeCSSCommand(async () => {
|
|
49
|
+
const componentData = await Promise.resolve().then(() => require("../uds/generated/componentData.cjs"));
|
|
50
|
+
return {
|
|
51
|
+
variants: require_styles_variants.variants,
|
|
52
|
+
autoVariants: (await Promise.resolve().then(() => require("../automated-config/dist/generated/autoVariants.cjs"))).autoVariants,
|
|
53
|
+
componentData
|
|
54
|
+
};
|
|
55
|
+
}),
|
|
47
56
|
require_cli_commands_sync.syncCommand
|
|
48
57
|
]);
|
|
49
58
|
|
package/dist/cli/runner.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { variants } from "../styles/variants.js";
|
|
3
3
|
import { components_exports } from "../components/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { makeCSSCommand } from "../tailwind/dist/commands/css.js";
|
|
5
5
|
import { makeGenerateComponentDataCommand } from "../tailwind/dist/commands/generateComponentData.js";
|
|
6
6
|
import { makeGeneratePurgeCSSDataCommand } from "../tailwind/dist/commands/generatePurgeCSSData.js";
|
|
7
7
|
import { makePurgeCommand } from "../tailwind/dist/commands/purge.js";
|
|
8
|
+
import { run } from "./dist/cli.js";
|
|
8
9
|
import package_default from "../uds/package.js";
|
|
9
10
|
import { experimental_exports } from "../components/experimental/index.js";
|
|
10
11
|
import { syncCommand } from "./commands/sync.js";
|
|
11
12
|
import { versionCommand } from "./commands/version.js";
|
|
12
|
-
import { join } from "node:path";
|
|
13
13
|
import { Project } from "ts-morph";
|
|
14
|
+
import { join } from "node:path";
|
|
14
15
|
|
|
15
16
|
//#region src/cli/runner.ts
|
|
16
17
|
run([
|
|
@@ -43,6 +44,14 @@ run([
|
|
|
43
44
|
outputFile: join(process.cwd(), "generated/componentData.json")
|
|
44
45
|
};
|
|
45
46
|
}),
|
|
47
|
+
makeCSSCommand(async () => {
|
|
48
|
+
const componentData = await import("../uds/generated/componentData.js");
|
|
49
|
+
return {
|
|
50
|
+
variants,
|
|
51
|
+
autoVariants: (await import("../automated-config/dist/generated/autoVariants.js")).autoVariants,
|
|
52
|
+
componentData
|
|
53
|
+
};
|
|
54
|
+
}),
|
|
46
55
|
syncCommand
|
|
47
56
|
]);
|
|
48
57
|
|
|
@@ -55,6 +55,7 @@ const AvatarImage = ({ size = require_components_client_Avatar_utils.DEFAULT_AVA
|
|
|
55
55
|
if (loadingState === "loaded") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
56
56
|
className: classNames.root,
|
|
57
57
|
style: inlineStyles.root,
|
|
58
|
+
...props,
|
|
58
59
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Image.Image, {
|
|
59
60
|
src,
|
|
60
61
|
srcSet,
|
|
@@ -53,6 +53,7 @@ const AvatarImage = ({ size = DEFAULT_AVATAR_SIZE, variant = DEFAULT_AVATAR_VARI
|
|
|
53
53
|
if (loadingState === "loaded") return /* @__PURE__ */ jsx(Box, {
|
|
54
54
|
className: classNames.root,
|
|
55
55
|
style: inlineStyles.root,
|
|
56
|
+
...props,
|
|
56
57
|
children: /* @__PURE__ */ jsx(Image$1, {
|
|
57
58
|
src,
|
|
58
59
|
srcSet,
|
|
@@ -20,7 +20,7 @@ const ChipDismissible = (0, react.forwardRef)(function ChipDismissible({ dismiss
|
|
|
20
20
|
className
|
|
21
21
|
}),
|
|
22
22
|
icon: require_styles_styler.getStyles({ chipDismissibleVariantIcon: variant }),
|
|
23
|
-
iconPressable: require_styles_styler.cx("uds-chip-dismissible-button", "uds-hit-target")
|
|
23
|
+
iconPressable: require_styles_styler.cx("uds-chip-dismissible-button", "uds-hit-target", "uds-ring", "rounded-full")
|
|
24
24
|
}), [className, variant]);
|
|
25
25
|
/**
|
|
26
26
|
* Handlers
|
|
@@ -17,7 +17,7 @@ const ChipDismissible = forwardRef(function ChipDismissible({ dismissButtonAriaL
|
|
|
17
17
|
className
|
|
18
18
|
}),
|
|
19
19
|
icon: getStyles({ chipDismissibleVariantIcon: variant }),
|
|
20
|
-
iconPressable: cx("uds-chip-dismissible-button", "uds-hit-target")
|
|
20
|
+
iconPressable: cx("uds-chip-dismissible-button", "uds-hit-target", "uds-ring", "rounded-full")
|
|
21
21
|
}), [className, variant]);
|
|
22
22
|
/**
|
|
23
23
|
* Handlers
|