@sanity/ui 4.0.0-static.26 → 4.0.0-static.27

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.js CHANGED
@@ -402,8 +402,8 @@ function Button(props) {
402
402
  tone,
403
403
  width
404
404
  }),
405
- "data-disabled": loading || disabled ? "" : void 0,
406
- "data-selected": selected ? "" : void 0,
405
+ "data-disabled": loading || disabled ? "" : props["data-disabled"],
406
+ "data-selected": selected ? "" : props["data-selected"],
407
407
  disabled: !!(loading || disabled),
408
408
  href: disabled ? void 0 : href,
409
409
  type,
@@ -773,7 +773,7 @@ function Card(props) {
773
773
  scheme: t6,
774
774
  tone
775
775
  }), $[12] = className, $[13] = t6, $[14] = tone, $[15] = t7) : t7 = $[15];
776
- const t8 = checkered ? "" : void 0, t9 = props.disabled ? "" : void 0, t10 = focusRing ? "" : void 0, t11 = pressed ? "" : void 0, t12 = selected ? "" : void 0;
776
+ const t8 = checkered ? "" : void 0, t9 = props.disabled ? "" : props["data-disabled"], t10 = focusRing ? "" : props["data-focus-ring"], t11 = pressed ? "" : props["data-pressed"], t12 = selected ? "" : props["data-selected"];
777
777
  let t13;
778
778
  $[16] !== as || $[17] !== radius || $[18] !== rest || $[19] !== style || $[20] !== t10 || $[21] !== t11 || $[22] !== t12 || $[23] !== t7 || $[24] !== t8 || $[25] !== t9 ? (t13 = /* @__PURE__ */ jsx(Box, { "data-ui": "Card", ...rest, as, className: t7, "data-checkered": t8, "data-disabled": t9, "data-focus-ring": t10, "data-pressed": t11, "data-selected": t12, radius, style }), $[16] = as, $[17] = radius, $[18] = rest, $[19] = style, $[20] = t10, $[21] = t11, $[22] = t12, $[23] = t7, $[24] = t8, $[25] = t9, $[26] = t13) : t13 = $[26];
779
779
  let node = t13;
@@ -1166,7 +1166,7 @@ function Selectable(props) {
1166
1166
  radius,
1167
1167
  tone
1168
1168
  }), $[7] = className, $[8] = radius, $[9] = tone, $[10] = t2) : t2 = $[10];
1169
- const t3 = selected ? "" : void 0;
1169
+ const t3 = selected ? "" : props["data-selected"];
1170
1170
  let t4;
1171
1171
  return $[11] !== as || $[12] !== rest || $[13] !== t2 || $[14] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { ...rest, as, className: t2, "data-selected": t3 }), $[11] = as, $[12] = rest, $[13] = t2, $[14] = t3, $[15] = t4) : t4 = $[15], t4;
1172
1172
  }
@@ -2410,36 +2410,40 @@ function MenuGroup(props) {
2410
2410
  }
2411
2411
  const DEFAULT_MENU_ITEM_ELEMENT = "button";
