@sanity/ui 4.0.0-static.33 → 4.0.0-static.35
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.ts +6 -20
- package/dist/index.js +284 -230
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/core/components/dialog/Dialog.tsx +16 -7
- package/src/core/components/dialog/DialogCard.tsx +4 -4
- package/src/core/components/dialog/DialogProvider.tsx +1 -1
- package/src/core/components/menu/Menu.test.tsx +6 -6
- package/src/core/components/menu/Menu.tsx +2 -2
- package/src/core/components/toast/Toast.test.tsx +6 -6
- package/src/core/components/toast/ToastProvider.tsx +2 -2
- package/src/core/components/tree/Tree.tsx +2 -2
- package/src/core/components/tree/TreeItem.tsx +4 -4
- package/src/core/helpers/props.ts +0 -9
- package/src/core/hooks/useResponsiveProp.ts +4 -17
- package/src/core/index.ts +4 -5
- package/src/core/primitives/avatar/Avatar.tsx +2 -2
- package/src/core/primitives/card/CardProvider.tsx +2 -11
- package/src/core/primitives/card/useCard.ts +8 -3
- package/src/core/primitives/layer/Layer.test.tsx +6 -6
- package/src/core/primitives/layer/LayerProvider.tsx +3 -3
- package/src/core/primitives/popover/Popover.tsx +22 -17
- package/src/core/primitives/textInput/TextInput.tsx +73 -53
- package/src/core/primitives/tooltip/Tooltip.tsx +30 -20
- package/src/core/primitives/tooltip/tooltipDelayGroup/TooltipDelayGroupProvider.tsx +1 -3
- package/src/core/utils/boundaryElement/BoundaryElementContext.ts +2 -5
- package/src/core/utils/boundaryElement/BoundaryElementProvider.tsx +2 -4
- package/src/core/utils/boundaryElement/types.ts +1 -4
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +6 -18
- package/src/core/utils/portal/Portal.tsx +6 -3
- package/src/core/utils/portal/usePortal.ts +9 -2
- package/src/core/utils/boundaryElement/BoundaryElement.test.tsx +0 -102
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { SpinnerIcon, CloseIcon, ChevronDownIcon, ChevronRightIcon, ToggleArrowRightIcon, CheckmarkIcon, RemoveIcon } from "@sanity/icons";
|
|
4
|
-
import {
|
|
4
|
+
import { isValidElement, useDebugValue, useSyncExternalStore, createContext, use, useRef, useImperativeHandle, useEffect, useState, cloneElement, useReducer, Children, Fragment as Fragment$1, startTransition, useId, lazy, Suspense, useLayoutEffect, Component } from "react";
|
|
5
5
|
import { box, text, textOverflow, animatedSpinnerIcon, spinner, button, buttonLoadingBox, _arrow, vars, _arrowSvg, _arrowStrokeMask, _arrowStroke, _arrowShape, card, BREAKPOINTS, popoverCard, popover, _selectable, stack, textInput, textInputPrefix, textInputElement, _inputElement, _inputPresentation, textInputSuffix, breadcrumbs, container as container$1, dialogCard, dialogHeader, dialogContent, dialogScrollerShadowTop, dialogScroller, dialogScrollerShadowBottom, dialogFooter, dialog, dialogContainer, kbd, menu, menuDivider, toast, toastLayer, treeItem, label, avatar, avatarArrow, avatarInitials, avatarImage, avatarImageOutline, avatarCounter, avatarStack, badge, checkbox, checkboxInput, checkboxPresentation, code, heading, radio, radioInput, radioPresentation, select, selectPresentation, skeleton, codeSkeleton, headingSkeleton, labelSkeleton, textSkeleton, srOnly, _switch, _switchElement, _switchPresentation, _switchTrack, _switchThumb, textArea, tooltip, root } from "@sanity/ui/css";
|
|
6
6
|
import { isValidElementType } from "react-is";
|
|
7
7
|
import { detectOverflow, useFloating, autoPlacement, flip, offset, shift, arrow, hide, autoUpdate } from "@floating-ui/react-dom";
|
|
@@ -119,18 +119,13 @@ function isArray(val) {
|
|
|
119
119
|
function isRecord(value) {
|
|
120
120
|
return !!(value && typeof value == "object" && !Array.isArray(value));
|
|
121
121
|
}
|
|
122
|
-
function _getArrayProp(val, defaultVal) {
|
|
123
|
-
return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
|
|
124
|
-
}
|
|
125
122
|
function _getResponsiveProp(val, defaultVal) {
|
|
126
123
|
return val === void 0 ? defaultVal || EMPTY_ARRAY : isArray(val) || isRecord(val) ? val : [val];
|
|
127
124
|
}
|
|
128
125
|
function useResponsiveProp(val, defaultVal) {
|
|
129
126
|
const $ = c(3);
|
|
130
127
|
let t0;
|
|
131
|
-
$[0] !== defaultVal || $[1] !== val ? (t0 =
|
|
132
|
-
const [t1, setCache] = useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
|
|
133
|
-
return hash !== cachedHash && setCache([_getResponsiveProp(val, defaultVal), hash]), cachedVal;
|
|
128
|
+
return $[0] !== defaultVal || $[1] !== val ? (t0 = _getResponsiveProp(val, defaultVal), $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2], t0;
|
|
134
129
|
}
|
|
135
130
|
const DEFAULT_BOX_ELEMENT = "div";
|
|
136
131
|
function Box(props) {
|
|
@@ -492,16 +487,7 @@ function createGlobalScopedContext(key2, defaultValue) {
|
|
|
492
487
|
const symbolMap = globalScope;
|
|
493
488
|
return symbolMap[symbol] = symbolMap[symbol] || createContext(defaultValue), symbolMap[symbol];
|
|
494
489
|
}
|
|
495
|
-
const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/v4/boundaryElement", null)
|
|
496
|
-
version: 0,
|
|
497
|
-
element: null
|
|
498
|
-
};
|
|
499
|
-
function useBoundaryElement() {
|
|
500
|
-
const value = use(BoundaryElementContext);
|
|
501
|
-
if (value && (!isRecord(value) || value.version !== 0))
|
|
502
|
-
throw new Error("useBoundaryElement(): the context value is not compatible");
|
|
503
|
-
return value || DEFAULT_VALUE;
|
|
504
|
-
}
|
|
490
|
+
const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/v4/boundaryElement", null);
|
|
505
491
|
function getElementRef(element) {
|
|
506
492
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
507
493
|
return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
|
|
@@ -520,15 +506,18 @@ function CardProvider(props) {
|
|
|
520
506
|
scheme,
|
|
521
507
|
unstable_CompatProvider
|
|
522
508
|
}, $[0] = scheme, $[1] = tone, $[2] = unstable_CompatProvider, $[3] = t0) : t0 = $[3];
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
return $[4] !== children || $[5] !== t1 ? (t2 = /* @__PURE__ */ jsx(CardContext.Provider, { value: t1, children }), $[4] = children, $[5] = t1, $[6] = t2) : t2 = $[6], t2;
|
|
509
|
+
let t1;
|
|
510
|
+
return $[4] !== children || $[5] !== t0 ? (t1 = /* @__PURE__ */ jsx(CardContext, { value: t0, children }), $[4] = children, $[5] = t0, $[6] = t1) : t1 = $[6], t1;
|
|
526
511
|
}
|
|
527
512
|
function useCard() {
|
|
528
513
|
const card2 = use(CardContext);
|
|
514
|
+
return assertCardContext(card2), card2;
|
|
515
|
+
}
|
|
516
|
+
function assertCardContext(card2) {
|
|
529
517
|
if (!card2)
|
|
530
|
-
throw new Error("useCard(): missing context value"
|
|
531
|
-
|
|
518
|
+
throw new Error("useCard(): missing context value", {
|
|
519
|
+
cause: card2
|
|
520
|
+
});
|
|
532
521
|
}
|
|
533
522
|
const key = "@sanity/ui/v4/portal", elementKey = Symbol.for(`${key}/element`), elementMap = globalScope;
|
|
534
523
|
elementMap[elementKey] = null;
|
|
@@ -541,19 +530,23 @@ const defaultContextValue = {
|
|
|
541
530
|
}, PortalContext = createGlobalScopedContext(key, defaultContextValue);
|
|
542
531
|
function usePortal() {
|
|
543
532
|
const value = use(PortalContext);
|
|
533
|
+
return assertPortalContext(value), value;
|
|
534
|
+
}
|
|
535
|
+
function assertPortalContext(value) {
|
|
544
536
|
if (!value)
|
|
545
537
|
throw new Error("usePortal(): missing context value");
|
|
546
538
|
if (!isRecord(value) || value.version !== 0)
|
|
547
539
|
throw new Error("usePortal(): the context value is not compatible");
|
|
548
|
-
return value;
|
|
549
540
|
}
|
|
550
541
|
function Portal(props) {
|
|
551
542
|
const $ = c(6), {
|
|
552
543
|
children,
|
|
553
544
|
__unstable_name: name
|
|
554
|
-
} = props,
|
|
545
|
+
} = props, portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default;
|
|
555
546
|
if (!portalElement)
|
|
556
547
|
return null;
|
|
548
|
+
const card2 = use(CardContext);
|
|
549
|
+
assertCardContext(card2);
|
|
557
550
|
let t0;
|
|
558
551
|
$[0] !== card2.scheme || $[1] !== children ? (t0 = /* @__PURE__ */ jsx(CardProvider, { tone: "transparent", scheme: card2.scheme, children }), $[0] = card2.scheme, $[1] = children, $[2] = t0) : t0 = $[2];
|
|
559
552
|
let t1;
|
|
@@ -891,18 +884,21 @@ function useMediaIndex() {
|
|
|
891
884
|
return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
|
|
892
885
|
}
|
|
893
886
|
function LayerProvider(props) {
|
|
894
|
-
const $ = c(
|
|
887
|
+
const $ = c(21), {
|
|
895
888
|
children,
|
|
896
889
|
zOffset: t0
|
|
897
890
|
} = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = use(LayerContext);
|
|
898
891
|
let t1;
|
|
899
892
|
$[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
|
|
900
|
-
const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1
|
|
893
|
+
const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1;
|
|
901
894
|
let t2;
|
|
902
|
-
$[2]
|
|
903
|
-
const
|
|
895
|
+
$[2] !== zOffsetProp ? (t2 = _getResponsiveProp(zOffsetProp), $[2] = zOffsetProp, $[3] = t2) : t2 = $[3];
|
|
896
|
+
const zOffset = t2, maxMediaIndex = Object.values(zOffset).length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + (zOffset[mediaIndex] ?? 0) : zOffset[mediaIndex] ?? 0;
|
|
904
897
|
let t3;
|
|
905
|
-
$[
|
|
898
|
+
$[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[4] = t3) : t3 = $[4];
|
|
899
|
+
const [, setChildLayers] = useState(t3), [size2, setSize] = useState(0), isTopLayer = size2 === 0;
|
|
900
|
+
let t4;
|
|
901
|
+
$[5] !== parentRegisterChild || $[6] !== setChildLayers ? (t4 = (childLevel) => {
|
|
906
902
|
const parentDispose = parentRegisterChild?.(childLevel);
|
|
907
903
|
return childLevel !== void 0 ? setChildLayers((state) => {
|
|
908
904
|
const prevLen = state[childLevel] ?? 0, nextState = {
|
|
@@ -918,22 +914,22 @@ function LayerProvider(props) {
|
|
|
918
914
|
return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
|
|
919
915
|
}) : setSize(_temp2$3), parentDispose?.();
|
|
920
916
|
};
|
|
921
|
-
}, $[
|
|
922
|
-
const registerChild =
|
|
923
|
-
let
|
|
924
|
-
$[
|
|
925
|
-
let
|
|
926
|
-
$[
|
|
917
|
+
}, $[5] = parentRegisterChild, $[6] = setChildLayers, $[7] = t4) : t4 = $[7];
|
|
918
|
+
const registerChild = t4;
|
|
919
|
+
let t5, t6;
|
|
920
|
+
$[8] !== level || $[9] !== parentRegisterChild ? (t5 = () => parentRegisterChild?.(level), t6 = [level, parentRegisterChild], $[8] = level, $[9] = parentRegisterChild, $[10] = t5, $[11] = t6) : (t5 = $[10], t6 = $[11]), useEffect(t5, t6);
|
|
921
|
+
let t7;
|
|
922
|
+
$[12] !== isTopLayer || $[13] !== level || $[14] !== registerChild || $[15] !== size2 || $[16] !== zIndex ? (t7 = {
|
|
927
923
|
version: 0,
|
|
928
924
|
isTopLayer,
|
|
929
925
|
level,
|
|
930
926
|
registerChild,
|
|
931
927
|
size: size2,
|
|
932
928
|
zIndex
|
|
933
|
-
}, $[
|
|
934
|
-
const value =
|
|
935
|
-
let
|
|
936
|
-
return $[
|
|
929
|
+
}, $[12] = isTopLayer, $[13] = level, $[14] = registerChild, $[15] = size2, $[16] = zIndex, $[17] = t7) : t7 = $[17];
|
|
930
|
+
const value = t7;
|
|
931
|
+
let t8;
|
|
932
|
+
return $[18] !== children || $[19] !== value ? (t8 = /* @__PURE__ */ jsx(LayerContext, { value, children }), $[18] = children, $[19] = value, $[20] = t8) : t8 = $[20], t8;
|
|
937
933
|
}
|
|
938
934
|
function _temp2$3(v_0) {
|
|
939
935
|
return v_0 - 1;
|
|
@@ -1039,7 +1035,7 @@ function ViewportOverlay() {
|
|
|
1039
1035
|
} }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
|
|
1040
1036
|
}
|
|
1041
1037
|
function Popover(props) {
|
|
1042
|
-
const $ = c(
|
|
1038
|
+
const $ = c(113), t0 = props;
|
|
1043
1039
|
let _fallbackPlacements, _floatingBoundary, _referenceBoundary, childProp, className, content2, disabled, forwardedRef, matchReferenceWidth, modal, open, padding, portal, referenceElement, rest, scheme, t1, t10, t11, t12, t13, t14, t2, t3, t4, t5, t6, t7, t8, t9, updateRef;
|
|
1044
1040
|
if ($[0] !== t0) {
|
|
1045
1041
|
const {
|
|
@@ -1079,12 +1075,15 @@ function Popover(props) {
|
|
|
1079
1075
|
t1 = t152, t2 = t162, t3 = t172, t4 = t182, childProp = t192, className = t202, t5 = t212, content2 = t222, disabled = t232, _fallbackPlacements = t242, matchReferenceWidth = t252, _floatingBoundary = t262, modal = t272, open = t282, t6 = t292, padding = t302, t7 = t312, t8 = t32, portal = t33, t9 = t34, t10 = t35, forwardedRef = t36, _referenceBoundary = t37, referenceElement = t38, scheme = t39, t11 = t40, t12 = t41, t13 = t42, t14 = t43, updateRef = t44, rest = t45, $[0] = t0, $[1] = _fallbackPlacements, $[2] = _floatingBoundary, $[3] = _referenceBoundary, $[4] = childProp, $[5] = className, $[6] = content2, $[7] = disabled, $[8] = forwardedRef, $[9] = matchReferenceWidth, $[10] = modal, $[11] = open, $[12] = padding, $[13] = portal, $[14] = referenceElement, $[15] = rest, $[16] = scheme, $[17] = t1, $[18] = t10, $[19] = t11, $[20] = t12, $[21] = t13, $[22] = t14, $[23] = t2, $[24] = t3, $[25] = t4, $[26] = t5, $[27] = t6, $[28] = t7, $[29] = t8, $[30] = t9, $[31] = updateRef;
|
|
1080
1076
|
} else
|
|
1081
1077
|
_fallbackPlacements = $[1], _floatingBoundary = $[2], _referenceBoundary = $[3], childProp = $[4], className = $[5], content2 = $[6], disabled = $[7], forwardedRef = $[8], matchReferenceWidth = $[9], modal = $[10], open = $[11], padding = $[12], portal = $[13], referenceElement = $[14], rest = $[15], scheme = $[16], t1 = $[17], t10 = $[18], t11 = $[19], t12 = $[20], t13 = $[21], t14 = $[22], t2 = $[23], t3 = $[24], t4 = $[25], t5 = $[26], t6 = $[27], t7 = $[28], t8 = $[29], t9 = $[30], updateRef = $[31];
|
|
1082
|
-
const margins = t1 === void 0 ? DEFAULT_POPOVER_MARGINS : t1, _animate = t2 === void 0 ? !1 : t2, arrowProp = t3 === void 0 ? !1 : t3, as = t4 === void 0 ? DEFAULT_POPOVER_ELEMENT : t4, constrainSize = t5 === void 0 ? !1 : t5, overflow = t6 === void 0 ? "hidden" : t6, placementProp = t7 === void 0 ? "bottom" : t7, placementStrategy = t8 === void 0 ? "flip" : t8, preventOverflow = t9 === void 0 ? !0 : t9, radius = t10 === void 0 ? 3 : t10, shadow = t11 === void 0 ? 3 : t11, tone = t12 === void 0 ? "inherit" : t12, widthProp = t13 === void 0 ? "auto" : t13, zOffsetProp = t14 === void 0 ? Z_OFFSETS.popover : t14, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ??
|
|
1078
|
+
const margins = t1 === void 0 ? DEFAULT_POPOVER_MARGINS : t1, _animate = t2 === void 0 ? !1 : t2, arrowProp = t3 === void 0 ? !1 : t3, as = t4 === void 0 ? DEFAULT_POPOVER_ELEMENT : t4, constrainSize = t5 === void 0 ? !1 : t5, overflow = t6 === void 0 ? "hidden" : t6, placementProp = t7 === void 0 ? "bottom" : t7, placementStrategy = t8 === void 0 ? "flip" : t8, preventOverflow = t9 === void 0 ? !0 : t9, radius = t10 === void 0 ? 3 : t10, shadow = t11 === void 0 ? 3 : t11, tone = t12 === void 0 ? "inherit" : t12, widthProp = t13 === void 0 ? "auto" : t13, zOffsetProp = t14 === void 0 ? Z_OFFSETS.popover : t14, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? use(BoundaryElementContext), referenceBoundary = _referenceBoundary ?? use(BoundaryElementContext), animate = usePrefersReducedMotion() ? !1 : _animate;
|
|
1083
1079
|
let t15;
|
|
1084
|
-
$[32]
|
|
1085
|
-
const
|
|
1080
|
+
$[32] !== zOffsetProp ? (t15 = _getResponsiveProp(zOffsetProp), $[32] = zOffsetProp, $[33] = t15) : t15 = $[33];
|
|
1081
|
+
const zOffset = t15, ref = useRef(null), arrowRef = useRef(null);
|
|
1086
1082
|
let t16;
|
|
1087
|
-
$[
|
|
1083
|
+
$[34] === Symbol.for("react.memo_cache_sentinel") ? (t16 = () => ref.current, $[34] = t16) : t16 = $[34], useImperativeHandle(forwardedRef, t16);
|
|
1084
|
+
const referenceWidthRef = useRef(void 0);
|
|
1085
|
+
let t17;
|
|
1086
|
+
$[35] !== animate || $[36] !== arrowProp || $[37] !== constrainSize || $[38] !== fallbackPlacements || $[39] !== floatingBoundary || $[40] !== margins || $[41] !== matchReferenceWidth || $[42] !== placementProp || $[43] !== placementStrategy || $[44] !== preventOverflow || $[45] !== referenceBoundary ? (t17 = {
|
|
1088
1087
|
animate,
|
|
1089
1088
|
arrowProp,
|
|
1090
1089
|
arrowRef,
|
|
@@ -1099,19 +1098,19 @@ function Popover(props) {
|
|
|
1099
1098
|
referenceBoundary,
|
|
1100
1099
|
referenceWidthRef,
|
|
1101
1100
|
rootBoundary: "viewport"
|
|
1102
|
-
}, $[
|
|
1103
|
-
const middleware = useMiddleware$1(
|
|
1104
|
-
let t17;
|
|
1105
|
-
$[45] !== referenceElement ? (t17 = referenceElement ? {
|
|
1106
|
-
reference: referenceElement
|
|
1107
|
-
} : void 0, $[45] = referenceElement, $[46] = t17) : t17 = $[46];
|
|
1101
|
+
}, $[35] = animate, $[36] = arrowProp, $[37] = constrainSize, $[38] = fallbackPlacements, $[39] = floatingBoundary, $[40] = margins, $[41] = matchReferenceWidth, $[42] = placementProp, $[43] = placementStrategy, $[44] = preventOverflow, $[45] = referenceBoundary, $[46] = t17) : t17 = $[46];
|
|
1102
|
+
const middleware = useMiddleware$1(t17);
|
|
1108
1103
|
let t18;
|
|
1109
|
-
$[47] !==
|
|
1104
|
+
$[47] !== referenceElement ? (t18 = referenceElement ? {
|
|
1105
|
+
reference: referenceElement
|
|
1106
|
+
} : void 0, $[47] = referenceElement, $[48] = t18) : t18 = $[48];
|
|
1107
|
+
let t19;
|
|
1108
|
+
$[49] !== middleware || $[50] !== placementProp || $[51] !== t18 ? (t19 = {
|
|
1110
1109
|
middleware,
|
|
1111
1110
|
placement: placementProp,
|
|
1112
1111
|
whileElementsMounted: autoUpdate,
|
|
1113
|
-
elements:
|
|
1114
|
-
}, $[
|
|
1112
|
+
elements: t18
|
|
1113
|
+
}, $[49] = middleware, $[50] = placementProp, $[51] = t18, $[52] = t19) : t19 = $[52];
|
|
1115
1114
|
const {
|
|
1116
1115
|
x,
|
|
1117
1116
|
y,
|
|
@@ -1120,61 +1119,71 @@ function Popover(props) {
|
|
|
1120
1119
|
refs,
|
|
1121
1120
|
strategy,
|
|
1122
1121
|
update
|
|
1123
|
-
} = useFloating(
|
|
1124
|
-
let t19;
|
|
1125
|
-
$[51] !== refs ? (t19 = (node) => {
|
|
1126
|
-
ref.current = node, refs.setFloating(node);
|
|
1127
|
-
}, $[51] = refs, $[52] = t19) : t19 = $[52];
|
|
1128
|
-
const setFloating = t19;
|
|
1122
|
+
} = useFloating(t19), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY;
|
|
1129
1123
|
let t20;
|
|
1130
|
-
$[53] !==
|
|
1124
|
+
$[53] !== refs ? (t20 = (node) => {
|
|
1125
|
+
ref.current = node, refs.setFloating(node);
|
|
1126
|
+
}, $[53] = refs, $[54] = t20) : t20 = $[54];
|
|
1127
|
+
const setFloating = t20;
|
|
1131
1128
|
let t21;
|
|
1132
|
-
$[55] !==
|
|
1129
|
+
$[55] !== childProp ? (t21 = childProp ? getElementRef(childProp) : null, $[55] = childProp, $[56] = t21) : t21 = $[56];
|
|
1133
1130
|
let t22;
|
|
1131
|
+
$[57] !== refs.reference.current ? (t22 = () => refs.reference.current, $[57] = refs.reference.current, $[58] = t22) : t22 = $[58], useImperativeHandle(t21, t22);
|
|
1132
|
+
let t23;
|
|
1134
1133
|
bb0: {
|
|
1135
1134
|
if (referenceElement) {
|
|
1136
|
-
|
|
1135
|
+
t23 = childProp;
|
|
1137
1136
|
break bb0;
|
|
1138
1137
|
}
|
|
1139
1138
|
if (!childProp) {
|
|
1140
|
-
|
|
1139
|
+
t23 = null;
|
|
1141
1140
|
break bb0;
|
|
1142
1141
|
}
|
|
1143
|
-
let
|
|
1144
|
-
$[
|
|
1142
|
+
let t242;
|
|
1143
|
+
$[59] !== childProp || $[60] !== refs.setReference ? (t242 = cloneElement(childProp, {
|
|
1145
1144
|
ref: refs.setReference
|
|
1146
|
-
}), $[
|
|
1145
|
+
}), $[59] = childProp, $[60] = refs.setReference, $[61] = t242) : t242 = $[61], t23 = t242;
|
|
1147
1146
|
}
|
|
1148
|
-
const child =
|
|
1149
|
-
let
|
|
1150
|
-
if ($[
|
|
1151
|
-
let
|
|
1152
|
-
return $[
|
|
1147
|
+
const child = t23;
|
|
1148
|
+
let t24, t25;
|
|
1149
|
+
if ($[62] !== update ? (t24 = () => update, t25 = [update], $[62] = update, $[63] = t24, $[64] = t25) : (t24 = $[63], t25 = $[64]), useImperativeHandle(updateRef, t24, t25), disabled) {
|
|
1150
|
+
let t262;
|
|
1151
|
+
return $[65] !== childProp ? (t262 = childProp || /* @__PURE__ */ jsx(Fragment, {}), $[65] = childProp, $[66] = t262) : t262 = $[66], t262;
|
|
1153
1152
|
}
|
|
1154
|
-
let t25;
|
|
1155
|
-
$[65] !== modal ? (t25 = modal && /* @__PURE__ */ jsx(ViewportOverlay, {}), $[65] = modal, $[66] = t25) : t25 = $[66];
|
|
1156
1153
|
let t26;
|
|
1157
|
-
$[67] !==
|
|
1158
|
-
className
|
|
1159
|
-
}), $[67] = className, $[68] = t26) : t26 = $[68];
|
|
1154
|
+
$[67] !== modal ? (t26 = modal && /* @__PURE__ */ jsx(ViewportOverlay, {}), $[67] = modal, $[68] = t26) : t26 = $[68];
|
|
1160
1155
|
let t27;
|
|
1161
|
-
$[69] !==
|
|
1156
|
+
$[69] !== className ? (t27 = popover({
|
|
1157
|
+
className
|
|
1158
|
+
}), $[69] = className, $[70] = t27) : t27 = $[70];
|
|
1162
1159
|
let t28;
|
|
1163
|
-
$[
|
|
1164
|
-
t25,
|
|
1165
|
-
t27
|
|
1166
|
-
] }), $[95] = t25, $[96] = t27, $[97] = t28) : t28 = $[97];
|
|
1167
|
-
const node_0 = t28;
|
|
1160
|
+
$[71] !== animate || $[72] !== arrowProp || $[73] !== arrowX || $[74] !== arrowY || $[75] !== as || $[76] !== content2 || $[77] !== margins || $[78] !== originX || $[79] !== originY || $[80] !== overflow || $[81] !== padding || $[82] !== placement || $[83] !== radius || $[84] !== referenceHidden || $[85] !== rest || $[86] !== scheme || $[87] !== setFloating || $[88] !== shadow || $[89] !== strategy || $[90] !== t27 || $[91] !== tone || $[92] !== widthProp || $[93] !== x || $[94] !== y || $[95] !== zOffset ? (t28 = /* @__PURE__ */ jsx(PopoverLayer, { ...rest, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef, arrowX, arrowY, as, className: t27, hidden: referenceHidden, maxWidth: widthProp, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, tone, strategy, x, y, zOffset, children: content2 }), $[71] = animate, $[72] = arrowProp, $[73] = arrowX, $[74] = arrowY, $[75] = as, $[76] = content2, $[77] = margins, $[78] = originX, $[79] = originY, $[80] = overflow, $[81] = padding, $[82] = placement, $[83] = radius, $[84] = referenceHidden, $[85] = rest, $[86] = scheme, $[87] = setFloating, $[88] = shadow, $[89] = strategy, $[90] = t27, $[91] = tone, $[92] = widthProp, $[93] = x, $[94] = y, $[95] = zOffset, $[96] = t28) : t28 = $[96];
|
|
1168
1161
|
let t29;
|
|
1169
|
-
$[
|
|
1170
|
-
|
|
1162
|
+
$[97] !== t26 || $[98] !== t28 ? (t29 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1163
|
+
t26,
|
|
1164
|
+
t28
|
|
1165
|
+
] }), $[97] = t26, $[98] = t28, $[99] = t29) : t29 = $[99];
|
|
1166
|
+
const node_0 = t29;
|
|
1167
|
+
let children = open ? node_0 : null;
|
|
1168
|
+
if (open && portal) {
|
|
1169
|
+
let resolvedTone = tone;
|
|
1170
|
+
if (tone === "inherit") {
|
|
1171
|
+
const card2 = use(CardContext);
|
|
1172
|
+
assertCardContext(card2), resolvedTone = card2.tone;
|
|
1173
|
+
}
|
|
1174
|
+
const t302 = typeof portal == "string" ? portal : void 0, t312 = scheme ?? "light";
|
|
1175
|
+
let t32;
|
|
1176
|
+
$[100] !== node_0 || $[101] !== resolvedTone || $[102] !== t312 ? (t32 = /* @__PURE__ */ jsx(CardProvider, { tone: resolvedTone, scheme: t312, children: node_0 }), $[100] = node_0, $[101] = resolvedTone, $[102] = t312, $[103] = t32) : t32 = $[103];
|
|
1177
|
+
let t33;
|
|
1178
|
+
$[104] !== t302 || $[105] !== t32 ? (t33 = /* @__PURE__ */ jsx(Portal, { __unstable_name: t302, children: t32 }), $[104] = t302, $[105] = t32, $[106] = t33) : t33 = $[106], children = t33;
|
|
1179
|
+
}
|
|
1171
1180
|
let t30;
|
|
1172
|
-
$[
|
|
1181
|
+
$[107] !== animate || $[108] !== children ? (t30 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[107] = animate, $[108] = children, $[109] = t30) : t30 = $[109];
|
|
1173
1182
|
let t31;
|
|
1174
|
-
return $[
|
|
1183
|
+
return $[110] !== child || $[111] !== t30 ? (t31 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1175
1184
|
t30,
|
|
1176
1185
|
child
|
|
1177
|
-
] }), $[
|
|
1186
|
+
] }), $[110] = child, $[111] = t30, $[112] = t31) : t31 = $[112], t31;
|
|
1178
1187
|
}
|
|
1179
1188
|
function useMiddleware$1(t0) {
|
|
1180
1189
|
const $ = c(36), {
|
|
@@ -1304,7 +1313,7 @@ function useCustomValidity(ref, customValidity) {
|
|
|
1304
1313
|
}
|
|
1305
1314
|
const DEFAULT_TEXT_INPUT_ELEMENT = "input";
|
|
1306
1315
|
function TextInput(props) {
|
|
1307
|
-
const $ = c(
|
|
1316
|
+
const $ = c(86), t0 = props;
|
|
1308
1317
|
let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, flex, forwardedRef, onClear, prefix, readOnly, rest, suffix, t1, t2, t3, t4, t5, t6, t7, t8, width;
|
|
1309
1318
|
if ($[0] !== t0) {
|
|
1310
1319
|
const {
|
|
@@ -1335,23 +1344,20 @@ function TextInput(props) {
|
|
|
1335
1344
|
__unstable_disableFocusRing = t92, t1 = t102, t2 = t112, className = t122, clearButton = t132, t3 = t142, flex = t152, t4 = t162, t5 = t172, IconComponent = t182, IconRightComponent = t192, onClear = t202, t6 = t212, prefix = t222, t7 = t232, readOnly = t242, forwardedRef = t252, suffix = t262, customValidity = t272, t8 = t282, width = t292, rest = t302, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = className, $[5] = clearButton, $[6] = customValidity, $[7] = flex, $[8] = forwardedRef, $[9] = onClear, $[10] = prefix, $[11] = readOnly, $[12] = rest, $[13] = suffix, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6, $[20] = t7, $[21] = t8, $[22] = width;
|
|
1336
1345
|
} else
|
|
1337
1346
|
IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6], flex = $[7], forwardedRef = $[8], onClear = $[9], prefix = $[10], readOnly = $[11], rest = $[12], suffix = $[13], t1 = $[14], t2 = $[15], t3 = $[16], t4 = $[17], t5 = $[18], t6 = $[19], t7 = $[20], t8 = $[21], width = $[22];
|
|
1338
|
-
const Element2 = t1 === void 0 ? DEFAULT_TEXT_INPUT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, gap = t5 === void 0 ? 3 : t5, padding = t6 === void 0 ? 3 : t6, radius = t7 === void 0 ? 2 : t7, type = t8 === void 0 ? "text" : t8, ref = useRef(null)
|
|
1347
|
+
const Element2 = t1 === void 0 ? DEFAULT_TEXT_INPUT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, gap = t5 === void 0 ? 3 : t5, padding = t6 === void 0 ? 3 : t6, radius = t7 === void 0 ? 2 : t7, type = t8 === void 0 ? "text" : t8, ref = useRef(null);
|
|
1339
1348
|
let t9;
|
|
1340
|
-
$[23]
|
|
1341
|
-
const
|
|
1349
|
+
$[23] !== padding ? (t9 = _getResponsiveProp(padding), $[23] = padding, $[24] = t9) : t9 = $[24];
|
|
1350
|
+
const responsivePadding = t9, withClearButton = !!clearButton;
|
|
1342
1351
|
let t10;
|
|
1343
|
-
$[
|
|
1344
|
-
|
|
1345
|
-
}, $[24] = onClear, $[25] = t10) : t10 = $[25];
|
|
1346
|
-
const handleClearClick = t10;
|
|
1352
|
+
$[25] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => ref.current, $[25] = t10) : t10 = $[25], useImperativeHandle(forwardedRef, t10), useCustomValidity(ref, customValidity);
|
|
1353
|
+
const handleClearMouseDown = _temp$a;
|
|
1347
1354
|
let t11;
|
|
1348
|
-
$[26] !==
|
|
1349
|
-
|
|
1355
|
+
$[26] !== onClear ? (t11 = (event_0) => {
|
|
1356
|
+
event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
|
|
1357
|
+
}, $[26] = onClear, $[27] = t11) : t11 = $[27];
|
|
1358
|
+
const handleClearClick = t11;
|
|
1350
1359
|
let t12;
|
|
1351
|
-
$[28] !==
|
|
1352
|
-
const clearButtonPadding = t12, clearButtonProps = isRecord(clearButton) ? clearButton : EMPTY_RECORD;
|
|
1353
|
-
let t13;
|
|
1354
|
-
$[30] !== border || $[31] !== className || $[32] !== flex || $[33] !== fontSize || $[34] !== gap || $[35] !== padding || $[36] !== radius || $[37] !== width ? (t13 = textInput({
|
|
1360
|
+
$[28] !== border || $[29] !== className || $[30] !== flex || $[31] !== fontSize || $[32] !== gap || $[33] !== padding || $[34] !== radius || $[35] !== width ? (t12 = textInput({
|
|
1355
1361
|
className,
|
|
1356
1362
|
border,
|
|
1357
1363
|
flex,
|
|
@@ -1360,52 +1366,77 @@ function TextInput(props) {
|
|
|
1360
1366
|
radius,
|
|
1361
1367
|
gap,
|
|
1362
1368
|
width
|
|
1363
|
-
}), $[
|
|
1364
|
-
const
|
|
1369
|
+
}), $[28] = border, $[29] = className, $[30] = flex, $[31] = fontSize, $[32] = gap, $[33] = padding, $[34] = radius, $[35] = width, $[36] = t12) : t12 = $[36];
|
|
1370
|
+
const t13 = IconComponent ? "" : void 0, t14 = IconRightComponent ? "" : void 0, t15 = customValidity ? "" : void 0, t16 = prefix ? "" : void 0, t17 = !disabled && readOnly ? "" : void 0, t18 = suffix ? "" : void 0;
|
|
1371
|
+
let t19;
|
|
1372
|
+
$[37] !== prefix ? (t19 = prefix && /* @__PURE__ */ jsx("span", { className: textInputPrefix(), children: /* @__PURE__ */ jsx("span", { children: prefix }) }), $[37] = prefix, $[38] = t19) : t19 = $[38];
|
|
1365
1373
|
let t20;
|
|
1366
|
-
$[39]
|
|
1374
|
+
$[39] === Symbol.for("react.memo_cache_sentinel") ? (t20 = textInputElement(), $[39] = t20) : t20 = $[39];
|
|
1367
1375
|
let t21;
|
|
1368
|
-
$[
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1376
|
+
$[40] === Symbol.for("react.memo_cache_sentinel") ? (t21 = _inputElement(), $[40] = t21) : t21 = $[40];
|
|
1377
|
+
const t22 = __unstable_disableFocusRing ? "" : void 0;
|
|
1378
|
+
let t23;
|
|
1379
|
+
$[41] !== Element2 || $[42] !== disabled || $[43] !== readOnly || $[44] !== rest || $[45] !== t22 || $[46] !== type ? (t23 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t21, "data-no-focus-ring": t22, disabled, readOnly, ref, type }), $[41] = Element2, $[42] = disabled, $[43] = readOnly, $[44] = rest, $[45] = t22, $[46] = type, $[47] = t23) : t23 = $[47];
|
|
1372
1380
|
let t24;
|
|
1373
|
-
$[
|
|
1381
|
+
$[48] === Symbol.for("react.memo_cache_sentinel") ? (t24 = _inputPresentation(), $[48] = t24) : t24 = $[48];
|
|
1374
1382
|
let t25;
|
|
1375
|
-
$[50]
|
|
1376
|
-
let t26;
|
|
1377
|
-
$[51] !== IconComponent || $[52] !== fontSize || $[53] !== padding ? (t26 = IconComponent && /* @__PURE__ */ jsx(Box, { as: "span", padding, position: "absolute", insetTop: 0, insetLeft: 0, children: /* @__PURE__ */ jsxs(Text, { as: "span", size: fontSize, children: [
|
|
1383
|
+
$[49] !== IconComponent || $[50] !== fontSize || $[51] !== padding ? (t25 = IconComponent && /* @__PURE__ */ jsx(Box, { as: "span", padding, position: "absolute", insetTop: 0, insetLeft: 0, children: /* @__PURE__ */ jsxs(Text, { as: "span", size: fontSize, children: [
|
|
1378
1384
|
isValidElement(IconComponent) && IconComponent,
|
|
1379
1385
|
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
1380
|
-
] }) }), $[
|
|
1381
|
-
let
|
|
1382
|
-
$[
|
|
1386
|
+
] }) }), $[49] = IconComponent, $[50] = fontSize, $[51] = padding, $[52] = t25) : t25 = $[52];
|
|
1387
|
+
let t26;
|
|
1388
|
+
$[53] !== IconRightComponent || $[54] !== fontSize || $[55] !== padding || $[56] !== withClearButton ? (t26 = !withClearButton && IconRightComponent && /* @__PURE__ */ jsx(Box, { as: "span", padding, position: "absolute", insetTop: 0, insetRight: 0, children: /* @__PURE__ */ jsxs(Text, { as: "span", size: fontSize, children: [
|
|
1383
1389
|
isValidElement(IconRightComponent) && IconRightComponent,
|
|
1384
1390
|
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
1385
|
-
] }) }), $[
|
|
1391
|
+
] }) }), $[53] = IconRightComponent, $[54] = fontSize, $[55] = padding, $[56] = withClearButton, $[57] = t26) : t26 = $[57];
|
|
1392
|
+
let t27;
|
|
1393
|
+
$[58] !== t25 || $[59] !== t26 ? (t27 = /* @__PURE__ */ jsxs("span", { className: t24, children: [
|
|
1394
|
+
t25,
|
|
1395
|
+
t26
|
|
1396
|
+
] }), $[58] = t25, $[59] = t26, $[60] = t27) : t27 = $[60];
|
|
1386
1397
|
let t28;
|
|
1387
|
-
$[
|
|
1388
|
-
t26,
|
|
1389
|
-
t27
|
|
1390
|
-
] }), $[60] = t26, $[61] = t27, $[62] = t28) : t28 = $[62];
|
|
1398
|
+
$[61] !== clearButton || $[62] !== disabled || $[63] !== fontSize || $[64] !== handleClearClick || $[65] !== radius || $[66] !== readOnly || $[67] !== responsivePadding ? (t28 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(ClearButton, { fontSize, radius, clearButtonProps: isRecord(clearButton) ? clearButton : EMPTY_RECORD, handleClearClick, handleClearMouseDown, padding: responsivePadding }), $[61] = clearButton, $[62] = disabled, $[63] = fontSize, $[64] = handleClearClick, $[65] = radius, $[66] = readOnly, $[67] = responsivePadding, $[68] = t28) : t28 = $[68];
|
|
1391
1399
|
let t29;
|
|
1392
|
-
$[
|
|
1393
|
-
|
|
1394
|
-
|
|
1400
|
+
$[69] !== t23 || $[70] !== t27 || $[71] !== t28 ? (t29 = /* @__PURE__ */ jsxs("span", { className: t20, children: [
|
|
1401
|
+
t23,
|
|
1402
|
+
t27,
|
|
1403
|
+
t28
|
|
1404
|
+
] }), $[69] = t23, $[70] = t27, $[71] = t28, $[72] = t29) : t29 = $[72];
|
|
1395
1405
|
let t30;
|
|
1396
|
-
$[73] !==
|
|
1397
|
-
t24,
|
|
1398
|
-
t28,
|
|
1399
|
-
t29
|
|
1400
|
-
] }), $[73] = t24, $[74] = t28, $[75] = t29, $[76] = t30) : t30 = $[76];
|
|
1406
|
+
$[73] !== suffix ? (t30 = suffix && /* @__PURE__ */ jsx("span", { className: textInputSuffix(), children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[73] = suffix, $[74] = t30) : t30 = $[74];
|
|
1401
1407
|
let t31;
|
|
1402
|
-
$[77] !==
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1408
|
+
return $[75] !== t12 || $[76] !== t13 || $[77] !== t14 || $[78] !== t15 || $[79] !== t16 || $[80] !== t17 || $[81] !== t18 || $[82] !== t19 || $[83] !== t29 || $[84] !== t30 ? (t31 = /* @__PURE__ */ jsxs("span", { className: t12, "data-icon-left": t13, "data-icon-right": t14, "data-invalid": t15, "data-prefix": t16, "data-read-only": t17, "data-suffix": t18, "data-ui": "TextInput", children: [
|
|
1409
|
+
t19,
|
|
1410
|
+
t29,
|
|
1411
|
+
t30
|
|
1412
|
+
] }), $[75] = t12, $[76] = t13, $[77] = t14, $[78] = t15, $[79] = t16, $[80] = t17, $[81] = t18, $[82] = t19, $[83] = t29, $[84] = t30, $[85] = t31) : t31 = $[85], t31;
|
|
1413
|
+
}
|
|
1414
|
+
function _temp$a(event) {
|
|
1415
|
+
event.preventDefault(), event.stopPropagation();
|
|
1416
|
+
}
|
|
1417
|
+
function ClearButton(t0) {
|
|
1418
|
+
const $ = c(15), {
|
|
1419
|
+
fontSize,
|
|
1420
|
+
radius,
|
|
1421
|
+
clearButtonProps,
|
|
1422
|
+
handleClearClick,
|
|
1423
|
+
handleClearMouseDown,
|
|
1424
|
+
padding
|
|
1425
|
+
} = t0;
|
|
1426
|
+
let t1;
|
|
1427
|
+
$[0] !== padding ? (t1 = Object.fromEntries(Object.entries(padding).map(_temp2$2)), $[0] = padding, $[1] = t1) : t1 = $[1];
|
|
1428
|
+
const clearButtonBoxPadding = t1;
|
|
1429
|
+
let t2;
|
|
1430
|
+
$[2] !== padding ? (t2 = Object.fromEntries(Object.entries(padding).map(_temp3)), $[2] = padding, $[3] = t2) : t2 = $[3];
|
|
1431
|
+
const clearButtonPadding = t2;
|
|
1432
|
+
let t3;
|
|
1433
|
+
$[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
|
|
1434
|
+
zIndex: 2
|
|
1435
|
+
}, $[4] = t3) : t3 = $[4];
|
|
1436
|
+
let t4;
|
|
1437
|
+
$[5] !== clearButtonPadding || $[6] !== clearButtonProps || $[7] !== fontSize || $[8] !== handleClearClick || $[9] !== handleClearMouseDown || $[10] !== radius ? (t4 = /* @__PURE__ */ jsx(Button, { "aria-label": "Clear", "data-qa": "clear-button", display: "block", fontSize, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }), $[5] = clearButtonPadding, $[6] = clearButtonProps, $[7] = fontSize, $[8] = handleClearClick, $[9] = handleClearMouseDown, $[10] = radius, $[11] = t4) : t4 = $[11];
|
|
1438
|
+
let t5;
|
|
1439
|
+
return $[12] !== clearButtonBoxPadding || $[13] !== t4 ? (t5 = /* @__PURE__ */ jsx(Box, { as: "span", insetTop: 0, insetRight: 0, padding: clearButtonBoxPadding, position: "absolute", style: t3, children: t4 }), $[12] = clearButtonBoxPadding, $[13] = t4, $[14] = t5) : t5 = $[14], t5;
|
|
1409
1440
|
}
|
|
1410
1441
|
function _temp3(t0) {
|
|
1411
1442
|
const [key_0, value_0] = t0;
|
|
@@ -1415,9 +1446,6 @@ function _temp2$2(t0) {
|
|
|
1415
1446
|
const [key2, value] = t0;
|
|
1416
1447
|
return value === 0 ? [key2, 0] : value === 1 ? [key2, 1] : value === 2 ? [key2, 1] : [key2, typeof value == "number" ? value - 2 : 0];
|
|
1417
1448
|
}
|
|
1418
|
-
function _temp$a(event) {
|
|
1419
|
-
event.preventDefault(), event.stopPropagation();
|
|
1420
|
-
}
|
|
1421
1449
|
function AutocompleteOption(props) {
|
|
1422
1450
|
const $ = c(11), {
|
|
1423
1451
|
children,
|
|
@@ -2010,9 +2038,9 @@ function DialogCard(props) {
|
|
|
2010
2038
|
ref: forwardedRef,
|
|
2011
2039
|
...rest
|
|
2012
2040
|
} = t0, $[0] = t0, $[1] = autoFocus, $[2] = children, $[3] = footer, $[4] = forwardedContentRef, $[5] = forwardedRef, $[6] = header, $[7] = hideCloseButton, $[8] = id, $[9] = onClickOutside, $[10] = onClose, $[11] = portalProp, $[12] = rest, $[13] = t1) : (autoFocus = $[1], children = $[2], footer = $[3], forwardedContentRef = $[4], forwardedRef = $[5], header = $[6], hideCloseButton = $[7], id = $[8], onClickOutside = $[9], onClose = $[10], portalProp = $[11], rest = $[12], t1 = $[13]);
|
|
2013
|
-
const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement =
|
|
2041
|
+
const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = use(BoundaryElementContext), ref = useRef(null), contentRef = useRef(null), {
|
|
2014
2042
|
isTopLayer
|
|
2015
|
-
} =
|
|
2043
|
+
} = useLayer(), labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton, [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), scrollBottom = scrollHeight - scrollTop;
|
|
2016
2044
|
let t2;
|
|
2017
2045
|
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], useImperativeHandle(forwardedRef, t2);
|
|
2018
2046
|
let t3;
|
|
@@ -2093,7 +2121,7 @@ function useDialog() {
|
|
|
2093
2121
|
}
|
|
2094
2122
|
const DEFAULT_DIALOG_ELEMENT = "div";
|
|
2095
2123
|
function Dialog(props) {
|
|
2096
|
-
const $ = c(
|
|
2124
|
+
const $ = c(75), context = useDialog(), t0 = props;
|
|
2097
2125
|
let _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, tone;
|
|
2098
2126
|
$[0] !== t0 ? ({
|
|
2099
2127
|
__unstable_autoFocus: t1,
|
|
@@ -2120,9 +2148,18 @@ function Dialog(props) {
|
|
|
2120
2148
|
tone,
|
|
2121
2149
|
...rest
|
|
2122
2150
|
} = t0, $[0] = t0, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = className, $[5] = contentRef, $[6] = footer, $[7] = header, $[8] = id, $[9] = onActivate, $[10] = onClickOutside, $[11] = onClose, $[12] = onFocus, $[13] = portalProp, $[14] = rest, $[15] = scheme, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = tone) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], className = $[4], contentRef = $[5], footer = $[6], header = $[7], id = $[8], onActivate = $[9], onClickOutside = $[10], onClose = $[11], onFocus = $[12], portalProp = $[13], rest = $[14], scheme = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21], t7 = $[22], tone = $[23]);
|
|
2123
|
-
const autoFocus = t1 === void 0 ? !0 : t1, hideCloseButton = t2 === void 0 ? !1 : t2, _animate = t3 === void 0 ? !1 : t3, cardRadiusProp = t4 === void 0 ? 4 : t4, padding = t5 === void 0 ? 3 : t5, cardShadow = t6 === void 0 ? 4 : t6, width = t7 === void 0 ? 0 : t7, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement =
|
|
2151
|
+
const autoFocus = t1 === void 0 ? !0 : t1, hideCloseButton = t2 === void 0 ? !1 : t2, _animate = t3 === void 0 ? !1 : t3, cardRadiusProp = t4 === void 0 ? 4 : t4, padding = t5 === void 0 ? 3 : t5, cardShadow = t6 === void 0 ? 4 : t6, width = t7 === void 0 ? 0 : t7, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = use(BoundaryElementContext);
|
|
2124
2152
|
let t8;
|
|
2125
|
-
$[24] !==
|
|
2153
|
+
$[24] !== cardRadiusProp ? (t8 = _getResponsiveProp(cardRadiusProp), $[24] = cardRadiusProp, $[25] = t8) : t8 = $[25];
|
|
2154
|
+
const cardRadius = t8;
|
|
2155
|
+
let t9;
|
|
2156
|
+
$[26] !== positionProp ? (t9 = _getResponsiveProp(positionProp), $[26] = positionProp, $[27] = t9) : t9 = $[27];
|
|
2157
|
+
const position = t9;
|
|
2158
|
+
let t10;
|
|
2159
|
+
$[28] !== zOffsetProp ? (t10 = _getResponsiveProp(zOffsetProp), $[28] = zOffsetProp, $[29] = t10) : t10 = $[29];
|
|
2160
|
+
const zOffset = t10, preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
|
|
2161
|
+
let t11;
|
|
2162
|
+
$[30] !== onFocus ? (t11 = (event) => {
|
|
2126
2163
|
onFocus?.(event);
|
|
2127
2164
|
const target = event.target, cardElement = cardRef.current;
|
|
2128
2165
|
if (cardElement && target === preDivRef.current) {
|
|
@@ -2134,10 +2171,10 @@ function Dialog(props) {
|
|
|
2134
2171
|
return;
|
|
2135
2172
|
}
|
|
2136
2173
|
isHTMLElement(event.target) && (focusedElementRef.current = event.target);
|
|
2137
|
-
}, $[
|
|
2138
|
-
const handleFocus =
|
|
2139
|
-
let
|
|
2140
|
-
$[
|
|
2174
|
+
}, $[30] = onFocus, $[31] = t11) : t11 = $[31];
|
|
2175
|
+
const handleFocus = t11, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
|
|
2176
|
+
let t12;
|
|
2177
|
+
$[32] !== boundaryElement || $[33] !== portalElement ? (t12 = () => {
|
|
2141
2178
|
rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
|
|
2142
2179
|
const activeElement = document.activeElement;
|
|
2143
2180
|
if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
|
|
@@ -2150,31 +2187,31 @@ function Dialog(props) {
|
|
|
2150
2187
|
target_0.focus();
|
|
2151
2188
|
}
|
|
2152
2189
|
}, 0);
|
|
2153
|
-
}, $[
|
|
2154
|
-
const handleRootClick =
|
|
2155
|
-
let t10;
|
|
2156
|
-
$[29] !== className ? (t10 = dialog({
|
|
2157
|
-
className
|
|
2158
|
-
}), $[29] = className, $[30] = t10) : t10 = $[30];
|
|
2159
|
-
const t11 = animate ? "" : void 0;
|
|
2160
|
-
let t12;
|
|
2161
|
-
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
|
|
2190
|
+
}, $[32] = boundaryElement, $[33] = portalElement, $[34] = t12) : t12 = $[34];
|
|
2191
|
+
const handleRootClick = t12;
|
|
2162
2192
|
let t13;
|
|
2163
|
-
$[
|
|
2164
|
-
|
|
2165
|
-
|
|
2193
|
+
$[35] !== className ? (t13 = dialog({
|
|
2194
|
+
className
|
|
2195
|
+
}), $[35] = className, $[36] = t13) : t13 = $[36];
|
|
2196
|
+
const t14 = animate ? "" : void 0;
|
|
2166
2197
|
let t15;
|
|
2167
|
-
$[
|
|
2198
|
+
$[37] === Symbol.for("react.memo_cache_sentinel") ? (t15 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[37] = t15) : t15 = $[37];
|
|
2168
2199
|
let t16;
|
|
2169
|
-
$[
|
|
2200
|
+
$[38] === Symbol.for("react.memo_cache_sentinel") ? (t16 = dialogContainer(), $[38] = t16) : t16 = $[38];
|
|
2170
2201
|
let t17;
|
|
2171
|
-
$[
|
|
2172
|
-
t12,
|
|
2173
|
-
t15,
|
|
2174
|
-
t16
|
|
2175
|
-
] }), $[53] = handleFocus, $[54] = handleRootClick, $[55] = id, $[56] = labelId, $[57] = onActivate, $[58] = padding, $[59] = position, $[60] = rest, $[61] = t10, $[62] = t11, $[63] = t15, $[64] = zOffset, $[65] = t17) : t17 = $[65];
|
|
2202
|
+
$[39] !== autoFocus || $[40] !== cardRadius || $[41] !== cardShadow || $[42] !== children || $[43] !== contentRef || $[44] !== footer || $[45] !== header || $[46] !== hideCloseButton || $[47] !== id || $[48] !== onClickOutside || $[49] !== onClose || $[50] !== portalProp || $[51] !== scheme || $[52] !== tone || $[53] !== width ? (t17 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[39] = autoFocus, $[40] = cardRadius, $[41] = cardShadow, $[42] = children, $[43] = contentRef, $[44] = footer, $[45] = header, $[46] = hideCloseButton, $[47] = id, $[48] = onClickOutside, $[49] = onClose, $[50] = portalProp, $[51] = scheme, $[52] = tone, $[53] = width, $[54] = t17) : t17 = $[54];
|
|
2176
2203
|
let t18;
|
|
2177
|
-
|
|
2204
|
+
$[55] !== t17 || $[56] !== width ? (t18 = /* @__PURE__ */ jsx(Container, { alignItems: "center", className: t16, "data-ui": "DialogCard", flexDirection: "column", display: "flex", justifyContent: "center", width, children: t17 }), $[55] = t17, $[56] = width, $[57] = t18) : t18 = $[57];
|
|
2205
|
+
let t19;
|
|
2206
|
+
$[58] === Symbol.for("react.memo_cache_sentinel") ? (t19 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[58] = t19) : t19 = $[58];
|
|
2207
|
+
let t20;
|
|
2208
|
+
$[59] !== handleFocus || $[60] !== handleRootClick || $[61] !== id || $[62] !== labelId || $[63] !== onActivate || $[64] !== padding || $[65] !== position || $[66] !== rest || $[67] !== t13 || $[68] !== t14 || $[69] !== t18 || $[70] !== zOffset ? (t20 = /* @__PURE__ */ jsxs(Layer, { ...rest, "aria-labelledby": labelId, "aria-modal": !0, className: t13, "data-animate": t14, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, role: "dialog", zOffset, children: [
|
|
2209
|
+
t15,
|
|
2210
|
+
t18,
|
|
2211
|
+
t19
|
|
2212
|
+
] }), $[59] = handleFocus, $[60] = handleRootClick, $[61] = id, $[62] = labelId, $[63] = onActivate, $[64] = padding, $[65] = position, $[66] = rest, $[67] = t13, $[68] = t14, $[69] = t18, $[70] = zOffset, $[71] = t20) : t20 = $[71];
|
|
2213
|
+
let t21;
|
|
2214
|
+
return $[72] !== portalProp || $[73] !== t20 ? (t21 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t20 }), $[72] = portalProp, $[73] = t20, $[74] = t21) : t21 = $[74], t21;
|
|
2178
2215
|
}
|
|
2179
2216
|
function DialogProvider(props) {
|
|
2180
2217
|
const $ = c(6), {
|
|
@@ -2190,7 +2227,7 @@ function DialogProvider(props) {
|
|
|
2190
2227
|
}, $[0] = position, $[1] = zOffset, $[2] = t0) : t0 = $[2];
|
|
2191
2228
|
const contextValue = t0;
|
|
2192
2229
|
let t1;
|
|
2193
|
-
return $[3] !== children || $[4] !== contextValue ? (t1 = /* @__PURE__ */ jsx(DialogContext
|
|
2230
|
+
return $[3] !== children || $[4] !== contextValue ? (t1 = /* @__PURE__ */ jsx(DialogContext, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t1) : t1 = $[5], t1;
|
|
2194
2231
|
}
|
|
2195
2232
|
const DEFAULT_KBD_ELEMENT = "kbd";
|
|
2196
2233
|
function KBD(props) {
|
|
@@ -2489,7 +2526,7 @@ function Menu(props) {
|
|
|
2489
2526
|
let t14;
|
|
2490
2527
|
$[45] !== as || $[46] !== handleKeyDown || $[47] !== handleRefChange || $[48] !== padding || $[49] !== rest || $[50] !== t12 || $[51] !== t13 ? (t14 = /* @__PURE__ */ jsx(Box, { "data-ui": "Menu", ...rest, as, className: t12, onKeyDown: handleKeyDown, overflow: "auto", outline: "none", padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t13 }), $[45] = as, $[46] = handleKeyDown, $[47] = handleRefChange, $[48] = padding, $[49] = rest, $[50] = t12, $[51] = t13, $[52] = t14) : t14 = $[52];
|
|
2491
2528
|
let t15;
|
|
2492
|
-
return $[53] !== t14 || $[54] !== value ? (t15 = /* @__PURE__ */ jsx(MenuContext
|
|
2529
|
+
return $[53] !== t14 || $[54] !== value ? (t15 = /* @__PURE__ */ jsx(MenuContext, { value, children: t14 }), $[53] = t14, $[54] = value, $[55] = t15) : t15 = $[55], t15;
|
|
2493
2530
|
}
|
|
2494
2531
|
function MenuButton(props) {
|
|
2495
2532
|
const $ = c(57), {
|
|
@@ -3135,7 +3172,7 @@ function ToastProvider(props) {
|
|
|
3135
3172
|
let t3;
|
|
3136
3173
|
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp$4) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t3) : t3 = $[9];
|
|
3137
3174
|
let t4;
|
|
3138
|
-
return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxs(ToastContext
|
|
3175
|
+
return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxs(ToastContext, { value, children: [
|
|
3139
3176
|
children,
|
|
3140
3177
|
t3
|
|
3141
3178
|
] }), $[10] = children, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
|
|
@@ -3363,7 +3400,7 @@ function Tree(props) {
|
|
|
3363
3400
|
let t18;
|
|
3364
3401
|
$[29] !== children || $[30] !== gap || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest ? (t18 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...rest, gap, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[29] = children, $[30] = gap, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t18) : t18 = $[34];
|
|
3365
3402
|
let t19;
|
|
3366
|
-
return $[35] !== contextValue || $[36] !== t18 ? (t19 = /* @__PURE__ */ jsx(TreeContext
|
|
3403
|
+
return $[35] !== contextValue || $[36] !== t18 ? (t19 = /* @__PURE__ */ jsx(TreeContext, { value: contextValue, children: t18 }), $[35] = contextValue, $[36] = t18, $[37] = t19) : t19 = $[37], t19;
|
|
3367
3404
|
}
|
|
3368
3405
|
function useTree() {
|
|
3369
3406
|
const tree = use(TreeContext);
|
|
@@ -3485,7 +3522,7 @@ function TreeItem(props) {
|
|
|
3485
3522
|
let t302;
|
|
3486
3523
|
$[86] !== children || $[87] !== expanded ? (t302 = children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }), $[86] = children, $[87] = expanded, $[88] = t302) : t302 = $[88];
|
|
3487
3524
|
let t312;
|
|
3488
|
-
$[89] !== contextValue || $[90] !== t302 ? (t312 = /* @__PURE__ */ jsx(TreeContext
|
|
3525
|
+
$[89] !== contextValue || $[90] !== t302 ? (t312 = /* @__PURE__ */ jsx(TreeContext, { value: contextValue, children: t302 }), $[89] = contextValue, $[90] = t302, $[91] = t312) : t312 = $[91];
|
|
3489
3526
|
let t322;
|
|
3490
3527
|
return $[92] !== handleClick || $[93] !== id || $[94] !== itemKey || $[95] !== t242 || $[96] !== t252 || $[97] !== t262 || $[98] !== t292 || $[99] !== t312 ? (t322 = /* @__PURE__ */ jsxs(Box, { "data-selected": t242, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...t252, as: "li", className: t262, onClick: handleClick, ref: setRootElement, role: "none", children: [
|
|
3491
3528
|
t292,
|
|
@@ -3507,7 +3544,7 @@ function TreeItem(props) {
|
|
|
3507
3544
|
let t31;
|
|
3508
3545
|
$[111] !== children || $[112] !== expanded ? (t31 = children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }), $[111] = children, $[112] = expanded, $[113] = t31) : t31 = $[113];
|
|
3509
3546
|
let t32;
|
|
3510
|
-
$[114] !== contextValue || $[115] !== t31 ? (t32 = /* @__PURE__ */ jsx(TreeContext
|
|
3547
|
+
$[114] !== contextValue || $[115] !== t31 ? (t32 = /* @__PURE__ */ jsx(TreeContext, { value: contextValue, children: t31 }), $[114] = contextValue, $[115] = t31, $[116] = t32) : t32 = $[116];
|
|
3511
3548
|
let t33;
|
|
3512
3549
|
return $[117] !== expanded || $[118] !== handleClick || $[119] !== handleKeyDown || $[120] !== id || $[121] !== itemKey || $[122] !== t24 || $[123] !== t25 || $[124] !== t26 || $[125] !== t30 || $[126] !== t32 || $[127] !== tabIndex ? (t33 = /* @__PURE__ */ jsxs(Box, { "data-selected": t24, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...t25, "aria-expanded": expanded, className: t26, onClick: handleClick, onKeyDown: handleKeyDown, ref: setRootElement, role: "treeitem", tabIndex, children: [
|
|
3513
3550
|
t30,
|
|
@@ -3777,7 +3814,7 @@ function Label(props) {
|
|
|
3777
3814
|
}
|
|
3778
3815
|
const DEFAULT_AVATAR_ELEMENT = "span";
|
|
3779
3816
|
function Avatar(props) {
|
|
3780
|
-
const $ = c(
|
|
3817
|
+
const $ = c(52), t0 = props;
|
|
3781
3818
|
let animateArrowFrom, arrowPositionProp, className, hideInnerStroke, initials, onImageLoadError, rest, src, t1, t2, t3, title;
|
|
3782
3819
|
$[0] !== t0 ? ({
|
|
3783
3820
|
__unstable_hideInnerStroke: hideInnerStroke,
|
|
@@ -3793,52 +3830,55 @@ function Avatar(props) {
|
|
|
3793
3830
|
size: t3,
|
|
3794
3831
|
...rest
|
|
3795
3832
|
} = t0, $[0] = t0, $[1] = animateArrowFrom, $[2] = arrowPositionProp, $[3] = className, $[4] = hideInnerStroke, $[5] = initials, $[6] = onImageLoadError, $[7] = rest, $[8] = src, $[9] = t1, $[10] = t2, $[11] = t3, $[12] = title) : (animateArrowFrom = $[1], arrowPositionProp = $[2], className = $[3], hideInnerStroke = $[4], initials = $[5], onImageLoadError = $[6], rest = $[7], src = $[8], t1 = $[9], t2 = $[10], t3 = $[11], title = $[12]);
|
|
3796
|
-
const Element2 = t1 === void 0 ? DEFAULT_AVATAR_ELEMENT : t1, color = t2 === void 0 ? "magenta" : t2, sizeProp = t3 === void 0 ? 1 : t3
|
|
3797
|
-
let t4
|
|
3798
|
-
$[13] !==
|
|
3833
|
+
const Element2 = t1 === void 0 ? DEFAULT_AVATAR_ELEMENT : t1, color = t2 === void 0 ? "magenta" : t2, sizeProp = t3 === void 0 ? 1 : t3;
|
|
3834
|
+
let t4;
|
|
3835
|
+
$[13] !== sizeProp ? (t4 = _getResponsiveProp(sizeProp), $[13] = sizeProp, $[14] = t4) : t4 = $[14];
|
|
3836
|
+
const size2 = t4, [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageError, setImageError] = useState(!1);
|
|
3837
|
+
let t5, t6;
|
|
3838
|
+
$[15] !== arrowPosition || $[16] !== arrowPositionProp ? (t5 = () => {
|
|
3799
3839
|
if (arrowPosition === arrowPositionProp)
|
|
3800
3840
|
return;
|
|
3801
3841
|
const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
|
|
3802
3842
|
return () => cancelAnimationFrame(raf);
|
|
3803
|
-
},
|
|
3804
|
-
let
|
|
3805
|
-
$[
|
|
3843
|
+
}, t6 = [arrowPosition, arrowPositionProp], $[15] = arrowPosition, $[16] = arrowPositionProp, $[17] = t5, $[18] = t6) : (t5 = $[17], t6 = $[18]), useEffect(t5, t6);
|
|
3844
|
+
let t7, t8;
|
|
3845
|
+
$[19] !== src ? (t7 = () => {
|
|
3806
3846
|
src && setImageError(!1);
|
|
3807
|
-
},
|
|
3808
|
-
let t8;
|
|
3809
|
-
$[20] !== onImageLoadError ? (t8 = () => {
|
|
3810
|
-
setImageError(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
|
|
3811
|
-
}, $[20] = onImageLoadError, $[21] = t8) : t8 = $[21];
|
|
3812
|
-
const handleImageError = t8;
|
|
3847
|
+
}, t8 = [src], $[19] = src, $[20] = t7, $[21] = t8) : (t7 = $[20], t8 = $[21]), useEffect(t7, t8);
|
|
3813
3848
|
let t9;
|
|
3814
|
-
$[22] !==
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3849
|
+
$[22] !== onImageLoadError ? (t9 = () => {
|
|
3850
|
+
setImageError(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
|
|
3851
|
+
}, $[22] = onImageLoadError, $[23] = t9) : t9 = $[23];
|
|
3852
|
+
const handleImageError = t9;
|
|
3853
|
+
let t10;
|
|
3854
|
+
$[24] !== size2 ? (t10 = Object.values(size2).map(_temp$2), $[24] = size2, $[25] = t10) : t10 = $[25];
|
|
3855
|
+
const initialsSize = t10, t11 = hideInnerStroke ? "" : void 0;
|
|
3856
|
+
let t12;
|
|
3857
|
+
$[26] !== className || $[27] !== color || $[28] !== sizeProp ? (t12 = avatar({
|
|
3818
3858
|
className,
|
|
3819
3859
|
color,
|
|
3820
3860
|
size: sizeProp
|
|
3821
|
-
}), $[
|
|
3822
|
-
const
|
|
3823
|
-
let t13;
|
|
3824
|
-
$[28] === Symbol.for("react.memo_cache_sentinel") ? (t13 = avatarArrow(), $[28] = t13) : t13 = $[28];
|
|
3861
|
+
}), $[26] = className, $[27] = color, $[28] = sizeProp, $[29] = t12) : t12 = $[29];
|
|
3862
|
+
const t13 = imageError ? "" : void 0;
|
|
3825
3863
|
let t14;
|
|
3826
|
-
$[
|
|
3864
|
+
$[30] === Symbol.for("react.memo_cache_sentinel") ? (t14 = avatarArrow(), $[30] = t14) : t14 = $[30];
|
|
3827
3865
|
let t15;
|
|
3828
|
-
$[31]
|
|
3866
|
+
$[31] !== color ? (t15 = /* @__PURE__ */ jsx("span", { className: t14, children: /* @__PURE__ */ jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[31] = color, $[32] = t15) : t15 = $[32];
|
|
3829
3867
|
let t16;
|
|
3830
|
-
$[
|
|
3868
|
+
$[33] === Symbol.for("react.memo_cache_sentinel") ? (t16 = avatarInitials(), $[33] = t16) : t16 = $[33];
|
|
3831
3869
|
let t17;
|
|
3832
|
-
$[
|
|
3870
|
+
$[34] !== initials || $[35] !== initialsSize ? (t17 = /* @__PURE__ */ jsx(Box, { alignItems: "center", as: "span", className: t16, display: "flex", justifyContent: "center", position: "absolute", inset: 0, children: /* @__PURE__ */ jsx(Label, { align: "center", as: "span", size: initialsSize, weight: "medium", children: initials }) }), $[34] = initials, $[35] = initialsSize, $[36] = t17) : t17 = $[36];
|
|
3871
|
+
let t18;
|
|
3872
|
+
$[37] !== handleImageError || $[38] !== initials || $[39] !== src ? (t18 = src && /* @__PURE__ */ jsxs(Box, { className: avatarImage(), inset: 0, position: "absolute", children: [
|
|
3833
3873
|
/* @__PURE__ */ jsx("img", { alt: initials, onError: handleImageError, src }),
|
|
3834
3874
|
/* @__PURE__ */ jsx("span", { className: avatarImageOutline() })
|
|
3835
|
-
] }), $[
|
|
3836
|
-
let
|
|
3837
|
-
return $[
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
] }), $[
|
|
3875
|
+
] }), $[37] = handleImageError, $[38] = initials, $[39] = src, $[40] = t18) : t18 = $[40];
|
|
3876
|
+
let t19;
|
|
3877
|
+
return $[41] !== Element2 || $[42] !== arrowPosition || $[43] !== rest || $[44] !== t11 || $[45] !== t12 || $[46] !== t13 || $[47] !== t15 || $[48] !== t17 || $[49] !== t18 || $[50] !== title ? (t19 = /* @__PURE__ */ jsxs(Element2, { "data-hide-inner-stroke": t11, "data-ui": "Avatar", ...rest, "aria-label": title, className: t12, "data-arrow-position": arrowPosition, "data-image-error": t13, title, children: [
|
|
3878
|
+
t15,
|
|
3879
|
+
t17,
|
|
3880
|
+
t18
|
|
3881
|
+
] }), $[41] = Element2, $[42] = arrowPosition, $[43] = rest, $[44] = t11, $[45] = t12, $[46] = t13, $[47] = t15, $[48] = t17, $[49] = t18, $[50] = title, $[51] = t19) : t19 = $[51], t19;
|
|
3842
3882
|
}
|
|
3843
3883
|
function _temp$2(s) {
|
|
3844
3884
|
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
@@ -4405,9 +4445,6 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
|
|
|
4405
4445
|
"right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
|
|
4406
4446
|
"right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
|
|
4407
4447
|
}, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/v4/tooltipDelayGroup", null);
|
|
4408
|
-
function useTooltipDelayGroup() {
|
|
4409
|
-
return use(TooltipDelayGroupContext);
|
|
4410
|
-
}
|
|
4411
4448
|
function TooltipLayer(props) {
|
|
4412
4449
|
const $ = c(50);
|
|
4413
4450
|
let animate, arrow2, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, rest, scheme, shadow, style, t0;
|
|
@@ -4462,7 +4499,7 @@ function TooltipLayer(props) {
|
|
|
4462
4499
|
}
|
|
4463
4500
|
const DEFAULT_TOOLTIP_ELEMENT = "div";
|
|
4464
4501
|
function Tooltip(props) {
|
|
4465
|
-
const $ = c(143),
|
|
4502
|
+
const $ = c(143), t0 = props;
|
|
4466
4503
|
let _boundaryElement, _fallbackPlacements, childProp, className, content2, delay, disabled, forwardedRef, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, t8, t9;
|
|
4467
4504
|
$[0] !== t0 ? ({
|
|
4468
4505
|
animate: t1,
|
|
@@ -4486,10 +4523,14 @@ function Tooltip(props) {
|
|
|
4486
4523
|
tone: t9,
|
|
4487
4524
|
...rest
|
|
4488
4525
|
} = t0, $[0] = t0, $[1] = _boundaryElement, $[2] = _fallbackPlacements, $[3] = childProp, $[4] = className, $[5] = content2, $[6] = delay, $[7] = disabled, $[8] = forwardedRef, $[9] = portalProp, $[10] = rest, $[11] = scheme, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5, $[17] = t6, $[18] = t7, $[19] = t8, $[20] = t9) : (_boundaryElement = $[1], _fallbackPlacements = $[2], childProp = $[3], className = $[4], content2 = $[5], delay = $[6], disabled = $[7], forwardedRef = $[8], portalProp = $[9], rest = $[10], scheme = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16], t6 = $[17], t7 = $[18], t8 = $[19], t9 = $[20]);
|
|
4489
|
-
const _animate = t1 === void 0 ? !1 : t1, arrowProp = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_TOOLTIP_ELEMENT : t3, padding = t4 === void 0 ? 2 : t4, placementProp = t5 === void 0 ? "bottom" : t5, radius = t6 === void 0 ? 3 : t6, shadow = t7 === void 0 ? 2 : t7, zOffset = t8 === void 0 ? Z_OFFSETS.tooltip : t8, tone = t9 === void 0 ? "inherit" : t9, boundaryElement = _boundaryElement ??
|
|
4526
|
+
const _animate = t1 === void 0 ? !1 : t1, arrowProp = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_TOOLTIP_ELEMENT : t3, padding = t4 === void 0 ? 2 : t4, placementProp = t5 === void 0 ? "bottom" : t5, radius = t6 === void 0 ? 3 : t6, shadow = t7 === void 0 ? 2 : t7, zOffset = t8 === void 0 ? Z_OFFSETS.tooltip : t8, tone = t9 === void 0 ? "inherit" : t9, boundaryElement = _boundaryElement ?? use(BoundaryElementContext), fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], animate = usePrefersReducedMotion() ? !1 : _animate, ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
|
|
4490
4527
|
let t10;
|
|
4491
4528
|
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => ref.current, $[21] = t10) : t10 = $[21], useImperativeHandle(forwardedRef, t10);
|
|
4492
|
-
|
|
4529
|
+
let portalElement = null;
|
|
4530
|
+
if (portalProp) {
|
|
4531
|
+
const portal = use(PortalContext);
|
|
4532
|
+
assertPortalContext(portal), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element;
|
|
4533
|
+
}
|
|
4493
4534
|
let t11;
|
|
4494
4535
|
$[22] !== animate || $[23] !== arrowProp || $[24] !== boundaryElement || $[25] !== fallbackPlacements ? (t11 = {
|
|
4495
4536
|
animate,
|
|
@@ -4518,7 +4559,7 @@ function Tooltip(props) {
|
|
|
4518
4559
|
middlewareData,
|
|
4519
4560
|
refs,
|
|
4520
4561
|
update
|
|
4521
|
-
} = useFloating(t13), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext =
|
|
4562
|
+
} = useFloating(t13), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = use(TooltipDelayGroupContext);
|
|
4522
4563
|
let t14;
|
|
4523
4564
|
$[33] !== delayGroupContext ? (t14 = delayGroupContext || {}, $[33] = delayGroupContext, $[34] = t14) : t14 = $[34];
|
|
4524
4565
|
const {
|
|
@@ -4596,10 +4637,10 @@ function Tooltip(props) {
|
|
|
4596
4637
|
};
|
|
4597
4638
|
}, t28 = [handleIsOpenChange, showTooltip], $[76] = handleIsOpenChange, $[77] = showTooltip, $[78] = t27, $[79] = t28) : (t27 = $[78], t28 = $[79]), useEffect(t27, t28);
|
|
4598
4639
|
let t29;
|
|
4599
|
-
$[80] !== boundaryElement || $[81] !== portalElement
|
|
4640
|
+
$[80] !== boundaryElement || $[81] !== portalElement ? (t29 = () => {
|
|
4600
4641
|
const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
|
|
4601
4642
|
setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
|
|
4602
|
-
}, $[80] = boundaryElement, $[81] = portalElement
|
|
4643
|
+
}, $[80] = boundaryElement, $[81] = portalElement, $[82] = t29) : t29 = $[82];
|
|
4603
4644
|
let t30;
|
|
4604
4645
|
$[83] !== boundaryElement || $[84] !== portalElement ? (t30 = [boundaryElement, portalElement], $[83] = boundaryElement, $[84] = portalElement, $[85] = t30) : t30 = $[85], useLayoutEffect(t29, t30);
|
|
4605
4646
|
let t31;
|
|
@@ -4652,16 +4693,26 @@ function Tooltip(props) {
|
|
|
4652
4693
|
let t40;
|
|
4653
4694
|
$[109] !== animate || $[110] !== arrowProp || $[111] !== arrowX || $[112] !== arrowY || $[113] !== as || $[114] !== content2 || $[115] !== originX || $[116] !== originY || $[117] !== padding || $[118] !== placement || $[119] !== radius || $[120] !== rest || $[121] !== scheme || $[122] !== setArrow || $[123] !== setFloating || $[124] !== shadow || $[125] !== t37 || $[126] !== t39 || $[127] !== tone || $[128] !== zOffset ? (t40 = /* @__PURE__ */ jsx(TooltipLayer, { "data-ui": "Tooltip", ...rest, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, className: t37, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, style: t39, tone, zOffset, children: content2 }), $[109] = animate, $[110] = arrowProp, $[111] = arrowX, $[112] = arrowY, $[113] = as, $[114] = content2, $[115] = originX, $[116] = originY, $[117] = padding, $[118] = placement, $[119] = radius, $[120] = rest, $[121] = scheme, $[122] = setArrow, $[123] = setFloating, $[124] = shadow, $[125] = t37, $[126] = t39, $[127] = tone, $[128] = zOffset, $[129] = t40) : t40 = $[129];
|
|
4654
4695
|
const node_0 = t40;
|
|
4696
|
+
let children = showTooltip ? node_0 : null;
|
|
4697
|
+
if (showTooltip && portalProp) {
|
|
4698
|
+
let resolvedTone = tone;
|
|
4699
|
+
if (tone === "inherit") {
|
|
4700
|
+
const card2 = use(CardContext);
|
|
4701
|
+
assertCardContext(card2), resolvedTone = card2.tone;
|
|
4702
|
+
}
|
|
4703
|
+
const t412 = typeof portalProp == "string" ? portalProp : void 0, t422 = scheme ?? "light";
|
|
4704
|
+
let t43;
|
|
4705
|
+
$[130] !== node_0 || $[131] !== resolvedTone || $[132] !== t422 ? (t43 = /* @__PURE__ */ jsx(CardProvider, { tone: resolvedTone, scheme: t422, children: node_0 }), $[130] = node_0, $[131] = resolvedTone, $[132] = t422, $[133] = t43) : t43 = $[133];
|
|
4706
|
+
let t44;
|
|
4707
|
+
$[134] !== t412 || $[135] !== t43 ? (t44 = /* @__PURE__ */ jsx(Portal, { __unstable_name: t412, children: t43 }), $[134] = t412, $[135] = t43, $[136] = t44) : t44 = $[136], children = t44;
|
|
4708
|
+
}
|
|
4655
4709
|
let t41;
|
|
4656
|
-
$[
|
|
4657
|
-
const children = t41;
|
|
4710
|
+
$[137] !== animate || $[138] !== children ? (t41 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[137] = animate, $[138] = children, $[139] = t41) : t41 = $[139];
|
|
4658
4711
|
let t42;
|
|
4659
|
-
$[
|
|
4660
|
-
|
|
4661
|
-
return $[140] !== child || $[141] !== t42 ? (t43 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4662
|
-
t42,
|
|
4712
|
+
return $[140] !== child || $[141] !== t41 ? (t42 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4713
|
+
t41,
|
|
4663
4714
|
child
|
|
4664
|
-
] }), $[140] = child, $[141] =
|
|
4715
|
+
] }), $[140] = child, $[141] = t41, $[142] = t42) : t42 = $[142], t42;
|
|
4665
4716
|
}
|
|
4666
4717
|
function useMiddleware(t0) {
|
|
4667
4718
|
const $ = c(17), {
|
|
@@ -4744,21 +4795,26 @@ function TooltipDelayGroupProvider(props) {
|
|
|
4744
4795
|
}, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t0, $[5] = t1) : t1 = $[5];
|
|
4745
4796
|
const value = t1;
|
|
4746
4797
|
let t2;
|
|
4747
|
-
return $[6] !== children || $[7] !== value ? (t2 = /* @__PURE__ */ jsx(TooltipDelayGroupContext
|
|
4798
|
+
return $[6] !== children || $[7] !== value ? (t2 = /* @__PURE__ */ jsx(TooltipDelayGroupContext, { value, children }), $[6] = children, $[7] = value, $[8] = t2) : t2 = $[8], t2;
|
|
4799
|
+
}
|
|
4800
|
+
function useTooltipDelayGroup() {
|
|
4801
|
+
return use(TooltipDelayGroupContext);
|
|
4748
4802
|
}
|
|
4749
4803
|
function BoundaryElementProvider(props) {
|
|
4750
|
-
const $ = c(
|
|
4804
|
+
const $ = c(3), {
|
|
4751
4805
|
children,
|
|
4752
4806
|
element
|
|
4753
4807
|
} = props;
|
|
4754
4808
|
let t0;
|
|
4755
|
-
$[0] !== element ? (t0 = {
|
|
4809
|
+
return $[0] !== children || $[1] !== element ? (t0 = /* @__PURE__ */ jsx(BoundaryElementContext, { value: element, children }), $[0] = children, $[1] = element, $[2] = t0) : t0 = $[2], t0;
|
|
4810
|
+
}
|
|
4811
|
+
function useBoundaryElement() {
|
|
4812
|
+
const $ = c(2), element = use(BoundaryElementContext);
|
|
4813
|
+
let t0;
|
|
4814
|
+
return $[0] !== element ? (t0 = {
|
|
4756
4815
|
version: 0,
|
|
4757
4816
|
element
|
|
4758
|
-
}, $[0] = element, $[1] = t0) : t0 = $[1];
|
|
4759
|
-
const value = t0;
|
|
4760
|
-
let t1;
|
|
4761
|
-
return $[2] !== children || $[3] !== value ? (t1 = /* @__PURE__ */ jsx(BoundaryElementContext.Provider, { value, children }), $[2] = children, $[3] = value, $[4] = t1) : t1 = $[4], t1;
|
|
4817
|
+
}, $[0] = element, $[1] = t0) : t0 = $[1], t0;
|
|
4762
4818
|
}
|
|
4763
4819
|
function findMaxBreakpoints(media2, width) {
|
|
4764
4820
|
const ret = [];
|
|
@@ -5041,7 +5097,6 @@ export {
|
|
|
5041
5097
|
VirtualList,
|
|
5042
5098
|
_ResizeObserver,
|
|
5043
5099
|
_elementSizeObserver,
|
|
5044
|
-
_getArrayProp,
|
|
5045
5100
|
_getResponsiveProp,
|
|
5046
5101
|
_hasFocus,
|
|
5047
5102
|
_isEnterToClickElement,
|
|
@@ -5072,7 +5127,6 @@ export {
|
|
|
5072
5127
|
usePortal,
|
|
5073
5128
|
usePrefersDark,
|
|
5074
5129
|
usePrefersReducedMotion,
|
|
5075
|
-
useResponsiveProp,
|
|
5076
5130
|
useToast,
|
|
5077
5131
|
useTooltipDelayGroup,
|
|
5078
5132
|
useTree
|