@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/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/theme.d.ts +6 -0
- package/dist/theme.esm.js +5 -3
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +5 -3
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
- package/src/core/components/dialog/dialog.tsx +1 -1
- package/src/core/components/dialog/styles.ts +2 -2
- package/src/theme/getScopedTheme.ts +1 -0
- package/src/theme/system/theme.ts +9 -1
- package/src/theme/versioning/getTheme_v2.ts +2 -1
package/package.json
CHANGED
|
@@ -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
|
|
48
|
+
if (!props.$animate) return css``
|
|
49
49
|
|
|
50
50
|
return css`
|
|
51
51
|
@keyframes zoomIn {
|
|
@@ -114,7 +114,15 @@ export type RootTheme = BaseTheme
|
|
|
114
114
|
/**
|
|
115
115
|
* @public
|
|
116
116
|
*/
|
|
117
|
-
export type Theme_v2 = Omit<RootTheme_v2, 'color'> & {
|
|
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,
|