@sanity/ui 2.9.0-canary.2 → 2.9.0-canary.3
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.esm.js +35 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +35 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +35 -47
- package/src/core/constants.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -5342,26 +5342,46 @@ const Autocomplete = InnerAutocomplete, Root$8 = styledComponents.styled.ol`
|
|
|
5342
5342
|
appearance: none;
|
|
5343
5343
|
margin: -4px;
|
|
5344
5344
|
`, Breadcrumbs = react.forwardRef(function(props, ref) {
|
|
5345
|
-
const
|
|
5345
|
+
const $ = reactCompilerRuntime.c(37);
|
|
5346
|
+
let t0, children, maxLength, restProps, separator;
|
|
5347
|
+
$[0] !== props ? ({
|
|
5346
5348
|
children,
|
|
5347
5349
|
maxLength,
|
|
5348
5350
|
separator,
|
|
5349
|
-
space:
|
|
5351
|
+
space: t0,
|
|
5350
5352
|
...restProps
|
|
5351
|
-
} = props,
|
|
5352
|
-
|
|
5353
|
-
|
|
5353
|
+
} = props, $[0] = props, $[1] = t0, $[2] = children, $[3] = maxLength, $[4] = restProps, $[5] = separator) : (t0 = $[1], children = $[2], maxLength = $[3], restProps = $[4], separator = $[5]);
|
|
5354
|
+
const space = useArrayProp(t0 === void 0 ? 2 : t0), [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null);
|
|
5355
|
+
let t1;
|
|
5356
|
+
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => setOpen(!1), $[6] = t1) : t1 = $[6];
|
|
5357
|
+
const collapse = t1;
|
|
5358
|
+
let t2;
|
|
5359
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => setOpen(!0), $[7] = t2) : t2 = $[7];
|
|
5360
|
+
const expand = t2;
|
|
5361
|
+
let t3;
|
|
5362
|
+
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => [expandElementRef.current, popoverElementRef.current], $[8] = t3) : t3 = $[8], useClickOutsideEvent(collapse, t3);
|
|
5363
|
+
let T0, t4, t5, t6, t7;
|
|
5364
|
+
if ($[9] !== children || $[10] !== maxLength || $[11] !== space || $[12] !== open || $[13] !== restProps || $[14] !== ref || $[15] !== separator) {
|
|
5365
|
+
const rawItems = react.Children.toArray(children).filter(react.isValidElement);
|
|
5366
|
+
let items = rawItems;
|
|
5354
5367
|
const len = rawItems.length;
|
|
5355
|
-
if (maxLength &&
|
|
5356
|
-
const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5368
|
+
if (maxLength && rawItems.length > maxLength) {
|
|
5369
|
+
const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2), t83 = /* @__PURE__ */ jsxRuntime.jsx(Stack, { as: "ol", overflow: "auto", padding: space, space, children: rawItems.slice(beforeLength - 1, len - afterLength) }), t9 = open ? collapse : expand;
|
|
5370
|
+
let t10;
|
|
5371
|
+
$[21] !== t9 || $[22] !== open ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: t9, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }), $[21] = t9, $[22] = open, $[23] = t10) : t10 = $[23];
|
|
5372
|
+
let t11;
|
|
5373
|
+
$[24] !== t83 || $[25] !== open || $[26] !== t10 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { constrainSize: !0, content: t83, open, placement: "top", portal: !0, ref: popoverElementRef, children: t10 }, "button"), $[24] = t83, $[25] = open, $[26] = t10, $[27] = t11) : t11 = $[27], items = [...rawItems.slice(0, beforeLength - 1), t11, ...rawItems.slice(len - afterLength)];
|
|
5374
|
+
}
|
|
5375
|
+
T0 = Root$8, t4 = "Breadcrumbs", t5 = restProps, t6 = ref;
|
|
5376
|
+
let t82;
|
|
5377
|
+
$[28] !== space || $[29] !== separator ? (t82 = (item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
5378
|
+
itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsxRuntime.jsx(Text, { muted: !0, children: "/" }) }),
|
|
5379
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "li", children: item })
|
|
5380
|
+
] }, itemIndex), $[28] = space, $[29] = separator, $[30] = t82) : t82 = $[30], t7 = items.map(t82), $[9] = children, $[10] = maxLength, $[11] = space, $[12] = open, $[13] = restProps, $[14] = ref, $[15] = separator, $[16] = T0, $[17] = t4, $[18] = t5, $[19] = t6, $[20] = t7;
|
|
5381
|
+
} else
|
|
5382
|
+
T0 = $[16], t4 = $[17], t5 = $[18], t6 = $[19], t7 = $[20];
|
|
5383
|
+
let t8;
|
|
5384
|
+
return $[31] !== T0 || $[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(T0, { "data-ui": t4, ...t5, ref: t6, children: t7 }), $[31] = T0, $[32] = t4, $[33] = t5, $[34] = t6, $[35] = t7, $[36] = t8) : t8 = $[36], t8;
|
|
5365
5385
|
});
|
|
5366
5386
|
Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
|
|
5367
5387
|
function dialogStyle({
|