2412
2412
  function MenuItem(props) {
2413
- const $ = c(75), t0 = props;
2414
- 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, text2;
2415
- $[0] !== t0 ? ({
2416
- as: t1,
2417
- children,
2418
- disabled,
2419
- fontSize: t2,
2420
- gap: t3,
2421
- gapX,
2422
- gapY,
2423
- hotkeys,
2424
- icon: IconComponent,
2425
- iconRight: IconRightComponent,
2426
- onClick,
2427
- padding: t4,
2428
- paddingX,
2429
- paddingY,
2430
- paddingTop,
2431
- paddingRight,
2432
- paddingBottom,
2433
- paddingLeft,
2434
- pressed,
2435
- radius: t5,
2436
- ref: forwardedRef,
2437
- role: t6,
2438
- selected: selectedProp,
2439
- text: text2,
2440
- tone: t7,
2441
- ...rest
2442
- } = 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] = text2) : (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], text2 = $[26]);
2413
+ const $ = c(72), t0 = props;
2414
+ let IconComponent, IconRightComponent, children, disabled, forwardedRef, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, rest, selectedProp, t1, t2, t3, t4, t5, t6, t7, text2;
2415
+ if ($[0] !== t0) {
2416
+ const {
2417
+ as: t82,
2418
+ children: t92,
2419
+ disabled: t102,
2420
+ fontSize: t112,
2421
+ gap: t122,
2422
+ gapX: t132,
2423
+ gapY: t142,
2424
+ hotkeys: t152,
2425
+ icon: t162,
2426
+ iconRight: t172,
2427
+ onClick: t18,
2428
+ padding: t19,
2429
+ paddingX: t20,
2430
+ paddingY: t21,
2431
+ paddingTop: t22,
2432
+ paddingRight: t23,
2433
+ paddingBottom: t24,
2434
+ paddingLeft: t25,
2435
+ pressed,
2436
+ radius: t26,
2437
+ ref: t27,
2438
+ role: t28,
2439
+ selected: t29,
2440
+ text: t30,
2441
+ tone: t31,
2442
+ ...t32
2443
+ } = t0;
2444
+ t1 = t82, children = t92, disabled = t102, t2 = t112, t3 = t122, gapX = t132, gapY = t142, hotkeys = t152, IconComponent = t162, IconRightComponent = t172, onClick = t18, t4 = t19, paddingX = t20, paddingY = t21, paddingTop = t22, paddingRight = t23, paddingBottom = t24, paddingLeft = t25, t5 = t26, forwardedRef = t27, t6 = t28, selectedProp = t29, text2 = t30, t7 = t31, rest = t32, $[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] = rest, $[17] = selectedProp, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4, $[22] = t5, $[23] = t6, $[24] = t7, $[25] = text2;
2445
+ } else
2446
+ 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], rest = $[16], selectedProp = $[17], t1 = $[18], t2 = $[19], t3 = $[20], t4 = $[21], t5 = $[22], t6 = $[23], t7 = $[24], text2 = $[25];
2443
2447
  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, menu2 = useMenu(), {
2444
2448
  activeElement,
2445
2449
  mount,
@@ -2448,16 +2452,16 @@ function MenuItem(props) {
2448
2452
  onItemMouseLeave
2449
2453
  } = menu2, [rootElement, setRootElement] = useState(null), active = !!activeElement && activeElement === rootElement, ref = useRef(null);
2450
2454
  let t8;
2451
- $[27] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[27] = t8) : t8 = $[27], useImperativeHandle(forwardedRef, t8);
2455
+ $[26] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[26] = t8) : t8 = $[26], useImperativeHandle(forwardedRef, t8);
2452
2456
  let t10, t9;
2453
- $[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]), useEffect(t9, t10);
2457
+ $[27] !== mount || $[28] !== rootElement || $[29] !== selectedProp ? (t9 = () => mount(rootElement, selectedProp), t10 = [mount, rootElement, selectedProp], $[27] = mount, $[28] = rootElement, $[29] = selectedProp, $[30] = t10, $[31] = t9) : (t10 = $[30], t9 = $[31]), useEffect(t9, t10);
2454
2458
  let t11;
2455
- $[33] !== disabled || $[34] !== onClick || $[35] !== onItemClick ? (t11 = (event) => {
2459
+ $[32] !== disabled || $[33] !== onClick || $[34] !== onItemClick ? (t11 = (event) => {
2456
2460
  disabled || (onClick && onClick(event), onItemClick && onItemClick(event));
2457
- }, $[33] = disabled, $[34] = onClick, $[35] = onItemClick, $[36] = t11) : t11 = $[36];
2461
+ }, $[32] = disabled, $[33] = onClick, $[34] = onItemClick, $[35] = t11) : t11 = $[35];
2458
2462
  const handleClick = t11;
2459
2463
  let t12;
