@sanity/ui 2.12.1 → 2.12.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "2.12.1",
3
+ "version": "2.12.3",
4
4
  "keywords": [
5
5
  "sanity",
6
6
  "ui",
@@ -121,7 +121,7 @@
121
121
  "@sanity/icons": "^3.5.7",
122
122
  "csstype": "^3.1.3",
123
123
  "framer-motion": "^12.4.1",
124
- "react-compiler-runtime": "19.0.0-beta-714736e-20250131",
124
+ "react-compiler-runtime": "19.0.0-beta-30d8a17-20250209",
125
125
  "react-refractor": "^2.2.0",
126
126
  "use-effect-event": "^1.0.2"
127
127
  },
@@ -164,7 +164,7 @@
164
164
  "@typescript-eslint/eslint-plugin": "^7.18.0",
165
165
  "@typescript-eslint/parser": "^7.18.0",
166
166
  "@vitejs/plugin-react": "^4.3.4",
167
- "babel-plugin-react-compiler": "19.0.0-beta-714736e-20250131",
167
+ "babel-plugin-react-compiler": "19.0.0-beta-30d8a17-20250209",
168
168
  "babel-plugin-styled-components": "^2.1.4",
169
169
  "commitizen": "^4.3.1",
170
170
  "cypress": "^13.17.0",
@@ -176,7 +176,7 @@
176
176
  "eslint-plugin-import": "^2.31.0",
177
177
  "eslint-plugin-jsx-a11y": "^6.10.2",
178
178
  "eslint-plugin-react": "^7.37.4",
179
- "eslint-plugin-react-compiler": "19.0.0-beta-714736e-20250131",
179
+ "eslint-plugin-react-compiler": "19.0.0-beta-30d8a17-20250209",
180
180
  "eslint-plugin-react-hooks": "^5.1.0",
181
181
  "eslint-plugin-storybook": "^0.11.2",
182
182
  "http-server": "^14.1.1",
@@ -8,6 +8,7 @@ import {
8
8
  ThemeColorSchemeKey,
9
9
  } from './system'
10
10
  import {is_v2, v0_v2, v2_v0} from './versioning'
11
+ import {themeColor_v0_v2_9} from './versioning/themeColor_v2_v2_9'
11
12
 
12
13
  // cache[scheme][tone][rootTheme] = theme
13
14
  const cache = new Map<
@@ -34,6 +35,7 @@ export function getScopedTheme(
34
35
 
35
36
  const colorScheme_v2 = v2.color[scheme] || v2.color.light
36
37
  const color_v2 = colorScheme_v2[tone] || colorScheme_v2.default
38
+ const color_v2_9 = themeColor_v0_v2_9(color_v2)
37
39
  const layer_v2 = v2.layer || defaultThemeConfig.layer
38
40
 
39
41
  const theme: Theme = {
@@ -44,7 +46,7 @@ export function getScopedTheme(
44
46
  v2: {
45
47
  ...v2,
46
48
  _resolved: true,
47
- color: color_v2,
49
+ color: color_v2_9,
48
50
  layer: layer_v2,
49
51
  },
50
52
  },
@@ -0,0 +1,49 @@
1
+ import type {ThemeColorCard_v2} from '../system'
2
+
3
+ /**
4
+ * Apply `neutral` and `suggest` if they're not already part of the color object,
5
+ * as this was introduced in v2.9, but is not compatible with v2.0.
6
+ *
7
+ * @param color - The color object to upgrade
8
+ * @returns The upgraded color object. Returns as-is if already upgraded.
9
+ * @internal
10
+ */
11
+ export function themeColor_v0_v2_9(color: ThemeColorCard_v2): ThemeColorCard_v2 {
12
+ if ('neutral' in color.badge) {
13
+ return color // Already at >= v2.9
14
+ }
15
+
16
+ // TypeScript narrows to `never` because the above should always be true
17
+ const colors = color as ThemeColorCard_v2
18
+
19
+ return {
20
+ ...colors,
21
+ badge: {
22
+ ...colors.badge,
23
+ neutral: colors.badge.default,
24
+ suggest: colors.badge.primary,
25
+ },
26
+ button: {
27
+ bleed: {
28
+ ...colors.button.bleed,
29
+ neutral: colors.button.bleed.default,
30
+ suggest: colors.button.bleed.primary,
31
+ },
32
+ default: {
33
+ ...colors.button.default,
34
+ neutral: colors.button.default.default,
35
+ suggest: colors.button.default.primary,
36
+ },
37
+ ghost: {
38
+ ...colors.button.ghost,
39
+ neutral: colors.button.ghost.default,
40
+ suggest: colors.button.ghost.primary,
41
+ },
42
+ },
43
+ selectable: {
44
+ ...colors.selectable,
45
+ neutral: colors.selectable.default,
46
+ suggest: colors.selectable.primary,
47
+ },
48
+ }
49
+ }