@common-origin/design-system 3.1.0 → 3.2.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/client.js +1017 -713
- package/dist/client.js.map +1 -1
- package/dist/components/atoms/Badge/Badge.d.mts +2 -2
- package/dist/components/atoms/Badge/Badge.d.ts +2 -2
- package/dist/components/atoms/Badge/Badge.mjs +15 -9
- package/dist/components/atoms/Box/Box.d.mts +3 -2
- package/dist/components/atoms/Box/Box.d.ts +3 -2
- package/dist/components/atoms/Button/Button.mjs +1 -1
- package/dist/components/atoms/Chip/shared/ChipBase.mjs +1 -1
- package/dist/components/atoms/IconButton/IconButton.mjs +1 -1
- package/dist/components/atoms/ProgressBar/ProgressBar.d.mts +1 -1
- package/dist/components/atoms/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/atoms/Tag/Tag.d.mts +1 -1
- package/dist/components/atoms/Tag/Tag.d.ts +1 -1
- package/dist/components/atoms/Tooltip/Tooltip.d.mts +7 -1
- package/dist/components/atoms/Tooltip/Tooltip.d.ts +7 -1
- package/dist/components/atoms/Tooltip/Tooltip.mjs +18 -8
- package/dist/components/molecules/ActionSheet/ActionSheet.mjs +2 -2
- package/dist/components/molecules/Alert/Alert.mjs +1 -1
- package/dist/components/molecules/Checkbox/SelectableInputBase.mjs +1 -1
- package/dist/components/molecules/Dropdown/Dropdown.mjs +1 -1
- package/dist/components/molecules/List/ListItem.mjs +3 -3
- package/dist/components/molecules/Menu/Menu.d.mts +8 -1
- package/dist/components/molecules/Menu/Menu.d.ts +8 -1
- package/dist/components/molecules/Menu/Menu.mjs +12 -9
- package/dist/components/molecules/Modal/Modal.mjs +1 -1
- package/dist/components/molecules/NumberInput/NumberInput.mjs +2 -1
- package/dist/components/molecules/PasswordField/PasswordField.mjs +3 -2
- package/dist/components/molecules/SearchField/SearchField.mjs +3 -3
- package/dist/components/molecules/Sheet/Sheet.mjs +3 -3
- package/dist/components/molecules/SidebarNavItem/SidebarNavItem.d.mts +3 -2
- package/dist/components/molecules/SidebarNavItem/SidebarNavItem.d.ts +3 -2
- package/dist/components/molecules/SidebarNavItem/SidebarNavItem.mjs +128 -41
- package/dist/components/molecules/SidebarNavItem/sidebarNavMotion.d.mts +30 -0
- package/dist/components/molecules/SidebarNavItem/sidebarNavMotion.d.ts +30 -0
- package/dist/components/molecules/SidebarNavItem/sidebarNavMotion.mjs +69 -0
- package/dist/components/molecules/SidebarNavItem/sidebarNavMotion.mjs.map +1 -0
- package/dist/components/molecules/SidebarNavSection/SidebarNavSection.mjs +57 -43
- package/dist/components/molecules/TabBar/TabBar.mjs +3 -3
- package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.mjs +3 -1
- package/dist/components/organisms/SidebarNav/SidebarNav.mjs +173 -62
- package/dist/data.js +96 -59
- package/dist/data.js.map +1 -1
- package/dist/lib/styleUtils.d.mts +4 -0
- package/dist/lib/styleUtils.d.ts +4 -0
- package/dist/lib/styleUtils.mjs +5 -1
- package/dist/lib/styleUtils.mjs.map +1 -1
- package/dist/lib/tokenAliases.mjs +1 -0
- package/dist/lib/tokenAliases.mjs.map +1 -1
- package/dist/lib/useFloatingLayer.d.mts +8 -1
- package/dist/lib/useFloatingLayer.d.ts +8 -1
- package/dist/lib/useFloatingLayer.mjs +11 -2
- package/dist/lib/useFloatingLayer.mjs.map +1 -1
- package/dist/styles/tokens.d.mts +93 -24
- package/dist/styles/tokens.d.ts +93 -24
- package/dist/styles/tokens.json +96 -59
- package/dist/styles/tokens.json.mjs +96 -59
- package/dist/styles/tokens.json.mjs.map +1 -1
- package/dist/tokens/index.js +96 -59
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/index.mjs +96 -59
- package/dist/tokens/index.mjs.map +1 -1
- package/dist/tokens/styles/tokens.d.mts +93 -24
- package/dist/tokens/styles/tokens.d.ts +93 -24
- package/dist/tokens.css +1105 -74
- package/package.json +3 -1
package/dist/data.js
CHANGED
|
@@ -35,7 +35,8 @@ var base = {
|
|
|
35
35
|
"4": "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
|
|
36
36
|
"5": "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
|
|
37
37
|
"6": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
38
|
-
none: "none"
|
|
38
|
+
none: "none",
|
|
39
|
+
inset: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"
|
|
39
40
|
},
|
|
40
41
|
zIndex: {
|
|
41
42
|
"0": "0",
|
|
@@ -65,7 +66,8 @@ var base = {
|
|
|
65
66
|
"80": "0.8",
|
|
66
67
|
"90": "0.9",
|
|
67
68
|
"95": "0.95",
|
|
68
|
-
"100": "1"
|
|
69
|
+
"100": "1",
|
|
70
|
+
scrim: "0.5"
|
|
69
71
|
},
|
|
70
72
|
dimension: {
|
|
71
73
|
"0": "0",
|
|
@@ -114,6 +116,15 @@ var base = {
|
|
|
114
116
|
color: {
|
|
115
117
|
transparent: "transparent",
|
|
116
118
|
white: "#ffffff",
|
|
119
|
+
surface: {
|
|
120
|
+
page: "#fcfcfc",
|
|
121
|
+
raised: "#ffffff",
|
|
122
|
+
overlay: "#ffffff"
|
|
123
|
+
},
|
|
124
|
+
ink: {
|
|
125
|
+
light: "#fcfcfc",
|
|
126
|
+
dark: "#222222"
|
|
127
|
+
},
|
|
117
128
|
gray: {
|
|
118
129
|
"100": "#fcfcfc",
|
|
119
130
|
"200": "#f9f9f9",
|
|
@@ -142,6 +153,20 @@ var base = {
|
|
|
142
153
|
"1100": "rgba(34, 34, 34, 0.706)",
|
|
143
154
|
"1200": "rgba(34, 34, 34, 1)"
|
|
144
155
|
},
|
|
156
|
+
"gray-alpha-inverse": {
|
|
157
|
+
"100": "rgba(252, 252, 252, 0.014)",
|
|
158
|
+
"200": "rgba(252, 252, 252, 0.027)",
|
|
159
|
+
"300": "rgba(252, 252, 252, 0.059)",
|
|
160
|
+
"400": "rgba(252, 252, 252, 0.09)",
|
|
161
|
+
"500": "rgba(252, 252, 252, 0.122)",
|
|
162
|
+
"600": "rgba(252, 252, 252, 0.158)",
|
|
163
|
+
"700": "rgba(252, 252, 252, 0.208)",
|
|
164
|
+
"800": "rgba(252, 252, 252, 0.502)",
|
|
165
|
+
"900": "rgba(252, 252, 252, 0.557)",
|
|
166
|
+
"1000": "rgba(252, 252, 252, 0.606)",
|
|
167
|
+
"1100": "rgba(252, 252, 252, 0.706)",
|
|
168
|
+
"1200": "rgba(252, 252, 252, 1)"
|
|
169
|
+
},
|
|
145
170
|
accent: {
|
|
146
171
|
"100": "#fbfcfd",
|
|
147
172
|
"200": "#f7f9fc",
|
|
@@ -154,7 +179,8 @@ var base = {
|
|
|
154
179
|
"900": "#0082fc",
|
|
155
180
|
"1000": "#0278e7",
|
|
156
181
|
"1100": "#0162bf",
|
|
157
|
-
"1200": "#0f2339"
|
|
182
|
+
"1200": "#0f2339",
|
|
183
|
+
solid: "#0162bf"
|
|
158
184
|
},
|
|
159
185
|
"accent-alpha": {
|
|
160
186
|
"100": "rgba(5, 68, 130, 0.016)",
|
|
@@ -182,7 +208,8 @@ var base = {
|
|
|
182
208
|
"900": "#009762",
|
|
183
209
|
"1000": "#018b5a",
|
|
184
210
|
"1100": "#017249",
|
|
185
|
-
"1200": "#12261b"
|
|
211
|
+
"1200": "#12261b",
|
|
212
|
+
solid: "#017249"
|
|
186
213
|
},
|
|
187
214
|
"success-alpha": {
|
|
188
215
|
"100": "rgba(5, 172, 47, 0.024)",
|
|
@@ -210,7 +237,8 @@ var base = {
|
|
|
210
237
|
"900": "#ad7b00",
|
|
211
238
|
"1000": "#9f7102",
|
|
212
239
|
"1100": "#835c00",
|
|
213
|
-
"1200": "#292111"
|
|
240
|
+
"1200": "#292111",
|
|
241
|
+
solid: "#835c00"
|
|
214
242
|
},
|
|
215
243
|
"warning-alpha": {
|
|
216
244
|
"100": "rgba(155, 105, 5, 0.02)",
|
|
@@ -238,7 +266,8 @@ var base = {
|
|
|
238
266
|
"900": "#da5f00",
|
|
239
267
|
"1000": "#c85701",
|
|
240
268
|
"1100": "#a54703",
|
|
241
|
-
"1200": "#341c10"
|
|
269
|
+
"1200": "#341c10",
|
|
270
|
+
solid: "#a54703"
|
|
242
271
|
},
|
|
243
272
|
"serious-alpha": {
|
|
244
273
|
"100": "rgba(193, 68, 5, 0.016)",
|
|
@@ -266,7 +295,8 @@ var base = {
|
|
|
266
295
|
"900": "#ff2b21",
|
|
267
296
|
"1000": "#f30004",
|
|
268
297
|
"1100": "#c90002",
|
|
269
|
-
"1200": "#3d1611"
|
|
298
|
+
"1200": "#3d1611",
|
|
299
|
+
solid: "#c90002"
|
|
270
300
|
},
|
|
271
301
|
"danger-alpha": {
|
|
272
302
|
"100": "rgba(172, 5, 5, 0.012)",
|
|
@@ -509,7 +539,7 @@ var component = {
|
|
|
509
539
|
primary: {
|
|
510
540
|
backgroundColor: "#222222",
|
|
511
541
|
textColor: "#fcfcfc",
|
|
512
|
-
borderRadius: "0.
|
|
542
|
+
borderRadius: "0.5rem",
|
|
513
543
|
font: "500 1rem/1.5rem 'Inter', sans-serif"
|
|
514
544
|
},
|
|
515
545
|
hover: {
|
|
@@ -522,21 +552,21 @@ var component = {
|
|
|
522
552
|
outline: "0.125rem solid #222222"
|
|
523
553
|
},
|
|
524
554
|
disabled: {
|
|
525
|
-
backgroundColor: "
|
|
555
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)",
|
|
526
556
|
textColor: "rgba(34, 34, 34, 0.208)"
|
|
527
557
|
},
|
|
528
558
|
variants: {
|
|
529
559
|
secondary: {
|
|
530
|
-
backgroundColor: "
|
|
560
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)",
|
|
531
561
|
textColor: "#222222",
|
|
532
562
|
hover: {
|
|
533
|
-
backgroundColor: "
|
|
563
|
+
backgroundColor: "rgba(34, 34, 34, 0.09)"
|
|
534
564
|
},
|
|
535
565
|
active: {
|
|
536
|
-
backgroundColor: "
|
|
566
|
+
backgroundColor: "rgba(34, 34, 34, 0.122)"
|
|
537
567
|
},
|
|
538
568
|
disabled: {
|
|
539
|
-
backgroundColor: "
|
|
569
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)",
|
|
540
570
|
textColor: "rgba(34, 34, 34, 0.208)"
|
|
541
571
|
}
|
|
542
572
|
},
|
|
@@ -544,10 +574,10 @@ var component = {
|
|
|
544
574
|
backgroundColor: "transparent",
|
|
545
575
|
textColor: "#222222",
|
|
546
576
|
hover: {
|
|
547
|
-
backgroundColor: "
|
|
577
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)"
|
|
548
578
|
},
|
|
549
579
|
active: {
|
|
550
|
-
backgroundColor: "
|
|
580
|
+
backgroundColor: "rgba(34, 34, 34, 0.09)"
|
|
551
581
|
},
|
|
552
582
|
disabled: {
|
|
553
583
|
backgroundColor: "transparent",
|
|
@@ -564,7 +594,7 @@ var component = {
|
|
|
564
594
|
backgroundColor: "color-mix(in srgb, #0162bf, #fcfcfc calc(0.12 * 100%))"
|
|
565
595
|
},
|
|
566
596
|
disabled: {
|
|
567
|
-
backgroundColor: "
|
|
597
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)",
|
|
568
598
|
textColor: "rgba(34, 34, 34, 0.208)"
|
|
569
599
|
}
|
|
570
600
|
},
|
|
@@ -578,7 +608,7 @@ var component = {
|
|
|
578
608
|
backgroundColor: "color-mix(in srgb, #c90002, #fcfcfc calc(0.12 * 100%))"
|
|
579
609
|
},
|
|
580
610
|
disabled: {
|
|
581
|
-
backgroundColor: "
|
|
611
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)",
|
|
582
612
|
textColor: "rgba(34, 34, 34, 0.208)"
|
|
583
613
|
}
|
|
584
614
|
}
|
|
@@ -601,16 +631,16 @@ var component = {
|
|
|
601
631
|
size: "1.25rem"
|
|
602
632
|
},
|
|
603
633
|
"default": {
|
|
604
|
-
backgroundColor: "
|
|
634
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)",
|
|
605
635
|
textColor: "#222222",
|
|
606
|
-
borderRadius: "
|
|
636
|
+
borderRadius: "10rem",
|
|
607
637
|
font: "400 1rem/1.5rem 'Inter', sans-serif"
|
|
608
638
|
},
|
|
609
639
|
focus: {
|
|
610
640
|
outline: "0.125rem solid #222222"
|
|
611
641
|
},
|
|
612
642
|
disabled: {
|
|
613
|
-
backgroundColor: "
|
|
643
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)",
|
|
614
644
|
textColor: "rgba(34, 34, 34, 0.208)"
|
|
615
645
|
},
|
|
616
646
|
variants: {
|
|
@@ -621,7 +651,7 @@ var component = {
|
|
|
621
651
|
backgroundColor: "#fcfcfc"
|
|
622
652
|
},
|
|
623
653
|
active: {
|
|
624
|
-
backgroundColor: "
|
|
654
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)"
|
|
625
655
|
},
|
|
626
656
|
disabled: {
|
|
627
657
|
backgroundColor: "#ffffff",
|
|
@@ -637,7 +667,7 @@ var component = {
|
|
|
637
667
|
},
|
|
638
668
|
iconButton: {
|
|
639
669
|
primary: {
|
|
640
|
-
borderRadius: "0.
|
|
670
|
+
borderRadius: "0.5rem"
|
|
641
671
|
},
|
|
642
672
|
focus: {
|
|
643
673
|
outline: "0.125rem solid #222222"
|
|
@@ -658,7 +688,7 @@ var component = {
|
|
|
658
688
|
}
|
|
659
689
|
},
|
|
660
690
|
progressBar: {
|
|
661
|
-
backgroundColor: "
|
|
691
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)",
|
|
662
692
|
sizes: {
|
|
663
693
|
sm: {
|
|
664
694
|
height: "0.25rem"
|
|
@@ -679,7 +709,7 @@ var component = {
|
|
|
679
709
|
backgroundColor: "#ffffff",
|
|
680
710
|
textColor: "#222222",
|
|
681
711
|
borderColor: "#909090",
|
|
682
|
-
borderRadius: "0.
|
|
712
|
+
borderRadius: "0.5rem",
|
|
683
713
|
borderWidth: "0.0625rem",
|
|
684
714
|
font: "400 1rem/1.5rem 'Inter', sans-serif"
|
|
685
715
|
},
|
|
@@ -704,7 +734,7 @@ var component = {
|
|
|
704
734
|
}
|
|
705
735
|
},
|
|
706
736
|
disabled: {
|
|
707
|
-
backgroundColor: "
|
|
737
|
+
backgroundColor: "rgba(34, 34, 34, 0.059)",
|
|
708
738
|
textColor: "rgba(34, 34, 34, 0.208)",
|
|
709
739
|
borderColor: "#d1d1d1"
|
|
710
740
|
},
|
|
@@ -752,19 +782,19 @@ var component = {
|
|
|
752
782
|
alert: {
|
|
753
783
|
severity: {
|
|
754
784
|
error: {
|
|
755
|
-
background: "
|
|
785
|
+
background: "rgba(180, 31, 1, 0.067)",
|
|
756
786
|
text: "#c90002"
|
|
757
787
|
},
|
|
758
788
|
warning: {
|
|
759
|
-
background: "
|
|
789
|
+
background: "rgba(210, 128, 0, 0.11)",
|
|
760
790
|
text: "#835c00"
|
|
761
791
|
},
|
|
762
792
|
info: {
|
|
763
|
-
background: "
|
|
793
|
+
background: "rgba(1, 86, 185, 0.071)",
|
|
764
794
|
text: "#0162bf"
|
|
765
795
|
},
|
|
766
796
|
success: {
|
|
767
|
-
background: "
|
|
797
|
+
background: "rgba(1, 213, 93, 0.142)",
|
|
768
798
|
text: "#017249"
|
|
769
799
|
}
|
|
770
800
|
},
|
|
@@ -865,7 +895,8 @@ var component = {
|
|
|
865
895
|
},
|
|
866
896
|
checkbox: {
|
|
867
897
|
box: {
|
|
868
|
-
size: "1.25rem"
|
|
898
|
+
size: "1.25rem",
|
|
899
|
+
borderRadius: "0.25rem"
|
|
869
900
|
},
|
|
870
901
|
row: {
|
|
871
902
|
minHeight: "2rem"
|
|
@@ -897,31 +928,34 @@ var component = {
|
|
|
897
928
|
status: {
|
|
898
929
|
pending: {
|
|
899
930
|
text: "#636363",
|
|
900
|
-
background: "
|
|
931
|
+
background: "rgba(34, 34, 34, 0.059)"
|
|
901
932
|
},
|
|
902
933
|
completed: {
|
|
903
934
|
text: "#017249",
|
|
904
|
-
background: "
|
|
935
|
+
background: "rgba(1, 213, 93, 0.142)"
|
|
905
936
|
},
|
|
906
937
|
failed: {
|
|
907
938
|
text: "#c90002",
|
|
908
|
-
background: "
|
|
939
|
+
background: "rgba(180, 31, 1, 0.067)"
|
|
909
940
|
},
|
|
910
941
|
cancelled: {
|
|
911
942
|
text: "#636363",
|
|
912
|
-
background: "
|
|
943
|
+
background: "rgba(34, 34, 34, 0.059)"
|
|
913
944
|
},
|
|
914
945
|
processing: {
|
|
915
946
|
text: "#0162bf",
|
|
916
|
-
background: "
|
|
947
|
+
background: "rgba(1, 86, 185, 0.071)"
|
|
917
948
|
},
|
|
918
949
|
scheduled: {
|
|
919
950
|
text: "#636363",
|
|
920
|
-
background: "
|
|
951
|
+
background: "rgba(34, 34, 34, 0.059)"
|
|
921
952
|
}
|
|
922
953
|
},
|
|
923
954
|
track: {
|
|
924
|
-
background: "
|
|
955
|
+
background: "rgba(34, 34, 34, 0.059)"
|
|
956
|
+
},
|
|
957
|
+
overlay: {
|
|
958
|
+
borderRadius: "1.5rem"
|
|
925
959
|
}
|
|
926
960
|
};
|
|
927
961
|
var semantic = {
|
|
@@ -1060,6 +1094,7 @@ var semantic = {
|
|
|
1060
1094
|
text: {
|
|
1061
1095
|
"default": "#222222",
|
|
1062
1096
|
inverse: "#fcfcfc",
|
|
1097
|
+
"on-fill": "#fcfcfc",
|
|
1063
1098
|
disabled: "rgba(34, 34, 34, 0.208)",
|
|
1064
1099
|
success: "#017249",
|
|
1065
1100
|
warning: "#835c00",
|
|
@@ -1086,6 +1121,7 @@ var semantic = {
|
|
|
1086
1121
|
"default": "#222222",
|
|
1087
1122
|
disabled: "rgba(34, 34, 34, 0.208)",
|
|
1088
1123
|
inverse: "#fcfcfc",
|
|
1124
|
+
"on-fill": "#fcfcfc",
|
|
1089
1125
|
success: "#017249",
|
|
1090
1126
|
warning: "#835c00",
|
|
1091
1127
|
muted: "#636363",
|
|
@@ -1098,53 +1134,53 @@ var semantic = {
|
|
|
1098
1134
|
gray: "#909090",
|
|
1099
1135
|
"gray-strong": "#636363",
|
|
1100
1136
|
"gray-text": "#636363",
|
|
1101
|
-
"gray-muted": "
|
|
1137
|
+
"gray-muted": "rgba(34, 34, 34, 0.059)",
|
|
1102
1138
|
olive: "#889903",
|
|
1103
1139
|
"olive-strong": "#5d6900",
|
|
1104
1140
|
"olive-text": "#5d6900",
|
|
1105
|
-
"olive-muted": "
|
|
1141
|
+
"olive-muted": "rgba(160, 202, 1, 0.169)",
|
|
1106
1142
|
periwinkle: "#7a84ff",
|
|
1107
1143
|
"periwinkle-strong": "#533eff",
|
|
1108
1144
|
"periwinkle-text": "#533eff",
|
|
1109
|
-
"periwinkle-muted": "
|
|
1145
|
+
"periwinkle-muted": "rgba(1, 35, 170, 0.059)",
|
|
1110
1146
|
rose: "#ff4989",
|
|
1111
1147
|
"rose-strong": "#c4005d",
|
|
1112
1148
|
"rose-text": "#c4005d",
|
|
1113
|
-
"rose-muted": "
|
|
1149
|
+
"rose-muted": "rgba(176, 1, 33, 0.063)",
|
|
1114
1150
|
magenta: "#fd00fa",
|
|
1115
1151
|
"magenta-strong": "#b100af",
|
|
1116
1152
|
"magenta-text": "#b100af",
|
|
1117
|
-
"magenta-muted": "
|
|
1153
|
+
"magenta-muted": "rgba(176, 1, 160, 0.063)"
|
|
1118
1154
|
},
|
|
1119
1155
|
fill: {
|
|
1120
1156
|
emphasis: "#222222",
|
|
1121
|
-
muted: "
|
|
1157
|
+
muted: "rgba(34, 34, 34, 0.059)",
|
|
1122
1158
|
inverse: "#222222",
|
|
1123
1159
|
accent: "#0162bf",
|
|
1124
|
-
"accent-muted": "
|
|
1125
|
-
"accent-muted-hover": "
|
|
1126
|
-
"accent-muted-pressed": "
|
|
1160
|
+
"accent-muted": "rgba(1, 86, 185, 0.071)",
|
|
1161
|
+
"accent-muted-hover": "rgba(0, 82, 191, 0.11)",
|
|
1162
|
+
"accent-muted-pressed": "rgba(0, 85, 196, 0.153)",
|
|
1127
1163
|
"accent-hover": "color-mix(in srgb, #0162bf, #fcfcfc calc(0.08 * 100%))",
|
|
1128
1164
|
"accent-pressed": "color-mix(in srgb, #0162bf, #fcfcfc calc(0.12 * 100%))",
|
|
1129
1165
|
danger: "#c90002",
|
|
1130
1166
|
"danger-hover": "color-mix(in srgb, #c90002, #fcfcfc calc(0.08 * 100%))",
|
|
1131
1167
|
"danger-pressed": "color-mix(in srgb, #c90002, #fcfcfc calc(0.12 * 100%))",
|
|
1132
|
-
"danger-muted": "
|
|
1168
|
+
"danger-muted": "rgba(180, 31, 1, 0.067)",
|
|
1133
1169
|
success: "#017249",
|
|
1134
|
-
"success-muted": "
|
|
1170
|
+
"success-muted": "rgba(1, 213, 93, 0.142)",
|
|
1135
1171
|
warning: "#835c00",
|
|
1136
|
-
"warning-muted": "
|
|
1137
|
-
disabled: "
|
|
1138
|
-
"default": "
|
|
1139
|
-
"default-hover": "
|
|
1140
|
-
"default-pressed": "
|
|
1172
|
+
"warning-muted": "rgba(210, 128, 0, 0.11)",
|
|
1173
|
+
disabled: "rgba(34, 34, 34, 0.059)",
|
|
1174
|
+
"default": "rgba(34, 34, 34, 0.059)",
|
|
1175
|
+
"default-hover": "rgba(34, 34, 34, 0.09)",
|
|
1176
|
+
"default-pressed": "rgba(34, 34, 34, 0.122)",
|
|
1141
1177
|
none: "transparent",
|
|
1142
|
-
"none-hover": "rgba(34, 34, 34, 0.
|
|
1143
|
-
"none-pressed": "rgba(34, 34, 34, 0.
|
|
1144
|
-
"inverse-none-hover": "rgba(
|
|
1178
|
+
"none-hover": "rgba(34, 34, 34, 0.09)",
|
|
1179
|
+
"none-pressed": "rgba(34, 34, 34, 0.158)",
|
|
1180
|
+
"inverse-none-hover": "rgba(252, 252, 252, 0.208)",
|
|
1145
1181
|
serious: "#a54703",
|
|
1146
|
-
"serious-muted": "
|
|
1147
|
-
"ai-muted": "
|
|
1182
|
+
"serious-muted": "rgba(192, 65, 2, 0.079)",
|
|
1183
|
+
"ai-muted": "rgba(69, 1, 170, 0.059)"
|
|
1148
1184
|
},
|
|
1149
1185
|
data: {
|
|
1150
1186
|
positive: "#009762",
|
|
@@ -1261,7 +1297,8 @@ var semantic = {
|
|
|
1261
1297
|
surface: {
|
|
1262
1298
|
base: "#fcfcfc",
|
|
1263
1299
|
raised: "#ffffff",
|
|
1264
|
-
|
|
1300
|
+
overlay: "#ffffff",
|
|
1301
|
+
scrim: "color-mix(in srgb, #222222 calc(0.5 * 100%), transparent)"
|
|
1265
1302
|
}
|
|
1266
1303
|
};
|
|
1267
1304
|
var tokensJson = {
|
package/dist/data.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","sources":["../src/types/tokens.ts","../src/types/icons.ts"],"sourcesContent":["import tokensJson from '../styles/tokens.json'\nimport type { Tokens } from '../styles/tokens'\n\n// The published types come from the generated `src/styles/tokens.ts`, which carries each token's\n// description as JSDoc and `@deprecated` on deprecated tokens (decision 0033, #199). Declaring the\n// constant with that type also keeps emitted .d.ts files free of JSON imports, which consumers can\n// only resolve with `resolveJsonModule`.\nexport const tokens: Tokens = tokensJson\n\nexport type { Tokens }\nexport type TokensBase = Tokens['base']\nexport type TokensSemantic = Tokens['semantic']\nexport type TokensComponent = Tokens['component']\n","// Icon type definitions for external consumption\n// This is a self-contained type that doesn't depend on JSON imports\n// to ensure it works correctly in consuming projects\n\nimport iconsJson from '../styles/icons.json'\n\nexport type IconName =\n | 'add'\n | 'ai'\n | 'addRing'\n | 'arrowDown'\n | 'arrowLeft'\n | 'arrowRight'\n | 'arrowUp'\n | 'back'\n | 'bell'\n | 'cancel'\n | 'caret'\n | 'caretDown'\n | 'caretUp'\n | 'check'\n | 'checkRing'\n | 'close'\n | 'copy'\n | 'creditCard'\n | 'crossCircle'\n | 'directionRight'\n | 'directionUp'\n | 'edit'\n | 'export'\n | 'fileDocSearch'\n | 'filter'\n | 'home'\n | 'info'\n | 'kebab'\n | 'lamp'\n | 'lineOut'\n | 'link'\n | 'meatballs'\n | 'menu'\n | 'message'\n | 'move'\n | 'mic'\n | 'order'\n | 'paper'\n | 'pause'\n | 'play'\n | 'playBack'\n | 'refresh'\n | 'remove'\n | 'search'\n | 'sidebar'\n | 'star'\n | 'starFilled'\n | 'statusCancelled'\n | 'statusError'\n | 'statusInProgress'\n | 'statusInfo'\n | 'statusNotStarted'\n | 'statusPending'\n | 'statusScheduled'\n | 'statusSerious'\n | 'statusSuccess'\n | 'statusWarning'\n | 'stop'\n | 'table'\n | 'trash'\n | 'userBox'\n | 'view'\n | 'viewHide'\n | 'wallet'\n\n/** Semantic category for grouping icons by purpose */\nexport type IconCategory =\n | 'action'\n | 'communication'\n | 'content'\n | 'feedback'\n | 'media'\n | 'navigation'\n | 'object'\n | 'status'\n | 'user'\n\n/** Enriched metadata for each icon entry in icons.json */\nexport interface IconMetadata {\n /** SVG path data */\n path: string\n /** Display name of the icon */\n name: string\n /** What the icon visually depicts */\n description: string\n /** Semantic category for grouping */\n category: IconCategory\n /** Alternative names and search terms */\n aliases: string[]\n /** When and why to use this icon */\n intent: string\n /** Whether the icon is typically decorative (true) or informative (false) */\n decorativeDefault: boolean\n /** Suggested accessible label when the icon conveys meaning */\n ariaLabelDefault: string\n}\n\n/** The full icon registry keyed by IconName */\nexport type IconRegistry = Record<IconName, IconMetadata>\n\n// Typed as IconRegistry so emitted .d.ts files don't import JSON (needs `resolveJsonModule` in consumers).\nexport const iconsData = iconsJson as IconRegistry\n"],"names":["tokens","tokensJson","iconsData","iconsJson"],"mappings":"
|
|
1
|
+
{"version":3,"file":"data.js","sources":["../src/types/tokens.ts","../src/types/icons.ts"],"sourcesContent":["import tokensJson from '../styles/tokens.json'\nimport type { Tokens } from '../styles/tokens'\n\n// The published types come from the generated `src/styles/tokens.ts`, which carries each token's\n// description as JSDoc and `@deprecated` on deprecated tokens (decision 0033, #199). Declaring the\n// constant with that type also keeps emitted .d.ts files free of JSON imports, which consumers can\n// only resolve with `resolveJsonModule`.\nexport const tokens: Tokens = tokensJson\n\nexport type { Tokens }\nexport type TokensBase = Tokens['base']\nexport type TokensSemantic = Tokens['semantic']\nexport type TokensComponent = Tokens['component']\n","// Icon type definitions for external consumption\n// This is a self-contained type that doesn't depend on JSON imports\n// to ensure it works correctly in consuming projects\n\nimport iconsJson from '../styles/icons.json'\n\nexport type IconName =\n | 'add'\n | 'ai'\n | 'addRing'\n | 'arrowDown'\n | 'arrowLeft'\n | 'arrowRight'\n | 'arrowUp'\n | 'back'\n | 'bell'\n | 'cancel'\n | 'caret'\n | 'caretDown'\n | 'caretUp'\n | 'check'\n | 'checkRing'\n | 'close'\n | 'copy'\n | 'creditCard'\n | 'crossCircle'\n | 'directionRight'\n | 'directionUp'\n | 'edit'\n | 'export'\n | 'fileDocSearch'\n | 'filter'\n | 'home'\n | 'info'\n | 'kebab'\n | 'lamp'\n | 'lineOut'\n | 'link'\n | 'meatballs'\n | 'menu'\n | 'message'\n | 'move'\n | 'mic'\n | 'order'\n | 'paper'\n | 'pause'\n | 'play'\n | 'playBack'\n | 'refresh'\n | 'remove'\n | 'search'\n | 'sidebar'\n | 'star'\n | 'starFilled'\n | 'statusCancelled'\n | 'statusError'\n | 'statusInProgress'\n | 'statusInfo'\n | 'statusNotStarted'\n | 'statusPending'\n | 'statusScheduled'\n | 'statusSerious'\n | 'statusSuccess'\n | 'statusWarning'\n | 'stop'\n | 'table'\n | 'trash'\n | 'userBox'\n | 'view'\n | 'viewHide'\n | 'wallet'\n\n/** Semantic category for grouping icons by purpose */\nexport type IconCategory =\n | 'action'\n | 'communication'\n | 'content'\n | 'feedback'\n | 'media'\n | 'navigation'\n | 'object'\n | 'status'\n | 'user'\n\n/** Enriched metadata for each icon entry in icons.json */\nexport interface IconMetadata {\n /** SVG path data */\n path: string\n /** Display name of the icon */\n name: string\n /** What the icon visually depicts */\n description: string\n /** Semantic category for grouping */\n category: IconCategory\n /** Alternative names and search terms */\n aliases: string[]\n /** When and why to use this icon */\n intent: string\n /** Whether the icon is typically decorative (true) or informative (false) */\n decorativeDefault: boolean\n /** Suggested accessible label when the icon conveys meaning */\n ariaLabelDefault: string\n}\n\n/** The full icon registry keyed by IconName */\nexport type IconRegistry = Record<IconName, IconMetadata>\n\n// Typed as IconRegistry so emitted .d.ts files don't import JSON (needs `resolveJsonModule` in consumers).\nexport const iconsData = iconsJson as IconRegistry\n"],"names":["tokens","tokensJson","iconsData","iconsJson"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;AACA;AACO,IAAMA,MAAM,GAAWC;;ACP9B;AACA;AACA;AAyGA;AACO,IAAMC,SAAS,GAAGC;;;;;;;"}
|
|
@@ -21,6 +21,10 @@ export declare const forcedColorsEdge: string;
|
|
|
21
21
|
export declare const reducedMotion = "@media (prefers-reduced-motion: reduce)";
|
|
22
22
|
export declare const exitAnimation: import("styled-components").RuleSet<object>;
|
|
23
23
|
export declare const visuallyHidden: import("styled-components").RuleSet<object>;
|
|
24
|
+
/** Corner radius of a button inside a field (a stepper, a clear or show-password button): one step tighter than the field, so its corner nests (decision 0055). */
|
|
25
|
+
export declare const fieldButtonRadius: string;
|
|
26
|
+
/** Corner radius every row and tab shares: the control radius (decision 0055). */
|
|
27
|
+
export declare const rowRadius: string;
|
|
24
28
|
export interface RowState {
|
|
25
29
|
background: string;
|
|
26
30
|
text?: string;
|
package/dist/lib/styleUtils.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ export declare const forcedColorsEdge: string;
|
|
|
21
21
|
export declare const reducedMotion = "@media (prefers-reduced-motion: reduce)";
|
|
22
22
|
export declare const exitAnimation: import("styled-components").RuleSet<object>;
|
|
23
23
|
export declare const visuallyHidden: import("styled-components").RuleSet<object>;
|
|
24
|
+
/** Corner radius of a button inside a field (a stepper, a clear or show-password button): one step tighter than the field, so its corner nests (decision 0055). */
|
|
25
|
+
export declare const fieldButtonRadius: string;
|
|
26
|
+
/** Corner radius every row and tab shares: the control radius (decision 0055). */
|
|
27
|
+
export declare const rowRadius: string;
|
|
24
28
|
export interface RowState {
|
|
25
29
|
background: string;
|
|
26
30
|
text?: string;
|
package/dist/lib/styleUtils.mjs
CHANGED
|
@@ -69,6 +69,10 @@ var visuallyHidden = css(templateObject_3 || (templateObject_3 = __makeTemplateO
|
|
|
69
69
|
var _a = tokens.semantic.color,
|
|
70
70
|
rowFill = _a.fill,
|
|
71
71
|
rowText = _a.text;
|
|
72
|
+
/** Corner radius of a button inside a field (a stepper, a clear or show-password button): one step tighter than the field, so its corner nests (decision 0055). */
|
|
73
|
+
var fieldButtonRadius = tokens.semantic.radius.sm;
|
|
74
|
+
/** Corner radius every row and tab shares: the control radius (decision 0055). */
|
|
75
|
+
var rowRadius = tokens.semantic.radius.md;
|
|
72
76
|
var rowStates = {
|
|
73
77
|
unselected: {
|
|
74
78
|
rest: {
|
|
@@ -156,5 +160,5 @@ var rowForcedColors = function rowForcedColors(_a) {
|
|
|
156
160
|
};
|
|
157
161
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
158
162
|
|
|
159
|
-
export { breakpoints, exitAnimation, forcedColors, forcedColorsEdge, interactiveRow, media, reducedMotion, rowStates, visuallyHidden };
|
|
163
|
+
export { breakpoints, exitAnimation, fieldButtonRadius, forcedColors, forcedColorsEdge, interactiveRow, media, reducedMotion, rowRadius, rowStates, visuallyHidden };
|
|
160
164
|
//# sourceMappingURL=styleUtils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styleUtils.mjs","sources":["../../src/lib/styleUtils.ts"],"sourcesContent":["import { css, keyframes } from 'styled-components'\nimport tokens from './cssTokens'\n\n// Breakpoints from the semantic tokens (decision 0014)\nexport const breakpoints = {\n xs: tokens.semantic.breakpoint.xs,\n sm: tokens.semantic.breakpoint.sm,\n md: tokens.semantic.breakpoint.md,\n lg: tokens.semantic.breakpoint.lg,\n xl: tokens.semantic.breakpoint.xl,\n '2xl': tokens.semantic.breakpoint['2xl'],\n}\n\n// Media query helpers\nexport const media = {\n xs: `@media (min-width: ${breakpoints.xs})`,\n sm: `@media (min-width: ${breakpoints.sm})`,\n md: `@media (min-width: ${breakpoints.md})`,\n lg: `@media (min-width: ${breakpoints.lg})`,\n xl: `@media (min-width: ${breakpoints.xl})`,\n '2xl': `@media (min-width: ${breakpoints['2xl']})`,\n}\n\n// Windows Contrast Themes and other forced-colours modes (decision 0038). The browser swaps in\n// the user's system colours, drops background colours and box-shadows, and keeps borders and\n// outlines. Inside this query, give a control that shows its edge with a fill alone a border,\n// and draw selected and checked states with system colours: ButtonText for control edges,\n// Highlight and HighlightText for selected and checked, GrayText for disabled, CanvasText for\n// content. Use forced-color-adjust: none only on a fill that carries state.\nexport const forcedColors = '@media (forced-colors: active)'\n\n/** A control's edge in forced colours, for a control that shows its edge with a fill alone. The\n * border follows the text colour the browser picks: ButtonText, LinkText, or GrayText when disabled. */\nexport const forcedColorsEdge = `${forcedColors} {\n border: ${tokens.semantic.border.width.thin} solid currentColor;\n}`\n\n// Wrap fallbacks for people who ask for less motion (decision 0005): movement becomes\n// an instant change or a simple fade. Colour and opacity transitions need no fallback.\nexport const reducedMotion = '@media (prefers-reduced-motion: reduce)'\n\n// No `from` keyframe: the fade starts from the element's current opacity, including a\n// still-running entrance, so closing mid-entrance doesn't jump back to fully visible.\nconst fadeOut = keyframes`\n to { opacity: 0; }\n`\n\n// Exit for overlays that unmount (use with usePresence). Append `exitAnimation` to each of\n// the element's `animation` declarations while it exits: the entrance stays in the list,\n// so it isn't restarted, and the fade runs on top of it. A fade is already the\n// reduced-motion form, so it needs no fallback of its own. While it fades, the backdrop\n// still catches clicks (so they can't reach the page behind it) and the panel is inert.\n// Exits accelerate: things leaving speed up as they go (decision 0037).\nexport const exitAnimation = css`, ${fadeOut} ${tokens.semantic.motion.duration.fast} ${tokens.semantic.motion.easing.accelerate} forwards`\n\n// Content for screen readers only. The 1px size and -1px margin are part of the standard\n// visually-hidden technique, not design values, so they aren't tokens.\nexport const visuallyHidden = css`\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n`\n\n// One interaction pattern for rows and items: list items, menu and listbox options, sidebars\n// (decision 0030). Unselected rows follow the naked Button's ladder; selected rows follow the\n// light-blue selected ladder, with the text darkening with its fill (decision 0016). Unselected\n// rows leave their text colour to the component, so a destructive row can stay red.\nconst { fill: rowFill, text: rowText } = tokens.semantic.color\n\nexport interface RowState {\n background: string\n text?: string\n}\n\nexport const rowStates: Record<'unselected' | 'selected', Record<'rest' | 'hover' | 'pressed', RowState>> = {\n unselected: {\n rest: { background: 'transparent' },\n hover: { background: rowFill.muted },\n pressed: { background: rowFill.default },\n },\n selected: {\n rest: { background: rowFill['accent-muted'], text: rowText.accent },\n hover: { background: rowFill['accent-muted-hover'], text: rowText.accent },\n pressed: { background: rowFill['accent-muted-pressed'], text: rowText.accent },\n },\n}\n\nconst rowDeclarations = ({ background, text }: RowState, textSelector?: string) => {\n if (!text) return `background-color: ${background};`\n return textSelector\n ? `background-color: ${background};\\n ${textSelector} { color: ${text}; }`\n : `background-color: ${background};\\n color: ${text};`\n}\n\n/**\n * The background (and, when selected, text) of an interactive row in every state.\n * - `focused`: keyboard focus that isn't DOM focus, such as a listbox option under\n * aria-activedescendant. It shows the hover state.\n * - `disabled`: shows the resting state, with no hover or press.\n * - `textSelector`: a descendant to colour when the row's text isn't the row itself, for example\n * text set by Typography. Pass it without `&`.\n */\nexport const interactiveRow = ({\n selected = false,\n focused = false,\n disabled = false,\n textSelector,\n}: {\n selected?: boolean\n focused?: boolean\n disabled?: boolean\n textSelector?: string\n} = {}) => {\n const states = selected ? rowStates.selected : rowStates.unselected\n if (disabled) return `${rowDeclarations(states.rest, textSelector)}\\n${rowForcedColors({ selected, focused, disabled, textSelector })}`\n return `\n ${rowDeclarations(focused ? states.hover : states.rest, textSelector)}\n\n &:hover {\n ${rowDeclarations(states.hover, textSelector)}\n }\n\n &:active {\n ${rowDeclarations(states.pressed, textSelector)}\n }\n\n ${rowForcedColors({ selected, focused, disabled, textSelector })}\n`\n}\n\n// Rows in forced colours (decision 0038): fills are dropped, so a selected row takes the system\n// selection colours, and a hovered or keyboard-active row is outlined in Highlight.\nconst rowForcedColors = ({\n selected,\n focused,\n disabled,\n textSelector,\n}: {\n selected: boolean\n focused: boolean\n disabled: boolean\n textSelector?: string\n}) => {\n const text = (color: string) => (textSelector ? `color: ${color};\\n ${textSelector} { color: ${color}; }` : `color: ${color};`)\n const hover = `outline: ${tokens.semantic.border.width.thin} solid Highlight;\\n outline-offset: calc(-1 * ${tokens.semantic.border.width.thin});`\n // A row that doesn't respond (disabled, or not interactive at all) keeps its selection but has\n // no hover outline. Disabled text is the component's to colour: callers also pass this for\n // static rows, which must stay CanvasText.\n // A selected row keeps forced-color-adjust: auto: the browser keeps system colours an author\n // sets, so the row stays Highlight with HighlightText. Its descendants' own colours would be\n // forced to CanvasText, so they inherit HighlightText, and anything drawn with a fill inside\n // (a chip or tag as the row's badge) drops it and keeps its edge. The doubled class outranks\n // the descendants' own rules.\n return `${forcedColors} {\n ${selected ? `background-color: Highlight;\\n ${text('HighlightText')}\\n && * {\\n color: inherit;\\n background-color: transparent;\\n }` : ''}\n ${!disabled && focused ? hover : ''}\n ${disabled ? '' : `&:hover {\\n ${hover}\\n }`}\n }`\n}\n"],"names":["breakpoints","xs","tokens","semantic","breakpoint","sm","md","lg","xl","media","concat","forcedColors","forcedColorsEdge","border","width","thin","reducedMotion","fadeOut","keyframes","templateObject_1","__makeTemplateObject","exitAnimation","css","templateObject_2","motion","duration","fast","easing","accelerate","visuallyHidden","_a","color","rowFill","fill","rowText","text","rowStates","unselected","rest","background","hover","muted","pressed","selected","accent","rowDeclarations","textSelector","interactiveRow","_b","_c","_d","focused","_e","disabled","states","rowForcedColors"],"mappings":";;;;;AAGA;AACO,IAAMA,WAAW,GAAG;AACzBC,EAAAA,EAAE,EAAEC,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACH,EAAE;AACjCI,EAAAA,EAAE,EAAEH,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACC,EAAE;AACjCC,EAAAA,EAAE,EAAEJ,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACE,EAAE;AACjCC,EAAAA,EAAE,EAAEL,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACG,EAAE;AACjCC,EAAAA,EAAE,EAAEN,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACI,EAAE;AACjC,EAAA,KAAK,EAAEN,MAAM,CAACC,QAAQ,CAACC,UAAU,CAAC,KAAK,CAAA;EACxC;AAED;AACO,IAAMK,KAAK,GAAG;EACnBR,EAAE,EAAE,qBAAA,CAAAS,MAAA,CAAsBV,WAAW,CAACC,EAAE,EAAG,GAAA,CAAA;EAC3CI,EAAE,EAAE,qBAAA,CAAAK,MAAA,CAAsBV,WAAW,CAACK,EAAE,EAAG,GAAA,CAAA;EAC3CC,EAAE,EAAE,qBAAA,CAAAI,MAAA,CAAsBV,WAAW,CAACM,EAAE,EAAG,GAAA,CAAA;EAC3CC,EAAE,EAAE,qBAAA,CAAAG,MAAA,CAAsBV,WAAW,CAACO,EAAE,EAAG,GAAA,CAAA;EAC3CC,EAAE,EAAE,qBAAA,CAAAE,MAAA,CAAsBV,WAAW,CAACQ,EAAE,EAAG,GAAA,CAAA;EAC3C,KAAK,EAAE,qBAAsB,CAAAE,MAAA,CAAAV,WAAW,CAAC,KAAK,CAAC,EAAG,GAAA,CAAA;EACnD;AAED;AACA;AACA;AACA;AACA;AACA;AACO,IAAMW,YAA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GAAG,2BAAoBb,KAAK,EAAA,SAAA,CAAS,UACpD,CAAA;AACJ,CAAC,CAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"styleUtils.mjs","sources":["../../src/lib/styleUtils.ts"],"sourcesContent":["import { css, keyframes } from 'styled-components'\nimport tokens from './cssTokens'\n\n// Breakpoints from the semantic tokens (decision 0014)\nexport const breakpoints = {\n xs: tokens.semantic.breakpoint.xs,\n sm: tokens.semantic.breakpoint.sm,\n md: tokens.semantic.breakpoint.md,\n lg: tokens.semantic.breakpoint.lg,\n xl: tokens.semantic.breakpoint.xl,\n '2xl': tokens.semantic.breakpoint['2xl'],\n}\n\n// Media query helpers\nexport const media = {\n xs: `@media (min-width: ${breakpoints.xs})`,\n sm: `@media (min-width: ${breakpoints.sm})`,\n md: `@media (min-width: ${breakpoints.md})`,\n lg: `@media (min-width: ${breakpoints.lg})`,\n xl: `@media (min-width: ${breakpoints.xl})`,\n '2xl': `@media (min-width: ${breakpoints['2xl']})`,\n}\n\n// Windows Contrast Themes and other forced-colours modes (decision 0038). The browser swaps in\n// the user's system colours, drops background colours and box-shadows, and keeps borders and\n// outlines. Inside this query, give a control that shows its edge with a fill alone a border,\n// and draw selected and checked states with system colours: ButtonText for control edges,\n// Highlight and HighlightText for selected and checked, GrayText for disabled, CanvasText for\n// content. Use forced-color-adjust: none only on a fill that carries state.\nexport const forcedColors = '@media (forced-colors: active)'\n\n/** A control's edge in forced colours, for a control that shows its edge with a fill alone. The\n * border follows the text colour the browser picks: ButtonText, LinkText, or GrayText when disabled. */\nexport const forcedColorsEdge = `${forcedColors} {\n border: ${tokens.semantic.border.width.thin} solid currentColor;\n}`\n\n// Wrap fallbacks for people who ask for less motion (decision 0005): movement becomes\n// an instant change or a simple fade. Colour and opacity transitions need no fallback.\nexport const reducedMotion = '@media (prefers-reduced-motion: reduce)'\n\n// No `from` keyframe: the fade starts from the element's current opacity, including a\n// still-running entrance, so closing mid-entrance doesn't jump back to fully visible.\nconst fadeOut = keyframes`\n to { opacity: 0; }\n`\n\n// Exit for overlays that unmount (use with usePresence). Append `exitAnimation` to each of\n// the element's `animation` declarations while it exits: the entrance stays in the list,\n// so it isn't restarted, and the fade runs on top of it. A fade is already the\n// reduced-motion form, so it needs no fallback of its own. While it fades, the backdrop\n// still catches clicks (so they can't reach the page behind it) and the panel is inert.\n// Exits accelerate: things leaving speed up as they go (decision 0037).\nexport const exitAnimation = css`, ${fadeOut} ${tokens.semantic.motion.duration.fast} ${tokens.semantic.motion.easing.accelerate} forwards`\n\n// Content for screen readers only. The 1px size and -1px margin are part of the standard\n// visually-hidden technique, not design values, so they aren't tokens.\nexport const visuallyHidden = css`\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n`\n\n// One interaction pattern for rows and items: list items, menu and listbox options, sidebars\n// (decision 0030). Unselected rows follow the naked Button's ladder; selected rows follow the\n// light-blue selected ladder, with the text darkening with its fill (decision 0016). Unselected\n// rows leave their text colour to the component, so a destructive row can stay red.\nconst { fill: rowFill, text: rowText } = tokens.semantic.color\n\n/** Corner radius of a button inside a field (a stepper, a clear or show-password button): one step tighter than the field, so its corner nests (decision 0055). */\nexport const fieldButtonRadius = tokens.semantic.radius.sm\n\n/** Corner radius every row and tab shares: the control radius (decision 0055). */\nexport const rowRadius = tokens.semantic.radius.md\n\nexport interface RowState {\n background: string\n text?: string\n}\n\nexport const rowStates: Record<'unselected' | 'selected', Record<'rest' | 'hover' | 'pressed', RowState>> = {\n unselected: {\n rest: { background: 'transparent' },\n hover: { background: rowFill.muted },\n pressed: { background: rowFill.default },\n },\n selected: {\n rest: { background: rowFill['accent-muted'], text: rowText.accent },\n hover: { background: rowFill['accent-muted-hover'], text: rowText.accent },\n pressed: { background: rowFill['accent-muted-pressed'], text: rowText.accent },\n },\n}\n\nconst rowDeclarations = ({ background, text }: RowState, textSelector?: string) => {\n if (!text) return `background-color: ${background};`\n return textSelector\n ? `background-color: ${background};\\n ${textSelector} { color: ${text}; }`\n : `background-color: ${background};\\n color: ${text};`\n}\n\n/**\n * The background (and, when selected, text) of an interactive row in every state.\n * - `focused`: keyboard focus that isn't DOM focus, such as a listbox option under\n * aria-activedescendant. It shows the hover state.\n * - `disabled`: shows the resting state, with no hover or press.\n * - `textSelector`: a descendant to colour when the row's text isn't the row itself, for example\n * text set by Typography. Pass it without `&`.\n */\nexport const interactiveRow = ({\n selected = false,\n focused = false,\n disabled = false,\n textSelector,\n}: {\n selected?: boolean\n focused?: boolean\n disabled?: boolean\n textSelector?: string\n} = {}) => {\n const states = selected ? rowStates.selected : rowStates.unselected\n if (disabled) return `${rowDeclarations(states.rest, textSelector)}\\n${rowForcedColors({ selected, focused, disabled, textSelector })}`\n return `\n ${rowDeclarations(focused ? states.hover : states.rest, textSelector)}\n\n &:hover {\n ${rowDeclarations(states.hover, textSelector)}\n }\n\n &:active {\n ${rowDeclarations(states.pressed, textSelector)}\n }\n\n ${rowForcedColors({ selected, focused, disabled, textSelector })}\n`\n}\n\n// Rows in forced colours (decision 0038): fills are dropped, so a selected row takes the system\n// selection colours, and a hovered or keyboard-active row is outlined in Highlight.\nconst rowForcedColors = ({\n selected,\n focused,\n disabled,\n textSelector,\n}: {\n selected: boolean\n focused: boolean\n disabled: boolean\n textSelector?: string\n}) => {\n const text = (color: string) => (textSelector ? `color: ${color};\\n ${textSelector} { color: ${color}; }` : `color: ${color};`)\n const hover = `outline: ${tokens.semantic.border.width.thin} solid Highlight;\\n outline-offset: calc(-1 * ${tokens.semantic.border.width.thin});`\n // A row that doesn't respond (disabled, or not interactive at all) keeps its selection but has\n // no hover outline. Disabled text is the component's to colour: callers also pass this for\n // static rows, which must stay CanvasText.\n // A selected row keeps forced-color-adjust: auto: the browser keeps system colours an author\n // sets, so the row stays Highlight with HighlightText. Its descendants' own colours would be\n // forced to CanvasText, so they inherit HighlightText, and anything drawn with a fill inside\n // (a chip or tag as the row's badge) drops it and keeps its edge. The doubled class outranks\n // the descendants' own rules.\n return `${forcedColors} {\n ${selected ? `background-color: Highlight;\\n ${text('HighlightText')}\\n && * {\\n color: inherit;\\n background-color: transparent;\\n }` : ''}\n ${!disabled && focused ? hover : ''}\n ${disabled ? '' : `&:hover {\\n ${hover}\\n }`}\n }`\n}\n"],"names":["breakpoints","xs","tokens","semantic","breakpoint","sm","md","lg","xl","media","concat","forcedColors","forcedColorsEdge","border","width","thin","reducedMotion","fadeOut","keyframes","templateObject_1","__makeTemplateObject","exitAnimation","css","templateObject_2","motion","duration","fast","easing","accelerate","visuallyHidden","_a","color","rowFill","fill","rowText","text","fieldButtonRadius","radius","rowRadius","rowStates","unselected","rest","background","hover","muted","pressed","selected","accent","rowDeclarations","textSelector","interactiveRow","_b","_c","_d","focused","_e","disabled","states","rowForcedColors"],"mappings":";;;;;AAGA;AACO,IAAMA,WAAW,GAAG;AACzBC,EAAAA,EAAE,EAAEC,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACH,EAAE;AACjCI,EAAAA,EAAE,EAAEH,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACC,EAAE;AACjCC,EAAAA,EAAE,EAAEJ,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACE,EAAE;AACjCC,EAAAA,EAAE,EAAEL,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACG,EAAE;AACjCC,EAAAA,EAAE,EAAEN,MAAM,CAACC,QAAQ,CAACC,UAAU,CAACI,EAAE;AACjC,EAAA,KAAK,EAAEN,MAAM,CAACC,QAAQ,CAACC,UAAU,CAAC,KAAK,CAAA;EACxC;AAED;AACO,IAAMK,KAAK,GAAG;EACnBR,EAAE,EAAE,qBAAA,CAAAS,MAAA,CAAsBV,WAAW,CAACC,EAAE,EAAG,GAAA,CAAA;EAC3CI,EAAE,EAAE,qBAAA,CAAAK,MAAA,CAAsBV,WAAW,CAACK,EAAE,EAAG,GAAA,CAAA;EAC3CC,EAAE,EAAE,qBAAA,CAAAI,MAAA,CAA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AK,GAAG,WAAY,CAAAjC,MAAA,CAAAR,MAAM,CAACC,QAAQ,CAACU,MAAM,CAACC,KAAK,CAACC,IAAI,EAAsD,qDAAA,CAAA,CAAAL,MAAA,CAAAR,MAAM,CAACC,QAAQ,CAACU,MAAM,CAACC,KAAK,CAACC,IAAI,EAAA,IAAA,CAAI,CAAA;AACtJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,OAAO,UAAGJ,YAAY,EAAA,UAAA,CAAA,CAAAD,MAAA,CAClBoC,QAAQ,GAAG,oCAAqC,CAAApC,MAAA,CAAAyB,IAAI,CAAC,eAAe,CAAC,qFAAkF,GAAG,EAAE,EAAA,QAAA,CAAA,CAAAzB,MAAA,CAC5J,CAAC8C,QAAQ,IAAIF,OAAO,GAAGX,KAAK,GAAG,EAAE,mBACjCa,QAAQ,GAAG,EAAE,GAAG,2BAAoBb,KAAK,EAAA,SAAA,CAAS,UACpD,CAAA;AACJ,CAAC,CAAA;;;;;"}
|
|
@@ -47,6 +47,7 @@ var radiusByKey = {
|
|
|
47
47
|
var backgroundByPath = {
|
|
48
48
|
'surface.base': surface.base,
|
|
49
49
|
'surface.raised': surface.raised,
|
|
50
|
+
'surface.overlay': surface.overlay,
|
|
50
51
|
'surface.scrim': surface.scrim,
|
|
51
52
|
'color.fill.emphasis': color.fill.emphasis,
|
|
52
53
|
'color.fill.muted': color.fill.muted,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenAliases.mjs","sources":["../../src/lib/tokenAliases.ts"],"sourcesContent":["import tokens from './cssTokens'\nimport type { Tokens } from '../types/tokens'\n\n// Box's spacing and radius props keep their own names, which 3.0 decoupled from the removed\n// spacing.layout and border.radius tokens (P7, #99), and read the semantic grammar's tokens\n// (decision 0031). Each map covers every key the prop type allows, so TypeScript fails here if a\n// key is added without a mapping.\nconst { semantic } = tokens\nconst { color, space, radius, surface } = semantic\n\ntype Semantic = Tokens['semantic']\n\n/** Box's spacing values (`p`, `m`, `gap`…), each a `space` step, plus `auto`. */\nexport type BoxSpace =\n | 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl' | '10xl' | '11xl'\n | 'auto'\n\n/** Box's spacing props: each name maps to the space step that replaced its spacing.layout token. */\nexport const spaceByLayoutKey: Record<BoxSpace, string> = {\n none: space[0],\n xs: space[100],\n sm: space[200],\n md: space[300],\n lg: space[400],\n xl: space[500],\n '2xl': space[600],\n '3xl': space[700],\n '4xl': space[800],\n '5xl': space[900],\n '6xl': space[1000],\n '7xl': space[1200],\n '8xl': space[1400],\n '9xl': space[1600],\n '10xl': space[2000],\n '11xl': space[2400],\n // A keyword, not a step (0031)\n auto: semantic.spacing.layout.auto,\n}\n\n/** Box's `borderRadius` values: the `radius` steps, with `circle` for `full`. */\nexport type BoxRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'circle'\n\n/** Box's `borderRadius` prop, read from `radius`. */\nexport const radiusByKey: Record<BoxRadius, string> = {\n none: radius.none,\n xs: radius.xs,\n sm: radius.sm,\n md: radius.md,\n lg: radius.lg,\n xl: radius.xl,\n '2xl': radius['2xl'],\n '3xl': radius['3xl'],\n circle: radius.full,\n}\n\n/**\n * Box's `bg` values in the semantic grammar (decision 0031, #304): the token's path below\n * `semantic`, such as `surface.raised` or `color.fill.muted`.\n */\nexport type BackgroundPath =\n | `surface.${keyof Semantic['surface']}`\n | `color.fill.${keyof Semantic['color']['fill']}`\n\n/** Box's `bg` prop: the grammar's token paths, read from the token at that path. */\nexport const backgroundByPath: Record<BackgroundPath, string> = {\n 'surface.base': surface.base,\n 'surface.raised': surface.raised,\n 'surface.scrim': surface.scrim,\n 'color.fill.emphasis': color.fill.emphasis,\n 'color.fill.muted': color.fill.muted,\n 'color.fill.inverse': color.fill.inverse,\n 'color.fill.accent': color.fill.accent,\n 'color.fill.accent-hover': color.fill['accent-hover'],\n 'color.fill.accent-pressed': color.fill['accent-pressed'],\n 'color.fill.accent-muted': color.fill['accent-muted'],\n 'color.fill.accent-muted-hover': color.fill['accent-muted-hover'],\n 'color.fill.accent-muted-pressed': color.fill['accent-muted-pressed'],\n 'color.fill.danger': color.fill.danger,\n 'color.fill.danger-hover': color.fill['danger-hover'],\n 'color.fill.danger-pressed': color.fill['danger-pressed'],\n 'color.fill.danger-muted': color.fill['danger-muted'],\n 'color.fill.success': color.fill.success,\n 'color.fill.success-muted': color.fill['success-muted'],\n 'color.fill.warning': color.fill.warning,\n 'color.fill.warning-muted': color.fill['warning-muted'],\n 'color.fill.serious': color.fill.serious,\n 'color.fill.serious-muted': color.fill['serious-muted'],\n 'color.fill.ai-muted': color.fill['ai-muted'],\n 'color.fill.disabled': color.fill.disabled,\n 'color.fill.default': color.fill.default,\n 'color.fill.default-hover': color.fill['default-hover'],\n 'color.fill.default-pressed': color.fill['default-pressed'],\n 'color.fill.none': color.fill.none,\n 'color.fill.none-hover': color.fill['none-hover'],\n 'color.fill.none-pressed': color.fill['none-pressed'],\n 'color.fill.inverse-none-hover': color.fill['inverse-none-hover'],\n}\n\n/** Box's `color` prop: the text colours. */\nexport const textColorByKey: Record<keyof Semantic['color']['text'], string> = color.text\n\n/** Box's border props: the border colours. */\nexport const borderColorByKey: Record<keyof Semantic['color']['border'], string> = color.border\n"],"names":["semantic","tokens","color","space","radius","surface","spaceByLayoutKey","none","xs","sm","md","lg","xl","auto","spacing","layout","radiusByKey","circle","full","backgroundByPath","base","raised","scrim","fill","emphasis","muted","inverse","accent","danger","success","warning","serious","disabled","textColorByKey","text","borderColorByKey","border"],"mappings":";;;AAGA;AACA;AACA;AACA;AACQ,IAAAA,QAAQ,GAAKC,MAAM,CAAAD,QAAX,CAAA;AACR,IAAAE,KAAK,GAA6BF,QAAQ,MAArC;EAAEG,KAAK,GAAsBH,QAAQ,CAAAG,KAA9B;EAAEC,MAAM,GAAcJ,QAAQ,CAAtBI,MAAA;EAAEC,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AM,CAAC,KAAK,CAAC;AACpB,EAAA,KAAK,EAAEA,MAAM,CAAC,KAAK,CAAC;EACpBa,MAAM,EAAEb,MAAM,CAACc,IAAAA;EAChB;AAUD;AACO,IAAMC,gBAAgB,GAAmC;EAC9D,cAAc,EAAEd,OAAO,CAACe,IAAI;EAC5B,gBAAgB,EAAEf,OAAO,CAACgB,MAAM;EAChC,
|
|
1
|
+
{"version":3,"file":"tokenAliases.mjs","sources":["../../src/lib/tokenAliases.ts"],"sourcesContent":["import tokens from './cssTokens'\nimport type { Tokens } from '../types/tokens'\n\n// Box's spacing and radius props keep their own names, which 3.0 decoupled from the removed\n// spacing.layout and border.radius tokens (P7, #99), and read the semantic grammar's tokens\n// (decision 0031). Each map covers every key the prop type allows, so TypeScript fails here if a\n// key is added without a mapping.\nconst { semantic } = tokens\nconst { color, space, radius, surface } = semantic\n\ntype Semantic = Tokens['semantic']\n\n/** Box's spacing values (`p`, `m`, `gap`…), each a `space` step, plus `auto`. */\nexport type BoxSpace =\n | 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl' | '10xl' | '11xl'\n | 'auto'\n\n/** Box's spacing props: each name maps to the space step that replaced its spacing.layout token. */\nexport const spaceByLayoutKey: Record<BoxSpace, string> = {\n none: space[0],\n xs: space[100],\n sm: space[200],\n md: space[300],\n lg: space[400],\n xl: space[500],\n '2xl': space[600],\n '3xl': space[700],\n '4xl': space[800],\n '5xl': space[900],\n '6xl': space[1000],\n '7xl': space[1200],\n '8xl': space[1400],\n '9xl': space[1600],\n '10xl': space[2000],\n '11xl': space[2400],\n // A keyword, not a step (0031)\n auto: semantic.spacing.layout.auto,\n}\n\n/** Box's `borderRadius` values: the `radius` steps, with `circle` for `full`. */\nexport type BoxRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'circle'\n\n/** Box's `borderRadius` prop, read from `radius`. */\nexport const radiusByKey: Record<BoxRadius, string> = {\n none: radius.none,\n xs: radius.xs,\n sm: radius.sm,\n md: radius.md,\n lg: radius.lg,\n xl: radius.xl,\n '2xl': radius['2xl'],\n '3xl': radius['3xl'],\n circle: radius.full,\n}\n\n/**\n * Box's `bg` values in the semantic grammar (decision 0031, #304): the token's path below\n * `semantic`, such as `surface.raised` or `color.fill.muted`.\n */\nexport type BackgroundPath =\n | `surface.${keyof Semantic['surface']}`\n | `color.fill.${keyof Semantic['color']['fill']}`\n\n/** Box's `bg` prop: the grammar's token paths, read from the token at that path. */\nexport const backgroundByPath: Record<BackgroundPath, string> = {\n 'surface.base': surface.base,\n 'surface.raised': surface.raised,\n 'surface.overlay': surface.overlay,\n 'surface.scrim': surface.scrim,\n 'color.fill.emphasis': color.fill.emphasis,\n 'color.fill.muted': color.fill.muted,\n 'color.fill.inverse': color.fill.inverse,\n 'color.fill.accent': color.fill.accent,\n 'color.fill.accent-hover': color.fill['accent-hover'],\n 'color.fill.accent-pressed': color.fill['accent-pressed'],\n 'color.fill.accent-muted': color.fill['accent-muted'],\n 'color.fill.accent-muted-hover': color.fill['accent-muted-hover'],\n 'color.fill.accent-muted-pressed': color.fill['accent-muted-pressed'],\n 'color.fill.danger': color.fill.danger,\n 'color.fill.danger-hover': color.fill['danger-hover'],\n 'color.fill.danger-pressed': color.fill['danger-pressed'],\n 'color.fill.danger-muted': color.fill['danger-muted'],\n 'color.fill.success': color.fill.success,\n 'color.fill.success-muted': color.fill['success-muted'],\n 'color.fill.warning': color.fill.warning,\n 'color.fill.warning-muted': color.fill['warning-muted'],\n 'color.fill.serious': color.fill.serious,\n 'color.fill.serious-muted': color.fill['serious-muted'],\n 'color.fill.ai-muted': color.fill['ai-muted'],\n 'color.fill.disabled': color.fill.disabled,\n 'color.fill.default': color.fill.default,\n 'color.fill.default-hover': color.fill['default-hover'],\n 'color.fill.default-pressed': color.fill['default-pressed'],\n 'color.fill.none': color.fill.none,\n 'color.fill.none-hover': color.fill['none-hover'],\n 'color.fill.none-pressed': color.fill['none-pressed'],\n 'color.fill.inverse-none-hover': color.fill['inverse-none-hover'],\n}\n\n/** Box's `color` prop: the text colours. */\nexport const textColorByKey: Record<keyof Semantic['color']['text'], string> = color.text\n\n/** Box's border props: the border colours. */\nexport const borderColorByKey: Record<keyof Semantic['color']['border'], string> = color.border\n"],"names":["semantic","tokens","color","space","radius","surface","spaceByLayoutKey","none","xs","sm","md","lg","xl","auto","spacing","layout","radiusByKey","circle","full","backgroundByPath","base","raised","overlay","scrim","fill","emphasis","muted","inverse","accent","danger","success","warning","serious","disabled","textColorByKey","text","borderColorByKey","border"],"mappings":";;;AAGA;AACA;AACA;AACA;AACQ,IAAAA,QAAQ,GAAKC,MAAM,CAAAD,QAAX,CAAA;AACR,IAAAE,KAAK,GAA6BF,QAAQ,MAArC;EAAEG,KAAK,GAAsBH,QAAQ,CAAAG,KAA9B;EAAEC,MAAM,GAAcJ,QAAQ,CAAtBI,MAAA;EAAEC,OAAO,GAAKL,QAAQ,QAAb,CAAA;AAUrC;AACO,IAAMM,gBAAgB,GAA6B;AACxDC,EAAAA,IAAI,EAAEJ,KAAK,CAAC,CAAC,CAAC;AACdK,EAAAA,EAAE,EAAEL,KAAK,CAAC,GAAG,CAAC;AACdM,EAAAA,EAAE,EAAEN,KAAK,CAAC,GAAG,CAAC;AACdO,EAAAA,EAAE,EAAEP,KAAK,CAAC,GAAG,CAAC;AACdQ,EAAAA,EAAE,EAAER,KAAK,CAAC,GAAG,CAAC;AACdS,EAAAA,EAAE,EAAET,KAAK,CAAC,GAAG,CAAC;AACd,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,GAAG,CAAC;AACjB,EAAA,KAAK,EAAEA,KAAK,CAAC,IAAI,CAAC;AAClB,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AiB,CAAC;AAC3D,EAAA,iBAAiB,EAAEtB,KAAK,CAACsB,IAAI,CAACjB,IAAI;AAClC,EAAA,uBAAuB,EAAEL,KAAK,CAACsB,IAAI,CAAC,YAAY,CAAC;AACjD,EAAA,yBAAyB,EAAEtB,KAAK,CAACsB,IAAI,CAAC,cAAc,CAAC;AACrD,EAAA,+BAA+B,EAAEtB,KAAK,CAACsB,IAAI,CAAC,oBAAoB,CAAA;EACjE;AAED;AACaU,IAAAA,cAAc,GAAoDhC,KAAK,CAACiC,KAAI;AAEzF;AACaC,IAAAA,gBAAgB,GAAsDlC,KAAK,CAACmC;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useEffect, type RefObject } from 'react';
|
|
2
2
|
import { type FloatingAlign, type FloatingSide } from './floatingPosition.mjs';
|
|
3
3
|
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
4
|
+
/** The trigger's width in px, set on the floating element when `matchAnchorWidth` is on */
|
|
5
|
+
export declare const ANCHOR_WIDTH_VAR = "--co-floating-anchor-width";
|
|
4
6
|
interface FloatingLayerOptions {
|
|
5
7
|
/** Whether the floating element is rendered */
|
|
6
8
|
isPresent: boolean;
|
|
@@ -10,6 +12,11 @@ interface FloatingLayerOptions {
|
|
|
10
12
|
anchorRef: RefObject<Element | null>;
|
|
11
13
|
side: FloatingSide;
|
|
12
14
|
align: FloatingAlign;
|
|
15
|
+
/**
|
|
16
|
+
* Writes the trigger's width to `ANCHOR_WIDTH_VAR` on the floating element before each placement,
|
|
17
|
+
* so its CSS can be at least as wide as the trigger
|
|
18
|
+
*/
|
|
19
|
+
matchAnchorWidth?: boolean;
|
|
13
20
|
/**
|
|
14
21
|
* Called when the trigger may have moved away from the floating element: the page or a container
|
|
15
22
|
* scrolled (anything but the floating element itself), or the window resized
|
|
@@ -21,5 +28,5 @@ interface FloatingLayerOptions {
|
|
|
21
28
|
* paints, and places it again whenever its size changes. A gap of `space.100` separates it from the
|
|
22
29
|
* trigger, and it keeps `space.200` from the viewport's edges.
|
|
23
30
|
*/
|
|
24
|
-
export declare function useFloatingLayer({ isPresent, floatingRef, anchorRef, side, align, onDetach }: FloatingLayerOptions): void;
|
|
31
|
+
export declare function useFloatingLayer({ isPresent, floatingRef, anchorRef, side, align, matchAnchorWidth, onDetach, }: FloatingLayerOptions): void;
|
|
25
32
|
export {};
|