@sanity/ui 2.1.15-canary.6 → 2.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.
Files changed (39) hide show
  1. package/dist/index.d.mts +2 -7
  2. package/dist/index.d.ts +2 -7
  3. package/dist/index.esm.js +2964 -2988
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +2964 -2987
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +2964 -2988
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/theme.esm.js +478 -1283
  10. package/dist/theme.esm.js.map +1 -1
  11. package/dist/theme.js +478 -1283
  12. package/dist/theme.js.map +1 -1
  13. package/dist/theme.mjs +478 -1283
  14. package/dist/theme.mjs.map +1 -1
  15. package/package.json +39 -37
  16. package/src/core/components/autocomplete/autocomplete.tsx +12 -9
  17. package/src/core/components/dialog/dialog.tsx +32 -20
  18. package/src/core/components/menu/menu.tsx +6 -8
  19. package/src/core/components/menu/menuItem.tsx +10 -10
  20. package/src/core/components/tab/tab.tsx +12 -9
  21. package/src/core/components/tree/tree.tsx +8 -21
  22. package/src/core/hooks/useArrayProp.ts +10 -1
  23. package/src/core/hooks/useForwardedRef.ts +11 -9
  24. package/src/core/hooks/useIsomorphicEffect.ts +0 -1
  25. package/src/core/primitives/card/__workshop__/props.tsx +2 -0
  26. package/src/core/primitives/card/card.tsx +3 -0
  27. package/src/core/primitives/card/styles.ts +2 -2
  28. package/src/core/primitives/card/types.ts +1 -0
  29. package/src/core/primitives/checkbox/checkbox.tsx +5 -10
  30. package/src/core/primitives/popover/popover.tsx +13 -13
  31. package/src/core/primitives/radio/radio.tsx +3 -8
  32. package/src/core/primitives/select/select.tsx +3 -8
  33. package/src/core/primitives/switch/switch.tsx +4 -8
  34. package/src/core/primitives/textArea/textArea.tsx +3 -8
  35. package/src/core/primitives/textInput/textInput.tsx +4 -16
  36. package/src/core/primitives/tooltip/tooltip.tsx +5 -8
  37. package/src/core/utils/elementQuery/elementQuery.tsx +11 -10
  38. package/src/core/utils/layer/layer.tsx +13 -8
  39. package/src/core/utils/virtualList/virtualList.tsx +8 -10
