@sanity/ui 2.0.0-alpha.2 → 2.0.0-alpha.21

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.
Files changed (96) hide show
  1. package/dist/index.cjs.mjs +28 -0
  2. package/dist/index.d.ts +476 -12
  3. package/dist/index.esm.js +1326 -524
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +1353 -523
  6. package/dist/index.js.map +1 -1
  7. package/package.json +6 -8
  8. package/src/components/autocomplete/autocomplete.tsx +6 -0
  9. package/src/components/dialog/constants.ts +4 -0
  10. package/src/components/dialog/dialog.tsx +79 -15
  11. package/src/components/hotkeys/hotkeys.tsx +2 -0
  12. package/src/components/menu/menu.tsx +2 -0
  13. package/src/components/menu/menuButton.tsx +2 -0
  14. package/src/components/menu/menuGroup.tsx +22 -23
  15. package/src/components/menu/menuItem.tsx +29 -35
  16. package/src/components/tab/tab.tsx +4 -1
  17. package/src/components/toast/toast.tsx +4 -0
  18. package/src/primitives/_selectable/style.ts +2 -1
  19. package/src/primitives/avatar/avatar.tsx +16 -9
  20. package/src/primitives/avatar/avatarCounter.tsx +3 -3
  21. package/src/primitives/avatar/styles.ts +1 -1
  22. package/src/primitives/badge/badge.tsx +7 -3
  23. package/src/primitives/box/box.tsx +3 -0
  24. package/src/primitives/button/__workshop__/sanityUploadButton.tsx +2 -1
  25. package/src/primitives/button/button.tsx +7 -3
  26. package/src/primitives/button/styles.ts +9 -2
  27. package/src/primitives/card/card.tsx +4 -0
  28. package/src/primitives/card/styles.ts +2 -0
  29. package/src/primitives/checkbox/checkbox.tsx +2 -0
  30. package/src/primitives/code/code.tsx +1 -0
  31. package/src/primitives/container/container.tsx +2 -0
  32. package/src/primitives/flex/flex.tsx +2 -0
  33. package/src/primitives/grid/grid.tsx +2 -0
  34. package/src/primitives/heading/heading.tsx +2 -0
  35. package/src/primitives/inline/inline.tsx +3 -0
  36. package/src/primitives/kbd/kbd.tsx +2 -0
  37. package/src/primitives/label/label.tsx +2 -0
  38. package/src/primitives/popover/popover.tsx +6 -1
  39. package/src/primitives/radio/radio.tsx +2 -0
  40. package/src/primitives/select/select.tsx +2 -0
  41. package/src/primitives/select/styles.ts +2 -0
  42. package/src/primitives/spinner/spinner.tsx +2 -0
  43. package/src/primitives/stack/stack.tsx +2 -0
  44. package/src/primitives/switch/switch.tsx +4 -0
  45. package/src/primitives/text/text.tsx +3 -0
  46. package/src/primitives/textArea/textArea.tsx +4 -1
  47. package/src/primitives/textInput/textInput.tsx +10 -1
  48. package/src/primitives/tooltip/__workshop__/customPortal.tsx +99 -0
  49. package/src/primitives/tooltip/__workshop__/index.ts +15 -0
  50. package/src/primitives/tooltip/__workshop__/overflowingBoundary.tsx +73 -0
  51. package/src/primitives/tooltip/__workshop__/resizableBoundary.tsx +85 -0
  52. package/src/primitives/tooltip/constants.ts +1 -0
  53. package/src/primitives/tooltip/tooltip.test.tsx +192 -0
  54. package/src/primitives/tooltip/tooltip.tsx +109 -33
  55. package/src/primitives/types.ts +4 -0
  56. package/src/styles/input/textInputStyle.ts +11 -6
  57. package/src/theme/_internal/__workshop__/build/story.tsx +288 -0
  58. package/src/theme/_internal/__workshop__/build/theme.ts +3 -0
  59. package/src/theme/_internal/__workshop__/index.ts +14 -0
  60. package/src/theme/_internal/build/buildTheme.test.ts +78 -0
  61. package/src/theme/_internal/build/buildTheme.ts +16 -0
  62. package/src/theme/_internal/build/colorTheme/buildColorTheme.test.ts +185 -0
  63. package/src/theme/_internal/build/colorTheme/buildColorTheme.ts +164 -0
  64. package/src/theme/_internal/build/colorTheme/renderColorTheme.ts +242 -0
  65. package/src/theme/_internal/build/colorTheme/resolveColorTokens.ts +121 -0
  66. package/src/theme/_internal/build/defaults/colorPalette.ts +8 -0
  67. package/src/theme/_internal/build/defaults/colorTokens.ts +147 -0
  68. package/src/theme/_internal/build/helpers.ts +65 -0
  69. package/src/theme/_internal/build/index.ts +1 -0
  70. package/src/theme/_internal/config/helpers.ts +47 -0
  71. package/src/theme/_internal/config/index.ts +3 -0
  72. package/src/theme/_internal/config/token/index.ts +2 -0
  73. package/src/theme/_internal/config/token/parseTokenKey.test.ts +72 -0
  74. package/src/theme/_internal/config/token/parseTokenKey.ts +88 -0
  75. package/src/theme/_internal/config/token/parseTokenValue.test.ts +45 -0
  76. package/src/theme/_internal/config/token/parseTokenValue.ts +123 -0
  77. package/src/theme/_internal/config/types.ts +137 -0
  78. package/src/theme/_internal/constants.ts +48 -0
  79. package/src/theme/_internal/helpers.ts +19 -0
  80. package/src/theme/_internal/index.ts +5 -0
  81. package/src/theme/_internal/types.ts +91 -0
  82. package/src/theme/index.ts +1 -0
  83. package/src/theme/lib/color-fns/blend/multiply.ts +2 -2
  84. package/src/theme/lib/color-fns/blend/screen.ts +2 -2
  85. package/src/theme/lib/color-fns/convert.ts +15 -1
  86. package/src/theme/lib/color-fns/parse.ts +7 -3
  87. package/src/theme/lib/color-fns/types.ts +11 -0
  88. package/src/theme/lib/theme/avatar.ts +2 -0
  89. package/src/theme/lib/theme/color/_legacy/createColorTheme.ts +7 -0
  90. package/src/theme/lib/theme/color/_legacy/index.ts +1 -0
  91. package/src/theme/lib/theme/color/_legacy/legacyColor.ts +3997 -0
  92. package/src/theme/studioTheme/color.ts +98 -82
  93. package/src/theme/studioTheme/helpers.ts +15 -1
  94. package/src/theme/studioTheme/theme.ts +5 -5
  95. package/src/theme/studioTheme/tints.ts +244 -84
  96. package/src/types/button.ts +5 -0
