@sanity/themer 0.8.1 → 0.10.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/bundle.css CHANGED
@@ -1,386 +1,137 @@
1
- .bgn4np2 {
2
- view-transition-name: bgn4np0;
3
- flex: none;
4
- }
5
-
6
- .bgn4np2[data-overlay="true"] {
7
- width: auto;
8
- position: absolute;
9
- inset: 0;
10
- }
11
-
12
- .bgn4np3 {
13
- position: relative;
14
- }
15
-
16
- .bgn4np4 {
17
- container: bgn4np1 / inline-size;
18
- }
19
-
20
- .bgn4np5 {
21
- z-index: 1;
22
- cursor: col-resize;
23
- touch-action: none;
24
- width: 7px;
25
- position: absolute;
26
- top: 0;
27
- bottom: 0;
28
- left: -3px;
29
- }
30
-
31
- .bgn4np5:after {
32
- content: "";
33
- background: var(--card-focus-ring-color);
34
- opacity: 0;
35
- width: 3px;
36
- transition: opacity .1s;
37
- position: absolute;
38
- top: 0;
39
- bottom: 0;
40
- left: 2px;
41
- }
42
-
43
- .bgn4np5:focus {
44
- outline: none;
1
+ @keyframes pcwcs07 {
2
+ 50% {
3
+ filter: blur(6px);
4
+ }
45
5
  }
46
6
 
47
- .bgn4np5:hover:after, .bgn4np5:focus-visible:after, .bgn4np5[data-dragging="true"]:after {
48
- opacity: 1;
7
+ @keyframes pcwcs08 {
8
+ to {
9
+ opacity: 0;
10
+ }
49
11
  }
50
12
 
51
- @keyframes _1yq4ar7b {
13
+ @keyframes pcwcs09 {
52
14
  from {
53
- transform: translateX(-100%);
15
+ opacity: 0;
54
16
  }
55
17
  }
56
18
 
57
- @keyframes _1yq4ar7c {
58
- to {
19
+ @keyframes pcwcs0b {
20
+ from {
21
+ opacity: 0;
59
22
  transform: translateX(-100%);
60
23
  }
61
- }
62
24
 
63
- @keyframes _1yq4ar7d {
64
- from {
65
- transform: translateY(-100%);
25
+ 25% {
26
+ opacity: 0;
66
27
  }
67
28
  }
68
29
 
69
- @keyframes _1yq4ar7e {
30
+ @keyframes pcwcs0c {
70
31
  to {
71
- transform: translateY(-100%);
32
+ opacity: 0;
33
+ transform: translateX(-100%);
34
+ }
35
+
36
+ 75% {
37
+ opacity: 0;
72
38
  }
73
39
  }
74
40
 
75
- @keyframes _1yq4ar7f {
41
+ @keyframes pcwcs0d {
76
42
  from {
77
43
  transform: translateX(100%);
78
44
  }
79
45
  }
80
46
 
81
- @keyframes _1yq4ar7g {
47
+ @keyframes pcwcs0f {
82
48
  to {
83
49
  transform: translateX(100%);
84
50
  }
85
51
  }
86
52
 
87
- ._1yq4ar78 {
88
- position: relative;
89
- }
90
-
91
- ._1yq4ar79 {
92
- color-scheme: light;
93
- }
94
-
95
- ._1yq4ar7a {
96
- color-scheme: dark;
97
- }
98
-
99
- ::view-transition-group(._1yq4ar70) {
100
- animation-duration: .32s;
101
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
102
- }
103
-
104
- ::view-transition-old(._1yq4ar70) {
105
- animation-duration: .32s;
106
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
107
- }
108
-
109
- ::view-transition-new(._1yq4ar70) {
110
- animation-duration: .32s;
111
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
112
- }
113
-
114
- ::view-transition-new(._1yq4ar72) {
115
- animation-duration: .32s;
116
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
117
- }
118
-
119
- ::view-transition-old(._1yq4ar73) {
120
- animation-duration: .32s;
121
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
122
- }
123
-
124
- ::view-transition-new(._1yq4ar74) {
125
- animation-duration: .32s;
126
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
127
- }
128
-
129
- ::view-transition-old(._1yq4ar75) {
130
- animation-duration: .32s;
131
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
132
- }
133
-
134
- ::view-transition-new(._1yq4ar76) {
135
- animation-duration: .32s;
136
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
137
- }
138
-
139
- ::view-transition-old(._1yq4ar77) {
140
- animation-duration: .32s;
141
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
142
- }
143
-
144
- ::view-transition-old(._1yq4ar71) {
145
- animation-duration: .32s;
146
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
147
- }
148
-
149
- ::view-transition-new(._1yq4ar71) {
150
- animation-duration: .32s;
151
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
152
- }
153
-
154
- :root:active-view-transition-type(sanity-themer)::view-transition-group(*) {
155
- animation-duration: .32s;
156
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
157
- }
158
-
159
- :root:active-view-transition-type(sanity-themer)::view-transition-old(*) {
160
- animation-duration: .32s;
161
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
53
+ ::view-transition-new(.pcwcs05) {
54
+ animation: none;
162
55
  }
163
56
 
164
- :root:active-view-transition-type(sanity-themer)::view-transition-new(*) {
165
- animation-duration: .32s;
166
- animation-timing-function: cubic-bezier(.2, 0, 0, 1);
57
+ ::view-transition-old(.pcwcs05) {
58
+ display: none;
167
59
  }
168
60
 
169
- ::view-transition-old(._1yq4ar70) {
61
+ ::view-transition-new(.pcwcs06) {
170
62
  object-fit: fill;
171
63
  block-size: 100%;
172
64
  inline-size: 100%;
173
65
  }
174
66
 
175
- ::view-transition-new(._1yq4ar70) {
67
+ ::view-transition-old(.pcwcs06) {
176
68
  object-fit: fill;
177
69
  block-size: 100%;
178
70
  inline-size: 100%;
179
71
  }
180
72
 
181
- ::view-transition-new(._1yq4ar72) {
182
- animation-name: _1yq4ar7b;
73
+ ::view-transition-new(.pcwcs0a) {
74
+ object-fit: fill;
75
+ block-size: 100%;
76
+ inline-size: 100%;
77
+ animation-name: pcwcs09;
183
78
  }
184
79
 
185
- ::view-transition-old(._1yq4ar73) {
186
- animation-name: _1yq4ar7c;
80
+ ::view-transition-old(.pcwcs0a) {
81
+ object-fit: fill;
82
+ block-size: 100%;
83
+ inline-size: 100%;
84
+ animation-name: pcwcs08;
187
85
  }
188
86
 
189
- ::view-transition-new(._1yq4ar74) {
190
- animation-name: _1yq4ar7d;
87
+ ::view-transition-image-pair(.pcwcs0a) {
88
+ animation-name: pcwcs07;
191
89
  }
192
90
 
193
- ::view-transition-old(._1yq4ar75) {
194
- animation-name: _1yq4ar7e;
91
+ ::view-transition-new(.pcwcs0e) {
92
+ animation-name: pcwcs0d;
195
93
  }
196
94
 
197
- ::view-transition-new(._1yq4ar76) {
198
- animation-name: _1yq4ar7f;
95
+ ::view-transition-old(.pcwcs0g) {
96
+ animation-name: pcwcs0f;
199
97
  }
200
98
 
201
- ::view-transition-old(._1yq4ar77) {
202
- animation-name: _1yq4ar7g;
99
+ ::view-transition-new(.pcwcs0h) {
100
+ animation-name: pcwcs0b;
203
101
  }
204
102
 
205
- ::view-transition-group(bgn4np0) {
206
- z-index: 1;
103
+ ::view-transition-old(.pcwcs0i) {
104
+ animation-name: pcwcs0c;
207
105
  }
208
106
 
209
- ::view-transition-group(bgn4np0) {
210
- animation: none;
107
+ :root:active-view-transition-type(sanity-themer)::view-transition-group(*) {
108
+ animation-duration: .32s;
109
+ animation-timing-function: cubic-bezier(.65, 0, .35, 1);
211
110
  }
212
111
 
213
- ::view-transition-image-pair(bgn4np0) {
214
- animation: none;
112
+ :root:active-view-transition-type(pcwcs02)::view-transition-group(*) {
113
+ animation-duration: .48s;
215
114
  }
216
115
 
217
- ::view-transition-old(bgn4np0) {
218
- animation: none;
116
+ :root:active-view-transition-type(pcwcs03)::view-transition-group(*) {
117
+ animation-duration: .48s;
219
118
  }
220
119
 
221
- ::view-transition-new(bgn4np0) {
222
- animation: none;
120
+ .pcwcs0j {
121
+ position: relative;
223
122
  }
224
123
 
225
124
  @media (prefers-reduced-motion: reduce) {
226
- ::view-transition-group(._1yq4ar70) {
227
- animation: none;
228
- }
229
-
230
- ::view-transition-group(._1yq4ar71) {
231
- animation: none;
232
- }
233
-
234
- ::view-transition-group(._1yq4ar72) {
235
- animation: none;
236
- }
237
-
238
- ::view-transition-group(._1yq4ar73) {
239
- animation: none;
240
- }
241
-
242
- ::view-transition-group(._1yq4ar74) {
243
- animation: none;
244
- }
245
-
246
- ::view-transition-group(._1yq4ar75) {
247
- animation: none;
248
- }
249
-
250
- ::view-transition-group(._1yq4ar76) {
251
- animation: none;
252
- }
253
-
254
- ::view-transition-group(._1yq4ar77) {
255
- animation: none;
256
- }
257
-
258
- ::view-transition-group(bgn4np0) {
259
- animation: none;
260
- }
261
-
262
125
  :root:active-view-transition-type(sanity-themer)::view-transition-group(*) {
263
- animation: none;
264
- }
265
-
266
- ::view-transition-image-pair(._1yq4ar70) {
267
- animation: none;
268
- }
269
-
270
- ::view-transition-image-pair(._1yq4ar71) {
271
- animation: none;
272
- }
273
-
274
- ::view-transition-image-pair(._1yq4ar72) {
275
- animation: none;
276
- }
277
-
278
- ::view-transition-image-pair(._1yq4ar73) {
279
- animation: none;
280
- }
281
-
282
- ::view-transition-image-pair(._1yq4ar74) {
283
- animation: none;
284
- }
285
-
286
- ::view-transition-image-pair(._1yq4ar75) {
287
- animation: none;
288
- }
289
-
290
- ::view-transition-image-pair(._1yq4ar76) {
291
- animation: none;
292
- }
293
-
294
- ::view-transition-image-pair(._1yq4ar77) {
295
- animation: none;
296
- }
297
-
298
- ::view-transition-image-pair(bgn4np0) {
299
- animation: none;
300
- }
301
-
302
- :root:active-view-transition-type(sanity-themer)::view-transition-image-pair(*) {
303
- animation: none;
304
- }
305
-
306
- ::view-transition-old(._1yq4ar70) {
307
- animation: none;
308
- }
309
-
310
- ::view-transition-old(._1yq4ar71) {
311
- animation: none;
312
- }
313
-
314
- ::view-transition-old(._1yq4ar72) {
315
- animation: none;
316
- }
317
-
318
- ::view-transition-old(._1yq4ar73) {
319
- animation: none;
320
- }
321
-
322
- ::view-transition-old(._1yq4ar74) {
323
- animation: none;
324
- }
325
-
326
- ::view-transition-old(._1yq4ar75) {
327
- animation: none;
328
- }
329
-
330
- ::view-transition-old(._1yq4ar76) {
331
- animation: none;
332
- }
333
-
334
- ::view-transition-old(._1yq4ar77) {
335
- animation: none;
336
- }
337
-
338
- ::view-transition-old(bgn4np0) {
339
- animation: none;
126
+ animation: none !important;
340
127
  }
341
128
 
342
129
  :root:active-view-transition-type(sanity-themer)::view-transition-old(*) {
343
- animation: none;
344
- }
345
-
346
- ::view-transition-new(._1yq4ar70) {
347
- animation: none;
348
- }
349
-
350
- ::view-transition-new(._1yq4ar71) {
351
- animation: none;
352
- }
353
-
354
- ::view-transition-new(._1yq4ar72) {
355
- animation: none;
356
- }
357
-
358
- ::view-transition-new(._1yq4ar73) {
359
- animation: none;
360
- }
361
-
362
- ::view-transition-new(._1yq4ar74) {
363
- animation: none;
364
- }
365
-
366
- ::view-transition-new(._1yq4ar75) {
367
- animation: none;
368
- }
369
-
370
- ::view-transition-new(._1yq4ar76) {
371
- animation: none;
372
- }
373
-
374
- ::view-transition-new(._1yq4ar77) {
375
- animation: none;
376
- }
377
-
378
- ::view-transition-new(bgn4np0) {
379
- animation: none;
130
+ animation: none !important;
380
131
  }
381
132
 
382
133
  :root:active-view-transition-type(sanity-themer)::view-transition-new(*) {
383
- animation: none;
134
+ animation: none !important;
384
135
  }
385
136
  }
386
137
 
@@ -722,24 +473,61 @@
722
473
  display: inline-block;
723
474
  }
724
475
 
476
+ .bgn4np1 {
477
+ flex: none;
478
+ }
479
+
480
+ .bgn4np2 {
481
+ position: relative;
482
+ }
483
+
484
+ .bgn4np3 {
485
+ container: bgn4np0 / inline-size;
486
+ }
487
+
488
+ .bgn4np4 {
489
+ z-index: 1;
490
+ cursor: col-resize;
491
+ touch-action: none;
492
+ width: 7px;
493
+ position: absolute;
494
+ top: 0;
495
+ bottom: 0;
496
+ left: -3px;
497
+ }
498
+
499
+ .bgn4np4:after {
500
+ content: "";
501
+ background: var(--card-focus-ring-color);
502
+ opacity: 0;
503
+ width: 3px;
504
+ transition: opacity .1s;
505
+ position: absolute;
506
+ top: 0;
507
+ bottom: 0;
508
+ left: 2px;
509
+ }
510
+
511
+ .bgn4np4:focus {
512
+ outline: none;
513
+ }
514
+
515
+ .bgn4np4:hover:after, .bgn4np4:focus-visible:after, .bgn4np4[data-dragging="true"]:after {
516
+ opacity: 1;
517
+ }
518
+
725
519
  .twjqgh0 {
726
520
  grid-template-columns: minmax(0, 1fr);
727
521
  gap: 16px;
728
522
  display: grid;
729
523
  }
730
524
 
731
- @container bgn4np1 (width >= 260px) {
525
+ @container bgn4np0 (width >= 260px) {
732
526
  .twjqgh0 {
733
527
  grid-template-columns: repeat(2, minmax(0, 1fr));
734
528
  }
735
529
  }
736
530
 
737
- @container bgn4np1 (width >= 480px) {
738
- .twjqgh0 {
739
- grid-template-columns: repeat(3, minmax(0, 1fr));
740
- }
741
- }
742
-
743
531
  .c2pqej0 {
744
532
  min-width: 0;
745
533
  }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,71 @@
1
- import { n as SchemeThemeOptions, t as BuildThemeOptions } from "./options-CU-emn_p.js";
2
1
  import { ColorHueKey, ColorTintKey } from "@sanity/color";
3
2
  import { RootTheme, ThemeColorSchemeKey } from "@sanity/ui/theme";
3
+ /**
4
+ * The colors of one color scheme, for {@link BuildThemeOptions}. Every color
5
+ * is a hex color (`#rgb` or `#rrggbb`), and everything is optional: omitted
6
+ * options fall back to the stock Studio colors, so an empty object reproduces
7
+ * the stock scheme exactly.
8
+ *
9
+ * @public
10
+ */
11
+ interface SchemeThemeOptions {
12
+ /**
13
+ * The accent color — the brand color of the scheme. Replaces the `blue`
14
+ * scale of the palette, which Sanity UI uses for primary buttons, focus
15
+ * rings and links.
16
+ *
17
+ * The stock accent is `#556bfc` (`blue/500` of `@sanity/color`).
18
+ */
19
+ accent?: string;
20
+ /**
21
+ * The background of the scheme — every other color of the scheme is
22
+ * blended onto it. The dark scheme's background replaces `black` in the
23
+ * palette and the light scheme's replaces `white`.
24
+ *
25
+ * It is kept far enough from the text and accent colors to stay usable:
26
+ * a dark background is made darker until it has enough contrast with them
27
+ * (it can never be lighter than either), and a light background can never
28
+ * be darker than either.
29
+ *
30
+ * The stock backgrounds are `#0d0e12` (dark) and `#ffffff` (light).
31
+ */
32
+ background?: string;
33
+ /**
34
+ * How strongly text and borders separate from the accent color, between 15
35
+ * and 100. The default is 85, which uses the text color as-is. Above 85 the
36
+ * text scale loses its tint until it is fully neutral at 100 — a high
37
+ * contrast scheme with no mixing of the text and accent colors. Below 85
38
+ * more and more of the accent color mixes into the text scale, giving text
39
+ * and borders more color, until the scale fully adopts the accent hue and
40
+ * saturation at 15.
41
+ */
42
+ contrast?: number;
43
+ /**
44
+ * The text color. Replaces the `gray` scale of the palette, which Sanity UI
45
+ * uses for text, icons, borders and neutral surfaces. When omitted, it is
46
+ * derived from the accent color: a mostly desaturated version of it, the
47
+ * way the stock `gray` scale carries a hint of the stock blue.
48
+ *
49
+ * The stock text color is `#727892` (`gray/500` of `@sanity/color`).
50
+ */
51
+ text?: string;
52
+ }
53
+ /**
54
+ * Options for {@link buildTheme} and {@link buildPalette}: the colors of the
55
+ * dark and the light scheme, each with its own accent, text, background and
56
+ * contrast — so the two schemes can differ in more than their background.
57
+ * Both schemes are optional, and so is every color: whatever is omitted
58
+ * falls back to the stock Studio colors, so `buildTheme({})` matches
59
+ * `buildTheme()` from `@sanity/ui/theme` exactly.
60
+ *
61
+ * @public
62
+ */
63
+ interface BuildThemeOptions {
64
+ /** The colors of the dark scheme */
65
+ dark?: SchemeThemeOptions;
66
+ /** The colors of the light scheme */
67
+ light?: SchemeThemeOptions;
68
+ }
4
69
  /**
5
70
  * A color palette generated by {@link buildPalette}: the `palette` config of
6
71
  * `buildTheme` from `@sanity/ui/theme`, with every color as a hex string.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/theme/buildPalette.ts","../src/theme/buildTheme.ts","../src/theme/presets.ts"],"mappings":";;;;;;;;;KA6CY;EAAyB;EAAe;IAAiB,OACnE,aACA,OAAO;;;;;;KAQG,yBAAyB,OAAO,qBAAqB;;;;;;;;;;;;;;;;;iBAkBjD,aAAa,UAAS,oBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCvB/C,WAAW,UAAS,oBAAyB;;;;;;;UC1C5C;EACf;EACA;;EAEA,SAAS;;;;;;;;;;;;;;;;;cA6BE,SAAS"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/theme/options.ts","../src/theme/buildPalette.ts","../src/theme/buildTheme.ts","../src/theme/presets.ts"],"mappings":";;;;;;;;;;UAciB;;;;;;;;EAQf;;;;;;;;;;;;;EAcA;;;;;;;;;;EAWA;;;;;;;;;EAUA;;;;;;;;;;;;UAae;;EAEf,OAAO;;EAEP,QAAQ;;;;;;;;KC7BE;EAAyB;EAAe;IAAiB,OACnE,aACA,OAAO;;;;;;KAQG,yBAAyB,OAAO,qBAAqB;;;;;;;;;;;;;;;;;iBAkBjD,aAAa,UAAS,oBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCvB/C,WAAW,UAAS,oBAAyB;;;;;;;UC1C5C;EACf;EACA;;EAEA,SAAS;;;;;;;;;;;;;;;;;cA6BE,SAAS"}