@sanity/ui 2.3.6-canary.5 → 2.3.6-canary.6
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.compiled.mjs +36 -25
- package/dist/index.compiled.mjs.map +1 -1
- package/dist/index.esm.js +12 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/primitives/popover/popover.tsx +18 -16
package/dist/index.compiled.mjs
CHANGED
|
@@ -3974,11 +3974,11 @@ const MotionCard$1 = styled(motion(Card))`
|
|
|
3974
3974
|
PopoverCard.displayName = "PopoverCard";
|
|
3975
3975
|
const Popover = memo(forwardRef(function(props, forwardedRef) {
|
|
3976
3976
|
var _a, _b, _c2, _d, _e, _f, _g, _h, _i;
|
|
3977
|
-
const $ = c(
|
|
3977
|
+
const $ = c(100), {
|
|
3978
3978
|
container,
|
|
3979
3979
|
layer
|
|
3980
3980
|
} = useTheme_v2(), boundaryElementContext = useBoundaryElement();
|
|
3981
|
-
let t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, _boundaryElement, _referenceBoundary, _floatingBoundary, _fallbackPlacements, _zOffset, paddingProp, open, matchReferenceWidth, updateRef,
|
|
3981
|
+
let t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, _boundaryElement, _referenceBoundary, _floatingBoundary, _fallbackPlacements, _zOffset, paddingProp, open, matchReferenceWidth, updateRef, _children, referenceElement, disabled, restProps, scheme, content, portal;
|
|
3982
3982
|
if ($[0] !== props) {
|
|
3983
3983
|
const {
|
|
3984
3984
|
__unstable_margins: t112,
|
|
@@ -4010,9 +4010,9 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
|
|
|
4010
4010
|
updateRef: t362,
|
|
4011
4011
|
...t37
|
|
4012
4012
|
} = props;
|
|
4013
|
-
t0 = t112, t1 = t122, t2 = t132, _boundaryElement = t142,
|
|
4013
|
+
t0 = t112, t1 = t122, t2 = t132, _boundaryElement = t142, _children = t152, t3 = t162, content = t172, disabled = t182, _fallbackPlacements = t192, matchReferenceWidth = t202, _floatingBoundary = t212, open = t222, t4 = t232, paddingProp = t242, t5 = t252, portal = t262, t6 = t272, t7 = t282, _referenceBoundary = t292, referenceElement = t302, scheme = t312, t8 = t322, t9 = t332, t10 = t342, _zOffset = t352, updateRef = t362, restProps = t37, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = t6, $[8] = t7, $[9] = t8, $[10] = t9, $[11] = t10, $[12] = _boundaryElement, $[13] = _referenceBoundary, $[14] = _floatingBoundary, $[15] = _fallbackPlacements, $[16] = _zOffset, $[17] = paddingProp, $[18] = open, $[19] = matchReferenceWidth, $[20] = updateRef, $[21] = _children, $[22] = referenceElement, $[23] = disabled, $[24] = restProps, $[25] = scheme, $[26] = content, $[27] = portal;
|
|
4014
4014
|
} else
|
|
4015
|
-
t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], t6 = $[7], t7 = $[8], t8 = $[9], t9 = $[10], t10 = $[11], _boundaryElement = $[12], _referenceBoundary = $[13], _floatingBoundary = $[14], _fallbackPlacements = $[15], _zOffset = $[16], paddingProp = $[17], open = $[18], matchReferenceWidth = $[19], updateRef = $[20],
|
|
4015
|
+
t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], t6 = $[7], t7 = $[8], t8 = $[9], t9 = $[10], t10 = $[11], _boundaryElement = $[12], _referenceBoundary = $[13], _floatingBoundary = $[14], _fallbackPlacements = $[15], _zOffset = $[16], paddingProp = $[17], open = $[18], matchReferenceWidth = $[19], updateRef = $[20], _children = $[21], referenceElement = $[22], disabled = $[23], restProps = $[24], scheme = $[25], content = $[26], portal = $[27];
|
|
4016
4016
|
const margins = t0 === void 0 ? DEFAULT_POPOVER_MARGINS : t0, _animate = t1 === void 0 ? !1 : t1, arrowProp = t2 === void 0 ? !1 : t2, constrainSize = t3 === void 0 ? !1 : t3, overflow = t4 === void 0 ? "hidden" : t4, placementProp = t5 === void 0 ? "bottom" : t5, preventOverflow = t6 === void 0 ? !0 : t6, radiusProp = t7 === void 0 ? 3 : t7, shadowProp = t8 === void 0 ? 3 : t8, tone = t9 === void 0 ? "inherit" : t9, widthProp = t10 === void 0 ? "auto" : t10, boundaryElement = _boundaryElement != null ? _boundaryElement : boundaryElementContext.element, referenceBoundary = (_a = _referenceBoundary != null ? _referenceBoundary : props.boundaryElement) != null ? _a : boundaryElementContext.element, floatingBoundary = (_b = _floatingBoundary != null ? _floatingBoundary : props.boundaryElement) != null ? _b : boundaryElementContext.element, fallbackPlacements = _fallbackPlacements != null ? _fallbackPlacements : DEFAULT_FALLBACK_PLACEMENTS$1[(_c2 = props.placement) != null ? _c2 : "bottom"], zOffsetProp = _zOffset != null ? _zOffset : layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = (_d = useElementSize(boundaryElement)) == null ? void 0 : _d.border;
|
|
4017
4017
|
let t11, t12;
|
|
4018
4018
|
$[28] !== paddingProp ? (t12 = _getArrayProp(paddingProp), $[28] = paddingProp, $[29] = t12) : t12 = $[29], t11 = t12;
|
|
@@ -4129,34 +4129,45 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
|
|
|
4129
4129
|
let t26, t27;
|
|
4130
4130
|
$[48] !== update ? (t26 = () => update, t27 = [update], $[48] = update, $[49] = t26, $[50] = t27) : (t26 = $[49], t27 = $[50]), useImperativeHandle(updateRef, t26, t27);
|
|
4131
4131
|
let t28, t29;
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
}, t29 = [
|
|
4135
|
-
let t302;
|
|
4136
|
-
return $[56] !== children ? (t302 = children || /* @__PURE__ */ jsx(Fragment, {}), $[56] = children, $[57] = t302) : t302 = $[57], t302;
|
|
4137
|
-
}
|
|
4132
|
+
$[51] !== _children || $[52] !== refs || $[53] !== referenceElement ? (t28 = () => {
|
|
4133
|
+
_children || refs.setReference(referenceElement || null);
|
|
4134
|
+
}, t29 = [_children, referenceElement, refs], $[51] = _children, $[52] = refs, $[53] = referenceElement, $[54] = t28, $[55] = t29) : (t28 = $[54], t29 = $[55]), useEffect(t28, t29);
|
|
4138
4135
|
let t30;
|
|
4139
|
-
|
|
4136
|
+
bb0: {
|
|
4137
|
+
if (!_children || referenceElement) {
|
|
4138
|
+
t30 = null;
|
|
4139
|
+
break bb0;
|
|
4140
|
+
}
|
|
4141
|
+
let t312;
|
|
4142
|
+
$[56] !== refs ? (t312 = (node_0) => {
|
|
4143
|
+
logDeprecatedWarning(), refs.setReference(node_0);
|
|
4144
|
+
}, $[56] = refs, $[57] = t312) : t312 = $[57];
|
|
4145
|
+
let t322;
|
|
4146
|
+
$[58] !== t312 || $[59] !== _children ? (t322 = cloneElement(_children, {
|
|
4147
|
+
ref: t312
|
|
4148
|
+
}), $[58] = t312, $[59] = _children, $[60] = t322) : t322 = $[60], t30 = t322;
|
|
4149
|
+
}
|
|
4150
|
+
const children = t30;
|
|
4151
|
+
if (disabled) {
|
|
4152
|
+
let t312;
|
|
4153
|
+
return $[61] !== _children ? (t312 = _children || /* @__PURE__ */ jsx(Fragment, {}), $[61] = _children, $[62] = t312) : t312 = $[62], t312;
|
|
4154
|
+
}
|
|
4140
4155
|
let t31;
|
|
4141
|
-
$[81] !==
|
|
4142
|
-
const popover = t31;
|
|
4156
|
+
$[63] !== restProps || $[64] !== margins || $[65] !== animate || $[66] !== arrowProp || $[67] !== setArrow || $[68] !== arrowX || $[69] !== arrowY || $[70] !== referenceHidden || $[71] !== overflow || $[72] !== padding || $[73] !== placement || $[74] !== radius || $[75] !== setFloating || $[76] !== scheme || $[77] !== shadow || $[78] !== originX || $[79] !== originY || $[80] !== strategy || $[81] !== tone || $[82] !== x || $[83] !== y || $[84] !== content ? (t31 = /* @__PURE__ */ jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, width: matchReferenceWidth ? referenceWidthRef.current : width, x, y, children: content }), $[63] = restProps, $[64] = margins, $[65] = animate, $[66] = arrowProp, $[67] = setArrow, $[68] = arrowX, $[69] = arrowY, $[70] = referenceHidden, $[71] = overflow, $[72] = padding, $[73] = placement, $[74] = radius, $[75] = setFloating, $[76] = scheme, $[77] = shadow, $[78] = originX, $[79] = originY, $[80] = strategy, $[81] = tone, $[82] = x, $[83] = y, $[84] = content, $[85] = t31) : t31 = $[85];
|
|
4143
4157
|
let t32;
|
|
4144
|
-
$[
|
|
4158
|
+
$[86] !== zOffset || $[87] !== t31 ? (t32 = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: t31 }), $[86] = zOffset, $[87] = t31, $[88] = t32) : t32 = $[88];
|
|
4159
|
+
const popover = t32;
|
|
4145
4160
|
let t33;
|
|
4146
|
-
$[
|
|
4161
|
+
$[89] === Symbol.for("react.memo_cache_sentinel") ? (t33 = (children_0) => /* @__PURE__ */ jsx(AnimatePresence, { children: children_0 }), $[89] = t33) : t33 = $[89];
|
|
4147
4162
|
let t34;
|
|
4148
|
-
$[
|
|
4163
|
+
$[90] !== open || $[91] !== portal || $[92] !== popover ? (t34 = open && /* @__PURE__ */ jsx(ConditionalWrapper, { condition: !!portal, wrapper: (children_1) => /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: children_1 }), children: popover }), $[90] = open, $[91] = portal, $[92] = popover, $[93] = t34) : t34 = $[93];
|
|
4149
4164
|
let t35;
|
|
4150
|
-
$[
|
|
4151
|
-
logDeprecatedWarning(), refs.setReference(node_0);
|
|
4152
|
-
}, style: {
|
|
4153
|
-
display: "contents"
|
|
4154
|
-
}, children }), $[92] = children, $[93] = referenceElement, $[94] = refs, $[95] = t35) : t35 = $[95];
|
|
4165
|
+
$[94] !== animate || $[95] !== t34 ? (t35 = /* @__PURE__ */ jsx(ConditionalWrapper, { condition: animate, wrapper: t33, children: t34 }), $[94] = animate, $[95] = t34, $[96] = t35) : t35 = $[96];
|
|
4155
4166
|
let t36;
|
|
4156
|
-
return $[
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
] }), $[
|
|
4167
|
+
return $[97] !== t35 || $[98] !== children ? (t36 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4168
|
+
t35,
|
|
4169
|
+
children
|
|
4170
|
+
] }), $[97] = t35, $[98] = children, $[99] = t36) : t36 = $[99], t36;
|
|
4160
4171
|
}));
|
|
4161
4172
|
Popover.displayName = "Popover";
|
|
4162
4173
|
let didWarn = !1;
|