@sanity/ui 2.9.0-canary.2 → 2.9.0-canary.4
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.d.mts +12 -10
- package/dist/index.d.ts +12 -10
- package/dist/index.esm.js +332 -142
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +331 -141
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +332 -142
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +35 -47
- package/src/core/components/menu/menu.tsx +12 -10
- package/src/core/components/menu/menuButton.tsx +14 -36
- package/src/core/components/tab/tabList.tsx +3 -11
- package/src/core/components/toast/toastProvider.tsx +5 -6
- package/src/core/components/toast/toastState.ts +6 -0
- package/src/core/components/tree/treeItem.tsx +5 -2
- package/src/core/constants.ts +1 -1
- package/src/core/primitives/popover/popover.tsx +4 -7
- package/src/core/utils/elementQuery/elementQuery.tsx +14 -16
- package/src/core/utils/layer/layerProvider.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -3215,16 +3215,37 @@ function findMinBreakpoints(media, width) {
|
|
|
3215
3215
|
return ret;
|
|
3216
3216
|
}
|
|
3217
3217
|
const ElementQuery = react.forwardRef(function(props, forwardedRef) {
|
|
3218
|
-
const theme2 = useTheme_v2()
|
|
3218
|
+
const $ = reactCompilerRuntime.c(18), theme2 = useTheme_v2();
|
|
3219
|
+
let _media, restProps, children;
|
|
3220
|
+
$[0] !== props ? ({
|
|
3219
3221
|
children,
|
|
3220
3222
|
media: _media,
|
|
3221
3223
|
...restProps
|
|
3222
|
-
} = props,
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3224
|
+
} = props, $[0] = props, $[1] = _media, $[2] = restProps, $[3] = children) : (_media = $[1], restProps = $[2], children = $[3]);
|
|
3225
|
+
const media = _media ?? theme2.media, [element, setElement] = react.useState(null), elementSize = useElementSize(element);
|
|
3226
|
+
let t0;
|
|
3227
|
+
t0 = elementSize?.border.width ?? window.innerWidth;
|
|
3228
|
+
const width = t0;
|
|
3229
|
+
let t1, t2;
|
|
3230
|
+
if ($[4] !== media || $[5] !== width) {
|
|
3231
|
+
const eq = findMaxBreakpoints(media, width);
|
|
3232
|
+
t2 = eq.length ? eq.join(" ") : void 0, $[4] = media, $[5] = width, $[6] = t2;
|
|
3233
|
+
} else
|
|
3234
|
+
t2 = $[6];
|
|
3235
|
+
t1 = t2;
|
|
3236
|
+
const max = t1;
|
|
3237
|
+
let t3, t4;
|
|
3238
|
+
if ($[7] !== media || $[8] !== width) {
|
|
3239
|
+
const eq_0 = findMinBreakpoints(media, width);
|
|
3240
|
+
t4 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = media, $[8] = width, $[9] = t4;
|
|
3241
|
+
} else
|
|
3242
|
+
t4 = $[9];
|
|
3243
|
+
t3 = t4;
|
|
3244
|
+
const min = t3;
|
|
3245
|
+
let t5, t6;
|
|
3246
|
+
$[10] !== element ? (t5 = () => element, t6 = [element], $[10] = element, $[11] = t5, $[12] = t6) : (t5 = $[11], t6 = $[12]), react.useImperativeHandle(forwardedRef, t5, t6);
|
|
3247
|
+
let t7;
|
|
3248
|
+
return $[13] !== restProps || $[14] !== max || $[15] !== min || $[16] !== children ? (t7 = /* @__PURE__ */ jsxRuntime.jsx("div", { "data-ui": "ElementQuery", ...restProps, "data-eq-max": max, "data-eq-min": min, ref: setElement, children }), $[13] = restProps, $[14] = max, $[15] = min, $[16] = children, $[17] = t7) : t7 = $[17], t7;
|
|
3228
3249
|
});
|
|
3229
3250
|
ElementQuery.displayName = "ForwardRef(ElementQuery)";
|
|
3230
3251
|
class ErrorBoundary extends react.Component {
|
|
@@ -3351,10 +3372,18 @@ function _isScrollable(el) {
|
|
|
3351
3372
|
return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
|
|
3352
3373
|
}
|
|
3353
3374
|
function LayerProvider(props) {
|
|
3354
|
-
const {
|
|
3375
|
+
const $ = reactCompilerRuntime.c(19), {
|
|
3355
3376
|
children,
|
|
3356
|
-
zOffset:
|
|
3357
|
-
} = props,
|
|
3377
|
+
zOffset: t0
|
|
3378
|
+
} = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = react.useContext(LayerContext);
|
|
3379
|
+
let t1;
|
|
3380
|
+
$[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
|
|
3381
|
+
const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = useArrayProp(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex];
|
|
3382
|
+
let t2;
|
|
3383
|
+
$[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[2] = t2) : t2 = $[2];
|
|
3384
|
+
const [, setChildLayers] = react.useState(t2), [size2, setSize] = react.useState(0), isTopLayer = size2 === 0;
|
|
3385
|
+
let t3;
|
|
3386
|
+
$[3] !== parentRegisterChild || $[4] !== setChildLayers ? (t3 = (childLevel) => {
|
|
3358
3387
|
const parentDispose = parentRegisterChild?.(childLevel);
|
|
3359
3388
|
return childLevel !== void 0 ? setChildLayers((state) => {
|
|
3360
3389
|
const prevLen = state[childLevel] ?? 0, nextState = {
|
|
@@ -3367,20 +3396,25 @@ function LayerProvider(props) {
|
|
|
3367
3396
|
const nextState_0 = {
|
|
3368
3397
|
...state_0
|
|
3369
3398
|
};
|
|
3370
|
-
return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel]
|
|
3399
|
+
return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
|
|
3371
3400
|
}) : setSize((v_0) => v_0 - 1), parentDispose?.();
|
|
3372
3401
|
};
|
|
3373
|
-
}, [parentRegisterChild]);
|
|
3374
|
-
|
|
3375
|
-
|
|
3402
|
+
}, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
|
|
3403
|
+
const registerChild = t3;
|
|
3404
|
+
let t4, t5;
|
|
3405
|
+
$[6] !== parentRegisterChild || $[7] !== level ? (t4 = () => parentRegisterChild?.(level), t5 = [level, parentRegisterChild], $[6] = parentRegisterChild, $[7] = level, $[8] = t4, $[9] = t5) : (t4 = $[8], t5 = $[9]), react.useEffect(t4, t5);
|
|
3406
|
+
let t6, t7;
|
|
3407
|
+
$[10] !== isTopLayer || $[11] !== level || $[12] !== registerChild || $[13] !== size2 || $[14] !== zIndex ? (t7 = {
|
|
3376
3408
|
version: 0,
|
|
3377
3409
|
isTopLayer,
|
|
3378
3410
|
level,
|
|
3379
3411
|
registerChild,
|
|
3380
3412
|
size: size2,
|
|
3381
3413
|
zIndex
|
|
3382
|
-
}
|
|
3383
|
-
|
|
3414
|
+
}, $[10] = isTopLayer, $[11] = level, $[12] = registerChild, $[13] = size2, $[14] = zIndex, $[15] = t7) : t7 = $[15], t6 = t7;
|
|
3415
|
+
const value = t6;
|
|
3416
|
+
let t8;
|
|
3417
|
+
return $[16] !== value || $[17] !== children ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children }), $[16] = value, $[17] = children, $[18] = t8) : t8 = $[18], t8;
|
|
3384
3418
|
}
|
|
3385
3419
|
LayerProvider.displayName = "LayerProvider";
|
|
3386
3420
|
const Root$j = styledComponents.styled.div({
|
|
@@ -3829,7 +3863,7 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
|
|
|
3829
3863
|
zOffset: _zOffsetProp,
|
|
3830
3864
|
updateRef,
|
|
3831
3865
|
...restProps
|
|
3832
|
-
} = props, boundaryElement = _boundaryElement ?? boundaryElementContext.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null),
|
|
3866
|
+
} = props, boundaryElement = _boundaryElement ?? boundaryElementContext.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), [arrowElement, setArrowElement] = react.useState(null), rootBoundary = "viewport";
|
|
3833
3867
|
react.useImperativeHandle(forwardedRef, () => ref.current);
|
|
3834
3868
|
const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
|
|
3835
3869
|
container,
|
|
@@ -3883,14 +3917,14 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
|
|
|
3883
3917
|
rootBoundary,
|
|
3884
3918
|
padding: DEFAULT_POPOVER_PADDING
|
|
3885
3919
|
})), arrowProp && ret.push(reactDom$1.arrow({
|
|
3886
|
-
element:
|
|
3920
|
+
element: arrowElement,
|
|
3887
3921
|
padding: DEFAULT_POPOVER_PADDING
|
|
3888
3922
|
})), animate && ret.push(origin), ret.push(reactDom$1.hide({
|
|
3889
3923
|
boundary: referenceBoundary || void 0,
|
|
3890
3924
|
padding: DEFAULT_POPOVER_PADDING,
|
|
3891
3925
|
strategy: "referenceHidden"
|
|
3892
3926
|
})), ret;
|
|
3893
|
-
}, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
|
|
3927
|
+
}, [animate, arrowElement, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
|
|
3894
3928
|
x,
|
|
3895
3929
|
y,
|
|
3896
3930
|
middlewareData,
|
|
@@ -3902,9 +3936,7 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
|
|
|
3902
3936
|
middleware,
|
|
3903
3937
|
placement: placementProp,
|
|
3904
3938
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
3905
|
-
}), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY,
|
|
3906
|
-
arrowRef.current = arrowEl;
|
|
3907
|
-
}, []), setFloating = react.useCallback((node) => {
|
|
3939
|
+
}), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, setFloating = react.useCallback((node) => {
|
|
3908
3940
|
ref.current = node, refs.setFloating(node);
|
|
3909
3941
|
}, [refs]), [childElement, setChildElement] = react.useState(null), setReference = react.useCallback((node_0) => {
|
|
3910
3942
|
refs.setReference(node_0), setChildElement(node_0);
|
|
@@ -3917,7 +3949,7 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
|
|
|
3917
3949
|
child || refs.setReference(referenceElement || null);
|
|
3918
3950
|
}, [referenceElement, refs, child]), disabled)
|
|
3919
3951
|
return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
3920
|
-
const popover = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef:
|
|
3952
|
+
const popover = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrowElement, 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 }) }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
|
|
3921
3953
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3922
3954
|
animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
|
|
3923
3955
|
child
|
|
@@ -5342,26 +5374,46 @@ const Autocomplete = InnerAutocomplete, Root$8 = styledComponents.styled.ol`
|
|
|
5342
5374
|
appearance: none;
|
|
5343
5375
|
margin: -4px;
|
|
5344
5376
|
`, Breadcrumbs = react.forwardRef(function(props, ref) {
|
|
5345
|
-
const
|
|
5377
|
+
const $ = reactCompilerRuntime.c(37);
|
|
5378
|
+
let t0, children, maxLength, restProps, separator;
|
|
5379
|
+
$[0] !== props ? ({
|
|
5346
5380
|
children,
|
|
5347
5381
|
maxLength,
|
|
5348
5382
|
separator,
|
|
5349
|
-
space:
|
|
5383
|
+
space: t0,
|
|
5350
5384
|
...restProps
|
|
5351
|
-
} = props,
|
|
5352
|
-
|
|
5353
|
-
|
|
5385
|
+
} = props, $[0] = props, $[1] = t0, $[2] = children, $[3] = maxLength, $[4] = restProps, $[5] = separator) : (t0 = $[1], children = $[2], maxLength = $[3], restProps = $[4], separator = $[5]);
|
|
5386
|
+
const space = useArrayProp(t0 === void 0 ? 2 : t0), [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null);
|
|
5387
|
+
let t1;
|
|
5388
|
+
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => setOpen(!1), $[6] = t1) : t1 = $[6];
|
|
5389
|
+
const collapse = t1;
|
|
5390
|
+
let t2;
|
|
5391
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => setOpen(!0), $[7] = t2) : t2 = $[7];
|
|
5392
|
+
const expand = t2;
|
|
5393
|
+
let t3;
|
|
5394
|
+
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => [expandElementRef.current, popoverElementRef.current], $[8] = t3) : t3 = $[8], useClickOutsideEvent(collapse, t3);
|
|
5395
|
+
let T0, t4, t5, t6, t7;
|
|
5396
|
+
if ($[9] !== children || $[10] !== maxLength || $[11] !== space || $[12] !== open || $[13] !== restProps || $[14] !== ref || $[15] !== separator) {
|
|
5397
|
+
const rawItems = react.Children.toArray(children).filter(react.isValidElement);
|
|
5398
|
+
let items = rawItems;
|
|
5354
5399
|
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
|
-
|
|
5400
|
+
if (maxLength && rawItems.length > maxLength) {
|
|
5401
|
+
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;
|
|
5402
|
+
let t10;
|
|
5403
|
+
$[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];
|
|
5404
|
+
let t11;
|
|
5405
|
+
$[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)];
|
|
5406
|
+
}
|
|
5407
|
+
T0 = Root$8, t4 = "Breadcrumbs", t5 = restProps, t6 = ref;
|
|
5408
|
+
let t82;
|
|
5409
|
+
$[28] !== space || $[29] !== separator ? (t82 = (item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
5410
|
+
itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsxRuntime.jsx(Text, { muted: !0, children: "/" }) }),
|
|
5411
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { as: "li", children: item })
|
|
5412
|
+
] }, 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;
|
|
5413
|
+
} else
|
|
5414
|
+
T0 = $[16], t4 = $[17], t5 = $[18], t6 = $[19], t7 = $[20];
|
|
5415
|
+
let t8;
|
|
5416
|
+
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
5417
|
});
|
|
5366
5418
|
Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
|
|
5367
5419
|
function dialogStyle({
|
|
@@ -5913,8 +5965,8 @@ const Root$5 = styledComponents.styled(Box)`
|
|
|
5913
5965
|
});
|
|
5914
5966
|
Menu.displayName = "ForwardRef(Menu)";
|
|
5915
5967
|
const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
5916
|
-
const {
|
|
5917
|
-
__unstable_disableRestoreFocusOnClose:
|
|
5968
|
+
const $ = reactCompilerRuntime.c(62), {
|
|
5969
|
+
__unstable_disableRestoreFocusOnClose: t0,
|
|
5918
5970
|
boundaryElement: deprecated_boundaryElement,
|
|
5919
5971
|
button: buttonProp,
|
|
5920
5972
|
id,
|
|
@@ -5923,23 +5975,38 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
5923
5975
|
onOpen,
|
|
5924
5976
|
placement: deprecated_placement,
|
|
5925
5977
|
popoverScheme: deprecated_popoverScheme,
|
|
5926
|
-
portal:
|
|
5978
|
+
portal: t1,
|
|
5927
5979
|
popover,
|
|
5928
5980
|
popoverRadius: deprecated_popoverRadius,
|
|
5929
5981
|
preventOverflow: deprecated_preventOverflow
|
|
5930
|
-
} = props, [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), [buttonElement, setButtonElement] = react.useState(null)
|
|
5931
|
-
|
|
5982
|
+
} = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), [buttonElement, setButtonElement] = react.useState(null);
|
|
5983
|
+
let t2;
|
|
5984
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
|
|
5985
|
+
const [menuElements, setChildMenuElements] = react.useState(t2), openRef = react.useRef(open);
|
|
5986
|
+
let t3, t4;
|
|
5987
|
+
$[1] !== onOpen || $[2] !== open ? (t3 = () => {
|
|
5932
5988
|
onOpen && open && !openRef.current && onOpen();
|
|
5933
|
-
}, [onOpen, open]), react.useEffect(
|
|
5989
|
+
}, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), react.useEffect(t3, t4);
|
|
5990
|
+
let t5, t6;
|
|
5991
|
+
$[5] !== onClose || $[6] !== open ? (t5 = () => {
|
|
5934
5992
|
onClose && !open && openRef.current && onClose();
|
|
5935
|
-
}, [onClose, open]), react.useEffect(
|
|
5993
|
+
}, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), react.useEffect(t5, t6);
|
|
5994
|
+
let t7, t8;
|
|
5995
|
+
$[9] !== open ? (t7 = () => {
|
|
5936
5996
|
openRef.current = open;
|
|
5937
|
-
}, [open]);
|
|
5938
|
-
|
|
5997
|
+
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), react.useEffect(t7, t8);
|
|
5998
|
+
let t9;
|
|
5999
|
+
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
5939
6000
|
setOpen((v) => !v), setShouldFocus(null);
|
|
5940
|
-
}, []
|
|
6001
|
+
}, $[12] = t9) : t9 = $[12];
|
|
6002
|
+
const handleButtonClick = t9;
|
|
6003
|
+
let t10;
|
|
6004
|
+
$[13] !== open ? (t10 = (event) => {
|
|
5941
6005
|
open && event.preventDefault();
|
|
5942
|
-
}, [open
|
|
6006
|
+
}, $[13] = open, $[14] = t10) : t10 = $[14];
|
|
6007
|
+
const handleMouseDown = t10;
|
|
6008
|
+
let t11;
|
|
6009
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (event_0) => {
|
|
5943
6010
|
if (event_0.key === "ArrowDown" || event_0.key === "Enter" || event_0.key === " ") {
|
|
5944
6011
|
event_0.preventDefault(), setOpen(!0), setShouldFocus("first");
|
|
5945
6012
|
return;
|
|
@@ -5948,7 +6015,10 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
5948
6015
|
event_0.preventDefault(), setOpen(!0), setShouldFocus("last");
|
|
5949
6016
|
return;
|
|
5950
6017
|
}
|
|
5951
|
-
}, []
|
|
6018
|
+
}, $[15] = t11) : t11 = $[15];
|
|
6019
|
+
const handleButtonKeyDown = t11;
|
|
6020
|
+
let t12;
|
|
6021
|
+
$[16] !== buttonElement || $[17] !== menuElements ? (t12 = (event_1) => {
|
|
5952
6022
|
const target = event_1.target;
|
|
5953
6023
|
if (target instanceof Node && !(buttonElement && (target === buttonElement || buttonElement.contains(target)))) {
|
|
5954
6024
|
for (const el of menuElements)
|
|
@@ -5956,9 +6026,15 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
5956
6026
|
return;
|
|
5957
6027
|
setOpen(!1);
|
|
5958
6028
|
}
|
|
5959
|
-
}, [buttonElement, menuElements
|
|
6029
|
+
}, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
|
|
6030
|
+
const handleMenuClickOutside = t12;
|
|
6031
|
+
let t13;
|
|
6032
|
+
$[19] !== disableRestoreFocusOnClose || $[20] !== buttonElement ? (t13 = () => {
|
|
5960
6033
|
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
5961
|
-
}, [
|
|
6034
|
+
}, $[19] = disableRestoreFocusOnClose, $[20] = buttonElement, $[21] = t13) : t13 = $[21];
|
|
6035
|
+
const handleMenuEscape = t13;
|
|
6036
|
+
let t14;
|
|
6037
|
+
$[22] !== menuElements ? (t14 = (event_2) => {
|
|
5962
6038
|
const target_0 = event_2.relatedTarget;
|
|
5963
6039
|
if (target_0 instanceof Node) {
|
|
5964
6040
|
for (const el_0 of menuElements)
|
|
@@ -5966,9 +6042,18 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
5966
6042
|
return;
|
|
5967
6043
|
setOpen(!1);
|
|
5968
6044
|
}
|
|
5969
|
-
}, [menuElements
|
|
6045
|
+
}, $[22] = menuElements, $[23] = t14) : t14 = $[23];
|
|
6046
|
+
const handleBlur = t14;
|
|
6047
|
+
let t15;
|
|
6048
|
+
$[24] !== disableRestoreFocusOnClose || $[25] !== buttonElement ? (t15 = () => {
|
|
5970
6049
|
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
5971
|
-
}, [
|
|
6050
|
+
}, $[24] = disableRestoreFocusOnClose, $[25] = buttonElement, $[26] = t15) : t15 = $[26];
|
|
6051
|
+
const handleItemClick = t15;
|
|
6052
|
+
let t16;
|
|
6053
|
+
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t16 = (el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => setChildMenuElements((els_0) => els_0.filter((_el) => _el !== el_1))), $[27] = t16) : t16 = $[27];
|
|
6054
|
+
const registerElement = t16;
|
|
6055
|
+
let t17;
|
|
6056
|
+
$[28] !== id || $[29] !== handleBlur || $[30] !== handleMenuClickOutside || $[31] !== handleMenuEscape || $[32] !== handleItemClick || $[33] !== buttonElement || $[34] !== shouldFocus || $[35] !== menuProp ? (t17 = menuProp && react.cloneElement(menuProp, {
|
|
5972
6057
|
"aria-labelledby": id,
|
|
5973
6058
|
onBlurCapture: handleBlur,
|
|
5974
6059
|
onClickOutside: handleMenuClickOutside,
|
|
@@ -5977,7 +6062,10 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
5977
6062
|
originElement: buttonElement,
|
|
5978
6063
|
registerElement,
|
|
5979
6064
|
shouldFocus
|
|
5980
|
-
}), [
|
|
6065
|
+
}), $[28] = id, $[29] = handleBlur, $[30] = handleMenuClickOutside, $[31] = handleMenuEscape, $[32] = handleItemClick, $[33] = buttonElement, $[34] = shouldFocus, $[35] = menuProp, $[36] = t17) : t17 = $[36];
|
|
6066
|
+
const menu = t17;
|
|
6067
|
+
let t18, t19;
|
|
6068
|
+
$[37] !== buttonProp || $[38] !== open || $[39] !== id || $[40] !== handleMouseDown ? (t19 = buttonProp && react.cloneElement(buttonProp, {
|
|
5981
6069
|
"data-ui": "MenuButton",
|
|
5982
6070
|
id,
|
|
5983
6071
|
onClick: handleButtonClick,
|
|
@@ -5985,14 +6073,16 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
5985
6073
|
onMouseDown: handleMouseDown,
|
|
5986
6074
|
"aria-haspopup": !0,
|
|
5987
6075
|
"aria-expanded": open,
|
|
5988
|
-
ref,
|
|
6076
|
+
ref: setButtonElement,
|
|
5989
6077
|
selected: buttonProp.props.selected ?? open
|
|
5990
|
-
}), [buttonProp,
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
6078
|
+
}), $[37] = buttonProp, $[38] = open, $[39] = id, $[40] = handleMouseDown, $[41] = t19) : t19 = $[41], t18 = t19;
|
|
6079
|
+
const button = t18;
|
|
6080
|
+
let t20, t21;
|
|
6081
|
+
$[42] !== buttonElement ? (t20 = () => buttonElement, t21 = [buttonElement], $[42] = buttonElement, $[43] = t20, $[44] = t21) : (t20 = $[43], t21 = $[44]), react.useImperativeHandle(forwardedRef, t20, t21);
|
|
6082
|
+
let t22, t23;
|
|
6083
|
+
$[45] !== popover ? (t23 = popover || {}, $[45] = popover, $[46] = t23) : t23 = $[46];
|
|
6084
|
+
let t24;
|
|
6085
|
+
$[47] !== deprecated_boundaryElement || $[48] !== deprecated_placement || $[49] !== deprecated_portal || $[50] !== deprecated_preventOverflow || $[51] !== deprecated_popoverRadius || $[52] !== deprecated_popoverScheme || $[53] !== t23 ? (t24 = {
|
|
5996
6086
|
boundaryElement: deprecated_boundaryElement,
|
|
5997
6087
|
overflow: "auto",
|
|
5998
6088
|
placement: deprecated_placement,
|
|
@@ -6000,9 +6090,13 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
6000
6090
|
preventOverflow: deprecated_preventOverflow,
|
|
6001
6091
|
radius: deprecated_popoverRadius,
|
|
6002
6092
|
scheme: deprecated_popoverScheme,
|
|
6003
|
-
...
|
|
6004
|
-
}
|
|
6005
|
-
|
|
6093
|
+
...t23
|
|
6094
|
+
}, $[47] = deprecated_boundaryElement, $[48] = deprecated_placement, $[49] = deprecated_portal, $[50] = deprecated_preventOverflow, $[51] = deprecated_popoverRadius, $[52] = deprecated_popoverScheme, $[53] = t23, $[54] = t24) : t24 = $[54], t22 = t24;
|
|
6095
|
+
const popoverProps = t22;
|
|
6096
|
+
let t25;
|
|
6097
|
+
$[55] !== button ? (t25 = button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[55] = button, $[56] = t25) : t25 = $[56];
|
|
6098
|
+
let t26;
|
|
6099
|
+
return $[57] !== popoverProps || $[58] !== menu || $[59] !== open || $[60] !== t25 ? (t26 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t25 }), $[57] = popoverProps, $[58] = menu, $[59] = open, $[60] = t25, $[61] = t26) : t26 = $[61], t26;
|
|
6006
6100
|
});
|
|
6007
6101
|
MenuButton.displayName = "ForwardRef(MenuButton)";
|
|
6008
6102
|
const MenuDivider = styledComponents.styled.hr`
|
|
@@ -6486,9 +6580,6 @@ const CustomButton = styledComponents.styled(Button)`
|
|
|
6486
6580
|
return $[18] !== restProps || $[19] !== t7 || $[20] !== fontSize2 || $[21] !== icon || $[22] !== id || $[23] !== onClick || $[24] !== handleFocus || $[25] !== padding || $[26] !== selected || $[27] !== t8 || $[28] !== label ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(CustomButton, { "data-ui": "Tab", ...restProps, "aria-selected": t7, fontSize: fontSize2, icon, id, mode: "bleed", onClick, onBlur: handleBlur, onFocus: handleFocus, padding, ref, role: "tab", selected, tabIndex: t8, text: label, type: "button" }), $[18] = restProps, $[19] = t7, $[20] = fontSize2, $[21] = icon, $[22] = id, $[23] = onClick, $[24] = handleFocus, $[25] = padding, $[26] = selected, $[27] = t8, $[28] = label, $[29] = t9) : t9 = $[29], t9;
|
|
6487
6581
|
});
|
|
6488
6582
|
Tab.displayName = "ForwardRef(Tab)";
|
|
6489
|
-
function _isReactElement(node) {
|
|
6490
|
-
return !!node;
|
|
6491
|
-
}
|
|
6492
6583
|
const CustomInline = styledComponents.styled(Inline)`
|
|
6493
6584
|
& > div {
|
|
6494
6585
|
display: inline-block;
|
|
@@ -6497,19 +6588,32 @@ const CustomInline = styledComponents.styled(Inline)`
|
|
|
6497
6588
|
box-sizing: border-box;
|
|
6498
6589
|
}
|
|
6499
6590
|
`, TabList = react.forwardRef(function(props, ref) {
|
|
6500
|
-
const
|
|
6591
|
+
const $ = reactCompilerRuntime.c(15);
|
|
6592
|
+
let childrenProp, restProps;
|
|
6593
|
+
$[0] !== props ? ({
|
|
6501
6594
|
children: childrenProp,
|
|
6502
6595
|
...restProps
|
|
6503
|
-
} = props, [
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6596
|
+
} = props, $[0] = props, $[1] = childrenProp, $[2] = restProps) : (childrenProp = $[1], restProps = $[2]);
|
|
6597
|
+
const [focusedIndex, setFocusedIndex] = react.useState(-1);
|
|
6598
|
+
let t0;
|
|
6599
|
+
if ($[3] !== childrenProp || $[4] !== focusedIndex) {
|
|
6600
|
+
const children = react.Children.toArray(childrenProp).filter(react.isValidElement);
|
|
6601
|
+
let t12;
|
|
6602
|
+
$[6] !== focusedIndex ? (t12 = (child, childIndex) => react.cloneElement(child, {
|
|
6603
|
+
focused: focusedIndex === childIndex,
|
|
6604
|
+
key: childIndex,
|
|
6605
|
+
onFocus: () => setFocusedIndex(childIndex)
|
|
6606
|
+
}), $[6] = focusedIndex, $[7] = t12) : t12 = $[7], t0 = children.map(t12), $[3] = childrenProp, $[4] = focusedIndex, $[5] = t0;
|
|
6607
|
+
} else
|
|
6608
|
+
t0 = $[5];
|
|
6609
|
+
const tabs = t0, numTabs = tabs.length;
|
|
6610
|
+
let t1;
|
|
6611
|
+
$[8] !== numTabs ? (t1 = (event) => {
|
|
6510
6612
|
event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
|
|
6511
|
-
}, [numTabs]);
|
|
6512
|
-
|
|
6613
|
+
}, $[8] = numTabs, $[9] = t1) : t1 = $[9];
|
|
6614
|
+
const handleKeyDown = t1;
|
|
6615
|
+
let t2;
|
|
6616
|
+
return $[10] !== restProps || $[11] !== handleKeyDown || $[12] !== ref || $[13] !== tabs ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(CustomInline, { "data-ui": "TabList", ...restProps, onKeyDown: handleKeyDown, ref, role: "tablist", children: tabs }), $[10] = restProps, $[11] = handleKeyDown, $[12] = ref, $[13] = tabs, $[14] = t2) : t2 = $[14], t2;
|
|
6513
6617
|
});
|
|
6514
6618
|
TabList.displayName = "ForwardRef(TabList)";
|
|
6515
6619
|
const TabPanel = react.forwardRef(function(props, ref) {
|
|
@@ -6630,7 +6734,12 @@ function _temp() {
|
|
|
6630
6734
|
return !0;
|
|
6631
6735
|
}
|
|
6632
6736
|
const subscribe = () => () => {
|
|
6633
|
-
}, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null)
|
|
6737
|
+
}, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null);
|
|
6738
|
+
let toastId = 0;
|
|
6739
|
+
function generateToastId() {
|
|
6740
|
+
return String(toastId++);
|
|
6741
|
+
}
|
|
6742
|
+
const Root$1 = styledComponents.styled(Layer)`
|
|
6634
6743
|
position: fixed;
|
|
6635
6744
|
top: 0;
|
|
6636
6745
|
left: 0;
|
|
@@ -6645,31 +6754,44 @@ const subscribe = () => () => {
|
|
|
6645
6754
|
max-width: 420px;
|
|
6646
6755
|
width: 100%;
|
|
6647
6756
|
`;
|
|
6648
|
-
let toastId = 0;
|
|
6649
6757
|
function ToastProvider(props) {
|
|
6650
|
-
const {
|
|
6758
|
+
const $ = reactCompilerRuntime.c(24), {
|
|
6651
6759
|
children,
|
|
6652
|
-
padding
|
|
6760
|
+
padding: t0,
|
|
6653
6761
|
paddingX,
|
|
6654
6762
|
paddingY,
|
|
6655
6763
|
zOffset
|
|
6656
|
-
} = props,
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6764
|
+
} = props, padding = t0 === void 0 ? 4 : t0;
|
|
6765
|
+
let t1;
|
|
6766
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
|
|
6767
|
+
const [state, _setState] = react.useState(t1);
|
|
6768
|
+
let t2;
|
|
6769
|
+
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[1] = t2) : t2 = $[1];
|
|
6770
|
+
const toastsRef = react.useRef(t2), mounted = useMounted(), prefersReducedMotion = usePrefersReducedMotion();
|
|
6771
|
+
let t3, t4, t5;
|
|
6772
|
+
$[2] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {
|
|
6773
|
+
opacity: 0,
|
|
6774
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
|
|
6775
|
+
y: 32,
|
|
6776
|
+
scale: 0.25,
|
|
6777
|
+
willChange: "transform"
|
|
6778
|
+
}, t5 = [0, 1, 1], $[2] = t4, $[3] = t5) : (t4 = $[2], t5 = $[3]);
|
|
6779
|
+
let t6, t7;
|
|
6780
|
+
$[4] === Symbol.for("react.memo_cache_sentinel") ? (t6 = {
|
|
6781
|
+
opacity: t5,
|
|
6782
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [0, 0, 1],
|
|
6783
|
+
y: 0,
|
|
6784
|
+
scale: 1
|
|
6785
|
+
}, t7 = [1, 1, 0], $[4] = t6, $[5] = t7) : (t6 = $[4], t7 = $[5]);
|
|
6786
|
+
let t8;
|
|
6787
|
+
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t8 = [1, 0, 0], $[6] = t8) : t8 = $[6];
|
|
6788
|
+
let t9;
|
|
6789
|
+
$[7] !== prefersReducedMotion ? (t9 = {
|
|
6790
|
+
initial: t4,
|
|
6791
|
+
animate: t6,
|
|
6670
6792
|
exit: {
|
|
6671
|
-
opacity:
|
|
6672
|
-
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]:
|
|
6793
|
+
opacity: t7,
|
|
6794
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: t8,
|
|
6673
6795
|
scale: 0.5,
|
|
6674
6796
|
transition: prefersReducedMotion ? {
|
|
6675
6797
|
duration: 0
|
|
@@ -6677,10 +6799,13 @@ function ToastProvider(props) {
|
|
|
6677
6799
|
duration: 0.2
|
|
6678
6800
|
}
|
|
6679
6801
|
}
|
|
6680
|
-
}
|
|
6802
|
+
}, $[7] = prefersReducedMotion, $[8] = t9) : t9 = $[8], t3 = t9;
|
|
6803
|
+
const variants = t3;
|
|
6804
|
+
let t10, t11;
|
|
6805
|
+
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t11 = {
|
|
6681
6806
|
version: 0,
|
|
6682
6807
|
push: (params) => {
|
|
6683
|
-
const setState = (state_0) => react.startTransition(() => _setState(state_0)), id = params.id ||
|
|
6808
|
+
const setState = (state_0) => react.startTransition(() => _setState(state_0)), id = params.id || generateToastId(), duration = params.duration || 5e3, dismiss = () => {
|
|
6684
6809
|
const timeoutId = toastsRef.current[id]?.timeoutId;
|
|
6685
6810
|
setState((prevState) => {
|
|
6686
6811
|
const idx = prevState.findIndex((t) => t.id === id);
|
|
@@ -6702,27 +6827,36 @@ function ToastProvider(props) {
|
|
|
6702
6827
|
timeoutId: setTimeout(dismiss, duration)
|
|
6703
6828
|
}, id;
|
|
6704
6829
|
}
|
|
6705
|
-
}
|
|
6706
|
-
|
|
6830
|
+
}, $[9] = t11) : t11 = $[9], t10 = t11;
|
|
6831
|
+
const value = t10;
|
|
6832
|
+
let t12, t13;
|
|
6833
|
+
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t12 = () => () => {
|
|
6707
6834
|
for (const {
|
|
6708
6835
|
timeoutId: timeoutId_0
|
|
6709
6836
|
} of Object.values(toastsRef.current))
|
|
6710
6837
|
clearTimeout(timeoutId_0);
|
|
6711
6838
|
toastsRef.current = {};
|
|
6712
|
-
}, []
|
|
6713
|
-
|
|
6714
|
-
|
|
6839
|
+
}, t13 = [], $[10] = t12, $[11] = t13) : (t12 = $[10], t13 = $[11]), react.useEffect(t12, t13);
|
|
6840
|
+
let t14;
|
|
6841
|
+
$[12] !== mounted || $[13] !== variants || $[14] !== prefersReducedMotion || $[15] !== state || $[16] !== padding || $[17] !== paddingX || $[18] !== paddingY || $[19] !== zOffset ? (t14 = mounted && /* @__PURE__ */ jsxRuntime.jsx(Root$1, { "data-ui": "ToastProvider", zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, children: state.map((t152) => {
|
|
6842
|
+
const {
|
|
6715
6843
|
dismiss: dismiss_0,
|
|
6716
6844
|
id: id_0,
|
|
6717
6845
|
params: params_0
|
|
6718
|
-
}
|
|
6846
|
+
} = t152;
|
|
6847
|
+
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.div, { layout: "position", initial: "initial", animate: "animate", exit: "exit", variants, transition: prefersReducedMotion ? {
|
|
6719
6848
|
duration: 0
|
|
6720
6849
|
} : {
|
|
6721
6850
|
type: "spring",
|
|
6722
6851
|
damping: 30,
|
|
6723
6852
|
stiffness: 400
|
|
6724
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration }) }, id_0)
|
|
6725
|
-
|
|
6853
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration }) }, id_0);
|
|
6854
|
+
}) }) }) }) }), $[12] = mounted, $[13] = variants, $[14] = prefersReducedMotion, $[15] = state, $[16] = padding, $[17] = paddingX, $[18] = paddingY, $[19] = zOffset, $[20] = t14) : t14 = $[20];
|
|
6855
|
+
let t15;
|
|
6856
|
+
return $[21] !== children || $[22] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
|
|
6857
|
+
children,
|
|
6858
|
+
t14
|
|
6859
|
+
] }), $[21] = children, $[22] = t14, $[23] = t15) : t15 = $[23], t15;
|
|
6726
6860
|
}
|
|
6727
6861
|
ToastProvider.displayName = "ToastProvider";
|
|
6728
6862
|
function useToast() {
|
|
@@ -7059,61 +7193,117 @@ const TreeGroup = react.memo(function(props) {
|
|
|
7059
7193
|
transition: transform 100ms;
|
|
7060
7194
|
}
|
|
7061
7195
|
`, TreeItem = react.memo(function(props) {
|
|
7062
|
-
const
|
|
7196
|
+
const $ = reactCompilerRuntime.c(112);
|
|
7197
|
+
let t0, t1, t2, t3, t4, idProp, onClick, IconComponent, children, muted, weight, text, href, linkAs, restProps;
|
|
7198
|
+
$[0] !== props ? ({
|
|
7063
7199
|
children,
|
|
7064
|
-
expanded:
|
|
7065
|
-
fontSize:
|
|
7200
|
+
expanded: t0,
|
|
7201
|
+
fontSize: t1,
|
|
7066
7202
|
href,
|
|
7067
7203
|
icon: IconComponent,
|
|
7068
7204
|
id: idProp,
|
|
7069
7205
|
linkAs,
|
|
7070
7206
|
muted,
|
|
7071
7207
|
onClick,
|
|
7072
|
-
padding
|
|
7073
|
-
selected
|
|
7074
|
-
space
|
|
7208
|
+
padding: t2,
|
|
7209
|
+
selected: t3,
|
|
7210
|
+
space: t4,
|
|
7075
7211
|
text,
|
|
7076
7212
|
weight,
|
|
7077
7213
|
...restProps
|
|
7078
|
-
} = props, [
|
|
7214
|
+
} = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = idProp, $[7] = onClick, $[8] = IconComponent, $[9] = children, $[10] = muted, $[11] = weight, $[12] = text, $[13] = href, $[14] = linkAs, $[15] = restProps) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], idProp = $[6], onClick = $[7], IconComponent = $[8], children = $[9], muted = $[10], weight = $[11], text = $[12], href = $[13], linkAs = $[14], restProps = $[15]);
|
|
7215
|
+
const expandedProp = t0 === void 0 ? !1 : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 === void 0 ? !1 : t3, space = t4 === void 0 ? 2 : t4, [rootElement, setRootElement] = react.useState(null), treeitemRef = react.useRef(null), tree = useTree(), {
|
|
7079
7216
|
path,
|
|
7080
7217
|
registerItem,
|
|
7081
7218
|
setExpanded,
|
|
7082
7219
|
setFocusedElement
|
|
7083
|
-
} = tree, _id = react.useId(), id = idProp || _id
|
|
7220
|
+
} = tree, _id = react.useId(), id = idProp || _id;
|
|
7221
|
+
let t5, t6, t7;
|
|
7222
|
+
if ($[16] !== id || $[17] !== path) {
|
|
7223
|
+
const result = path.concat([id || ""]);
|
|
7224
|
+
t6 = result, t7 = result.join("/"), $[16] = id, $[17] = path, $[18] = t6, $[19] = t7;
|
|
7225
|
+
} else
|
|
7226
|
+
t6 = $[18], t7 = $[19];
|
|
7227
|
+
let t8;
|
|
7228
|
+
$[20] !== t6 || $[21] !== t7 ? (t8 = [t6, t7], $[20] = t6, $[21] = t7, $[22] = t8) : t8 = $[22], t5 = t8;
|
|
7229
|
+
const [itemPath, itemKey] = t5, itemState = tree.state[itemKey], focused = tree.focusedElement === rootElement, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootElement ? 0 : -1;
|
|
7230
|
+
let t9;
|
|
7231
|
+
const t10 = tree.level + 1;
|
|
7232
|
+
let t11;
|
|
7233
|
+
$[23] !== tree || $[24] !== t10 || $[25] !== itemPath ? (t11 = {
|
|
7084
7234
|
...tree,
|
|
7085
|
-
level:
|
|
7235
|
+
level: t10,
|
|
7086
7236
|
path: itemPath
|
|
7087
|
-
}
|
|
7237
|
+
}, $[23] = tree, $[24] = t10, $[25] = itemPath, $[26] = t11) : t11 = $[26], t9 = t11;
|
|
7238
|
+
const contextValue = t9;
|
|
7239
|
+
let t12;
|
|
7240
|
+
$[27] !== onClick || $[28] !== setExpanded || $[29] !== itemKey || $[30] !== expanded || $[31] !== setFocusedElement || $[32] !== rootElement ? (t12 = (event) => {
|
|
7088
7241
|
onClick && onClick(event);
|
|
7089
7242
|
const target = event.target;
|
|
7090
7243
|
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
|
|
7091
|
-
}, [
|
|
7244
|
+
}, $[27] = onClick, $[28] = setExpanded, $[29] = itemKey, $[30] = expanded, $[31] = setFocusedElement, $[32] = rootElement, $[33] = t12) : t12 = $[33];
|
|
7245
|
+
const handleClick = t12;
|
|
7246
|
+
let t13;
|
|
7247
|
+
$[34] !== focused || $[35] !== rootElement ? (t13 = (event_0) => {
|
|
7092
7248
|
focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
|
|
7093
|
-
}, [focused, rootElement]);
|
|
7094
|
-
|
|
7249
|
+
}, $[34] = focused, $[35] = rootElement, $[36] = t13) : t13 = $[36];
|
|
7250
|
+
const handleKeyDown = t13;
|
|
7251
|
+
let t14, t15;
|
|
7252
|
+
$[37] !== rootElement || $[38] !== registerItem || $[39] !== itemPath || $[40] !== expanded || $[41] !== selected ? (t14 = () => {
|
|
7095
7253
|
if (rootElement)
|
|
7096
7254
|
return registerItem(rootElement, itemPath.join("/"), expanded, selected);
|
|
7097
|
-
}, [expanded, itemPath, registerItem, rootElement, selected]);
|
|
7098
|
-
const
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
] });
|
|
7255
|
+
}, t15 = [expanded, itemPath, registerItem, rootElement, selected], $[37] = rootElement, $[38] = registerItem, $[39] = itemPath, $[40] = expanded, $[41] = selected, $[42] = t14, $[43] = t15) : (t14 = $[42], t15 = $[43]), react.useEffect(t14, t15);
|
|
7256
|
+
const t16 = IconComponent || children ? "visible" : "hidden";
|
|
7257
|
+
let t17;
|
|
7258
|
+
$[44] !== t16 ? (t17 = {
|
|
7259
|
+
visibility: t16,
|
|
7260
|
+
pointerEvents: "none"
|
|
7261
|
+
}, $[44] = t16, $[45] = t17) : t17 = $[45];
|
|
7262
|
+
let t18;
|
|
7263
|
+
$[46] !== IconComponent || $[47] !== muted || $[48] !== fontSize2 || $[49] !== weight ? (t18 = IconComponent && /* @__PURE__ */ jsxRuntime.jsx(Text, { muted, size: fontSize2, weight, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {}) }), $[46] = IconComponent, $[47] = muted, $[48] = fontSize2, $[49] = weight, $[50] = t18) : t18 = $[50];
|
|
7264
|
+
let t19;
|
|
7265
|
+
$[51] !== IconComponent || $[52] !== expanded || $[53] !== muted || $[54] !== fontSize2 || $[55] !== weight ? (t19 = !IconComponent && /* @__PURE__ */ jsxRuntime.jsx(ToggleArrowText, { muted, size: fontSize2, weight, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ToggleArrowRightIcon, { style: {
|
|
7266
|
+
transform: expanded ? "rotate(90deg)" : void 0
|
|
7267
|
+
} }) }), $[51] = IconComponent, $[52] = expanded, $[53] = muted, $[54] = fontSize2, $[55] = weight, $[56] = t19) : t19 = $[56];
|
|
7268
|
+
let t20;
|
|
7269
|
+
$[57] !== space || $[58] !== t17 || $[59] !== t18 || $[60] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { marginRight: space, style: t17, children: [
|
|
7270
|
+
t18,
|
|
7271
|
+
t19
|
|
7272
|
+
] }), $[57] = space, $[58] = t17, $[59] = t18, $[60] = t19, $[61] = t20) : t20 = $[61];
|
|
7273
|
+
let t21;
|
|
7274
|
+
$[62] !== muted || $[63] !== fontSize2 || $[64] !== weight || $[65] !== text ? (t21 = /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { muted, size: fontSize2, textOverflow: "ellipsis", weight, children: text }) }), $[62] = muted, $[63] = fontSize2, $[64] = weight, $[65] = text, $[66] = t21) : t21 = $[66];
|
|
7275
|
+
let t22;
|
|
7276
|
+
$[67] !== padding || $[68] !== t20 || $[69] !== t21 ? (t22 = /* @__PURE__ */ jsxRuntime.jsxs(Flex, { padding, children: [
|
|
7277
|
+
t20,
|
|
7278
|
+
t21
|
|
7279
|
+
] }), $[67] = padding, $[68] = t20, $[69] = t21, $[70] = t22) : t22 = $[70];
|
|
7280
|
+
const content = t22;
|
|
7281
|
+
if (href) {
|
|
7282
|
+
const t232 = selected ? "" : void 0;
|
|
7283
|
+
let t242;
|
|
7284
|
+
$[71] !== tree.level || $[72] !== expanded || $[73] !== linkAs || $[74] !== href || $[75] !== tabIndex || $[76] !== content ? (t242 = /* @__PURE__ */ jsxRuntime.jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content }), $[71] = tree.level, $[72] = expanded, $[73] = linkAs, $[74] = href, $[75] = tabIndex, $[76] = content, $[77] = t242) : t242 = $[77];
|
|
7285
|
+
let t252;
|
|
7286
|
+
$[78] !== children || $[79] !== expanded ? (t252 = children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { hidden: !expanded, children }), $[78] = children, $[79] = expanded, $[80] = t252) : t252 = $[80];
|
|
7287
|
+
let t262;
|
|
7288
|
+
$[81] !== contextValue || $[82] !== t252 ? (t262 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t252 }), $[81] = contextValue, $[82] = t252, $[83] = t262) : t262 = $[83];
|
|
7289
|
+
let t272;
|
|
7290
|
+
return $[84] !== t232 || $[85] !== id || $[86] !== itemKey || $[87] !== restProps || $[88] !== handleClick || $[89] !== t242 || $[90] !== t262 ? (t272 = /* @__PURE__ */ jsxRuntime.jsxs(Root, { "data-selected": t232, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: setRootElement, role: "none", children: [
|
|
7291
|
+
t242,
|
|
7292
|
+
t262
|
|
7293
|
+
] }), $[84] = t232, $[85] = id, $[86] = itemKey, $[87] = restProps, $[88] = handleClick, $[89] = t242, $[90] = t262, $[91] = t272) : t272 = $[91], t272;
|
|
7294
|
+
}
|
|
7295
|
+
const t23 = selected ? "" : void 0;
|
|
7296
|
+
let t24;
|
|
7297
|
+
$[92] !== tree.level || $[93] !== content ? (t24 = /* @__PURE__ */ jsxRuntime.jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content }), $[92] = tree.level, $[93] = content, $[94] = t24) : t24 = $[94];
|
|
7298
|
+
let t25;
|
|
7299
|
+
$[95] !== children || $[96] !== expanded ? (t25 = children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }), $[95] = children, $[96] = expanded, $[97] = t25) : t25 = $[97];
|
|
7300
|
+
let t26;
|
|
7301
|
+
$[98] !== contextValue || $[99] !== t25 ? (t26 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t25 }), $[98] = contextValue, $[99] = t25, $[100] = t26) : t26 = $[100];
|
|
7302
|
+
let t27;
|
|
7303
|
+
return $[101] !== t23 || $[102] !== id || $[103] !== itemKey || $[104] !== restProps || $[105] !== expanded || $[106] !== handleClick || $[107] !== handleKeyDown || $[108] !== tabIndex || $[109] !== t24 || $[110] !== t26 ? (t27 = /* @__PURE__ */ jsxRuntime.jsxs(Root, { "data-selected": t23, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: setRootElement, role: "treeitem", tabIndex, children: [
|
|
7304
|
+
t24,
|
|
7305
|
+
t26
|
|
7306
|
+
] }), $[101] = t23, $[102] = id, $[103] = itemKey, $[104] = restProps, $[105] = expanded, $[106] = handleClick, $[107] = handleKeyDown, $[108] = tabIndex, $[109] = t24, $[110] = t26, $[111] = t27) : t27 = $[111], t27;
|
|
7117
7307
|
});
|
|
7118
7308
|
TreeItem.displayName = "Memo(TreeItem)";
|
|
7119
7309
|
exports.Arrow = Arrow;
|