@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/css/index.css +1 -1
- package/dist/css/index.css.map +1 -1
- package/dist/index.js +57 -53
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/core/components/menu/MenuItem.tsx +0 -2
- package/src/core/components/menu/__workshop__/DataProps.tsx +27 -0
- package/src/core/components/menu/__workshop__/index.ts +6 -1
- package/src/core/primitives/button/Button.tsx +2 -2
- package/src/core/primitives/button/__workshop__/DataProps.tsx +22 -0
- package/src/core/primitives/button/__workshop__/index.ts +5 -0
- package/src/core/primitives/card/Card.tsx +4 -4
- package/src/core/primitives/card/__workshop__/DataProps.tsx +30 -0
- package/src/core/primitives/card/__workshop__/index.ts +1 -0
- package/src/core/primitives/selectable/Selectable.tsx +1 -1
- package/src/core/primitives/selectable/__workshop__/DataProps.tsx +27 -0
- package/src/core/primitives/selectable/__workshop__/index.ts +14 -0
- package/src/css/primitives/_input/_input.css.ts +6 -5
- package/src/css/primitives/box/box.css.ts +0 -2
- package/src/css/primitives/button/button.css.ts +251 -183
- package/src/css/primitives/card/card.css.ts +136 -80
- package/src/css/primitives/selectable/selectable.css.ts +79 -44
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 ? "" :
|
|
406
|
-
"data-selected": selected ? "" :
|
|
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 ? "" :
|
|
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 ? "" :
|
|
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(
|
|
2414
|
-
let IconComponent, IconRightComponent, children, disabled, forwardedRef, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY,
|
|
2415
|
-
$[0] !== t0
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
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
|
-
$[
|
|
2455
|
+
$[26] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[26] = t8) : t8 = $[26], useImperativeHandle(forwardedRef, t8);
|
|
2452
2456
|
let t10, t9;
|
|
2453
|
-
$[
|
|
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
|
-
$[
|
|
2459
|
+
$[32] !== disabled || $[33] !== onClick || $[34] !== onItemClick ? (t11 = (event) => {
|
|
2456
2460
|
disabled || (onClick && onClick(event), onItemClick && onItemClick(event));
|
|
2457
|
-
}, $[
|
|
2461
|
+
}, $[32] = disabled, $[33] = onClick, $[34] = onItemClick, $[35] = t11) : t11 = $[35];
|
|
2458
2462
|
const handleClick = t11;
|
|
2459
2463
|
let t12;
|
|
2460
|
-
$[
|
|
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
|
-
}, $[
|
|
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
|
-
$[
|
|
2475
|
+
$[44] === Symbol.for("react.memo_cache_sentinel") ? (t13 = (el) => {
|
|
2472
2476
|
ref.current = el, setRootElement(el);
|
|
2473
|
-
}, $[
|
|
2474
|
-
const setRef = t13, t14 =
|
|
2475
|
-
let
|
|
2476
|
-
$[
|
|
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
|
-
] }), $[
|
|
2491
|
-
let
|
|
2492
|
-
$[
|
|
2493
|
-
let
|
|
2494
|
-
return $[
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
] }), $[
|
|
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) {
|