@sanity/ui 3.0.0-static.10 → 3.0.0-static.3

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 (106) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +105 -143
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-cjs/buildCommand.js +1 -1
  4. package/dist/_chunks-cjs/buildCommand.js.map +1 -1
  5. package/dist/_chunks-cjs/v3_v2.js +251 -0
  6. package/dist/_chunks-cjs/v3_v2.js.map +1 -0
  7. package/dist/_chunks-es/_visual-editing.mjs +106 -144
  8. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  9. package/dist/_chunks-es/v3_v2.mjs +252 -0
  10. package/dist/_chunks-es/v3_v2.mjs.map +1 -0
  11. package/dist/_visual-editing.d.mts +11 -14
  12. package/dist/_visual-editing.d.ts +11 -14
  13. package/dist/cli.js +1 -1
  14. package/dist/css.d.mts +1006 -282
  15. package/dist/css.d.ts +1006 -282
  16. package/dist/css.js +743 -852
  17. package/dist/css.js.map +1 -1
  18. package/dist/css.mjs +743 -852
  19. package/dist/css.mjs.map +1 -1
  20. package/dist/index.d.mts +11 -14
  21. package/dist/index.d.ts +11 -14
  22. package/dist/index.js +31 -17
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +33 -19
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/sanity-palette.css +9 -1
  27. package/dist/sanity-theme.css +1 -1
  28. package/dist/system.css +1023 -1448
  29. package/dist/theme.d.mts +119 -85
  30. package/dist/theme.d.ts +119 -85
  31. package/dist/theme.js +219 -432
  32. package/dist/theme.js.map +1 -1
  33. package/dist/theme.mjs +202 -413
  34. package/dist/theme.mjs.map +1 -1
  35. package/package.json +2 -2
  36. package/src/cli/buildCommand.ts +2 -2
  37. package/src/css/_comp.ts +0 -1
  38. package/src/css/aspects/flex/flexJustify.style.ts +3 -3
  39. package/src/css/aspects/grid/types.ts +2 -2
  40. package/src/css/aspects/index.ts +0 -1
  41. package/src/css/aspects/textOverflow/textOverflow.ts +2 -2
  42. package/src/css/compile/compilePalette.ts +41 -8
  43. package/src/css/compile/compileRule.ts +0 -1
  44. package/src/css/compile/compileStyle.ts +1 -1
  45. package/src/css/compile/compileTheme_v3.ts +55 -46
  46. package/src/css/index.ts +2 -2
  47. package/src/css/primitives/_input/__workshop__/index.ts +1 -1
  48. package/src/css/primitives/_selectable/_contants.ts +1 -1
  49. package/src/css/primitives/badge/badge.style.ts +1 -1
  50. package/src/css/primitives/box/box.style.ts +1 -1
  51. package/src/css/primitives/box/box.ts +0 -2
  52. package/src/css/primitives/box/types.ts +0 -2
  53. package/src/css/primitives/button/_constants.ts +1 -1
  54. package/src/css/primitives/button/button.style.ts +13 -32
  55. package/src/css/primitives/card/_constants.ts +2 -2
  56. package/src/css/primitives/card/card.style.ts +44 -116
  57. package/src/css/primitives/card/card.ts +1 -1
  58. package/src/css/primitives/card/rules.ts +473 -0
  59. package/src/css/primitives/card/types.ts +1 -0
  60. package/src/css/primitives/kbd/kbd.style.ts +1 -1
  61. package/src/css/primitives/popover/popover.ts +0 -4
  62. package/src/css/primitives/switch/switch.style.ts +83 -8
  63. package/src/css/primitives/text/text.style.ts +3 -11
  64. package/src/css/system.style.ts +0 -4
  65. package/src/css/types.ts +188 -202
  66. package/src/css/varNames.ts +76 -110
  67. package/src/css/vars.ts +76 -109
  68. package/src/theme/defaults/config.ts +2 -2
  69. package/src/theme/defaults/fonts.ts +4 -4
  70. package/src/theme/palette/constants.ts +3 -1
  71. package/src/theme/palette/types.ts +12 -0
  72. package/src/theme/v3/buildTheme_v3.ts +2 -1
  73. package/src/theme/v3/color/buildColor_v3.ts +38 -43
  74. package/src/theme/v3/color/card.ts +38 -43
  75. package/src/theme/v3/color/color.ts +38 -42
  76. package/src/theme/v3/defaults.ts +72 -69
  77. package/src/theme/v3/resolveTokens.ts +38 -43
  78. package/src/theme/v3/types.ts +3 -0
  79. package/src/theme/versioning/themeColor_v3_v2.ts +1 -1
  80. package/src/ui/StyleTags.tsx +1 -1
  81. package/src/ui/components/autocomplete/__workshop__/async.tsx +1 -0
  82. package/src/ui/components/autocomplete/__workshop__/index.ts +1 -1
  83. package/src/ui/components/autocomplete/autocomplete.tsx +11 -2
  84. package/src/ui/components/dialog/dialog.tsx +4 -3
  85. package/src/ui/constants.ts +0 -6
  86. package/src/ui/hooks/useMediaIndex/useMediaIndex.ts +2 -0
  87. package/src/ui/primitives/box/box.tsx +2 -9
  88. package/src/ui/primitives/button/button.tsx +11 -12
  89. package/src/ui/primitives/card/card.tsx +5 -4
  90. package/src/ui/primitives/code/code.tsx +1 -1
  91. package/src/ui/primitives/heading/heading.tsx +1 -1
  92. package/src/ui/primitives/kbd/kbd.tsx +2 -2
  93. package/src/ui/primitives/popover/popover.tsx +75 -5
  94. package/src/ui/primitives/popover/popoverCard.tsx +39 -45
  95. package/src/ui/primitives/select/select.tsx +3 -3
  96. package/src/ui/primitives/stack/stack.tsx +5 -10
  97. package/src/ui/primitives/text/text.tsx +1 -1
  98. package/src/ui/primitives/textInput/textInput.tsx +1 -1
  99. package/src/ui/primitives/tooltip/tooltip.tsx +3 -2
  100. package/src/css/aspects/minWidth/index.ts +0 -2
  101. package/src/css/aspects/minWidth/minWidth.style.ts +0 -13
  102. package/src/css/aspects/minWidth/minWidth.ts +0 -6
  103. package/src/css/aspects/minWidth/types.ts +0 -7
  104. package/src/css/primitives/stack/index.ts +0 -1
  105. package/src/css/primitives/stack/stack.style.ts +0 -9
  106. package/src/css/primitives/stack/stack.ts +0 -6
