@sanity/ui 2.0.0-beta.15 → 2.0.0-beta.17

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-beta.15",
3
+ "version": "2.0.0-beta.17",
4
4
  "sideEffects": false,
5
5
  "types": "./dist/index.d.ts",
6
6
  "source": "./exports/index.ts",
@@ -394,6 +394,7 @@ export const Dialog = forwardRef(function Dialog(
394
394
  <Portal __unstable_name={portalProp}>
395
395
  <Root
396
396
  {...restProps}
397
+ $animate={animate}
397
398
  $padding={padding}
398
399
  $position={position}
399
400
  aria-labelledby={labelId}
@@ -406,7 +407,6 @@ export const Dialog = forwardRef(function Dialog(
406
407
  ref={ref}
407
408
  role="dialog"
408
409
  zOffset={zOffset}
409
- animate={animate}
410
410
  >
411
411
  <div ref={preDivRef} tabIndex={0} />
412
412
  <DialogCard
@@ -41,11 +41,11 @@ export function responsiveDialogPositionStyle(
41
41
  * @internal
42
42
  */
43
43
  export interface AnimationDialogStyleProps {
44
- animate: boolean
44
+ $animate: boolean
45
45
  }
46
46
 
47
47
  export function animationDialogStyle(props: AnimationDialogStyleProps): ReturnType<typeof css> {
48
- if (!props.animate) return css``
48
+ if (!props.$animate) return css``
49
49
 
50
50
  return css`
51
51
  @keyframes zoomIn {
@@ -36,6 +36,7 @@ export function getScopedTheme(
36
36
  layer: layer_v0,
37
37
  v2: {
38
38
  ...v2,
39
+ _resolved: true,
39
40
  color: color_v2,
40
41
  layer: layer_v2,
41
42
  },
@@ -114,7 +114,15 @@ export type RootTheme = BaseTheme
114
114
  /**
115
115
  * @public
116
116
  */
117
- export type Theme_v2 = Omit<RootTheme_v2, 'color'> & {color: ThemeColorCard_v2}
117
+ export type Theme_v2 = Omit<RootTheme_v2, 'color'> & {
118
+ color: ThemeColorCard_v2
119
+ /**
120
+ * Indicates whether the theme is resolved or raw, it's necessary to avoid issues
121
+ * with sanity V2 components accessing a v1 <ThemeProvider>.
122
+ * See https://github.com/sanity-io/ui/pull/1203 for more info.
123
+ */
124
+ _resolved: boolean
125
+ }
118
126
 
119
127
  /**
120
128
  * @public
@@ -6,7 +6,7 @@ const cache = new WeakMap<Theme, Theme_v2>()
6
6
 
7
7
  /** @public */
8
8
  export function getTheme_v2(theme: Theme): Theme_v2 {
9
- if (theme.sanity.v2) return theme.sanity.v2
9
+ if (theme.sanity.v2?._resolved) return theme.sanity.v2
10
10
 
11
11
  const cached_v2 = cache.get(theme)
12
12
 
@@ -14,6 +14,7 @@ export function getTheme_v2(theme: Theme): Theme_v2 {
14
14
 
15
15
  const v2: Theme_v2 = {
16
16
  _version: 2,
17
+ _resolved: true,
17
18
  avatar: {
18
19
  ...defaultThemeConfig.avatar,
19
20
  ...theme.sanity.avatar,