@@ -1,17 +1,16 @@
1
- import {ColorTints, black, hues, white} from '@sanity/color'
1
+ import {black, ColorTints, hues, white} from '@sanity/color'
2
2
  import {rgba} from '../lib/color-fns'
3
- import {ThemeColorName, createColorTheme} from '../lib/theme'
3
+ import {createColorTheme} from '../lib/theme'
4
4
  import {multiply, screen} from './helpers'
5
- import {getColorHex} from './tints'
6
5
 
7
- export const tones: Record<ThemeColorName, ColorTints> = {
6
+ export const tones: {[key: string]: ColorTints} = {
8
7
  default: hues.gray,
9
8
  transparent: hues.gray,
10
- primary: hues.gray,
11
- positive: hues.cyan,
9
+ primary: hues.blue,
10
+ positive: hues.green,
12
11
  caution: hues.yellow,
13
12
  critical: hues.red,
14
- } as const
13
+ }
15
14
 
16
15
  const NEUTRAL_TONES = ['default', 'transparent']
17
16
 
@@ -23,9 +22,9 @@ export const color = createColorTheme({
23
22
 
24
23
  return {
25
24
  fg: dark ? white.hex : black.hex,
26
- bg: getColorHex(tones['default'], dark, 'default', 'bg_base'),
27
- border: getColorHex(tones['default'], dark, 'default', 'border_base'),
28
- focusRing: getColorHex(tones['positive'], dark, 'positive', 'border_accent'),
25
+ bg: dark ? black.hex : white.hex,
26
+ border: tints[dark ? 800 : 200].hex,
27
+ focusRing: hues.blue[dark ? 500 : 500].hex,
29
28
  shadow: {
30
29
  outline: rgba(tints[500].hex, 0.4),
31
30
  umbra: dark ? rgba(tints[950].hex, 0.4) : rgba(tints[500].hex, 0.2),
@@ -66,9 +65,9 @@ export const color = createColorTheme({
66
65
 
67
66
  return {
68
67
  fg: tints[dark ? 100 : 900].hex,
69
- bg: getColorHex(tints, dark, name, 'bg_base'),
70
- border: getColorHex(tints, dark, name, 'border_base'),
71
- focusRing: getColorHex(tints, dark, name, 'border_accent'),
68
+ bg: tints[dark ? 950 : 50].hex,
69
+ border: tints[dark ? 800 : 200].hex,
70
+ focusRing: tints[500].hex,
72
71
  shadow: {
73
72
  outline: rgba(tints[500].hex, 0.4),
74
73
  umbra: dark ? rgba(tints[900].hex, 0.4) : rgba(tints[500].hex, 0.2),
@@ -93,15 +92,16 @@ export const color = createColorTheme({
93
92
  if (state === 'disabled') {
94
93
  tints = defaultTints
95
94
 
96
- const bg = getColorHex(tones.default, dark, 'default', 'bg_tint')
95
+ const bg = mix(base.bg, tints[dark ? 800 : 200].hex)
97
96
  const skeletonFrom = mix2(bg, tints[dark ? 200 : 800].hex)
98
97
 
99
98
  return {
100
99
  bg,
101
100
  bg2: mix2(bg, tints[dark ? 50 : 950].hex),
102
- border: getColorHex(tones.default, dark, 'default', 'bg_base'),
103
- fg: getColorHex(tones.default, dark, 'default', 'text_inactive'),
104
- iconColor: getColorHex(tones.default, dark, 'default', 'border_base'),
101
+ border: mix(base.bg, tints[dark ? 800 : 200].hex),
102
+ iconColor: '', // Add color
103
+
104
+ fg: mix(base.bg, dark ? black.hex : white.hex),
105
105
  muted: {
106
106
  fg: mix(base.bg, tints[dark ? 950 : 50].hex),
107
107
  },
@@ -123,15 +123,16 @@ export const color = createColorTheme({
123
123
  }
124
124
 
125
125
  if (state === 'hovered') {
126
- const bg = getColorHex(tints, dark, tone, 'bg_accent_hover')
126
+ const bg = mix(base.bg, tints[dark ? 300 : 600].hex)
127
127
  const skeletonFrom = mix2(bg, tints[dark ? 200 : 800].hex)
128
128
 
129
129
  return {
130
130
  bg,
131
131
  bg2: mix2(bg, tints[dark ? 50 : 950].hex),
132
- border: bg,
133
- fg: getColorHex(tints, dark, 'default', 'bg_base'),
134
- iconColor: getColorHex(tints, dark, 'default', 'icon_inverted'),
132
+ border: mix(base.bg, tints[dark ? 300 : 600].hex),
133
+ fg: mix(base.bg, dark ? black.hex : white.hex),
134
+ iconColor: '', // Add color
135
+
135
136
  muted: {
136
137
  fg: mix(base.bg, tints[dark ? 800 : 200].hex),
137
138
  },
@@ -153,15 +154,16 @@ export const color = createColorTheme({
153
154
  }
154
155
 
155
156
  if (state === 'pressed') {
156
- const bg = getColorHex(tints, dark, tone, 'bg_accent_active')
157
- const skeletonFrom = mix2(bg, tints[dark ? 200 : 600].hex)
157
+ const bg = mix(base.bg, tints[dark ? 200 : 800].hex)
158
+ const skeletonFrom = mix2(bg, tints[dark ? 200 : 800].hex)
158
159
 
159
160
  return {
160
- bg: bg,
161
+ bg: mix(base.bg, tints[dark ? 200 : 800].hex),
161
162
  bg2: mix2(bg, tints[dark ? 50 : 950].hex),
162
- border: bg,
163
- fg: getColorHex(tints, dark, 'default', 'bg_base'),
164
- iconColor: getColorHex(tints, dark, 'default', 'icon_inverted'),
163
+ iconColor: '', // Add color
164
+
165
+ border: mix(base.bg, tints[dark ? 200 : 800].hex),
166
+ fg: mix(base.bg, dark ? black.hex : white.hex),
165
167
  muted: {
166
168
  fg: mix(base.bg, tints[dark ? 800 : 200].hex),
167
169
  },
@@ -193,9 +195,10 @@ export const color = createColorTheme({
193
195
  return {
194
196
  bg,
195
197
  bg2: mix2(bg, tints[dark ? 50 : 950].hex),
196
- border: bg,
197
- fg: getColorHex(tints, dark, 'default', 'bg_base'),
198
- iconColor: getColorHex(tints, dark, 'default', 'icon_inverted'),
198
+ border: mix(base.bg, tints[dark ? 200 : 800].hex),
199
+ fg: mix(base.bg, dark ? black.hex : white.hex),
200
+ iconColor: '', // Add color
201
+
199
202
  muted: {
200
203
  fg: mix(base.bg, tints[dark ? 800 : 200].hex),
201
204
  },
@@ -217,15 +220,16 @@ export const color = createColorTheme({
217
220
  }
218
221
 
219
222
  // state: "enabled" | unknown
220
- const bg = getColorHex(tints, dark, tone, 'bg_accent')
223
+ const bg = mix(base.bg, tints[dark ? 400 : 500].hex)
221
224
  const skeletonFrom = mix2(bg, tints[dark ? 200 : 800].hex)
222
225
 
223
226
  return {
224
227
  bg,
225
228
  bg2: mix2(bg, tints[dark ? 50 : 950].hex),
226
- border: bg,
227
- fg: getColorHex(tints, dark, 'default', 'bg_base'),
228
- iconColor: getColorHex(tints, dark, 'default', 'icon_inverted'),
229
+ border: mix(base.bg, tints[dark ? 400 : 500].hex),
230
+ iconColor: '', // Add color
231
+
232
+ fg: mix(base.bg, dark ? black.hex : white.hex),
229
233
  muted: {
230
234
  fg: mix(base.bg, tints[dark ? 900 : 100].hex),
231
235
  },
@@ -262,21 +266,21 @@ export const color = createColorTheme({
262
266
  return {
263
267
  bg,
264
268
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
265
- border: getColorHex(tones.default, dark, 'default', 'border_base'),
266
- fg: getColorHex(tones.default, dark, 'default', 'text_inactive'),
267
- iconColor: getColorHex(tones.default, dark, 'default', 'border_base'),
269
+ border: mix(bg, tints[dark ? 950 : 50].hex),
270
+ iconColor: '', // Add color
271
+ fg: mix(bg, tints[dark ? 800 : 200].hex),
268
272
  muted: {
269
- fg: getColorHex(tones.default, dark, 'default', 'text_inactive'),
273
+ fg: mix(bg, tints[dark ? 900 : 100].hex),
270
274
  },
271
275
  accent: {
272
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
276
+ fg: mix(bg, tints[dark ? 900 : 100].hex),
273
277
  },
274
278
  link: {
275
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
279
+ fg: mix(bg, tints[dark ? 900 : 100].hex),
276
280
  },
277
281
  code: {
278
282
  bg,
279
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
283
+ fg: mix(bg, tints[dark ? 900 : 100].hex),
280
284
  },
281
285
  skeleton: {
282
286
  from: rgba(skeletonFrom, 0.5),
@@ -286,17 +290,22 @@ export const color = createColorTheme({
286
290
  }
287
291
 
288
292
  if (state === 'hovered') {
289
- const bg = getColorHex(tints, dark, name, 'bg_base_hover')
293
+ // if (isNeutral) {
294
+ // tints = tones.primary
295
+ // }
296
+
297
+ const bg = mix(base.bg, tints[dark ? 950 : 50].hex)
290
298
  const skeletonFrom = mix(bg, tints[dark ? 900 : 100].hex)
291
299
 
292
300
  return {
293
301
  bg,
294
302
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
295
303
  border: mix(bg, tints[dark ? 900 : 100].hex),
296
- fg: getColorHex(tints, dark, tone, 'text_primary'),
297
- iconColor: getColorHex(tints, dark, name, 'icon_default'),
304
+ fg: mix(base.bg, tints[dark ? 200 : 800].hex),
305
+ iconColor: '', // Add color
306
+
298
307
  muted: {
299
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
308
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex),
300
309
  },
301
310
  accent: {
302
311
  fg: mix(base.bg, hues.red[dark ? 400 : 500].hex),
@@ -306,7 +315,7 @@ export const color = createColorTheme({
306
315
  },
307
316
  code: {
308
317
  bg: mix(bg, tints[dark ? 950 : 50].hex),
309
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
318
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex),
310
319
  },
311
320
  skeleton: {
312
321
  from: skeletonFrom,
@@ -320,17 +329,18 @@ export const color = createColorTheme({
320
329
  tints = tones.primary
321
330
  }
322
331
 
323
- const bg = getColorHex(tints, dark, name, 'bg_base_active')
324
- const skeletonFrom = mix(bg, getColorHex(tints, dark, name, 'bg_base_active'))
332
+ const bg = mix(base.bg, tints[dark ? 900 : 100].hex)
333
+ const skeletonFrom = mix(bg, tints[dark ? 900 : 100].hex)
325
334
 
326
335
  return {
327
336
  bg,
328
337
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
329
- border: getColorHex(tints, dark, name, 'border_base'),
330
- fg: getColorHex(tints, dark, tone, 'text_primary'),
331
- iconColor: getColorHex(tints, dark, name, 'icon_default'),
338
+ border: mix(bg, tints[dark ? 900 : 100].hex),
339
+ iconColor: '', // Add color
340
+
341
+ fg: mix(base.bg, tints[dark ? 200 : 800].hex),
332
342
  muted: {
333
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
343
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex),
334
344
  },
335
345
  accent: {
336
346
  fg: mix(bg, hues.red[dark ? 400 : 500].hex),
@@ -340,7 +350,7 @@ export const color = createColorTheme({
340
350
  },
341
351
  code: {
342
352
  bg: mix(bg, tints[dark ? 950 : 50].hex),
343
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
353
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex),
344
354
  },
345
355
  skeleton: {
346
356
  from: skeletonFrom,
@@ -360,11 +370,12 @@ export const color = createColorTheme({
360
370
  return {
361
371
  bg,
362
372
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
363
- border: getColorHex(tints, dark, name, 'border_base'),
364
- fg: getColorHex(tints, dark, tone, 'text_primary'),
365
- iconColor: getColorHex(tints, dark, name, 'icon_default'),
373
+ border: mix(bg, tints[dark ? 900 : 100].hex),
374
+ fg: mix(base.bg, tints[dark ? 200 : 800].hex),
375
+ iconColor: '', // Add color
376
+
366
377
  muted: {
367
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
378
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex),
368
379
  },
369
380
  accent: {
370
381
  fg: mix(bg, hues.red[dark ? 400 : 500].hex),
@@ -374,7 +385,7 @@ export const color = createColorTheme({
374
385
  },
375
386
  code: {
376
387
  bg: mix(bg, tints[dark ? 950 : 50].hex),
377
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
388
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex),
378
389
  },
379
390
  skeleton: {
380
391
  from: skeletonFrom,
@@ -389,11 +400,12 @@ export const color = createColorTheme({
389
400
  return {
390
401
  bg,
391
402
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
392
- border: mix(bg, getColorHex(tints, dark, name, 'bg_base')),
393
- fg: getColorHex(tints, dark, tone, 'text_primary'),
394
- iconColor: getColorHex(tints, dark, name, 'icon_default'),
403
+ border: mix(bg, tints[dark ? 900 : 100].hex),
404
+ fg: mix(base.bg, tints[dark ? 300 : 700].hex),
405
+ iconColor: '', // Add color
406
+
395
407
  muted: {
396
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
408
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex),
397
409
  },
398
410
  accent: {
399
411
  fg: mix(base.bg, hues.red[dark ? 400 : 500].hex),
@@ -403,7 +415,7 @@ export const color = createColorTheme({
403
415
  },
404
416
  code: {
405
417
  bg: mix(base.bg, tints[dark ? 950 : 50].hex),
406
- fg: getColorHex(tints, dark, tone, 'text_secondary'),
418
+ fg: mix(base.bg, tints[dark ? 400 : 600].hex),
407
419
  },
408
420
  skeleton: {
409
421
  from: skeletonFrom,
@@ -440,11 +452,12 @@ export const color = createColorTheme({
440
452
 
441
453
  if (mode === 'ghost') {
442
454
  return {
443
- ...muted,
455
+ ...solid,
444
456
  enabled: {
445
457
  ...muted.enabled,
446
458
  border: base.border,
447
459
  },
460
+ disabled: muted.disabled,
448
461
  }
449
462
  }
450
463
 
@@ -487,8 +500,8 @@ export const color = createColorTheme({
487
500
  bg,
488
501
  bg2: mix(bg, tints[dark ? 950 : 50].hex),
489
502
  fg: base.fg,
490
- iconColor: getColorHex(tints, dark, name, 'icon_default'),
491
503
  border: base.border,
504
+ iconColor: '', // Add color
492
505
  muted: {
493
506
  fg: mix(base.bg, tints[dark ? 400 : 600].hex),
494
507
  },
@@ -517,49 +530,52 @@ export const color = createColorTheme({
517
530
 
518
531
  return {
519
532
  bg: mix(base.bg, tints[dark ? 950 : 50].hex),
520
- bg2: getColorHex(tints, dark, 'critical', 'text_secondary'),
533
+ bg2: '', // Add color
521
534
  fg: mix(base.bg, tints[dark ? 400 : 600].hex),
522
- border: getColorHex(tints, dark, 'critical', 'border_base'),
523
- placeholder: getColorHex(tones.default, !dark, 'default', 'text_secondary'),
535
+ border: mix(base.bg, tints[dark ? 800 : 200].hex),
536
+ placeholder: mix(base.bg, tints[dark ? 600 : 400].hex),
524
537
  }
525
538
  }
526
539
 
527
540
  if (state === 'hovered') {
528
541
  return {
529
542
  bg: base.bg,
530
- bg2: getColorHex(tones.default, dark, 'default', 'text_secondary'),
543
+ bg2: '', // Add color
544
+
531
545
  fg: base.fg,
532
546
  border: mix(base.bg, hues.gray[dark ? 700 : 300].hex),
533
- placeholder: getColorHex(tones.default, !dark, 'default', 'text_secondary'),
547
+ placeholder: mix(base.bg, hues.gray[dark ? 600 : 400].hex),
534
548
  }
535
549
  }
536
550
 
537
551
  if (state === 'disabled') {
538
552
  return {
539
- bg: getColorHex(tones.default, dark, 'default', 'bg_tint'),
540
- bg2: getColorHex(tones.default, dark, 'default', 'border_base'),
541
- fg: getColorHex(tones.default, dark, 'default', 'text_secondary'),
542
- border: getColorHex(tones.default, dark, 'default', 'border_base'),
543
- placeholder: getColorHex(tones.default, !dark, 'default', 'text_secondary'),
553
+ bg: mix(base.bg, hues.gray[dark ? 950 : 50].hex),
554
+ bg2: '', // Add color
555
+
556
+ fg: mix(base.bg, hues.gray[dark ? 700 : 300].hex),
557
+ border: mix(base.bg, hues.gray[dark ? 900 : 100].hex),
558
+ placeholder: mix(base.bg, hues.gray[dark ? 800 : 200].hex),
544
559
  }
545
560
  }
546
561
 
547
562
  if (state === 'readOnly') {
548
563
  return {
549
- bg: getColorHex(tones.default, dark, 'default', 'bg_tint'),
550
- bg2: getColorHex(tones.default, dark, 'default', 'border_base'),
551
- fg: getColorHex(tones.default, dark, 'default', 'text_secondary'),
552
- border: getColorHex(tones.default, dark, 'default', 'border_base'),
553
- placeholder: getColorHex(tones.default, !dark, 'default', 'text_secondary'),
564
+ bg: mix(base.bg, hues.gray[dark ? 950 : 50].hex),
565
+ bg2: '', // Add color
566
+
567
+ fg: mix(base.bg, hues.gray[dark ? 200 : 800].hex),
568
+ border: mix(base.bg, hues.gray[dark ? 800 : 200].hex),
569
+ placeholder: mix(base.bg, hues.gray[dark ? 600 : 400].hex),
554
570
  }
555
571
  }
556
572
 
557
573
  return {
558
574
  bg: base.bg,
559
- bg2: getColorHex(tones.default, dark, 'default', 'text_secondary'),
575
+ bg2: '', // Add color
560
576
  fg: base.fg,
561
577
  border: base.border,
562
- placeholder: getColorHex(tones.default, !dark, 'default', 'text_secondary'),
578
+ placeholder: mix(base.bg, hues.gray[dark ? 600 : 400].hex),
563
579
  }
564
580
  },
565
581
 
@@ -1,10 +1,20 @@
1
- import {parseColor, rgbToHex, screen as _screen, multiply as _multiply} from '../lib/color-fns'
1
+ import {
2
+ parseColor,
3
+ rgbToHex,
4
+ screen as _screen,
5
+ multiply as _multiply,
6
+ rgba,
7
+ } from '../lib/color-fns'
2
8
 
3
9
  export function multiply(bg: string, fg: string): string {
4
10
  const b = parseColor(bg)
5
11
  const s = parseColor(fg)
6
12
  const hex = rgbToHex(_multiply(b, s))
7
13
 
14
+ if (s.a) {
15
+ return rgba(hex, s.a)
16
+ }
17
+
8
18
  return hex
9
19
  }
10
20
 
@@ -13,5 +23,9 @@ export function screen(bg: string, fg: string): string {
13
23
  const s = parseColor(fg)
14
24
  const hex = rgbToHex(_screen(b, s))
15
25
 
26
+ if (s.a) {
27
+ return rgba(hex, s.a)
28
+ }
29
+
16
30
  return hex
17
31
  }
@@ -8,11 +8,11 @@ import {fonts} from './fonts'
8
8
  export const studioTheme: RootTheme = {
9
9
  avatar: {
10
10
  sizes: [
11
- {distance: -3, size: 25},
12
- {distance: -6, size: 35},
13
- {distance: -9, size: 55},
11
+ {distance: -3, size: 23},
12
+ {distance: -6, size: 33},
13
+ {distance: -9, size: 53},
14
14
  ],
15
- focusRing: {offset: 1, width: 1},
15
+ focusRing: {offset: 0, width: 1},
16
16
  },
17
17
  button: {
18
18
  textWeight: 'medium',
@@ -33,7 +33,7 @@ export const studioTheme: RootTheme = {
33
33
  shadows: [
34
34
  null,
35
35
  {umbra: [0, 0, 0, 0], penumbra: [0, 0, 0, 0], ambient: [0, 0, 0, 0]},
36
- {umbra: [0, 3, 5, -1], penumbra: [0, 6, 10, 0], ambient: [0, 1, 18, 0]},
36
+ {umbra: [0, 3, 5, -2], penumbra: [0, 6, 10, 0], ambient: [0, 1, 18, 1]},
37
37
  {umbra: [0, 7, 8, -4], penumbra: [0, 12, 17, 2], ambient: [0, 5, 22, 4]},
38
38
  {umbra: [0, 9, 11, -5], penumbra: [0, 18, 28, 2], ambient: [0, 7, 34, 6]},
39
39
  {umbra: [0, 11, 15, -7], penumbra: [0, 24, 38, 3], ambient: [0, 9, 46, 8]},