@@ -15,48 +15,6 @@ export interface CardColorTokens {
15
15
  }
16
16
  >
17
17
  backdrop: [ColorToken, ColorToken]
18
- code: {
19
- bg: [ColorToken, ColorToken]
20
- fg: [ColorToken, ColorToken]
21
- token: {
22
- atrule: [ColorToken, ColorToken]
23
- attrName: [ColorToken, ColorToken]
24
- attrValue: [ColorToken, ColorToken]
25
- attribute: [ColorToken, ColorToken]
26
- boolean: [ColorToken, ColorToken]
27
- builtin: [ColorToken, ColorToken]
28
- cdata: [ColorToken, ColorToken]
29
- char: [ColorToken, ColorToken]
30
- class: [ColorToken, ColorToken]
31
- className: [ColorToken, ColorToken]
32
- comment: [ColorToken, ColorToken]
33
- constant: [ColorToken, ColorToken]
34
- deleted: [ColorToken, ColorToken]
35
- doctype: [ColorToken, ColorToken]
36
- entity: [ColorToken, ColorToken]
37
- function: [ColorToken, ColorToken]
38
- hexcode: [ColorToken, ColorToken]
39
- id: [ColorToken, ColorToken]
40
- important: [ColorToken, ColorToken]
41
- inserted: [ColorToken, ColorToken]
42
- keyword: [ColorToken, ColorToken]
43
- number: [ColorToken, ColorToken]
44
- operator: [ColorToken, ColorToken]
45
- prolog: [ColorToken, ColorToken]
46
- property: [ColorToken, ColorToken]
47
- pseudoClass: [ColorToken, ColorToken]
48
- pseudoElement: [ColorToken, ColorToken]
49
- punctuation: [ColorToken, ColorToken]
50
- regex: [ColorToken, ColorToken]
51
- selector: [ColorToken, ColorToken]
52
- string: [ColorToken, ColorToken]
53
- symbol: [ColorToken, ColorToken]
54
- tag: [ColorToken, ColorToken]
55
- unit: [ColorToken, ColorToken]
56
- url: [ColorToken, ColorToken]
57
- variable: [ColorToken, ColorToken]
58
- }
59
- }
60
18
  focusRing: [ColorToken, ColorToken]
