@sanity/ui 2.9.0-canary.6 → 2.10.0-corel.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/_chunks-cjs/getTheme_v2.js +54 -84
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +54 -84
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +54 -84
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/index.d.mts +21 -14
- package/dist/index.d.ts +21 -14
- package/dist/index.esm.js +3150 -3805
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3148 -3802
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3150 -3805
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.mts +22 -28
- package/dist/theme.d.ts +22 -28
- package/dist/theme.esm.js +630 -1318
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +630 -1318
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +630 -1318
- package/dist/theme.mjs.map +1 -1
- package/package.json +1 -2
- package/src/core/__workshop__/constants.ts +13 -13
- package/src/core/components/autocomplete/autocomplete.tsx +31 -42
- package/src/core/components/breadcrumbs/__workshop__/buttons.tsx +58 -0
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +3 -1
- package/src/core/components/breadcrumbs/__workshop__/index.ts +5 -0
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +1 -13
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +70 -50
- package/src/core/components/dialog/dialog.tsx +3 -5
- package/src/core/components/menu/menu.tsx +11 -15
- package/src/core/components/menu/menuButton.tsx +36 -14
- package/src/core/components/menu/menuGroup.tsx +1 -2
- package/src/core/components/menu/menuItem.tsx +2 -4
- package/src/core/components/menu/useMenuController.ts +21 -18
- package/src/core/components/tab/tabList.tsx +11 -3
- package/src/core/components/toast/toastProvider.tsx +6 -5
- package/src/core/components/tree/treeItem.tsx +15 -18
- package/src/core/constants.ts +1 -1
- package/src/core/hooks/useArrayProp.ts +9 -14
- package/src/core/hooks/useMatchMedia.ts +22 -12
- package/src/core/primitives/avatar/avatarStack.tsx +5 -2
- package/src/core/primitives/button/__workshop__/props.tsx +1 -1
- package/src/core/primitives/button/button.tsx +11 -6
- package/src/core/primitives/button/styles.ts +1 -1
- package/src/core/primitives/flex/flex.tsx +5 -1
- package/src/core/primitives/heading/heading.tsx +1 -1
- package/src/core/primitives/popover/popover.tsx +139 -74
- package/src/core/primitives/popover/popoverCard.tsx +4 -1
- package/src/core/primitives/text/styles.ts +1 -0
- package/src/core/primitives/text/text.tsx +4 -2
- package/src/core/primitives/tooltip/tooltip.tsx +17 -47
- package/src/core/styles/card/_cardColorStyle.ts +8 -0
- package/src/core/styles/flex/flexStyle.ts +18 -0
- package/src/core/styles/flex/types.ts +2 -0
- package/src/core/theme/themeProvider.tsx +6 -4
- package/src/core/utils/elementQuery/elementQuery.tsx +17 -16
- package/src/core/utils/layer/layerProvider.tsx +1 -1
- package/src/core/utils/portal/portalProvider.tsx +5 -5
- package/src/theme/build/_deprecated/color/factory.ts +1 -1
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/build/buildColorTheme.ts +45 -39
- package/src/theme/build/renderColorTheme.ts +239 -65
- package/src/theme/build/resolveColorTokens.ts +51 -115
- package/src/theme/config/tokens/color/types.ts +4 -18
- package/src/theme/defaults/colorTokens.ts +19 -11
- package/src/theme/getScopedTheme.ts +9 -2
- package/src/theme/system/color/_constants.ts +8 -0
- package/src/theme/system/color/badge.ts +3 -7
- package/src/theme/system/v0/color/_system.ts +8 -4
- package/src/theme/system/v0/color/color.ts +3 -2
- package/src/theme/versioning/themeColor_v0_v2.ts +26 -0
- package/src/theme/versioning/v0_v2.ts +4 -0
- package/src/core/components/toast/toastState.ts +0 -6
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {ThemeColorPalette, ThemeConfig} from '../config'
|
|
2
2
|
import {defaultColorPalette} from '../defaults/colorPalette'
|
|
3
3
|
import {
|
|
4
|
+
THEME_COLOR_STATE_TONES,
|
|
4
5
|
ThemeColorAvatar_v2,
|
|
5
6
|
ThemeColorBadgeTone_v2,
|
|
6
7
|
ThemeColorBadge_v2,
|
|
@@ -31,15 +32,18 @@ export function renderThemeColorSchemes(
|
|
|
31
32
|
const colorPalette = config?.palette ?? defaultColorPalette
|
|
32
33
|
|
|
33
34
|
return {
|
|
34
|
-
light: renderThemeColorScheme(colorPalette, value.light),
|
|
35
|
-
dark: renderThemeColorScheme(colorPalette, value.dark),
|
|
35
|
+
light: renderThemeColorScheme(colorPalette, value.light, {debugPath: 'light'}),
|
|
36
|
+
dark: renderThemeColorScheme(colorPalette, value.dark, {debugPath: 'dark'}),
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
function renderThemeColorScheme(
|
|
40
41
|
colorPalette: ThemeColorPalette,
|
|
41
42
|
value: ThemeColorScheme_v2,
|
|
43
|
+
options: {debugPath: string},
|
|
42
44
|
): ThemeColorScheme_v2 {
|
|
45
|
+
const {debugPath} = options
|
|
46
|
+
|
|
43
47
|
const toneEntries = Object.entries(value) as [ThemeColorCardToneKey, ThemeColorCard_v2][]
|
|
44
48
|
|
|
45
49
|
const [, transparentTone] = toneEntries.find(([k]) => k === 'transparent')!
|
|
@@ -48,8 +52,14 @@ function renderThemeColorScheme(
|
|
|
48
52
|
// The `transparent` and `default` tones are special cases, so we render them first
|
|
49
53
|
// (rendered without a `bg` option).
|
|
50
54
|
// But the rest of the tones are rendered on top of the `default` tone's `bg`.
|
|
51
|
-
const renderedTransparentTone = renderThemeColor(transparentTone, {
|
|
52
|
-
|
|
55
|
+
const renderedTransparentTone = renderThemeColor(transparentTone, {
|
|
56
|
+
colorPalette,
|
|
57
|
+
debugPath: `${debugPath}.transparent`,
|
|
58
|
+
})
|
|
59
|
+
const renderedDefaultTone = renderThemeColor(defaultTone, {
|
|
60
|
+
colorPalette,
|
|
61
|
+
debugPath: `${debugPath}.default`,
|
|
62
|
+
})
|
|
53
63
|
|
|
54
64
|
// Get the `default` tone's `bg` property
|
|
55
65
|
const bg = renderedDefaultTone.bg
|
|
@@ -63,7 +73,14 @@ function renderThemeColorScheme(
|
|
|
63
73
|
['default', renderedDefaultTone],
|
|
64
74
|
...toneEntries
|
|
65
75
|
.filter(([k]) => k !== 'default' && k !== 'transparent')
|
|
66
|
-
.map(([k, v]) => [
|
|
76
|
+
.map(([k, v]) => [
|
|
77
|
+
k,
|
|
78
|
+
renderThemeColor(v, {
|
|
79
|
+
bg,
|
|
80
|
+
colorPalette,
|
|
81
|
+
debugPath: `${debugPath}.${k}`,
|
|
82
|
+
}),
|
|
83
|
+
]),
|
|
67
84
|
]) as ThemeColorScheme_v2
|
|
68
85
|
}
|
|
69
86
|
|
|
@@ -72,10 +89,12 @@ function renderThemeColor(
|
|
|
72
89
|
options: {
|
|
73
90
|
bg?: string
|
|
74
91
|
colorPalette: ThemeColorPalette
|
|
92
|
+
debugPath: string
|
|
75
93
|
},
|
|
76
94
|
): ThemeColorCard_v2 {
|
|
77
|
-
const {colorPalette, bg} = options
|
|
95
|
+
const {colorPalette, bg, debugPath} = options
|
|
78
96
|
const blendMode = value._blend || 'multiply'
|
|
97
|
+
|
|
79
98
|
const baseBg = renderColorValue(value.bg, {colorPalette, bg, blendMode})
|
|
80
99
|
const colorOptions: RenderColorValueOptions = {colorPalette, bg: baseBg, blendMode}
|
|
81
100
|
|
|
@@ -83,12 +102,14 @@ function renderThemeColor(
|
|
|
83
102
|
baseBg,
|
|
84
103
|
blendMode,
|
|
85
104
|
colorPalette,
|
|
105
|
+
debugPath: `${debugPath}.button`,
|
|
86
106
|
})
|
|
87
107
|
|
|
88
108
|
const selectable = renderThemeColorSelectable(value.selectable, {
|
|
89
109
|
colorPalette,
|
|
90
110
|
baseBg,
|
|
91
111
|
blendMode,
|
|
112
|
+
debugPath: `${debugPath}.selectable`,
|
|
92
113
|
})
|
|
93
114
|
|
|
94
115
|
const shadow: ThemeColorShadow = {
|
|
@@ -116,9 +137,19 @@ function renderThemeColor(
|
|
|
116
137
|
accent: {
|
|
117
138
|
fg: renderColorValue(value.accent.fg, colorOptions),
|
|
118
139
|
},
|
|
119
|
-
avatar: renderThemeColorAvatar(value.avatar, {
|
|
140
|
+
avatar: renderThemeColorAvatar(value.avatar, {
|
|
141
|
+
baseBg,
|
|
142
|
+
colorPalette,
|
|
143
|
+
blendMode,
|
|
144
|
+
debugPath: `${debugPath}.avatar`,
|
|
145
|
+
}),
|
|
120
146
|
backdrop: renderColorValue(value.backdrop, colorOptions),
|
|
121
|
-
badge: renderThemeColorBadge(value.badge, {
|
|
147
|
+
badge: renderThemeColorBadge(value.badge, {
|
|
148
|
+
baseBg,
|
|
149
|
+
colorPalette,
|
|
150
|
+
blendMode,
|
|
151
|
+
debugPath: `${debugPath}.badge`,
|
|
152
|
+
}),
|
|
122
153
|
bg: baseBg,
|
|
123
154
|
border: renderColorValue(value.border, colorOptions),
|
|
124
155
|
button,
|
|
@@ -129,8 +160,18 @@ function renderThemeColor(
|
|
|
129
160
|
fg: renderColorValue(value.fg, colorOptions),
|
|
130
161
|
focusRing: renderColorValue(value.focusRing, colorOptions),
|
|
131
162
|
icon: renderColorValue(value.icon, colorOptions),
|
|
132
|
-
input: renderThemeColorInput(value.input, {
|
|
133
|
-
|
|
163
|
+
input: renderThemeColorInput(value.input, {
|
|
164
|
+
baseBg,
|
|
165
|
+
colorPalette,
|
|
166
|
+
blendMode,
|
|
167
|
+
debugPath: `${debugPath}.input`,
|
|
168
|
+
}),
|
|
169
|
+
kbd: renderThemeColorKBD(value.kbd, {
|
|
170
|
+
baseBg,
|
|
171
|
+
colorPalette,
|
|
172
|
+
blendMode,
|
|
173
|
+
debugPath: `${debugPath}.kbd`,
|
|
174
|
+
}),
|
|
134
175
|
link: {
|
|
135
176
|
fg: renderColorValue(value.link.fg, colorOptions),
|
|
136
177
|
},
|
|
@@ -143,7 +184,12 @@ function renderThemeColor(
|
|
|
143
184
|
from: renderColorValue(value.skeleton.from, colorOptions),
|
|
144
185
|
to: renderColorValue(value.skeleton.to, colorOptions),
|
|
145
186
|
},
|
|
146
|
-
syntax: renderSyntaxColorTheme(value.syntax, {
|
|
187
|
+
syntax: renderSyntaxColorTheme(value.syntax, {
|
|
188
|
+
baseBg,
|
|
189
|
+
colorPalette,
|
|
190
|
+
blendMode,
|
|
191
|
+
debugPath: `${debugPath}.syntax`,
|
|
192
|
+
}),
|
|
147
193
|
selectable,
|
|
148
194
|
}
|
|
149
195
|
}
|
|
@@ -154,6 +200,7 @@ function renderThemeColorKBD(
|
|
|
154
200
|
baseBg: string
|
|
155
201
|
blendMode: ThemeColorBlendModeKey
|
|
156
202
|
colorPalette: ThemeColorPalette
|
|
203
|
+
debugPath: string
|
|
157
204
|
},
|
|
158
205
|
): ThemeColorKBD {
|
|
159
206
|
const {baseBg, blendMode, colorPalette} = options
|
|
@@ -185,18 +232,48 @@ function renderThemeColorAvatar(
|
|
|
185
232
|
baseBg: string
|
|
186
233
|
blendMode: ThemeColorBlendModeKey
|
|
187
234
|
colorPalette: ThemeColorPalette
|
|
235
|
+
debugPath: string
|
|
188
236
|
},
|
|
189
237
|
): ThemeColorAvatar_v2 {
|
|
238
|
+
const {debugPath} = options
|
|
239
|
+
|
|
190
240
|
return {
|
|
191
|
-
gray: renderThemeColorAvatarColor(value.gray,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
241
|
+
gray: renderThemeColorAvatarColor(value.gray, {
|
|
242
|
+
...options,
|
|
243
|
+
debugPath: `${debugPath}.gray`,
|
|
244
|
+
}),
|
|
245
|
+
blue: renderThemeColorAvatarColor(value.blue, {
|
|
246
|
+
...options,
|
|
247
|
+
debugPath: `${debugPath}.blue`,
|
|
248
|
+
}),
|
|
249
|
+
purple: renderThemeColorAvatarColor(value.purple, {
|
|
250
|
+
...options,
|
|
251
|
+
debugPath: `${debugPath}.purple`,
|
|
252
|
+
}),
|
|
253
|
+
magenta: renderThemeColorAvatarColor(value.magenta, {
|
|
254
|
+
...options,
|
|
255
|
+
debugPath: `${debugPath}.magenta`,
|
|
256
|
+
}),
|
|
257
|
+
red: renderThemeColorAvatarColor(value.red, {
|
|
258
|
+
...options,
|
|
259
|
+
debugPath: `${debugPath}.red`,
|
|
260
|
+
}),
|
|
261
|
+
orange: renderThemeColorAvatarColor(value.orange, {
|
|
262
|
+
...options,
|
|
263
|
+
debugPath: `${debugPath}.orange`,
|
|
264
|
+
}),
|
|
265
|
+
yellow: renderThemeColorAvatarColor(value.yellow, {
|
|
266
|
+
...options,
|
|
267
|
+
debugPath: `${debugPath}.yellow`,
|
|
268
|
+
}),
|
|
269
|
+
green: renderThemeColorAvatarColor(value.green, {
|
|
270
|
+
...options,
|
|
271
|
+
debugPath: `${debugPath}.green`,
|
|
272
|
+
}),
|
|
273
|
+
cyan: renderThemeColorAvatarColor(value.cyan, {
|
|
274
|
+
...options,
|
|
275
|
+
debugPath: `${debugPath}.cyan`,
|
|
276
|
+
}),
|
|
200
277
|
}
|
|
201
278
|
}
|
|
202
279
|
|
|
@@ -206,6 +283,7 @@ function renderThemeColorAvatarColor(
|
|
|
206
283
|
baseBg: string
|
|
207
284
|
blendMode: ThemeColorBlendModeKey
|
|
208
285
|
colorPalette: ThemeColorPalette
|
|
286
|
+
debugPath: string
|
|
209
287
|
},
|
|
210
288
|
): ThemeColorAvatar_v2['gray'] {
|
|
211
289
|
const {baseBg, blendMode: rootBlendMode, colorPalette} = options
|
|
@@ -238,15 +316,19 @@ function renderThemeColorBadge(
|
|
|
238
316
|
baseBg: string
|
|
239
317
|
blendMode: ThemeColorBlendModeKey
|
|
240
318
|
colorPalette: ThemeColorPalette
|
|
319
|
+
debugPath: string
|
|
241
320
|
},
|
|
242
321
|
): ThemeColorBadge_v2 {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
322
|
+
const {debugPath} = options
|
|
323
|
+
|
|
324
|
+
return THEME_COLOR_STATE_TONES.reduce((acc, tone) => {
|
|
325
|
+
acc[tone] = renderThemeColorBadgeColor(value[tone], {
|
|
326
|
+
...options,
|
|
327
|
+
debugPath: `${debugPath}.${tone}`,
|
|
328
|
+
})
|
|
329
|
+
|
|
330
|
+
return acc
|
|
331
|
+
}, {} as ThemeColorBadge_v2)
|
|
250
332
|
}
|
|
251
333
|
|
|
252
334
|
function renderThemeColorBadgeColor(
|
|
@@ -255,12 +337,11 @@ function renderThemeColorBadgeColor(
|
|
|
255
337
|
baseBg: string
|
|
256
338
|
blendMode: ThemeColorBlendModeKey
|
|
257
339
|
colorPalette: ThemeColorPalette
|
|
340
|
+
debugPath: string
|
|
258
341
|
},
|
|
259
342
|
): ThemeColorBadgeTone_v2 {
|
|
260
343
|
const {baseBg, blendMode: rootBlendMode, colorPalette} = options
|
|
261
344
|
|
|
262
|
-
// const blendMode = value._blend || 'multiply'
|
|
263
|
-
|
|
264
345
|
const blendMode = rootBlendMode
|
|
265
346
|
|
|
266
347
|
const rootOptions: RenderColorValueOptions = {
|
|
@@ -291,12 +372,24 @@ function renderThemeColorButton(
|
|
|
291
372
|
baseBg: string
|
|
292
373
|
blendMode: ThemeColorBlendModeKey
|
|
293
374
|
colorPalette: ThemeColorPalette
|
|
375
|
+
debugPath: string
|
|
294
376
|
},
|
|
295
377
|
): ThemeColorButton_v2 {
|
|
378
|
+
const {debugPath} = options
|
|
379
|
+
|
|
296
380
|
return {
|
|
297
|
-
default: renderThemeColorButtonTones(value.default,
|
|
298
|
-
|
|
299
|
-
|
|
381
|
+
default: renderThemeColorButtonTones(value.default, {
|
|
382
|
+
...options,
|
|
383
|
+
debugPath: `${debugPath}.default`,
|
|
384
|
+
}),
|
|
385
|
+
ghost: renderThemeColorButtonTones(value.ghost, {
|
|
386
|
+
...options,
|
|
387
|
+
debugPath: `${debugPath}.ghost`,
|
|
388
|
+
}),
|
|
389
|
+
bleed: renderThemeColorButtonTones(value.bleed, {
|
|
390
|
+
...options,
|
|
391
|
+
debugPath: `${debugPath}.bleed`,
|
|
392
|
+
}),
|
|
300
393
|
}
|
|
301
394
|
}
|
|
302
395
|
|
|
@@ -306,15 +399,19 @@ function renderThemeColorButtonTones(
|
|
|
306
399
|
baseBg: string
|
|
307
400
|
blendMode: ThemeColorBlendModeKey
|
|
308
401
|
colorPalette: ThemeColorPalette
|
|
402
|
+
debugPath: string
|
|
309
403
|
},
|
|
310
404
|
): ThemeColorButtonMode_v2 {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
405
|
+
const {debugPath} = options
|
|
406
|
+
|
|
407
|
+
return THEME_COLOR_STATE_TONES.reduce((acc, tone) => {
|
|
408
|
+
acc[tone] = renderThemeColorButtonStates(value[tone], {
|
|
409
|
+
...options,
|
|
410
|
+
debugPath: `${debugPath}.${tone}`,
|
|
411
|
+
})
|
|
412
|
+
|
|
413
|
+
return acc
|
|
414
|
+
}, {} as ThemeColorButtonMode_v2)
|
|
318
415
|
}
|
|
319
416
|
|
|
320
417
|
function renderThemeColorButtonStates(
|
|
@@ -323,14 +420,32 @@ function renderThemeColorButtonStates(
|
|
|
323
420
|
baseBg: string
|
|
324
421
|
blendMode: ThemeColorBlendModeKey
|
|
325
422
|
colorPalette: ThemeColorPalette
|
|
423
|
+
debugPath: string
|
|
326
424
|
},
|
|
327
425
|
): ThemeColorButtonTone_v2 {
|
|
426
|
+
const {debugPath} = options
|
|
427
|
+
|
|
328
428
|
return {
|
|
329
|
-
enabled: renderThemeColorState(value.enabled,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
429
|
+
enabled: renderThemeColorState(value.enabled, {
|
|
430
|
+
...options,
|
|
431
|
+
debugPath: `${debugPath}.enabled`,
|
|
432
|
+
}),
|
|
433
|
+
hovered: renderThemeColorState(value.hovered, {
|
|
434
|
+
...options,
|
|
435
|
+
debugPath: `${debugPath}.hovered`,
|
|
436
|
+
}),
|
|
437
|
+
pressed: renderThemeColorState(value.pressed, {
|
|
438
|
+
...options,
|
|
439
|
+
debugPath: `${debugPath}.pressed`,
|
|
440
|
+
}),
|
|
441
|
+
selected: renderThemeColorState(value.selected, {
|
|
442
|
+
...options,
|
|
443
|
+
debugPath: `${debugPath}.selected`,
|
|
444
|
+
}),
|
|
445
|
+
disabled: renderThemeColorState(value.disabled, {
|
|
446
|
+
...options,
|
|
447
|
+
debugPath: `${debugPath}.disabled`,
|
|
448
|
+
}),
|
|
334
449
|
}
|
|
335
450
|
}
|
|
336
451
|
|
|
@@ -340,9 +455,10 @@ function renderThemeColorState(
|
|
|
340
455
|
baseBg: string
|
|
341
456
|
blendMode: ThemeColorBlendModeKey
|
|
342
457
|
colorPalette: ThemeColorPalette
|
|
458
|
+
debugPath: string
|
|
343
459
|
},
|
|
344
460
|
): ThemeColorState_v2 {
|
|
345
|
-
const {baseBg, blendMode: rootBlendMode, colorPalette} = options
|
|
461
|
+
const {baseBg, blendMode: rootBlendMode, colorPalette, debugPath} = options
|
|
346
462
|
const blendMode = value._blend || 'multiply'
|
|
347
463
|
|
|
348
464
|
const rootOptions: RenderColorValueOptions = {
|
|
@@ -364,8 +480,18 @@ function renderThemeColorState(
|
|
|
364
480
|
accent: {
|
|
365
481
|
fg: renderColorValue(value.accent.fg, colorOptions),
|
|
366
482
|
},
|
|
367
|
-
avatar: renderThemeColorAvatar(value.avatar, {
|
|
368
|
-
|
|
483
|
+
avatar: renderThemeColorAvatar(value.avatar, {
|
|
484
|
+
baseBg: bg,
|
|
485
|
+
colorPalette,
|
|
486
|
+
blendMode,
|
|
487
|
+
debugPath: `${debugPath}.avatar`,
|
|
488
|
+
}),
|
|
489
|
+
badge: renderThemeColorBadge(value.badge, {
|
|
490
|
+
baseBg: bg,
|
|
491
|
+
colorPalette,
|
|
492
|
+
blendMode,
|
|
493
|
+
debugPath: `${debugPath}.badge`,
|
|
494
|
+
}),
|
|
369
495
|
bg,
|
|
370
496
|
border: renderColorValue(value.border, colorOptions),
|
|
371
497
|
code: {
|
|
@@ -399,11 +525,20 @@ function renderThemeColorInput(
|
|
|
399
525
|
baseBg: string
|
|
400
526
|
blendMode: ThemeColorBlendModeKey
|
|
401
527
|
colorPalette: ThemeColorPalette
|
|
528
|
+
debugPath: string
|
|
402
529
|
},
|
|
403
530
|
): ThemeColorInput_v2 {
|
|
531
|
+
const {debugPath} = options
|
|
532
|
+
|
|
404
533
|
return {
|
|
405
|
-
default: renderInputStatesColorTheme(value.default,
|
|
406
|
-
|
|
534
|
+
default: renderInputStatesColorTheme(value.default, {
|
|
535
|
+
...options,
|
|
536
|
+
debugPath: `${debugPath}.default`,
|
|
537
|
+
}),
|
|
538
|
+
invalid: renderInputStatesColorTheme(value.invalid, {
|
|
539
|
+
...options,
|
|
540
|
+
debugPath: `${debugPath}.invalid`,
|
|
541
|
+
}),
|
|
407
542
|
}
|
|
408
543
|
}
|
|
409
544
|
|
|
@@ -413,13 +548,28 @@ function renderInputStatesColorTheme(
|
|
|
413
548
|
baseBg: string
|
|
414
549
|
blendMode: ThemeColorBlendModeKey
|
|
415
550
|
colorPalette: ThemeColorPalette
|
|
551
|
+
debugPath: string
|
|
416
552
|
},
|
|
417
553
|
): ThemeColorInputMode_v2 {
|
|
554
|
+
const {debugPath} = options
|
|
555
|
+
|
|
418
556
|
return {
|
|
419
|
-
enabled: renderInputStateColorTheme(value.enabled,
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
557
|
+
enabled: renderInputStateColorTheme(value.enabled, {
|
|
558
|
+
...options,
|
|
559
|
+
debugPath: `${debugPath}.enabled`,
|
|
560
|
+
}),
|
|
561
|
+
hovered: renderInputStateColorTheme(value.hovered, {
|
|
562
|
+
...options,
|
|
563
|
+
debugPath: `${debugPath}.hovered`,
|
|
564
|
+
}),
|
|
565
|
+
readOnly: renderInputStateColorTheme(value.readOnly, {
|
|
566
|
+
...options,
|
|
567
|
+
debugPath: `${debugPath}.readOnly`,
|
|
568
|
+
}),
|
|
569
|
+
disabled: renderInputStateColorTheme(value.disabled, {
|
|
570
|
+
...options,
|
|
571
|
+
debugPath: `${debugPath}.disabled`,
|
|
572
|
+
}),
|
|
423
573
|
}
|
|
424
574
|
}
|
|
425
575
|
|
|
@@ -429,6 +579,7 @@ function renderInputStateColorTheme(
|
|
|
429
579
|
baseBg: string
|
|
430
580
|
blendMode: ThemeColorBlendModeKey
|
|
431
581
|
colorPalette: ThemeColorPalette
|
|
582
|
+
debugPath: string
|
|
432
583
|
},
|
|
433
584
|
): ThemeColorInputState_v2 {
|
|
434
585
|
const {baseBg, blendMode: rootBlendMode, colorPalette} = options
|
|
@@ -455,15 +606,19 @@ function renderThemeColorSelectable(
|
|
|
455
606
|
baseBg: string
|
|
456
607
|
blendMode: ThemeColorBlendModeKey
|
|
457
608
|
colorPalette: ThemeColorPalette
|
|
609
|
+
debugPath: string
|
|
458
610
|
},
|
|
459
611
|
): ThemeColorSelectable_v2 {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
612
|
+
const {debugPath} = options
|
|
613
|
+
|
|
614
|
+
return THEME_COLOR_STATE_TONES.reduce((acc, tone) => {
|
|
615
|
+
acc[tone] = renderThemeColorSelectableStates(value[tone], {
|
|
616
|
+
...options,
|
|
617
|
+
debugPath: `${debugPath}.${tone}`,
|
|
618
|
+
})
|
|
619
|
+
|
|
620
|
+
return acc
|
|
621
|
+
}, {} as ThemeColorSelectable_v2)
|
|
467
622
|
}
|
|
468
623
|
|
|
469
624
|
function renderThemeColorSelectableStates(
|
|
@@ -472,14 +627,32 @@ function renderThemeColorSelectableStates(
|
|
|
472
627
|
baseBg: string
|
|
473
628
|
blendMode: ThemeColorBlendModeKey
|
|
474
629
|
colorPalette: ThemeColorPalette
|
|
630
|
+
debugPath: string
|
|
475
631
|
},
|
|
476
632
|
): ThemeColorSelectableTone_v2 {
|
|
633
|
+
const {debugPath} = options
|
|
634
|
+
|
|
477
635
|
return {
|
|
478
|
-
enabled: renderThemeColorState(value.enabled,
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
636
|
+
enabled: renderThemeColorState(value.enabled, {
|
|
637
|
+
...options,
|
|
638
|
+
debugPath: `${debugPath}.enabled`,
|
|
639
|
+
}),
|
|
640
|
+
hovered: renderThemeColorState(value.hovered, {
|
|
641
|
+
...options,
|
|
642
|
+
debugPath: `${debugPath}.hovered`,
|
|
643
|
+
}),
|
|
644
|
+
pressed: renderThemeColorState(value.pressed, {
|
|
645
|
+
...options,
|
|
646
|
+
debugPath: `${debugPath}.pressed`,
|
|
647
|
+
}),
|
|
648
|
+
selected: renderThemeColorState(value.selected, {
|
|
649
|
+
...options,
|
|
650
|
+
debugPath: `${debugPath}.selected`,
|
|
651
|
+
}),
|
|
652
|
+
disabled: renderThemeColorState(value.disabled, {
|
|
653
|
+
...options,
|
|
654
|
+
debugPath: `${debugPath}.disabled`,
|
|
655
|
+
}),
|
|
483
656
|
}
|
|
484
657
|
}
|
|
485
658
|
|
|
@@ -489,6 +662,7 @@ function renderSyntaxColorTheme(
|
|
|
489
662
|
baseBg: string
|
|
490
663
|
blendMode: ThemeColorBlendModeKey
|
|
491
664
|
colorPalette: ThemeColorPalette
|
|
665
|
+
debugPath: string
|
|
492
666
|
},
|
|
493
667
|
): ThemeColorSyntax {
|
|
494
668
|
const {colorPalette, baseBg, blendMode} = options
|