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