@sanity/ui 3.0.0-static.45 → 3.0.0-static.47
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.cjs +41 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +41 -41
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/core/components/menu/menuItem.tsx +5 -4
- package/src/core/primitives/popover/popover.tsx +1 -0
- package/src/core/primitives/skeleton/skeleton.tsx +1 -2
package/dist/index.cjs
CHANGED
|
@@ -1131,7 +1131,7 @@ function Popover(props) {
|
|
|
1131
1131
|
modal && /* @__PURE__ */ jsxRuntime.jsx(ViewportOverlay, {}),
|
|
1132
1132
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverLayer, { ...rest, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, className: css.popover({
|
|
1133
1133
|
className
|
|
1134
|
-
}), hidden: referenceHidden, maxWidth: widthProp, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, x, y, zOffset, children: content2 })
|
|
1134
|
+
}), hidden: referenceHidden, maxWidth: widthProp, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, tone, strategy, x, y, zOffset, children: content2 })
|
|
1135
1135
|
] }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { tone: tone === "inherit" ? card.tone : tone, scheme: scheme ?? "light", children: node_1 }) }) : node_1);
|
|
1136
1136
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1137
1137
|
animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
|
|
@@ -2406,8 +2406,8 @@ function MenuGroup(props) {
|
|
|
2406
2406
|
}
|
|
2407
2407
|
const DEFAULT_MENU_ITEM_ELEMENT = "button";
|
|
2408
2408
|
function MenuItem(props) {
|
|
2409
|
-
const $ = compilerRuntime.c(
|
|
2410
|
-
let IconComponent, IconRightComponent, children, disabled, forwardedRef, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, rest, selectedProp, t1, t2, t3, t4, t5, t6, text;
|
|
2409
|
+
const $ = compilerRuntime.c(75), t0 = props;
|
|
2410
|
+
let IconComponent, IconRightComponent, children, disabled, forwardedRef, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, rest, selectedProp, t1, t2, t3, t4, t5, t6, t7, text;
|
|
2411
2411
|
$[0] !== t0 ? ({
|
|
2412
2412
|
as: t1,
|
|
2413
2413
|
children,
|
|
@@ -2430,29 +2430,30 @@ function MenuItem(props) {
|
|
|
2430
2430
|
pressed,
|
|
2431
2431
|
radius: t5,
|
|
2432
2432
|
ref: forwardedRef,
|
|
2433
|
+
role: t6,
|
|
2433
2434
|
selected: selectedProp,
|
|
2434
2435
|
text,
|
|
2435
|
-
tone:
|
|
2436
|
+
tone: t7,
|
|
2436
2437
|
...rest
|
|
2437
|
-
} = t0, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = forwardedRef, $[6] = gapX, $[7] = gapY, $[8] = hotkeys, $[9] = onClick, $[10] = paddingBottom, $[11] = paddingLeft, $[12] = paddingRight, $[13] = paddingTop, $[14] = paddingX, $[15] = paddingY, $[16] = pressed, $[17] = rest, $[18] = selectedProp, $[19] = t1, $[20] = t2, $[21] = t3, $[22] = t4, $[23] = t5, $[24] = t6, $[25] = text) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], forwardedRef = $[5], gapX = $[6], gapY = $[7], hotkeys = $[8], onClick = $[9], paddingBottom = $[10], paddingLeft = $[11], paddingRight = $[12], paddingTop = $[13], paddingX = $[14], paddingY = $[15], pressed = $[16], rest = $[17], selectedProp = $[18], t1 = $[19], t2 = $[20], t3 = $[21], t4 = $[22], t5 = $[23], t6 = $[24],
|
|
2438
|
-
const as = t1 === void 0 ? DEFAULT_MENU_ITEM_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, gap = t3 === void 0 ? 3 : t3, padding = t4 === void 0 ? 3 : t4, radius = t5 === void 0 ? 2 : t5,
|
|
2438
|
+
} = t0, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = forwardedRef, $[6] = gapX, $[7] = gapY, $[8] = hotkeys, $[9] = onClick, $[10] = paddingBottom, $[11] = paddingLeft, $[12] = paddingRight, $[13] = paddingTop, $[14] = paddingX, $[15] = paddingY, $[16] = pressed, $[17] = rest, $[18] = selectedProp, $[19] = t1, $[20] = t2, $[21] = t3, $[22] = t4, $[23] = t5, $[24] = t6, $[25] = t7, $[26] = text) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], forwardedRef = $[5], gapX = $[6], gapY = $[7], hotkeys = $[8], onClick = $[9], paddingBottom = $[10], paddingLeft = $[11], paddingRight = $[12], paddingTop = $[13], paddingX = $[14], paddingY = $[15], pressed = $[16], rest = $[17], selectedProp = $[18], t1 = $[19], t2 = $[20], t3 = $[21], t4 = $[22], t5 = $[23], t6 = $[24], t7 = $[25], text = $[26]);
|
|
2439
|
+
const as = t1 === void 0 ? DEFAULT_MENU_ITEM_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, gap = t3 === void 0 ? 3 : t3, padding = t4 === void 0 ? 3 : t4, radius = t5 === void 0 ? 2 : t5, role = t6 === void 0 ? "menuitem" : t6, tone = t7 === void 0 ? "default" : t7, menu = useMenu(), {
|
|
2439
2440
|
activeElement,
|
|
2440
2441
|
mount,
|
|
2441
2442
|
onItemClick,
|
|
2442
2443
|
onItemMouseEnter,
|
|
2443
2444
|
onItemMouseLeave
|
|
2444
2445
|
} = menu, [rootElement, setRootElement] = react.useState(null), active = !!activeElement && activeElement === rootElement, ref = react.useRef(null);
|
|
2445
|
-
let
|
|
2446
|
-
$[
|
|
2447
|
-
let
|
|
2448
|
-
$[
|
|
2449
|
-
let
|
|
2450
|
-
$[
|
|
2446
|
+
let t8;
|
|
2447
|
+
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[27] = t8) : t8 = $[27], react.useImperativeHandle(forwardedRef, t8);
|
|
2448
|
+
let t10, t9;
|
|
2449
|
+
$[28] !== mount || $[29] !== rootElement || $[30] !== selectedProp ? (t9 = () => mount(rootElement, selectedProp), t10 = [mount, rootElement, selectedProp], $[28] = mount, $[29] = rootElement, $[30] = selectedProp, $[31] = t10, $[32] = t9) : (t10 = $[31], t9 = $[32]), react.useEffect(t9, t10);
|
|
2450
|
+
let t11;
|
|
2451
|
+
$[33] !== disabled || $[34] !== onClick || $[35] !== onItemClick ? (t11 = (event) => {
|
|
2451
2452
|
disabled || (onClick && onClick(event), onItemClick && onItemClick());
|
|
2452
|
-
}, $[
|
|
2453
|
-
const handleClick =
|
|
2454
|
-
let
|
|
2455
|
-
$[
|
|
2453
|
+
}, $[33] = disabled, $[34] = onClick, $[35] = onItemClick, $[36] = t11) : t11 = $[36];
|
|
2454
|
+
const handleClick = t11;
|
|
2455
|
+
let t12, t13;
|
|
2456
|
+
$[37] !== padding || $[38] !== paddingBottom || $[39] !== paddingLeft || $[40] !== paddingRight || $[41] !== paddingTop || $[42] !== paddingX || $[43] !== paddingY ? (t13 = {
|
|
2456
2457
|
padding,
|
|
2457
2458
|
paddingX,
|
|
2458
2459
|
paddingY,
|
|
@@ -2460,15 +2461,15 @@ function MenuItem(props) {
|
|
|
2460
2461
|
paddingRight,
|
|
2461
2462
|
paddingBottom,
|
|
2462
2463
|
paddingLeft
|
|
2463
|
-
}, $[
|
|
2464
|
-
const paddingProps =
|
|
2465
|
-
let
|
|
2466
|
-
$[
|
|
2464
|
+
}, $[37] = padding, $[38] = paddingBottom, $[39] = paddingLeft, $[40] = paddingRight, $[41] = paddingTop, $[42] = paddingX, $[43] = paddingY, $[44] = t13) : t13 = $[44], t12 = t13;
|
|
2465
|
+
const paddingProps = t12;
|
|
2466
|
+
let t14;
|
|
2467
|
+
$[45] === Symbol.for("react.memo_cache_sentinel") ? (t14 = (el) => {
|
|
2467
2468
|
ref.current = el, setRootElement(el);
|
|
2468
|
-
}, $[
|
|
2469
|
-
const setRef =
|
|
2470
|
-
let
|
|
2471
|
-
$[
|
|
2469
|
+
}, $[45] = t14) : t14 = $[45];
|
|
2470
|
+
const setRef = t14, t15 = pressed ? "" : void 0, t16 = active ? "" : void 0, t17 = disabled ? "" : void 0, t18 = as === "button" ? "button" : void 0;
|
|
2471
|
+
let t19;
|
|
2472
|
+
$[46] !== IconComponent || $[47] !== IconRightComponent || $[48] !== fontSize || $[49] !== gap || $[50] !== gapX || $[51] !== gapY || $[52] !== hotkeys || $[53] !== paddingProps || $[54] !== text ? (t19 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap, gapX, gapY, align: "center", ...paddingProps, children: [
|
|
2472
2473
|
IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { muted: !0, size: fontSize, children: [
|
|
2473
2474
|
react.isValidElement(IconComponent) && IconComponent,
|
|
2474
2475
|
reactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
|
|
@@ -2482,14 +2483,14 @@ function MenuItem(props) {
|
|
|
2482
2483
|
react.isValidElement(IconRightComponent) && IconRightComponent,
|
|
2483
2484
|
reactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
|
|
2484
2485
|
] })
|
|
2485
|
-
] }), $[
|
|
2486
|
-
let t19;
|
|
2487
|
-
$[55] !== children || $[56] !== paddingProps ? (t19 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children }), $[55] = children, $[56] = paddingProps, $[57] = t19) : t19 = $[57];
|
|
2486
|
+
] }), $[46] = IconComponent, $[47] = IconRightComponent, $[48] = fontSize, $[49] = gap, $[50] = gapX, $[51] = gapY, $[52] = hotkeys, $[53] = paddingProps, $[54] = text, $[55] = t19) : t19 = $[55];
|
|
2488
2487
|
let t20;
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2488
|
+
$[56] !== children || $[57] !== paddingProps ? (t20 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children }), $[56] = children, $[57] = paddingProps, $[58] = t20) : t20 = $[58];
|
|
2489
|
+
let t21;
|
|
2490
|
+
return $[59] !== as || $[60] !== disabled || $[61] !== handleClick || $[62] !== onItemMouseEnter || $[63] !== onItemMouseLeave || $[64] !== radius || $[65] !== rest || $[66] !== role || $[67] !== t15 || $[68] !== t16 || $[69] !== t17 || $[70] !== t18 || $[71] !== t19 || $[72] !== t20 || $[73] !== tone ? (t21 = /* @__PURE__ */ jsxRuntime.jsxs(Selectable, { "data-ui": "MenuItem", ...rest, as, "data-pressed": t15, "data-selected": t16, "data-disabled": t17, radius, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role, tabIndex: -1, tone, type: t18, children: [
|
|
2491
|
+
t19,
|
|
2492
|
+
t20
|
|
2493
|
+
] }), $[59] = as, $[60] = disabled, $[61] = handleClick, $[62] = onItemMouseEnter, $[63] = onItemMouseLeave, $[64] = radius, $[65] = rest, $[66] = role, $[67] = t15, $[68] = t16, $[69] = t17, $[70] = t18, $[71] = t19, $[72] = t20, $[73] = tone, $[74] = t21) : t21 = $[74], t21;
|
|
2493
2494
|
}
|
|
2494
2495
|
const DEFAULT_TAB_ELEMENT = "button";
|
|
2495
2496
|
function Tab(props) {
|
|
@@ -3700,19 +3701,18 @@ function Select(props) {
|
|
|
3700
3701
|
}
|
|
3701
3702
|
const DEFAULT_SKELETON_ELEMENT = "div";
|
|
3702
3703
|
function Skeleton(props) {
|
|
3703
|
-
const $ = compilerRuntime.c(
|
|
3704
|
-
let className, delay,
|
|
3704
|
+
const $ = compilerRuntime.c(18), t0 = props;
|
|
3705
|
+
let className, delay, rest, t1, t2;
|
|
3705
3706
|
$[0] !== t0 ? ({
|
|
3706
3707
|
as: t1,
|
|
3707
3708
|
animated: t2,
|
|
3708
3709
|
className,
|
|
3709
3710
|
delay,
|
|
3710
|
-
radius,
|
|
3711
3711
|
...rest
|
|
3712
|
-
} = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] =
|
|
3712
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = rest, $[4] = t1, $[5] = t2) : (className = $[1], delay = $[2], rest = $[3], t1 = $[4], t2 = $[5]);
|
|
3713
3713
|
const As = t1 === void 0 ? DEFAULT_SKELETON_ELEMENT : t1, animated = t2 === void 0 ? !1 : t2, [visible, setVisible] = react.useState(!delay);
|
|
3714
3714
|
let t3, t4;
|
|
3715
|
-
$[
|
|
3715
|
+
$[6] !== delay ? (t3 = () => {
|
|
3716
3716
|
if (!delay)
|
|
3717
3717
|
return setVisible(!0);
|
|
3718
3718
|
const timeout = setTimeout(() => {
|
|
@@ -3721,15 +3721,15 @@ function Skeleton(props) {
|
|
|
3721
3721
|
return () => {
|
|
3722
3722
|
clearTimeout(timeout);
|
|
3723
3723
|
};
|
|
3724
|
-
}, t4 = [delay], $[
|
|
3724
|
+
}, t4 = [delay], $[6] = delay, $[7] = t3, $[8] = t4) : (t3 = $[7], t4 = $[8]), react.useEffect(t3, t4);
|
|
3725
3725
|
let t5;
|
|
3726
|
-
$[
|
|
3726
|
+
$[9] !== className || $[10] !== rest ? (t5 = css.skeleton({
|
|
3727
3727
|
className,
|
|
3728
|
-
|
|
3729
|
-
}), $[
|
|
3728
|
+
...rest
|
|
3729
|
+
}), $[9] = className, $[10] = rest, $[11] = t5) : t5 = $[11];
|
|
3730
3730
|
const t6 = animated ? "" : void 0, t7 = visible ? "" : void 0;
|
|
3731
3731
|
let t8;
|
|
3732
|
-
return $[
|
|
3732
|
+
return $[12] !== As || $[13] !== rest || $[14] !== t5 || $[15] !== t6 || $[16] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(As, { "data-ui": "Skeleton", ...rest, className: t5, "data-animated": t6, "data-visible": t7 }), $[12] = As, $[13] = rest, $[14] = t5, $[15] = t6, $[16] = t7, $[17] = t8) : t8 = $[17], t8;
|
|
3733
3733
|
}
|
|
3734
3734
|
const DEFAULT_CODE_SKELETON_ELEMENT = "div";
|
|
3735
3735
|
function CodeSkeleton(props) {
|