@camunda/design-system 0.69.0 → 0.71.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/README.md +2 -0
- package/dist/src/components/ui/alert-dialog.js +3 -3
- package/dist/src/components/ui/alert-dialog.js.map +1 -1
- package/dist/src/components/ui/breadcrumb.js +2 -2
- package/dist/src/components/ui/breadcrumb.js.map +1 -1
- package/dist/src/components/ui/chart.js +2 -2
- package/dist/src/components/ui/chart.js.map +1 -1
- package/dist/src/components/ui/checkbox.js +1 -1
- package/dist/src/components/ui/checkbox.js.map +1 -1
- package/dist/src/components/ui/combobox.js +1 -1
- package/dist/src/components/ui/dialog.d.ts +8 -1
- package/dist/src/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/components/ui/dialog.js +14 -6
- package/dist/src/components/ui/dialog.js.map +1 -1
- package/dist/src/components/ui/file-uploader.js +2 -2
- package/dist/src/components/ui/file-uploader.js.map +1 -1
- package/dist/src/components/ui/input.d.ts +7 -1
- package/dist/src/components/ui/input.d.ts.map +1 -1
- package/dist/src/components/ui/input.js +6 -2
- package/dist/src/components/ui/input.js.map +1 -1
- package/dist/src/components/ui/multi-select.js +2 -2
- package/dist/src/components/ui/multi-select.js.map +1 -1
- package/dist/src/components/ui/page-layout.js +1 -1
- package/dist/src/components/ui/page-layout.js.map +1 -1
- package/dist/src/components/ui/search-input.d.ts +6 -1
- package/dist/src/components/ui/search-input.d.ts.map +1 -1
- package/dist/src/components/ui/search-input.js.map +1 -1
- package/dist/src/components/ui/spinner.d.ts +2 -0
- package/dist/src/components/ui/spinner.d.ts.map +1 -1
- package/dist/src/components/ui/spinner.js +3 -1
- package/dist/src/components/ui/spinner.js.map +1 -1
- package/dist/src/components/ui/toast.js +1 -1
- package/dist/src/components/ui/toast.js.map +1 -1
- package/dist/src/components/ui/typography.js +4 -4
- package/dist/src/components/ui/typography.js.map +1 -1
- package/dist/src/examples/agent-control-plane-processes/DashboardPage.d.ts.map +1 -1
- package/dist/src/examples/agent-control-plane-processes/DashboardPage.js +2 -2
- package/dist/src/examples/agent-control-plane-processes/DashboardPage.js.map +1 -1
- package/dist/src/examples/project-detail/ProjectDetailPage.d.ts.map +1 -1
- package/dist/src/examples/project-detail/ProjectDetailPage.js +2 -2
- package/dist/src/examples/project-detail/ProjectDetailPage.js.map +1 -1
- package/dist/src/examples/shared/DashboardSection.d.ts.map +1 -1
- package/dist/src/examples/shared/DashboardSection.js +2 -1
- package/dist/src/examples/shared/DashboardSection.js.map +1 -1
- package/dist/src/examples/shared/DateRangePopover.js +1 -1
- package/dist/src/examples/shared/DateRangePopover.js.map +1 -1
- package/dist/src/icons/registry.d.ts.map +1 -1
- package/dist/src/icons/registry.js +1 -1
- package/dist/src/icons/registry.js.map +1 -1
- package/dist/styles.css +128 -39
- package/dist/theme.css +175 -0
- package/eslint-plugin/index.d.ts +1 -0
- package/eslint-plugin/index.js +20 -1
- package/eslint-rules/index.js +2 -0
- package/eslint-rules/no-bare-var-arbitrary.js +110 -0
- package/eslint-rules/no-uncompiled-utility.js +254 -0
- package/package.json +6 -4
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flags Tailwind v3-style CSS-variable shorthand in arbitrary values:
|
|
3
|
+
* `w-[--radix-popover-trigger-width]`. Tailwind v4 no longer wraps a bare
|
|
4
|
+
* custom property in var(): it compiles to `width: --radix-popover-trigger-width`,
|
|
5
|
+
* which is invalid CSS the browser drops — silently. The v4 form is
|
|
6
|
+
* `w-(--radix-popover-trigger-width)`.
|
|
7
|
+
*
|
|
8
|
+
* Every string and template literal is checked, because the shorthand
|
|
9
|
+
* typically hides in cn()/cva() arguments and copied snippets. The autofix,
|
|
10
|
+
* though, only runs where the string is known to be a class list (a
|
|
11
|
+
* `className`/`class` attribute, or an argument of a class helper such as
|
|
12
|
+
* cn/clsx/cva); anywhere else the string could be runtime data (a URL, an id,
|
|
13
|
+
* a fixture), so the rewrite is offered as an editor suggestion instead.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// `<utility>-[--name]`: the `[` must follow a utility-name character, so
|
|
17
|
+
// arbitrary properties (`[--x:1px]`) and plain `--x` strings never match.
|
|
18
|
+
const BARE_VAR = /([A-Za-z0-9])-\[(--[A-Za-z0-9_-]+)\]/g;
|
|
19
|
+
const HAS_BARE_VAR = new RegExp(BARE_VAR.source);
|
|
20
|
+
|
|
21
|
+
const CLASS_ATTRIBUTES = new Set(["className", "class"]);
|
|
22
|
+
const CLASS_HELPERS = new Set([
|
|
23
|
+
"cn",
|
|
24
|
+
"clsx",
|
|
25
|
+
"classnames",
|
|
26
|
+
"classNames",
|
|
27
|
+
"cx",
|
|
28
|
+
"cva",
|
|
29
|
+
"tv",
|
|
30
|
+
"twMerge",
|
|
31
|
+
"twJoin",
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
function calleeName(callee) {
|
|
35
|
+
if (callee.type === "Identifier") return callee.name;
|
|
36
|
+
if (
|
|
37
|
+
callee.type === "MemberExpression" &&
|
|
38
|
+
callee.property.type === "Identifier"
|
|
39
|
+
) {
|
|
40
|
+
return callee.property.name;
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// True when the literal sits inside a className/class attribute or anywhere in
|
|
46
|
+
// a class helper's arguments (including nested cva variant objects).
|
|
47
|
+
function isClassContext(ancestors) {
|
|
48
|
+
return ancestors.some(
|
|
49
|
+
(a) =>
|
|
50
|
+
(a.type === "JSXAttribute" && CLASS_ATTRIBUTES.has(a.name.name)) ||
|
|
51
|
+
(a.type === "CallExpression" && CLASS_HELPERS.has(calleeName(a.callee))),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
meta: {
|
|
57
|
+
type: "problem",
|
|
58
|
+
docs: {
|
|
59
|
+
description:
|
|
60
|
+
"Disallow Tailwind v3 `-[--var]` arbitrary values, which Tailwind v4 compiles to invalid CSS.",
|
|
61
|
+
},
|
|
62
|
+
fixable: "code",
|
|
63
|
+
hasSuggestions: true,
|
|
64
|
+
messages: {
|
|
65
|
+
bareVar:
|
|
66
|
+
"{{classes}}: Tailwind v4 compiles `-[--var]` to invalid CSS (e.g. `width: --var`), so the declaration is dropped. Use {{fixed}}.",
|
|
67
|
+
rewrite: "Rewrite to the Tailwind v4 `-(--var)` form.",
|
|
68
|
+
},
|
|
69
|
+
schema: [],
|
|
70
|
+
},
|
|
71
|
+
create(context) {
|
|
72
|
+
const sourceCode = context.sourceCode;
|
|
73
|
+
|
|
74
|
+
function check(node, text) {
|
|
75
|
+
const classes = [];
|
|
76
|
+
const fixed = [];
|
|
77
|
+
for (const token of text.split(/[\s"'`]+/)) {
|
|
78
|
+
if (!HAS_BARE_VAR.test(token)) continue;
|
|
79
|
+
classes.push(`"${token}"`);
|
|
80
|
+
fixed.push(`"${token.replace(BARE_VAR, "$1-($2)")}"`);
|
|
81
|
+
}
|
|
82
|
+
if (classes.length === 0) return;
|
|
83
|
+
const fix = (fixer) =>
|
|
84
|
+
fixer.replaceText(
|
|
85
|
+
node,
|
|
86
|
+
sourceCode.getText(node).replace(BARE_VAR, "$1-($2)"),
|
|
87
|
+
);
|
|
88
|
+
const data = { classes: classes.join(", "), fixed: fixed.join(", ") };
|
|
89
|
+
if (isClassContext(sourceCode.getAncestors(node))) {
|
|
90
|
+
context.report({ node, messageId: "bareVar", data, fix });
|
|
91
|
+
} else {
|
|
92
|
+
context.report({
|
|
93
|
+
node,
|
|
94
|
+
messageId: "bareVar",
|
|
95
|
+
data,
|
|
96
|
+
suggest: [{ messageId: "rewrite", fix }],
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
Literal(node) {
|
|
103
|
+
if (typeof node.value === "string") check(node, node.value);
|
|
104
|
+
},
|
|
105
|
+
TemplateElement(node) {
|
|
106
|
+
check(node, node.value.cooked ?? node.value.raw);
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
};
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flags Tailwind utility classes in a consumer's className that nothing will
|
|
3
|
+
* turn into CSS. `@camunda/design-system/styles.css` is precompiled: it holds
|
|
4
|
+
* only the utilities the DS components use. In an app without its own Tailwind
|
|
5
|
+
* build, any other utility (`w-92`, `grid-cols-[3fr_1fr]`) renders unstyled,
|
|
6
|
+
* silently. An app with its own Tailwind build (stylesheet entry + plugin
|
|
7
|
+
* registered in its build config) compiles any utility except DS token ones,
|
|
8
|
+
* which need `@camunda/design-system/theme.css`; only those are checked
|
|
9
|
+
* there, and nothing once the theme is imported.
|
|
10
|
+
*
|
|
11
|
+
* Only utility-shaped tokens are checked — spacing/sizing/layout roots,
|
|
12
|
+
* color utilities naming a DS token (read from the `theme.css` next to the
|
|
13
|
+
* stylesheet), arbitrary values, variant prefixes — so the app's own class
|
|
14
|
+
* names (`card-header`, `text-wrapper`, BEM, CSS-module keys) never match.
|
|
15
|
+
* Only string-literal classNames are inspected. The class list comes from the
|
|
16
|
+
* DS installed for the linted app, falling back to this package's own build.
|
|
17
|
+
*/
|
|
18
|
+
import fs from "node:fs";
|
|
19
|
+
import { createRequire } from "node:module";
|
|
20
|
+
import path from "node:path";
|
|
21
|
+
import { fileURLToPath } from "node:url";
|
|
22
|
+
import { classLiteral } from "./class-literal.js";
|
|
23
|
+
|
|
24
|
+
// This package's own build: the fallback when the linted app's installed DS
|
|
25
|
+
// can't be resolved (e.g. the DS audit gate running on a file outside an app).
|
|
26
|
+
const OWN_STYLESHEET = fileURLToPath(
|
|
27
|
+
new URL("../dist/styles.css", import.meta.url),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const UTILITY_ROOT =
|
|
31
|
+
/^-?(?:p[xytrblse]?|m[xytrblse]?|gap(?:-[xy])?|space-[xy]|w|h|size|min-w|min-h|max-w|max-h|inset(?:-[xy])?|top|right|bottom|left|start|end|z|basis|grid-cols|grid-rows|col-span|col-start|col-end|row-span|order|flex|shrink|grow|leading|tracking|line-clamp|opacity|rounded(?:-[tblrse]{1,2})?|translate-[xy]|rotate|scale(?:-[xy])?)-[A-Za-z0-9./()-]+$/;
|
|
32
|
+
|
|
33
|
+
const COLOR_UTILITY =
|
|
34
|
+
/^(?:bg|text|border(?:-[trblxyse])?|ring|ring-offset|outline|fill|stroke|divide|from|via|to|decoration|placeholder|caret|accent)-(.+?)(?:\/\d+)?$/;
|
|
35
|
+
|
|
36
|
+
const TAILWIND_ENTRY = /@import\s+(?:url\()?["']tailwindcss(?:\/[a-z]+)?["']/;
|
|
37
|
+
const DS_THEME_IMPORT =
|
|
38
|
+
/@import\s+(?:url\()?["']@camunda\/design-system\/theme\.css["']/;
|
|
39
|
+
const CONFIG_EXTS = ["js", "ts", "mjs", "mts", "cjs", "cts"];
|
|
40
|
+
const VITE_CONFIGS = CONFIG_EXTS.map((ext) => `vite.config.${ext}`);
|
|
41
|
+
const POSTCSS_CONFIGS = [
|
|
42
|
+
...CONFIG_EXTS.map((ext) => `postcss.config.${ext}`),
|
|
43
|
+
...["", ".json", ".js", ".cjs", ".mjs", ".yml", ".yaml"].map(
|
|
44
|
+
(ext) => `.postcssrc${ext}`,
|
|
45
|
+
),
|
|
46
|
+
];
|
|
47
|
+
const STYLE_EXTS = new Set([".css", ".scss", ".pcss", ".less"]);
|
|
48
|
+
const SKIP_DIRS = new Set(["node_modules", "dist", "build", ".git"]);
|
|
49
|
+
|
|
50
|
+
const shippedCache = new Map();
|
|
51
|
+
const tailwindBuildCache = new Map();
|
|
52
|
+
const stylesheetCache = new Map();
|
|
53
|
+
|
|
54
|
+
// Class names in a compiled stylesheet, unescaped (`md\:flex` → `md:flex`),
|
|
55
|
+
// plus the DS color token names from the `theme.css` published beside it.
|
|
56
|
+
function shippedClasses(stylesheet) {
|
|
57
|
+
if (shippedCache.has(stylesheet)) return shippedCache.get(stylesheet);
|
|
58
|
+
let shipped = null;
|
|
59
|
+
try {
|
|
60
|
+
const css = fs.readFileSync(stylesheet, "utf8");
|
|
61
|
+
const classes = new Set();
|
|
62
|
+
for (const [, name] of css.matchAll(/\.((?:\\.|[\w-])+)/g)) {
|
|
63
|
+
classes.add(name.replace(/\\(.)/g, "$1"));
|
|
64
|
+
}
|
|
65
|
+
const colorTokens = new Set();
|
|
66
|
+
try {
|
|
67
|
+
const theme = fs.readFileSync(
|
|
68
|
+
path.join(path.dirname(stylesheet), "theme.css"),
|
|
69
|
+
"utf8",
|
|
70
|
+
);
|
|
71
|
+
for (const [, token] of theme.matchAll(/--color-([\w-]+):/g)) {
|
|
72
|
+
colorTokens.add(token);
|
|
73
|
+
}
|
|
74
|
+
} catch {
|
|
75
|
+
// Older DS builds ship no theme.css: color utilities go unchecked.
|
|
76
|
+
}
|
|
77
|
+
shipped = { classes, colorTokens };
|
|
78
|
+
} catch {
|
|
79
|
+
// No built stylesheet (e.g. linting inside the DS repo before a build):
|
|
80
|
+
// nothing to compare against, so the rule stays silent.
|
|
81
|
+
}
|
|
82
|
+
shippedCache.set(stylesheet, shipped);
|
|
83
|
+
return shipped;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function nearestPackageRoot(file) {
|
|
87
|
+
let dir = path.dirname(path.resolve(file));
|
|
88
|
+
while (true) {
|
|
89
|
+
if (fs.existsSync(path.join(dir, "package.json"))) return dir;
|
|
90
|
+
const parent = path.dirname(dir);
|
|
91
|
+
if (parent === dir) return null;
|
|
92
|
+
dir = parent;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Concatenated contents of every stylesheet under `dir`.
|
|
97
|
+
function stylesheetsText(dir) {
|
|
98
|
+
let entries;
|
|
99
|
+
try {
|
|
100
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
101
|
+
} catch {
|
|
102
|
+
return "";
|
|
103
|
+
}
|
|
104
|
+
let text = "";
|
|
105
|
+
for (const entry of entries) {
|
|
106
|
+
const full = path.join(dir, entry.name);
|
|
107
|
+
if (entry.isDirectory()) {
|
|
108
|
+
if (!SKIP_DIRS.has(entry.name)) text += stylesheetsText(full);
|
|
109
|
+
} else if (STYLE_EXTS.has(path.extname(entry.name))) {
|
|
110
|
+
text += fs.readFileSync(full, "utf8") + "\n";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return text;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function anyFileMentions(root, names, needle) {
|
|
117
|
+
return names.some((name) => {
|
|
118
|
+
try {
|
|
119
|
+
return fs.readFileSync(path.join(root, name), "utf8").includes(needle);
|
|
120
|
+
} catch {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Whether the Tailwind v4 plugin is registered in the app's build config:
|
|
127
|
+
// `@tailwindcss/vite` in vite.config, or `@tailwindcss/postcss` in a PostCSS
|
|
128
|
+
// config (including package.json's `postcss` key).
|
|
129
|
+
function pluginRegistered(root) {
|
|
130
|
+
if (anyFileMentions(root, VITE_CONFIGS, "@tailwindcss/vite")) return true;
|
|
131
|
+
if (anyFileMentions(root, POSTCSS_CONFIGS, "@tailwindcss/postcss")) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
const pkg = JSON.parse(
|
|
136
|
+
fs.readFileSync(path.join(root, "package.json"), "utf8"),
|
|
137
|
+
);
|
|
138
|
+
return JSON.stringify(pkg.postcss ?? {}).includes("@tailwindcss/postcss");
|
|
139
|
+
} catch {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// What the app owning `file` compiles itself. `build`: a stylesheet under
|
|
145
|
+
// src/ imports Tailwind AND its plugin is registered — installed packages
|
|
146
|
+
// alone generate nothing. `dsTheme`: a stylesheet imports the DS theme, without
|
|
147
|
+
// which DS token utilities compile to nothing even in a working build.
|
|
148
|
+
function appTailwind(file) {
|
|
149
|
+
const root = nearestPackageRoot(file);
|
|
150
|
+
if (!root) return { build: false, dsTheme: false };
|
|
151
|
+
if (!tailwindBuildCache.has(root)) {
|
|
152
|
+
const styles = stylesheetsText(path.join(root, "src"));
|
|
153
|
+
tailwindBuildCache.set(root, {
|
|
154
|
+
build: TAILWIND_ENTRY.test(styles) && pluginRegistered(root),
|
|
155
|
+
dsTheme: DS_THEME_IMPORT.test(styles),
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return tailwindBuildCache.get(root);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// The stylesheet the app actually ships: the DS installed for the app owning
|
|
162
|
+
// `file` (resolution walks up, so hoisted monorepo installs are found), else
|
|
163
|
+
// this package's own build. Comparing against a different DS version than
|
|
164
|
+
// the app's would report classes that version does or doesn't ship.
|
|
165
|
+
function appStylesheet(file) {
|
|
166
|
+
const root = nearestPackageRoot(file);
|
|
167
|
+
if (!root) return OWN_STYLESHEET;
|
|
168
|
+
if (!stylesheetCache.has(root)) {
|
|
169
|
+
let resolved = OWN_STYLESHEET;
|
|
170
|
+
try {
|
|
171
|
+
resolved = createRequire(path.join(root, "package.json")).resolve(
|
|
172
|
+
"@camunda/design-system/styles.css",
|
|
173
|
+
);
|
|
174
|
+
} catch {
|
|
175
|
+
// DS not installed for this app — keep the fallback.
|
|
176
|
+
}
|
|
177
|
+
stylesheetCache.set(root, resolved);
|
|
178
|
+
}
|
|
179
|
+
return stylesheetCache.get(root);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function isDsTokenUtility(token, colorTokens) {
|
|
183
|
+
const base = token.replace(/^!/, "").split(":").pop();
|
|
184
|
+
const color = base.match(COLOR_UTILITY);
|
|
185
|
+
return Boolean(color && colorTokens.has(color[1]));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function isUtilityShaped(token, colorTokens) {
|
|
189
|
+
const base = token.replace(/^!/, "").split(":").pop();
|
|
190
|
+
if (token.includes("[") || token.includes(":") || UTILITY_ROOT.test(base)) {
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
return isDsTokenUtility(token, colorTokens);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export default {
|
|
197
|
+
meta: {
|
|
198
|
+
type: "problem",
|
|
199
|
+
docs: {
|
|
200
|
+
description:
|
|
201
|
+
"Disallow Tailwind utilities that nothing compiles: ones the precompiled DS stylesheet does not ship in apps without their own Tailwind build, and DS token utilities in Tailwind builds without the DS theme.",
|
|
202
|
+
heuristic: true,
|
|
203
|
+
},
|
|
204
|
+
messages: {
|
|
205
|
+
uncompiled:
|
|
206
|
+
"`{{name}}` is not in the DS stylesheet and this app has no Tailwind build, so it renders no CSS. Use your own CSS with DS token variables (`var(--border)`), or add a Tailwind build with `@camunda/design-system/theme.css`.",
|
|
207
|
+
noTheme:
|
|
208
|
+
"`{{name}}` names a DS token, but this app's Tailwind build does not import `@camunda/design-system/theme.css`, so it renders no CSS unless the DS stylesheet ships it. Import the theme in your Tailwind stylesheet.",
|
|
209
|
+
},
|
|
210
|
+
schema: [
|
|
211
|
+
{
|
|
212
|
+
type: "object",
|
|
213
|
+
properties: {
|
|
214
|
+
stylesheet: { type: "string" },
|
|
215
|
+
tailwindBuild: { type: "boolean" },
|
|
216
|
+
dsTheme: { type: "boolean" },
|
|
217
|
+
},
|
|
218
|
+
additionalProperties: false,
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
create(context) {
|
|
223
|
+
const options = context.options[0] ?? {};
|
|
224
|
+
const detected =
|
|
225
|
+
options.tailwindBuild === undefined || options.dsTheme === undefined
|
|
226
|
+
? appTailwind(context.filename)
|
|
227
|
+
: null;
|
|
228
|
+
const tailwindBuild = options.tailwindBuild ?? detected.build;
|
|
229
|
+
const dsTheme = options.dsTheme ?? detected.dsTheme;
|
|
230
|
+
if (tailwindBuild && dsTheme) return {};
|
|
231
|
+
const shipped = shippedClasses(
|
|
232
|
+
options.stylesheet ?? appStylesheet(context.filename),
|
|
233
|
+
);
|
|
234
|
+
if (!shipped) return {};
|
|
235
|
+
// A Tailwind build compiles any utility except DS token ones, which need
|
|
236
|
+
// the theme; without a build, only what the DS stylesheet ships exists.
|
|
237
|
+
const shouldCheck = tailwindBuild
|
|
238
|
+
? (name) => isDsTokenUtility(name, shipped.colorTokens)
|
|
239
|
+
: (name) => isUtilityShaped(name, shipped.colorTokens);
|
|
240
|
+
const messageId = tailwindBuild ? "noTheme" : "uncompiled";
|
|
241
|
+
return {
|
|
242
|
+
JSXAttribute(node) {
|
|
243
|
+
if (node.name.name !== "className") return;
|
|
244
|
+
const raw = classLiteral(node.value);
|
|
245
|
+
if (!raw) return;
|
|
246
|
+
for (const name of raw.split(/\s+/).filter(Boolean)) {
|
|
247
|
+
if (shouldCheck(name) && !shipped.classes.has(name)) {
|
|
248
|
+
context.report({ node, messageId, data: { name } });
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.71.0",
|
|
4
4
|
"description": "Camunda's AI-first design system. shadcn + Tailwind components, design tokens aligned to Camunda's identity, and AI tooling for component authoring + migration.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"types": "./eslint-plugin/index.d.ts",
|
|
34
34
|
"import": "./eslint-plugin/index.js"
|
|
35
35
|
},
|
|
36
|
-
"./styles.css": "./dist/styles.css"
|
|
36
|
+
"./styles.css": "./dist/styles.css",
|
|
37
|
+
"./theme.css": "./dist/theme.css"
|
|
37
38
|
},
|
|
38
39
|
"typesVersions": {
|
|
39
40
|
"*": {
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
},
|
|
68
69
|
"scripts": {
|
|
69
70
|
"build": "tsc -p tsconfig.app.json && tsc-alias -p tsconfig.app.json && npm run build:css && npm run build:fonts",
|
|
70
|
-
"build:css": "tailwindcss -i src/index.css -o dist/styles.css && npm run check:css",
|
|
71
|
+
"build:css": "tailwindcss -i src/index.css -o dist/styles.css && cp src/theme.css dist/theme.css && npm run check:css",
|
|
71
72
|
"check:css": "test -f dist/styles.css || { echo 'ERROR: dist/styles.css not found — run npm run build:css first'; exit 1; }; if grep -n '«' dist/styles.css; then echo 'ERROR: dist/styles.css contains unresolved Tailwind placeholder tokens (see issue #580)'; exit 1; fi",
|
|
72
73
|
"build:fonts": "node scripts/build-fonts.mjs",
|
|
73
74
|
"dev": "tsc -p tsconfig.app.json --watch",
|
|
@@ -87,7 +88,8 @@
|
|
|
87
88
|
"audit:conventions": "node scripts/audit-conventions.mjs",
|
|
88
89
|
"mapping:build": "bash skills/migrate/scripts/build-mapping.sh",
|
|
89
90
|
"mapping:check": "bash skills/migrate/scripts/build-mapping.sh --check",
|
|
90
|
-
"test:rules": "node eslint-rules/no-adhoc-typography.test.mjs && node eslint-rules/no-primitive-tailwind-colors.test.mjs && node eslint-rules/no-raw-color-in-classname.test.mjs && node eslint-rules/require-shared-sidebar-provider.test.mjs && node eslint-rules/no-hardcoded-user-facing-string.test.mjs && node eslint-rules/no-direct-lucide-import.test.mjs && node eslint-rules/no-deep-import.test.mjs && node eslint-rules/button-has-type.test.mjs && node eslint-rules/icon-button-needs-label.test.mjs && node eslint-rules/prefer-link-props.test.mjs && node eslint-rules/require-browsable-link.test.mjs && node eslint-rules/no-hardcoded-i18n-prop.test.mjs && node --test eslint-plugin/index.test.mjs src/icons/registry.integrity.test.mjs src/icons/carbon-lucide-mapping.integrity.test.mjs src/lib/trigger-ref.integrity.test.mjs src/lib/i18n/dictionary.test.mjs src/lib/i18n/dictionary-usage.test.mjs src/lib/i18n/context.test.mjs scripts/package-exports.integrity.test.mjs scripts/plugin-check-version.test.mjs .storybook/a11y-run-args.test.mjs",
|
|
91
|
+
"test:rules": "node eslint-rules/no-adhoc-typography.test.mjs && node eslint-rules/no-bare-var-arbitrary.test.mjs && node eslint-rules/no-primitive-tailwind-colors.test.mjs && node eslint-rules/no-raw-color-in-classname.test.mjs && node eslint-rules/require-shared-sidebar-provider.test.mjs && node eslint-rules/no-hardcoded-user-facing-string.test.mjs && node eslint-rules/no-direct-lucide-import.test.mjs && node eslint-rules/no-deep-import.test.mjs && node eslint-rules/button-has-type.test.mjs && node eslint-rules/icon-button-needs-label.test.mjs && node eslint-rules/prefer-link-props.test.mjs && node eslint-rules/require-browsable-link.test.mjs && node eslint-rules/no-hardcoded-i18n-prop.test.mjs && node eslint-rules/no-uncompiled-utility.test.mjs && node --test eslint-plugin/index.test.mjs src/icons/registry.integrity.test.mjs src/icons/carbon-lucide-mapping.integrity.test.mjs src/lib/trigger-ref.integrity.test.mjs src/lib/i18n/dictionary.test.mjs src/lib/i18n/dictionary-usage.test.mjs src/lib/i18n/context.test.mjs scripts/package-exports.integrity.test.mjs scripts/json-import-attributes.integrity.test.mjs scripts/plugin-check-version.test.mjs .storybook/a11y-run-args.test.mjs",
|
|
92
|
+
"test:skills": "bash skills/migrate/scripts/test/consumer-setup.test.sh && bash skills/migrate/scripts/test/bulk-verify-done.test.sh && bash skills/migrate/scripts/test/visual-capture.test.sh",
|
|
91
93
|
"test:hooks": "python3 plugins/camunda-design-system/scripts/route-request.test.py",
|
|
92
94
|
"prepare": "husky",
|
|
93
95
|
"release": "changeset publish",
|