@sanity/ui 2.0.0-beta.2 → 2.0.0-beta.4
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.cjs.mjs +10 -36
- package/dist/index.d.ts +179 -238
- package/dist/index.esm.js +18 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +26 -218
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs.mjs +1 -1
- package/dist/theme.d.ts +75 -111
- package/dist/theme.esm.js +154 -92
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +154 -92
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
- package/src/core/_compat.ts +236 -87
- package/src/core/components/menu/__workshop__/selectedItem.tsx +7 -2
- package/src/core/components/menu/menuButton.tsx +12 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +6 -3
- package/src/core/primitives/kbd/kbd.tsx +2 -0
- package/src/core/styles/margin/marginsStyle.test.ts +2 -2
- package/src/core/styles/padding/paddingStyle.test.ts +2 -2
- package/src/core/theme/__workshop__/build/Root.tsx +20 -3
- package/src/core/theme/__workshop__/build/story.tsx +16 -10
- package/src/core/theme/__workshop__/canvas.tsx +7 -7
- package/src/core/theme/__workshop__/debug/story.tsx +159 -0
- package/src/core/theme/__workshop__/index.ts +5 -0
- package/src/core/theme/theme.test.tsx +2 -2
- package/src/core/types/button.ts +1 -2
- package/src/theme/build/_deprecated/color/factory.ts +3 -3
- package/src/theme/build/buildColorTheme.ts +16 -16
- package/src/theme/build/colorToken/colorToken.ts +19 -0
- package/src/theme/build/colorToken/compileColorToken.ts +17 -0
- package/src/theme/build/colorToken/index.ts +2 -0
- package/src/theme/build/colorToken/types.ts +6 -0
- package/src/theme/build/renderColorTheme.ts +14 -15
- package/src/theme/build/renderColorValue.ts +1 -1
- package/src/theme/config/system.ts +9 -9
- package/src/theme/config/tokens/color/types.ts +12 -1
- package/src/theme/config/tokens/parseTokenKey.ts +1 -0
- package/src/theme/config/tokens/parseTokenValue.ts +1 -0
- package/src/theme/defaults/colorTokens.ts +127 -66
- package/src/theme/index.ts +0 -7
- package/src/theme/system/color/_constants.ts +5 -2
- package/src/theme/system/color/_system.ts +2 -1
- package/src/theme/system/color/avatar.ts +2 -12
- package/src/theme/system/color/button.ts +4 -20
- package/src/theme/system/color/input.ts +3 -11
- package/src/theme/system/color/selectable.ts +3 -14
- package/src/theme/system/shadow.ts +0 -6
- package/src/theme/system/styles.ts +0 -6
- package/src/theme/system/theme.ts +2 -0
- package/src/theme/system/v0/avatar.ts +1 -1
- package/src/theme/system/v0/color/button.ts +4 -4
- package/src/theme/system/v0/color/card.ts +2 -2
- package/src/theme/system/v0/color/input.ts +3 -3
- package/src/theme/system/v0/color/muted.ts +2 -2
- package/src/theme/system/v0/color/solid.ts +2 -2
- package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
- package/src/theme/versioning/v2_v0.ts +2 -2
- package/src/theme/build/colorToken.ts +0 -39
|
@@ -4,6 +4,9 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
4
4
|
base: {
|
|
5
5
|
'*': {
|
|
6
6
|
_blend: ['multiply', 'screen'],
|
|
7
|
+
accent: {
|
|
8
|
+
fg: ['purple/600', 'purple/400'],
|
|
9
|
+
},
|
|
7
10
|
avatar: {
|
|
8
11
|
'*': {
|
|
9
12
|
_blend: ['screen', 'multiply'],
|
|
@@ -19,6 +22,8 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
19
22
|
'*': {
|
|
20
23
|
bg: ['100', '900'],
|
|
21
24
|
fg: ['600', '400'],
|
|
25
|
+
icon: ['500', '500'],
|
|
26
|
+
dot: ['500', '500'],
|
|
22
27
|
},
|
|
23
28
|
positive: {
|
|
24
29
|
bg: ['200/0.6', '900'],
|
|
@@ -33,7 +38,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
33
38
|
border: ['200', '800'],
|
|
34
39
|
code: {
|
|
35
40
|
bg: ['50', '950'],
|
|
36
|
-
fg: ['
|
|
41
|
+
fg: ['700', '300'],
|
|
37
42
|
},
|
|
38
43
|
fg: ['800', '200'],
|
|
39
44
|
focusRing: ['blue/500', 'blue/500'],
|
|
@@ -43,7 +48,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
43
48
|
border: ['200', '800'],
|
|
44
49
|
},
|
|
45
50
|
link: {
|
|
46
|
-
fg: ['blue/
|
|
51
|
+
fg: ['blue/700', 'blue/300'],
|
|
47
52
|
},
|
|
48
53
|
muted: {
|
|
49
54
|
bg: ['50', '950'],
|
|
@@ -100,8 +105,10 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
100
105
|
},
|
|
101
106
|
badge: {
|
|
102
107
|
'*': {
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
bg: ['900', '100'],
|
|
109
|
+
fg: ['400', '600'],
|
|
110
|
+
dot: ['500', '500'],
|
|
111
|
+
icon: ['500', '500'],
|
|
105
112
|
},
|
|
106
113
|
},
|
|
107
114
|
bg: ['500', '400'],
|
|
@@ -113,8 +120,8 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
113
120
|
fg: ['white', 'black'],
|
|
114
121
|
icon: ['200', '800'],
|
|
115
122
|
kbd: {
|
|
116
|
-
bg: ['
|
|
117
|
-
fg: ['
|
|
123
|
+
bg: ['black', 'white'],
|
|
124
|
+
fg: ['200', '800'],
|
|
118
125
|
border: ['800', '200'],
|
|
119
126
|
},
|
|
120
127
|
link: {
|
|
@@ -141,8 +148,21 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
141
148
|
},
|
|
142
149
|
disabled: {
|
|
143
150
|
_hue: 'gray',
|
|
151
|
+
badge: {
|
|
152
|
+
'*': {
|
|
153
|
+
bg: ['gray/700', 'gray/300'],
|
|
154
|
+
fg: ['white', 'black'],
|
|
155
|
+
dot: ['white', 'black'],
|
|
156
|
+
icon: ['white', 'black'],
|
|
157
|
+
},
|
|
158
|
+
},
|
|
144
159
|
bg: ['200', '800'],
|
|
145
160
|
icon: ['white', 'black'],
|
|
161
|
+
kbd: {
|
|
162
|
+
bg: ['black', 'white'],
|
|
163
|
+
fg: ['white', 'black'],
|
|
164
|
+
border: ['700', '300'],
|
|
165
|
+
},
|
|
146
166
|
},
|
|
147
167
|
},
|
|
148
168
|
default: {
|
|
@@ -192,12 +212,29 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
192
212
|
'*': {
|
|
193
213
|
'*': {
|
|
194
214
|
_blend: ['multiply', 'screen'],
|
|
215
|
+
accent: {
|
|
216
|
+
fg: ['purple/700/0.6', 'purple/400/0.8'],
|
|
217
|
+
},
|
|
218
|
+
badge: {
|
|
219
|
+
'*': {
|
|
220
|
+
bg: ['100', '900'],
|
|
221
|
+
fg: ['600', '400'],
|
|
222
|
+
dot: ['500', '500'],
|
|
223
|
+
icon: ['500', '500'],
|
|
224
|
+
},
|
|
225
|
+
},
|
|
195
226
|
bg: ['50', '950'],
|
|
227
|
+
border: ['100', '900'],
|
|
228
|
+
code: {
|
|
229
|
+
bg: ['500/0.1', '400/0.1'],
|
|
230
|
+
fg: ['700/0.6', '400/0.6'],
|
|
231
|
+
},
|
|
196
232
|
fg: ['700', '400'],
|
|
197
233
|
icon: ['600', '500'],
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
fg: ['
|
|
234
|
+
kbd: {
|
|
235
|
+
bg: ['white', 'black'],
|
|
236
|
+
fg: ['600', '400'],
|
|
237
|
+
border: ['200', '800'],
|
|
201
238
|
},
|
|
202
239
|
link: {
|
|
203
240
|
fg: ['blue/700/0.6', 'blue/400/0.8'],
|
|
@@ -206,20 +243,10 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
206
243
|
bg: ['100', '950'],
|
|
207
244
|
fg: ['700/0.6', '400/0.6'],
|
|
208
245
|
},
|
|
209
|
-
code: {
|
|
210
|
-
bg: ['500/0.1', '400/0.1'],
|
|
211
|
-
fg: ['700/0.6', '400/0.6'],
|
|
212
|
-
},
|
|
213
246
|
skeleton: {
|
|
214
247
|
from: ['100', '900'],
|
|
215
248
|
to: ['100/0.5', '900/0.5'],
|
|
216
249
|
},
|
|
217
|
-
badge: {
|
|
218
|
-
'*': {
|
|
219
|
-
dot: ['300', '700'],
|
|
220
|
-
icon: ['600', '400'],
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
250
|
},
|
|
224
251
|
hovered: {
|
|
225
252
|
bg: ['100', '900'],
|
|
@@ -235,21 +262,35 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
235
262
|
},
|
|
236
263
|
disabled: {
|
|
237
264
|
_hue: 'gray',
|
|
238
|
-
|
|
239
|
-
|
|
265
|
+
accent: {
|
|
266
|
+
fg: ['200', '800'],
|
|
267
|
+
},
|
|
268
|
+
badge: {
|
|
269
|
+
'*': {
|
|
270
|
+
_hue: 'gray',
|
|
271
|
+
bg: ['50', '950'],
|
|
272
|
+
fg: ['gray/200', 'gray/800'],
|
|
273
|
+
dot: ['gray/200', 'gray/800'],
|
|
274
|
+
icon: ['gray/200', 'gray/800'],
|
|
275
|
+
},
|
|
276
|
+
},
|
|
240
277
|
border: ['100', '900'],
|
|
241
|
-
|
|
242
|
-
|
|
278
|
+
code: {
|
|
279
|
+
bg: ['50', '950'],
|
|
280
|
+
fg: ['200', '800'],
|
|
243
281
|
},
|
|
244
|
-
|
|
245
|
-
|
|
282
|
+
fg: ['200', '800'],
|
|
283
|
+
icon: ['200', '800'],
|
|
284
|
+
kbd: {
|
|
285
|
+
bg: ['white', 'black'],
|
|
286
|
+
fg: ['200', '800'],
|
|
287
|
+
border: ['100', '900'],
|
|
246
288
|
},
|
|
247
289
|
link: {
|
|
248
|
-
fg: ['200
|
|
290
|
+
fg: ['200', '800'],
|
|
249
291
|
},
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
fg: ['200/0.6', '900/0.6'],
|
|
292
|
+
muted: {
|
|
293
|
+
fg: ['200', '800'],
|
|
253
294
|
},
|
|
254
295
|
},
|
|
255
296
|
},
|
|
@@ -268,34 +309,41 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
268
309
|
'*': {
|
|
269
310
|
'*': {
|
|
270
311
|
_blend: ['multiply', 'screen'],
|
|
312
|
+
accent: {
|
|
313
|
+
fg: ['purple/700/0.7', 'purple/300/0.7'],
|
|
314
|
+
},
|
|
315
|
+
badge: {
|
|
316
|
+
'*': {
|
|
317
|
+
bg: ['100', '900'],
|
|
318
|
+
fg: ['600', '400'],
|
|
319
|
+
dot: ['500', '500'],
|
|
320
|
+
icon: ['500', '500'],
|
|
321
|
+
},
|
|
322
|
+
},
|
|
271
323
|
bg: ['white', 'black'],
|
|
272
|
-
fg: ['700', '300'],
|
|
273
|
-
icon: ['700/0.7', '300/0.7'],
|
|
274
324
|
border: ['white/0', 'black/0'],
|
|
275
|
-
|
|
325
|
+
code: {
|
|
276
326
|
bg: ['100', '950'],
|
|
277
|
-
fg: ['
|
|
327
|
+
fg: ['600', '300'],
|
|
278
328
|
},
|
|
279
|
-
|
|
280
|
-
|
|
329
|
+
fg: ['700', '300'],
|
|
330
|
+
icon: ['700/0.7', '300/0.7'],
|
|
331
|
+
kbd: {
|
|
332
|
+
bg: ['white', 'black'],
|
|
333
|
+
fg: ['600', '400'],
|
|
334
|
+
border: ['200', '800'],
|
|
281
335
|
},
|
|
282
336
|
link: {
|
|
283
337
|
fg: ['blue/700/0.7', 'blue/300/0.7'],
|
|
284
338
|
},
|
|
285
|
-
|
|
339
|
+
muted: {
|
|
286
340
|
bg: ['100', '950'],
|
|
287
|
-
fg: ['
|
|
341
|
+
fg: ['700/0.7', '300/0.7'],
|
|
288
342
|
},
|
|
289
343
|
skeleton: {
|
|
290
344
|
from: ['100', '900'],
|
|
291
345
|
to: ['100/0.5', '900/0.5'],
|
|
292
346
|
},
|
|
293
|
-
badge: {
|
|
294
|
-
'*': {
|
|
295
|
-
dot: ['300', '700'],
|
|
296
|
-
icon: ['600', '400'],
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
347
|
},
|
|
300
348
|
hovered: {
|
|
301
349
|
bg: ['50', '950'],
|
|
@@ -314,19 +362,33 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
314
362
|
},
|
|
315
363
|
disabled: {
|
|
316
364
|
_hue: 'gray',
|
|
365
|
+
badge: {
|
|
366
|
+
'*': {
|
|
367
|
+
_hue: 'gray',
|
|
368
|
+
bg: ['50', '950'],
|
|
369
|
+
fg: ['gray/200', 'gray/800'],
|
|
370
|
+
dot: ['gray/200', 'gray/800'],
|
|
371
|
+
icon: ['gray/200', 'gray/800'],
|
|
372
|
+
},
|
|
373
|
+
},
|
|
317
374
|
fg: ['200', '800'],
|
|
318
375
|
muted: {
|
|
319
|
-
fg: ['200
|
|
376
|
+
fg: ['200', '800'],
|
|
320
377
|
},
|
|
321
378
|
accent: {
|
|
322
|
-
fg: ['200
|
|
379
|
+
fg: ['200', '800'],
|
|
380
|
+
},
|
|
381
|
+
kbd: {
|
|
382
|
+
bg: ['white', 'black'],
|
|
383
|
+
fg: ['200', '800'],
|
|
384
|
+
border: ['100', '900'],
|
|
323
385
|
},
|
|
324
386
|
link: {
|
|
325
|
-
fg: ['200
|
|
387
|
+
fg: ['200', '800'],
|
|
326
388
|
},
|
|
327
389
|
code: {
|
|
328
|
-
bg: ['50
|
|
329
|
-
fg: ['200
|
|
390
|
+
bg: ['50', '950'],
|
|
391
|
+
fg: ['200', '800'],
|
|
330
392
|
},
|
|
331
393
|
},
|
|
332
394
|
},
|
|
@@ -380,9 +442,18 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
380
442
|
bg: ['500', '400'],
|
|
381
443
|
fg: ['white', 'black'],
|
|
382
444
|
},
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
445
|
+
yellow: {bg: ['600', '400']},
|
|
446
|
+
green: {bg: ['600', '400']},
|
|
447
|
+
cyan: {bg: ['600', '400']},
|
|
448
|
+
},
|
|
449
|
+
badge: {
|
|
450
|
+
'*': {
|
|
451
|
+
// _blend: ['multiply', 'screen'],
|
|
452
|
+
bg: ['100', '900'],
|
|
453
|
+
fg: ['600', '400'],
|
|
454
|
+
dot: ['500', '500'],
|
|
455
|
+
icon: ['500', '500'],
|
|
456
|
+
},
|
|
386
457
|
},
|
|
387
458
|
border: ['200', '800'],
|
|
388
459
|
muted: {
|
|
@@ -392,6 +463,11 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
392
463
|
accent: {
|
|
393
464
|
fg: ['purple/600', 'purple/400'],
|
|
394
465
|
},
|
|
466
|
+
kbd: {
|
|
467
|
+
bg: ['white', 'black'],
|
|
468
|
+
fg: ['600', '400'],
|
|
469
|
+
border: ['200', '800'],
|
|
470
|
+
},
|
|
395
471
|
link: {
|
|
396
472
|
fg: ['blue/700', 'blue/300'],
|
|
397
473
|
},
|
|
@@ -403,21 +479,6 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
403
479
|
from: ['100', '900'],
|
|
404
480
|
to: ['100/0.5', '900/0.5'],
|
|
405
481
|
},
|
|
406
|
-
badge: {
|
|
407
|
-
'*': {
|
|
408
|
-
// _blend: ['multiply', 'screen'],
|
|
409
|
-
bg: ['100', '900'],
|
|
410
|
-
fg: ['600', '200'],
|
|
411
|
-
dot: ['300', '700'],
|
|
412
|
-
icon: ['600', '400'],
|
|
413
|
-
},
|
|
414
|
-
},
|
|
415
|
-
kbd: {
|
|
416
|
-
// _blend: ['multiply', 'screen'],
|
|
417
|
-
bg: ['white', 'black'],
|
|
418
|
-
fg: ['600', '400'],
|
|
419
|
-
border: ['200', '800'],
|
|
420
|
-
},
|
|
421
482
|
},
|
|
422
483
|
hovered: {
|
|
423
484
|
bg: ['50', '950'],
|
package/src/theme/index.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {COLOR_HUES} from '@sanity/color'
|
|
2
2
|
|
|
3
|
+
/** @public */
|
|
4
|
+
export const THEME_COLOR_SCHEMES = ['light', 'dark'] as const
|
|
5
|
+
|
|
3
6
|
/** @public */
|
|
4
7
|
export const THEME_COLOR_BLEND_MODES = ['multiply', 'screen'] as const
|
|
5
8
|
|
|
@@ -7,7 +10,7 @@ export const THEME_COLOR_BLEND_MODES = ['multiply', 'screen'] as const
|
|
|
7
10
|
export const THEME_COLOR_CARD_TONES = [
|
|
8
11
|
'transparent',
|
|
9
12
|
'default',
|
|
10
|
-
'primary',
|
|
13
|
+
'primary',
|
|
11
14
|
'positive',
|
|
12
15
|
'caution',
|
|
13
16
|
'critical',
|
|
@@ -16,7 +19,7 @@ export const THEME_COLOR_CARD_TONES = [
|
|
|
16
19
|
/** @public */
|
|
17
20
|
export const THEME_COLOR_STATE_TONES = [
|
|
18
21
|
'default',
|
|
19
|
-
'primary',
|
|
22
|
+
'primary',
|
|
20
23
|
'positive',
|
|
21
24
|
'caution',
|
|
22
25
|
'critical',
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
THEME_COLOR_CARD_TONES,
|
|
6
6
|
THEME_COLOR_INPUT_MODES,
|
|
7
7
|
THEME_COLOR_INPUT_STATES,
|
|
8
|
+
THEME_COLOR_SCHEMES,
|
|
8
9
|
THEME_COLOR_STATES,
|
|
9
10
|
THEME_COLOR_STATE_TONES,
|
|
10
11
|
} from './_constants'
|
|
@@ -12,7 +13,7 @@ import {
|
|
|
12
13
|
/**
|
|
13
14
|
* @public
|
|
14
15
|
*/
|
|
15
|
-
export type ThemeColorSchemeKey =
|
|
16
|
+
export type ThemeColorSchemeKey = (typeof THEME_COLOR_SCHEMES)[number]
|
|
16
17
|
|
|
17
18
|
/** @public */
|
|
18
19
|
export type ThemeColorBlendModeKey = (typeof THEME_COLOR_BLEND_MODES)[number]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ThemeColorBlendModeKey} from './_system'
|
|
1
|
+
import {ThemeColorAvatarColorKey, ThemeColorBlendModeKey} from './_system'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
@@ -12,14 +12,4 @@ export interface ThemeColorAvatarHue_v2 {
|
|
|
12
12
|
/**
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
16
|
-
gray: ThemeColorAvatarHue_v2
|
|
17
|
-
blue: ThemeColorAvatarHue_v2
|
|
18
|
-
purple: ThemeColorAvatarHue_v2
|
|
19
|
-
magenta: ThemeColorAvatarHue_v2
|
|
20
|
-
red: ThemeColorAvatarHue_v2
|
|
21
|
-
orange: ThemeColorAvatarHue_v2
|
|
22
|
-
yellow: ThemeColorAvatarHue_v2
|
|
23
|
-
green: ThemeColorAvatarHue_v2
|
|
24
|
-
cyan: ThemeColorAvatarHue_v2
|
|
25
|
-
}
|
|
15
|
+
export type ThemeColorAvatar_v2 = Record<ThemeColorAvatarColorKey, ThemeColorAvatarHue_v2>
|
|
@@ -1,33 +1,17 @@
|
|
|
1
|
+
import {ThemeColorButtonModeKey, ThemeColorStateKey, ThemeColorStateToneKey} from './_system'
|
|
1
2
|
import {ThemeColorState_v2} from './state'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @public
|
|
5
6
|
*/
|
|
6
|
-
export
|
|
7
|
-
enabled: ThemeColorState_v2
|
|
8
|
-
hovered: ThemeColorState_v2
|
|
9
|
-
pressed: ThemeColorState_v2
|
|
10
|
-
selected: ThemeColorState_v2
|
|
11
|
-
disabled: ThemeColorState_v2
|
|
12
|
-
}
|
|
7
|
+
export type ThemeColorButtonTone_v2 = Record<ThemeColorStateKey, ThemeColorState_v2>
|
|
13
8
|
|
|
14
9
|
/**
|
|
15
|
-
* TODO: Rename to `ThemeColorButtonMode`.
|
|
16
10
|
* @public
|
|
17
11
|
*/
|
|
18
|
-
export
|
|
19
|
-
default: ThemeColorButtonStates_v2
|
|
20
|
-
primary: ThemeColorButtonStates_v2
|
|
21
|
-
positive: ThemeColorButtonStates_v2
|
|
22
|
-
caution: ThemeColorButtonStates_v2
|
|
23
|
-
critical: ThemeColorButtonStates_v2
|
|
24
|
-
}
|
|
12
|
+
export type ThemeColorButtonMode_v2 = Record<ThemeColorStateToneKey, ThemeColorButtonTone_v2>
|
|
25
13
|
|
|
26
14
|
/**
|
|
27
15
|
* @public
|
|
28
16
|
*/
|
|
29
|
-
export
|
|
30
|
-
default: ThemeColorButtonTones_v2
|
|
31
|
-
ghost: ThemeColorButtonTones_v2
|
|
32
|
-
bleed: ThemeColorButtonTones_v2
|
|
33
|
-
}
|
|
17
|
+
export type ThemeColorButton_v2 = Record<ThemeColorButtonModeKey, ThemeColorButtonMode_v2>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ThemeColorBlendModeKey} from './_system'
|
|
1
|
+
import {ThemeColorBlendModeKey, ThemeColorInputModeKey, ThemeColorInputStateKey} from './_system'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
@@ -17,17 +17,9 @@ export interface ThemeColorInputState_v2 {
|
|
|
17
17
|
/**
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
21
|
-
enabled: ThemeColorInputState_v2
|
|
22
|
-
disabled: ThemeColorInputState_v2
|
|
23
|
-
hovered: ThemeColorInputState_v2
|
|
24
|
-
readOnly: ThemeColorInputState_v2
|
|
25
|
-
}
|
|
20
|
+
export type ThemeColorInputMode_v2 = Record<ThemeColorInputStateKey, ThemeColorInputState_v2>
|
|
26
21
|
|
|
27
22
|
/**
|
|
28
23
|
* @public
|
|
29
24
|
*/
|
|
30
|
-
export
|
|
31
|
-
default: ThemeColorInputStates_v2
|
|
32
|
-
invalid: ThemeColorInputStates_v2
|
|
33
|
-
}
|
|
25
|
+
export type ThemeColorInput_v2 = Record<ThemeColorInputModeKey, ThemeColorInputMode_v2>
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
+
import {ThemeColorStateKey, ThemeColorStateToneKey} from './_system'
|
|
1
2
|
import {ThemeColorState_v2} from './state'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @public
|
|
5
6
|
*/
|
|
6
|
-
export
|
|
7
|
-
enabled: ThemeColorState_v2
|
|
8
|
-
hovered: ThemeColorState_v2
|
|
9
|
-
pressed: ThemeColorState_v2
|
|
10
|
-
selected: ThemeColorState_v2
|
|
11
|
-
disabled: ThemeColorState_v2
|
|
12
|
-
}
|
|
7
|
+
export type ThemeColorSelectableTone_v2 = Record<ThemeColorStateKey, ThemeColorState_v2>
|
|
13
8
|
|
|
14
9
|
/**
|
|
15
10
|
* @public
|
|
16
11
|
*/
|
|
17
|
-
export
|
|
18
|
-
default: ThemeColorSelectableStates_v2
|
|
19
|
-
primary: ThemeColorSelectableStates_v2
|
|
20
|
-
positive: ThemeColorSelectableStates_v2
|
|
21
|
-
caution: ThemeColorSelectableStates_v2
|
|
22
|
-
critical: ThemeColorSelectableStates_v2
|
|
23
|
-
}
|
|
12
|
+
export type ThemeColorSelectable_v2 = Record<ThemeColorStateToneKey, ThemeColorSelectableTone_v2>
|
|
@@ -33,6 +33,7 @@ export interface RootTheme_v2 {
|
|
|
33
33
|
radius: number[]
|
|
34
34
|
shadow: Array<ThemeShadow | null>
|
|
35
35
|
space: number[]
|
|
36
|
+
/** @internal */
|
|
36
37
|
style?: ThemeStyles
|
|
37
38
|
}
|
|
38
39
|
|
|
@@ -97,6 +98,7 @@ export interface BaseTheme {
|
|
|
97
98
|
*/
|
|
98
99
|
space: number[]
|
|
99
100
|
/**
|
|
101
|
+
* @internal
|
|
100
102
|
* @deprecated Use `v2.style` instead
|
|
101
103
|
*/
|
|
102
104
|
styles?: ThemeStyles
|
|
@@ -2,13 +2,13 @@ import {ThemeColorGenericState} from './_generic'
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
|
-
* @deprecated Use `
|
|
5
|
+
* @deprecated Use `ThemeColorState_v2` instead.
|
|
6
6
|
*/
|
|
7
7
|
export type ThemeColorButtonState = ThemeColorGenericState
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @public
|
|
11
|
-
* @deprecated
|
|
11
|
+
* @deprecated Use `ThemeColorButtonStates_v2` instead.
|
|
12
12
|
*/
|
|
13
13
|
export interface ThemeColorButtonStates {
|
|
14
14
|
enabled: ThemeColorGenericState
|
|
@@ -21,7 +21,7 @@ export interface ThemeColorButtonStates {
|
|
|
21
21
|
/**
|
|
22
22
|
* TODO: Rename to `ThemeColorButtonMode`.
|
|
23
23
|
* @public
|
|
24
|
-
* @deprecated
|
|
24
|
+
* @deprecated Use `ThemeColorButtonTones_v2` instead.
|
|
25
25
|
*/
|
|
26
26
|
export interface ThemeColorButtonTones {
|
|
27
27
|
default: ThemeColorButtonStates
|
|
@@ -33,7 +33,7 @@ export interface ThemeColorButtonTones {
|
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* @public
|
|
36
|
-
* @deprecated
|
|
36
|
+
* @deprecated Use `ThemeColorButton_v2` instead.
|
|
37
37
|
*/
|
|
38
38
|
export interface ThemeColorButton {
|
|
39
39
|
default: ThemeColorButtonTones
|
|
@@ -2,13 +2,13 @@ import {ThemeColorGenericState} from './_generic'
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
|
-
* @deprecated Use `
|
|
5
|
+
* @deprecated Use `ThemeColorState_v2` instead.
|
|
6
6
|
*/
|
|
7
7
|
export type ThemeColorCardState = ThemeColorGenericState
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @public
|
|
11
|
-
* @deprecated
|
|
11
|
+
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
12
12
|
*/
|
|
13
13
|
export interface ThemeColorCard {
|
|
14
14
|
enabled: ThemeColorGenericState
|
|
@@ -2,7 +2,7 @@ import {ThemeColorBlendModeKey} from '../../color/_system'
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
|
-
* @deprecated
|
|
5
|
+
* @deprecated Use `ThemeColorInputState_v2` instead.
|
|
6
6
|
*/
|
|
7
7
|
export interface ThemeColorInputState {
|
|
8
8
|
_blend?: ThemeColorBlendModeKey
|
|
@@ -15,7 +15,7 @@ export interface ThemeColorInputState {
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @public
|
|
18
|
-
* @deprecated
|
|
18
|
+
* @deprecated Use `ThemeColorInputMode_v2` instead.
|
|
19
19
|
*/
|
|
20
20
|
export interface ThemeColorInputStates {
|
|
21
21
|
enabled: ThemeColorInputState
|
|
@@ -26,7 +26,7 @@ export interface ThemeColorInputStates {
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* @public
|
|
29
|
-
* @deprecated
|
|
29
|
+
* @deprecated Use `ThemeColorInput_v2` instead.
|
|
30
30
|
*/
|
|
31
31
|
export interface ThemeColorInput {
|
|
32
32
|
default: ThemeColorInputStates
|
|
@@ -2,7 +2,7 @@ import {ThemeColorGenericState} from './_generic'
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
|
-
* @deprecated
|
|
5
|
+
* @deprecated Use `ThemeColorSelectableTone_v2` instead.
|
|
6
6
|
*/
|
|
7
7
|
export interface ThemeColorMutedTone {
|
|
8
8
|
enabled: ThemeColorGenericState
|
|
@@ -14,7 +14,7 @@ export interface ThemeColorMutedTone {
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @public
|
|
17
|
-
* @deprecated
|
|
17
|
+
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
18
18
|
*/
|
|
19
19
|
export interface ThemeColorMuted {
|
|
20
20
|
default: ThemeColorMutedTone
|
|
@@ -2,7 +2,7 @@ import {ThemeColorGenericState} from './_generic'
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
|
-
* @deprecated
|
|
5
|
+
* @deprecated Use `ThemeColorSelectableTone_v2` instead.
|
|
6
6
|
*/
|
|
7
7
|
export interface ThemeColorSolidTone {
|
|
8
8
|
enabled: ThemeColorGenericState
|
|
@@ -14,7 +14,7 @@ export interface ThemeColorSolidTone {
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @public
|
|
17
|
-
* @deprecated
|
|
17
|
+
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
18
18
|
*/
|
|
19
19
|
export interface ThemeColorSolid {
|
|
20
20
|
default: ThemeColorSolidTone
|