@sanity/ui 4.0.0-next.4 → 4.0.0-next.5
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/README.md +4 -0
- package/dist/_system-CTe2lb5l.d.ts +40 -0
- package/dist/_system-CTe2lb5l.d.ts.map +1 -0
- package/dist/arrow-BG0EMNiC.js +159 -0
- package/dist/arrow-BG0EMNiC.js.map +1 -0
- package/dist/autocomplete.d.ts +140 -0
- package/dist/autocomplete.d.ts.map +1 -0
- package/dist/autocomplete.js +468 -0
- package/dist/autocomplete.js.map +1 -0
- package/dist/breadcrumbs.d.ts +18 -0
- package/dist/breadcrumbs.d.ts.map +1 -0
- package/dist/breadcrumbs.js +112 -0
- package/dist/breadcrumbs.js.map +1 -0
- package/dist/button-BzoZs3Sl.d.ts +76 -0
- package/dist/button-BzoZs3Sl.d.ts.map +1 -0
- package/dist/button-DZkAQOL2.js +174 -0
- package/dist/button-DZkAQOL2.js.map +1 -0
- package/dist/card-C0a0wQTc.d.ts +7 -0
- package/dist/card-C0a0wQTc.d.ts.map +1 -0
- package/dist/code.d.ts +20 -0
- package/dist/code.d.ts.map +1 -0
- package/dist/code.js +85 -0
- package/dist/code.js.map +1 -0
- package/dist/codeFontStyle-DYUujk7K.js +11 -0
- package/dist/codeFontStyle-DYUujk7K.js.map +1 -0
- package/dist/component-DVlwaWB-.d.ts +25 -0
- package/dist/component-DVlwaWB-.d.ts.map +1 -0
- package/dist/element-BYgCE_iK.js +51 -0
- package/dist/element-BYgCE_iK.js.map +1 -0
- package/dist/{getScopedTheme-CqaSCfTH.js → factory-CvRcEQ36.js} +6 -753
- package/dist/factory-CvRcEQ36.js.map +1 -0
- package/dist/flex-BYRpBTOc.js +69 -0
- package/dist/flex-BYRpBTOc.js.map +1 -0
- package/dist/font-EtfxKPUz.d.ts +49 -0
- package/dist/font-EtfxKPUz.d.ts.map +1 -0
- package/dist/getElementRef-5HZQ-Owu.js +91 -0
- package/dist/getElementRef-5HZQ-Owu.js.map +1 -0
- package/dist/getScopedTheme-C-sZsyAz.js +267 -0
- package/dist/getScopedTheme-C-sZsyAz.js.map +1 -0
- package/dist/getTheme_v2-y09KqtEb.js +487 -0
- package/dist/getTheme_v2-y09KqtEb.js.map +1 -0
- package/dist/grid-D88j-N7f.js +108 -0
- package/dist/grid-D88j-N7f.js.map +1 -0
- package/dist/helpers-bwfx1e-Y.js +67 -0
- package/dist/helpers-bwfx1e-Y.js.map +1 -0
- package/dist/hotkeys-B08HIKNu.js +145 -0
- package/dist/hotkeys-B08HIKNu.js.map +1 -0
- package/dist/index.d.ts +112 -896
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +93 -4409
- package/dist/index.js.map +1 -1
- package/dist/layer-BQfdK7rt.d.ts +242 -0
- package/dist/layer-BQfdK7rt.d.ts.map +1 -0
- package/dist/layer-BdkSGATt.js +56 -0
- package/dist/layer-BdkSGATt.js.map +1 -0
- package/dist/menu.d.ts +146 -0
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +602 -0
- package/dist/menu.js.map +1 -0
- package/dist/popover-DmmmSNzL.d.ts +96 -0
- package/dist/popover-DmmmSNzL.d.ts.map +1 -0
- package/dist/popover-Iy6EZEmv.js +406 -0
- package/dist/popover-Iy6EZEmv.js.map +1 -0
- package/dist/popover.d.ts +2 -0
- package/dist/popover.js +3 -0
- package/dist/responsiveFont-hN1mZFjm.js +55 -0
- package/dist/responsiveFont-hN1mZFjm.js.map +1 -0
- package/dist/{rgba-LmTDhX0u.d.ts → rgba-BSYaEUW6.d.ts} +4 -87
- package/dist/rgba-BSYaEUW6.d.ts.map +1 -0
- package/dist/selectable-B0GUIL74.d.ts +7 -0
- package/dist/selectable-B0GUIL74.d.ts.map +1 -0
- package/dist/stack-C5WV-BRh.js +98 -0
- package/dist/stack-C5WV-BRh.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/textInput-IbiDH7Jc.js +315 -0
- package/dist/textInput-IbiDH7Jc.js.map +1 -0
- package/dist/theme.d.ts +3 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +3 -1
- package/dist/theme.js.map +1 -1
- package/dist/toast.d.ts +73 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +297 -0
- package/dist/toast.js.map +1 -0
- package/dist/tooltip.d.ts +88 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +432 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/useClickOutsideEvent-lEVhDFCQ.js +36 -0
- package/dist/useClickOutsideEvent-lEVhDFCQ.js.map +1 -0
- package/dist/useElementSize-BJvbGHq8.js +51 -0
- package/dist/useElementSize-BJvbGHq8.js.map +1 -0
- package/dist/useLayer-9Pz-GG0r.js +704 -0
- package/dist/useLayer-9Pz-GG0r.js.map +1 -0
- package/package.json +15 -3
- package/dist/getScopedTheme-CqaSCfTH.js.map +0 -1
- package/dist/rgba-LmTDhX0u.d.ts.map +0 -1
|
@@ -1,230 +1,7 @@
|
|
|
1
|
+
import { r as defaultThemeConfig } from "./getTheme_v2-y09KqtEb.js";
|
|
2
|
+
import { a as defineLazyProperty, n as v2_v0 } from "./getScopedTheme-C-sZsyAz.js";
|
|
1
3
|
import { COLOR_HUES, COLOR_TINTS, color } from "@sanity/color";
|
|
2
|
-
const
|
|
3
|
-
_version: 2,
|
|
4
|
-
avatar: {
|
|
5
|
-
sizes: [
|
|
6
|
-
{
|
|
7
|
-
distance: -4,
|
|
8
|
-
size: 19
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
distance: -4,
|
|
12
|
-
size: 25
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
distance: -8,
|
|
16
|
-
size: 33
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
distance: -12,
|
|
20
|
-
size: 49
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
focusRing: {
|
|
24
|
-
offset: 1,
|
|
25
|
-
width: 1
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
button: {
|
|
29
|
-
textWeight: "medium",
|
|
30
|
-
border: { width: 1 },
|
|
31
|
-
focusRing: {
|
|
32
|
-
offset: -1,
|
|
33
|
-
width: 1
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
card: {
|
|
37
|
-
border: { width: 1 },
|
|
38
|
-
focusRing: {
|
|
39
|
-
offset: -1,
|
|
40
|
-
width: 1
|
|
41
|
-
},
|
|
42
|
-
shadow: { outline: .5 }
|
|
43
|
-
},
|
|
44
|
-
container: [
|
|
45
|
-
320,
|
|
46
|
-
640,
|
|
47
|
-
960,
|
|
48
|
-
1280,
|
|
49
|
-
1600,
|
|
50
|
-
1920
|
|
51
|
-
],
|
|
52
|
-
media: [
|
|
53
|
-
360,
|
|
54
|
-
600,
|
|
55
|
-
900,
|
|
56
|
-
1200,
|
|
57
|
-
1800,
|
|
58
|
-
2400
|
|
59
|
-
],
|
|
60
|
-
layer: {
|
|
61
|
-
dialog: { zOffset: 600 },
|
|
62
|
-
popover: { zOffset: 400 },
|
|
63
|
-
tooltip: { zOffset: 200 }
|
|
64
|
-
},
|
|
65
|
-
radius: [
|
|
66
|
-
0,
|
|
67
|
-
1,
|
|
68
|
-
3,
|
|
69
|
-
6,
|
|
70
|
-
9,
|
|
71
|
-
12,
|
|
72
|
-
21
|
|
73
|
-
],
|
|
74
|
-
shadow: [
|
|
75
|
-
null,
|
|
76
|
-
{
|
|
77
|
-
umbra: [
|
|
78
|
-
0,
|
|
79
|
-
0,
|
|
80
|
-
0,
|
|
81
|
-
0
|
|
82
|
-
],
|
|
83
|
-
penumbra: [
|
|
84
|
-
0,
|
|
85
|
-
0,
|
|
86
|
-
0,
|
|
87
|
-
0
|
|
88
|
-
],
|
|
89
|
-
ambient: [
|
|
90
|
-
0,
|
|
91
|
-
0,
|
|
92
|
-
0,
|
|
93
|
-
0
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
umbra: [
|
|
98
|
-
0,
|
|
99
|
-
3,
|
|
100
|
-
5,
|
|
101
|
-
-2
|
|
102
|
-
],
|
|
103
|
-
penumbra: [
|
|
104
|
-
0,
|
|
105
|
-
6,
|
|
106
|
-
10,
|
|
107
|
-
0
|
|
108
|
-
],
|
|
109
|
-
ambient: [
|
|
110
|
-
0,
|
|
111
|
-
1,
|
|
112
|
-
18,
|
|
113
|
-
1
|
|
114
|
-
]
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
umbra: [
|
|
118
|
-
0,
|
|
119
|
-
7,
|
|
120
|
-
8,
|
|
121
|
-
-4
|
|
122
|
-
],
|
|
123
|
-
penumbra: [
|
|
124
|
-
0,
|
|
125
|
-
12,
|
|
126
|
-
17,
|
|
127
|
-
2
|
|
128
|
-
],
|
|
129
|
-
ambient: [
|
|
130
|
-
0,
|
|
131
|
-
5,
|
|
132
|
-
22,
|
|
133
|
-
4
|
|
134
|
-
]
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
umbra: [
|
|
138
|
-
0,
|
|
139
|
-
9,
|
|
140
|
-
11,
|
|
141
|
-
-5
|
|
142
|
-
],
|
|
143
|
-
penumbra: [
|
|
144
|
-
0,
|
|
145
|
-
18,
|
|
146
|
-
28,
|
|
147
|
-
2
|
|
148
|
-
],
|
|
149
|
-
ambient: [
|
|
150
|
-
0,
|
|
151
|
-
7,
|
|
152
|
-
34,
|
|
153
|
-
6
|
|
154
|
-
]
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
umbra: [
|
|
158
|
-
0,
|
|
159
|
-
11,
|
|
160
|
-
15,
|
|
161
|
-
-7
|
|
162
|
-
],
|
|
163
|
-
penumbra: [
|
|
164
|
-
0,
|
|
165
|
-
24,
|
|
166
|
-
38,
|
|
167
|
-
3
|
|
168
|
-
],
|
|
169
|
-
ambient: [
|
|
170
|
-
0,
|
|
171
|
-
9,
|
|
172
|
-
46,
|
|
173
|
-
8
|
|
174
|
-
]
|
|
175
|
-
}
|
|
176
|
-
],
|
|
177
|
-
space: [
|
|
178
|
-
0,
|
|
179
|
-
4,
|
|
180
|
-
8,
|
|
181
|
-
12,
|
|
182
|
-
20,
|
|
183
|
-
32,
|
|
184
|
-
52,
|
|
185
|
-
84,
|
|
186
|
-
136,
|
|
187
|
-
220
|
|
188
|
-
],
|
|
189
|
-
input: {
|
|
190
|
-
border: { width: 1 },
|
|
191
|
-
checkbox: {
|
|
192
|
-
size: 17,
|
|
193
|
-
focusRing: {
|
|
194
|
-
offset: -1,
|
|
195
|
-
width: 1
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
radio: {
|
|
199
|
-
size: 17,
|
|
200
|
-
markSize: 9,
|
|
201
|
-
focusRing: {
|
|
202
|
-
offset: -1,
|
|
203
|
-
width: 1
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
switch: {
|
|
207
|
-
width: 25,
|
|
208
|
-
height: 17,
|
|
209
|
-
padding: 5,
|
|
210
|
-
transitionDurationMs: 150,
|
|
211
|
-
transitionTimingFunction: "ease-out",
|
|
212
|
-
focusRing: {
|
|
213
|
-
offset: 1,
|
|
214
|
-
width: 1
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
select: { focusRing: {
|
|
218
|
-
offset: -1,
|
|
219
|
-
width: 1
|
|
220
|
-
} },
|
|
221
|
-
text: { focusRing: {
|
|
222
|
-
offset: -1,
|
|
223
|
-
width: 1
|
|
224
|
-
} }
|
|
225
|
-
},
|
|
226
|
-
style: { button: { root: { transition: "background-color 100ms,border-color 100ms,color 100ms" } } }
|
|
227
|
-
}, defaultThemeFonts = {
|
|
4
|
+
const defaultThemeFonts = {
|
|
228
5
|
code: {
|
|
229
6
|
family: "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
|
|
230
7
|
weights: {
|
|
@@ -445,127 +222,7 @@ const defaultThemeConfig = {
|
|
|
445
222
|
}
|
|
446
223
|
]
|
|
447
224
|
}
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Defines a lazy, self-replacing property on `obj`.
|
|
451
|
-
*
|
|
452
|
-
* On first access the `factory` is called and the getter is replaced with the
|
|
453
|
-
* computed plain value — subsequent reads have zero overhead.
|
|
454
|
-
*
|
|
455
|
-
* The property is enumerable (visible in `Object.keys` / spread) in both states.
|
|
456
|
-
*
|
|
457
|
-
* @internal
|
|
458
|
-
*/
|
|
459
|
-
function defineLazyProperty(obj, key, factory) {
|
|
460
|
-
Object.defineProperty(obj, key, {
|
|
461
|
-
get() {
|
|
462
|
-
let value = factory();
|
|
463
|
-
return Object.defineProperty(obj, key, {
|
|
464
|
-
value,
|
|
465
|
-
enumerable: !0,
|
|
466
|
-
writable: !1,
|
|
467
|
-
configurable: !1
|
|
468
|
-
}), value;
|
|
469
|
-
},
|
|
470
|
-
enumerable: !0,
|
|
471
|
-
configurable: !0
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
const cache$4 = /* @__PURE__ */ new WeakMap(), V0_TONES = [
|
|
475
|
-
"transparent",
|
|
476
|
-
"default",
|
|
477
|
-
"primary",
|
|
478
|
-
"positive",
|
|
479
|
-
"caution",
|
|
480
|
-
"critical"
|
|
481
|
-
];
|
|
482
|
-
function lazyV0Scheme(schemeKey, color) {
|
|
483
|
-
let scheme = {};
|
|
484
|
-
for (let tone of V0_TONES) defineLazyProperty(scheme, tone, () => themeColor_v2_v0(color[schemeKey][tone]));
|
|
485
|
-
return scheme;
|
|
486
|
-
}
|
|
487
|
-
/** @internal */
|
|
488
|
-
function v2_v0(v2) {
|
|
489
|
-
let cachedTheme = cache$4.get(v2);
|
|
490
|
-
if (cachedTheme) return cachedTheme;
|
|
491
|
-
let { avatar, button, color, container, font: fonts, input, media, radius, shadow: shadows, space, style: styles } = v2, v0Color = {};
|
|
492
|
-
defineLazyProperty(v0Color, "light", () => lazyV0Scheme("light", color)), defineLazyProperty(v0Color, "dark", () => lazyV0Scheme("dark", color));
|
|
493
|
-
let theme = {
|
|
494
|
-
_version: 0,
|
|
495
|
-
avatar,
|
|
496
|
-
button,
|
|
497
|
-
container,
|
|
498
|
-
color: v0Color,
|
|
499
|
-
focusRing: input.text.focusRing,
|
|
500
|
-
fonts,
|
|
501
|
-
input,
|
|
502
|
-
media,
|
|
503
|
-
radius,
|
|
504
|
-
shadows,
|
|
505
|
-
space,
|
|
506
|
-
styles,
|
|
507
|
-
v2
|
|
508
|
-
};
|
|
509
|
-
return cache$4.set(v2, theme), theme;
|
|
510
|
-
}
|
|
511
|
-
function themeColor_v2_v0(color_v2) {
|
|
512
|
-
return {
|
|
513
|
-
base: {
|
|
514
|
-
bg: color_v2.bg,
|
|
515
|
-
fg: color_v2.fg,
|
|
516
|
-
border: color_v2.border,
|
|
517
|
-
focusRing: color_v2.focusRing,
|
|
518
|
-
shadow: color_v2.shadow
|
|
519
|
-
},
|
|
520
|
-
button: color_v2.button,
|
|
521
|
-
card: color_v2.selectable.default,
|
|
522
|
-
dark: color_v2._dark,
|
|
523
|
-
input: {
|
|
524
|
-
default: inputStatesThemeColor_v2_v0(color_v2.input.default),
|
|
525
|
-
invalid: inputStatesThemeColor_v2_v0(color_v2.input.invalid)
|
|
526
|
-
},
|
|
527
|
-
muted: {
|
|
528
|
-
...color_v2.button.ghost,
|
|
529
|
-
transparent: color_v2.button.ghost.default
|
|
530
|
-
},
|
|
531
|
-
solid: {
|
|
532
|
-
...color_v2.button.default,
|
|
533
|
-
transparent: color_v2.button.default.default
|
|
534
|
-
},
|
|
535
|
-
selectable: color_v2.selectable,
|
|
536
|
-
spot: {
|
|
537
|
-
gray: color_v2.avatar.gray.bg,
|
|
538
|
-
blue: color_v2.avatar.blue.bg,
|
|
539
|
-
purple: color_v2.avatar.purple.bg,
|
|
540
|
-
magenta: color_v2.avatar.magenta.bg,
|
|
541
|
-
red: color_v2.avatar.red.bg,
|
|
542
|
-
orange: color_v2.avatar.orange.bg,
|
|
543
|
-
yellow: color_v2.avatar.yellow.bg,
|
|
544
|
-
green: color_v2.avatar.green.bg,
|
|
545
|
-
cyan: color_v2.avatar.cyan.bg
|
|
546
|
-
},
|
|
547
|
-
syntax: color_v2.syntax
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
|
-
function inputStatesThemeColor_v2_v0(t) {
|
|
551
|
-
return {
|
|
552
|
-
enabled: inputStateThemeColor_v2_v0(t.enabled),
|
|
553
|
-
disabled: inputStateThemeColor_v2_v0(t.disabled),
|
|
554
|
-
readOnly: inputStateThemeColor_v2_v0(t.readOnly),
|
|
555
|
-
hovered: inputStateThemeColor_v2_v0(t.hovered)
|
|
556
|
-
};
|
|
557
|
-
}
|
|
558
|
-
function inputStateThemeColor_v2_v0(t) {
|
|
559
|
-
return {
|
|
560
|
-
bg: t.bg,
|
|
561
|
-
bg2: t.muted.bg,
|
|
562
|
-
border: t.border,
|
|
563
|
-
fg: t.fg,
|
|
564
|
-
placeholder: t.placeholder
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
/** @public */
|
|
568
|
-
const THEME_COLOR_SCHEMES = ["light", "dark"], THEME_COLOR_BLEND_MODES = ["multiply", "screen"], THEME_COLOR_CARD_TONES = [
|
|
225
|
+
}, THEME_COLOR_SCHEMES = ["light", "dark"], THEME_COLOR_BLEND_MODES = ["multiply", "screen"], THEME_COLOR_CARD_TONES = [
|
|
569
226
|
"transparent",
|
|
570
227
|
"default",
|
|
571
228
|
"neutral",
|
|
@@ -3394,410 +3051,6 @@ function _createColor(opts, dark, name) {
|
|
|
3394
3051
|
muted
|
|
3395
3052
|
};
|
|
3396
3053
|
}
|
|
3397
|
-
|
|
3398
|
-
/** @internal */
|
|
3399
|
-
function themeColor_v0_v2(color_v0) {
|
|
3400
|
-
let cached_v2 = cache$3.get(color_v0);
|
|
3401
|
-
if (cached_v2) return cached_v2;
|
|
3402
|
-
let base = stateThemeColor_v0_v2(color_v0, color_v0.card.enabled), color_v2 = {
|
|
3403
|
-
_blend: color_v0._blend || (color_v0.dark ? "screen" : "multiply"),
|
|
3404
|
-
_dark: color_v0.dark,
|
|
3405
|
-
accent: base.accent,
|
|
3406
|
-
avatar: base.avatar,
|
|
3407
|
-
backdrop: color_v0.base.shadow.ambient,
|
|
3408
|
-
badge: base.badge,
|
|
3409
|
-
bg: color_v0.base.bg,
|
|
3410
|
-
border: color_v0.base.border,
|
|
3411
|
-
button: {
|
|
3412
|
-
default: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.default),
|
|
3413
|
-
ghost: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.ghost),
|
|
3414
|
-
bleed: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.bleed)
|
|
3415
|
-
},
|
|
3416
|
-
code: base.code,
|
|
3417
|
-
fg: color_v0.base.fg,
|
|
3418
|
-
focusRing: color_v0.base.focusRing,
|
|
3419
|
-
icon: base.muted.fg,
|
|
3420
|
-
input: {
|
|
3421
|
-
default: inputStatesThemeColor_v0_v2(color_v0.input.default),
|
|
3422
|
-
invalid: inputStatesThemeColor_v0_v2(color_v0.input.invalid)
|
|
3423
|
-
},
|
|
3424
|
-
kbd: base.kbd,
|
|
3425
|
-
link: base.link,
|
|
3426
|
-
muted: {
|
|
3427
|
-
...base.muted,
|
|
3428
|
-
bg: color_v0.selectable?.default.enabled.bg2 || color_v0.base.bg
|
|
3429
|
-
},
|
|
3430
|
-
selectable: stateTonesThemeColor_v0_v2(color_v0, color_v0.selectable || color_v0.muted),
|
|
3431
|
-
shadow: color_v0.base.shadow,
|
|
3432
|
-
skeleton: {
|
|
3433
|
-
from: color_v0.skeleton?.from || color_v0.base.border,
|
|
3434
|
-
to: color_v0.skeleton?.to || color_v0.base.border
|
|
3435
|
-
},
|
|
3436
|
-
syntax: color_v0.syntax
|
|
3437
|
-
};
|
|
3438
|
-
return cache$3.set(color_v0, color_v2), color_v2;
|
|
3439
|
-
}
|
|
3440
|
-
function stateTonesThemeColor_v0_v2(v0, t) {
|
|
3441
|
-
return {
|
|
3442
|
-
default: {
|
|
3443
|
-
enabled: stateThemeColor_v0_v2(v0, t.default.enabled),
|
|
3444
|
-
hovered: stateThemeColor_v0_v2(v0, t.default.hovered),
|
|
3445
|
-
pressed: stateThemeColor_v0_v2(v0, t.default.pressed),
|
|
3446
|
-
selected: stateThemeColor_v0_v2(v0, t.default.selected),
|
|
3447
|
-
disabled: stateThemeColor_v0_v2(v0, t.default.disabled)
|
|
3448
|
-
},
|
|
3449
|
-
neutral: {
|
|
3450
|
-
enabled: stateThemeColor_v0_v2(v0, t.default.enabled),
|
|
3451
|
-
hovered: stateThemeColor_v0_v2(v0, t.default.hovered),
|
|
3452
|
-
pressed: stateThemeColor_v0_v2(v0, t.default.pressed),
|
|
3453
|
-
selected: stateThemeColor_v0_v2(v0, t.default.selected),
|
|
3454
|
-
disabled: stateThemeColor_v0_v2(v0, t.default.disabled)
|
|
3455
|
-
},
|
|
3456
|
-
primary: {
|
|
3457
|
-
enabled: stateThemeColor_v0_v2(v0, t.primary.enabled),
|
|
3458
|
-
hovered: stateThemeColor_v0_v2(v0, t.primary.hovered),
|
|
3459
|
-
pressed: stateThemeColor_v0_v2(v0, t.primary.pressed),
|
|
3460
|
-
selected: stateThemeColor_v0_v2(v0, t.primary.selected),
|
|
3461
|
-
disabled: stateThemeColor_v0_v2(v0, t.primary.disabled)
|
|
3462
|
-
},
|
|
3463
|
-
suggest: {
|
|
3464
|
-
enabled: stateThemeColor_v0_v2(v0, t.primary.enabled),
|
|
3465
|
-
hovered: stateThemeColor_v0_v2(v0, t.primary.hovered),
|
|
3466
|
-
pressed: stateThemeColor_v0_v2(v0, t.primary.pressed),
|
|
3467
|
-
selected: stateThemeColor_v0_v2(v0, t.primary.selected),
|
|
3468
|
-
disabled: stateThemeColor_v0_v2(v0, t.primary.disabled)
|
|
3469
|
-
},
|
|
3470
|
-
positive: {
|
|
3471
|
-
enabled: stateThemeColor_v0_v2(v0, t.positive.enabled),
|
|
3472
|
-
hovered: stateThemeColor_v0_v2(v0, t.positive.hovered),
|
|
3473
|
-
pressed: stateThemeColor_v0_v2(v0, t.positive.pressed),
|
|
3474
|
-
selected: stateThemeColor_v0_v2(v0, t.positive.selected),
|
|
3475
|
-
disabled: stateThemeColor_v0_v2(v0, t.positive.disabled)
|
|
3476
|
-
},
|
|
3477
|
-
caution: {
|
|
3478
|
-
enabled: stateThemeColor_v0_v2(v0, t.caution.enabled),
|
|
3479
|
-
hovered: stateThemeColor_v0_v2(v0, t.caution.hovered),
|
|
3480
|
-
pressed: stateThemeColor_v0_v2(v0, t.caution.pressed),
|
|
3481
|
-
selected: stateThemeColor_v0_v2(v0, t.caution.selected),
|
|
3482
|
-
disabled: stateThemeColor_v0_v2(v0, t.caution.disabled)
|
|
3483
|
-
},
|
|
3484
|
-
critical: {
|
|
3485
|
-
enabled: stateThemeColor_v0_v2(v0, t.critical.enabled),
|
|
3486
|
-
hovered: stateThemeColor_v0_v2(v0, t.critical.hovered),
|
|
3487
|
-
pressed: stateThemeColor_v0_v2(v0, t.critical.pressed),
|
|
3488
|
-
selected: stateThemeColor_v0_v2(v0, t.critical.selected),
|
|
3489
|
-
disabled: stateThemeColor_v0_v2(v0, t.critical.disabled)
|
|
3490
|
-
}
|
|
3491
|
-
};
|
|
3492
|
-
}
|
|
3493
|
-
function stateThemeColor_v0_v2(v0, state) {
|
|
3494
|
-
return {
|
|
3495
|
-
...state,
|
|
3496
|
-
avatar: {
|
|
3497
|
-
gray: {
|
|
3498
|
-
bg: v0.spot.gray,
|
|
3499
|
-
fg: v0.base.bg
|
|
3500
|
-
},
|
|
3501
|
-
blue: {
|
|
3502
|
-
bg: v0.spot.blue,
|
|
3503
|
-
fg: v0.base.bg
|
|
3504
|
-
},
|
|
3505
|
-
purple: {
|
|
3506
|
-
bg: v0.spot.purple,
|
|
3507
|
-
fg: v0.base.bg
|
|
3508
|
-
},
|
|
3509
|
-
magenta: {
|
|
3510
|
-
bg: v0.spot.magenta,
|
|
3511
|
-
fg: v0.base.bg
|
|
3512
|
-
},
|
|
3513
|
-
red: {
|
|
3514
|
-
bg: v0.spot.red,
|
|
3515
|
-
fg: v0.base.bg
|
|
3516
|
-
},
|
|
3517
|
-
orange: {
|
|
3518
|
-
bg: v0.spot.orange,
|
|
3519
|
-
fg: v0.base.bg
|
|
3520
|
-
},
|
|
3521
|
-
yellow: {
|
|
3522
|
-
bg: v0.spot.yellow,
|
|
3523
|
-
fg: v0.base.bg
|
|
3524
|
-
},
|
|
3525
|
-
green: {
|
|
3526
|
-
bg: v0.spot.green,
|
|
3527
|
-
fg: v0.base.bg
|
|
3528
|
-
},
|
|
3529
|
-
cyan: {
|
|
3530
|
-
bg: v0.spot.cyan,
|
|
3531
|
-
fg: v0.base.bg
|
|
3532
|
-
}
|
|
3533
|
-
},
|
|
3534
|
-
badge: {
|
|
3535
|
-
default: {
|
|
3536
|
-
bg: v0.muted.default.enabled.bg,
|
|
3537
|
-
fg: v0.muted.default.enabled.fg,
|
|
3538
|
-
dot: v0.muted.default.enabled.muted.fg,
|
|
3539
|
-
icon: v0.muted.default.enabled.muted.fg
|
|
3540
|
-
},
|
|
3541
|
-
neutral: {
|
|
3542
|
-
bg: v0.muted.transparent.enabled.bg,
|
|
3543
|
-
fg: v0.muted.transparent.enabled.fg,
|
|
3544
|
-
dot: v0.muted.transparent.enabled.muted.fg,
|
|
3545
|
-
icon: v0.muted.transparent.enabled.muted.fg
|
|
3546
|
-
},
|
|
3547
|
-
primary: {
|
|
3548
|
-
bg: v0.muted.primary.enabled.bg,
|
|
3549
|
-
fg: v0.muted.primary.enabled.fg,
|
|
3550
|
-
dot: v0.muted.primary.enabled.muted.fg,
|
|
3551
|
-
icon: v0.muted.primary.enabled.muted.fg
|
|
3552
|
-
},
|
|
3553
|
-
suggest: {
|
|
3554
|
-
bg: v0.muted.primary.enabled.bg,
|
|
3555
|
-
fg: v0.muted.primary.enabled.fg,
|
|
3556
|
-
dot: v0.muted.primary.enabled.muted.fg,
|
|
3557
|
-
icon: v0.muted.primary.enabled.muted.fg
|
|
3558
|
-
},
|
|
3559
|
-
positive: {
|
|
3560
|
-
bg: v0.muted.positive.enabled.bg,
|
|
3561
|
-
fg: v0.muted.positive.enabled.fg,
|
|
3562
|
-
dot: v0.muted.positive.enabled.muted.fg,
|
|
3563
|
-
icon: v0.muted.positive.enabled.muted.fg
|
|
3564
|
-
},
|
|
3565
|
-
caution: {
|
|
3566
|
-
bg: v0.muted.caution.enabled.bg,
|
|
3567
|
-
fg: v0.muted.caution.enabled.fg,
|
|
3568
|
-
dot: v0.muted.caution.enabled.muted.fg,
|
|
3569
|
-
icon: v0.muted.caution.enabled.muted.fg
|
|
3570
|
-
},
|
|
3571
|
-
critical: {
|
|
3572
|
-
bg: v0.muted.critical.enabled.bg,
|
|
3573
|
-
fg: v0.muted.critical.enabled.fg,
|
|
3574
|
-
dot: v0.muted.critical.enabled.muted.fg,
|
|
3575
|
-
icon: v0.muted.critical.enabled.muted.fg
|
|
3576
|
-
}
|
|
3577
|
-
},
|
|
3578
|
-
kbd: {
|
|
3579
|
-
bg: v0.muted.default.enabled.bg,
|
|
3580
|
-
fg: v0.muted.default.enabled.fg,
|
|
3581
|
-
border: v0.muted.default.enabled.border
|
|
3582
|
-
},
|
|
3583
|
-
muted: {
|
|
3584
|
-
...v0.muted.default.enabled.muted,
|
|
3585
|
-
bg: state.bg2 || state.bg
|
|
3586
|
-
},
|
|
3587
|
-
skeleton: {
|
|
3588
|
-
from: state.skeleton?.from || state.border,
|
|
3589
|
-
to: state.skeleton?.to || state.border
|
|
3590
|
-
}
|
|
3591
|
-
};
|
|
3592
|
-
}
|
|
3593
|
-
function inputStatesThemeColor_v0_v2(states) {
|
|
3594
|
-
return {
|
|
3595
|
-
enabled: inputStateThemeColor_v0_v2(states.enabled),
|
|
3596
|
-
disabled: inputStateThemeColor_v0_v2(states.disabled),
|
|
3597
|
-
readOnly: inputStateThemeColor_v0_v2(states.readOnly),
|
|
3598
|
-
hovered: inputStateThemeColor_v0_v2(states.hovered)
|
|
3599
|
-
};
|
|
3600
|
-
}
|
|
3601
|
-
function inputStateThemeColor_v0_v2(state) {
|
|
3602
|
-
return {
|
|
3603
|
-
bg: state.bg,
|
|
3604
|
-
border: state.border,
|
|
3605
|
-
fg: state.fg,
|
|
3606
|
-
muted: { bg: state.bg2 },
|
|
3607
|
-
placeholder: state.placeholder
|
|
3608
|
-
};
|
|
3609
|
-
}
|
|
3610
|
-
const cache$2 = /* @__PURE__ */ new WeakMap();
|
|
3611
|
-
/** @public */
|
|
3612
|
-
function getTheme_v2(theme) {
|
|
3613
|
-
if (theme.sanity.v2?._resolved) return theme.sanity.v2;
|
|
3614
|
-
let cached_v2 = cache$2.get(theme);
|
|
3615
|
-
if (cached_v2) return cached_v2;
|
|
3616
|
-
let v2 = {
|
|
3617
|
-
_version: 2,
|
|
3618
|
-
_resolved: !0,
|
|
3619
|
-
avatar: {
|
|
3620
|
-
...defaultThemeConfig.avatar,
|
|
3621
|
-
...theme.sanity.avatar
|
|
3622
|
-
},
|
|
3623
|
-
button: {
|
|
3624
|
-
...defaultThemeConfig.button,
|
|
3625
|
-
...theme.sanity.button
|
|
3626
|
-
},
|
|
3627
|
-
card: defaultThemeConfig.card,
|
|
3628
|
-
color: themeColor_v0_v2(theme.sanity.color),
|
|
3629
|
-
container: theme.sanity.container,
|
|
3630
|
-
font: theme.sanity.fonts,
|
|
3631
|
-
input: {
|
|
3632
|
-
...defaultThemeConfig.input,
|
|
3633
|
-
...theme.sanity.input,
|
|
3634
|
-
checkbox: {
|
|
3635
|
-
...defaultThemeConfig.input.checkbox,
|
|
3636
|
-
...theme.sanity.input.checkbox
|
|
3637
|
-
},
|
|
3638
|
-
radio: {
|
|
3639
|
-
...defaultThemeConfig.input.radio,
|
|
3640
|
-
...theme.sanity.input.radio
|
|
3641
|
-
},
|
|
3642
|
-
switch: {
|
|
3643
|
-
...defaultThemeConfig.input.switch,
|
|
3644
|
-
...theme.sanity.input.switch
|
|
3645
|
-
}
|
|
3646
|
-
},
|
|
3647
|
-
layer: theme.sanity.layer ?? defaultThemeConfig.layer,
|
|
3648
|
-
media: theme.sanity.media,
|
|
3649
|
-
radius: theme.sanity.radius,
|
|
3650
|
-
shadow: theme.sanity.shadows,
|
|
3651
|
-
space: theme.sanity.space,
|
|
3652
|
-
style: theme.sanity.styles
|
|
3653
|
-
};
|
|
3654
|
-
return cache$2.set(theme, v2), v2;
|
|
3655
|
-
}
|
|
3656
|
-
/** @internal */
|
|
3657
|
-
function is_v2(themeProp) {
|
|
3658
|
-
return themeProp._version === 2;
|
|
3659
|
-
}
|
|
3660
|
-
/**
|
|
3661
|
-
* Apply `neutral` and `suggest` if they're not already part of the color object,
|
|
3662
|
-
* as this was introduced in v2.9, but is not compatible with v2.0.
|
|
3663
|
-
*
|
|
3664
|
-
* @param color - The color object to upgrade
|
|
3665
|
-
* @returns The upgraded color object. Returns as-is if already upgraded.
|
|
3666
|
-
* @internal
|
|
3667
|
-
*/
|
|
3668
|
-
function themeColor_v0_v2_9(color) {
|
|
3669
|
-
if ("neutral" in color.badge) return color;
|
|
3670
|
-
let colors = color;
|
|
3671
|
-
return {
|
|
3672
|
-
...colors,
|
|
3673
|
-
badge: {
|
|
3674
|
-
...colors.badge,
|
|
3675
|
-
neutral: colors.badge.default,
|
|
3676
|
-
suggest: colors.badge.primary
|
|
3677
|
-
},
|
|
3678
|
-
button: {
|
|
3679
|
-
bleed: {
|
|
3680
|
-
...colors.button.bleed,
|
|
3681
|
-
neutral: colors.button.bleed.default,
|
|
3682
|
-
suggest: colors.button.bleed.primary
|
|
3683
|
-
},
|
|
3684
|
-
default: {
|
|
3685
|
-
...colors.button.default,
|
|
3686
|
-
neutral: colors.button.default.default,
|
|
3687
|
-
suggest: colors.button.default.primary
|
|
3688
|
-
},
|
|
3689
|
-
ghost: {
|
|
3690
|
-
...colors.button.ghost,
|
|
3691
|
-
neutral: colors.button.ghost.default,
|
|
3692
|
-
suggest: colors.button.ghost.primary
|
|
3693
|
-
}
|
|
3694
|
-
},
|
|
3695
|
-
selectable: {
|
|
3696
|
-
...colors.selectable,
|
|
3697
|
-
neutral: colors.selectable.default,
|
|
3698
|
-
suggest: colors.selectable.primary
|
|
3699
|
-
}
|
|
3700
|
-
};
|
|
3701
|
-
}
|
|
3702
|
-
const cache$1 = /* @__PURE__ */ new WeakMap();
|
|
3703
|
-
/** @internal */
|
|
3704
|
-
function v0_v2(v0) {
|
|
3705
|
-
if (v0.v2) return v0.v2;
|
|
3706
|
-
let cached_v2 = cache$1.get(v0);
|
|
3707
|
-
if (cached_v2) return cached_v2;
|
|
3708
|
-
let { avatar, button, color, container, focusRing: _unused_focusRing, fonts: font, input, layer, media, radius, shadows: shadow, space, styles: style } = v0, v2 = {
|
|
3709
|
-
_version: 2,
|
|
3710
|
-
avatar: {
|
|
3711
|
-
...defaultThemeConfig.avatar,
|
|
3712
|
-
...avatar
|
|
3713
|
-
},
|
|
3714
|
-
button: {
|
|
3715
|
-
...defaultThemeConfig.button,
|
|
3716
|
-
...button
|
|
3717
|
-
},
|
|
3718
|
-
card: defaultThemeConfig.card,
|
|
3719
|
-
color: {
|
|
3720
|
-
light: {
|
|
3721
|
-
transparent: themeColor_v0_v2(color.light.transparent),
|
|
3722
|
-
default: themeColor_v0_v2(color.light.default),
|
|
3723
|
-
neutral: themeColor_v0_v2(color.light.transparent),
|
|
3724
|
-
primary: themeColor_v0_v2(color.light.primary),
|
|
3725
|
-
suggest: themeColor_v0_v2(color.light.primary),
|
|
3726
|
-
positive: themeColor_v0_v2(color.light.positive),
|
|
3727
|
-
caution: themeColor_v0_v2(color.light.caution),
|
|
3728
|
-
critical: themeColor_v0_v2(color.light.critical)
|
|
3729
|
-
},
|
|
3730
|
-
dark: {
|
|
3731
|
-
transparent: themeColor_v0_v2(color.dark.transparent),
|
|
3732
|
-
default: themeColor_v0_v2(color.dark.default),
|
|
3733
|
-
neutral: themeColor_v0_v2(color.dark.transparent),
|
|
3734
|
-
primary: themeColor_v0_v2(color.dark.primary),
|
|
3735
|
-
suggest: themeColor_v0_v2(color.dark.primary),
|
|
3736
|
-
positive: themeColor_v0_v2(color.dark.positive),
|
|
3737
|
-
caution: themeColor_v0_v2(color.dark.caution),
|
|
3738
|
-
critical: themeColor_v0_v2(color.dark.critical)
|
|
3739
|
-
}
|
|
3740
|
-
},
|
|
3741
|
-
container,
|
|
3742
|
-
font,
|
|
3743
|
-
input: {
|
|
3744
|
-
...defaultThemeConfig.input,
|
|
3745
|
-
...input,
|
|
3746
|
-
checkbox: {
|
|
3747
|
-
...defaultThemeConfig.input.checkbox,
|
|
3748
|
-
...input.checkbox
|
|
3749
|
-
},
|
|
3750
|
-
radio: {
|
|
3751
|
-
...defaultThemeConfig.input.radio,
|
|
3752
|
-
...input.radio
|
|
3753
|
-
},
|
|
3754
|
-
switch: {
|
|
3755
|
-
...defaultThemeConfig.input.switch,
|
|
3756
|
-
...input.switch
|
|
3757
|
-
}
|
|
3758
|
-
},
|
|
3759
|
-
layer: layer ?? defaultThemeConfig.layer,
|
|
3760
|
-
media,
|
|
3761
|
-
radius,
|
|
3762
|
-
shadow,
|
|
3763
|
-
space,
|
|
3764
|
-
style
|
|
3765
|
-
};
|
|
3766
|
-
return cache$1.set(v0, v2), v2;
|
|
3767
|
-
}
|
|
3768
|
-
const cache = /* @__PURE__ */ new Map();
|
|
3769
|
-
/** @internal */
|
|
3770
|
-
function getScopedTheme(themeProp, scheme, tone) {
|
|
3771
|
-
let cachedTheme = _getCachedTheme(themeProp, scheme, tone);
|
|
3772
|
-
if (cachedTheme) return cachedTheme;
|
|
3773
|
-
let v0 = is_v2(themeProp) ? v2_v0(themeProp) : themeProp, v2 = is_v2(themeProp) ? themeProp : v0_v2(themeProp), layer_v0 = v0.layer || defaultThemeConfig.layer, colorScheme_v2 = v2.color[scheme] || v2.color.light, color_v2_9 = themeColor_v0_v2_9(colorScheme_v2[tone] || colorScheme_v2.default), layer_v2 = v2.layer || defaultThemeConfig.layer, { color: _v0Color, ...v0Rest } = v0, sanity = {
|
|
3774
|
-
...v0Rest,
|
|
3775
|
-
layer: layer_v0,
|
|
3776
|
-
v2: {
|
|
3777
|
-
...v2,
|
|
3778
|
-
_resolved: !0,
|
|
3779
|
-
color: color_v2_9,
|
|
3780
|
-
layer: layer_v2
|
|
3781
|
-
}
|
|
3782
|
-
};
|
|
3783
|
-
defineLazyProperty(sanity, "color", () => {
|
|
3784
|
-
let colorScheme_v0 = v0.color[scheme] || v0.color.light;
|
|
3785
|
-
return colorScheme_v0[tone] || colorScheme_v0.default;
|
|
3786
|
-
});
|
|
3787
|
-
let theme = { sanity };
|
|
3788
|
-
return _setCachedTheme(themeProp, scheme, tone, theme), theme;
|
|
3789
|
-
}
|
|
3790
|
-
function _getCachedTheme(rootTheme, scheme, tone) {
|
|
3791
|
-
let schemeCache = cache.get(scheme);
|
|
3792
|
-
if (!schemeCache) return;
|
|
3793
|
-
let toneCache = schemeCache.get(tone);
|
|
3794
|
-
if (toneCache) return toneCache.get(rootTheme);
|
|
3795
|
-
}
|
|
3796
|
-
function _setCachedTheme(rootTheme, scheme, tone, theme) {
|
|
3797
|
-
cache.has(scheme) || cache.set(scheme, /* @__PURE__ */ new Map());
|
|
3798
|
-
let schemeCache = cache.get(scheme);
|
|
3799
|
-
schemeCache.has(tone) || schemeCache.set(tone, /* @__PURE__ */ new WeakMap()), schemeCache.get(tone).set(rootTheme, theme);
|
|
3800
|
-
}
|
|
3801
|
-
export { COLOR_CONFIG_INPUT_MODES as A, THEME_COLOR_BLEND_MODES as B, isColorOpacityValue as C, COLOR_CONFIG_BLEND_KEYS as D, COLOR_CONFIG_AVATAR_COLORS as E, isColorBlendModeValue as F, THEME_COLOR_SCHEMES as G, THEME_COLOR_CARD_TONES as H, isColorButtonMode as I, v2_v0 as J, THEME_COLOR_STATES as K, isColorHueKey as L, COLOR_CONFIG_STATES as M, COLOR_CONFIG_STATE_KEYS as N, COLOR_CONFIG_CARD_KEYS as O, COLOR_CONFIG_STATE_TONES as P, isColorTintKey as R, isColorConfigStateTone as S, isColorValue as T, THEME_COLOR_INPUT_MODES as U, THEME_COLOR_BUTTON_MODES as V, THEME_COLOR_INPUT_STATES as W, parseTokenValue as _, createColorTheme as a, isColorConfigBlendKey as b, multiply as c, hexToRgb as d, hslToRgb as f, mix as g, rgbaToRGBA as h, getTheme_v2 as i, COLOR_CONFIG_INPUT_STATES as j, COLOR_CONFIG_CARD_TONES as k, rgba as l, rgbToHsl as m, v0_v2 as n, buildTheme as o, rgbToHex as p, THEME_COLOR_STATE_TONES as q, is_v2 as r, screen as s, getScopedTheme as t, parseColor as u, isColorConfigBaseKey as v, isColorTokenValue as w, isColorConfigStateKey as x, isColorConfigBaseTone as y, THEME_COLOR_AVATAR_COLORS as z };
|
|
3054
|
+
export { COLOR_CONFIG_STATE_TONES as A, THEME_COLOR_INPUT_STATES as B, COLOR_CONFIG_BLEND_KEYS as C, COLOR_CONFIG_INPUT_STATES as D, COLOR_CONFIG_INPUT_MODES as E, THEME_COLOR_AVATAR_COLORS as F, THEME_COLOR_STATES as H, THEME_COLOR_BLEND_MODES as I, THEME_COLOR_BUTTON_MODES as L, isColorButtonMode as M, isColorHueKey as N, COLOR_CONFIG_STATES as O, isColorTintKey as P, THEME_COLOR_CARD_TONES as R, COLOR_CONFIG_AVATAR_COLORS as S, COLOR_CONFIG_CARD_TONES as T, THEME_COLOR_STATE_TONES as U, THEME_COLOR_SCHEMES as V, isColorConfigStateKey as _, rgba as a, isColorTokenValue as b, hslToRgb as c, rgbaToRGBA as d, mix as f, isColorConfigBlendKey as g, isColorConfigBaseTone as h, multiply as i, isColorBlendModeValue as j, COLOR_CONFIG_STATE_KEYS as k, rgbToHex as l, isColorConfigBaseKey as m, buildTheme as n, parseColor as o, parseTokenValue as p, screen as r, hexToRgb as s, createColorTheme as t, rgbToHsl as u, isColorConfigStateTone as v, COLOR_CONFIG_CARD_KEYS as w, isColorValue as x, isColorOpacityValue as y, THEME_COLOR_INPUT_MODES as z };
|
|
3802
3055
|
|
|
3803
|
-
//# sourceMappingURL=
|
|
3056
|
+
//# sourceMappingURL=factory-CvRcEQ36.js.map
|