@sanity/ui 2.0.0-beta.2 → 2.0.0-beta.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 (57) hide show
  1. package/dist/index.cjs.mjs +10 -36
  2. package/dist/index.d.ts +179 -238
  3. package/dist/index.esm.js +13 -4
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +21 -217
  6. package/dist/index.js.map +1 -1
  7. package/dist/theme.cjs.mjs +1 -1
  8. package/dist/theme.d.ts +75 -111
  9. package/dist/theme.esm.js +154 -92
  10. package/dist/theme.esm.js.map +1 -1
  11. package/dist/theme.js +154 -92
  12. package/dist/theme.js.map +1 -1
  13. package/package.json +1 -1
  14. package/src/core/_compat.ts +236 -87
  15. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +6 -3
  16. package/src/core/primitives/kbd/kbd.tsx +2 -0
  17. package/src/core/styles/margin/marginsStyle.test.ts +2 -2
  18. package/src/core/styles/padding/paddingStyle.test.ts +2 -2
  19. package/src/core/theme/__workshop__/build/Root.tsx +20 -3
  20. package/src/core/theme/__workshop__/build/story.tsx +16 -10
  21. package/src/core/theme/__workshop__/canvas.tsx +7 -7
  22. package/src/core/theme/__workshop__/debug/story.tsx +159 -0
  23. package/src/core/theme/__workshop__/index.ts +5 -0
  24. package/src/core/theme/theme.test.tsx +2 -2
  25. package/src/core/types/button.ts +1 -2
  26. package/src/theme/build/_deprecated/color/factory.ts +3 -3
  27. package/src/theme/build/buildColorTheme.ts +16 -16
  28. package/src/theme/build/colorToken/colorToken.ts +19 -0
  29. package/src/theme/build/colorToken/compileColorToken.ts +17 -0
  30. package/src/theme/build/colorToken/index.ts +2 -0
  31. package/src/theme/build/colorToken/types.ts +6 -0
  32. package/src/theme/build/renderColorTheme.ts +14 -15
  33. package/src/theme/build/renderColorValue.ts +1 -1
  34. package/src/theme/config/system.ts +9 -9
  35. package/src/theme/config/tokens/color/types.ts +12 -1
  36. package/src/theme/config/tokens/parseTokenKey.ts +1 -0
  37. package/src/theme/config/tokens/parseTokenValue.ts +1 -0
  38. package/src/theme/defaults/colorTokens.ts +127 -66
  39. package/src/theme/index.ts +0 -7
  40. package/src/theme/system/color/_constants.ts +5 -2
  41. package/src/theme/system/color/_system.ts +2 -1
  42. package/src/theme/system/color/avatar.ts +2 -12
  43. package/src/theme/system/color/button.ts +4 -20
  44. package/src/theme/system/color/input.ts +3 -11
  45. package/src/theme/system/color/selectable.ts +3 -14
  46. package/src/theme/system/shadow.ts +0 -6
  47. package/src/theme/system/styles.ts +0 -6
  48. package/src/theme/system/theme.ts +2 -0
  49. package/src/theme/system/v0/avatar.ts +1 -1
  50. package/src/theme/system/v0/color/button.ts +4 -4
  51. package/src/theme/system/v0/color/card.ts +2 -2
  52. package/src/theme/system/v0/color/input.ts +3 -3
  53. package/src/theme/system/v0/color/muted.ts +2 -2
  54. package/src/theme/system/v0/color/solid.ts +2 -2
  55. package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
  56. package/src/theme/versioning/v2_v0.ts +2 -2
  57. package/src/theme/build/colorToken.ts +0 -39
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "sideEffects": false,
5
5
  "types": "./dist/index.d.ts",
6
6
  "source": "./exports/index.ts",