2460
- $[37] !== padding || $[38] !== paddingBottom || $[39] !== paddingLeft || $[40] !== paddingRight || $[41] !== paddingTop || $[42] !== paddingX || $[43] !== paddingY ? (t12 = {
2464
+ $[36] !== padding || $[37] !== paddingBottom || $[38] !== paddingLeft || $[39] !== paddingRight || $[40] !== paddingTop || $[41] !== paddingX || $[42] !== paddingY ? (t12 = {
2461
2465
  padding,
2462
2466
  paddingX,
2463
2467
  paddingY,
@@ -2465,15 +2469,15 @@ function MenuItem(props) {
2465
2469
  paddingRight,
2466
2470
  paddingBottom,
2467
2471
  paddingLeft
2468
- }, $[37] = padding, $[38] = paddingBottom, $[39] = paddingLeft, $[40] = paddingRight, $[41] = paddingTop, $[42] = paddingX, $[43] = paddingY, $[44] = t12) : t12 = $[44];
2472
+ }, $[36] = padding, $[37] = paddingBottom, $[38] = paddingLeft, $[39] = paddingRight, $[40] = paddingTop, $[41] = paddingX, $[42] = paddingY, $[43] = t12) : t12 = $[43];
2469
2473
  const paddingProps = t12;
2470
2474
  let t13;
2471
- $[45] === Symbol.for("react.memo_cache_sentinel") ? (t13 = (el) => {
2475
+ $[44] === Symbol.for("react.memo_cache_sentinel") ? (t13 = (el) => {
2472
2476
  ref.current = el, setRootElement(el);
2473
- }, $[45] = t13) : t13 = $[45];
2474
- const setRef = t13, t14 = pressed ? "" : void 0, t15 = disabled ? "" : void 0, t16 = as === "button" ? "button" : void 0;
2475
- let t17;
2476
- $[46] !== IconComponent || $[47] !== IconRightComponent || $[48] !== fontSize || $[49] !== gap || $[50] !== gapX || $[51] !== gapY || $[52] !== hotkeys || $[53] !== paddingProps || $[54] !== text2 ? (t17 = (IconComponent || text2 || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap, gapX, gapY, align: "center", ...paddingProps, children: [
2477
+ }, $[44] = t13) : t13 = $[44];
2478
+ const setRef = t13, t14 = as === "button" ? "button" : void 0;
2479
+ let t15;
2480
+ $[45] !== IconComponent || $[46] !== IconRightComponent || $[47] !== fontSize || $[48] !== gap || $[49] !== gapX || $[50] !== gapY || $[51] !== hotkeys || $[52] !== paddingProps || $[53] !== text2 ? (t15 = (IconComponent || text2 || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap, gapX, gapY, align: "center", ...paddingProps, children: [
2477
2481
  IconComponent && /* @__PURE__ */ jsxs(Text, { muted: !0, size: fontSize, children: [
2478
2482
  isValidElement(IconComponent) && IconComponent,
2479
2483
  isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
@@ -2487,14 +2491,14 @@ function MenuItem(props) {
2487
2491
  isValidElement(IconRightComponent) && IconRightComponent,
2488
2492
  isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
2489
2493
  ] })
2490
- ] }), $[46] = IconComponent, $[47] = IconRightComponent, $[48] = fontSize, $[49] = gap, $[50] = gapX, $[51] = gapY, $[52] = hotkeys, $[53] = paddingProps, $[54] = text2, $[55] = t17) : t17 = $[55];
2491
- let t18;
2492
- $[56] !== children || $[57] !== paddingProps ? (t18 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[56] = children, $[57] = paddingProps, $[58] = t18) : t18 = $[58];
2493
- let t19;
2494
- return $[59] !== active || $[60] !== as || $[61] !== disabled || $[62] !== handleClick || $[63] !== onItemMouseEnter || $[64] !== onItemMouseLeave || $[65] !== radius || $[66] !== rest || $[67] !== role || $[68] !== t14 || $[69] !== t15 || $[70] !== t16 || $[71] !== t17 || $[72] !== t18 || $[73] !== tone ? (t19 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", ...rest, as, "data-pressed": t14, "data-disabled": t15, radius, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role, selected: active, tabIndex: -1, tone, type: t16, children: [
2495
- t17,
2496
- t18
2497
- ] }), $[59] = active, $[60] = as, $[61] = disabled, $[62] = handleClick, $[63] = onItemMouseEnter, $[64] = onItemMouseLeave, $[65] = radius, $[66] = rest, $[67] = role, $[68] = t14, $[69] = t15, $[70] = t16, $[71] = t17, $[72] = t18, $[73] = tone, $[74] = t19) : t19 = $[74], t19;
2494
+ ] }), $[45] = IconComponent, $[46] = IconRightComponent, $[47] = fontSize, $[48] = gap, $[49] = gapX, $[50] = gapY, $[51] = hotkeys, $[52] = paddingProps, $[53] = text2, $[54] = t15) : t15 = $[54];
2495
+ let t16;
2496
+ $[55] !== children || $[56] !== paddingProps ? (t16 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[55] = children, $[56] = paddingProps, $[57] = t16) : t16 = $[57];
2497
+ let t17;
2498
+ return $[58] !== active || $[59] !== as || $[60] !== disabled || $[61] !== handleClick || $[62] !== onItemMouseEnter || $[63] !== onItemMouseLeave || $[64] !== radius || $[65] !== rest || $[66] !== role || $[67] !== t14 || $[68] !== t15 || $[69] !== t16 || $[70] !== tone ? (t17 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", ...rest, as, radius, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role, selected: active, tabIndex: -1, tone, type: t14, children: [
2499
+ t15,
2500
+ t16
2501
+ ] }), $[58] = active, $[59] = as, $[60] = disabled, $[61] = handleClick, $[62] = onItemMouseEnter, $[63] = onItemMouseLeave, $[64] = radius, $[65] = rest, $[66] = role, $[67] = t14, $[68] = t15, $[69] = t16, $[70] = tone, $[71] = t17) : t17 = $[71], t17;
2498
2502
  }
2499
2503
  const DEFAULT_TAB_ELEMENT = "button";
2500
2504
  function Tab(props) {