@camunda/design-system 0.69.0 → 0.70.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 CHANGED
@@ -70,6 +70,8 @@ export function Example() {
70
70
 
71
71
  `<C4Provider>` establishes the `.c4-ui` CSS scope that design tokens and Tailwind preflight require. Place it at your app root — as high up as possible.
72
72
 
73
+ No Tailwind setup is needed: `styles.css` is precompiled. It ships only the utility classes the DS components use, so a class like `w-92` in your own code renders nothing unless your app runs its own Tailwind build. For what each setup step does, when it is safe to skip, and how to add Tailwind with the DS theme (`@camunda/design-system/theme.css`), see [Consumer setup](https://camunda.github.io/design-system/?path=/docs/consumer-setup--docs).
74
+
73
75
  ### What's included
74
76
 
75
77
  **Components** (`src/components/ui/`) — 28 shadcn/Radix UI primitives (Button, Input, Dialog, DataTable, TreeView, ComboBox, and more), each with:
@@ -8,6 +8,8 @@ type SpinnerIconProps = Omit<React.ComponentProps<"svg">, "ref" | "role" | "aria
8
8
  * Decorative spinning icon (always `aria-hidden`, no role). Use it inside elements
9
9
  * that already convey the busy state (aria-busy buttons/rows, status regions, toast
10
10
  * icon slots); use `Spinner` when the icon is the only loading signal.
11
+ * Next to text, prefer `Spinner` with `label`; otherwise put the icon and the text in a
12
+ * `flex items-center` row (the svg is block-level, so it breaks inline text).
11
13
  * Pass `size={null}` to emit no size class so a parent's svg sizing applies.
12
14
  */
13
15
  declare function SpinnerIcon({ size, className, ...props }: SpinnerIconProps): React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAMlE,QAAA,MAAM,eAAe;;8EAWnB,CAAC;AAEH,KAAK,gBAAgB,GAAG,IAAI,CAC1B,KAAK,CAAC,cAAc,CA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WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,qBASnE;AAED,KAAK,YAAY,GAAG,IAAI,CACtB,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAC5B,KAAK,GAAG,MAAM,GAAG,UAAU,CAC5B,GAAG;IACF,IAAI,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACjE,oFAAoF;IACpF,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,gHAAgH;IAChH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,iBAAS,OAAO,CAAC,EACf,SAAS,EACT,IAAI,EACJ,KAAK,EACL,eAAe,EACf,GAAG,KAAK,EACT,EAAE,YAAY,qBAsBd;AAED,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
@@ -20,6 +20,8 @@ const spinnerVariants = cva("shrink-0 motion-safe:animate-spin", {
20
20
  * Decorative spinning icon (always `aria-hidden`, no role). Use it inside elements
21
21
  * that already convey the busy state (aria-busy buttons/rows, status regions, toast
22
22
  * icon slots); use `Spinner` when the icon is the only loading signal.
23
+ * Next to text, prefer `Spinner` with `label`; otherwise put the icon and the text in a
24
+ * `flex items-center` row (the svg is block-level, so it breaks inline text).
23
25
  * Pass `size={null}` to emit no size class so a parent's svg sizing applies.
24
26
  */
25
27
  function SpinnerIcon({ size, className, ...props }) {
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/ui/spinner.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,c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C;IAE3E,OAAO,CACL,6BACY,SAAS,KACf,KAAK,EACT,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE,SAAS,CAAC,aAE1D,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,GAAI,EAC1B,QAAQ,CAAC,CAAC,CAAC,CACV,eAAM,SAAS,EAAC,wBAAwB,YAAE,KAAK,GAAQ,CACxD,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,SAAS,YACtB,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,iBAAiB,CAAC,GAC3C,CACR,IACI,CACR,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
package/dist/styles.css CHANGED
@@ -129,7 +129,9 @@
129
129
  --default-font-family: "Geist Sans", sans-serif;
130
130
  --default-mono-font-family: "IBM Plex Mono", ui-monospace, "Cascadia Code", monospace;
131
131
  --font-heading: var(--font-sans);
132
+ --color-border: var(--border);
132
133
  --color-input: var(--input);
134
+ --color-danger-action-default: var(--danger-action-default);
133
135
  }
134
136
  .\@container\/card-header {
135
137
  container-type: inline-size;
@@ -195,6 +197,9 @@
195
197
  .top-0 {
196
198
  top: 0px;
197
199
  }
200
+ .top-0\.5 {
201
+ top: calc(var(--spacing) * 0.5);
202
+ }
198
203
  .top-1 {
199
204
  top: var(--spacing);
200
205
  }
@@ -887,6 +892,12 @@
887
892
  .w-80 {
888
893
  width: calc(var(--spacing) * 80);
889
894
  }
895
+ .w-92 {
896
+ width: calc(var(--spacing) * 92);
897
+ }
898
+ .w-93 {
899
+ width: calc(var(--spacing) * 93);
900
+ }
890
901
  .w-96 {
891
902
  width: calc(var(--spacing) * 96);
892
903
  }
@@ -1160,6 +1171,12 @@
1160
1171
  .grid-cols-\[\.\.\.\] {
1161
1172
  grid-template-columns: ...;
1162
1173
  }
1174
+ .grid-cols-\[1fr_auto\] {
1175
+ grid-template-columns: 1fr auto;
1176
+ }
1177
+ .grid-cols-\[3fr_1fr\] {
1178
+ grid-template-columns: 3fr 1fr;
1179
+ }
1163
1180
  .grid-cols-\[auto_1fr_auto\] {
1164
1181
  grid-template-columns: auto 1fr auto;
1165
1182
  }
@@ -1262,6 +1279,9 @@
1262
1279
  .gap-\[0\.3125rem\] {
1263
1280
  gap: 0.3125rem;
1264
1281
  }
1282
+ .gap-\[13px\] {
1283
+ gap: 13px;
1284
+ }
1265
1285
  :where(.space-y-1 > :not(:last-child)) {
1266
1286
  --tw-space-y-reverse: 0;
1267
1287
  margin-block-start: calc(var(--spacing) * var(--tw-space-y-reverse));
@@ -1461,6 +1481,9 @@
1461
1481
  .border-\(--color-border-tooltip\) {
1462
1482
  border-color: var(--color-border-tooltip);
1463
1483
  }
1484
+ .border-accent-action-default {
1485
+ border-color: var(--accent-action-default);
1486
+ }
1464
1487
  .border-accent-border-strong {
1465
1488
  border-color: var(--accent-border-strong);
1466
1489
  }
@@ -2058,6 +2081,9 @@
2058
2081
  .text-current {
2059
2082
  color: currentcolor;
2060
2083
  }
2084
+ .text-danger-action-default {
2085
+ color: var(--danger-action-default);
2086
+ }
2061
2087
  .text-danger-action-foreground {
2062
2088
  color: var(--danger-action-foreground);
2063
2089
  }
@@ -3145,6 +3171,9 @@
3145
3171
  }
3146
3172
  }
3147
3173
  @media (width >= 48rem) {
3174
+ .md\:flex {
3175
+ display: flex;
3176
+ }
3148
3177
  .md\:grid-cols-5 {
3149
3178
  grid-template-columns: repeat(5, minmax(0, 1fr));
3150
3179
  }
@@ -3166,6 +3195,9 @@
3166
3195
  }
3167
3196
  }
3168
3197
  @media (width >= 64rem) {
3198
+ .lg\:flex {
3199
+ display: flex;
3200
+ }
3169
3201
  .lg\:inline {
3170
3202
  display: inline;
3171
3203
  }
package/dist/theme.css ADDED
@@ -0,0 +1,175 @@
1
+ /*
2
+ * @camunda/design-system Tailwind theme — published as
3
+ * `@camunda/design-system/theme.css`.
4
+ *
5
+ * Maps the DS design tokens onto Tailwind's theme namespaces (colors,
6
+ * fonts, radius, elevation, breakpoints) plus the `dark` variant. The DS's
7
+ * own stylesheet imports it from `index.css`; a consumer that runs its own
8
+ * Tailwind build imports it too, so utilities written in the consumer's
9
+ * code (`bg-primary-action-default`, `rounded-md`, `shadow-sm`, …) resolve
10
+ * to DS tokens instead of Tailwind's stock values.
11
+ *
12
+ * Declarations only: no utilities, no preflight, no token values. The
13
+ * values live on `.c4-ui` in `index.css` (shipped in `styles.css`), so
14
+ * these utilities resolve only inside `<C4Provider>`.
15
+ */
16
+
17
+ @custom-variant dark (&:is(.dark *));
18
+
19
+ @theme inline {
20
+ --font-heading: var(--font-sans);
21
+ --font-sans: "Geist Sans", sans-serif;
22
+ --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", monospace;
23
+
24
+ /* Surface */
25
+ --color-background: var(--background);
26
+ --color-foreground: var(--foreground);
27
+ --color-border: var(--border);
28
+ --color-ring: var(--ring);
29
+
30
+ --color-popover: var(--popover);
31
+ --color-popover-foreground: var(--popover-foreground);
32
+ --color-input: var(--input);
33
+ --color-input-background: var(--input-background);
34
+ --color-switch-background: var(--switch-background);
35
+
36
+ /* Neutral */
37
+ --color-neutral-action-default: var(--neutral-action-default);
38
+ --color-neutral-action-hover: var(--neutral-action-hover);
39
+ --color-neutral-action-active: var(--neutral-action-active);
40
+ --color-neutral-action-disabled: var(--neutral-action-disabled);
41
+ --color-neutral-action-foreground: var(--neutral-action-foreground);
42
+ --color-neutral-background-subtle: var(--neutral-background-subtle);
43
+ --color-neutral-background-medium: var(--neutral-background-medium);
44
+ --color-neutral-background-strong: var(--neutral-background-strong);
45
+ --color-neutral-foreground-subtle: var(--neutral-foreground-subtle);
46
+ --color-neutral-foreground-strong: var(--neutral-foreground-strong);
47
+ --color-neutral-border-subtle: var(--neutral-border-subtle);
48
+ --color-neutral-border-strong: var(--neutral-border-strong);
49
+
50
+ /* Primary — full action-state scale */
51
+ --color-primary-action-default: var(--primary-action-default);
52
+ --color-primary-action-hover: var(--primary-action-hover);
53
+ --color-primary-action-active: var(--primary-action-active);
54
+ --color-primary-action-disabled: var(--primary-action-disabled);
55
+ --color-primary-action-foreground: var(--primary-action-foreground);
56
+ --color-primary-background-subtle: var(--primary-background-subtle);
57
+ --color-primary-background-strong: var(--primary-background-strong);
58
+ --color-primary-foreground-subtle: var(--primary-foreground-subtle);
59
+ --color-primary-foreground-strong: var(--primary-foreground-strong);
60
+ --color-primary-border-subtle: var(--primary-border-subtle);
61
+ --color-primary-border-strong: var(--primary-border-strong);
62
+
63
+ /* Accent */
64
+ --color-accent-action-default: var(--accent-action-default);
65
+ --color-accent-action-hover: var(--accent-action-hover);
66
+ --color-accent-action-active: var(--accent-action-active);
67
+ --color-accent-action-disabled: var(--accent-action-disabled);
68
+ --color-accent-action-foreground: var(--accent-action-foreground);
69
+ --color-accent-background-subtle: var(--accent-background-subtle);
70
+ --color-accent-background-strong: var(--accent-background-strong);
71
+ --color-accent-foreground-subtle: var(--accent-foreground-subtle);
72
+ --color-accent-foreground-strong: var(--accent-foreground-strong);
73
+ --color-accent-border-subtle: var(--accent-border-subtle);
74
+ --color-accent-border-strong: var(--accent-border-strong);
75
+
76
+ /* Warning */
77
+ --color-warning-action-default: var(--warning-action-default);
78
+ --color-warning-action-hover: var(--warning-action-hover);
79
+ --color-warning-action-active: var(--warning-action-active);
80
+ --color-warning-action-disabled: var(--warning-action-disabled);
81
+ --color-warning-action-foreground: var(--warning-action-foreground);
82
+ --color-warning-background-subtle: var(--warning-background-subtle);
83
+ --color-warning-background-strong: var(--warning-background-strong);
84
+ --color-warning-foreground-subtle: var(--warning-foreground-subtle);
85
+ --color-warning-foreground-strong: var(--warning-foreground-strong);
86
+ --color-warning-border-subtle: var(--warning-border-subtle);
87
+ --color-warning-border-strong: var(--warning-border-strong);
88
+
89
+ /* Danger */
90
+ --color-danger-action-default: var(--danger-action-default);
91
+ --color-danger-action-hover: var(--danger-action-hover);
92
+ --color-danger-action-active: var(--danger-action-active);
93
+ --color-danger-action-disabled: var(--danger-action-disabled);
94
+ --color-danger-action-foreground: var(--danger-action-foreground);
95
+ --color-danger-background-subtle: var(--danger-background-subtle);
96
+ --color-danger-background-strong: var(--danger-background-strong);
97
+ --color-danger-foreground-subtle: var(--danger-foreground-subtle);
98
+ --color-danger-foreground-strong: var(--danger-foreground-strong);
99
+ --color-danger-border-subtle: var(--danger-border-subtle);
100
+ --color-danger-border-strong: var(--danger-border-strong);
101
+
102
+ /* Success */
103
+ --color-success-action-default: var(--success-action-default);
104
+ --color-success-action-hover: var(--success-action-hover);
105
+ --color-success-action-active: var(--success-action-active);
106
+ --color-success-action-disabled: var(--success-action-disabled);
107
+ --color-success-action-foreground: var(--success-action-foreground);
108
+ --color-success-background-subtle: var(--success-background-subtle);
109
+ --color-success-background-strong: var(--success-background-strong);
110
+ --color-success-foreground-subtle: var(--success-foreground-subtle);
111
+ --color-success-foreground-strong: var(--success-foreground-strong);
112
+ --color-success-border-subtle: var(--success-border-subtle);
113
+ --color-success-border-strong: var(--success-border-strong);
114
+
115
+ /* Info */
116
+ --color-info-action-default: var(--info-action-default);
117
+ --color-info-action-hover: var(--info-action-hover);
118
+ --color-info-action-active: var(--info-action-active);
119
+ --color-info-action-disabled: var(--info-action-disabled);
120
+ --color-info-action-foreground: var(--info-action-foreground);
121
+ --color-info-background-subtle: var(--info-background-subtle);
122
+ --color-info-background-strong: var(--info-background-strong);
123
+ --color-info-foreground-subtle: var(--info-foreground-subtle);
124
+ --color-info-foreground-strong: var(--info-foreground-strong);
125
+ --color-info-border-subtle: var(--info-border-subtle);
126
+ --color-info-border-strong: var(--info-border-strong);
127
+
128
+ /* Charts */
129
+ --color-chart-sky: var(--chart-sky);
130
+ --color-chart-teal: var(--chart-teal);
131
+ --color-chart-orange: var(--chart-orange);
132
+ --color-chart-purple: var(--chart-purple);
133
+ --color-chart-pink: var(--chart-pink);
134
+ --color-chart-blue: var(--chart-blue);
135
+ --color-chart-cyan: var(--chart-cyan);
136
+ --color-chart-fuchsia: var(--chart-fuchsia);
137
+ --color-chart-lime: var(--chart-lime);
138
+ --color-chart-indigo: var(--chart-indigo);
139
+
140
+ /* Overlay */
141
+ --color-overlay: var(--overlay);
142
+
143
+ /* Border radius */
144
+ --radius-sm: calc(var(--radius) - 4px);
145
+ --radius-md: calc(var(--radius) - 2px);
146
+ --radius-lg: var(--radius);
147
+ --radius-xl: calc(var(--radius) + 4px);
148
+
149
+ /* Elevation — aliased, not declared, so the `shadow-*` utilities emit
150
+ `var(--elevation-*)` instead of a build-time literal. Declaring
151
+ `--shadow-*` inside `.c4-ui` does NOT reach the utilities: Tailwind
152
+ resolves theme values at build time, so the class keeps its stock
153
+ value and only explicit `shadow-[var(--shadow-*)]` call sites see the
154
+ override. Going through `@theme inline` is what makes
155
+ `.dark .c4-ui` able to retheme elevation. */
156
+ /* xs is not a step of its own; it resolves to sm so the class keeps
157
+ returning a DS value instead of Tailwind's stock shadow. */
158
+ --shadow-xs: var(--elevation-sm);
159
+ --shadow-sm: var(--elevation-sm);
160
+ --shadow-md: var(--elevation-md);
161
+ --shadow-lg: var(--elevation-lg);
162
+ --shadow-xl: var(--elevation-xl);
163
+ }
164
+
165
+ /* Breakpoints — single source of truth for CSS responsive variants AND the
166
+ JS useMediaQuery/useIsMobile hooks. NON-inline so Tailwind emits them as
167
+ runtime :root CSS variables (the hook reads --breakpoint-md via
168
+ getComputedStyle). Values equal Tailwind's defaults — declared here so they
169
+ are owned and rethemable, not implicit. */
170
+ @theme {
171
+ --breakpoint-sm: 40rem;
172
+ --breakpoint-md: 48rem; /* 768px — mobile/desktop navigation boundary */
173
+ --breakpoint-lg: 64rem;
174
+ --breakpoint-xl: 80rem;
175
+ }
@@ -7,6 +7,7 @@ export declare const rules: Record<string, Rule.RuleModule>;
7
7
  export declare const configs: {
8
8
  recommended: Linter.Config;
9
9
  tailwind: Linter.Config;
10
+ utilities: Linter.Config;
10
11
  all: Linter.Config;
11
12
  };
12
13
 
@@ -17,6 +17,7 @@ import { consumerNoDirectLucideImport } from "../eslint-rules/no-direct-lucide-i
17
17
  import noHardcodedI18nProp from "../eslint-rules/no-hardcoded-i18n-prop.js";
18
18
  import noPrimitiveTailwindColors from "../eslint-rules/no-primitive-tailwind-colors.js";
19
19
  import noRawColorInClassName from "../eslint-rules/no-raw-color-in-classname.js";
20
+ import noUncompiledUtility from "../eslint-rules/no-uncompiled-utility.js";
20
21
  import preferLinkProps from "../eslint-rules/prefer-link-props.js";
21
22
  import requireBrowsableLink from "../eslint-rules/require-browsable-link.js";
22
23
  import requireSharedSidebarProvider from "../eslint-rules/require-shared-sidebar-provider.js";
@@ -48,6 +49,7 @@ const rules = {
48
49
  "Raw hex/rgb in className forbidden. Use a DS semantic token utility (see the Design tokens page in the DS Storybook).",
49
50
  }),
50
51
  "no-adhoc-typography": noAdhocTypography,
52
+ "no-uncompiled-utility": noUncompiledUtility,
51
53
  };
52
54
 
53
55
  const plugin = {
@@ -79,6 +81,14 @@ const tailwindRules = {
79
81
  [`${PLUGIN_NAME}/no-adhoc-typography`]: "error",
80
82
  };
81
83
 
84
+ // Utility classes that nothing compiles. Opt-in, and deliberately outside
85
+ // `all`: enabling it in an existing preset would add warnings on upgrade, and
86
+ // consumers linting with --max-warnings 0 would go red. The agent audit gate
87
+ // enables it explicitly.
88
+ const utilitiesRules = {
89
+ [`${PLUGIN_NAME}/no-uncompiled-utility`]: "warn",
90
+ };
91
+
82
92
  Object.assign(plugin.configs, {
83
93
  recommended: {
84
94
  name: `${PLUGIN_NAME}/recommended`,
@@ -90,6 +100,11 @@ Object.assign(plugin.configs, {
90
100
  plugins: { [PLUGIN_NAME]: plugin },
91
101
  rules: tailwindRules,
92
102
  },
103
+ utilities: {
104
+ name: `${PLUGIN_NAME}/utilities`,
105
+ plugins: { [PLUGIN_NAME]: plugin },
106
+ rules: utilitiesRules,
107
+ },
93
108
  all: {
94
109
  name: `${PLUGIN_NAME}/all`,
95
110
  plugins: { [PLUGIN_NAME]: plugin },
@@ -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.69.0",
3
+ "version": "0.70.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-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/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",