61
19
  link: {
62
20
  fg: [ColorToken, ColorToken]
@@ -71,7 +29,44 @@ export interface CardColorTokens {
71
29
  from: [ColorToken, ColorToken]
72
30
  to: [ColorToken, ColorToken]
73
31
  }
74
-
32
+ token: {
33
+ atrule: [ColorToken, ColorToken]
34
+ attrName: [ColorToken, ColorToken]
35
+ attrValue: [ColorToken, ColorToken]
36
+ attribute: [ColorToken, ColorToken]
37
+ boolean: [ColorToken, ColorToken]
38
+ builtin: [ColorToken, ColorToken]
39
+ cdata: [ColorToken, ColorToken]
40
+ char: [ColorToken, ColorToken]
41
+ class: [ColorToken, ColorToken]
42
+ className: [ColorToken, ColorToken]
43
+ comment: [ColorToken, ColorToken]
44
+ constant: [ColorToken, ColorToken]
45
+ deleted: [ColorToken, ColorToken]
46
+ doctype: [ColorToken, ColorToken]
47
+ entity: [ColorToken, ColorToken]
48
+ function: [ColorToken, ColorToken]
49
+ hexcode: [ColorToken, ColorToken]
50
+ id: [ColorToken, ColorToken]
51
+ important: [ColorToken, ColorToken]
52
+ inserted: [ColorToken, ColorToken]
53
+ keyword: [ColorToken, ColorToken]
54
+ number: [ColorToken, ColorToken]
55
+ operator: [ColorToken, ColorToken]
56
+ prolog: [ColorToken, ColorToken]
57
+ property: [ColorToken, ColorToken]
58
+ pseudoClass: [ColorToken, ColorToken]
59
+ pseudoElement: [ColorToken, ColorToken]
60
+ punctuation: [ColorToken, ColorToken]
61
+ regex: [ColorToken, ColorToken]
62
+ selector: [ColorToken, ColorToken]
63
+ string: [ColorToken, ColorToken]
64
+ symbol: [ColorToken, ColorToken]
65
+ tag: [ColorToken, ColorToken]
66
+ unit: [ColorToken, ColorToken]
67
+ url: [ColorToken, ColorToken]
68
+ variable: [ColorToken, ColorToken]
69
+ }
75
70
  variant: {
76
71
  solid: Record<'*' | ThemeColorStateToneKey, ElementColorTokens>
77
72
  tinted: Record<'*' | ThemeColorStateToneKey, ElementColorTokens>
@@ -34,48 +34,6 @@ export interface ThemeColorCard_v3 {
34
34
  _hue: Hue
35
35
  avatar: ThemeColorAvatar_v2
36
36
  backdrop: string
37
- code: {
38
- bg: string
39
- fg: string
40
- token: {
41
- atrule: string
42
- attrName: string
43
- attrValue: string
44
- attribute: string
45
- boolean: string
46
- builtin: string
47
- cdata: string
48
- char: string
49
- class: string
50
- className: string
51
- comment: string
52
- constant: string
53
- deleted: string
54
- doctype: string
55
- entity: string
56
- function: string
57
- hexcode: string
58
- id: string
59
- important: string
60
- inserted: string
61
- keyword: string
62
- number: string
63
- operator: string
64
- prolog: string
65
- property: string
66
- pseudoClass: string
67
- pseudoElement: string
68
- punctuation: string
69
- regex: string
70
- selector: string
71
- string: string
72
- symbol: string
73
- tag: string
74
- unit: string
75
- url: string
76
- variable: string
77
- }
78
- }
79
37
  focusRing: string
80
38
  shadow: {
81
39
  outline: string
@@ -83,6 +41,44 @@ export interface ThemeColorCard_v3 {
83
41
  penumbra: string
84
42
  ambient: string
85
43
  }
44
+ token: {
45
+ atrule: string
46
+ attrName: string
47
+ attrValue: string
48
+ attribute: string
49
+ boolean: string
50
+ builtin: string
51
+ cdata: string
52
+ char: string
53
+ class: string
54
+ className: string
55
+ comment: string
56
+ constant: string
57
+ deleted: string
58
+ doctype: string
59
+ entity: string
60
+ function: string
61
+ hexcode: string
62
+ id: string
63
+ important: string
64
+ inserted: string
65
+ keyword: string
66
+ number: string
67
+ operator: string
68
+ prolog: string
69
+ property: string
70
+ pseudoClass: string
71
+ pseudoElement: string
72
+ punctuation: string
73
+ regex: string
74
+ selector: string
75
+ string: string
76
+ symbol: string
77
+ tag: string
78
+ unit: string
79
+ url: string
80
+ variable: string
81
+ }
86
82
  skeleton: {
87
83
  from: string
88
84
  to: string
@@ -1,52 +1,28 @@
1
+ import {PaletteConfig} from '../palette'
1
2
  import {PartialTokens, Tokens} from './tokens'
2
3
 
4
+ export const defaultPalette: PaletteConfig = {
5
+ chroma: {min: 0.005, max: 0.2325},
6
+ luminosity: {min: 0.1875, max: 1},
7
+ hues: {
8
+ gray: {h: 277, c: 0.04},
9
+ blue: {h: 273, c: 0.185},
10
+ purple: {h: 295, c: 0.4},
11
+ magenta: {h: 12, c: 0.4},
12
+ red: {h: 30, c: 0.4},
13
+ orange: {h: 68, c: 0.4},
14
+ yellow: {h: 90, c: 0.4},
15
+ green: {h: 171, c: 0.4},
16
+ cyan: {h: 194, c: 0.4},
17
+ },
18
+ }
19
+
3
20
  export const defaultTokens: PartialTokens<Tokens> = {
4
21
  color: {
5
22
  '*': {
6
23
  // backdrop: ['black/0.2', '200/0.2'],
7
24
  backdrop: ['black/0.5', 'gray/100/0.5'],
8
- code: {
9
- bg: ['950', '50'],
10
- fg: ['300', '700'],
11
- token: {
12
- atrule: ['purple/300', 'purple/600'],
13
- attrName: ['green/300', 'green/600'],
14
- attrValue: ['yellow/300', 'yellow/600'],
15
- attribute: ['yellow/300', 'yellow/600'],
16
- boolean: ['purple/300', 'purple/600'],
17
- builtin: ['purple/300', 'purple/600'],
18
- cdata: ['yellow/300', 'yellow/600'],
19
- char: ['yellow/300', 'yellow/600'],
20
- class: ['orange/300', 'orange/600'],
21
- className: ['cyan/300', 'cyan/600'],
22
- comment: ['gray/600', 'gray/300'],
23
- constant: ['purple/300', 'purple/600'],
24
- deleted: ['red/300', 'red/600'],
25
- entity: ['red/300', 'red/600'],
26
- function: ['green/300', 'green/600'],
27
- hexcode: ['blue/300', 'blue/600'],
28
- id: ['purple/300', 'purple/600'],
29
- important: ['purple/300', 'purple/600'],
30
- inserted: ['green/300', 'green/600'],
31
- keyword: ['magenta/300', 'magenta/600'],
32
- number: ['purple/300', 'purple/600'],
33
- operator: ['magenta/300', 'magenta/600'],
34
- prolog: ['gray/300', 'gray/600'],
35
- property: ['blue/300', 'blue/600'],
36
- pseudoClass: ['yellow/300', 'yellow/600'],
37
- pseudoElement: ['yellow/300', 'yellow/600'],
38
- punctuation: ['gray/300', 'gray/600'],
39
- regex: ['blue/300', 'blue/600'],
40
- selector: ['red/300', 'red/600'],
41
- string: ['yellow/300', 'yellow/600'],
42
- symbol: ['purple/300', 'purple/600'],
43
- tag: ['red/300', 'red/600'],
44
- unit: ['orange/300', 'orange/600'],
45
- url: ['red/300', 'red/600'],
46
- variable: ['red/300', 'red/600'],
47
- },
48
- },
49
- focusRing: ['blue/500', 'blue/500'],
25
+ focusRing: ['blue/500', 'blue/300'],
50
26
  link: {
51
27
  fg: ['blue/400', 'blue/600'],
52
28
  },
@@ -56,16 +32,53 @@ export const defaultTokens: PartialTokens<Tokens> = {
56
32
  penumbra: ['black/0.14', '500/0.07'],
57
33
  ambient: ['black/0.12', '500/0.06'],
58
34
  },
35
+ token: {
36
+ atrule: ['purple/300', 'purple/600'],
37
+ attrName: ['green/300', 'green/600'],
38
+ attrValue: ['yellow/300', 'yellow/600'],
39
+ attribute: ['yellow/300', 'yellow/600'],
40
+ boolean: ['purple/300', 'purple/600'],
41
+ builtin: ['purple/300', 'purple/600'],
42
+ cdata: ['yellow/300', 'yellow/600'],
43
+ char: ['yellow/300', 'yellow/600'],
44
+ class: ['orange/300', 'orange/600'],
45
+ className: ['cyan/300', 'cyan/600'],
46
+ comment: ['gray/600', 'gray/300'],
47
+ constant: ['purple/300', 'purple/600'],
48
+ deleted: ['red/300', 'red/600'],
49
+ entity: ['red/300', 'red/600'],
50
+ function: ['green/300', 'green/600'],
51
+ hexcode: ['blue/300', 'blue/600'],
52
+ id: ['purple/300', 'purple/600'],
53
+ important: ['purple/300', 'purple/600'],
54
+ inserted: ['green/300', 'green/600'],
55
+ keyword: ['magenta/300', 'magenta/600'],
56
+ number: ['purple/300', 'purple/600'],
57
+ operator: ['magenta/300', 'magenta/600'],
58
+ prolog: ['gray/300', 'gray/600'],
59
+ property: ['blue/300', 'blue/600'],
60
+ pseudoClass: ['yellow/300', 'yellow/600'],
61
+ pseudoElement: ['yellow/300', 'yellow/600'],
62
+ punctuation: ['gray/300', 'gray/600'],
63
+ regex: ['blue/300', 'blue/600'],
64
+ selector: ['red/300', 'red/600'],
65
+ string: ['yellow/300', 'yellow/600'],
66
+ symbol: ['purple/300', 'purple/600'],
67
+ tag: ['red/300', 'red/600'],
68
+ unit: ['orange/300', 'orange/600'],
69
+ url: ['red/300', 'red/600'],
70
+ variable: ['red/300', 'red/600'],
71
+ },
59
72
  variant: {
60
73
  tinted: {
61
74
  '*': {
62
75
  bg: {
63
- 0: ['950', '50'],
64
- 4: ['800', '200'],
76
+ 0: ['900', '50'],
77
+ 4: ['800', '150'],
65
78
  },
66
79
  border: {
67
- 0: ['700', '100'],
68
- 4: ['500', '300'],
80
+ 0: ['800', '150'],
81
+ 4: ['600', '350'],
69
82
  },
70
83
  fg: {
71
84
  0: ['100', '900'],
@@ -91,8 +104,8 @@ export const defaultTokens: PartialTokens<Tokens> = {
91
104
  solid: {
92
105
  '*': {
93
106
  bg: {
94
- 0: ['400', '500'],
95
- 4: ['300', '600'],
107
+ 0: ['300', '500'],
108
+ 4: ['200', '600'],
96
109
  },
97
110
  border: {
98
111
  0: ['200', '400'],
@@ -137,15 +150,15 @@ export const defaultTokens: PartialTokens<Tokens> = {
137
150
  '*': {
138
151
  bg: {
139
152
  0: ['black', 'gray/50'],
140
- 4: ['800', '300 50%'],
153
+ 4: ['900', '150'],
141
154
  },
142
155
  border: {
143
- 0: ['800', '300 40%'],
144
- 4: ['600', '300'],
156
+ 0: ['900', '150'],
157
+ 4: ['700', '350'],
145
158
  },
146
159
  fg: {
147
- 0: ['100', 'black'],
148
- 4: ['400', '700'],
160
+ 0: ['150', 'black'],
161
+ 4: ['550', '600'],
149
162
  },
150
163
  },
151
164
  },
@@ -156,12 +169,12 @@ export const defaultTokens: PartialTokens<Tokens> = {
156
169
  tinted: {
157
170
  '*': {
158
171
  bg: {
159
- 0: ['950', 'white'],
160
- 4: ['800', '200'],
172
+ 0: ['gray/950', 'white'],
173
+ 4: ['850', '100'],
161
174
  },
162
175
  border: {
163
- 0: ['800', '100'],
164
- 4: ['600', '300'],
176
+ 0: ['850', '100'],
177
+ 4: ['650', '300'],
165
178
  },
166
179
  fg: {
167
180
  0: ['white', 'black'],
@@ -171,18 +184,6 @@ export const defaultTokens: PartialTokens<Tokens> = {
171
184
  },
172
185
  },
173
186
  },
174
- 'neutral': {
175
- variant: {
176
- tinted: {
177
- '*': {
178
- bg: {
179
- 0: ['900', '50'],
180
- 4: ['700', '200'],
181
- },
182
- },
183
- },
184
- },
185
- },
186
187
  'primary': {
187
188
  _hue: 'blue',
188
189
  },
@@ -200,3 +201,5 @@ export const defaultTokens: PartialTokens<Tokens> = {
200
201
  },
201
202
  },
202
203
  }
204
+
205
+ // export const defaultTheme = buildTheme_v3()
@@ -97,48 +97,6 @@ function resolveCardColorTokens(
97
97
  },
98
98
  },
99
99
  backdrop: tokens?.backdrop ?? ['900', '100'],
100
- code: {
101
- bg: tokens?.code?.bg ?? ['950', '50'],
102
- fg: tokens?.code?.fg ?? ['400', '600'],
103
- token: {
104
- atrule: tokens?.code?.token?.atrule ?? ['400', '600'],
105
- attribute: tokens?.code?.token?.attribute ?? ['400', '600'],
106
- attrName: tokens?.code?.token?.attrName ?? ['400', '600'],
107
- attrValue: tokens?.code?.token?.attrValue ?? ['400', '600'],
108
- boolean: tokens?.code?.token?.boolean ?? ['400', '600'],
109
- builtin: tokens?.code?.token?.builtin ?? ['400', '600'],
110
- cdata: tokens?.code?.token?.cdata ?? ['400', '600'],
111
- char: tokens?.code?.token?.char ?? ['400', '600'],
112
- class: tokens?.code?.token?.class ?? ['400', '600'],
113
- className: tokens?.code?.token?.className ?? ['400', '600'],
114
- comment: tokens?.code?.token?.comment ?? ['600', '400'],
115
- constant: tokens?.code?.token?.constant ?? ['400', '600'],
116
- deleted: tokens?.code?.token?.deleted ?? ['400', '600'],
117
- doctype: tokens?.code?.token?.doctype ?? ['400', '600'],
118
- entity: tokens?.code?.token?.entity ?? ['400', '600'],
119
- function: tokens?.code?.token?.function ?? ['400', '600'],
120
- hexcode: tokens?.code?.token?.hexcode ?? ['400', '600'],
121
- id: tokens?.code?.token?.id ?? ['400', '600'],
122
- important: tokens?.code?.token?.important ?? ['400', '600'],
123
- inserted: tokens?.code?.token?.inserted ?? ['400', '600'],
124
- keyword: tokens?.code?.token?.keyword ?? ['400', '600'],
125
- number: tokens?.code?.token?.number ?? ['400', '600'],
126
- operator: tokens?.code?.token?.operator ?? ['400', '600'],
127
- prolog: tokens?.code?.token?.prolog ?? ['400', '600'],
128
- property: tokens?.code?.token?.property ?? ['400', '600'],
129
- pseudoClass: tokens?.code?.token?.pseudoClass ?? ['400', '600'],
130
- pseudoElement: tokens?.code?.token?.pseudoElement ?? ['400', '600'],
131
- punctuation: tokens?.code?.token?.punctuation ?? ['400', '600'],
132
- regex: tokens?.code?.token?.regex ?? ['400', '600'],
133
- selector: tokens?.code?.token?.selector ?? ['400', '600'],
134
- string: tokens?.code?.token?.string ?? ['400', '600'],
135
- symbol: tokens?.code?.token?.symbol ?? ['400', '600'],
136
- tag: tokens?.code?.token?.tag ?? ['400', '600'],
137
- unit: tokens?.code?.token?.unit ?? ['400', '600'],
138
- url: tokens?.code?.token?.url ?? ['400', '600'],
139
- variable: tokens?.code?.token?.variable ?? ['400', '600'],
140
- },
141
- },
142
100
  focusRing: tokens?.focusRing ?? ['500', '500'],
143
101
  link: {
144
102
  fg: tokens?.link?.fg ?? ['400', '600'],
@@ -153,7 +111,44 @@ function resolveCardColorTokens(
153
111
  from: tokens?.skeleton?.from ?? ['900', '100'],
154
112
  to: tokens?.skeleton?.to ?? ['950', '50'],
155
113
  },
156
-
114
+ token: {
115
+ atrule: tokens?.token?.atrule ?? ['400', '600'],
116
+ attribute: tokens?.token?.attribute ?? ['400', '600'],
117
+ attrName: tokens?.token?.attrName ?? ['400', '600'],
118
+ attrValue: tokens?.token?.attrValue ?? ['400', '600'],
119
+ boolean: tokens?.token?.boolean ?? ['400', '600'],
120
+ builtin: tokens?.token?.builtin ?? ['400', '600'],
121
+ cdata: tokens?.token?.cdata ?? ['400', '600'],
122
+ char: tokens?.token?.char ?? ['400', '600'],
123
+ class: tokens?.token?.class ?? ['400', '600'],
124
+ className: tokens?.token?.className ?? ['400', '600'],
125
+ comment: tokens?.token?.comment ?? ['600', '400'],
126
+ constant: tokens?.token?.constant ?? ['400', '600'],
127
+ deleted: tokens?.token?.deleted ?? ['400', '600'],
128
+ doctype: tokens?.token?.doctype ?? ['400', '600'],
129
+ entity: tokens?.token?.entity ?? ['400', '600'],
130
+ function: tokens?.token?.function ?? ['400', '600'],
131
+ hexcode: tokens?.token?.hexcode ?? ['400', '600'],
132
+ id: tokens?.token?.id ?? ['400', '600'],
133
+ important: tokens?.token?.important ?? ['400', '600'],
134
+ inserted: tokens?.token?.inserted ?? ['400', '600'],
135
+ keyword: tokens?.token?.keyword ?? ['400', '600'],
136
+ number: tokens?.token?.number ?? ['400', '600'],
137
+ operator: tokens?.token?.operator ?? ['400', '600'],
138
+ prolog: tokens?.token?.prolog ?? ['400', '600'],
139
+ property: tokens?.token?.property ?? ['400', '600'],
140
+ pseudoClass: tokens?.token?.pseudoClass ?? ['400', '600'],
141
+ pseudoElement: tokens?.token?.pseudoElement ?? ['400', '600'],
142
+ punctuation: tokens?.token?.punctuation ?? ['400', '600'],
143
+ regex: tokens?.token?.regex ?? ['400', '600'],
144
+ selector: tokens?.token?.selector ?? ['400', '600'],
145
+ string: tokens?.token?.string ?? ['400', '600'],
146
+ symbol: tokens?.token?.symbol ?? ['400', '600'],
147
+ tag: tokens?.token?.tag ?? ['400', '600'],
148
+ unit: tokens?.token?.unit ?? ['400', '600'],
149
+ url: tokens?.token?.url ?? ['400', '600'],
150
+ variable: tokens?.token?.variable ?? ['400', '600'],
151
+ },
157
152
  variant: {
158
153
  solid: {
159
154
  '*': resolveElementTokens(tokens?.variant?.solid?.['*']),
@@ -1,4 +1,5 @@
1
1
  import {ThemeConfig} from '../config'
2
+ import {PaletteConfig} from '../palette'
2
3
  import {ThemeFocusRing, ThemeFonts, ThemeFontWeightKey, ThemeLayer, ThemeShadow} from '../v0'
3
4
  import {ThemeAvatar_v2, ThemeInput_v2} from '../v2'
4
5
  import {ThemeColor_v3} from './color'
@@ -10,6 +11,7 @@ export type ThemeEntry = [`--${string}`, string]
10
11
  /** @public */
11
12
  export interface ThemeOptions {
12
13
  v2?: ThemeConfig
14
+ palette?: PaletteConfig
13
15
  tokens?: PartialTokens<Tokens>
14
16
  }
15
17
 
@@ -20,6 +22,7 @@ export interface ThemeOptions {
20
22
  */
21
23
  export interface Theme_v3 {
22
24
  _version: 3
25
+ _palette: PaletteConfig
23
26
  _tokens: Tokens
24
27
  avatar: ThemeAvatar_v2
25
28
  button: {
@@ -84,7 +84,7 @@ export function themeColor_v3_v2(options: {
84
84
  return tones
85
85
  }, {} as ThemeColorSelectable_v2),
86
86
  shadow: color.shadow,
87
- syntax: color.code.token,
87
+ syntax: color.token,
88
88
  }
89
89
  }
90
90
 
@@ -11,7 +11,7 @@ export function StyleTags(props: {theme?: Theme_v3}): ReactNode {
11
11
  return (
12
12
  <>
13
13
  <style href="sanity-palette" precedence="palette">
14
- {compilePalette()}
14
+ {compilePalette(theme._palette)}
15
15
  </style>
16
16
  <style href="sanity-theme" precedence="theme">
17
17
  {compileTheme({v3: theme} as RootTheme)}
@@ -135,6 +135,7 @@ function AsyncOption(props: {
135
135
  disabled={disabled}
136
136
  padding={3}
137
137
  radius={1}
138
+ selectable
138
139
  selected={selected}
139
140
  tabIndex={tabIndex}
140
141
  >
@@ -2,7 +2,7 @@ import {defineScope} from '@sanity/ui-workshop'
2
2
  import {lazy} from 'react'
3
3
 
4
4
  export default defineScope({
5
- name: 'components/autocomplete',
5
+ name: './components/autocomplete',
6
6
  title: 'Autocomplete',
7
7
  stories: [
8
8
  {
@@ -128,7 +128,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete<
128
128
  customValidity,
129
129
  disabled,
130
130
  filterOption: filterOptionProp,
131
- fontSize = 2,
131
+ fontSize = 1,
132
132
  icon,
133
133
  id,
134
134
  listBox = EMPTY_RECORD,
@@ -167,7 +167,14 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete<
167
167
 
168
168
  const defaultRenderOption = useCallback(
169
169
  ({value}: BaseAutocompleteOption) => (
170
- <Card as="button" padding={paddingProp} radius={2} tone="inherit">
170
+ <Card
171
+ as="button"
172
+ // data-as="button"
173
+ padding={paddingProp}
174
+ radius={2}
175
+ selectable
176
+ // tone="inherit"
177
+ >
171
178
  <Text size={fontSize} textOverflow="ellipsis">
172
179
  {value}
173
180
  </Text>
@@ -612,6 +619,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete<
612
619
  {cloneElement(renderOption(option), {
613
620
  disabled: loading,
614
621
  selected: active,
622
+ selectable: true,
615
623
  tabIndex: listFocused && active ? 0 : -1,
616
624
  })}
617
625
  </AutocompleteOption>
@@ -678,6 +686,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete<
678
686
  handlePopoverMouseEnter,
679
687
  handlePopoverMouseLeave,
680
688
  popover,
689
+ radius,
681
690
  renderPopover,
682
691
  ])
683
692
 
@@ -26,7 +26,7 @@ import {
26
26
  useRef,
27
27
  } from 'react'
28
28
 
29
- import {Z_OFFSETS} from '../../constants'
29
+ import {useTheme_v2} from '../../_compat'
30
30
  import {
31
31
  containsOrEqualsElement,
32
32
  focusFirstDescendant,
@@ -282,6 +282,7 @@ export const Dialog = forwardRef(function Dialog(
282
282
  ref: ForwardedRef<HTMLDivElement>,
283
283
  ) {
284
284
  const context = useDialog()
285
+ const {layer} = useTheme_v2()
285
286
  const {
286
287
  __unstable_autoFocus: autoFocus = true,
287
288
  __unstable_hideCloseButton: hideCloseButton = false,
@@ -308,8 +309,8 @@ export const Dialog = forwardRef(function Dialog(
308
309
  tone,
309
310
  ...restProps
310
311
  } = props
311
- const positionProp = _positionProp ?? context.position ?? 'fixed'
312
- const zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog
312
+ const positionProp = _positionProp ?? (context.position || 'fixed')
313
+ const zOffsetProp = _zOffsetProp ?? (context.zOffset || layer.dialog.zOffset)
313
314
  const prefersReducedMotion = usePrefersReducedMotion()
314
315
  const animate = prefersReducedMotion ? false : _animate
315
316
  const portal = usePortal()
@@ -77,9 +77,3 @@ export const FLOATING_STATIC_SIDES: Record<string, 'bottom' | 'left' | 'top' | '
77
77
  bottom: 'top',
78
78
  left: 'right',
79
79
  }
80
-
81
- export const Z_OFFSETS = {
82
- dialog: 600,
83
- popover: 400,
84
- tooltip: 200,
85
- }
@@ -96,6 +96,8 @@ function getServerSnapshot() {
96
96
  * @beta
97
97
  */
98
98
  export function useMediaIndex(): number {
99
+ // const {media} = useTheme_v2()
100
+ // const media = MEDIA
99
101
  const store = useMemo(() => _createMediaStore(), [])
100
102
 
101
103
  return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot)
@@ -32,10 +32,7 @@ export const Box = forwardRef(function Box(
32
32
  const {
33
33
  align,
34
34
  as: As = 'div',
35
- autoCols,
36
- autoFlow,
37
- autoRows,
38
- border = false,
35
+ border,
39
36
  borderTop,
40
37
  borderRight,
41
38
  borderBottom,
@@ -66,7 +63,6 @@ export const Box = forwardRef(function Box(
66
63
  marginBottom,
67
64
  marginLeft,
68
65
  maxWidth,
69
- minWidth = 0,
70
66
  overflow,
71
67
  padding = 0,
72
68
  paddingX,
@@ -97,9 +93,6 @@ export const Box = forwardRef(function Box(
97
93
  className,
98
94
  box({
99
95
  align,
100
- autoCols,
101
- autoFlow,
102
- autoRows,
103
96
  border,
104
97
  borderTop,
105
98
  borderRight,
@@ -131,7 +124,6 @@ export const Box = forwardRef(function Box(
131
124
  marginBottom,
132
125
  marginLeft,
133
126
  maxWidth,
134
- minWidth,
135
127
  muted,
136
128
  padding,
137
129
  paddingX,
@@ -152,6 +144,7 @@ export const Box = forwardRef(function Box(
152
144
  wrap,
153
145
  }),
154
146
  )}
147
+ // data-gap={gap}
155
148
  ref={ref}
156
149
  >
157
150
  {props.children}