package/dist/theme.esm.js CHANGED
@@ -55,226 +55,46 @@ function _createSelectableStates(opts, base, dark, solid, muted, tone) {
55
55
  function createSolidTones(opts, base, dark, name) {
56
56
  return {
57
57
  default: {
58
- enabled: opts.solid({
59
- base,
60
- dark,
61
- tone: "default",
62
- name,
63
- state: "enabled"
64
- }),
65
- disabled: opts.solid({
66
- base,
67
- dark,
68
- tone: "default",
69
- name,
70
- state: "disabled"
71
- }),
72
- hovered: opts.solid({
73
- base,
74
- dark,
75
- tone: "default",
76
- name,
77
- state: "hovered"
78
- }),
79
- pressed: opts.solid({
80
- base,
81
- dark,
82
- tone: "default",
83
- name,
84
- state: "pressed"
85
- }),
86
- selected: opts.solid({
87
- base,
88
- dark,
89
- tone: "default",
90
- name,
91
- state: "selected"
92
- })
58
+ enabled: opts.solid({ base, dark, tone: "default", name, state: "enabled" }),
59
+ disabled: opts.solid({ base, dark, tone: "default", name, state: "disabled" }),
60
+ hovered: opts.solid({ base, dark, tone: "default", name, state: "hovered" }),
61
+ pressed: opts.solid({ base, dark, tone: "default", name, state: "pressed" }),
62
+ selected: opts.solid({ base, dark, tone: "default", name, state: "selected" })
93
63
  },
94
64
  transparent: {
95
- enabled: opts.solid({
96
- base,
97
- dark,
98
- tone: "transparent",
99
- name,
100
- state: "enabled"
101
- }),
102
- disabled: opts.solid({
103
- base,
104
- dark,
105
- tone: "transparent",
106
- name,
107
- state: "disabled"
108
- }),
109
- hovered: opts.solid({
110
- base,
111
- dark,
112
- tone: "transparent",
113
- name,
114
- state: "hovered"
115
- }),
116
- pressed: opts.solid({
117
- base,
118
- dark,
119
- tone: "transparent",
120
- name,
121
- state: "pressed"
122
- }),
123
- selected: opts.solid({
124
- base,
125
- dark,
126
- tone: "transparent",
127
- name,
128
- state: "selected"
129
- })
65
+ enabled: opts.solid({ base, dark, tone: "transparent", name, state: "enabled" }),
66
+ disabled: opts.solid({ base, dark, tone: "transparent", name, state: "disabled" }),
67
+ hovered: opts.solid({ base, dark, tone: "transparent", name, state: "hovered" }),
68
+ pressed: opts.solid({ base, dark, tone: "transparent", name, state: "pressed" }),
69
+ selected: opts.solid({ base, dark, tone: "transparent", name, state: "selected" })
130
70
  },
131
71
  primary: {
132
- enabled: opts.solid({
133
- base,
134
- dark,
135
- tone: "primary",
136
- name,
137
- state: "enabled"
138
- }),
139
- disabled: opts.solid({
140
- base,
141
- dark,
142
- tone: "primary",
143
- name,
144
- state: "disabled"
145
- }),
146
- hovered: opts.solid({
147
- base,
148
- dark,
149
- tone: "primary",
150
- name,
151
- state: "hovered"
152
- }),
153
- pressed: opts.solid({
154
- base,
155
- dark,
156
- tone: "primary",
157
- name,
158
- state: "pressed"
159
- }),
160
- selected: opts.solid({
161
- base,
162
- dark,
163
- tone: "primary",
164
- name,
165
- state: "selected"
166
- })
72
+ enabled: opts.solid({ base, dark, tone: "primary", name, state: "enabled" }),
73
+ disabled: opts.solid({ base, dark, tone: "primary", name, state: "disabled" }),
74
+ hovered: opts.solid({ base, dark, tone: "primary", name, state: "hovered" }),
75
+ pressed: opts.solid({ base, dark, tone: "primary", name, state: "pressed" }),
76
+ selected: opts.solid({ base, dark, tone: "primary", name, state: "selected" })
167
77
  },
168
78
  positive: {
169
- enabled: opts.solid({
170
- base,
171
- dark,
172
- tone: "positive",
173
- name,
174
- state: "enabled"
175
- }),
176
- disabled: opts.solid({
177
- base,
178
- dark,
179
- tone: "positive",
180
- name,
181
- state: "disabled"
182
- }),
183
- hovered: opts.solid({
184
- base,
185
- dark,
186
- tone: "positive",
187
- name,
188
- state: "hovered"
189
- }),
190
- pressed: opts.solid({
191
- base,
192
- dark,
193
- tone: "positive",
194
- name,
195
- state: "pressed"
196
- }),
197
- selected: opts.solid({
198
- base,
199
- dark,
200
- tone: "positive",
201
- name,
202
- state: "selected"
203
- })
79
+ enabled: opts.solid({ base, dark, tone: "positive", name, state: "enabled" }),
80
+ disabled: opts.solid({ base, dark, tone: "positive", name, state: "disabled" }),
81
+ hovered: opts.solid({ base, dark, tone: "positive", name, state: "hovered" }),
82
+ pressed: opts.solid({ base, dark, tone: "positive", name, state: "pressed" }),
83
+ selected: opts.solid({ base, dark, tone: "positive", name, state: "selected" })
204
84
  },
205
85
  caution: {
206
- enabled: opts.solid({
207
- base,
208
- dark,
209
- tone: "caution",
210
- name,
211
- state: "enabled"
212
- }),
213
- disabled: opts.solid({
214
- base,
215
- dark,
216
- tone: "caution",
217
- name,
218
- state: "disabled"
219
- }),
220
- hovered: opts.solid({
221
- base,
222
- dark,
223
- tone: "caution",
224
- name,
225
- state: "hovered"
226
- }),
227
- pressed: opts.solid({
228
- base,
229
- dark,
230
- tone: "caution",
231
- name,
232
- state: "pressed"
233
- }),
234
- selected: opts.solid({
235
- base,
236
- dark,
237
- tone: "caution",
238
- name,
239
- state: "selected"
240
- })
86
+ enabled: opts.solid({ base, dark, tone: "caution", name, state: "enabled" }),
87
+ disabled: opts.solid({ base, dark, tone: "caution", name, state: "disabled" }),
88
+ hovered: opts.solid({ base, dark, tone: "caution", name, state: "hovered" }),
89
+ pressed: opts.solid({ base, dark, tone: "caution", name, state: "pressed" }),
90
+ selected: opts.solid({ base, dark, tone: "caution", name, state: "selected" })
241
91
  },
242
92
  critical: {
243
- enabled: opts.solid({
244
- base,
245
- dark,
246
- tone: "critical",
247
- name,
248
- state: "enabled"
249
- }),
250
- disabled: opts.solid({
251
- base,
252
- dark,
253
- tone: "critical",
254
- name,
255
- state: "disabled"
256
- }),
257
- hovered: opts.solid({
258
- base,
259
- dark,
260
- tone: "critical",
261
- name,
262
- state: "hovered"
263
- }),
264
- pressed: opts.solid({
265
- base,
266
- dark,
267
- tone: "critical",
268
- name,
269
- state: "pressed"
270
- }),
271
- selected: opts.solid({
272
- base,
273
- dark,
274
- tone: "critical",
275
- name,
276
- state: "selected"
277
- })
93
+ enabled: opts.solid({ base, dark, tone: "critical", name, state: "enabled" }),
94
+ disabled: opts.solid({ base, dark, tone: "critical", name, state: "disabled" }),
95
+ hovered: opts.solid({ base, dark, tone: "critical", name, state: "hovered" }),
96
+ pressed: opts.solid({ base, dark, tone: "critical", name, state: "pressed" }),
97
+ selected: opts.solid({ base, dark, tone: "critical", name, state: "selected" })
278
98
  }
279
99
  };
280
100
  }
@@ -465,10 +285,7 @@ const black = "hsl(0, 0%, 0%)", white = "hsl(0, 0%, 100%)", colors = {
465
285
  focusRing: [colors.critical.base, colors.critical.base]
466
286
  }
467
287
  }, defaultOpts = {
468
- base: ({
469
- dark,
470
- name
471
- }) => name === "default" ? {
288
+ base: ({ dark, name }) => name === "default" ? {
472
289
  bg: dark ? black : white,
473
290
  fg: dark ? white : black,
474
291
  border: dark ? colors.default.darkest : colors.default.lightest,
@@ -499,12 +316,7 @@ const black = "hsl(0, 0%, 0%)", white = "hsl(0, 0%, 100%)", colors = {
499
316
  to: dark ? white : black
500
317
  }
501
318
  },
502
- solid: ({
503
- base,
504
- dark,
505
- state,
506
- tone
507
- }) => {
319
+ solid: ({ base, dark, state, tone }) => {
508
320
  const color2 = colors[tone];
509
321
  return state === "hovered" ? {
510
322
  bg: dark ? color2.light : color2.dark,
@@ -548,12 +360,7 @@ const black = "hsl(0, 0%, 0%)", white = "hsl(0, 0%, 100%)", colors = {
548
360
  skeleton: base.skeleton
549
361
  };
550
362
  },
551
- muted: ({
552
- base,
553
- dark,
554
- state,
555
- tone
556
- }) => {
363
+ muted: ({ base, dark, state, tone }) => {
557
364
  const color2 = colors[tone];
558
365
  return state === "hovered" ? {
559
366
  bg: dark ? color2.darker : color2.lighter,
@@ -597,12 +404,7 @@ const black = "hsl(0, 0%, 0%)", white = "hsl(0, 0%, 100%)", colors = {
597
404
  skeleton: base.skeleton
598
405
  };
599
406
  },
600
- button: ({
601
- base,
602
- mode,
603
- muted,
604
- solid
605
- }) => mode === "bleed" ? {
407
+ button: ({ base, mode, muted, solid }) => mode === "bleed" ? {
606
408
  ...muted,
607
409
  enabled: {
608
410
  bg: "transparent",
@@ -650,9 +452,7 @@ const black = "hsl(0, 0%, 0%)", white = "hsl(0, 0%, 100%)", colors = {
650
452
  ...solid,
651
453
  enabled: muted.enabled
652
454
  } : solid,
653
- card: ({
654
- base
655
- }) => ({
455
+ card: ({ base }) => ({
656
456
  bg: black,
657
457
  bg2: black,
658
458
  fg: black,
@@ -680,14 +480,8 @@ const black = "hsl(0, 0%, 0%)", white = "hsl(0, 0%, 100%)", colors = {
680
480
  border: black,
681
481
  placeholder: black
682
482
  }),
683
- selectable: ({
684
- muted,
685
- state,
686
- tone
687
- }) => muted[tone][state],
688
- spot: ({
689
- key
690
- }) => spots[key],
483
+ selectable: ({ muted, state, tone }) => muted[tone][state],
484
+ spot: ({ key }) => spots[key],
691
485
  syntax: () => ({
692
486
  atrule: black,
693
487
  attrName: black,
@@ -802,283 +596,64 @@ function createInputModes(opts, base, dark, solid, muted) {
802
596
  function createMutedTones(opts, base, dark, name) {
803
597
  return {
804
598
  default: {
805
- enabled: opts.muted({
806
- base,
807
- dark,
808
- tone: "default",
809
- name,
810
- state: "enabled"
811
- }),
812
- disabled: opts.muted({
813
- base,
814
- dark,
815
- tone: "default",
816
- name,
817
- state: "disabled"
818
- }),
819
- hovered: opts.muted({
820
- base,
821
- dark,
822
- tone: "default",
823
- name,
824
- state: "hovered"
825
- }),
826
- pressed: opts.muted({
827
- base,
828
- dark,
829
- tone: "default",
830
- name,
831
- state: "pressed"
832
- }),
833
- selected: opts.muted({
834
- base,
835
- dark,
836
- tone: "default",
837
- name,
838
- state: "selected"
839
- })
599
+ enabled: opts.muted({ base, dark, tone: "default", name, state: "enabled" }),
600
+ disabled: opts.muted({ base, dark, tone: "default", name, state: "disabled" }),
601
+ hovered: opts.muted({ base, dark, tone: "default", name, state: "hovered" }),
602
+ pressed: opts.muted({ base, dark, tone: "default", name, state: "pressed" }),
603
+ selected: opts.muted({ base, dark, tone: "default", name, state: "selected" })
840
604
  },
841
605
  transparent: {
842
- enabled: opts.muted({
843
- base,
844
- dark,
845
- tone: "transparent",
846
- name,
847
- state: "enabled"
848
- }),
849
- disabled: opts.muted({
850
- base,
851
- dark,
852
- tone: "transparent",
853
- name,
854
- state: "disabled"
855
- }),
856
- hovered: opts.muted({
857
- base,
858
- dark,
859
- tone: "transparent",
860
- name,
861
- state: "hovered"
862
- }),
863
- pressed: opts.muted({
864
- base,
865
- dark,
866
- tone: "transparent",
867
- name,
868
- state: "pressed"
869
- }),
870
- selected: opts.muted({
871
- base,
872
- dark,
873
- tone: "transparent",
874
- name,
875
- state: "selected"
876
- })
606
+ enabled: opts.muted({ base, dark, tone: "transparent", name, state: "enabled" }),
607
+ disabled: opts.muted({ base, dark, tone: "transparent", name, state: "disabled" }),
608
+ hovered: opts.muted({ base, dark, tone: "transparent", name, state: "hovered" }),
609
+ pressed: opts.muted({ base, dark, tone: "transparent", name, state: "pressed" }),
610
+ selected: opts.muted({ base, dark, tone: "transparent", name, state: "selected" })
877
611
  },
878
612
  primary: {
879
- enabled: opts.muted({
880
- base,
881
- dark,
882
- tone: "primary",
883
- name,
884
- state: "enabled"
885
- }),
886
- disabled: opts.muted({
887
- base,
888
- dark,
889
- tone: "primary",
890
- name,
891
- state: "disabled"
892
- }),
893
- hovered: opts.muted({
894
- base,
895
- dark,
896
- tone: "primary",
897
- name,
898
- state: "hovered"
899
- }),
900
- pressed: opts.muted({
901
- base,
902
- dark,
903
- tone: "primary",
904
- name,
905
- state: "pressed"
906
- }),
907
- selected: opts.muted({
908
- base,
909
- dark,
910
- tone: "primary",
911
- name,
912
- state: "selected"
913
- })
613
+ enabled: opts.muted({ base, dark, tone: "primary", name, state: "enabled" }),
614
+ disabled: opts.muted({ base, dark, tone: "primary", name, state: "disabled" }),
615
+ hovered: opts.muted({ base, dark, tone: "primary", name, state: "hovered" }),
616
+ pressed: opts.muted({ base, dark, tone: "primary", name, state: "pressed" }),
617
+ selected: opts.muted({ base, dark, tone: "primary", name, state: "selected" })
914
618
  },
915
619
  positive: {
916
- enabled: opts.muted({
917
- base,
918
- dark,
919
- tone: "positive",
920
- name,
921
- state: "enabled"
922
- }),
923
- disabled: opts.muted({
924
- base,
925
- dark,
926
- tone: "positive",
927
- name,
928
- state: "disabled"
929
- }),
930
- hovered: opts.muted({
931
- base,
932
- dark,
933
- tone: "positive",
934
- name,
935
- state: "hovered"
936
- }),
937
- pressed: opts.muted({
938
- base,
939
- dark,
940
- tone: "positive",
941
- name,
942
- state: "pressed"
943
- }),
944
- selected: opts.muted({
945
- base,
946
- dark,
947
- tone: "positive",
948
- name,
949
- state: "selected"
950
- })
620
+ enabled: opts.muted({ base, dark, tone: "positive", name, state: "enabled" }),
621
+ disabled: opts.muted({ base, dark, tone: "positive", name, state: "disabled" }),
622
+ hovered: opts.muted({ base, dark, tone: "positive", name, state: "hovered" }),
623
+ pressed: opts.muted({ base, dark, tone: "positive", name, state: "pressed" }),
624
+ selected: opts.muted({ base, dark, tone: "positive", name, state: "selected" })
951
625
  },
952
626
  caution: {
953
- enabled: opts.muted({
954
- base,
955
- dark,
956
- tone: "caution",
957
- name,
958
- state: "enabled"
959
- }),
960
- disabled: opts.muted({
961
- base,
962
- dark,
963
- tone: "caution",
964
- name,
965
- state: "disabled"
966
- }),
967
- hovered: opts.muted({
968
- base,
969
- dark,
970
- tone: "caution",
971
- name,
972
- state: "hovered"
973
- }),
974
- pressed: opts.muted({
975
- base,
976
- dark,
977
- tone: "caution",
978
- name,
979
- state: "pressed"
980
- }),
981
- selected: opts.muted({
982
- base,
983
- dark,
984
- tone: "caution",
985
- name,
986
- state: "selected"
987
- })
627
+ enabled: opts.muted({ base, dark, tone: "caution", name, state: "enabled" }),
628
+ disabled: opts.muted({ base, dark, tone: "caution", name, state: "disabled" }),
629
+ hovered: opts.muted({ base, dark, tone: "caution", name, state: "hovered" }),
630
+ pressed: opts.muted({ base, dark, tone: "caution", name, state: "pressed" }),
631
+ selected: opts.muted({ base, dark, tone: "caution", name, state: "selected" })
988
632
  },
989
633
  critical: {
990
- enabled: opts.muted({
991
- base,
992
- dark,
993
- tone: "critical",
994
- name,
995
- state: "enabled"
996
- }),
997
- disabled: opts.muted({
998
- base,
999
- dark,
1000
- tone: "critical",
1001
- name,
1002
- state: "disabled"
1003
- }),
1004
- hovered: opts.muted({
1005
- base,
1006
- dark,
1007
- tone: "critical",
1008
- name,
1009
- state: "hovered"
1010
- }),
1011
- pressed: opts.muted({
1012
- base,
1013
- dark,
1014
- tone: "critical",
1015
- name,
1016
- state: "pressed"
1017
- }),
1018
- selected: opts.muted({
1019
- base,
1020
- dark,
1021
- tone: "critical",
1022
- name,
1023
- state: "selected"
1024
- })
634
+ enabled: opts.muted({ base, dark, tone: "critical", name, state: "enabled" }),
635
+ disabled: opts.muted({ base, dark, tone: "critical", name, state: "disabled" }),
636
+ hovered: opts.muted({ base, dark, tone: "critical", name, state: "hovered" }),
637
+ pressed: opts.muted({ base, dark, tone: "critical", name, state: "pressed" }),
638
+ selected: opts.muted({ base, dark, tone: "critical", name, state: "selected" })
1025
639
  }
1026
640
  };
1027
641
  }
1028
642
  function createSpot(opts, base, dark) {
1029
643
  return {
1030
- gray: opts.spot({
1031
- base,
1032
- dark,
1033
- key: "gray"
1034
- }),
1035
- blue: opts.spot({
1036
- base,
1037
- dark,
1038
- key: "blue"
1039
- }),
1040
- purple: opts.spot({
1041
- base,
1042
- dark,
1043
- key: "purple"
1044
- }),
1045
- magenta: opts.spot({
1046
- base,
1047
- dark,
1048
- key: "magenta"
1049
- }),
1050
- red: opts.spot({
1051
- base,
1052
- dark,
1053
- key: "red"
1054
- }),
1055
- orange: opts.spot({
1056
- base,
1057
- dark,
1058
- key: "orange"
1059
- }),
1060
- yellow: opts.spot({
1061
- base,
1062
- dark,
1063
- key: "yellow"
1064
- }),
1065
- green: opts.spot({
1066
- base,
1067
- dark,
1068
- key: "green"
1069
- }),
1070
- cyan: opts.spot({
1071
- base,
1072
- dark,
1073
- key: "cyan"
1074
- })
644
+ gray: opts.spot({ base, dark, key: "gray" }),
645
+ blue: opts.spot({ base, dark, key: "blue" }),
646
+ purple: opts.spot({ base, dark, key: "purple" }),
647
+ magenta: opts.spot({ base, dark, key: "magenta" }),
648
+ red: opts.spot({ base, dark, key: "red" }),
649
+ orange: opts.spot({ base, dark, key: "orange" }),
650
+ yellow: opts.spot({ base, dark, key: "yellow" }),
651
+ green: opts.spot({ base, dark, key: "green" }),
652
+ cyan: opts.spot({ base, dark, key: "cyan" })
1075
653
  };
1076
654
  }
1077
655
  function createColorTheme(partialOpts = {}) {
1078
- const builders = {
1079
- ...defaultOpts,
1080
- ...partialOpts
1081
- };
656
+ const builders = { ...defaultOpts, ...partialOpts };
1082
657
  return {
1083
658
  light: _createColorScheme(builders, !1),
1084
659
  dark: _createColorScheme(builders, !0)
@@ -1095,10 +670,7 @@ function _createColorScheme(opts, dark) {
1095
670
  };
1096
671
  }
1097
672
  function _createColor(opts, dark, name) {
1098
- const base = opts.base({
1099
- dark,
1100
- name
1101
- }), solid = createSolidTones(opts, base, dark, name), muted = createMutedTones(opts, base, dark, name);
673
+ const base = opts.base({ dark, name }), solid = createSolidTones(opts, base, dark, name), muted = createMutedTones(opts, base, dark, name);
1102
674
  return {
1103
675
  base,
1104
676
  button: createButtonModes(opts, base, dark, solid, muted),
@@ -1107,111 +679,61 @@ function _createColor(opts, dark, name) {
1107
679
  input: createInputModes(opts, base, dark, solid, muted),
1108
680
  selectable: createSelectableTones(opts, base, dark, solid, muted),
1109
681
  spot: createSpot(opts, base, dark),
1110
- syntax: opts.syntax({
1111
- base,
1112
- dark
1113
- }),
682
+ syntax: opts.syntax({ base, dark }),
1114
683
  solid,
1115
684
  muted
1116
685
  };
1117
686
  }
1118
- const defaultThemeConfig = {
687
+ const BORDER_WIDTH = 1, OUTLINE_WIDTH = 0.5, defaultThemeConfig = {
1119
688
  _version: 2,
1120
689
  avatar: {
1121
- sizes: [{
1122
- distance: -4,
1123
- size: 19
1124
- }, {
1125
- distance: -4,
1126
- size: 25
1127
- }, {
1128
- distance: -8,
1129
- size: 33
1130
- }, {
1131
- distance: -12,
1132
- size: 49
1133
- }],
1134
- focusRing: {
1135
- offset: 1,
1136
- width: 1
1137
- }
690
+ sizes: [
691
+ { distance: -4, size: 19 },
692
+ { distance: -4, size: 25 },
693
+ { distance: -8, size: 33 },
694
+ { distance: -12, size: 49 }
695
+ ],
696
+ focusRing: { offset: 1, width: 1 }
1138
697
  },
1139
698
  button: {
1140
699
  textWeight: "medium",
1141
- border: {
1142
- width: 1
1143
- },
1144
- focusRing: {
1145
- offset: -1,
1146
- width: 1
1147
- }
700
+ border: { width: BORDER_WIDTH },
701
+ focusRing: { offset: -1, width: 1 }
1148
702
  },
1149
703
  card: {
1150
- border: {
1151
- width: 1
1152
- },
1153
- focusRing: {
1154
- offset: -1,
1155
- width: 1
1156
- },
1157
- shadow: {
1158
- outline: 0.5
1159
- }
704
+ border: { width: BORDER_WIDTH },
705
+ focusRing: { offset: -1, width: 1 },
706
+ shadow: { outline: OUTLINE_WIDTH }
1160
707
  },
1161
708
  container: [320, 640, 960, 1280, 1600, 1920],
1162
709
  media: [360, 600, 900, 1200, 1800, 2400],
1163
710
  layer: {
1164
- dialog: {
1165
- zOffset: 600
1166
- },
1167
- popover: {
1168
- zOffset: 400
1169
- },
1170
- tooltip: {
1171
- zOffset: 200
1172
- }
711
+ dialog: { zOffset: 600 },
712
+ popover: { zOffset: 400 },
713
+ tooltip: { zOffset: 200 }
1173
714
  },
1174
715
  radius: [0, 1, 3, 6, 9, 12, 21],
1175
- shadow: [null, {
1176
- umbra: [0, 0, 0, 0],
1177
- penumbra: [0, 0, 0, 0],
1178
- ambient: [0, 0, 0, 0]
1179
- }, {
1180
- umbra: [0, 3, 5, -2],
1181
- penumbra: [0, 6, 10, 0],
1182
- ambient: [0, 1, 18, 1]
1183
- }, {
1184
- umbra: [0, 7, 8, -4],
1185
- penumbra: [0, 12, 17, 2],
1186
- ambient: [0, 5, 22, 4]
1187
- }, {
1188
- umbra: [0, 9, 11, -5],
1189
- penumbra: [0, 18, 28, 2],
1190
- ambient: [0, 7, 34, 6]
1191
- }, {
1192
- umbra: [0, 11, 15, -7],
1193
- penumbra: [0, 24, 38, 3],
1194
- ambient: [0, 9, 46, 8]
1195
- }],
716
+ shadow: [
717
+ null,
718
+ { umbra: [0, 0, 0, 0], penumbra: [0, 0, 0, 0], ambient: [0, 0, 0, 0] },
719
+ { umbra: [0, 3, 5, -2], penumbra: [0, 6, 10, 0], ambient: [0, 1, 18, 1] },
720
+ { umbra: [0, 7, 8, -4], penumbra: [0, 12, 17, 2], ambient: [0, 5, 22, 4] },
721
+ { umbra: [0, 9, 11, -5], penumbra: [0, 18, 28, 2], ambient: [0, 7, 34, 6] },
722
+ { umbra: [0, 11, 15, -7], penumbra: [0, 24, 38, 3], ambient: [0, 9, 46, 8] }
723
+ ],
1196
724
  space: [0, 4, 8, 12, 20, 32, 52, 84, 136, 220],
1197
725
  input: {
1198
726
  border: {
1199
- width: 1
727
+ width: BORDER_WIDTH
1200
728
  },
1201
729
  checkbox: {
1202
730
  size: 17,
1203
- focusRing: {
1204
- offset: -1,
1205
- width: 1
1206
- }
731
+ focusRing: { offset: -1, width: 1 }
1207
732
  },
1208
733
  radio: {
1209
734
  size: 17,
1210
735
  markSize: 9,
1211
- focusRing: {
1212
- offset: -1,
1213
- width: 1
1214
- }
736
+ focusRing: { offset: -1, width: 1 }
1215
737
  },
1216
738
  switch: {
1217
739
  width: 25,
@@ -1219,22 +741,13 @@ const defaultThemeConfig = {
1219
741
  padding: 5,
1220
742
  transitionDurationMs: 150,
1221
743
  transitionTimingFunction: "ease-out",
1222
- focusRing: {
1223
- offset: 1,
1224
- width: 1
1225
- }
744
+ focusRing: { offset: 1, width: 1 }
1226
745
  },
1227
746
  select: {
1228
- focusRing: {
1229
- offset: -1,
1230
- width: 1
1231
- }
747
+ focusRing: { offset: -1, width: 1 }
1232
748
  },
1233
749
  text: {
1234
- focusRing: {
1235
- offset: -1,
1236
- width: 1
1237
- }
750
+ focusRing: { offset: -1, width: 1 }
1238
751
  }
1239
752
  },
1240
753
  style: {
@@ -1258,42 +771,48 @@ const defaultThemeConfig = {
1258
771
  semibold: 600,
1259
772
  bold: 700
1260
773
  },
1261
- sizes: [{
1262
- ascenderHeight: 4,
1263
- descenderHeight: 4,
1264
- fontSize: 10,
1265
- iconSize: 17,
1266
- lineHeight: 15,
1267
- letterSpacing: 0
1268
- }, {
1269
- ascenderHeight: 5,
1270
- descenderHeight: 5,
1271
- fontSize: 13,
1272
- iconSize: 21,
1273
- lineHeight: 19,
1274
- letterSpacing: 0
1275
- }, {
1276
- ascenderHeight: 6,
1277
- descenderHeight: 6,
1278
- fontSize: 16,
1279
- iconSize: 25,
1280
- lineHeight: 23,
1281
- letterSpacing: 0
1282
- }, {
1283
- ascenderHeight: 7,
1284
- descenderHeight: 7,
1285
- fontSize: 19,
1286
- iconSize: 29,
1287
- lineHeight: 27,
1288
- letterSpacing: 0
1289
- }, {
1290
- ascenderHeight: 8,
1291
- descenderHeight: 8,
1292
- fontSize: 22,
1293
- iconSize: 33,
1294
- lineHeight: 31,
1295
- letterSpacing: 0
1296
- }]
774
+ sizes: [
775
+ {
776
+ ascenderHeight: 4,
777
+ descenderHeight: 4,
778
+ fontSize: 10,
779
+ iconSize: 17,
780
+ lineHeight: 15,
781
+ letterSpacing: 0
782
+ },
783
+ {
784
+ ascenderHeight: 5,
785
+ descenderHeight: 5,
786
+ fontSize: 13,
787
+ iconSize: 21,
788
+ lineHeight: 19,
789
+ letterSpacing: 0
790
+ },
791
+ {
792
+ ascenderHeight: 6,
793
+ descenderHeight: 6,
794
+ fontSize: 16,
795
+ iconSize: 25,
796
+ lineHeight: 23,
797
+ letterSpacing: 0
798
+ },
799
+ {
800
+ ascenderHeight: 7,
801
+ descenderHeight: 7,
802
+ fontSize: 19,
803
+ iconSize: 29,
804
+ lineHeight: 27,
805
+ letterSpacing: 0
806
+ },
807
+ {
808
+ ascenderHeight: 8,
809
+ descenderHeight: 8,
810
+ fontSize: 22,
811
+ iconSize: 33,
812
+ lineHeight: 31,
813
+ letterSpacing: 0
814
+ }
815
+ ]
1297
816
  },
1298
817
  heading: {
1299
818
  family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
@@ -1303,49 +822,56 @@ const defaultThemeConfig = {
1303
822
  semibold: 900,
1304
823
  bold: 900
1305
824
  },
1306
- sizes: [{
1307
- ascenderHeight: 5,
1308
- descenderHeight: 5,
1309
- fontSize: 13,
1310
- iconSize: 17,
1311
- lineHeight: 19,
1312
- letterSpacing: 0
1313
- }, {
1314
- ascenderHeight: 6,
1315
- descenderHeight: 6,
1316
- fontSize: 16,
1317
- iconSize: 25,
1318
- lineHeight: 23,
1319
- letterSpacing: 0
1320
- }, {
1321
- ascenderHeight: 7,
1322
- descenderHeight: 7,
1323
- fontSize: 21,
1324
- iconSize: 33,
1325
- lineHeight: 29,
1326
- letterSpacing: 0
1327
- }, {
1328
- ascenderHeight: 8,
1329
- descenderHeight: 8,
1330
- fontSize: 27,
1331
- iconSize: 41,
1332
- lineHeight: 35,
1333
- letterSpacing: 0
1334
- }, {
1335
- ascenderHeight: 9.5,
1336
- descenderHeight: 8.5,
1337
- fontSize: 33,
1338
- iconSize: 49,
1339
- lineHeight: 41,
1340
- letterSpacing: 0
1341
- }, {
1342
- ascenderHeight: 10.5,
1343
- descenderHeight: 9.5,
1344
- fontSize: 38,
1345
- iconSize: 53,
1346
- lineHeight: 47,
1347
- letterSpacing: 0
1348
- }]
825
+ sizes: [
826
+ {
827
+ ascenderHeight: 5,
828
+ descenderHeight: 5,
829
+ fontSize: 13,
830
+ iconSize: 17,
831
+ lineHeight: 19,
832
+ letterSpacing: 0
833
+ },
834
+ {
835
+ ascenderHeight: 6,
836
+ descenderHeight: 6,
837
+ fontSize: 16,
838
+ iconSize: 25,
839
+ lineHeight: 23,
840
+ letterSpacing: 0
841
+ },
842
+ {
843
+ ascenderHeight: 7,
844
+ descenderHeight: 7,
845
+ fontSize: 21,
846
+ iconSize: 33,
847
+ lineHeight: 29,
848
+ letterSpacing: 0
849
+ },
850
+ {
851
+ ascenderHeight: 8,
852
+ descenderHeight: 8,
853
+ fontSize: 27,
854
+ iconSize: 41,
855
+ lineHeight: 35,
856
+ letterSpacing: 0
857
+ },
858
+ {
859
+ ascenderHeight: 9.5,
860
+ descenderHeight: 8.5,
861
+ fontSize: 33,
862
+ iconSize: 49,
863
+ lineHeight: 41,
864
+ letterSpacing: 0
865
+ },
866
+ {
867
+ ascenderHeight: 10.5,
868
+ descenderHeight: 9.5,
869
+ fontSize: 38,
870
+ iconSize: 53,
871
+ lineHeight: 47,
872
+ letterSpacing: 0
873
+ }
874
+ ]
1349
875
  },
1350
876
  label: {
1351
877
  family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
@@ -1355,49 +881,56 @@ const defaultThemeConfig = {
1355
881
  semibold: 800,
1356
882
  bold: 900
1357
883
  },
1358
- sizes: [{
1359
- ascenderHeight: 2,
1360
- descenderHeight: 2,
1361
- fontSize: 8.1,
1362
- iconSize: 13,
1363
- lineHeight: 10,
1364
- letterSpacing: 0.5
1365
- }, {
1366
- ascenderHeight: 2,
1367
- descenderHeight: 2,
1368
- fontSize: 9.5,
1369
- iconSize: 15,
1370
- lineHeight: 11,
1371
- letterSpacing: 0.5
1372
- }, {
1373
- ascenderHeight: 2,
1374
- descenderHeight: 2,
1375
- fontSize: 10.8,
1376
- iconSize: 17,
1377
- lineHeight: 12,
1378
- letterSpacing: 0.5
1379
- }, {
1380
- ascenderHeight: 2,
1381
- descenderHeight: 2,
1382
- fontSize: 12.25,
1383
- iconSize: 19,
1384
- lineHeight: 13,
1385
- letterSpacing: 0.5
1386
- }, {
1387
- ascenderHeight: 2,
1388
- descenderHeight: 2,
1389
- fontSize: 13.6,
1390
- iconSize: 21,
1391
- lineHeight: 14,
1392
- letterSpacing: 0.5
1393
- }, {
1394
- ascenderHeight: 2,
1395
- descenderHeight: 2,
1396
- fontSize: 15,
1397
- iconSize: 23,
1398
- lineHeight: 15,
1399
- letterSpacing: 0.5
1400
- }]
884
+ sizes: [
885
+ {
886
+ ascenderHeight: 2,
887
+ descenderHeight: 2,
888
+ fontSize: 8.1,
889
+ iconSize: 13,
890
+ lineHeight: 10,
891
+ letterSpacing: 0.5
892
+ },
893
+ {
894
+ ascenderHeight: 2,
895
+ descenderHeight: 2,
896
+ fontSize: 9.5,
897
+ iconSize: 15,
898
+ lineHeight: 11,
899
+ letterSpacing: 0.5
900
+ },
901
+ {
902
+ ascenderHeight: 2,
903
+ descenderHeight: 2,
904
+ fontSize: 10.8,
905
+ iconSize: 17,
906
+ lineHeight: 12,
907
+ letterSpacing: 0.5
908
+ },
909
+ {
910
+ ascenderHeight: 2,
911
+ descenderHeight: 2,
912
+ fontSize: 12.25,
913
+ iconSize: 19,
914
+ lineHeight: 13,
915
+ letterSpacing: 0.5
916
+ },
917
+ {
918
+ ascenderHeight: 2,
919
+ descenderHeight: 2,
920
+ fontSize: 13.6,
921
+ iconSize: 21,
922
+ lineHeight: 14,
923
+ letterSpacing: 0.5
924
+ },
925
+ {
926
+ ascenderHeight: 2,
927
+ descenderHeight: 2,
928
+ fontSize: 15,
929
+ iconSize: 23,
930
+ lineHeight: 15,
931
+ letterSpacing: 0.5
932
+ }
933
+ ]
1401
934
  },
1402
935
  text: {
1403
936
  family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
@@ -1407,42 +940,48 @@ const defaultThemeConfig = {
1407
940
  semibold: 600,
1408
941
  bold: 700
1409
942
  },
1410
- sizes: [{
1411
- ascenderHeight: 4,
1412
- descenderHeight: 4,
1413
- fontSize: 10,
1414
- iconSize: 17,
1415
- lineHeight: 15,
1416
- letterSpacing: 0
1417
- }, {
1418
- ascenderHeight: 5,
1419
- descenderHeight: 5,
1420
- fontSize: 13,
1421
- iconSize: 21,
1422
- lineHeight: 19,
1423
- letterSpacing: 0
1424
- }, {
1425
- ascenderHeight: 6,
1426
- descenderHeight: 6,
1427
- fontSize: 15,
1428
- iconSize: 25,
1429
- lineHeight: 23,
1430
- letterSpacing: 0
1431
- }, {
1432
- ascenderHeight: 7,
1433
- descenderHeight: 7,
1434
- fontSize: 18,
1435
- iconSize: 29,
1436
- lineHeight: 27,
1437
- letterSpacing: 0
1438
- }, {
1439
- ascenderHeight: 8,
1440
- descenderHeight: 8,
1441
- fontSize: 21,
1442
- iconSize: 33,
1443
- lineHeight: 31,
1444
- letterSpacing: 0
1445
- }]
943
+ sizes: [
944
+ {
945
+ ascenderHeight: 4,
946
+ descenderHeight: 4,
947
+ fontSize: 10,
948
+ iconSize: 17,
949
+ lineHeight: 15,
950
+ letterSpacing: 0
951
+ },
952
+ {
953
+ ascenderHeight: 5,
954
+ descenderHeight: 5,
955
+ fontSize: 13,
956
+ iconSize: 21,
957
+ lineHeight: 19,
958
+ letterSpacing: 0
959
+ },
960
+ {
961
+ ascenderHeight: 6,
962
+ descenderHeight: 6,
963
+ fontSize: 15,
964
+ iconSize: 25,
965
+ lineHeight: 23,
966
+ letterSpacing: 0
967
+ },
968
+ {
969
+ ascenderHeight: 7,
970
+ descenderHeight: 7,
971
+ fontSize: 18,
972
+ iconSize: 29,
973
+ lineHeight: 27,
974
+ letterSpacing: 0
975
+ },
976
+ {
977
+ ascenderHeight: 8,
978
+ descenderHeight: 8,
979
+ fontSize: 21,
980
+ iconSize: 33,
981
+ lineHeight: 31,
982
+ letterSpacing: 0
983
+ }
984
+ ]
1446
985
  }
1447
986
  }, cache$4 = /* @__PURE__ */ new WeakMap();
1448
987
  function themeColor_v0_v2(color_v0) {
@@ -1869,7 +1408,20 @@ function inputStateThemeColor_v2_v0(t) {
1869
1408
  placeholder: t.placeholder
1870
1409
  };
1871
1410
  }
1872
- const THEME_COLOR_SCHEMES = ["light", "dark"], THEME_COLOR_BLEND_MODES = ["multiply", "screen"], THEME_COLOR_CARD_TONES = ["transparent", "default", "primary", "positive", "caution", "critical"], THEME_COLOR_STATE_TONES = ["default", "primary", "positive", "caution", "critical"], THEME_COLOR_STATES = ["enabled", "hovered", "pressed", "selected", "disabled"], THEME_COLOR_BUTTON_MODES = ["default", "ghost", "bleed"], THEME_COLOR_INPUT_MODES = ["default", "invalid"], THEME_COLOR_INPUT_STATES = ["enabled", "hovered", "readOnly", "disabled"], THEME_COLOR_AVATAR_COLORS = COLOR_HUES;
1411
+ const THEME_COLOR_SCHEMES = ["light", "dark"], THEME_COLOR_BLEND_MODES = ["multiply", "screen"], THEME_COLOR_CARD_TONES = [
1412
+ "transparent",
1413
+ "default",
1414
+ "primary",
1415
+ "positive",
1416
+ "caution",
1417
+ "critical"
1418
+ ], THEME_COLOR_STATE_TONES = [
1419
+ "default",
1420
+ "primary",
1421
+ "positive",
1422
+ "caution",
1423
+ "critical"
1424
+ ], THEME_COLOR_STATES = ["enabled", "hovered", "pressed", "selected", "disabled"], THEME_COLOR_BUTTON_MODES = ["default", "ghost", "bleed"], THEME_COLOR_INPUT_MODES = ["default", "invalid"], THEME_COLOR_INPUT_STATES = ["enabled", "hovered", "readOnly", "disabled"], THEME_COLOR_AVATAR_COLORS = COLOR_HUES;
1873
1425
  function isColorBlendModeValue(str) {
1874
1426
  return THEME_COLOR_BLEND_MODES.includes(str);
1875
1427
  }
@@ -1882,7 +1434,33 @@ function isColorTintKey(str) {
1882
1434
  function isColorButtonMode(str) {
1883
1435
  return THEME_COLOR_BUTTON_MODES.includes(str);
1884
1436
  }
1885
- const COLOR_CONFIG_STATE_KEYS = ["_hue", "bg", "fg", "border", "focusRing", "muted/fg", "accent/fg", "link/fg", "code/bg", "code/fg", "skeleton/from", "skeleton/to", "status/dot", "status/icon"], COLOR_CONFIG_CARD_KEYS = [...COLOR_CONFIG_STATE_KEYS, "_hue", "bg", "fg", "border", "focusRing", "shadow/outline", "shadow/umbra", "shadow/penumbra", "shadow/ambient"], COLOR_CONFIG_BLEND_KEYS = ["_blend"], COLOR_CONFIG_AVATAR_COLORS = ["*", ...THEME_COLOR_AVATAR_COLORS], COLOR_CONFIG_CARD_TONES = ["*", ...THEME_COLOR_CARD_TONES], COLOR_CONFIG_STATE_TONES = ["*", ...THEME_COLOR_STATE_TONES], COLOR_CONFIG_STATES = ["*", ...THEME_COLOR_STATES], COLOR_CONFIG_INPUT_MODES = ["*", ...THEME_COLOR_INPUT_MODES], COLOR_CONFIG_INPUT_STATES = ["*", ...THEME_COLOR_INPUT_STATES];
1437
+ const COLOR_CONFIG_STATE_KEYS = [
1438
+ "_hue",
1439
+ "bg",
1440
+ "fg",
1441
+ "border",
1442
+ "focusRing",
1443
+ "muted/fg",
1444
+ "accent/fg",
1445
+ "link/fg",
1446
+ "code/bg",
1447
+ "code/fg",
1448
+ "skeleton/from",
1449
+ "skeleton/to",
1450
+ "status/dot",
1451
+ "status/icon"
1452
+ ], COLOR_CONFIG_CARD_KEYS = [
1453
+ ...COLOR_CONFIG_STATE_KEYS,
1454
+ "_hue",
1455
+ "bg",
1456
+ "fg",
1457
+ "border",
1458
+ "focusRing",
1459
+ "shadow/outline",
1460
+ "shadow/umbra",
1461
+ "shadow/penumbra",
1462
+ "shadow/ambient"
1463
+ ], COLOR_CONFIG_BLEND_KEYS = ["_blend"], COLOR_CONFIG_AVATAR_COLORS = ["*", ...THEME_COLOR_AVATAR_COLORS], COLOR_CONFIG_CARD_TONES = ["*", ...THEME_COLOR_CARD_TONES], COLOR_CONFIG_STATE_TONES = ["*", ...THEME_COLOR_STATE_TONES], COLOR_CONFIG_STATES = ["*", ...THEME_COLOR_STATES], COLOR_CONFIG_INPUT_MODES = ["*", ...THEME_COLOR_INPUT_MODES], COLOR_CONFIG_INPUT_STATES = ["*", ...THEME_COLOR_INPUT_STATES];
1886
1464
  function parseTokenKey(str) {
1887
1465
  const segments = str.split("/"), segment0 = segments.shift() || "";
1888
1466
  if (isColorConfigBaseTone(segment0)) {
@@ -2049,16 +1627,10 @@ function compileColorTokenValue(node) {
2049
1627
  }
2050
1628
  const DEFAULT_COLOR_TOKEN_VALUE = ["500", "500"];
2051
1629
  function resolveColorTokenValue(context, value = DEFAULT_COLOR_TOKEN_VALUE) {
2052
- const {
2053
- hue,
2054
- scheme
2055
- } = context, node = parseTokenValue(value[scheme === "light" ? 0 : 1]);
1630
+ const { hue, scheme } = context, node = parseTokenValue(value[scheme === "light" ? 0 : 1]);
2056
1631
  if (!node || node.type !== "color")
2057
1632
  throw new Error(`Invalid color token: ${value[0]}`);
2058
- return compileColorTokenValue({
2059
- ...node,
2060
- hue: node.hue || hue
2061
- });
1633
+ return compileColorTokenValue({ ...node, hue: node.hue || hue });
2062
1634
  }
2063
1635
  const defaultColorTokens = {
2064
1636
  base: {
@@ -2133,24 +1705,16 @@ const defaultColorTokens = {
2133
1705
  fg: ["600", "400"]
2134
1706
  }
2135
1707
  },
2136
- primary: {
2137
- _hue: "blue"
2138
- },
1708
+ primary: { _hue: "blue" },
2139
1709
  positive: {
2140
1710
  _hue: "green",
2141
- shadow: {
2142
- outline: ["500/0.4", "500/0.4"]
2143
- }
1711
+ shadow: { outline: ["500/0.4", "500/0.4"] }
2144
1712
  },
2145
1713
  caution: {
2146
1714
  _hue: "yellow",
2147
- shadow: {
2148
- outline: ["600/0.3", "500/0.4"]
2149
- }
1715
+ shadow: { outline: ["600/0.3", "500/0.4"] }
2150
1716
  },
2151
- critical: {
2152
- _hue: "red"
2153
- }
1717
+ critical: { _hue: "red" }
2154
1718
  },
2155
1719
  button: {
2156
1720
  default: {
@@ -2748,33 +2312,15 @@ function resolveBaseColorTones(inputTokens, tone) {
2748
2312
  ...spec,
2749
2313
  _hue: hue,
2750
2314
  avatar: {
2751
- gray: merge({
2752
- _hue: "gray"
2753
- }, (_e = spec.avatar) == null ? void 0 : _e["*"], (_f = spec.avatar) == null ? void 0 : _f.gray),
2754
- blue: merge({
2755
- _hue: "blue"
2756
- }, (_g = spec.avatar) == null ? void 0 : _g["*"], (_h = spec.avatar) == null ? void 0 : _h.blue),
2757
- purple: merge({
2758
- _hue: "purple"
2759
- }, (_i = spec.avatar) == null ? void 0 : _i["*"], (_j = spec.avatar) == null ? void 0 : _j.purple),
2760
- magenta: merge({
2761
- _hue: "magenta"
2762
- }, (_k = spec.avatar) == null ? void 0 : _k["*"], (_l = spec.avatar) == null ? void 0 : _l.magenta),
2763
- red: merge({
2764
- _hue: "red"
2765
- }, (_m = spec.avatar) == null ? void 0 : _m["*"], (_n = spec.avatar) == null ? void 0 : _n.red),
2766
- orange: merge({
2767
- _hue: "orange"
2768
- }, (_o = spec.avatar) == null ? void 0 : _o["*"], (_p = spec.avatar) == null ? void 0 : _p.orange),
2769
- yellow: merge({
2770
- _hue: "yellow"
2771
- }, (_q = spec.avatar) == null ? void 0 : _q["*"], (_r = spec.avatar) == null ? void 0 : _r.yellow),
2772
- green: merge({
2773
- _hue: "green"
2774
- }, (_s = spec.avatar) == null ? void 0 : _s["*"], (_t = spec.avatar) == null ? void 0 : _t.green),
2775
- cyan: merge({
2776
- _hue: "cyan"
2777
- }, (_u = spec.avatar) == null ? void 0 : _u["*"], (_v = spec.avatar) == null ? void 0 : _v.cyan)
2315
+ gray: merge({ _hue: "gray" }, (_e = spec.avatar) == null ? void 0 : _e["*"], (_f = spec.avatar) == null ? void 0 : _f.gray),
2316
+ blue: merge({ _hue: "blue" }, (_g = spec.avatar) == null ? void 0 : _g["*"], (_h = spec.avatar) == null ? void 0 : _h.blue),
2317
+ purple: merge({ _hue: "purple" }, (_i = spec.avatar) == null ? void 0 : _i["*"], (_j = spec.avatar) == null ? void 0 : _j.purple),
2318
+ magenta: merge({ _hue: "magenta" }, (_k = spec.avatar) == null ? void 0 : _k["*"], (_l = spec.avatar) == null ? void 0 : _l.magenta),
2319
+ red: merge({ _hue: "red" }, (_m = spec.avatar) == null ? void 0 : _m["*"], (_n = spec.avatar) == null ? void 0 : _n.red),
2320
+ orange: merge({ _hue: "orange" }, (_o = spec.avatar) == null ? void 0 : _o["*"], (_p = spec.avatar) == null ? void 0 : _p.orange),
2321
+ yellow: merge({ _hue: "yellow" }, (_q = spec.avatar) == null ? void 0 : _q["*"], (_r = spec.avatar) == null ? void 0 : _r.yellow),
2322
+ green: merge({ _hue: "green" }, (_s = spec.avatar) == null ? void 0 : _s["*"], (_t = spec.avatar) == null ? void 0 : _t.green),
2323
+ cyan: merge({ _hue: "cyan" }, (_u = spec.avatar) == null ? void 0 : _u["*"], (_v = spec.avatar) == null ? void 0 : _v.cyan)
2778
2324
  },
2779
2325
  badge: {
2780
2326
  default: {
@@ -2825,38 +2371,25 @@ function resolveButtonModeColorTokens(inputTokens, mode, tone) {
2825
2371
  }
2826
2372
  function resolveButtonStateColorTokens(inputTokens, tone, mode, state) {
2827
2373
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z;
2828
- const spec = merge((_c = (_b = (_a = inputTokens == null ? void 0 : inputTokens.button) == null ? void 0 : _a[mode]) == null ? void 0 : _b["*"]) == null ? void 0 : _c["*"], (_f = (_e = (_d = inputTokens == null ? void 0 : inputTokens.button) == null ? void 0 : _d[mode]) == null ? void 0 : _e[tone]) == null ? void 0 : _f["*"], (_i = (_h = (_g = inputTokens == null ? void 0 : inputTokens.button) == null ? void 0 : _g[mode]) == null ? void 0 : _h["*"]) == null ? void 0 : _i[state], (_l = (_k = (_j = inputTokens == null ? void 0 : inputTokens.button) == null ? void 0 : _j[mode]) == null ? void 0 : _k[tone]) == null ? void 0 : _l[state]), hue = spec._hue || ((_n = (_m = inputTokens == null ? void 0 : inputTokens.base) == null ? void 0 : _m[tone]) == null ? void 0 : _n._hue);
2374
+ const spec = merge(
2375
+ (_c = (_b = (_a = inputTokens == null ? void 0 : inputTokens.button) == null ? void 0 : _a[mode]) == null ? void 0 : _b["*"]) == null ? void 0 : _c["*"],
2376
+ (_f = (_e = (_d = inputTokens == null ? void 0 : inputTokens.button) == null ? void 0 : _d[mode]) == null ? void 0 : _e[tone]) == null ? void 0 : _f["*"],
2377
+ (_i = (_h = (_g = inputTokens == null ? void 0 : inputTokens.button) == null ? void 0 : _g[mode]) == null ? void 0 : _h["*"]) == null ? void 0 : _i[state],
2378
+ (_l = (_k = (_j = inputTokens == null ? void 0 : inputTokens.button) == null ? void 0 : _j[mode]) == null ? void 0 : _k[tone]) == null ? void 0 : _l[state]
2379
+ ), hue = spec._hue || ((_n = (_m = inputTokens == null ? void 0 : inputTokens.base) == null ? void 0 : _m[tone]) == null ? void 0 : _n._hue);
2829
2380
  return {
2830
2381
  ...spec,
2831
2382
  _hue: hue,
2832
2383
  avatar: {
2833
- gray: merge({
2834
- _hue: "gray"
2835
- }, (_o = spec.avatar) == null ? void 0 : _o["*"], (_p = spec.avatar) == null ? void 0 : _p.gray),
2836
- blue: merge({
2837
- _hue: "blue"
2838
- }, (_q = spec.avatar) == null ? void 0 : _q["*"], (_r = spec.avatar) == null ? void 0 : _r.blue),
2839
- purple: merge({
2840
- _hue: "purple"
2841
- }, (_s = spec.avatar) == null ? void 0 : _s["*"], (_t = spec.avatar) == null ? void 0 : _t.purple),
2842
- magenta: merge({
2843
- _hue: "magenta"
2844
- }, (_u = spec.avatar) == null ? void 0 : _u["*"], (_v = spec.avatar) == null ? void 0 : _v.magenta),
2845
- red: merge({
2846
- _hue: "red"
2847
- }, (_w = spec.avatar) == null ? void 0 : _w["*"], (_x = spec.avatar) == null ? void 0 : _x.red),
2848
- orange: merge({
2849
- _hue: "orange"
2850
- }, (_y = spec.avatar) == null ? void 0 : _y["*"], (_z = spec.avatar) == null ? void 0 : _z.orange),
2851
- yellow: merge({
2852
- _hue: "yellow"
2853
- }, (_A = spec.avatar) == null ? void 0 : _A["*"], (_B = spec.avatar) == null ? void 0 : _B.yellow),
2854
- green: merge({
2855
- _hue: "green"
2856
- }, (_C = spec.avatar) == null ? void 0 : _C["*"], (_D = spec.avatar) == null ? void 0 : _D.green),
2857
- cyan: merge({
2858
- _hue: "cyan"
2859
- }, (_E = spec.avatar) == null ? void 0 : _E["*"], (_F = spec.avatar) == null ? void 0 : _F.cyan)
2384
+ gray: merge({ _hue: "gray" }, (_o = spec.avatar) == null ? void 0 : _o["*"], (_p = spec.avatar) == null ? void 0 : _p.gray),
2385
+ blue: merge({ _hue: "blue" }, (_q = spec.avatar) == null ? void 0 : _q["*"], (_r = spec.avatar) == null ? void 0 : _r.blue),
2386
+ purple: merge({ _hue: "purple" }, (_s = spec.avatar) == null ? void 0 : _s["*"], (_t = spec.avatar) == null ? void 0 : _t.purple),
2387
+ magenta: merge({ _hue: "magenta" }, (_u = spec.avatar) == null ? void 0 : _u["*"], (_v = spec.avatar) == null ? void 0 : _v.magenta),
2388
+ red: merge({ _hue: "red" }, (_w = spec.avatar) == null ? void 0 : _w["*"], (_x = spec.avatar) == null ? void 0 : _x.red),
2389
+ orange: merge({ _hue: "orange" }, (_y = spec.avatar) == null ? void 0 : _y["*"], (_z = spec.avatar) == null ? void 0 : _z.orange),
2390
+ yellow: merge({ _hue: "yellow" }, (_A = spec.avatar) == null ? void 0 : _A["*"], (_B = spec.avatar) == null ? void 0 : _B.yellow),
2391
+ green: merge({ _hue: "green" }, (_C = spec.avatar) == null ? void 0 : _C["*"], (_D = spec.avatar) == null ? void 0 : _D.green),
2392
+ cyan: merge({ _hue: "cyan" }, (_E = spec.avatar) == null ? void 0 : _E["*"], (_F = spec.avatar) == null ? void 0 : _F.cyan)
2860
2393
  },
2861
2394
  badge: {
2862
2395
  default: {
@@ -2901,11 +2434,13 @@ function resolveInputModeColorTokens(inputTokens, mode) {
2901
2434
  }
2902
2435
  function resolveInputStateColorTokens(inputTokens, mode, state) {
2903
2436
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2904
- const spec = merge((_b = (_a = inputTokens == null ? void 0 : inputTokens.input) == null ? void 0 : _a["*"]) == null ? void 0 : _b["*"], (_d = (_c = inputTokens == null ? void 0 : inputTokens.input) == null ? void 0 : _c[mode]) == null ? void 0 : _d["*"], (_f = (_e = inputTokens == null ? void 0 : inputTokens.input) == null ? void 0 : _e["*"]) == null ? void 0 : _f[state], (_h = (_g = inputTokens == null ? void 0 : inputTokens.input) == null ? void 0 : _g[mode]) == null ? void 0 : _h[state]), hue = spec._hue || ((_j = (_i = inputTokens == null ? void 0 : inputTokens.input) == null ? void 0 : _i[mode]) == null ? void 0 : _j._hue);
2905
- return {
2906
- ...spec,
2907
- _hue: hue
2908
- };
2437
+ const spec = merge(
2438
+ (_b = (_a = inputTokens == null ? void 0 : inputTokens.input) == null ? void 0 : _a["*"]) == null ? void 0 : _b["*"],
2439
+ (_d = (_c = inputTokens == null ? void 0 : inputTokens.input) == null ? void 0 : _c[mode]) == null ? void 0 : _d["*"],
2440
+ (_f = (_e = inputTokens == null ? void 0 : inputTokens.input) == null ? void 0 : _e["*"]) == null ? void 0 : _f[state],
2441
+ (_h = (_g = inputTokens == null ? void 0 : inputTokens.input) == null ? void 0 : _g[mode]) == null ? void 0 : _h[state]
2442
+ ), hue = spec._hue || ((_j = (_i = inputTokens == null ? void 0 : inputTokens.input) == null ? void 0 : _i[mode]) == null ? void 0 : _j._hue);
2443
+ return { ...spec, _hue: hue };
2909
2444
  }
2910
2445
  function resolveSelectableColorTokens(inputTokens) {
2911
2446
  const tokens = {};
@@ -2924,38 +2459,25 @@ function resolveSelectableToneColorTokens(inputTokens, tone) {
2924
2459
  }
2925
2460
  function resolveSelectableStateColorTokens(inputTokens, tone, state) {
2926
2461
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V;
2927
- const spec = merge((_b = (_a = inputTokens == null ? void 0 : inputTokens.selectable) == null ? void 0 : _a["*"]) == null ? void 0 : _b["*"], (_d = (_c = inputTokens == null ? void 0 : inputTokens.selectable) == null ? void 0 : _c[tone]) == null ? void 0 : _d["*"], (_f = (_e = inputTokens == null ? void 0 : inputTokens.selectable) == null ? void 0 : _e["*"]) == null ? void 0 : _f[state], (_h = (_g = inputTokens == null ? void 0 : inputTokens.selectable) == null ? void 0 : _g[tone]) == null ? void 0 : _h[state]), hue = spec._hue || ((_j = (_i = inputTokens == null ? void 0 : inputTokens.base) == null ? void 0 : _i[tone]) == null ? void 0 : _j._hue);
2462
+ const spec = merge(
2463
+ (_b = (_a = inputTokens == null ? void 0 : inputTokens.selectable) == null ? void 0 : _a["*"]) == null ? void 0 : _b["*"],
2464
+ (_d = (_c = inputTokens == null ? void 0 : inputTokens.selectable) == null ? void 0 : _c[tone]) == null ? void 0 : _d["*"],
2465
+ (_f = (_e = inputTokens == null ? void 0 : inputTokens.selectable) == null ? void 0 : _e["*"]) == null ? void 0 : _f[state],
2466
+ (_h = (_g = inputTokens == null ? void 0 : inputTokens.selectable) == null ? void 0 : _g[tone]) == null ? void 0 : _h[state]
2467
+ ), hue = spec._hue || ((_j = (_i = inputTokens == null ? void 0 : inputTokens.base) == null ? void 0 : _i[tone]) == null ? void 0 : _j._hue);
2928
2468
  return {
2929
2469
  ...spec,
2930
2470
  _hue: hue,
2931
2471
  avatar: {
2932
- gray: merge({
2933
- _hue: "gray"
2934
- }, (_k = spec.avatar) == null ? void 0 : _k["*"], (_l = spec.avatar) == null ? void 0 : _l.gray),
2935
- blue: merge({
2936
- _hue: "blue"
2937
- }, (_m = spec.avatar) == null ? void 0 : _m["*"], (_n = spec.avatar) == null ? void 0 : _n.blue),
2938
- purple: merge({
2939
- _hue: "purple"
2940
- }, (_o = spec.avatar) == null ? void 0 : _o["*"], (_p = spec.avatar) == null ? void 0 : _p.purple),
2941
- magenta: merge({
2942
- _hue: "magenta"
2943
- }, (_q = spec.avatar) == null ? void 0 : _q["*"], (_r = spec.avatar) == null ? void 0 : _r.magenta),
2944
- red: merge({
2945
- _hue: "red"
2946
- }, (_s = spec.avatar) == null ? void 0 : _s["*"], (_t = spec.avatar) == null ? void 0 : _t.red),
2947
- orange: merge({
2948
- _hue: "orange"
2949
- }, (_u = spec.avatar) == null ? void 0 : _u["*"], (_v = spec.avatar) == null ? void 0 : _v.orange),
2950
- yellow: merge({
2951
- _hue: "yellow"
2952
- }, (_w = spec.avatar) == null ? void 0 : _w["*"], (_x = spec.avatar) == null ? void 0 : _x.yellow),
2953
- green: merge({
2954
- _hue: "green"
2955
- }, (_y = spec.avatar) == null ? void 0 : _y["*"], (_z = spec.avatar) == null ? void 0 : _z.green),
2956
- cyan: merge({
2957
- _hue: "cyan"
2958
- }, (_A = spec.avatar) == null ? void 0 : _A["*"], (_B = spec.avatar) == null ? void 0 : _B.cyan)
2472
+ gray: merge({ _hue: "gray" }, (_k = spec.avatar) == null ? void 0 : _k["*"], (_l = spec.avatar) == null ? void 0 : _l.gray),
2473
+ blue: merge({ _hue: "blue" }, (_m = spec.avatar) == null ? void 0 : _m["*"], (_n = spec.avatar) == null ? void 0 : _n.blue),
2474
+ purple: merge({ _hue: "purple" }, (_o = spec.avatar) == null ? void 0 : _o["*"], (_p = spec.avatar) == null ? void 0 : _p.purple),
2475
+ magenta: merge({ _hue: "magenta" }, (_q = spec.avatar) == null ? void 0 : _q["*"], (_r = spec.avatar) == null ? void 0 : _r.magenta),
2476
+ red: merge({ _hue: "red" }, (_s = spec.avatar) == null ? void 0 : _s["*"], (_t = spec.avatar) == null ? void 0 : _t.red),
2477
+ orange: merge({ _hue: "orange" }, (_u = spec.avatar) == null ? void 0 : _u["*"], (_v = spec.avatar) == null ? void 0 : _v.orange),
2478
+ yellow: merge({ _hue: "yellow" }, (_w = spec.avatar) == null ? void 0 : _w["*"], (_x = spec.avatar) == null ? void 0 : _x.yellow),
2479
+ green: merge({ _hue: "green" }, (_y = spec.avatar) == null ? void 0 : _y["*"], (_z = spec.avatar) == null ? void 0 : _z.green),
2480
+ cyan: merge({ _hue: "cyan" }, (_A = spec.avatar) == null ? void 0 : _A["*"], (_B = spec.avatar) == null ? void 0 : _B.cyan)
2959
2481
  },
2960
2482
  badge: {
2961
2483
  default: {
@@ -2992,72 +2514,36 @@ function buildColorTheme(config) {
2992
2514
  color: resolveColorTokens(config == null ? void 0 : config.color)
2993
2515
  };
2994
2516
  return {
2995
- light: buildColorScheme({
2996
- scheme: "light"
2997
- }, resolvedConfig),
2998
- dark: buildColorScheme({
2999
- scheme: "dark"
3000
- }, resolvedConfig)
2517
+ light: buildColorScheme({ scheme: "light" }, resolvedConfig),
2518
+ dark: buildColorScheme({ scheme: "dark" }, resolvedConfig)
3001
2519
  };
3002
2520
  }
3003
2521
  function buildColorScheme(options, config) {
3004
- const {
3005
- scheme
3006
- } = options;
2522
+ const { scheme } = options;
3007
2523
  return {
3008
- transparent: buildCardColorTheme({
3009
- scheme,
3010
- tone: "transparent"
3011
- }, config),
3012
- default: buildCardColorTheme({
3013
- scheme,
3014
- tone: "default"
3015
- }, config),
3016
- primary: buildCardColorTheme({
3017
- scheme,
3018
- tone: "primary"
3019
- }, config),
3020
- positive: buildCardColorTheme({
3021
- scheme,
3022
- tone: "positive"
3023
- }, config),
3024
- caution: buildCardColorTheme({
3025
- scheme,
3026
- tone: "caution"
3027
- }, config),
3028
- critical: buildCardColorTheme({
3029
- scheme,
3030
- tone: "critical"
3031
- }, config)
2524
+ transparent: buildCardColorTheme({ scheme, tone: "transparent" }, config),
2525
+ default: buildCardColorTheme({ scheme, tone: "default" }, config),
2526
+ primary: buildCardColorTheme({ scheme, tone: "primary" }, config),
2527
+ positive: buildCardColorTheme({ scheme, tone: "positive" }, config),
2528
+ caution: buildCardColorTheme({ scheme, tone: "caution" }, config),
2529
+ critical: buildCardColorTheme({ scheme, tone: "critical" }, config)
3032
2530
  };
3033
2531
  }
3034
2532
  function buildCardColorTheme(options, config) {
3035
2533
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
3036
- const {
3037
- scheme,
3038
- tone
3039
- } = options, tokens = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.base) == null ? void 0 : _b[tone], context = {
3040
- hue: (tokens == null ? void 0 : tokens._hue) || "gray",
3041
- scheme
3042
- };
2534
+ const { scheme, tone } = options, tokens = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.base) == null ? void 0 : _b[tone], context = { hue: (tokens == null ? void 0 : tokens._hue) || "gray", scheme };
3043
2535
  return {
3044
2536
  _blend: ((tokens == null ? void 0 : tokens._blend) || ["multiply", "screen"])[scheme === "light" ? 0 : 1],
3045
2537
  _dark: scheme === "dark",
3046
2538
  accent: {
3047
2539
  fg: resolveColorTokenValue(context, (_c = tokens == null ? void 0 : tokens.accent) == null ? void 0 : _c.fg)
3048
2540
  },
3049
- avatar: buildAvatarColorTheme({
3050
- scheme
3051
- }, tokens),
2541
+ avatar: buildAvatarColorTheme({ scheme }, tokens),
3052
2542
  backdrop: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.backdrop),
3053
- badge: buildBadgeColorTheme(tokens == null ? void 0 : tokens.badge, {
3054
- scheme
3055
- }, config),
2543
+ badge: buildBadgeColorTheme(tokens == null ? void 0 : tokens.badge, { scheme }, config),
3056
2544
  bg: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.bg),
3057
2545
  border: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.border),
3058
- button: buildButtonColorTheme({
3059
- scheme
3060
- }, config),
2546
+ button: buildButtonColorTheme({ scheme }, config),
3061
2547
  code: {
3062
2548
  bg: resolveColorTokenValue(context, (_d = tokens == null ? void 0 : tokens.code) == null ? void 0 : _d.bg),
3063
2549
  fg: resolveColorTokenValue(context, (_e = tokens == null ? void 0 : tokens.code) == null ? void 0 : _e.fg)
@@ -3065,10 +2551,7 @@ function buildCardColorTheme(options, config) {
3065
2551
  fg: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.fg),
3066
2552
  focusRing: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.focusRing),
3067
2553
  icon: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.icon),
3068
- input: buildInputColorTheme({
3069
- scheme,
3070
- tone
3071
- }, config),
2554
+ input: buildInputColorTheme({ scheme, tone }, config),
3072
2555
  kbd: {
3073
2556
  bg: resolveColorTokenValue(context, (_f = tokens == null ? void 0 : tokens.kbd) == null ? void 0 : _f.bg),
3074
2557
  fg: resolveColorTokenValue(context, (_g = tokens == null ? void 0 : tokens.kbd) == null ? void 0 : _g.fg),
@@ -3081,31 +2564,18 @@ function buildCardColorTheme(options, config) {
3081
2564
  bg: resolveColorTokenValue(context, (_j = tokens == null ? void 0 : tokens.muted) == null ? void 0 : _j.bg),
3082
2565
  fg: resolveColorTokenValue(context, (_k = tokens == null ? void 0 : tokens.muted) == null ? void 0 : _k.fg)
3083
2566
  },
3084
- selectable: buildSelectableColorTheme({
3085
- scheme
3086
- }, config),
3087
- shadow: buildShadowColorTheme({
3088
- scheme,
3089
- tone
3090
- }, config),
2567
+ selectable: buildSelectableColorTheme({ scheme }, config),
2568
+ shadow: buildShadowColorTheme({ scheme, tone }, config),
3091
2569
  skeleton: {
3092
2570
  from: resolveColorTokenValue(context, (_l = tokens == null ? void 0 : tokens.skeleton) == null ? void 0 : _l.from),
3093
2571
  to: resolveColorTokenValue(context, (_m = tokens == null ? void 0 : tokens.skeleton) == null ? void 0 : _m.to)
3094
2572
  },
3095
- syntax: buildSyntaxColorTheme({
3096
- scheme
3097
- }, config)
2573
+ syntax: buildSyntaxColorTheme({ scheme }, config)
3098
2574
  };
3099
2575
  }
3100
2576
  function buildShadowColorTheme(options, config) {
3101
2577
  var _a, _b, _c, _d, _e, _f;
3102
- const {
3103
- scheme,
3104
- tone
3105
- } = options, tokens = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.base) == null ? void 0 : _b[tone], context = {
3106
- hue: (tokens == null ? void 0 : tokens._hue) || "gray",
3107
- scheme
3108
- };
2578
+ const { scheme, tone } = options, tokens = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.base) == null ? void 0 : _b[tone], context = { hue: (tokens == null ? void 0 : tokens._hue) || "gray", scheme };
3109
2579
  return {
3110
2580
  outline: resolveColorTokenValue(context, (_c = tokens == null ? void 0 : tokens.shadow) == null ? void 0 : _c.outline),
3111
2581
  umbra: resolveColorTokenValue(context, (_d = tokens == null ? void 0 : tokens.shadow) == null ? void 0 : _d.umbra),
@@ -3114,57 +2584,22 @@ function buildShadowColorTheme(options, config) {
3114
2584
  };
3115
2585
  }
3116
2586
  function buildAvatarColorTheme(options, stateTokens) {
3117
- const {
3118
- scheme
3119
- } = options;
2587
+ const { scheme } = options;
3120
2588
  return {
3121
- gray: _buildAvatarColorTheme({
3122
- color: "gray",
3123
- scheme
3124
- }, stateTokens),
3125
- blue: _buildAvatarColorTheme({
3126
- color: "blue",
3127
- scheme
3128
- }, stateTokens),
3129
- purple: _buildAvatarColorTheme({
3130
- color: "purple",
3131
- scheme
3132
- }, stateTokens),
3133
- magenta: _buildAvatarColorTheme({
3134
- color: "magenta",
3135
- scheme
3136
- }, stateTokens),
3137
- red: _buildAvatarColorTheme({
3138
- color: "red",
3139
- scheme
3140
- }, stateTokens),
3141
- orange: _buildAvatarColorTheme({
3142
- color: "orange",
3143
- scheme
3144
- }, stateTokens),
3145
- yellow: _buildAvatarColorTheme({
3146
- color: "yellow",
3147
- scheme
3148
- }, stateTokens),
3149
- green: _buildAvatarColorTheme({
3150
- color: "green",
3151
- scheme
3152
- }, stateTokens),
3153
- cyan: _buildAvatarColorTheme({
3154
- color: "cyan",
3155
- scheme
3156
- }, stateTokens)
2589
+ gray: _buildAvatarColorTheme({ color: "gray", scheme }, stateTokens),
2590
+ blue: _buildAvatarColorTheme({ color: "blue", scheme }, stateTokens),
2591
+ purple: _buildAvatarColorTheme({ color: "purple", scheme }, stateTokens),
2592
+ magenta: _buildAvatarColorTheme({ color: "magenta", scheme }, stateTokens),
2593
+ red: _buildAvatarColorTheme({ color: "red", scheme }, stateTokens),
2594
+ orange: _buildAvatarColorTheme({ color: "orange", scheme }, stateTokens),
2595
+ yellow: _buildAvatarColorTheme({ color: "yellow", scheme }, stateTokens),
2596
+ green: _buildAvatarColorTheme({ color: "green", scheme }, stateTokens),
2597
+ cyan: _buildAvatarColorTheme({ color: "cyan", scheme }, stateTokens)
3157
2598
  };
3158
2599
  }
3159
2600
  function _buildAvatarColorTheme(options, stateTokens) {
3160
2601
  var _a;
3161
- const {
3162
- color: color2,
3163
- scheme
3164
- } = options, tokens = (_a = stateTokens == null ? void 0 : stateTokens.avatar) == null ? void 0 : _a[color2], context = {
3165
- hue: (tokens == null ? void 0 : tokens._hue) || "gray",
3166
- scheme
3167
- };
2602
+ const { color: color2, scheme } = options, tokens = (_a = stateTokens == null ? void 0 : stateTokens.avatar) == null ? void 0 : _a[color2], context = { hue: (tokens == null ? void 0 : tokens._hue) || "gray", scheme };
3168
2603
  return {
3169
2604
  _blend: ((tokens == null ? void 0 : tokens._blend) || ["screen", "multiply"])[scheme === "light" ? 0 : 1],
3170
2605
  bg: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.bg),
@@ -3172,41 +2607,18 @@ function _buildAvatarColorTheme(options, stateTokens) {
3172
2607
  };
3173
2608
  }
3174
2609
  function buildBadgeColorTheme(tokens, options, config) {
3175
- const {
3176
- scheme
3177
- } = options;
2610
+ const { scheme } = options;
3178
2611
  return {
3179
- default: _buildBadgeColorTheme(tokens, {
3180
- scheme,
3181
- tone: "default"
3182
- }, config),
3183
- primary: _buildBadgeColorTheme(tokens, {
3184
- scheme,
3185
- tone: "primary"
3186
- }, config),
3187
- positive: _buildBadgeColorTheme(tokens, {
3188
- scheme,
3189
- tone: "positive"
3190
- }, config),
3191
- caution: _buildBadgeColorTheme(tokens, {
3192
- scheme,
3193
- tone: "caution"
3194
- }, config),
3195
- critical: _buildBadgeColorTheme(tokens, {
3196
- scheme,
3197
- tone: "critical"
3198
- }, config)
2612
+ default: _buildBadgeColorTheme(tokens, { scheme, tone: "default" }, config),
2613
+ primary: _buildBadgeColorTheme(tokens, { scheme, tone: "primary" }, config),
2614
+ positive: _buildBadgeColorTheme(tokens, { scheme, tone: "positive" }, config),
2615
+ caution: _buildBadgeColorTheme(tokens, { scheme, tone: "caution" }, config),
2616
+ critical: _buildBadgeColorTheme(tokens, { scheme, tone: "critical" }, config)
3199
2617
  };
3200
2618
  }
3201
2619
  function _buildBadgeColorTheme(parentTokens, options, config) {
3202
2620
  var _a, _b, _c;
3203
- const {
3204
- scheme,
3205
- tone
3206
- } = options, tokens = parentTokens == null ? void 0 : parentTokens[tone], context = {
3207
- hue: (tokens == null ? void 0 : tokens._hue) || ((_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.base) == null ? void 0 : _b[tone]) == null ? void 0 : _c._hue) || "gray",
3208
- scheme
3209
- };
2621
+ const { scheme, tone } = options, tokens = parentTokens == null ? void 0 : parentTokens[tone], context = { hue: (tokens == null ? void 0 : tokens._hue) || ((_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.base) == null ? void 0 : _b[tone]) == null ? void 0 : _c._hue) || "gray", scheme };
3210
2622
  return {
3211
2623
  bg: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.bg),
3212
2624
  fg: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.fg),
@@ -3215,66 +2627,33 @@ function _buildBadgeColorTheme(parentTokens, options, config) {
3215
2627
  };
3216
2628
  }
3217
2629
  function buildButtonColorTheme(options, config) {
3218
- const {
3219
- scheme
3220
- } = options, modes = {};
2630
+ const { scheme } = options, modes = {};
3221
2631
  for (const mode of THEME_COLOR_BUTTON_MODES)
3222
- modes[mode] = buildButtonTonesColorTheme({
3223
- scheme,
3224
- mode
3225
- }, config);
2632
+ modes[mode] = buildButtonTonesColorTheme({ scheme, mode }, config);
3226
2633
  return modes;
3227
2634
  }
3228
2635
  function buildButtonTonesColorTheme(options, config) {
3229
- const {
3230
- mode,
3231
- scheme
3232
- } = options, tones2 = {};
2636
+ const { mode, scheme } = options, tones2 = {};
3233
2637
  for (const tone of THEME_COLOR_STATE_TONES)
3234
- tones2[tone] = buildButtonStatesColorTheme({
3235
- mode,
3236
- scheme,
3237
- tone
3238
- }, config);
2638
+ tones2[tone] = buildButtonStatesColorTheme({ mode, scheme, tone }, config);
3239
2639
  return tones2;
3240
2640
  }
3241
2641
  function buildButtonStatesColorTheme(options, config) {
3242
- const {
3243
- mode,
3244
- scheme,
3245
- tone
3246
- } = options, states = {};
2642
+ const { mode, scheme, tone } = options, states = {};
3247
2643
  for (const state of THEME_COLOR_STATES)
3248
- states[state] = buildButtonStateColorTheme({
3249
- mode,
3250
- tone,
3251
- scheme,
3252
- state
3253
- }, config);
2644
+ states[state] = buildButtonStateColorTheme({ mode, tone, scheme, state }, config);
3254
2645
  return states;
3255
2646
  }
3256
2647
  function buildButtonStateColorTheme(options, config) {
3257
2648
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
3258
- const {
3259
- mode,
3260
- tone,
3261
- scheme,
3262
- state
3263
- } = options, tokens = (_d = (_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.button) == null ? void 0 : _b[mode]) == null ? void 0 : _c[tone]) == null ? void 0 : _d[state], hue = (tokens == null ? void 0 : tokens._hue) || "gray", blendMode = (tokens == null ? void 0 : tokens._blend) || ["screen", "multiply"], context = {
3264
- hue,
3265
- scheme
3266
- };
2649
+ const { mode, tone, scheme, state } = options, tokens = (_d = (_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.button) == null ? void 0 : _b[mode]) == null ? void 0 : _c[tone]) == null ? void 0 : _d[state], hue = (tokens == null ? void 0 : tokens._hue) || "gray", blendMode = (tokens == null ? void 0 : tokens._blend) || ["screen", "multiply"], context = { hue, scheme };
3267
2650
  return {
3268
2651
  _blend: blendMode[scheme === "light" ? 0 : 1],
3269
2652
  accent: {
3270
2653
  fg: resolveColorTokenValue(context, (_e = tokens == null ? void 0 : tokens.accent) == null ? void 0 : _e.fg)
3271
2654
  },
3272
- avatar: buildAvatarColorTheme({
3273
- scheme
3274
- }, tokens),
3275
- badge: buildBadgeColorTheme(tokens == null ? void 0 : tokens.badge, {
3276
- scheme
3277
- }, config),
2655
+ avatar: buildAvatarColorTheme({ scheme }, tokens),
2656
+ badge: buildBadgeColorTheme(tokens == null ? void 0 : tokens.badge, { scheme }, config),
3278
2657
  bg: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.bg),
3279
2658
  border: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.border),
3280
2659
  code: {
@@ -3302,67 +2681,24 @@ function buildButtonStateColorTheme(options, config) {
3302
2681
  };
3303
2682
  }
3304
2683
  function buildInputColorTheme(options, config) {
3305
- const {
3306
- scheme,
3307
- tone
3308
- } = options;
2684
+ const { scheme, tone } = options;
3309
2685
  return {
3310
- default: buildInputStatesColorTheme({
3311
- mode: "default",
3312
- scheme,
3313
- tone
3314
- }, config),
3315
- invalid: buildInputStatesColorTheme({
3316
- mode: "invalid",
3317
- scheme,
3318
- tone
3319
- }, config)
2686
+ default: buildInputStatesColorTheme({ mode: "default", scheme, tone }, config),
2687
+ invalid: buildInputStatesColorTheme({ mode: "invalid", scheme, tone }, config)
3320
2688
  };
3321
2689
  }
3322
2690
  function buildInputStatesColorTheme(options, config) {
3323
- const {
3324
- mode,
3325
- scheme,
3326
- tone
3327
- } = options;
2691
+ const { mode, scheme, tone } = options;
3328
2692
  return {
3329
- enabled: buildInputStateColorTheme({
3330
- mode,
3331
- scheme,
3332
- state: "enabled",
3333
- tone
3334
- }, config),
3335
- hovered: buildInputStateColorTheme({
3336
- mode,
3337
- scheme,
3338
- state: "hovered",
3339
- tone
3340
- }, config),
3341
- readOnly: buildInputStateColorTheme({
3342
- mode,
3343
- scheme,
3344
- state: "readOnly",
3345
- tone
3346
- }, config),
3347
- disabled: buildInputStateColorTheme({
3348
- mode,
3349
- scheme,
3350
- state: "disabled",
3351
- tone
3352
- }, config)
2693
+ enabled: buildInputStateColorTheme({ mode, scheme, state: "enabled", tone }, config),
2694
+ hovered: buildInputStateColorTheme({ mode, scheme, state: "hovered", tone }, config),
2695
+ readOnly: buildInputStateColorTheme({ mode, scheme, state: "readOnly", tone }, config),
2696
+ disabled: buildInputStateColorTheme({ mode, scheme, state: "disabled", tone }, config)
3353
2697
  };
3354
2698
  }
3355
2699
  function buildInputStateColorTheme(options, config) {
3356
2700
  var _a, _b, _c, _d, _e, _f, _g;
3357
- const {
3358
- mode,
3359
- tone,
3360
- scheme,
3361
- state
3362
- } = options, tokens = (_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.input) == null ? void 0 : _b[mode]) == null ? void 0 : _c[state], hue = (tokens == null ? void 0 : tokens._hue) || ((_f = (_e = (_d = config == null ? void 0 : config.color) == null ? void 0 : _d.base) == null ? void 0 : _e[tone]) == null ? void 0 : _f._hue) || "gray", blendMode = (tokens == null ? void 0 : tokens._blend) || ["screen", "multiply"], context = {
3363
- hue,
3364
- scheme
3365
- };
2701
+ const { mode, tone, scheme, state } = options, tokens = (_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.input) == null ? void 0 : _b[mode]) == null ? void 0 : _c[state], hue = (tokens == null ? void 0 : tokens._hue) || ((_f = (_e = (_d = config == null ? void 0 : config.color) == null ? void 0 : _d.base) == null ? void 0 : _e[tone]) == null ? void 0 : _f._hue) || "gray", blendMode = (tokens == null ? void 0 : tokens._blend) || ["screen", "multiply"], context = { hue, scheme };
3366
2702
  return {
3367
2703
  _blend: blendMode[scheme === "light" ? 0 : 1],
3368
2704
  bg: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.bg),
@@ -3375,50 +2711,27 @@ function buildInputStateColorTheme(options, config) {
3375
2711
  };
3376
2712
  }
3377
2713
  function buildSelectableColorTheme(options, config) {
3378
- const {
3379
- scheme
3380
- } = options, tones2 = {};
2714
+ const { scheme } = options, tones2 = {};
3381
2715
  for (const tone of THEME_COLOR_STATE_TONES)
3382
- tones2[tone] = buildSelectableStatesColorTheme({
3383
- scheme,
3384
- tone
3385
- }, config);
2716
+ tones2[tone] = buildSelectableStatesColorTheme({ scheme, tone }, config);
3386
2717
  return tones2;
3387
2718
  }
3388
2719
  function buildSelectableStatesColorTheme(options, config) {
3389
- const {
3390
- scheme,
3391
- tone
3392
- } = options, states = {};
2720
+ const { scheme, tone } = options, states = {};
3393
2721
  for (const state of THEME_COLOR_STATES)
3394
- states[state] = buildSelectableStateColorTheme({
3395
- tone,
3396
- scheme,
3397
- state
3398
- }, config);
2722
+ states[state] = buildSelectableStateColorTheme({ tone, scheme, state }, config);
3399
2723
  return states;
3400
2724
  }
3401
2725
  function buildSelectableStateColorTheme(options, config) {
3402
2726
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
3403
- const {
3404
- scheme,
3405
- state,
3406
- tone
3407
- } = options, tokens = (_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.selectable) == null ? void 0 : _b[tone]) == null ? void 0 : _c[state], hue = (tokens == null ? void 0 : tokens._hue) || "gray", blendMode = (tokens == null ? void 0 : tokens._blend) || ["screen", "multiply"], context = {
3408
- hue,
3409
- scheme
3410
- };
2727
+ const { scheme, state, tone } = options, tokens = (_c = (_b = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.selectable) == null ? void 0 : _b[tone]) == null ? void 0 : _c[state], hue = (tokens == null ? void 0 : tokens._hue) || "gray", blendMode = (tokens == null ? void 0 : tokens._blend) || ["screen", "multiply"], context = { hue, scheme };
3411
2728
  return {
3412
2729
  _blend: blendMode[scheme === "light" ? 0 : 1],
3413
2730
  accent: {
3414
2731
  fg: resolveColorTokenValue(context, (_d = tokens == null ? void 0 : tokens.accent) == null ? void 0 : _d.fg)
3415
2732
  },
3416
- avatar: buildAvatarColorTheme({
3417
- scheme
3418
- }, tokens),
3419
- badge: buildBadgeColorTheme(tokens == null ? void 0 : tokens.badge, {
3420
- scheme
3421
- }, config),
2733
+ avatar: buildAvatarColorTheme({ scheme }, tokens),
2734
+ badge: buildBadgeColorTheme(tokens == null ? void 0 : tokens.badge, { scheme }, config),
3422
2735
  bg: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.bg),
3423
2736
  border: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.border),
3424
2737
  code: {
@@ -3447,12 +2760,7 @@ function buildSelectableStateColorTheme(options, config) {
3447
2760
  }
3448
2761
  function buildSyntaxColorTheme(options, config) {
3449
2762
  var _a;
3450
- const {
3451
- scheme
3452
- } = options, tokens = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.syntax, context = {
3453
- hue: "gray",
3454
- scheme
3455
- };
2763
+ const { scheme } = options, tokens = (_a = config == null ? void 0 : config.color) == null ? void 0 : _a.syntax, context = { hue: "gray", scheme };
3456
2764
  return {
3457
2765
  atrule: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.atrule),
3458
2766
  attrName: resolveColorTokenValue(context, tokens == null ? void 0 : tokens.attrName),
@@ -3567,19 +2875,11 @@ function rgbToHex(color2) {
3567
2875
  const r = round(clamp(Math.round(color2.r), 0, 255)), g = round(clamp(Math.round(color2.g), 0, 255)), b = round(clamp(Math.round(color2.b), 0, 255));
3568
2876
  return "a" in color2 ? `rgba(${r},${g},${b},${color2.a})` : "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
3569
2877
  }
3570
- function rgbToHsl({
3571
- r,
3572
- g,
3573
- b
3574
- }) {
2878
+ function rgbToHsl({ r, g, b }) {
3575
2879
  r /= 255, g /= 255, b /= 255;
3576
2880
  const cmin = Math.min(r, g, b), cmax = Math.max(r, g, b), delta = cmax - cmin;
3577
2881
  let h = 0, s = 0, l = 0;
3578
- return delta == 0 ? h = 0 : cmax == r ? h = (g - b) / delta % 6 : cmax == g ? h = (b - r) / delta + 2 : h = (r - g) / delta + 4, h = Math.round(h * 60), h < 0 && (h += 360), l = (cmax + cmin) / 2, s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1)), s = +(s * 100).toFixed(1), l = +(l * 100).toFixed(1), {
3579
- h,
3580
- s,
3581
- l
3582
- };
2882
+ return delta == 0 ? h = 0 : cmax == r ? h = (g - b) / delta % 6 : cmax == g ? h = (b - r) / delta + 2 : h = (r - g) / delta + 4, h = Math.round(h * 60), h < 0 && (h += 360), l = (cmax + cmin) / 2, s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1)), s = +(s * 100).toFixed(1), l = +(l * 100).toFixed(1), { h, s, l };
3583
2883
  }
3584
2884
  function hslToRgb(hsl) {
3585
2885
  const s = hsl.s / 100, l = hsl.l / 100, c = (1 - Math.abs(2 * l - 1)) * s, x = c * (1 - Math.abs(hsl.h / 60 % 2 - 1)), m = l - c / 2;
@@ -3604,18 +2904,10 @@ function parseHsl(str) {
3604
2904
  const res = HSL_RE.exec(str);
3605
2905
  if (!res)
3606
2906
  throw new Error(`parseHsl: string is not a HSL color: "${str}"`);
3607
- return {
3608
- h: parseInt(res[1]),
3609
- s: parseFloat(res[3]),
3610
- l: parseFloat(res[5])
3611
- };
2907
+ return { h: parseInt(res[1]), s: parseFloat(res[3]), l: parseFloat(res[5]) };
3612
2908
  }
3613
2909
  function parseColor(color2) {
3614
- if (!color2) return {
3615
- r: 0,
3616
- g: 0,
3617
- b: 0
3618
- };
2910
+ if (!color2) return { r: 0, g: 0, b: 0 };
3619
2911
  if (typeof color2 != "string")
3620
2912
  throw new Error("parseColor: expected a string");
3621
2913
  if (isHex(color2))
@@ -3630,11 +2922,7 @@ function getContrastRatio(bg, fg) {
3630
2922
  const rgb1 = parseColor(bg), rgb2 = parseColor(fg), c1 = rgb_lrgb(rgb1), c2 = rgb_lrgb(rgb2), l1 = lrgb_luminance(c1), l2 = lrgb_luminance(c2);
3631
2923
  return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
3632
2924
  }
3633
- function rgb_lrgb({
3634
- r,
3635
- g,
3636
- b
3637
- }) {
2925
+ function rgb_lrgb({ r, g, b }) {
3638
2926
  return [rgb_lrgb1(r / 255), rgb_lrgb1(g / 255), rgb_lrgb1(b / 255)];
3639
2927
  }
3640
2928
  function rgb_lrgb1(v) {
@@ -3649,9 +2937,7 @@ function rgba(color2, a) {
3649
2937
  }
3650
2938
  const RGB_RANGE = [0, 255];
3651
2939
  function mixThemeColor(value, options) {
3652
- const {
3653
- blendMode
3654
- } = options, color2 = parseColor(value), black2 = parseColor(options.black), white2 = parseColor(options.white), bg = options.bg ? parseColor(options.bg) : blendMode === "multiply" ? white2 : black2, paletteRange = {
2940
+ const { blendMode } = options, color2 = parseColor(value), black2 = parseColor(options.black), white2 = parseColor(options.white), bg = options.bg ? parseColor(options.bg) : blendMode === "multiply" ? white2 : black2, paletteRange = {
3655
2941
  r: [black2.r, white2.r],
3656
2942
  g: [black2.g, white2.g],
3657
2943
  b: [black2.b, white2.b]
@@ -3671,11 +2957,7 @@ function mixThemeColor(value, options) {
3671
2957
  return rgbToHex(v);
3672
2958
  }
3673
2959
  function renderColorValue(str, options) {
3674
- const {
3675
- bg,
3676
- blendMode,
3677
- colorPalette
3678
- } = options;
2960
+ const { bg, blendMode, colorPalette } = options;
3679
2961
  if (bg === "white")
3680
2962
  throw new Error("Cannot blend with white background");
3681
2963
  const node = parseTokenValue(str);
@@ -3713,31 +2995,17 @@ function renderThemeColorSchemes(value, config) {
3713
2995
  };
3714
2996
  }
3715
2997
  function renderThemeColorScheme(colorPalette, value) {
3716
- const toneEntries = Object.entries(value), [, transparentTone] = toneEntries.find(([k]) => k === "transparent"), [, defaultTone] = toneEntries.find(([k]) => k === "default"), renderedTransparentTone = renderThemeColor(transparentTone, {
3717
- colorPalette
3718
- }), renderedDefaultTone = renderThemeColor(defaultTone, {
3719
- colorPalette
3720
- }), bg = renderedDefaultTone.bg;
2998
+ const toneEntries = Object.entries(value), [, transparentTone] = toneEntries.find(([k]) => k === "transparent"), [, defaultTone] = toneEntries.find(([k]) => k === "default"), renderedTransparentTone = renderThemeColor(transparentTone, { colorPalette }), renderedDefaultTone = renderThemeColor(defaultTone, { colorPalette }), bg = renderedDefaultTone.bg;
3721
2999
  if (bg === "white")
3722
3000
  throw new Error("Cannot blend with white background");
3723
- return Object.fromEntries([["transparent", renderedTransparentTone], ["default", renderedDefaultTone], ...toneEntries.filter(([k]) => k !== "default" && k !== "transparent").map(([k, v]) => [k, renderThemeColor(v, {
3724
- bg,
3725
- colorPalette
3726
- })])]);
3001
+ return Object.fromEntries([
3002
+ ["transparent", renderedTransparentTone],
3003
+ ["default", renderedDefaultTone],
3004
+ ...toneEntries.filter(([k]) => k !== "default" && k !== "transparent").map(([k, v]) => [k, renderThemeColor(v, { bg, colorPalette })])
3005
+ ]);
3727
3006
  }
3728
3007
  function renderThemeColor(value, options) {
3729
- const {
3730
- colorPalette,
3731
- bg
3732
- } = options, blendMode = value._blend || "multiply", baseBg = renderColorValue(value.bg, {
3733
- colorPalette,
3734
- bg,
3735
- blendMode
3736
- }), colorOptions = {
3737
- colorPalette,
3738
- bg: baseBg,
3739
- blendMode
3740
- }, button = renderThemeColorButton(value.button, {
3008
+ const { colorPalette, bg } = options, blendMode = value._blend || "multiply", baseBg = renderColorValue(value.bg, { colorPalette, bg, blendMode }), colorOptions = { colorPalette, bg: baseBg, blendMode }, button = renderThemeColorButton(value.button, {
3741
3009
  baseBg,
3742
3010
  blendMode,
3743
3011
  colorPalette
@@ -3750,26 +3018,17 @@ function renderThemeColor(value, options) {
3750
3018
  umbra: renderColorValue(value.shadow.umbra, {
3751
3019
  ...colorOptions,
3752
3020
  bg: void 0,
3753
- colorPalette: {
3754
- ...colorPalette,
3755
- black: "#000000"
3756
- }
3021
+ colorPalette: { ...colorPalette, black: "#000000" }
3757
3022
  }),
3758
3023
  penumbra: renderColorValue(value.shadow.penumbra, {
3759
3024
  ...colorOptions,
3760
3025
  bg: void 0,
3761
- colorPalette: {
3762
- ...colorPalette,
3763
- black: "#000000"
3764
- }
3026
+ colorPalette: { ...colorPalette, black: "#000000" }
3765
3027
  }),
3766
3028
  ambient: renderColorValue(value.shadow.ambient, {
3767
3029
  ...colorOptions,
3768
3030
  bg: void 0,
3769
- colorPalette: {
3770
- ...colorPalette,
3771
- black: "#000000"
3772
- }
3031
+ colorPalette: { ...colorPalette, black: "#000000" }
3773
3032
  })
3774
3033
  };
3775
3034
  return {
@@ -3778,17 +3037,9 @@ function renderThemeColor(value, options) {
3778
3037
  accent: {
3779
3038
  fg: renderColorValue(value.accent.fg, colorOptions)
3780
3039
  },
3781
- avatar: renderThemeColorAvatar(value.avatar, {
3782
- baseBg,
3783
- colorPalette,
3784
- blendMode
3785
- }),
3040
+ avatar: renderThemeColorAvatar(value.avatar, { baseBg, colorPalette, blendMode }),
3786
3041
  backdrop: renderColorValue(value.backdrop, colorOptions),
3787
- badge: renderThemeColorBadge(value.badge, {
3788
- baseBg,
3789
- colorPalette,
3790
- blendMode
3791
- }),
3042
+ badge: renderThemeColorBadge(value.badge, { baseBg, colorPalette, blendMode }),
3792
3043
  bg: baseBg,
3793
3044
  border: renderColorValue(value.border, colorOptions),
3794
3045
  button,
@@ -3799,16 +3050,8 @@ function renderThemeColor(value, options) {
3799
3050
  fg: renderColorValue(value.fg, colorOptions),
3800
3051
  focusRing: renderColorValue(value.focusRing, colorOptions),
3801
3052
  icon: renderColorValue(value.icon, colorOptions),
3802
- input: renderThemeColorInput(value.input, {
3803
- baseBg,
3804
- colorPalette,
3805
- blendMode
3806
- }),
3807
- kbd: renderThemeColorKBD(value.kbd, {
3808
- baseBg,
3809
- colorPalette,
3810
- blendMode
3811
- }),
3053
+ input: renderThemeColorInput(value.input, { baseBg, colorPalette, blendMode }),
3054
+ kbd: renderThemeColorKBD(value.kbd, { baseBg, colorPalette, blendMode }),
3812
3055
  link: {
3813
3056
  fg: renderColorValue(value.link.fg, colorOptions)
3814
3057
  },
@@ -3821,20 +3064,12 @@ function renderThemeColor(value, options) {
3821
3064
  from: renderColorValue(value.skeleton.from, colorOptions),
3822
3065
  to: renderColorValue(value.skeleton.to, colorOptions)
3823
3066
  },
3824
- syntax: renderSyntaxColorTheme(value.syntax, {
3825
- baseBg,
3826
- colorPalette,
3827
- blendMode
3828
- }),
3067
+ syntax: renderSyntaxColorTheme(value.syntax, { baseBg, colorPalette, blendMode }),
3829
3068
  selectable
3830
3069
  };
3831
3070
  }
3832
3071
  function renderThemeColorKBD(value, options) {
3833
- const {
3834
- baseBg,
3835
- blendMode,
3836
- colorPalette
3837
- } = options, rootOptions = {
3072
+ const { baseBg, blendMode, colorPalette } = options, rootOptions = {
3838
3073
  bg: baseBg,
3839
3074
  blendMode,
3840
3075
  colorPalette
@@ -3863,11 +3098,7 @@ function renderThemeColorAvatar(value, options) {
3863
3098
  };
3864
3099
  }
3865
3100
  function renderThemeColorAvatarColor(value, options) {
3866
- const {
3867
- baseBg,
3868
- blendMode: rootBlendMode,
3869
- colorPalette
3870
- } = options, blendMode = value._blend || "multiply", rootOptions = {
3101
+ const { baseBg, blendMode: rootBlendMode, colorPalette } = options, blendMode = value._blend || "multiply", rootOptions = {
3871
3102
  bg: baseBg,
3872
3103
  blendMode: rootBlendMode,
3873
3104
  colorPalette
@@ -3892,11 +3123,7 @@ function renderThemeColorBadge(value, options) {
3892
3123
  };
3893
3124
  }
3894
3125
  function renderThemeColorBadgeColor(value, options) {
3895
- const {
3896
- baseBg,
3897
- blendMode: rootBlendMode,
3898
- colorPalette
3899
- } = options, blendMode = rootBlendMode, rootOptions = {
3126
+ const { baseBg, blendMode: rootBlendMode, colorPalette } = options, blendMode = rootBlendMode, rootOptions = {
3900
3127
  bg: baseBg,
3901
3128
  blendMode: rootBlendMode,
3902
3129
  colorPalette
@@ -3939,11 +3166,7 @@ function renderThemeColorButtonStates(value, options) {
3939
3166
  }
3940
3167
  function renderThemeColorState(value, options) {
3941
3168
  var _a, _b;
3942
- const {
3943
- baseBg,
3944
- blendMode: rootBlendMode,
3945
- colorPalette
3946
- } = options, blendMode = value._blend || "multiply", rootOptions = {
3169
+ const { baseBg, blendMode: rootBlendMode, colorPalette } = options, blendMode = value._blend || "multiply", rootOptions = {
3947
3170
  bg: baseBg,
3948
3171
  blendMode: rootBlendMode,
3949
3172
  colorPalette
@@ -3957,16 +3180,8 @@ function renderThemeColorState(value, options) {
3957
3180
  accent: {
3958
3181
  fg: renderColorValue(value.accent.fg, colorOptions)
3959
3182
  },
3960
- avatar: renderThemeColorAvatar(value.avatar, {
3961
- baseBg: bg,
3962
- colorPalette,
3963
- blendMode
3964
- }),
3965
- badge: renderThemeColorBadge(value.badge, {
3966
- baseBg: bg,
3967
- colorPalette,
3968
- blendMode
3969
- }),
3183
+ avatar: renderThemeColorAvatar(value.avatar, { baseBg: bg, colorPalette, blendMode }),
3184
+ badge: renderThemeColorBadge(value.badge, { baseBg: bg, colorPalette, blendMode }),
3970
3185
  bg,
3971
3186
  border: renderColorValue(value.border, colorOptions),
3972
3187
  code: {
@@ -4008,19 +3223,7 @@ function renderInputStatesColorTheme(value, options) {
4008
3223
  };
4009
3224
  }
4010
3225
  function renderInputStateColorTheme(value, options) {
4011
- const {
4012
- baseBg,
4013
- blendMode: rootBlendMode,
4014
- colorPalette
4015
- } = options, blendMode = value._blend || "multiply", rootOptions = {
4016
- colorPalette,
4017
- bg: baseBg,
4018
- blendMode: rootBlendMode
4019
- }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
4020
- colorPalette,
4021
- bg,
4022
- blendMode
4023
- };
3226
+ const { baseBg, blendMode: rootBlendMode, colorPalette } = options, blendMode = value._blend || "multiply", rootOptions = { colorPalette, bg: baseBg, blendMode: rootBlendMode }, bg = renderColorValue(value.bg, rootOptions), colorOptions = { colorPalette, bg, blendMode };
4024
3227
  return {
4025
3228
  _blend: blendMode,
4026
3229
  bg,
@@ -4051,15 +3254,7 @@ function renderThemeColorSelectableStates(value, options) {
4051
3254
  };
4052
3255
  }
4053
3256
  function renderSyntaxColorTheme(value, options) {
4054
- const {
4055
- colorPalette,
4056
- baseBg,
4057
- blendMode
4058
- } = options, colorOptions = {
4059
- colorPalette,
4060
- bg: baseBg,
4061
- blendMode
4062
- };
3257
+ const { colorPalette, baseBg, blendMode } = options, colorOptions = { colorPalette, bg: baseBg, blendMode };
4063
3258
  return {
4064
3259
  atrule: renderColorValue(value.atrule, colorOptions),
4065
3260
  attrName: renderColorValue(value.attrName, colorOptions),