@sanity/ui 2.0.0-alpha.35 → 2.0.0-alpha.36

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "2.0.0-alpha.35",
3
+ "version": "2.0.0-alpha.36",
4
4
  "sideEffects": false,
5
5
  "types": "./dist/index.d.ts",
6
6
  "source": "./exports/index.ts",
@@ -41,36 +41,64 @@ export interface RootTheme_v2 {
41
41
  */
42
42
  export interface BaseTheme {
43
43
  _version?: 0
44
+ /**
45
+ * @deprecated Use `v2.avatar` instead
46
+ */
44
47
  avatar: ThemeAvatar
48
+ /**
49
+ * @deprecated Use `v2.button` instead
50
+ */
45
51
  button: {
46
- border: {width: number}
47
- focusRing: ThemeFocusRing
48
52
  textWeight: ThemeFontWeightKey
49
53
  }
50
- card: {
51
- border: {width: number}
52
- focusRing: ThemeFocusRing
53
- shadow: {outline: number}
54
- }
54
+ /**
55
+ * @deprecated Use `v2.color` instead
56
+ */
55
57
  color: ThemeColorSchemes
58
+ /**
59
+ * @deprecated Use `v2.container` instead
60
+ */
56
61
  container: number[]
57
- /** @deprecated Use component-specific `focusRing` values instead */
62
+ /**
63
+ * @deprecated Use component-specific `v2.{button | card | input}.focusRing` values instead
64
+ */
58
65
  focusRing: {
59
66
  offset: number
60
67
  width: number
61
68
  }
69
+ /**
70
+ * @deprecated Use `v2.font` instead
71
+ */
62
72
  fonts: ThemeFonts
73
+ /**
74
+ * @deprecated Use `v2.input` instead
75
+ */
63
76
  input: ThemeInput
64
77
  /**
65
78
  * THIS API MAY BE UNSTABLE. DO NOT USE IN PRODUCTION.
66
79
  * @beta
80
+ * @deprecated Use `v2.layer` instead
67
81
  */
68
82
  layer?: ThemeLayer
83
+ /**
84
+ * @deprecated Use `v2.media` instead
85
+ */
69
86
  media: number[]
87
+ /**
88
+ * @deprecated Use `v2.radius` instead
89
+ */
70
90
  radius: number[]
91
+ /**
92
+ * @deprecated Use `v2.shadow` instead
93
+ */
71
94
  shadows: Array<ThemeShadow | null>
95
+ /**
96
+ * @deprecated Use `v2.space` instead
97
+ */
72
98
  space: number[]
73
- /** @internal */
99
+ /**
100
+ * @deprecated Use `v2.style` instead
101
+ */
74
102
  styles?: ThemeStyles
75
103
 
76
104
  v2?: RootTheme_v2
@@ -91,6 +119,9 @@ export type Theme_v2 = Omit<RootTheme_v2, 'color'> & {color: ThemeColorCard_v2}
91
119
  */
92
120
  export interface Theme {
93
121
  sanity: Omit<RootTheme, 'color' | 'v2'> & {
122
+ /**
123
+ * @deprecated Use `v2.color` instead
124
+ */
94
125
  color: ThemeColor
95
126
  v2?: Theme_v2
96
127
  }
@@ -15,8 +15,11 @@ export function getTheme_v2(theme: Theme): Theme_v2 {
15
15
  const v2: Theme_v2 = {
16
16
  _version: 2,
17
17
  avatar: theme.sanity.avatar,
18
- button: theme.sanity.button,
19
- card: theme.sanity.card,
18
+ button: {
19
+ ...defaultThemeConfig.button,
20
+ ...theme.sanity.button,
21
+ },
22
+ card: defaultThemeConfig.card,
20
23
  color: themeColor_v0_v2(theme.sanity.color),
21
24
  container: theme.sanity.container,
22
25
  font: theme.sanity.fonts,
@@ -15,7 +15,6 @@ export function v0_v2(v0: RootTheme): RootTheme_v2 {
15
15
  const {
16
16
  avatar,
17
17
  button,
18
- card,
19
18
  color,
20
19
  container,
21
20
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -33,8 +32,11 @@ export function v0_v2(v0: RootTheme): RootTheme_v2 {
33
32
  const v2: RootTheme_v2 = {
34
33
  _version: 2,
35
34
  avatar,
36
- button,
37
- card,
35
+ button: {
36
+ ...defaultThemeConfig.button,
37
+ ...button,
38
+ },
39
+ card: defaultThemeConfig.card,
38
40
  color: {
39
41
  light: {
40
42
  transparent: themeColor_v0_v2(color.light.transparent),
@@ -20,7 +20,6 @@ export function v2_v0(v2: RootTheme_v2): RootTheme {
20
20
  const {
21
21
  avatar,
22
22
  button,
23
- card,
24
23
  color,
25
24
  container,
26
25
  font: fonts,
@@ -36,7 +35,6 @@ export function v2_v0(v2: RootTheme_v2): RootTheme {
36
35
  _version: 0,
37
36
  avatar,
38
37
  button,
39
- card,
40
38
  container,
41
39
  color: {
42
40
  light: {