@@ -1,73 +1,23 @@
1
- // re-export for backwards compatibility
2
- export {
3
- COLOR_CONFIG_CARD_KEYS,
4
- COLOR_CONFIG_CARD_TONES,
5
- COLOR_CONFIG_BLEND_KEYS,
6
- COLOR_CONFIG_STATE_KEYS,
7
- COLOR_CONFIG_STATE_TONES,
8
- THEME_COLOR_CARD_TONES,
9
- THEME_COLOR_BLEND_MODES,
10
- THEME_COLOR_BUTTON_MODES,
11
- THEME_COLOR_STATES,
12
- THEME_COLOR_STATE_TONES,
13
- buildTheme,
14
- createColorTheme,
15
- hexToRgb,
16
- hslToRgb,
17
- isColorBlendModeValue,
18
- isColorButtonMode,
19
- isColorConfigBaseKey,
20
- isColorConfigBaseTone,
21
- isColorConfigBlendKey,
22
- isColorConfigStateKey,
23
- isColorConfigStateTone,
24
- isColorHueKey,
25
- isColorOpacityValue,
26
- isColorTintKey,
27
- isColorTokenValue,
28
- isColorValue,
29
- multiply,
30
- parseColor,
31
- parseTokenKey,
32
- parseTokenValue,
33
- rgbToHex,
34
- rgbToHsl,
35
- rgba,
36
- rgbaToRGBA,
37
- screen,
38
- defaultTheme as studioTheme,
39
- type BaseTheme,
40
- type BoxShadow,
41
- type CSSObject,
42
- type ColorBlendModeTokenValue,
43
- type ColorConfigCardKey,
44
- type ColorConfigCardTone,
45
- type ColorConfigBlendKey,
46
- type ColorConfigOpacityValue,
47
- type ColorConfigStateKey,
48
- type ColorConfigStateTone,
49
- type ColorConfigValue,
50
- type HSL,
1
+ // This file re-exports API members which existed in the `@sanity/ui` export in v1.
2
+
3
+ import {
4
+ type BaseTheme as _BaseTheme,
5
+ type ThemeBoxShadow,
6
+ type HSL as _HSL,
51
7
  type PartialThemeColorBuilderOpts,
52
- type RGB,
53
- type RGBA,
54
- type RootTheme,
55
- type Theme,
8
+ type RGB as _RGB,
9
+ type RootTheme as _RootTheme,
10
+ type ThemeStyles,
11
+ type Theme as _Theme,
56
12
  type ThemeAvatar,
57
13
  type ThemeColor,
58
14
  type ThemeColorBase,
59
- type ThemeColorBaseTokens,
60
- type ThemeColorCardToneKey,
61
- type ThemeColorBlendModeKey,
62
15
  type ThemeColorBuilderOpts,
63
16
  type ThemeColorButton,
64
- type ThemeColorButtonModeKey,
65
- type ThemeColorButtonState,
17
+ type ThemeColorButtonModeKey as _ThemeColorButtonModeKey,
66
18
  type ThemeColorButtonStates,
67
- type ThemeColorButtonTokens,
68
19
  type ThemeColorButtonTones,
69
20
  type ThemeColorCard,
70
- type ThemeColorCardState,
71
21
  type ThemeColorGenericState,
72
22
  type ThemeColorInput,
73
23
  type ThemeColorInputState,
@@ -76,40 +26,239 @@ export {
76
26
  type ThemeColorMutedTone,
77
27
  type ThemeColorName,
78
28
  type ThemeColorScheme,
79
- type ThemeColorSchemeKey,
29
+ type ThemeColorSchemeKey as _ThemeColorSchemeKey,
80
30
  type ThemeColorSchemes,
81
31
  type ThemeColorSelectable,
32
+ type ThemeColorSelectableStates,
33
+ type ThemeColorSolid,
34
+ type ThemeColorSolidTone,
35
+ type ThemeColorSpot,
36
+ type ThemeColorSpotKey,
37
+ type ThemeColorSyntax as _ThemeColorSyntax,
38
+ type ThemeColorToneKey,
39
+ type ThemeFont as _ThemeFont,
40
+ type ThemeFontKey as _ThemeFontKey,
41
+ type ThemeFontSize as _ThemeFontSize,
42
+ type ThemeFontWeight as _ThemeFontWeight,
43
+ type ThemeFontWeightKey as _ThemeFontWeightKey,
44
+ type ThemeFonts as _ThemeFonts,
45
+ type ThemeInput,
46
+ type ThemeLayer as _ThemeLayer,
47
+ type ThemeShadow as _ThemeShadow,
48
+ type ThemeColorButtonState,
49
+ type ThemeColorCardState,
82
50
  type ThemeColorSelectableState,
51
+ buildTheme,
52
+ } from '@sanity/ui/theme'
53
+
54
+ /**
55
+ * @public
56
+ * @deprecated Use `BaseTheme` from `@sanity/ui/theme` instead.
57
+ */
58
+ export type BaseTheme = _BaseTheme
59
+
60
+ /**
61
+ * @public
62
+ * @deprecated Use `ThemeBoxShadow` from `@sanity/ui/theme` instead.
63
+ */
64
+ export type BoxShadow = ThemeBoxShadow
65
+
66
+ /**
67
+ * @public
68
+ * @deprecated Use `HSL` from `@sanity/ui/theme` instead.
69
+ */
70
+ export type HSL = _HSL
71
+
72
+ /**
73
+ * @public
74
+ * @deprecated Use `RGB` from `@sanity/ui/theme` instead.
75
+ */
76
+ export type RGB = _RGB
77
+
78
+ /**
79
+ * @public
80
+ * @deprecated Use `RootTheme` from `@sanity/ui/theme` instead.
81
+ */
82
+ export type RootTheme = _RootTheme
83
+
84
+ /**
85
+ * @public
86
+ * @deprecated Use `ThemeStyles` from `@sanity/ui/theme` instead.
87
+ */
88
+ export type Styles = ThemeStyles
89
+
90
+ /**
91
+ * @public
92
+ * @deprecated Use `Theme` from `@sanity/ui/theme` instead.
93
+ */
94
+ export type Theme = _Theme
95
+
96
+ /**
97
+ * @public
98
+ * @deprecated Use `ThemeColorButtonModeKey` from `@sanity/ui/theme` instead.
99
+ */
100
+ export type ThemeColorButtonModeKey = _ThemeColorButtonModeKey
101
+
102
+ /**
103
+ * @public
104
+ * @deprecated Use `ThemeColorSchemeKey` from `@sanity/ui/theme` instead.
105
+ */
106
+ export type ThemeColorSchemeKey = _ThemeColorSchemeKey
107
+
108
+ /**
109
+ * @public
110
+ * @deprecated Use `ThemeColorSyntax` from `@sanity/ui/theme` instead.
111
+ */
112
+ export type ThemeColorSyntax = _ThemeColorSyntax
113
+
114
+ /**
115
+ * @public
116
+ * @deprecated Use `ThemeFont` from `@sanity/ui/theme` instead.
117
+ */
118
+ export type ThemeFont = _ThemeFont
119
+
120
+ /**
121
+ * @public
122
+ * @deprecated Use `ThemeFontKey` from `@sanity/ui/theme` instead.
123
+ */
124
+ export type ThemeFontKey = _ThemeFontKey
125
+
126
+ /**
127
+ * @public
128
+ * @deprecated Use `ThemeFontSize` from `@sanity/ui/theme` instead.
129
+ */
130
+ export type ThemeFontSize = _ThemeFontSize
131
+
132
+ /**
133
+ * @public
134
+ * @deprecated Use `ThemeFontWeight` from `@sanity/ui/theme` instead.
135
+ */
136
+ export type ThemeFontWeight = _ThemeFontWeight
137
+
138
+ /**
139
+ * @public
140
+ * @deprecated Use `ThemeFontWeightKey` from `@sanity/ui/theme` instead.
141
+ */
142
+ export type ThemeFontWeightKey = _ThemeFontWeightKey
143
+
144
+ /**
145
+ * @public
146
+ * @deprecated Use `ThemeFonts` from `@sanity/ui/theme` instead.
147
+ */
148
+ export type ThemeFonts = _ThemeFonts
149
+
150
+ /**
151
+ * @public
152
+ * @deprecated Use `ThemeLayer` from `@sanity/ui/theme` instead.
153
+ */
154
+ export type ThemeLayer = _ThemeLayer
155
+
156
+ /**
157
+ * @public
158
+ * @deprecated Use `ThemeShadow` from `@sanity/ui/theme` instead.
159
+ */
160
+ export type ThemeShadow = _ThemeShadow
161
+
162
+ export {
163
+ type PartialThemeColorBuilderOpts,
164
+ type ThemeAvatar,
165
+ type ThemeColor,
166
+ type ThemeColorBase,
167
+ type ThemeColorBuilderOpts,
168
+ type ThemeColorButton,
169
+ type ThemeColorButtonStates,
170
+ type ThemeColorButtonTones,
171
+ type ThemeColorCard,
172
+ type ThemeColorGenericState,
173
+ type ThemeColorInput,
174
+ type ThemeColorInputState,
175
+ type ThemeColorInputStates,
176
+ type ThemeColorMuted,
177
+ type ThemeColorMutedTone,
178
+ type ThemeColorName,
179
+ type ThemeColorScheme,
180
+ type ThemeColorSchemes,
181
+ type ThemeColorSelectable,
83
182
  type ThemeColorSelectableStates,
84
183
  type ThemeColorSolid,
85
184
  type ThemeColorSolidTone,
86
185
  type ThemeColorSpot,
87
186
  type ThemeColorSpotKey,
88
- type ThemeColorStateKey,
89
- type ThemeColorStateTokens,
90
- type ThemeColorStateToneKey,
91
- type ThemeColorStatesTokens,
92
- type ThemeColorSyntax,
93
- type ThemeColorTokenValue,
94
- type ThemeColorTokens,
95
187
  type ThemeColorToneKey,
96
- type ThemeConfig,
97
- type ThemeFocusRing,
98
- type ThemeFont,
99
- type ThemeFontKey,
100
- type ThemeFontSize,
101
- type ThemeFontWeight,
102
- type ThemeFontWeightKey,
103
- type ThemeFonts,
104
188
  type ThemeInput,
105
- type ThemeLayer,
106
- type ThemeShadow,
107
- type ThemeStyles,
108
- type TokenBaseKeyNode,
109
- type TokenBlendModeValueNode,
110
- type TokenButtonKeyNode,
111
- type TokenColorValueNode,
112
- type TokenHueValueNode,
113
- type TokenKeyNode,
114
- type TokenValueNode,
189
+ type ThemeColorButtonState,
190
+ type ThemeColorCardState,
191
+ type ThemeColorSelectableState,
192
+ }
193
+
194
+ import {
195
+ createColorTheme as _createColorTheme,
196
+ hexToRgb as _hexToRgb,
197
+ hslToRgb as _hslToRgb,
198
+ multiply as _multiply,
199
+ parseColor as _parseColor,
200
+ rgbToHex as _rgbToHex,
201
+ rgbToHsl as _rgbToHsl,
202
+ rgba as _rgba,
203
+ screen as _screen,
115
204
  } from '@sanity/ui/theme'
205
+
206
+ /**
207
+ * @public
208
+ * @deprecated Use `createColorTheme` from `@sanity/ui/theme` instead.
209
+ */
210
+ export const createColorTheme = _createColorTheme
211
+
212
+ /**
213
+ * @public
214
+ * @deprecated Use `hexToRgb` from `@sanity/ui/theme` instead.
215
+ */
216
+ export const hexToRgb = _hexToRgb
217
+
218
+ /**
219
+ * @public
220
+ * @deprecated Use `hslToRgb` from `@sanity/ui/theme` instead.
221
+ */
222
+ export const hslToRgb = _hslToRgb
223
+
224
+ /**
225
+ * @public
226
+ * @deprecated Use `multiply` from `@sanity/ui/theme` instead.
227
+ */
228
+ export const multiply = _multiply
229
+
230
+ /**
231
+ * @public
232
+ * @deprecated Use `parseColor` from `@sanity/ui/theme` instead.
233
+ */
234
+ export const parseColor = _parseColor
235
+
236
+ /**
237
+ * @public
238
+ * @deprecated Use `rgbToHex` from `@sanity/ui/theme` instead.
239
+ */
240
+ export const rgbToHex = _rgbToHex
241
+
242
+ /**
243
+ * @public
244
+ * @deprecated Use `rgbToHsl` from `@sanity/ui/theme` instead.
245
+ */
246
+ export const rgbToHsl = _rgbToHsl
247
+
248
+ /**
249
+ * @public
250
+ * @deprecated Use `rgba` from `@sanity/ui/theme` instead.
251
+ */
252
+ export const rgba = _rgba
253
+
254
+ /**
255
+ * @public
256
+ * @deprecated Use `screen` from `@sanity/ui/theme` instead.
257
+ */
258
+ export const screen = _screen
259
+
260
+ /**
261
+ * @public
262
+ * @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
263
+ */
264
+ export const studioTheme = buildTheme()
@@ -1,9 +1,12 @@
1
1
  /** @jest-environment node */
2
- import {defaultTheme} from '@sanity/ui/theme'
2
+
3
+ import {buildTheme} from '@sanity/ui/theme'
3
4
  import {renderToString, renderToStaticMarkup} from 'react-dom/server'
4
5
  import {ThemeProvider} from '../../theme'
5
6
  import {useMediaIndex} from './useMediaIndex'
6
7
 
8
+ const theme = buildTheme()
9
+
7
10
  function Log() {
8
11
  const mediaIndex = useMediaIndex()
9
12
 
@@ -14,7 +17,7 @@ describe('useMediaIndex', () => {
14
17
  it(`SSR to static markup returns 0`, () => {
15
18
  expect(
16
19
  renderToStaticMarkup(
17
- <ThemeProvider theme={defaultTheme}>
20
+ <ThemeProvider theme={theme}>
18
21
  <Log />
19
22
  </ThemeProvider>,
20
23
  ),
@@ -23,7 +26,7 @@ describe('useMediaIndex', () => {
23
26
  it(`SSR to markup for hydration doesn't throw`, () => {
24
27
  expect(
25
28
  renderToString(
26
- <ThemeProvider theme={defaultTheme}>
29
+ <ThemeProvider theme={theme}>
27
30
  <Log />
28
31
  </ThemeProvider>,
29
32
  ),
@@ -26,6 +26,8 @@ function kbdStyle() {
26
26
  background: var(--card-bg-color);
27
27
  font: inherit;
28
28
 
29
+ vertical-align: top;
30
+
29
31
  &:not([hidden]) {
30
32
  display: inline-block;
31
33
  }
@@ -1,9 +1,9 @@
1
1
  /** @jest-environment jsdom */
2
2
 
3
- import {getScopedTheme, defaultTheme} from '@sanity/ui/theme'
3
+ import {buildTheme, getScopedTheme} from '@sanity/ui/theme'
4
4
  import {responsiveMarginStyle} from './marginStyle'
5
5
 
6
- const theme = getScopedTheme(defaultTheme, 'light', 'default')
6
+ const theme = getScopedTheme(buildTheme(), 'light', 'default')
7
7
 
8
8
  describe('styles/margin', () => {
9
9
  it('should 1', () => {
@@ -1,9 +1,9 @@
1
1
  /** @jest-environment jsdom */
2
2
 
3
- import {getScopedTheme, defaultTheme} from '@sanity/ui/theme'
3
+ import {buildTheme, getScopedTheme} from '@sanity/ui/theme'
4
4
  import {responsivePaddingStyle} from './paddingStyle'
5
5
 
6
- const theme = getScopedTheme(defaultTheme, 'light', 'default')
6
+ const theme = getScopedTheme(buildTheme(), 'light', 'default')
7
7
 
8
8
  describe('styles/padding', () => {
9
9
  it('should 1', () => {
@@ -159,6 +159,7 @@ export const Root = styled.div((props) => {
159
159
  --link-fg: var(--card-enabled-link-fg);
160
160
  --code-bg: var(--card-enabled-code-bg);
161
161
  --code-fg: var(--card-enabled-code-fg);
162
+ --kbd-bg: var(--card-enabled-kbd-bg);
162
163
  --skeleton-from: var(--card-enabled-skeleton-from);
163
164
  --skeleton-to: var(--card-enabled-skeleton-to);
164
165
 
@@ -322,15 +323,15 @@ export const Root = styled.div((props) => {
322
323
  color: var(--icon);
323
324
  }
324
325
 
325
- .muted-fg {
326
+ .muted {
326
327
  color: var(--muted-fg);
327
328
  }
328
329
 
329
- .accent-fg {
330
+ .accent {
330
331
  color: var(--accent-fg);
331
332
  }
332
333
 
333
- .link-fg {
334
+ .link {
334
335
  color: var(--link-fg);
335
336
  }
336
337
 
@@ -339,6 +340,22 @@ export const Root = styled.div((props) => {
339
340
  color: var(--code-fg);
340
341
  }
341
342
 
343
+ .kbd {
344
+ background-color: var(--kbd-bg);
345
+ color: var(--kbd-fg);
346
+ }
347
+
348
+ .badge {
349
+ background-color: var(--badge-bg);
350
+ color: var(--badge-fg);
351
+ }
352
+
353
+ .badge--default {
354
+ --badge-bg: var(--badge-default-bg);
355
+ --badge-fg: var(--badge-default-fg);
356
+ --badge-border: var(--badge-default-border);
357
+ }
358
+
342
359
  .skeleton-from {
343
360
  color: var(--skeleton-from);
344
361
  }
@@ -1,27 +1,27 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
 
3
3
  import {
4
- ThemeColorButtonStates_v2,
4
+ ThemeColorButtonTone_v2,
5
5
  ThemeColorCard_v2,
6
- ThemeColorInputStates_v2,
6
+ ThemeColorInputMode_v2,
7
7
  ThemeColorState_v2,
8
8
  } from '@sanity/ui/theme'
9
9
  import {
10
- THEME_COLOR_CARD_TONES,
11
10
  THEME_COLOR_BUTTON_MODES,
11
+ THEME_COLOR_CARD_TONES,
12
12
  THEME_COLOR_INPUT_MODES,
13
13
  THEME_COLOR_STATE_TONES,
14
14
  ThemeColorCardToneKey,
15
15
  ThemeColorInputModeKey,
16
16
  } from '@sanity/ui/theme'
17
- import {defaultTheme} from '@sanity/ui/theme'
17
+ import {buildTheme} from '@sanity/ui/theme'
18
18
  import {ReactElement} from 'react'
19
19
  import {rem} from '../../../styles'
20
20
  import {useTheme_v2} from '../../useTheme'
21
21
  import {getCSSProps} from './helpers'
22
22
  import {Root} from './Root'
23
23
 
24
- const theme = defaultTheme
24
+ const theme = buildTheme()
25
25
 
26
26
  export default function BuildStory(): ReactElement {
27
27
  return (
@@ -268,7 +268,7 @@ function StatePreview(props: {theme: ThemeColorState_v2}) {
268
268
  )
269
269
  }
270
270
 
271
- function ButtonPreview(props: {theme: ThemeColorButtonStates_v2}) {
271
+ function ButtonPreview(props: {theme: ThemeColorButtonTone_v2}) {
272
272
  const {theme: button} = props
273
273
 
274
274
  return (
@@ -289,18 +289,24 @@ function ButtonPreview(props: {theme: ThemeColorButtonStates_v2}) {
289
289
  <div className="icon" style={{flex: 'none'}}>
290
290
  &copy;
291
291
  </div>
292
- <div className="muted-fg" style={{flex: 'none'}}>
292
+ <div className="muted" style={{flex: 'none'}}>
293
293
  m
294
294
  </div>
295
- <div className="accent-fg" style={{flex: 'none'}}>
295
+ <div className="accent" style={{flex: 'none'}}>
296
296
  a
297
297
  </div>
298
- <div className="link-fg" style={{flex: 'none'}}>
298
+ <div className="link" style={{flex: 'none'}}>
299
299
  l
300
300
  </div>
301
301
  <div className="code" style={{flex: 'none'}}>
302
302
  c
303
303
  </div>
304
+ <div className="kbd" style={{flex: 'none'}}>
305
+ k
306
+ </div>
307
+ <div className="badge badge--default" style={{flex: 'none'}}>
308
+ b
309
+ </div>
304
310
  <div style={{flex: 'none'}}>
305
311
  <CheckeredBackground />
306
312
  </div>
@@ -424,7 +430,7 @@ function Skeleton() {
424
430
  )
425
431
  }
426
432
 
427
- function InputPreview(props: {mode: ThemeColorInputModeKey; theme: ThemeColorInputStates_v2}) {
433
+ function InputPreview(props: {mode: ThemeColorInputModeKey; theme: ThemeColorInputMode_v2}) {
428
434
  const {mode, theme: input} = props
429
435
 
430
436
  return (
@@ -10,14 +10,14 @@ import {
10
10
  useRootTheme,
11
11
  } from '@sanity/ui'
12
12
  import {
13
- ThemeColorButtonStates_v2,
14
- ThemeColorButtonTones_v2,
13
+ ThemeColorButtonMode_v2,
14
+ ThemeColorButtonTone_v2,
15
15
  ThemeColorButton_v2,
16
+ ThemeColorCard_v2,
16
17
  ThemeColorScheme_v2,
17
- ThemeColorSelectableStates_v2,
18
+ ThemeColorSelectableTone_v2,
18
19
  ThemeColorSelectable_v2,
19
20
  ThemeColorState_v2,
20
- ThemeColorCard_v2,
21
21
  getContrastRatio,
22
22
  mix,
23
23
  parseColor,
@@ -202,7 +202,7 @@ function ColorButton(props: {color: ThemeColorButton_v2}) {
202
202
  )
203
203
  }
204
204
 
205
- function ColorButtonMode(props: {color: ThemeColorButtonTones_v2}) {
205
+ function ColorButtonMode(props: {color: ThemeColorButtonMode_v2}) {
206
206
  const {color} = props
207
207
 
208
208
  return (
@@ -243,7 +243,7 @@ function ColorButtonMode(props: {color: ThemeColorButtonTones_v2}) {
243
243
  )
244
244
  }
245
245
 
246
- function ColorGenericStates(props: {color: ThemeColorButtonStates_v2}) {
246
+ function ColorGenericStates(props: {color: ThemeColorButtonTone_v2}) {
247
247
  const {color} = props
248
248
 
249
249
  return (
@@ -335,7 +335,7 @@ function ColorSelectable(props: {color: ThemeColorSelectable_v2}) {
335
335
  )
336
336
  }
337
337
 
338
- function ColorSelectableTone(props: {color: ThemeColorSelectableStates_v2}) {
338
+ function ColorSelectableTone(props: {color: ThemeColorSelectableTone_v2}) {
339
339
  const {color} = props
340
340
 
341
341
  return (