@camunda/design-system 0.70.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/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.js +1 -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 +96 -39
- package/eslint-plugin/index.js +5 -1
- package/eslint-rules/index.js +2 -0
- package/eslint-rules/no-bare-var-arbitrary.js +110 -0
- package/package.json +2 -2
package/dist/styles.css
CHANGED
|
@@ -212,15 +212,15 @@
|
|
|
212
212
|
.top-2 {
|
|
213
213
|
top: calc(var(--spacing) * 2);
|
|
214
214
|
}
|
|
215
|
+
.top-2\.5 {
|
|
216
|
+
top: calc(var(--spacing) * 2.5);
|
|
217
|
+
}
|
|
215
218
|
.top-4 {
|
|
216
219
|
top: calc(var(--spacing) * 4);
|
|
217
220
|
}
|
|
218
221
|
.top-12 {
|
|
219
222
|
top: calc(var(--spacing) * 12);
|
|
220
223
|
}
|
|
221
|
-
.top-\[10px\] {
|
|
222
|
-
top: 10px;
|
|
223
|
-
}
|
|
224
224
|
.-right-0\.5 {
|
|
225
225
|
right: calc(var(--spacing) * -0.5);
|
|
226
226
|
}
|
|
@@ -392,9 +392,15 @@
|
|
|
392
392
|
.my-5 {
|
|
393
393
|
margin-block: calc(var(--spacing) * 5);
|
|
394
394
|
}
|
|
395
|
+
.-mt-\(--z\) {
|
|
396
|
+
margin-top: calc(var(--z) * -1);
|
|
397
|
+
}
|
|
395
398
|
.-mt-1 {
|
|
396
399
|
margin-top: calc(var(--spacing) * -1);
|
|
397
400
|
}
|
|
401
|
+
.-mt-\[--z\] {
|
|
402
|
+
margin-top: calc(--z * -1);
|
|
403
|
+
}
|
|
398
404
|
.mt-0\.5 {
|
|
399
405
|
margin-top: calc(var(--spacing) * 0.5);
|
|
400
406
|
}
|
|
@@ -631,6 +637,9 @@
|
|
|
631
637
|
.h-\(--radix-select-trigger-height\) {
|
|
632
638
|
height: var(--radix-select-trigger-height);
|
|
633
639
|
}
|
|
640
|
+
.h-\(--y\) {
|
|
641
|
+
height: var(--y);
|
|
642
|
+
}
|
|
634
643
|
.h-1 {
|
|
635
644
|
height: var(--spacing);
|
|
636
645
|
}
|
|
@@ -694,6 +703,12 @@
|
|
|
694
703
|
.h-64 {
|
|
695
704
|
height: calc(var(--spacing) * 64);
|
|
696
705
|
}
|
|
706
|
+
.h-\[--radix-select-trigger-height\] {
|
|
707
|
+
height: --radix-select-trigger-height;
|
|
708
|
+
}
|
|
709
|
+
.h-\[--y\] {
|
|
710
|
+
height: --y;
|
|
711
|
+
}
|
|
697
712
|
.h-\[36rem\] {
|
|
698
713
|
height: 36rem;
|
|
699
714
|
}
|
|
@@ -769,21 +784,21 @@
|
|
|
769
784
|
.min-h-16 {
|
|
770
785
|
min-height: calc(var(--spacing) * 16);
|
|
771
786
|
}
|
|
787
|
+
.min-h-20 {
|
|
788
|
+
min-height: calc(var(--spacing) * 20);
|
|
789
|
+
}
|
|
772
790
|
.min-h-24 {
|
|
773
791
|
min-height: calc(var(--spacing) * 24);
|
|
774
792
|
}
|
|
793
|
+
.min-h-30 {
|
|
794
|
+
min-height: calc(var(--spacing) * 30);
|
|
795
|
+
}
|
|
775
796
|
.min-h-32 {
|
|
776
797
|
min-height: calc(var(--spacing) * 32);
|
|
777
798
|
}
|
|
778
799
|
.min-h-40 {
|
|
779
800
|
min-height: calc(var(--spacing) * 40);
|
|
780
801
|
}
|
|
781
|
-
.min-h-\[80px\] {
|
|
782
|
-
min-height: 80px;
|
|
783
|
-
}
|
|
784
|
-
.min-h-\[120px\] {
|
|
785
|
-
min-height: 120px;
|
|
786
|
-
}
|
|
787
802
|
.min-h-\[280px\] {
|
|
788
803
|
min-height: 280px;
|
|
789
804
|
}
|
|
@@ -799,6 +814,18 @@
|
|
|
799
814
|
.min-h-screen {
|
|
800
815
|
min-height: 100vh;
|
|
801
816
|
}
|
|
817
|
+
.\!w-\(--y\) {
|
|
818
|
+
width: var(--y) !important;
|
|
819
|
+
}
|
|
820
|
+
.\!w-\[--y\] {
|
|
821
|
+
width: --y !important;
|
|
822
|
+
}
|
|
823
|
+
.w-\(--radix-popover-trigger-width\) {
|
|
824
|
+
width: var(--radix-popover-trigger-width);
|
|
825
|
+
}
|
|
826
|
+
.w-\(--x\) {
|
|
827
|
+
width: var(--x);
|
|
828
|
+
}
|
|
802
829
|
.w-0 {
|
|
803
830
|
width: 0px;
|
|
804
831
|
}
|
|
@@ -904,6 +931,9 @@
|
|
|
904
931
|
.w-\[--radix-popover-trigger-width\] {
|
|
905
932
|
width: --radix-popover-trigger-width;
|
|
906
933
|
}
|
|
934
|
+
.w-\[--x\] {
|
|
935
|
+
width: --x;
|
|
936
|
+
}
|
|
907
937
|
.w-\[50px\] {
|
|
908
938
|
width: 50px;
|
|
909
939
|
}
|
|
@@ -940,14 +970,14 @@
|
|
|
940
970
|
.max-w-48 {
|
|
941
971
|
max-width: calc(var(--spacing) * 48);
|
|
942
972
|
}
|
|
943
|
-
.max-w
|
|
944
|
-
max-width:
|
|
973
|
+
.max-w-50 {
|
|
974
|
+
max-width: calc(var(--spacing) * 50);
|
|
945
975
|
}
|
|
946
|
-
.max-w
|
|
947
|
-
max-width:
|
|
976
|
+
.max-w-396 {
|
|
977
|
+
max-width: calc(var(--spacing) * 396);
|
|
948
978
|
}
|
|
949
|
-
.max-w-\[
|
|
950
|
-
max-width:
|
|
979
|
+
.max-w-\[26rem\] {
|
|
980
|
+
max-width: 26rem;
|
|
951
981
|
}
|
|
952
982
|
.max-w-\[calc\(100\%-2rem\)\] {
|
|
953
983
|
max-width: calc(100% - 2rem);
|
|
@@ -1000,8 +1030,11 @@
|
|
|
1000
1030
|
.min-w-48 {
|
|
1001
1031
|
min-width: calc(var(--spacing) * 48);
|
|
1002
1032
|
}
|
|
1003
|
-
.min-w
|
|
1004
|
-
min-width:
|
|
1033
|
+
.min-w-105 {
|
|
1034
|
+
min-width: calc(var(--spacing) * 105);
|
|
1035
|
+
}
|
|
1036
|
+
.min-w-\[--radix-select-trigger-width\] {
|
|
1037
|
+
min-width: --radix-select-trigger-width;
|
|
1005
1038
|
}
|
|
1006
1039
|
.min-w-fit {
|
|
1007
1040
|
min-width: fit-content;
|
|
@@ -1375,12 +1408,6 @@
|
|
|
1375
1408
|
.rounded-4xl {
|
|
1376
1409
|
border-radius: var(--radius-4xl);
|
|
1377
1410
|
}
|
|
1378
|
-
.rounded-\[2px\] {
|
|
1379
|
-
border-radius: 2px;
|
|
1380
|
-
}
|
|
1381
|
-
.rounded-\[4px\] {
|
|
1382
|
-
border-radius: 4px;
|
|
1383
|
-
}
|
|
1384
1411
|
.rounded-\[inherit\] {
|
|
1385
1412
|
border-radius: inherit;
|
|
1386
1413
|
}
|
|
@@ -1402,6 +1429,9 @@
|
|
|
1402
1429
|
.rounded-xl {
|
|
1403
1430
|
border-radius: calc(var(--radius) + 4px);
|
|
1404
1431
|
}
|
|
1432
|
+
.rounded-xs {
|
|
1433
|
+
border-radius: var(--radius-xs);
|
|
1434
|
+
}
|
|
1405
1435
|
.rounded-t-xl {
|
|
1406
1436
|
border-top-left-radius: calc(var(--radius) + 4px);
|
|
1407
1437
|
border-top-right-radius: calc(var(--radius) + 4px);
|
|
@@ -1544,6 +1574,12 @@
|
|
|
1544
1574
|
.border-l-transparent {
|
|
1545
1575
|
border-left-color: transparent;
|
|
1546
1576
|
}
|
|
1577
|
+
.bg-\(--brand\)\/50 {
|
|
1578
|
+
background-color: var(--brand);
|
|
1579
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1580
|
+
background-color: color-mix(in oklab, var(--brand) 50%, transparent);
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1547
1583
|
.bg-\(--color-indicator-legend\) {
|
|
1548
1584
|
background-color: var(--color-indicator-legend);
|
|
1549
1585
|
}
|
|
@@ -1553,6 +1589,12 @@
|
|
|
1553
1589
|
.bg-\[\#ff0000\] {
|
|
1554
1590
|
background-color: #ff0000;
|
|
1555
1591
|
}
|
|
1592
|
+
.bg-\[\#fff\] {
|
|
1593
|
+
background-color: #fff;
|
|
1594
|
+
}
|
|
1595
|
+
.bg-\[--brand\]\/50 {
|
|
1596
|
+
background-color: color-mix(in oklab, --brand 50%, transparent);
|
|
1597
|
+
}
|
|
1556
1598
|
.bg-\[rgb\(255\,0\,0\)\] {
|
|
1557
1599
|
background-color: rgb(255,0,0);
|
|
1558
1600
|
}
|
|
@@ -1984,6 +2026,10 @@
|
|
|
1984
2026
|
--tw-leading: calc(var(--spacing) * 4);
|
|
1985
2027
|
line-height: calc(var(--spacing) * 4);
|
|
1986
2028
|
}
|
|
2029
|
+
.leading-4\.5 {
|
|
2030
|
+
--tw-leading: calc(var(--spacing) * 4.5);
|
|
2031
|
+
line-height: calc(var(--spacing) * 4.5);
|
|
2032
|
+
}
|
|
1987
2033
|
.leading-5 {
|
|
1988
2034
|
--tw-leading: calc(var(--spacing) * 5);
|
|
1989
2035
|
line-height: calc(var(--spacing) * 5);
|
|
@@ -2004,10 +2050,6 @@
|
|
|
2004
2050
|
--tw-leading: calc(var(--spacing) * 10);
|
|
2005
2051
|
line-height: calc(var(--spacing) * 10);
|
|
2006
2052
|
}
|
|
2007
|
-
.leading-\[18px\] {
|
|
2008
|
-
--tw-leading: 18px;
|
|
2009
|
-
line-height: 18px;
|
|
2010
|
-
}
|
|
2011
2053
|
.leading-\[22px\] {
|
|
2012
2054
|
--tw-leading: 22px;
|
|
2013
2055
|
line-height: 22px;
|
|
@@ -2379,6 +2421,12 @@
|
|
|
2379
2421
|
-webkit-user-select: none;
|
|
2380
2422
|
user-select: none;
|
|
2381
2423
|
}
|
|
2424
|
+
.\[--sidebar-width\:16rem\] {
|
|
2425
|
+
--sidebar-width: 16rem;
|
|
2426
|
+
}
|
|
2427
|
+
.\[--x\:1px\] {
|
|
2428
|
+
--x: 1px;
|
|
2429
|
+
}
|
|
2382
2430
|
.ring-inset {
|
|
2383
2431
|
--tw-ring-inset: inset;
|
|
2384
2432
|
}
|
|
@@ -2879,8 +2927,8 @@
|
|
|
2879
2927
|
.has-\[\>img\:first-child\]\:pt-0:has( > img:first-child) {
|
|
2880
2928
|
padding-top: 0px;
|
|
2881
2929
|
}
|
|
2882
|
-
.has-\[\~\[data-button\]\]\:top
|
|
2883
|
-
top:
|
|
2930
|
+
.has-\[\~\[data-button\]\]\:top-4\.5:has( ~ [data-button]) {
|
|
2931
|
+
top: calc(var(--spacing) * 4.5);
|
|
2884
2932
|
}
|
|
2885
2933
|
.aria-disabled\:pointer-events-none[aria-disabled="true"] {
|
|
2886
2934
|
pointer-events: none;
|
|
@@ -3055,6 +3103,9 @@
|
|
|
3055
3103
|
.data-\[state\=open\]\:bg-neutral-background-medium[data-state="open"] {
|
|
3056
3104
|
background-color: var(--neutral-background-medium);
|
|
3057
3105
|
}
|
|
3106
|
+
.data-\[state\=open\]\:p-2[data-state="open"] {
|
|
3107
|
+
padding: calc(var(--spacing) * 2);
|
|
3108
|
+
}
|
|
3058
3109
|
.data-\[state\=open\]\:text-accent-foreground-strong[data-state="open"] {
|
|
3059
3110
|
color: var(--accent-foreground-strong);
|
|
3060
3111
|
}
|
|
@@ -3130,17 +3181,17 @@
|
|
|
3130
3181
|
.sm\:max-w-2xl {
|
|
3131
3182
|
max-width: var(--container-2xl);
|
|
3132
3183
|
}
|
|
3133
|
-
.sm\:max-w
|
|
3134
|
-
max-width:
|
|
3184
|
+
.sm\:max-w-100 {
|
|
3185
|
+
max-width: calc(var(--spacing) * 100);
|
|
3135
3186
|
}
|
|
3136
|
-
.sm\:max-w
|
|
3137
|
-
max-width:
|
|
3187
|
+
.sm\:max-w-150 {
|
|
3188
|
+
max-width: calc(var(--spacing) * 150);
|
|
3138
3189
|
}
|
|
3139
|
-
.sm\:max-w
|
|
3140
|
-
max-width:
|
|
3190
|
+
.sm\:max-w-200 {
|
|
3191
|
+
max-width: calc(var(--spacing) * 200);
|
|
3141
3192
|
}
|
|
3142
|
-
.sm\:max-w-\[
|
|
3143
|
-
max-width:
|
|
3193
|
+
.sm\:max-w-\[90vw\] {
|
|
3194
|
+
max-width: 90vw;
|
|
3144
3195
|
}
|
|
3145
3196
|
.sm\:max-w-\[1234px\] {
|
|
3146
3197
|
max-width: 1234px;
|
|
@@ -3174,6 +3225,12 @@
|
|
|
3174
3225
|
.md\:flex {
|
|
3175
3226
|
display: flex;
|
|
3176
3227
|
}
|
|
3228
|
+
.md\:max-h-\(--x\) {
|
|
3229
|
+
max-height: var(--x);
|
|
3230
|
+
}
|
|
3231
|
+
.md\:max-h-\[--x\] {
|
|
3232
|
+
max-height: --x;
|
|
3233
|
+
}
|
|
3177
3234
|
.md\:grid-cols-5 {
|
|
3178
3235
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
3179
3236
|
}
|
|
@@ -3527,8 +3584,8 @@
|
|
|
3527
3584
|
.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]) {
|
|
3528
3585
|
padding-right: 0px;
|
|
3529
3586
|
}
|
|
3530
|
-
.\[\&\:has\(\~\[data-content\]_\[data-description\]\)\]\:top
|
|
3531
|
-
top:
|
|
3587
|
+
.\[\&\:has\(\~\[data-content\]_\[data-description\]\)\]\:top-3:has( ~ [data-content] [data-description]) {
|
|
3588
|
+
top: calc(var(--spacing) * 3);
|
|
3532
3589
|
}
|
|
3533
3590
|
.\[\&\:has\(\~\[data-content\]_\[data-description\]\)\]\:-mt-1:has( ~ [data-content] [data-description]) {
|
|
3534
3591
|
margin-top: calc(var(--spacing) * -1);
|
package/eslint-plugin/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { createRequire } from "node:module";
|
|
|
12
12
|
import buttonHasType from "../eslint-rules/button-has-type.js";
|
|
13
13
|
import iconButtonNeedsLabel from "../eslint-rules/icon-button-needs-label.js";
|
|
14
14
|
import noAdhocTypography from "../eslint-rules/no-adhoc-typography.js";
|
|
15
|
+
import noBareVarArbitrary from "../eslint-rules/no-bare-var-arbitrary.js";
|
|
15
16
|
import noDeepImport from "../eslint-rules/no-deep-import.js";
|
|
16
17
|
import { consumerNoDirectLucideImport } from "../eslint-rules/no-direct-lucide-import.js";
|
|
17
18
|
import noHardcodedI18nProp from "../eslint-rules/no-hardcoded-i18n-prop.js";
|
|
@@ -49,6 +50,7 @@ const rules = {
|
|
|
49
50
|
"Raw hex/rgb in className forbidden. Use a DS semantic token utility (see the Design tokens page in the DS Storybook).",
|
|
50
51
|
}),
|
|
51
52
|
"no-adhoc-typography": noAdhocTypography,
|
|
53
|
+
"no-bare-var-arbitrary": noBareVarArbitrary,
|
|
52
54
|
"no-uncompiled-utility": noUncompiledUtility,
|
|
53
55
|
};
|
|
54
56
|
|
|
@@ -74,11 +76,13 @@ const recommendedRules = {
|
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
// Styling conventions for repos that style with Tailwind utilities on top of
|
|
77
|
-
// the DS tokens: semantic color tokens only, Heading/Text for typography
|
|
79
|
+
// the DS tokens: semantic color tokens only, Heading/Text for typography, and
|
|
80
|
+
// no v3 `-[--var]` shorthand (autofixes inside className and class helpers).
|
|
78
81
|
const tailwindRules = {
|
|
79
82
|
[`${PLUGIN_NAME}/no-primitive-tailwind-colors`]: "error",
|
|
80
83
|
[`${PLUGIN_NAME}/no-raw-color-in-classname`]: "error",
|
|
81
84
|
[`${PLUGIN_NAME}/no-adhoc-typography`]: "error",
|
|
85
|
+
[`${PLUGIN_NAME}/no-bare-var-arbitrary`]: "error",
|
|
82
86
|
};
|
|
83
87
|
|
|
84
88
|
// Utility classes that nothing compiles. Opt-in, and deliberately outside
|
package/eslint-rules/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import requireBrowsableLink from "./require-browsable-link.js";
|
|
|
9
9
|
import noPrimitiveTailwindColors from "./no-primitive-tailwind-colors.js";
|
|
10
10
|
import noRawColorInClassName from "./no-raw-color-in-classname.js";
|
|
11
11
|
import noAdhocTypography from "./no-adhoc-typography.js";
|
|
12
|
+
import noBareVarArbitrary from "./no-bare-var-arbitrary.js";
|
|
12
13
|
import requireSharedSidebarProvider from "./require-shared-sidebar-provider.js";
|
|
13
14
|
import noHardcodedUserFacingString from "./no-hardcoded-user-facing-string.js";
|
|
14
15
|
|
|
@@ -19,6 +20,7 @@ export const rules = {
|
|
|
19
20
|
"no-primitive-tailwind-colors": noPrimitiveTailwindColors,
|
|
20
21
|
"no-raw-color-in-classname": noRawColorInClassName,
|
|
21
22
|
"no-adhoc-typography": noAdhocTypography,
|
|
23
|
+
"no-bare-var-arbitrary": noBareVarArbitrary,
|
|
22
24
|
"require-shared-sidebar-provider": requireSharedSidebarProvider,
|
|
23
25
|
"no-hardcoded-user-facing-string": noHardcodedUserFacingString,
|
|
24
26
|
};
|
|
@@ -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
|
+
};
|
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": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"audit:conventions": "node scripts/audit-conventions.mjs",
|
|
89
89
|
"mapping:build": "bash skills/migrate/scripts/build-mapping.sh",
|
|
90
90
|
"mapping:check": "bash skills/migrate/scripts/build-mapping.sh --check",
|
|
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",
|
|
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
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",
|
|
93
93
|
"test:hooks": "python3 plugins/camunda-design-system/scripts/route-request.test.py",
|
|
94
94
|
"prepare": "husky",
|