@sanity/ui 3.0.0-static.30 → 3.0.0-static.31
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/_chunks-cjs/_visual-editing.cjs +13 -14
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-cjs/refractor.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +13 -14
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/refractor.js.map +1 -1
- package/dist/css/index.css +1 -1
- package/dist/css/index.d.cts +7227 -7227
- package/dist/css/index.d.ts +7227 -7227
- package/dist/index.cjs +11 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.js.map +1 -1
- package/package.json +25 -25
- package/src/core/__DEV__.ts +0 -1
- package/src/core/_compat/theme/theme.test.tsx +4 -3
- package/src/core/components/dialog/dialogCard.tsx +9 -2
- package/src/core/components/menu/menu.test.tsx +8 -7
- package/src/core/components/toast/toast.test.tsx +8 -7
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +1 -1
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +1 -1
- package/src/core/lib/createGlobalScopedContext.ts +5 -2
- package/src/core/lib/globalScope.ts +1 -1
- package/src/core/primitives/code/refractor.tsx +1 -1
- package/src/core/primitives/layer/layer.test.tsx +8 -7
- package/src/core/primitives/popover/popover.tsx +4 -29
- package/src/core/primitives/textArea/textArea.tsx +0 -2
- package/src/core/primitives/types.ts +11 -11
- package/src/core/types/props.ts +1 -0
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +8 -7
- package/src/core/utils/getElementRef.ts +2 -0
- package/src/core/utils/portal/portal.test.tsx +8 -7
- package/src/core/utils/portal/portalContext.ts +10 -7
- package/src/css/components/dialog/dialog.css.ts +2 -2
- package/src/css/primitives/button/button.css.ts +0 -2
- package/src/theme/v0/css.ts +2 -0
- package/src/theme/v2/build/merge.ts +2 -0
- package/src/theme/v3/merge.ts +2 -0
package/dist/index.d.cts
CHANGED
|
@@ -1992,7 +1992,7 @@ export declare interface ResponsiveAvatarSizeStyleProps {
|
|
|
1992
1992
|
|
|
1993
1993
|
/**
|
|
1994
1994
|
* @public
|
|
1995
|
-
* @deprecated
|
|
1995
|
+
* @deprecated No longer used.
|
|
1996
1996
|
*/
|
|
1997
1997
|
export declare interface ResponsiveBorderProps {
|
|
1998
1998
|
border?: boolean | boolean[]
|
|
@@ -2004,7 +2004,7 @@ export declare interface ResponsiveBorderProps {
|
|
|
2004
2004
|
|
|
2005
2005
|
/**
|
|
2006
2006
|
* @public
|
|
2007
|
-
* @deprecated
|
|
2007
|
+
* @deprecated No longer used.
|
|
2008
2008
|
*/
|
|
2009
2009
|
export declare interface ResponsiveBoxProps {
|
|
2010
2010
|
display?: BoxDisplay | BoxDisplay[]
|
|
@@ -2015,7 +2015,7 @@ export declare interface ResponsiveBoxProps {
|
|
|
2015
2015
|
|
|
2016
2016
|
/**
|
|
2017
2017
|
* @public
|
|
2018
|
-
* @deprecated
|
|
2018
|
+
* @deprecated No longer used.
|
|
2019
2019
|
*/
|
|
2020
2020
|
export declare interface ResponsiveFlexItemProps {
|
|
2021
2021
|
/** Sets the flex CSS attribute. The property is responsive. */
|
|
@@ -2024,7 +2024,7 @@ export declare interface ResponsiveFlexItemProps {
|
|
|
2024
2024
|
|
|
2025
2025
|
/**
|
|
2026
2026
|
* @public
|
|
2027
|
-
* @deprecated
|
|
2027
|
+
* @deprecated No longer used.
|
|
2028
2028
|
*/
|
|
2029
2029
|
export declare interface ResponsiveFlexProps {
|
|
2030
2030
|
align?: FlexAlign | FlexAlign[]
|
|
@@ -2035,7 +2035,7 @@ export declare interface ResponsiveFlexProps {
|
|
|
2035
2035
|
|
|
2036
2036
|
/**
|
|
2037
2037
|
* @public
|
|
2038
|
-
* @deprecated
|
|
2038
|
+
* @deprecated No longer used.
|
|
2039
2039
|
*/
|
|
2040
2040
|
export declare interface ResponsiveGridItemProps {
|
|
2041
2041
|
column?: GridItemColumn | GridItemColumn[]
|
|
@@ -2048,7 +2048,7 @@ export declare interface ResponsiveGridItemProps {
|
|
|
2048
2048
|
|
|
2049
2049
|
/**
|
|
2050
2050
|
* @public
|
|
2051
|
-
* @deprecated
|
|
2051
|
+
* @deprecated No longer used.
|
|
2052
2052
|
*/
|
|
2053
2053
|
export declare interface ResponsiveGridProps {
|
|
2054
2054
|
autoRows?: GridAutoRows | GridAutoRows[]
|
|
@@ -2060,7 +2060,7 @@ export declare interface ResponsiveGridProps {
|
|
|
2060
2060
|
|
|
2061
2061
|
/**
|
|
2062
2062
|
* @public
|
|
2063
|
-
* @deprecated
|
|
2063
|
+
* @deprecated No longer used.
|
|
2064
2064
|
*/
|
|
2065
2065
|
export declare interface ResponsiveMarginProps {
|
|
2066
2066
|
/** Applies margins to all sides. The property is responsive. */
|
|
@@ -2077,7 +2077,7 @@ export declare interface ResponsiveMarginProps {
|
|
|
2077
2077
|
|
|
2078
2078
|
/**
|
|
2079
2079
|
* @public
|
|
2080
|
-
* @deprecated
|
|
2080
|
+
* @deprecated No longer used.
|
|
2081
2081
|
*/
|
|
2082
2082
|
export declare interface ResponsivePaddingProps {
|
|
2083
2083
|
padding?: number | number[]
|
|
@@ -2091,7 +2091,7 @@ export declare interface ResponsivePaddingProps {
|
|
|
2091
2091
|
|
|
2092
2092
|
/**
|
|
2093
2093
|
* @public
|
|
2094
|
-
* @deprecated
|
|
2094
|
+
* @deprecated No longer used.
|
|
2095
2095
|
*/
|
|
2096
2096
|
export declare interface ResponsiveRadiusProps {
|
|
2097
2097
|
radius?: Radius | Radius[]
|
|
@@ -2099,7 +2099,7 @@ export declare interface ResponsiveRadiusProps {
|
|
|
2099
2099
|
|
|
2100
2100
|
/**
|
|
2101
2101
|
* @public
|
|
2102
|
-
* @deprecated
|
|
2102
|
+
* @deprecated No longer used.
|
|
2103
2103
|
*/
|
|
2104
2104
|
export declare interface ResponsiveShadowProps {
|
|
2105
2105
|
shadow?: number | number[]
|
|
@@ -2107,7 +2107,7 @@ export declare interface ResponsiveShadowProps {
|
|
|
2107
2107
|
|
|
2108
2108
|
/**
|
|
2109
2109
|
* @public
|
|
2110
|
-
* @deprecated
|
|
2110
|
+
* @deprecated No longer used.
|
|
2111
2111
|
*/
|
|
2112
2112
|
export declare interface ResponsiveWidthProps {
|
|
2113
2113
|
width?: number | 'auto' | (number | 'auto')[]
|
package/dist/index.d.ts
CHANGED
|
@@ -1992,7 +1992,7 @@ export declare interface ResponsiveAvatarSizeStyleProps {
|
|
|
1992
1992
|
|
|
1993
1993
|
/**
|
|
1994
1994
|
* @public
|
|
1995
|
-
* @deprecated
|
|
1995
|
+
* @deprecated No longer used.
|
|
1996
1996
|
*/
|
|
1997
1997
|
export declare interface ResponsiveBorderProps {
|
|
1998
1998
|
border?: boolean | boolean[]
|
|
@@ -2004,7 +2004,7 @@ export declare interface ResponsiveBorderProps {
|
|
|
2004
2004
|
|
|
2005
2005
|
/**
|
|
2006
2006
|
* @public
|
|
2007
|
-
* @deprecated
|
|
2007
|
+
* @deprecated No longer used.
|
|
2008
2008
|
*/
|
|
2009
2009
|
export declare interface ResponsiveBoxProps {
|
|
2010
2010
|
display?: BoxDisplay | BoxDisplay[]
|
|
@@ -2015,7 +2015,7 @@ export declare interface ResponsiveBoxProps {
|
|
|
2015
2015
|
|
|
2016
2016
|
/**
|
|
2017
2017
|
* @public
|
|
2018
|
-
* @deprecated
|
|
2018
|
+
* @deprecated No longer used.
|
|
2019
2019
|
*/
|
|
2020
2020
|
export declare interface ResponsiveFlexItemProps {
|
|
2021
2021
|
/** Sets the flex CSS attribute. The property is responsive. */
|
|
@@ -2024,7 +2024,7 @@ export declare interface ResponsiveFlexItemProps {
|
|
|
2024
2024
|
|
|
2025
2025
|
/**
|
|
2026
2026
|
* @public
|
|
2027
|
-
* @deprecated
|
|
2027
|
+
* @deprecated No longer used.
|
|
2028
2028
|
*/
|
|
2029
2029
|
export declare interface ResponsiveFlexProps {
|
|
2030
2030
|
align?: FlexAlign | FlexAlign[]
|
|
@@ -2035,7 +2035,7 @@ export declare interface ResponsiveFlexProps {
|
|
|
2035
2035
|
|
|
2036
2036
|
/**
|
|
2037
2037
|
* @public
|
|
2038
|
-
* @deprecated
|
|
2038
|
+
* @deprecated No longer used.
|
|
2039
2039
|
*/
|
|
2040
2040
|
export declare interface ResponsiveGridItemProps {
|
|
2041
2041
|
column?: GridItemColumn | GridItemColumn[]
|
|
@@ -2048,7 +2048,7 @@ export declare interface ResponsiveGridItemProps {
|
|
|
2048
2048
|
|
|
2049
2049
|
/**
|
|
2050
2050
|
* @public
|
|
2051
|
-
* @deprecated
|
|
2051
|
+
* @deprecated No longer used.
|
|
2052
2052
|
*/
|
|
2053
2053
|
export declare interface ResponsiveGridProps {
|
|
2054
2054
|
autoRows?: GridAutoRows | GridAutoRows[]
|
|
@@ -2060,7 +2060,7 @@ export declare interface ResponsiveGridProps {
|
|
|
2060
2060
|
|
|
2061
2061
|
/**
|
|
2062
2062
|
* @public
|
|
2063
|
-
* @deprecated
|
|
2063
|
+
* @deprecated No longer used.
|
|
2064
2064
|
*/
|
|
2065
2065
|
export declare interface ResponsiveMarginProps {
|
|
2066
2066
|
/** Applies margins to all sides. The property is responsive. */
|
|
@@ -2077,7 +2077,7 @@ export declare interface ResponsiveMarginProps {
|
|
|
2077
2077
|
|
|
2078
2078
|
/**
|
|
2079
2079
|
* @public
|
|
2080
|
-
* @deprecated
|
|
2080
|
+
* @deprecated No longer used.
|
|
2081
2081
|
*/
|
|
2082
2082
|
export declare interface ResponsivePaddingProps {
|
|
2083
2083
|
padding?: number | number[]
|
|
@@ -2091,7 +2091,7 @@ export declare interface ResponsivePaddingProps {
|
|
|
2091
2091
|
|
|
2092
2092
|
/**
|
|
2093
2093
|
* @public
|
|
2094
|
-
* @deprecated
|
|
2094
|
+
* @deprecated No longer used.
|
|
2095
2095
|
*/
|
|
2096
2096
|
export declare interface ResponsiveRadiusProps {
|
|
2097
2097
|
radius?: Radius | Radius[]
|
|
@@ -2099,7 +2099,7 @@ export declare interface ResponsiveRadiusProps {
|
|
|
2099
2099
|
|
|
2100
2100
|
/**
|
|
2101
2101
|
* @public
|
|
2102
|
-
* @deprecated
|
|
2102
|
+
* @deprecated No longer used.
|
|
2103
2103
|
*/
|
|
2104
2104
|
export declare interface ResponsiveShadowProps {
|
|
2105
2105
|
shadow?: number | number[]
|
|
@@ -2107,7 +2107,7 @@ export declare interface ResponsiveShadowProps {
|
|
|
2107
2107
|
|
|
2108
2108
|
/**
|
|
2109
2109
|
* @public
|
|
2110
|
-
* @deprecated
|
|
2110
|
+
* @deprecated No longer used.
|
|
2111
2111
|
*/
|
|
2112
2112
|
export declare interface ResponsiveWidthProps {
|
|
2113
2113
|
width?: number | 'auto' | (number | 'auto')[]
|
package/dist/index.js
CHANGED
|
@@ -380,7 +380,7 @@ function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
|
380
380
|
}
|
|
381
381
|
const DEFAULT_DIALOG_CARD_ELEMENT = "div";
|
|
382
382
|
function DialogCard(props) {
|
|
383
|
-
const $ = c(
|
|
383
|
+
const $ = c(61), t0 = props;
|
|
384
384
|
let autoFocus, children, footer, forwardedContentRef, forwardedRef, header, hideCloseButton, id, onClickOutside, onClose, portalProp, rest, t1;
|
|
385
385
|
$[0] !== t0 ? ({
|
|
386
386
|
__unstable_autoFocus: autoFocus,
|
|
@@ -399,7 +399,7 @@ function DialogCard(props) {
|
|
|
399
399
|
} = t0, $[0] = t0, $[1] = autoFocus, $[2] = children, $[3] = footer, $[4] = forwardedContentRef, $[5] = forwardedRef, $[6] = header, $[7] = hideCloseButton, $[8] = id, $[9] = onClickOutside, $[10] = onClose, $[11] = portalProp, $[12] = rest, $[13] = t1) : (autoFocus = $[1], children = $[2], footer = $[3], forwardedContentRef = $[4], forwardedRef = $[5], header = $[6], hideCloseButton = $[7], id = $[8], onClickOutside = $[9], onClose = $[10], portalProp = $[11], rest = $[12], t1 = $[13]);
|
|
400
400
|
const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
|
|
401
401
|
isTopLayer
|
|
402
|
-
} = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton, [scrollTop, setScrollTop] = useState(0);
|
|
402
|
+
} = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton, [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), scrollBottom = scrollHeight - scrollTop;
|
|
403
403
|
let t2;
|
|
404
404
|
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], useImperativeHandle(forwardedRef, t2);
|
|
405
405
|
let t3;
|
|
@@ -428,7 +428,7 @@ function DialogCard(props) {
|
|
|
428
428
|
if (!el)
|
|
429
429
|
return;
|
|
430
430
|
const handleScroll = () => {
|
|
431
|
-
setScrollTop(el.scrollTop);
|
|
431
|
+
setScrollTop(el.scrollTop), setScrollHeight(el.scrollHeight - el.offsetHeight);
|
|
432
432
|
};
|
|
433
433
|
return el.addEventListener("scroll", handleScroll, {
|
|
434
434
|
passive: !0
|
|
@@ -454,21 +454,23 @@ function DialogCard(props) {
|
|
|
454
454
|
let t16;
|
|
455
455
|
$[44] !== children ? (t16 = /* @__PURE__ */ jsx(Box, { className: t15, overflow: "auto", ref: contentRef, children }), $[44] = children, $[45] = t16) : t16 = $[45];
|
|
456
456
|
let t17;
|
|
457
|
-
$[46] !== footer ? (t17 = footer && /* @__PURE__ */ jsx("div", { className: dialogScrollerShadowBottom()
|
|
457
|
+
$[46] !== footer || $[47] !== scrollBottom ? (t17 = footer && /* @__PURE__ */ jsx("div", { className: dialogScrollerShadowBottom(), style: {
|
|
458
|
+
opacity: Math.min(scrollBottom, 32) / 32
|
|
459
|
+
} }), $[46] = footer, $[47] = scrollBottom, $[48] = t17) : t17 = $[48];
|
|
458
460
|
let t18;
|
|
459
|
-
$[
|
|
461
|
+
$[49] !== t14 || $[50] !== t16 || $[51] !== t17 ? (t18 = /* @__PURE__ */ jsxs(Box, { className: t13, flex: 1, position: "relative", tabIndex: -1, children: [
|
|
460
462
|
t14,
|
|
461
463
|
t16,
|
|
462
464
|
t17
|
|
463
|
-
] }), $[
|
|
465
|
+
] }), $[49] = t14, $[50] = t16, $[51] = t17, $[52] = t18) : t18 = $[52];
|
|
464
466
|
let t19;
|
|
465
|
-
$[
|
|
467
|
+
$[53] !== footer ? (t19 = footer && /* @__PURE__ */ jsx(Box, { className: dialogFooter(), position: "relative", children: footer }), $[53] = footer, $[54] = t19) : t19 = $[54];
|
|
466
468
|
let t20;
|
|
467
|
-
return $[
|
|
469
|
+
return $[55] !== as || $[56] !== rest || $[57] !== t12 || $[58] !== t18 || $[59] !== t19 ? (t20 = /* @__PURE__ */ jsxs(Card, { ...rest, as, className: t11, display: "flex", flexDirection: "column", ref, children: [
|
|
468
470
|
t12,
|
|
469
471
|
t18,
|
|
470
472
|
t19
|
|
471
|
-
] }), $[
|
|
473
|
+
] }), $[55] = as, $[56] = rest, $[57] = t12, $[58] = t18, $[59] = t19, $[60] = t20) : t20 = $[60], t20;
|
|
472
474
|
}
|
|
473
475
|
const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
|
|
474
476
|
version: 0
|