@sanity/ui 2.3.6-canary.2 → 2.3.6-canary.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.compiled.mjs +724 -389
- package/dist/index.compiled.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +160 -161
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +160 -161
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +160 -161
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/core/components/autocomplete/autocomplete.tsx +30 -33
- package/src/core/components/dialog/dialog.tsx +4 -2
- package/src/core/components/menu/menu.tsx +3 -1
- package/src/core/components/menu/menuGroup.tsx +2 -1
- package/src/core/components/menu/menuItem.tsx +4 -2
- package/src/core/components/toast/toastProvider.tsx +26 -24
- package/src/core/components/tree/treeItem.styles.ts +21 -0
- package/src/core/components/tree/treeItem.tsx +31 -44
- package/src/core/primitives/avatar/avatar.tsx +8 -12
- package/src/core/primitives/avatar/avatarCounter.tsx +10 -15
- package/src/core/primitives/avatar/avatarStack.tsx +1 -4
- package/src/core/primitives/popover/popover.tsx +41 -44
- package/src/core/primitives/tooltip/tooltip.tsx +8 -5
- package/src/core/utils/elementQuery/elementQuery.tsx +4 -3
- package/src/core/utils/layer/getLayerContext.test.ts +0 -4
- package/src/core/utils/layer/layer.test.tsx +0 -2
- package/src/core/utils/layer/layerProvider.tsx +32 -41
- package/src/core/utils/layer/types.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -934,7 +934,7 @@ const Root$B = styledComponents.styled.div(
|
|
|
934
934
|
status = "online",
|
|
935
935
|
size: sizeProp = 1,
|
|
936
936
|
...restProps
|
|
937
|
-
} = props, { avatar } = useTheme_v2(), as = reactIs.isValidElementType(asProp) ? asProp : "div", size2 =
|
|
937
|
+
} = props, { avatar } = useTheme_v2(), as = reactIs.isValidElementType(asProp) ? asProp : "div", size2 = _getArrayProp(sizeProp), _sizeRem = (avatar.sizes[size2[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = react.useId(), [arrowPosition, setArrowPosition] = react.useState(
|
|
938
938
|
animateArrowFrom || arrowPositionProp || "inside"
|
|
939
939
|
), [imageFailed, setImageFailed] = react.useState(!1), imageId = `avatar-image-${elementId}`;
|
|
940
940
|
react.useEffect(() => {
|
|
@@ -946,10 +946,7 @@ const Root$B = styledComponents.styled.div(
|
|
|
946
946
|
}, [src]);
|
|
947
947
|
const handleImageError = react.useCallback(() => {
|
|
948
948
|
setImageFailed(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
|
|
949
|
-
}, [onImageLoadError]), initialsSize =
|
|
950
|
-
() => size2.map((s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0),
|
|
951
|
-
[size2]
|
|
952
|
-
);
|
|
949
|
+
}, [onImageLoadError]), initialsSize = size2.map((s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0);
|
|
953
950
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
954
951
|
Root$B,
|
|
955
952
|
{
|
|
@@ -1044,11 +1041,8 @@ const Root$A = styledComponents.styled.div(
|
|
|
1044
1041
|
_responsiveAvatarCounterSizeStyle,
|
|
1045
1042
|
_avatarCounterBaseStyle
|
|
1046
1043
|
), AvatarCounter = react.forwardRef(function(props, ref) {
|
|
1047
|
-
const { count, size:
|
|
1048
|
-
|
|
1049
|
-
[size2]
|
|
1050
|
-
);
|
|
1051
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: /* @__PURE__ */ jsxRuntime.jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }) });
|
|
1044
|
+
const { count, size: size2 } = props, $size = _getArrayProp(size2 != null ? size2 : 1), fontSize2 = $size.map((s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0);
|
|
1045
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root$A, { $size, "data-ui": "AvatarCounter", ref, children: /* @__PURE__ */ jsxRuntime.jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }) });
|
|
1052
1046
|
}), BASE_STYLES = styledComponents.css`
|
|
1053
1047
|
white-space: nowrap;
|
|
1054
1048
|
|
|
@@ -1080,10 +1074,7 @@ const Root$z = styledComponents.styled.div(responsiveAvatarStackSizeStyle, avata
|
|
|
1080
1074
|
maxLength: maxLengthProp = 4,
|
|
1081
1075
|
size: sizeProp = 1,
|
|
1082
1076
|
...restProps
|
|
1083
|
-
} = props, children = react.useMemo(
|
|
1084
|
-
() => react.Children.toArray(childrenProp).filter(react.isValidElement),
|
|
1085
|
-
[childrenProp]
|
|
1086
|
-
), maxLength = Math.max(maxLengthProp, 0), size2 = react.useMemo(() => _getArrayProp(sizeProp), [sizeProp]), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
|
|
1077
|
+
} = props, children = react.Children.toArray(childrenProp).filter(react.isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = react.useMemo(() => _getArrayProp(sizeProp), [sizeProp]), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
|
|
1087
1078
|
return /* @__PURE__ */ jsxRuntime.jsxs(Root$z, { "data-ui": "AvatarStack", ...restProps, ref, $size: size2, children: [
|
|
1088
1079
|
len === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: len, size: size2 }) }),
|
|
1089
1080
|
len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size: size2 }) }),
|
|
@@ -2830,10 +2821,10 @@ function findMinBreakpoints(media, width) {
|
|
|
2830
2821
|
return ret;
|
|
2831
2822
|
}
|
|
2832
2823
|
const ElementQuery = react.forwardRef(function(props, forwardedRef) {
|
|
2833
|
-
const theme2 = useTheme_v2(), { children, media
|
|
2824
|
+
const theme2 = useTheme_v2(), { children, media: _media, ...restProps } = props, media = _media != null ? _media : theme2.media, ref = react.useRef(null), [element, setElement] = react.useState(null), elementSize = useElementSize(element), width = react.useMemo(() => {
|
|
2834
2825
|
var _a;
|
|
2835
2826
|
return (_a = elementSize == null ? void 0 : elementSize.border.width) != null ? _a : window.innerWidth;
|
|
2836
|
-
}, [elementSize]), max =
|
|
2827
|
+
}, [elementSize]), max = findMaxBreakpoints(media, width), min = findMinBreakpoints(media, width);
|
|
2837
2828
|
react.useImperativeHandle(forwardedRef, () => ref.current);
|
|
2838
2829
|
const setRef = react.useCallback((el) => {
|
|
2839
2830
|
ref.current = el, setElement(el);
|
|
@@ -2967,18 +2958,18 @@ function _isScrollable(el) {
|
|
|
2967
2958
|
}
|
|
2968
2959
|
function LayerProvider(props) {
|
|
2969
2960
|
var _a;
|
|
2970
|
-
const { children, zOffset: zOffsetProp = 0 } = props, parentContextValue = react.useContext(LayerContext), parent = parentContextValue && getLayerContext(parentContextValue),
|
|
2961
|
+
const { children, zOffset: zOffsetProp = 0 } = props, parentContextValue = react.useContext(LayerContext), parentRegisterChild = react.useContext(LayerContextRegisterChild), parent = parentContextValue && getLayerContext(parentContextValue), level = ((_a = parent == null ? void 0 : parent.level) != null ? _a : 0) + 1, zOffset = react.useMemo(() => _getArrayProp(zOffsetProp), [zOffsetProp]), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex], [childLayers, setChildLayers] = react.useState({}), size2 = react.useMemo(() => Object.keys(childLayers).length, [childLayers]), isTopLayer = size2 === 0, registerChild = react.useCallback(
|
|
2971
2962
|
(childLevel) => {
|
|
2972
2963
|
const parentDispose = parentRegisterChild == null ? void 0 : parentRegisterChild(childLevel);
|
|
2973
|
-
return
|
|
2964
|
+
return setChildLayers((state) => {
|
|
2974
2965
|
var _a2;
|
|
2975
|
-
const prevLen = (_a2 = state[childLevel]) != null ? _a2 : 0
|
|
2976
|
-
return
|
|
2977
|
-
})
|
|
2978
|
-
|
|
2966
|
+
const prevLen = (_a2 = state[childLevel]) != null ? _a2 : 0;
|
|
2967
|
+
return { ...state, [childLevel]: prevLen + 1 };
|
|
2968
|
+
}), () => {
|
|
2969
|
+
setChildLayers((state) => {
|
|
2979
2970
|
const nextState = { ...state };
|
|
2980
|
-
return nextState[childLevel] === 1 ?
|
|
2981
|
-
})
|
|
2971
|
+
return nextState[childLevel] === 1 ? delete nextState[childLevel] : nextState[childLevel] -= 1, nextState;
|
|
2972
|
+
}), parentDispose == null || parentDispose();
|
|
2982
2973
|
};
|
|
2983
2974
|
},
|
|
2984
2975
|
[parentRegisterChild]
|
|
@@ -2989,15 +2980,14 @@ function LayerProvider(props) {
|
|
|
2989
2980
|
version: 0,
|
|
2990
2981
|
isTopLayer,
|
|
2991
2982
|
level,
|
|
2992
|
-
registerChild,
|
|
2993
2983
|
size: size2,
|
|
2994
2984
|
zIndex
|
|
2995
2985
|
}),
|
|
2996
|
-
[isTopLayer, level,
|
|
2986
|
+
[isTopLayer, level, size2, zIndex]
|
|
2997
2987
|
);
|
|
2998
|
-
return /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children });
|
|
2988
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(LayerContextRegisterChild.Provider, { value: registerChild, children }) });
|
|
2999
2989
|
}
|
|
3000
|
-
const Root$j = styledComponents.styled.div({ position: "relative" }), LayerChildren = react.forwardRef(function(props, forwardedRef) {
|
|
2990
|
+
const LayerContextRegisterChild = react.createContext(null), Root$j = styledComponents.styled.div({ position: "relative" }), LayerChildren = react.forwardRef(function(props, forwardedRef) {
|
|
3001
2991
|
const { children, onActivate, onFocus, style = EMPTY_RECORD, ...restProps } = props, { zIndex, isTopLayer } = useLayer(), lastFocusedRef = react.useRef(null), ref = react.useRef(null), isTopLayerRef = react.useRef(isTopLayer);
|
|
3002
2992
|
react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => {
|
|
3003
2993
|
isTopLayerRef.current !== isTopLayer && isTopLayer && (onActivate == null || onActivate({ activeElement: lastFocusedRef.current })), isTopLayerRef.current = isTopLayer;
|
|
@@ -3265,19 +3255,19 @@ const MotionCard$1 = styledComponents.styled(framerMotion.motion(Card))`
|
|
|
3265
3255
|
PopoverCard.displayName = "PopoverCard";
|
|
3266
3256
|
const Popover = react.memo(
|
|
3267
3257
|
react.forwardRef(function(props, forwardedRef) {
|
|
3268
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i
|
|
3258
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
3269
3259
|
const { container, layer } = useTheme_v2(), boundaryElementContext = useBoundaryElement(), {
|
|
3270
3260
|
__unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
|
|
3271
3261
|
animate: _animate = !1,
|
|
3272
3262
|
arrow: arrowProp = !1,
|
|
3273
|
-
boundaryElement
|
|
3274
|
-
children
|
|
3263
|
+
boundaryElement: _boundaryElement,
|
|
3264
|
+
children,
|
|
3275
3265
|
constrainSize = !1,
|
|
3276
3266
|
content,
|
|
3277
3267
|
disabled,
|
|
3278
|
-
fallbackPlacements
|
|
3268
|
+
fallbackPlacements: _fallbackPlacements,
|
|
3279
3269
|
matchReferenceWidth,
|
|
3280
|
-
floatingBoundary
|
|
3270
|
+
floatingBoundary: _floatingBoundary,
|
|
3281
3271
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3282
3272
|
onActivate,
|
|
3283
3273
|
open,
|
|
@@ -3287,16 +3277,16 @@ const Popover = react.memo(
|
|
|
3287
3277
|
portal,
|
|
3288
3278
|
preventOverflow = !0,
|
|
3289
3279
|
radius: radiusProp = 3,
|
|
3290
|
-
referenceBoundary
|
|
3280
|
+
referenceBoundary: _referenceBoundary,
|
|
3291
3281
|
referenceElement,
|
|
3292
3282
|
scheme,
|
|
3293
3283
|
shadow: shadowProp = 3,
|
|
3294
3284
|
tone = "inherit",
|
|
3295
3285
|
width: widthProp = "auto",
|
|
3296
|
-
zOffset:
|
|
3286
|
+
zOffset: _zOffset,
|
|
3297
3287
|
updateRef,
|
|
3298
3288
|
...restProps
|
|
3299
|
-
} = props, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = (
|
|
3289
|
+
} = props, boundaryElement = _boundaryElement != null ? _boundaryElement : boundaryElementContext.element, referenceBoundary = (_a = _referenceBoundary != null ? _referenceBoundary : props.boundaryElement) != null ? _a : boundaryElementContext.element, floatingBoundary = (_b = _floatingBoundary != null ? _floatingBoundary : props.boundaryElement) != null ? _b : boundaryElementContext.element, fallbackPlacements = _fallbackPlacements != null ? _fallbackPlacements : DEFAULT_FALLBACK_PLACEMENTS$1[(_c = props.placement) != null ? _c : "bottom"], zOffsetProp = _zOffset != null ? _zOffset : layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = (_d = useElementSize(boundaryElement)) == null ? void 0 : _d.border, padding = react.useMemo(() => _getArrayProp(paddingProp), [paddingProp]), radius = react.useMemo(() => _getArrayProp(radiusProp), [radiusProp]), shadow = react.useMemo(() => _getArrayProp(shadowProp), [shadowProp]), widthArrayProp = _getArrayProp(widthProp), zOffset = react.useMemo(() => _getArrayProp(zOffsetProp), [zOffsetProp]), ref = react.useRef(null), arrowRef = react.useRef(null), rootBoundary = "viewport";
|
|
3300
3290
|
react.useImperativeHandle(
|
|
3301
3291
|
forwardedRef,
|
|
3302
3292
|
() => ref.current
|
|
@@ -3377,27 +3367,18 @@ const Popover = react.memo(
|
|
|
3377
3367
|
middleware,
|
|
3378
3368
|
placement: placementProp,
|
|
3379
3369
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
3380
|
-
}), referenceHidden = (
|
|
3370
|
+
}), referenceHidden = (_e = middlewareData.hide) == null ? void 0 : _e.referenceHidden, arrowX = (_f = middlewareData.arrow) == null ? void 0 : _f.x, arrowY = (_g = middlewareData.arrow) == null ? void 0 : _g.y, originX = (_h = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _h.originX, originY = (_i = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _i.originY, setArrow = react.useCallback((arrowEl) => {
|
|
3381
3371
|
arrowRef.current = arrowEl;
|
|
3382
3372
|
}, []), setFloating = react.useCallback(
|
|
3383
3373
|
(node) => {
|
|
3384
3374
|
ref.current = node, refs.setFloating(node);
|
|
3385
3375
|
},
|
|
3386
3376
|
[refs]
|
|
3387
|
-
)
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
},
|
|
3393
|
-
[childProp, refs]
|
|
3394
|
-
), child = react.useMemo(() => !childProp || referenceElement ? null : react.cloneElement(childProp, { ref: setReference }), [childProp, referenceElement, setReference]);
|
|
3395
|
-
if (react.useEffect(() => {
|
|
3396
|
-
updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
|
|
3397
|
-
}, [update, updateRef]), react.useEffect(() => {
|
|
3398
|
-
child || refs.setReference(referenceElement || null);
|
|
3399
|
-
}, [referenceElement, refs, child]), disabled)
|
|
3400
|
-
return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
3377
|
+
);
|
|
3378
|
+
if (react.useImperativeHandle(updateRef, () => update, [update]), react.useEffect(() => {
|
|
3379
|
+
children || refs.setReference(referenceElement || null);
|
|
3380
|
+
}, [children, referenceElement, refs]), disabled)
|
|
3381
|
+
return children || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
3401
3382
|
const popover = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3402
3383
|
PopoverCard,
|
|
3403
3384
|
{
|
|
@@ -3431,22 +3412,35 @@ const Popover = react.memo(
|
|
|
3431
3412
|
ConditionalWrapper,
|
|
3432
3413
|
{
|
|
3433
3414
|
condition: animate,
|
|
3434
|
-
wrapper: (
|
|
3415
|
+
wrapper: (children2) => /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: children2 }),
|
|
3435
3416
|
children: open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3436
3417
|
ConditionalWrapper,
|
|
3437
3418
|
{
|
|
3438
3419
|
condition: !!portal,
|
|
3439
|
-
wrapper: (
|
|
3420
|
+
wrapper: (children2) => /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: children2 }),
|
|
3440
3421
|
children: popover
|
|
3441
3422
|
}
|
|
3442
3423
|
)
|
|
3443
3424
|
}
|
|
3444
3425
|
),
|
|
3445
|
-
|
|
3426
|
+
children && !referenceElement && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3427
|
+
"div",
|
|
3428
|
+
{
|
|
3429
|
+
ref: (node) => {
|
|
3430
|
+
logDeprecatedWarning(), refs.setReference(node);
|
|
3431
|
+
},
|
|
3432
|
+
style: { display: "contents" },
|
|
3433
|
+
children
|
|
3434
|
+
}
|
|
3435
|
+
)
|
|
3446
3436
|
] });
|
|
3447
3437
|
})
|
|
3448
3438
|
);
|
|
3449
3439
|
Popover.displayName = "Popover";
|
|
3440
|
+
let didWarn = !1;
|
|
3441
|
+
function logDeprecatedWarning() {
|
|
3442
|
+
didWarn || (console.warn("Popover: Please use the `referenceElement` prop instead of passing a children."), didWarn = !0);
|
|
3443
|
+
}
|
|
3450
3444
|
function radioBaseStyle() {
|
|
3451
3445
|
return styledComponents.css`
|
|
3452
3446
|
position: relative;
|
|
@@ -4319,30 +4313,30 @@ const Root$a = styledComponents.styled(Layer)`
|
|
|
4319
4313
|
pointer-events: none;
|
|
4320
4314
|
max-width: ${({ $maxWidth }) => $maxWidth}px;
|
|
4321
4315
|
`, Tooltip = react.forwardRef(function(props, forwardedRef) {
|
|
4322
|
-
var _a, _b, _c, _d, _e, _f
|
|
4316
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4323
4317
|
const boundaryElementContext = useBoundaryElement(), { layer } = useTheme_v2(), {
|
|
4324
4318
|
animate: _animate = !1,
|
|
4325
4319
|
arrow: arrowProp = !1,
|
|
4326
|
-
boundaryElement
|
|
4320
|
+
boundaryElement: _boundaryElement,
|
|
4327
4321
|
children: childProp,
|
|
4328
4322
|
content,
|
|
4329
4323
|
disabled,
|
|
4330
|
-
fallbackPlacements:
|
|
4324
|
+
fallbackPlacements: _fallbackPlacements,
|
|
4331
4325
|
padding = 2,
|
|
4332
4326
|
placement: placementProp = "bottom",
|
|
4333
4327
|
portal: portalProp,
|
|
4334
4328
|
radius = 2,
|
|
4335
4329
|
scheme,
|
|
4336
4330
|
shadow = 2,
|
|
4337
|
-
zOffset
|
|
4331
|
+
zOffset: _zOffset,
|
|
4338
4332
|
delay,
|
|
4339
4333
|
...restProps
|
|
4340
|
-
} = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = react.useMemo(
|
|
4334
|
+
} = props, zOffset = _zOffset != null ? _zOffset : layer.tooltip.zOffset, fallbackPlacementsProp = _fallbackPlacements != null ? _fallbackPlacements : DEFAULT_FALLBACK_PLACEMENTS[(_a = props.placement) != null ? _a : "bottom"], boundaryElement = _boundaryElement != null ? _boundaryElement : boundaryElementContext == null ? void 0 : boundaryElementContext.element, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = react.useMemo(
|
|
4341
4335
|
() => _getArrayProp(fallbackPlacementsProp),
|
|
4342
4336
|
[fallbackPlacementsProp]
|
|
4343
4337
|
), ref = react.useRef(null), [referenceElement, setReferenceElement] = react.useState(null), arrowRef = react.useRef(null), rootBoundary = "viewport";
|
|
4344
4338
|
react.useImperativeHandle(forwardedRef, () => ref.current);
|
|
4345
|
-
const portal = usePortal(), portalElement = typeof portalProp == "string" ? ((
|
|
4339
|
+
const portal = usePortal(), portalElement = typeof portalProp == "string" ? ((_b = portal.elements) == null ? void 0 : _b[portalProp]) || null : portal.element, documentBodyOffsetWidth = react.useSyncExternalStore(
|
|
4346
4340
|
emptySubscribe,
|
|
4347
4341
|
() => document.body.offsetWidth,
|
|
4348
4342
|
// We don't actually know what the width of the body is during SSR, so we'll just assume it's 800px or larger
|
|
@@ -4373,7 +4367,7 @@ const Root$a = styledComponents.styled(Layer)`
|
|
|
4373
4367
|
middleware,
|
|
4374
4368
|
placement: placementProp,
|
|
4375
4369
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
4376
|
-
}), arrowX = (
|
|
4370
|
+
}), arrowX = (_c = middlewareData.arrow) == null ? void 0 : _c.x, arrowY = (_d = middlewareData.arrow) == null ? void 0 : _d.y, originX = (_e = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _e.originX, originY = (_f = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _f.originY, tooltipId = react.useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), showTooltip = isOpen || (delayGroupContext == null ? void 0 : delayGroupContext.openTooltipId) === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : (delay == null ? void 0 : delay.open) || 0, closeDelayProp = typeof delay == "number" ? delay : (delay == null ? void 0 : delay.close) || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, handleIsOpenChange = react.useCallback(
|
|
4377
4371
|
(open, immediate) => {
|
|
4378
4372
|
if (isInsideGroup)
|
|
4379
4373
|
if (open) {
|
|
@@ -4426,9 +4420,9 @@ const Root$a = styledComponents.styled(Layer)`
|
|
|
4426
4420
|
);
|
|
4427
4421
|
react.useEffect(() => {
|
|
4428
4422
|
if (!showTooltip) return;
|
|
4429
|
-
|
|
4423
|
+
const handleWindowMouseMove = (event) => {
|
|
4430
4424
|
referenceElement && (referenceElement === event.target || event.target instanceof Node && referenceElement.contains(event.target) || (handleIsOpenChange(!1), window.removeEventListener("mousemove", handleWindowMouseMove)));
|
|
4431
|
-
}
|
|
4425
|
+
};
|
|
4432
4426
|
return window.addEventListener("mousemove", handleWindowMouseMove), () => {
|
|
4433
4427
|
window.removeEventListener("mousemove", handleWindowMouseMove);
|
|
4434
4428
|
};
|
|
@@ -4629,37 +4623,34 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
4629
4623
|
forwardedRef,
|
|
4630
4624
|
() => inputElementRef.current
|
|
4631
4625
|
);
|
|
4632
|
-
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding =
|
|
4626
|
+
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = _getArrayProp(paddingProp), currentOption = react.useMemo(
|
|
4633
4627
|
() => value !== null ? options.find((o) => o.value === value) : void 0,
|
|
4634
4628
|
[options, value]
|
|
4635
4629
|
), filteredOptions = react.useMemo(
|
|
4636
4630
|
() => options.filter((option) => query ? filterOption(query, option) : !0),
|
|
4637
4631
|
[filterOption, options, query]
|
|
4638
|
-
), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur =
|
|
4639
|
-
(
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
},
|
|
4658
|
-
[onBlur, onQueryChange, relatedElements]
|
|
4659
|
-
), handleRootFocus = react.useCallback((event) => {
|
|
4632
|
+
), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = (event) => {
|
|
4633
|
+
setTimeout(() => {
|
|
4634
|
+
if (popoverMouseWithinRef.current)
|
|
4635
|
+
return;
|
|
4636
|
+
const elements = (relatedElements || []).concat(
|
|
4637
|
+
rootElementRef.current ? [rootElementRef.current] : [],
|
|
4638
|
+
resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []
|
|
4639
|
+
);
|
|
4640
|
+
let focusInside = !1;
|
|
4641
|
+
if (document.activeElement) {
|
|
4642
|
+
for (const e of elements)
|
|
4643
|
+
if (e === document.activeElement || e.contains(document.activeElement)) {
|
|
4644
|
+
focusInside = !0;
|
|
4645
|
+
break;
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
focusInside === !1 && (dispatch({ type: "root/blur" }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
|
|
4649
|
+
}, 0);
|
|
4650
|
+
}, handleRootFocus = (event) => {
|
|
4660
4651
|
const listBoxElement = listBoxElementRef.current, focusedElement = event.target instanceof HTMLElement ? event.target : null, listFocused2 = (listBoxElement == null ? void 0 : listBoxElement.contains(focusedElement)) || !1;
|
|
4661
4652
|
listFocused2 !== listFocusedRef.current && (listFocusedRef.current = listFocused2, dispatch({ type: "root/setListFocused", listFocused: listFocused2 }));
|
|
4662
|
-
},
|
|
4653
|
+
}, handleOptionSelect = react.useCallback(
|
|
4663
4654
|
(v) => {
|
|
4664
4655
|
var _a;
|
|
4665
4656
|
dispatch({ type: "value/change", value: v }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), (_a = inputElementRef.current) == null || _a.focus();
|
|
@@ -5149,13 +5140,13 @@ const Root$7 = styledComponents.styled(Layer)(responsivePaddingStyle, dialogStyl
|
|
|
5149
5140
|
onFocus,
|
|
5150
5141
|
padding: paddingProp = 3,
|
|
5151
5142
|
portal: portalProp,
|
|
5152
|
-
position:
|
|
5143
|
+
position: _position,
|
|
5153
5144
|
scheme,
|
|
5154
5145
|
width: widthProp = 0,
|
|
5155
|
-
zOffset:
|
|
5146
|
+
zOffset: _zOffset,
|
|
5156
5147
|
animate: _animate = !1,
|
|
5157
5148
|
...restProps
|
|
5158
|
-
} = props, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? ((_a = portal.elements) == null ? void 0 : _a[portalProp]) || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = react.useMemo(() => _getArrayProp(cardRadiusProp), [cardRadiusProp]), padding = react.useMemo(() => _getArrayProp(paddingProp), [paddingProp]), position = react.useMemo(() => _getArrayProp(positionProp), [positionProp]), width = react.useMemo(() => _getArrayProp(widthProp), [widthProp]), zOffset = react.useMemo(() => _getArrayProp(zOffsetProp), [zOffsetProp]), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null), handleFocus = react.useCallback(
|
|
5149
|
+
} = props, positionProp = _position != null ? _position : dialog.position || "fixed", zOffsetProp = _zOffset != null ? _zOffset : dialog.zOffset || layer.dialog.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? ((_a = portal.elements) == null ? void 0 : _a[portalProp]) || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = react.useMemo(() => _getArrayProp(cardRadiusProp), [cardRadiusProp]), padding = react.useMemo(() => _getArrayProp(paddingProp), [paddingProp]), position = react.useMemo(() => _getArrayProp(positionProp), [positionProp]), width = react.useMemo(() => _getArrayProp(widthProp), [widthProp]), zOffset = react.useMemo(() => _getArrayProp(zOffsetProp), [zOffsetProp]), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null), handleFocus = react.useCallback(
|
|
5159
5150
|
(event) => {
|
|
5160
5151
|
onFocus == null || onFocus(event);
|
|
5161
5152
|
const target = event.target, cardElement = cardRef.current;
|
|
@@ -5419,10 +5410,10 @@ const Root$5 = styledComponents.styled(Box)`
|
|
|
5419
5410
|
originElement,
|
|
5420
5411
|
padding = 1,
|
|
5421
5412
|
registerElement,
|
|
5422
|
-
shouldFocus
|
|
5413
|
+
shouldFocus: _shouldFocus,
|
|
5423
5414
|
space = 1,
|
|
5424
5415
|
...restProps
|
|
5425
|
-
} = props, ref = react.useRef(null);
|
|
5416
|
+
} = props, shouldFocus = _shouldFocus != null ? _shouldFocus : props.focusFirst && "first" || props.focusLast && "last" || null, ref = react.useRef(null);
|
|
5426
5417
|
react.useImperativeHandle(forwardedRef, () => ref.current);
|
|
5427
5418
|
const { isTopLayer } = useLayer(), {
|
|
5428
5419
|
activeElement,
|
|
@@ -5768,9 +5759,9 @@ function MenuGroup(props) {
|
|
|
5768
5759
|
onClickOutside,
|
|
5769
5760
|
onEscape,
|
|
5770
5761
|
onItemClick,
|
|
5771
|
-
onItemMouseEnter
|
|
5762
|
+
onItemMouseEnter: _onItemMouseEnter,
|
|
5772
5763
|
registerElement
|
|
5773
|
-
} = menu, [rootElement, setRootElement] = react.useState(null), [open, setOpen] = react.useState(!1), shouldFocusRef = react.useRef(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = react.useState(!1), radius = react.useMemo(() => _getArrayProp(radiusProp), [radiusProp]), handleMouseEnter = react.useCallback(
|
|
5764
|
+
} = menu, onItemMouseEnter = _onItemMouseEnter != null ? _onItemMouseEnter : menu.onMouseEnter, [rootElement, setRootElement] = react.useState(null), [open, setOpen] = react.useState(!1), shouldFocusRef = react.useRef(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = react.useState(!1), radius = react.useMemo(() => _getArrayProp(radiusProp), [radiusProp]), handleMouseEnter = react.useCallback(
|
|
5774
5765
|
(event) => {
|
|
5775
5766
|
setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
|
|
5776
5767
|
},
|
|
@@ -5876,9 +5867,9 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
|
|
|
5876
5867
|
activeElement,
|
|
5877
5868
|
mount,
|
|
5878
5869
|
onItemClick,
|
|
5879
|
-
onItemMouseEnter
|
|
5880
|
-
onItemMouseLeave
|
|
5881
|
-
} = menu, [rootElement, setRootElement] = react.useState(null), active = !!activeElement && activeElement === rootElement, ref = react.useRef(null);
|
|
5870
|
+
onItemMouseEnter: _onItemMouseEnter,
|
|
5871
|
+
onItemMouseLeave: _onItemMouseLeave
|
|
5872
|
+
} = menu, onItemMouseEnter = _onItemMouseEnter != null ? _onItemMouseEnter : menu.onMouseEnter, onItemMouseLeave = _onItemMouseLeave != null ? _onItemMouseLeave : menu.onMouseLeave, [rootElement, setRootElement] = react.useState(null), active = !!activeElement && activeElement === rootElement, ref = react.useRef(null);
|
|
5882
5873
|
react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => mount(rootElement, selectedProp), [mount, rootElement, selectedProp]);
|
|
5883
5874
|
const handleClick = react.useCallback(
|
|
5884
5875
|
(event) => {
|
|
@@ -6198,33 +6189,12 @@ const subscribe = () => () => {
|
|
|
6198
6189
|
max-width: 420px;
|
|
6199
6190
|
width: 100%;
|
|
6200
6191
|
`;
|
|
6201
|
-
let toastId = 0;
|
|
6202
6192
|
function ToastProvider(props) {
|
|
6203
6193
|
const { children, padding = 4, paddingX, paddingY, zOffset } = props, [state, _setState] = react.useState([]), toastsRef = react.useRef({}), mounted = useMounted(), prefersReducedMotion = usePrefersReducedMotion(), variants = react.useMemo(
|
|
6204
|
-
() => (
|
|
6205
|
-
initial: {
|
|
6206
|
-
opacity: 0,
|
|
6207
|
-
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
|
|
6208
|
-
y: 32,
|
|
6209
|
-
scale: 0.25,
|
|
6210
|
-
willChange: "transform"
|
|
6211
|
-
},
|
|
6212
|
-
animate: {
|
|
6213
|
-
opacity: [0, 1, 1],
|
|
6214
|
-
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [0, 0, 1],
|
|
6215
|
-
y: 0,
|
|
6216
|
-
scale: 1
|
|
6217
|
-
},
|
|
6218
|
-
exit: {
|
|
6219
|
-
opacity: [1, 1, 0],
|
|
6220
|
-
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [1, 0, 0],
|
|
6221
|
-
scale: 0.5,
|
|
6222
|
-
transition: prefersReducedMotion ? { duration: 0 } : { duration: 0.2 }
|
|
6223
|
-
}
|
|
6224
|
-
}),
|
|
6194
|
+
() => getVariants(prefersReducedMotion),
|
|
6225
6195
|
[prefersReducedMotion]
|
|
6226
6196
|
), value = react.useMemo(() => ({ version: 0, push: (params) => {
|
|
6227
|
-
const setState = (state2) => react.startTransition(() => _setState(state2)), id = params.id ||
|
|
6197
|
+
const setState = (state2) => react.startTransition(() => _setState(state2)), id = params.id || crypto.randomUUID(), duration = params.duration || 5e3, dismiss = () => {
|
|
6228
6198
|
var _a;
|
|
6229
6199
|
const timeoutId = (_a = toastsRef.current[id]) == null ? void 0 : _a.timeoutId;
|
|
6230
6200
|
setState((prevState) => {
|
|
@@ -6277,6 +6247,29 @@ function ToastProvider(props) {
|
|
|
6277
6247
|
)) }) }) }) })
|
|
6278
6248
|
] });
|
|
6279
6249
|
}
|
|
6250
|
+
function getVariants(prefersReducedMotion) {
|
|
6251
|
+
return {
|
|
6252
|
+
initial: {
|
|
6253
|
+
opacity: 0,
|
|
6254
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
|
|
6255
|
+
y: 32,
|
|
6256
|
+
scale: 0.25,
|
|
6257
|
+
willChange: "transform"
|
|
6258
|
+
},
|
|
6259
|
+
animate: {
|
|
6260
|
+
opacity: [0, 1, 1],
|
|
6261
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [0, 0, 1],
|
|
6262
|
+
y: 0,
|
|
6263
|
+
scale: 1
|
|
6264
|
+
},
|
|
6265
|
+
exit: {
|
|
6266
|
+
opacity: [1, 1, 0],
|
|
6267
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [1, 0, 0],
|
|
6268
|
+
scale: 0.5,
|
|
6269
|
+
transition: { duration: prefersReducedMotion ? 0 : 0.2 }
|
|
6270
|
+
}
|
|
6271
|
+
};
|
|
6272
|
+
}
|
|
6280
6273
|
function useToast() {
|
|
6281
6274
|
const value = react.useContext(ToastContext);
|
|
6282
6275
|
if (!value)
|
|
@@ -6463,6 +6456,28 @@ const key = Symbol.for("@sanity/ui/context/tree"), TreeContext = createGlobalSco
|
|
|
6463
6456
|
})
|
|
6464
6457
|
);
|
|
6465
6458
|
Tree.displayName = "Tree";
|
|
6459
|
+
function useTree() {
|
|
6460
|
+
const tree = react.useContext(TreeContext);
|
|
6461
|
+
if (!tree)
|
|
6462
|
+
throw new Error("Tree: missing context value");
|
|
6463
|
+
return tree;
|
|
6464
|
+
}
|
|
6465
|
+
const TreeGroup = react.memo(function(props) {
|
|
6466
|
+
const { children, expanded = !1, ...restProps } = props, tree = useTree();
|
|
6467
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6468
|
+
Stack,
|
|
6469
|
+
{
|
|
6470
|
+
as: "ul",
|
|
6471
|
+
"data-ui": "TreeGroup",
|
|
6472
|
+
...restProps,
|
|
6473
|
+
hidden: !expanded,
|
|
6474
|
+
marginTop: tree.space,
|
|
6475
|
+
role: "group",
|
|
6476
|
+
space: tree.space,
|
|
6477
|
+
children
|
|
6478
|
+
}
|
|
6479
|
+
);
|
|
6480
|
+
});
|
|
6466
6481
|
function treeItemRootStyle() {
|
|
6467
6482
|
return styledComponents.css`
|
|
6468
6483
|
&[role='none'] > [role='treeitem'] {
|
|
@@ -6549,28 +6564,9 @@ function treeItemBoxStyle(props) {
|
|
|
6549
6564
|
}
|
|
6550
6565
|
`;
|
|
6551
6566
|
}
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
throw new Error("Tree: missing context value");
|
|
6556
|
-
return tree;
|
|
6557
|
-
}
|
|
6558
|
-
const TreeGroup = react.memo(function(props) {
|
|
6559
|
-
const { children, expanded = !1, ...restProps } = props, tree = useTree();
|
|
6560
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6561
|
-
Stack,
|
|
6562
|
-
{
|
|
6563
|
-
as: "ul",
|
|
6564
|
-
"data-ui": "TreeGroup",
|
|
6565
|
-
...restProps,
|
|
6566
|
-
hidden: !expanded,
|
|
6567
|
-
marginTop: tree.space,
|
|
6568
|
-
role: "group",
|
|
6569
|
-
space: tree.space,
|
|
6570
|
-
children
|
|
6571
|
-
}
|
|
6572
|
-
);
|
|
6573
|
-
}), Root = react.memo(styledComponents.styled.li(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = styledComponents.styled(Box).attrs({ forwardedAs: "a" })(treeItemBoxStyle), ToggleArrowText = styledComponents.styled(Text)`
|
|
6567
|
+
const Root = react.memo(styledComponents.styled.li(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = styledComponents.styled(Box).attrs({ forwardedAs: "a" })(
|
|
6568
|
+
treeItemBoxStyle
|
|
6569
|
+
), ToggleArrowText = styledComponents.styled(Text)`
|
|
6574
6570
|
& > svg {
|
|
6575
6571
|
transition: transform 100ms;
|
|
6576
6572
|
}
|
|
@@ -6591,12 +6587,12 @@ const TreeGroup = react.memo(function(props) {
|
|
|
6591
6587
|
text,
|
|
6592
6588
|
weight,
|
|
6593
6589
|
...restProps
|
|
6594
|
-
} = props, rootRef = react.useRef(null), treeitemRef = react.useRef(null), tree = useTree(), { path, registerItem, setExpanded, setFocusedElement } = tree, _id = react.useId(), id = idProp || _id, itemPath = react.useMemo(() => path
|
|
6590
|
+
} = props, rootRef = react.useRef(null), treeitemRef = react.useRef(null), tree = useTree(), { path, registerItem, setExpanded, setFocusedElement } = tree, _id = react.useId(), id = idProp || _id, itemPath = react.useMemo(() => [...path, id || ""], [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = (itemState == null ? void 0 : itemState.expanded) === void 0 ? expandedProp : (itemState == null ? void 0 : itemState.expanded) || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = react.useMemo(
|
|
6595
6591
|
() => ({ ...tree, level: tree.level + 1, path: itemPath }),
|
|
6596
6592
|
[itemPath, tree]
|
|
6597
6593
|
), handleClick = react.useCallback(
|
|
6598
6594
|
(event) => {
|
|
6599
|
-
onClick
|
|
6595
|
+
onClick == null || onClick(event);
|
|
6600
6596
|
const target = event.target;
|
|
6601
6597
|
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
|
|
6602
6598
|
},
|
|
@@ -6614,23 +6610,26 @@ const TreeGroup = react.memo(function(props) {
|
|
|
6614
6610
|
if (rootRef.current)
|
|
6615
6611
|
return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
|
|
6616
6612
|
}, [expanded, itemPath, registerItem, selected]);
|
|
6617
|
-
const content =
|
|
6618
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6613
|
+
const content = react.useMemo(
|
|
6614
|
+
() => /* @__PURE__ */ jsxRuntime.jsxs(Flex, { padding, children: [
|
|
6615
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6616
|
+
Box,
|
|
6617
|
+
{
|
|
6618
|
+
marginRight: space,
|
|
6619
|
+
style: {
|
|
6620
|
+
visibility: IconComponent || children ? "visible" : "hidden",
|
|
6621
|
+
pointerEvents: "none"
|
|
6622
|
+
},
|
|
6623
|
+
children: [
|
|
6624
|
+
IconComponent && /* @__PURE__ */ jsxRuntime.jsx(Text, { muted, size: fontSize2, weight, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {}) }),
|
|
6625
|
+
!IconComponent && /* @__PURE__ */ jsxRuntime.jsx(ToggleArrowText, { muted, size: fontSize2, weight, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ToggleArrowRightIcon, { style: { transform: expanded ? "rotate(90deg)" : void 0 } }) })
|
|
6626
|
+
]
|
|
6627
|
+
}
|
|
6628
|
+
),
|
|
6629
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { muted, size: fontSize2, textOverflow: "ellipsis", weight, children: text }) })
|
|
6630
|
+
] }),
|
|
6631
|
+
[IconComponent, children, expanded, fontSize2, muted, padding, space, text, weight]
|
|
6632
|
+
);
|
|
6634
6633
|
return href ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6635
6634
|
Root,
|
|
6636
6635
|
{
|