@camunda/design-system 0.70.0 → 0.72.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/code-block.d.ts.map +1 -1
- package/dist/src/components/ui/code-block.js +11 -76
- package/dist/src/components/ui/code-block.js.map +1 -1
- package/dist/src/components/ui/combobox.js +1 -1
- package/dist/src/components/ui/copy-button.d.ts +21 -0
- package/dist/src/components/ui/copy-button.d.ts.map +1 -0
- package/dist/src/components/ui/copy-button.js +55 -0
- package/dist/src/components/ui/copy-button.js.map +1 -0
- package/dist/src/components/ui/copyable-value.d.ts +13 -0
- package/dist/src/components/ui/copyable-value.d.ts.map +1 -0
- package/dist/src/components/ui/copyable-value.js +13 -0
- package/dist/src/components/ui/copyable-value.js.map +1 -0
- 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/hooks/use-copy-to-clipboard.d.ts +29 -0
- package/dist/src/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/src/hooks/use-copy-to-clipboard.js +126 -0
- package/dist/src/hooks/use-copy-to-clipboard.js.map +1 -0
- 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/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/i18n/dictionary.d.ts +7 -0
- package/dist/src/lib/i18n/dictionary.d.ts.map +1 -1
- package/dist/src/lib/i18n/dictionary.js +6 -0
- package/dist/src/lib/i18n/dictionary.js.map +1 -1
- package/dist/styles.css +111 -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;
|
|
@@ -1180,6 +1213,9 @@
|
|
|
1180
1213
|
.grid-cols-\[auto_1fr_auto\] {
|
|
1181
1214
|
grid-template-columns: auto 1fr auto;
|
|
1182
1215
|
}
|
|
1216
|
+
.grid-cols-\[max-content_1fr\] {
|
|
1217
|
+
grid-template-columns: max-content 1fr;
|
|
1218
|
+
}
|
|
1183
1219
|
.flex-col {
|
|
1184
1220
|
flex-direction: column;
|
|
1185
1221
|
}
|
|
@@ -1315,6 +1351,12 @@
|
|
|
1315
1351
|
.gap-x-2 {
|
|
1316
1352
|
column-gap: calc(var(--spacing) * 2);
|
|
1317
1353
|
}
|
|
1354
|
+
.gap-x-4 {
|
|
1355
|
+
column-gap: calc(var(--spacing) * 4);
|
|
1356
|
+
}
|
|
1357
|
+
.gap-y-2 {
|
|
1358
|
+
row-gap: calc(var(--spacing) * 2);
|
|
1359
|
+
}
|
|
1318
1360
|
.gap-y-3 {
|
|
1319
1361
|
row-gap: calc(var(--spacing) * 3);
|
|
1320
1362
|
}
|
|
@@ -1375,12 +1417,6 @@
|
|
|
1375
1417
|
.rounded-4xl {
|
|
1376
1418
|
border-radius: var(--radius-4xl);
|
|
1377
1419
|
}
|
|
1378
|
-
.rounded-\[2px\] {
|
|
1379
|
-
border-radius: 2px;
|
|
1380
|
-
}
|
|
1381
|
-
.rounded-\[4px\] {
|
|
1382
|
-
border-radius: 4px;
|
|
1383
|
-
}
|
|
1384
1420
|
.rounded-\[inherit\] {
|
|
1385
1421
|
border-radius: inherit;
|
|
1386
1422
|
}
|
|
@@ -1402,6 +1438,9 @@
|
|
|
1402
1438
|
.rounded-xl {
|
|
1403
1439
|
border-radius: calc(var(--radius) + 4px);
|
|
1404
1440
|
}
|
|
1441
|
+
.rounded-xs {
|
|
1442
|
+
border-radius: var(--radius-xs);
|
|
1443
|
+
}
|
|
1405
1444
|
.rounded-t-xl {
|
|
1406
1445
|
border-top-left-radius: calc(var(--radius) + 4px);
|
|
1407
1446
|
border-top-right-radius: calc(var(--radius) + 4px);
|
|
@@ -1544,6 +1583,12 @@
|
|
|
1544
1583
|
.border-l-transparent {
|
|
1545
1584
|
border-left-color: transparent;
|
|
1546
1585
|
}
|
|
1586
|
+
.bg-\(--brand\)\/50 {
|
|
1587
|
+
background-color: var(--brand);
|
|
1588
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1589
|
+
background-color: color-mix(in oklab, var(--brand) 50%, transparent);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1547
1592
|
.bg-\(--color-indicator-legend\) {
|
|
1548
1593
|
background-color: var(--color-indicator-legend);
|
|
1549
1594
|
}
|
|
@@ -1553,6 +1598,12 @@
|
|
|
1553
1598
|
.bg-\[\#ff0000\] {
|
|
1554
1599
|
background-color: #ff0000;
|
|
1555
1600
|
}
|
|
1601
|
+
.bg-\[\#fff\] {
|
|
1602
|
+
background-color: #fff;
|
|
1603
|
+
}
|
|
1604
|
+
.bg-\[--brand\]\/50 {
|
|
1605
|
+
background-color: color-mix(in oklab, --brand 50%, transparent);
|
|
1606
|
+
}
|
|
1556
1607
|
.bg-\[rgb\(255\,0\,0\)\] {
|
|
1557
1608
|
background-color: rgb(255,0,0);
|
|
1558
1609
|
}
|
|
@@ -1984,6 +2035,10 @@
|
|
|
1984
2035
|
--tw-leading: calc(var(--spacing) * 4);
|
|
1985
2036
|
line-height: calc(var(--spacing) * 4);
|
|
1986
2037
|
}
|
|
2038
|
+
.leading-4\.5 {
|
|
2039
|
+
--tw-leading: calc(var(--spacing) * 4.5);
|
|
2040
|
+
line-height: calc(var(--spacing) * 4.5);
|
|
2041
|
+
}
|
|
1987
2042
|
.leading-5 {
|
|
1988
2043
|
--tw-leading: calc(var(--spacing) * 5);
|
|
1989
2044
|
line-height: calc(var(--spacing) * 5);
|
|
@@ -2004,10 +2059,6 @@
|
|
|
2004
2059
|
--tw-leading: calc(var(--spacing) * 10);
|
|
2005
2060
|
line-height: calc(var(--spacing) * 10);
|
|
2006
2061
|
}
|
|
2007
|
-
.leading-\[18px\] {
|
|
2008
|
-
--tw-leading: 18px;
|
|
2009
|
-
line-height: 18px;
|
|
2010
|
-
}
|
|
2011
2062
|
.leading-\[22px\] {
|
|
2012
2063
|
--tw-leading: 22px;
|
|
2013
2064
|
line-height: 22px;
|
|
@@ -2054,6 +2105,12 @@
|
|
|
2054
2105
|
.break-words {
|
|
2055
2106
|
overflow-wrap: break-word;
|
|
2056
2107
|
}
|
|
2108
|
+
.break-all {
|
|
2109
|
+
word-break: break-all;
|
|
2110
|
+
}
|
|
2111
|
+
.text-ellipsis {
|
|
2112
|
+
text-overflow: ellipsis;
|
|
2113
|
+
}
|
|
2057
2114
|
.whitespace-nowrap {
|
|
2058
2115
|
white-space: nowrap;
|
|
2059
2116
|
}
|
|
@@ -2379,6 +2436,12 @@
|
|
|
2379
2436
|
-webkit-user-select: none;
|
|
2380
2437
|
user-select: none;
|
|
2381
2438
|
}
|
|
2439
|
+
.\[--sidebar-width\:16rem\] {
|
|
2440
|
+
--sidebar-width: 16rem;
|
|
2441
|
+
}
|
|
2442
|
+
.\[--x\:1px\] {
|
|
2443
|
+
--x: 1px;
|
|
2444
|
+
}
|
|
2382
2445
|
.ring-inset {
|
|
2383
2446
|
--tw-ring-inset: inset;
|
|
2384
2447
|
}
|
|
@@ -2879,8 +2942,8 @@
|
|
|
2879
2942
|
.has-\[\>img\:first-child\]\:pt-0:has( > img:first-child) {
|
|
2880
2943
|
padding-top: 0px;
|
|
2881
2944
|
}
|
|
2882
|
-
.has-\[\~\[data-button\]\]\:top
|
|
2883
|
-
top:
|
|
2945
|
+
.has-\[\~\[data-button\]\]\:top-4\.5:has( ~ [data-button]) {
|
|
2946
|
+
top: calc(var(--spacing) * 4.5);
|
|
2884
2947
|
}
|
|
2885
2948
|
.aria-disabled\:pointer-events-none[aria-disabled="true"] {
|
|
2886
2949
|
pointer-events: none;
|
|
@@ -3055,6 +3118,9 @@
|
|
|
3055
3118
|
.data-\[state\=open\]\:bg-neutral-background-medium[data-state="open"] {
|
|
3056
3119
|
background-color: var(--neutral-background-medium);
|
|
3057
3120
|
}
|
|
3121
|
+
.data-\[state\=open\]\:p-2[data-state="open"] {
|
|
3122
|
+
padding: calc(var(--spacing) * 2);
|
|
3123
|
+
}
|
|
3058
3124
|
.data-\[state\=open\]\:text-accent-foreground-strong[data-state="open"] {
|
|
3059
3125
|
color: var(--accent-foreground-strong);
|
|
3060
3126
|
}
|
|
@@ -3130,17 +3196,17 @@
|
|
|
3130
3196
|
.sm\:max-w-2xl {
|
|
3131
3197
|
max-width: var(--container-2xl);
|
|
3132
3198
|
}
|
|
3133
|
-
.sm\:max-w
|
|
3134
|
-
max-width:
|
|
3199
|
+
.sm\:max-w-100 {
|
|
3200
|
+
max-width: calc(var(--spacing) * 100);
|
|
3135
3201
|
}
|
|
3136
|
-
.sm\:max-w
|
|
3137
|
-
max-width:
|
|
3202
|
+
.sm\:max-w-150 {
|
|
3203
|
+
max-width: calc(var(--spacing) * 150);
|
|
3138
3204
|
}
|
|
3139
|
-
.sm\:max-w
|
|
3140
|
-
max-width:
|
|
3205
|
+
.sm\:max-w-200 {
|
|
3206
|
+
max-width: calc(var(--spacing) * 200);
|
|
3141
3207
|
}
|
|
3142
|
-
.sm\:max-w-\[
|
|
3143
|
-
max-width:
|
|
3208
|
+
.sm\:max-w-\[90vw\] {
|
|
3209
|
+
max-width: 90vw;
|
|
3144
3210
|
}
|
|
3145
3211
|
.sm\:max-w-\[1234px\] {
|
|
3146
3212
|
max-width: 1234px;
|
|
@@ -3174,6 +3240,12 @@
|
|
|
3174
3240
|
.md\:flex {
|
|
3175
3241
|
display: flex;
|
|
3176
3242
|
}
|
|
3243
|
+
.md\:max-h-\(--x\) {
|
|
3244
|
+
max-height: var(--x);
|
|
3245
|
+
}
|
|
3246
|
+
.md\:max-h-\[--x\] {
|
|
3247
|
+
max-height: --x;
|
|
3248
|
+
}
|
|
3177
3249
|
.md\:grid-cols-5 {
|
|
3178
3250
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
3179
3251
|
}
|
|
@@ -3527,8 +3599,8 @@
|
|
|
3527
3599
|
.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]) {
|
|
3528
3600
|
padding-right: 0px;
|
|
3529
3601
|
}
|
|
3530
|
-
.\[\&\:has\(\~\[data-content\]_\[data-description\]\)\]\:top
|
|
3531
|
-
top:
|
|
3602
|
+
.\[\&\:has\(\~\[data-content\]_\[data-description\]\)\]\:top-3:has( ~ [data-content] [data-description]) {
|
|
3603
|
+
top: calc(var(--spacing) * 3);
|
|
3532
3604
|
}
|
|
3533
3605
|
.\[\&\:has\(\~\[data-content\]_\[data-description\]\)\]\:-mt-1:has( ~ [data-content] [data-description]) {
|
|
3534
3606
|
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.72.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",
|