@sanity/ui 2.9.0-canary.6 → 2.9.0
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/_chunks-cjs/getTheme_v2.js +26 -0
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +26 -0
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +26 -0
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/index.esm.js +652 -1048
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +651 -1047
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +652 -1048
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.mts +22 -28
- package/dist/theme.d.ts +22 -28
- package/dist/theme.esm.js +124 -260
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +124 -260
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +124 -260
- package/dist/theme.mjs.map +1 -1
- package/package.json +60 -53
- package/src/core/__workshop__/constants.ts +27 -31
- package/src/core/components/autocomplete/autocomplete.tsx +31 -42
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +47 -35
- package/src/core/components/dialog/dialog.tsx +1 -1
- package/src/core/components/menu/__workshop__/tones.tsx +5 -6
- package/src/core/components/menu/useMenuController.ts +21 -18
- package/src/core/components/toast/__workshop__/hook.tsx +1 -1
- package/src/core/components/toast/toast.tsx +2 -2
- package/src/core/components/tree/treeItem.tsx +15 -18
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +2 -2
- package/src/core/hooks/useMatchMedia.ts +22 -12
- package/src/core/primitives/badge/__workshop__/tones.tsx +6 -13
- package/src/core/primitives/button/__workshop__/custom.tsx +4 -3
- package/src/core/primitives/card/__workshop__/allTones.tsx +6 -8
- package/src/core/primitives/card/__workshop__/asButton.tsx +42 -24
- package/src/core/primitives/card/__workshop__/asComponent.tsx +1 -1
- package/src/core/primitives/card/__workshop__/checkered.tsx +17 -7
- package/src/core/primitives/card/__workshop__/interactive.tsx +10 -3
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +5 -3
- package/src/core/primitives/card/__workshop__/props.tsx +7 -5
- package/src/core/primitives/card/__workshop__/selected.tsx +4 -1
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +6 -0
- package/src/core/primitives/code/__workshop__/props.tsx +1 -1
- package/src/core/primitives/container/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/__workshop__/example.tsx +3 -3
- package/src/core/primitives/grid/__workshop__/responsive.tsx +12 -12
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +13 -25
- package/src/core/primitives/inline/__workshop__/plain.tsx +3 -3
- package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +6 -6
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +1 -1
- package/src/core/primitives/popover/popover.tsx +140 -74
- package/src/core/primitives/popover/popoverCard.tsx +4 -1
- package/src/core/primitives/radio/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/text/__workshop__/example.tsx +6 -6
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +11 -21
- package/src/core/primitives/textArea/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/index.ts +0 -5
- package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -2
- package/src/core/primitives/textInput/__workshop__/readOnly.tsx +6 -2
- package/src/core/primitives/textInput/__workshop__/tones.tsx +38 -0
- package/src/core/primitives/tooltip/tooltip.tsx +17 -47
- package/src/core/styles/card/_cardColorStyle.ts +8 -0
- package/src/core/theme/__workshop__/debug/story.tsx +18 -11
- package/src/core/utils/portal/portalProvider.tsx +5 -5
- package/src/theme/build/_deprecated/color/factory.ts +1 -1
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/build/buildColorTheme.ts +47 -37
- package/src/theme/build/renderColorTheme.ts +26 -30
- package/src/theme/build/resolveColorTokens.ts +51 -115
- package/src/theme/config/tokens/color/types.ts +4 -18
- package/src/theme/defaults/colorTokens.ts +8 -5
- package/src/theme/getScopedTheme.ts +9 -2
- package/src/theme/system/color/_constants.ts +6 -2
- package/src/theme/system/color/badge.ts +3 -7
- package/src/theme/system/v0/color/_system.ts +8 -4
- package/src/theme/system/v0/color/color.ts +3 -2
- package/src/theme/versioning/themeColor_v0_v2.ts +26 -0
- package/src/theme/versioning/v0_v2.ts +4 -0
- package/src/core/primitives/textInput/__workshop__/multipleTones.tsx +0 -20
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { buildTheme, createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, getTheme_v2, getScopedTheme } from "@sanity/ui/theme";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
|
-
import { useState, useRef, useEffect, useDebugValue, useImperativeHandle, useSyncExternalStore, createContext, useContext, forwardRef, useId, Children, isValidElement, cloneElement, Component, memo, useLayoutEffect, useReducer, Fragment as Fragment$1, startTransition } from "react";
|
|
4
|
+
import { useState, useRef, useEffect, useDebugValue, useImperativeHandle, useMemo, useSyncExternalStore, createContext, useContext, forwardRef, useId, Children, isValidElement, cloneElement, Component, memo, useCallback, useLayoutEffect, useReducer, Fragment as Fragment$1, startTransition } from "react";
|
|
5
5
|
import ReactIs, { isValidElementType } from "react-is";
|
|
6
6
|
import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css, styled, keyframes } from "styled-components";
|
|
7
7
|
import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon, ToggleArrowRightIcon } from "@sanity/icons";
|
|
@@ -156,7 +156,7 @@ function responsiveTextFont(props) {
|
|
|
156
156
|
function useArrayProp(val, defaultVal) {
|
|
157
157
|
const $ = c(3);
|
|
158
158
|
let t0;
|
|
159
|
-
$[0] !==
|
|
159
|
+
$[0] !== defaultVal || $[1] !== val ? (t0 = () => [_getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
|
|
160
160
|
const [t1, setCache] = useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
|
|
161
161
|
return hash !== cachedHash && setCache([_getArrayProp(val, defaultVal), hash]), cachedVal;
|
|
162
162
|
}
|
|
@@ -190,7 +190,7 @@ function useClickOutside(listener, t0, boundaryElement) {
|
|
|
190
190
|
}
|
|
191
191
|
}, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
|
|
192
192
|
let t4, t5;
|
|
193
|
-
return $[7] !==
|
|
193
|
+
return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
|
|
194
194
|
if (!listener)
|
|
195
195
|
return;
|
|
196
196
|
const handleWindowMouseDown = (evt) => {
|
|
@@ -205,12 +205,12 @@ function useClickOutside(listener, t0, boundaryElement) {
|
|
|
205
205
|
return window.addEventListener("mousedown", handleWindowMouseDown), () => {
|
|
206
206
|
window.removeEventListener("mousedown", handleWindowMouseDown);
|
|
207
207
|
};
|
|
208
|
-
}, t5 = [boundaryElement, listener, elements], $[7] =
|
|
208
|
+
}, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
|
|
209
209
|
}
|
|
210
210
|
function useClickOutsideEvent(listener, t0, boundaryElement) {
|
|
211
|
-
const $ = c(8), elementsArg = t0 === void 0 ? _temp$
|
|
211
|
+
const $ = c(8), elementsArg = t0 === void 0 ? _temp$b : t0;
|
|
212
212
|
let t1;
|
|
213
|
-
$[0] !==
|
|
213
|
+
$[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
|
|
214
214
|
if (!listener)
|
|
215
215
|
return;
|
|
216
216
|
const target = evt.target;
|
|
@@ -224,7 +224,7 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
|
|
|
224
224
|
if (el && (target === el || el.contains(target)))
|
|
225
225
|
return;
|
|
226
226
|
listener(evt);
|
|
227
|
-
}, $[0] =
|
|
227
|
+
}, $[0] = boundaryElement, $[1] = elementsArg, $[2] = listener, $[3] = t1) : t1 = $[3];
|
|
228
228
|
const onEvent = useEffectEvent(t1), hasListener = !!listener;
|
|
229
229
|
let t2, t3;
|
|
230
230
|
$[4] !== hasListener || $[5] !== onEvent ? (t2 = () => {
|
|
@@ -236,15 +236,15 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
|
|
|
236
236
|
};
|
|
237
237
|
}, t3 = [hasListener, onEvent], $[4] = hasListener, $[5] = onEvent, $[6] = t2, $[7] = t3) : (t2 = $[6], t3 = $[7]), useEffect(t2, t3), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
|
|
238
238
|
}
|
|
239
|
-
function _temp$
|
|
239
|
+
function _temp$b() {
|
|
240
240
|
return EMPTY_ARRAY;
|
|
241
241
|
}
|
|
242
242
|
function useCustomValidity(ref, customValidity) {
|
|
243
243
|
const $ = c(6);
|
|
244
244
|
let t0;
|
|
245
|
-
$[0] !==
|
|
245
|
+
$[0] !== customValidity || $[1] !== ref.current ? (t0 = () => {
|
|
246
246
|
ref.current?.setCustomValidity(customValidity || "");
|
|
247
|
-
}, $[0] =
|
|
247
|
+
}, $[0] = customValidity, $[1] = ref.current, $[2] = t0) : t0 = $[2];
|
|
248
248
|
let t1;
|
|
249
249
|
$[3] !== customValidity || $[4] !== ref ? (t1 = [customValidity, ref], $[3] = customValidity, $[4] = ref, $[5] = t1) : t1 = $[5], useEffect(t0, t1);
|
|
250
250
|
}
|
|
@@ -593,19 +593,20 @@ function useGlobalKeyDown(onKeyDown) {
|
|
|
593
593
|
return $[0] !== onKeyDown ? (t0 = () => (addEventListener("keydown", onKeyDown), () => removeEventListener("keydown", onKeyDown)), t1 = [onKeyDown], $[0] = onKeyDown, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), useEffect(t0, t1);
|
|
594
594
|
}
|
|
595
595
|
function useMatchMedia(mediaQueryString, getServerSnapshot2) {
|
|
596
|
-
const $ = c(4);
|
|
597
|
-
let t0, t1;
|
|
598
|
-
$[0] !== mediaQueryString ? (t1 = typeof window > "u" ? null : window.matchMedia(mediaQueryString), $[0] = mediaQueryString, $[1] = t1) : t1 = $[1], t0 = t1;
|
|
599
|
-
const cachedMatchMedia = t0;
|
|
600
|
-
let t2, t3;
|
|
601
|
-
$[2] !== cachedMatchMedia ? (t3 = {
|
|
602
|
-
subscribe: (onStoreChange) => (cachedMatchMedia.addEventListener("change", onStoreChange), () => cachedMatchMedia.removeEventListener("change", onStoreChange)),
|
|
603
|
-
getSnapshot: () => cachedMatchMedia.matches
|
|
604
|
-
}, $[2] = cachedMatchMedia, $[3] = t3) : t3 = $[3], t2 = t3;
|
|
605
596
|
const {
|
|
606
597
|
subscribe: subscribe2,
|
|
607
598
|
getSnapshot
|
|
608
|
-
} =
|
|
599
|
+
} = useMemo(() => {
|
|
600
|
+
let MEDIA_QUERY_CACHE;
|
|
601
|
+
const getMatchMedia = () => (MEDIA_QUERY_CACHE || (MEDIA_QUERY_CACHE = window.matchMedia(mediaQueryString)), MEDIA_QUERY_CACHE);
|
|
602
|
+
return {
|
|
603
|
+
subscribe: (onStoreChange) => {
|
|
604
|
+
const matchMedia = getMatchMedia();
|
|
605
|
+
return matchMedia.addEventListener("change", onStoreChange), () => matchMedia.removeEventListener("change", onStoreChange);
|
|
606
|
+
},
|
|
607
|
+
getSnapshot: () => getMatchMedia().matches
|
|
608
|
+
};
|
|
609
|
+
}, [mediaQueryString]);
|
|
609
610
|
return useDebugValue(mediaQueryString), useSyncExternalStore(subscribe2, getSnapshot, getServerSnapshot2);
|
|
610
611
|
}
|
|
611
612
|
function getGlobalScope() {
|
|
@@ -655,9 +656,9 @@ function ThemeProvider(props) {
|
|
|
655
656
|
return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
|
|
656
657
|
}
|
|
657
658
|
let t2;
|
|
658
|
-
$[9] !==
|
|
659
|
+
$[9] !== children || $[10] !== theme ? (t2 = /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }), $[9] = children, $[10] = theme, $[11] = t2) : t2 = $[11];
|
|
659
660
|
let t3;
|
|
660
|
-
return $[12] !==
|
|
661
|
+
return $[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14], t3;
|
|
661
662
|
}
|
|
662
663
|
ThemeProvider.displayName = "ThemeProvider";
|
|
663
664
|
function useRootTheme() {
|
|
@@ -673,7 +674,7 @@ function ThemeColorProvider(props) {
|
|
|
673
674
|
tone
|
|
674
675
|
} = props, root = useRootTheme(), t0 = scheme || root.scheme;
|
|
675
676
|
let t1;
|
|
676
|
-
return $[0] !==
|
|
677
|
+
return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ jsx(ThemeProvider, { scheme: t0, theme: root.theme, tone, children }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
|
|
677
678
|
}
|
|
678
679
|
ThemeColorProvider.displayName = "ThemeColorProvider";
|
|
679
680
|
function useTheme() {
|
|
@@ -742,15 +743,15 @@ function useMediaIndex() {
|
|
|
742
743
|
return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
|
|
743
744
|
}
|
|
744
745
|
function usePrefersDark(t0) {
|
|
745
|
-
return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$
|
|
746
|
+
return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$a : t0);
|
|
746
747
|
}
|
|
747
|
-
function _temp$
|
|
748
|
+
function _temp$a() {
|
|
748
749
|
return !1;
|
|
749
750
|
}
|
|
750
751
|
function usePrefersReducedMotion(t0) {
|
|
751
|
-
return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$
|
|
752
|
+
return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$9 : t0);
|
|
752
753
|
}
|
|
753
|
-
function _temp$
|
|
754
|
+
function _temp$9() {
|
|
754
755
|
return !1;
|
|
755
756
|
}
|
|
756
757
|
function responsiveBorderStyle() {
|
|
@@ -1466,7 +1467,7 @@ const Root$C = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBa
|
|
|
1466
1467
|
overflow: clip;
|
|
1467
1468
|
`, Label = forwardRef(function(props, ref) {
|
|
1468
1469
|
const $ = c(22);
|
|
1469
|
-
let
|
|
1470
|
+
let accent, align, childrenProp, restProps, t0, t1, textOverflow, weight;
|
|
1470
1471
|
$[0] !== props ? ({
|
|
1471
1472
|
accent,
|
|
1472
1473
|
align,
|
|
@@ -1476,7 +1477,7 @@ const Root$C = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBa
|
|
|
1476
1477
|
textOverflow,
|
|
1477
1478
|
weight,
|
|
1478
1479
|
...restProps
|
|
1479
|
-
} = props, $[0] = props, $[1] =
|
|
1480
|
+
} = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = childrenProp, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = textOverflow, $[8] = weight) : (accent = $[1], align = $[2], childrenProp = $[3], restProps = $[4], t0 = $[5], t1 = $[6], textOverflow = $[7], weight = $[8]);
|
|
1480
1481
|
const muted = t0 === void 0 ? !1 : t0, size2 = t1 === void 0 ? 2 : t1;
|
|
1481
1482
|
let children = childrenProp;
|
|
1482
1483
|
if (textOverflow === "ellipsis") {
|
|
@@ -1488,7 +1489,7 @@ const Root$C = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBa
|
|
|
1488
1489
|
}
|
|
1489
1490
|
const t2 = useArrayProp(align), t3 = useArrayProp(size2);
|
|
1490
1491
|
let t4;
|
|
1491
|
-
return $[13] !==
|
|
1492
|
+
return $[13] !== accent || $[14] !== children || $[15] !== muted || $[16] !== ref || $[17] !== restProps || $[18] !== t2 || $[19] !== t3 || $[20] !== weight ? (t4 = /* @__PURE__ */ jsx(Root$C, { "data-ui": "Label", ...restProps, $accent: accent, $align: t2, $muted: muted, $size: t3, $weight: weight, ref, children }), $[13] = accent, $[14] = children, $[15] = muted, $[16] = ref, $[17] = restProps, $[18] = t2, $[19] = t3, $[20] = weight, $[21] = t4) : t4 = $[21], t4;
|
|
1492
1493
|
});
|
|
1493
1494
|
Label.displayName = "ForwardRef(Label)";
|
|
1494
1495
|
const avatarStyle = {
|
|
@@ -1637,8 +1638,8 @@ function avatarStrokeStyle() {
|
|
|
1637
1638
|
const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1 = styled.div(avatarStyle.arrow), BgStroke = styled.ellipse(avatarStyle.bgStroke), Stroke = styled.ellipse(avatarStyle.stroke), Initials = styled.div(avatarStyle.initials), InitialsLabel = styled(Label)({
|
|
1638
1639
|
color: "inherit"
|
|
1639
1640
|
}), Image = styled.svg(avatarStyle.image), Avatar = forwardRef(function(props, ref) {
|
|
1640
|
-
const $ = c(
|
|
1641
|
-
let
|
|
1641
|
+
const $ = c(52);
|
|
1642
|
+
let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
|
|
1642
1643
|
$[0] !== props ? ({
|
|
1643
1644
|
__unstable_hideInnerStroke,
|
|
1644
1645
|
as: asProp,
|
|
@@ -1652,7 +1653,7 @@ const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1
|
|
|
1652
1653
|
status: t1,
|
|
1653
1654
|
size: t2,
|
|
1654
1655
|
...restProps
|
|
1655
|
-
} = props, $[0] = props, $[1] =
|
|
1656
|
+
} = props, $[0] = props, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = asProp, $[5] = initials, $[6] = onImageLoadError, $[7] = restProps, $[8] = src, $[9] = t0, $[10] = t1, $[11] = t2, $[12] = title) : (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], asProp = $[4], initials = $[5], onImageLoadError = $[6], restProps = $[7], src = $[8], t0 = $[9], t1 = $[10], t2 = $[11], title = $[12]);
|
|
1656
1657
|
const color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, {
|
|
1657
1658
|
avatar
|
|
1658
1659
|
} = useTheme_v2(), as = ReactIs.isValidElementType(asProp) ? asProp : "div", size2 = useArrayProp(sizeProp), _sizeRem = (avatar.sizes[size2[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = useId(), [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = useState(!1), imageId = `avatar-image-${elementId}`;
|
|
@@ -1673,32 +1674,30 @@ const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1
|
|
|
1673
1674
|
}, $[20] = onImageLoadError, $[21] = t7) : t7 = $[21];
|
|
1674
1675
|
const handleImageError = t7;
|
|
1675
1676
|
let t8, t9;
|
|
1676
|
-
|
|
1677
|
-
let t102;
|
|
1678
|
-
$[24] === Symbol.for("react.memo_cache_sentinel") ? (t102 = (s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0, $[24] = t102) : t102 = $[24], t9 = size2.map(t102), $[22] = size2, $[23] = t9;
|
|
1679
|
-
} else
|
|
1680
|
-
t9 = $[23];
|
|
1681
|
-
t8 = t9;
|
|
1677
|
+
$[22] !== size2 ? (t9 = size2.map(_temp$8), $[22] = size2, $[23] = t9) : t9 = $[23], t8 = t9;
|
|
1682
1678
|
const initialsSize = t8, t10 = typeof as == "string" ? as : void 0;
|
|
1683
1679
|
let t11;
|
|
1684
|
-
$[
|
|
1680
|
+
$[24] !== color ? (t11 = /* @__PURE__ */ jsx(Arrow$1, { 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 }) }) }), $[24] = color, $[25] = t11) : t11 = $[25];
|
|
1685
1681
|
let t12;
|
|
1686
|
-
$[
|
|
1682
|
+
$[26] !== __unstable_hideInnerStroke || $[27] !== _radius || $[28] !== _sizeRem || $[29] !== handleImageError || $[30] !== imageFailed || $[31] !== imageId || $[32] !== src ? (t12 = !imageFailed && src && /* @__PURE__ */ jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
|
|
1687
1683
|
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsx("image", { href: src, width: "1", height: "1", onError: handleImageError }) }) }),
|
|
1688
1684
|
/* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
|
|
1689
1685
|
!__unstable_hideInnerStroke && /* @__PURE__ */ jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
|
|
1690
1686
|
/* @__PURE__ */ jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
|
|
1691
|
-
] }), $[
|
|
1687
|
+
] }), $[26] = __unstable_hideInnerStroke, $[27] = _radius, $[28] = _sizeRem, $[29] = handleImageError, $[30] = imageFailed, $[31] = imageId, $[32] = src, $[33] = t12) : t12 = $[33];
|
|
1692
1688
|
let t13;
|
|
1693
|
-
$[
|
|
1689
|
+
$[34] !== imageFailed || $[35] !== initials || $[36] !== initialsSize || $[37] !== src ? (t13 = (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Initials, { children: /* @__PURE__ */ jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) }), $[34] = imageFailed, $[35] = initials, $[36] = initialsSize, $[37] = src, $[38] = t13) : t13 = $[38];
|
|
1694
1690
|
let t14;
|
|
1695
|
-
return $[40] !== as || $[41] !==
|
|
1691
|
+
return $[39] !== arrowPosition || $[40] !== as || $[41] !== color || $[42] !== ref || $[43] !== restProps || $[44] !== size2 || $[45] !== status || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t13 || $[50] !== title ? (t14 = /* @__PURE__ */ jsxs(Root$B, { as, "data-as": t10, "data-ui": "Avatar", ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
|
|
1696
1692
|
t11,
|
|
1697
1693
|
t12,
|
|
1698
1694
|
t13
|
|
1699
|
-
] }), $[40] = as, $[41] =
|
|
1695
|
+
] }), $[39] = arrowPosition, $[40] = as, $[41] = color, $[42] = ref, $[43] = restProps, $[44] = size2, $[45] = status, $[46] = t10, $[47] = t11, $[48] = t12, $[49] = t13, $[50] = title, $[51] = t14) : t14 = $[51], t14;
|
|
1700
1696
|
});
|
|
1701
1697
|
Avatar.displayName = "ForwardRef(Avatar)";
|
|
1698
|
+
function _temp$8(s) {
|
|
1699
|
+
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
1700
|
+
}
|
|
1702
1701
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
1703
1702
|
const {
|
|
1704
1703
|
avatar,
|
|
@@ -1736,24 +1735,22 @@ function _avatarCounterBaseStyle(props) {
|
|
|
1736
1735
|
`;
|
|
1737
1736
|
}
|
|
1738
1737
|
const Root$A = styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = forwardRef(function(props, ref) {
|
|
1739
|
-
const $ = c(
|
|
1738
|
+
const $ = c(9), {
|
|
1740
1739
|
count,
|
|
1741
1740
|
size: t0
|
|
1742
1741
|
} = props, size2 = useArrayProp(t0 === void 0 ? 1 : t0);
|
|
1743
1742
|
let t1, t2;
|
|
1744
|
-
|
|
1745
|
-
let t32;
|
|
1746
|
-
$[2] === Symbol.for("react.memo_cache_sentinel") ? (t32 = (s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0, $[2] = t32) : t32 = $[2], t2 = size2.map(t32), $[0] = size2, $[1] = t2;
|
|
1747
|
-
} else
|
|
1748
|
-
t2 = $[1];
|
|
1749
|
-
t1 = t2;
|
|
1743
|
+
$[0] !== size2 ? (t2 = size2.map(_temp$7), $[0] = size2, $[1] = t2) : t2 = $[1], t1 = t2;
|
|
1750
1744
|
const fontSize2 = t1;
|
|
1751
1745
|
let t3;
|
|
1752
|
-
$[
|
|
1746
|
+
$[2] !== count || $[3] !== fontSize2 ? (t3 = /* @__PURE__ */ jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }), $[2] = count, $[3] = fontSize2, $[4] = t3) : t3 = $[4];
|
|
1753
1747
|
let t4;
|
|
1754
|
-
return $[
|
|
1748
|
+
return $[5] !== ref || $[6] !== size2 || $[7] !== t3 ? (t4 = /* @__PURE__ */ jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: t3 }), $[5] = ref, $[6] = size2, $[7] = t3, $[8] = t4) : t4 = $[8], t4;
|
|
1755
1749
|
});
|
|
1756
1750
|
AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
|
|
1751
|
+
function _temp$7(s) {
|
|
1752
|
+
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
1753
|
+
}
|
|
1757
1754
|
const BASE_STYLES = css`
|
|
1758
1755
|
white-space: nowrap;
|
|
1759
1756
|
|
|
@@ -1784,13 +1781,13 @@ function responsiveAvatarStackSizeStyle(props) {
|
|
|
1784
1781
|
}
|
|
1785
1782
|
const Root$z = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = forwardRef(function(props, ref) {
|
|
1786
1783
|
const $ = c(15);
|
|
1787
|
-
let
|
|
1784
|
+
let childrenProp, restProps, t0, t1;
|
|
1788
1785
|
$[0] !== props ? ({
|
|
1789
1786
|
children: childrenProp,
|
|
1790
1787
|
maxLength: t0,
|
|
1791
1788
|
size: t1,
|
|
1792
1789
|
...restProps
|
|
1793
|
-
} = props, $[0] = props, $[1] =
|
|
1790
|
+
} = props, $[0] = props, $[1] = childrenProp, $[2] = restProps, $[3] = t0, $[4] = t1) : (childrenProp = $[1], restProps = $[2], t0 = $[3], t1 = $[4]);
|
|
1794
1791
|
const maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1, children = Children.toArray(childrenProp).filter(isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children, T0 = Root$z, t2 = "AvatarStack", t3 = len === 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }) }), t4 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }) });
|
|
1795
1792
|
let t5;
|
|
1796
1793
|
$[5] !== size2 ? (t5 = (child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, {
|
|
@@ -1798,16 +1795,16 @@ const Root$z = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), Ava
|
|
|
1798
1795
|
}) }, String(childIndex)), $[5] = size2, $[6] = t5) : t5 = $[6];
|
|
1799
1796
|
const t6 = visibleChildren.map(t5);
|
|
1800
1797
|
let t7;
|
|
1801
|
-
return $[7] !== T0 || $[8] !==
|
|
1798
|
+
return $[7] !== T0 || $[8] !== ref || $[9] !== restProps || $[10] !== size2 || $[11] !== t3 || $[12] !== t4 || $[13] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T0, { "data-ui": t2, ...restProps, ref, $size: size2, children: [
|
|
1802
1799
|
t3,
|
|
1803
1800
|
t4,
|
|
1804
1801
|
t6
|
|
1805
|
-
] }), $[7] = T0, $[8] =
|
|
1802
|
+
] }), $[7] = T0, $[8] = ref, $[9] = restProps, $[10] = size2, $[11] = t3, $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14], t7;
|
|
1806
1803
|
});
|
|
1807
1804
|
AvatarStack.displayName = "ForwardRef(AvatarStack)";
|
|
1808
1805
|
const Root$y = styled.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle), Box = forwardRef(function(props, ref) {
|
|
1809
1806
|
const $ = c(59);
|
|
1810
|
-
let
|
|
1807
|
+
let column, columnEnd, columnStart, flex, height, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, overflow, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, restProps, row, rowEnd, rowStart, sizing, t0, t1, t2, t3;
|
|
1811
1808
|
$[0] !== props ? ({
|
|
1812
1809
|
as: t0,
|
|
1813
1810
|
column,
|
|
@@ -1836,10 +1833,10 @@ const Root$y = styled.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiv
|
|
|
1836
1833
|
rowEnd,
|
|
1837
1834
|
sizing,
|
|
1838
1835
|
...restProps
|
|
1839
|
-
} = props, $[0] = props, $[1] =
|
|
1836
|
+
} = props, $[0] = props, $[1] = column, $[2] = columnEnd, $[3] = columnStart, $[4] = flex, $[5] = height, $[6] = marginBottom, $[7] = marginLeft, $[8] = marginRight, $[9] = marginTop, $[10] = marginX, $[11] = marginY, $[12] = overflow, $[13] = paddingBottom, $[14] = paddingLeft, $[15] = paddingRight, $[16] = paddingTop, $[17] = paddingX, $[18] = paddingY, $[19] = restProps, $[20] = row, $[21] = rowEnd, $[22] = rowStart, $[23] = sizing, $[24] = t0, $[25] = t1, $[26] = t2, $[27] = t3) : (column = $[1], columnEnd = $[2], columnStart = $[3], flex = $[4], height = $[5], marginBottom = $[6], marginLeft = $[7], marginRight = $[8], marginTop = $[9], marginX = $[10], marginY = $[11], overflow = $[12], paddingBottom = $[13], paddingLeft = $[14], paddingRight = $[15], paddingTop = $[16], paddingX = $[17], paddingY = $[18], restProps = $[19], row = $[20], rowEnd = $[21], rowStart = $[22], sizing = $[23], t0 = $[24], t1 = $[25], t2 = $[26], t3 = $[27]);
|
|
1840
1837
|
const asProp = t0 === void 0 ? "div" : t0, display = t1 === void 0 ? "block" : t1, margin = t2 === void 0 ? 0 : t2, padding = t3 === void 0 ? 0 : t3, t4 = typeof asProp == "string" ? asProp : void 0, t5 = useArrayProp(column), t6 = useArrayProp(columnStart), t7 = useArrayProp(columnEnd), t8 = useArrayProp(display), t9 = useArrayProp(flex), t10 = useArrayProp(height), t11 = useArrayProp(margin), t12 = useArrayProp(marginX), t13 = useArrayProp(marginY), t14 = useArrayProp(marginTop), t15 = useArrayProp(marginRight), t16 = useArrayProp(marginBottom), t17 = useArrayProp(marginLeft), t18 = useArrayProp(overflow), t19 = useArrayProp(padding), t20 = useArrayProp(paddingX), t21 = useArrayProp(paddingY), t22 = useArrayProp(paddingTop), t23 = useArrayProp(paddingRight), t24 = useArrayProp(paddingBottom), t25 = useArrayProp(paddingLeft), t26 = useArrayProp(row), t27 = useArrayProp(rowStart), t28 = useArrayProp(rowEnd), t29 = useArrayProp(sizing);
|
|
1841
1838
|
let t30;
|
|
1842
|
-
return $[28] !==
|
|
1839
|
+
return $[28] !== asProp || $[29] !== props.children || $[30] !== ref || $[31] !== restProps || $[32] !== t10 || $[33] !== t11 || $[34] !== t12 || $[35] !== t13 || $[36] !== t14 || $[37] !== t15 || $[38] !== t16 || $[39] !== t17 || $[40] !== t18 || $[41] !== t19 || $[42] !== t20 || $[43] !== t21 || $[44] !== t22 || $[45] !== t23 || $[46] !== t24 || $[47] !== t25 || $[48] !== t26 || $[49] !== t27 || $[50] !== t28 || $[51] !== t29 || $[52] !== t4 || $[53] !== t5 || $[54] !== t6 || $[55] !== t7 || $[56] !== t8 || $[57] !== t9 ? (t30 = /* @__PURE__ */ jsx(Root$y, { "data-as": t4, "data-ui": "Box", ...restProps, $column: t5, $columnStart: t6, $columnEnd: t7, $display: t8, $flex: t9, $height: t10, $margin: t11, $marginX: t12, $marginY: t13, $marginTop: t14, $marginRight: t15, $marginBottom: t16, $marginLeft: t17, $overflow: t18, $padding: t19, $paddingX: t20, $paddingY: t21, $paddingTop: t22, $paddingRight: t23, $paddingBottom: t24, $paddingLeft: t25, $row: t26, $rowStart: t27, $rowEnd: t28, $sizing: t29, as: asProp, ref, children: props.children }), $[28] = asProp, $[29] = props.children, $[30] = ref, $[31] = restProps, $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13, $[36] = t14, $[37] = t15, $[38] = t16, $[39] = t17, $[40] = t18, $[41] = t19, $[42] = t20, $[43] = t21, $[44] = t22, $[45] = t23, $[46] = t24, $[47] = t25, $[48] = t26, $[49] = t27, $[50] = t28, $[51] = t29, $[52] = t4, $[53] = t5, $[54] = t6, $[55] = t7, $[56] = t8, $[57] = t9, $[58] = t30) : t30 = $[58], t30;
|
|
1843
1840
|
});
|
|
1844
1841
|
Box.displayName = "ForwardRef(Box)";
|
|
1845
1842
|
function textBaseStyle(props) {
|
|
@@ -1918,7 +1915,7 @@ const Root$x = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBase
|
|
|
1918
1915
|
overflow: clip;
|
|
1919
1916
|
`, Text = forwardRef(function(props, ref) {
|
|
1920
1917
|
const $ = c(22);
|
|
1921
|
-
let
|
|
1918
|
+
let align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
|
|
1922
1919
|
$[0] !== props ? ({
|
|
1923
1920
|
accent: t0,
|
|
1924
1921
|
align,
|
|
@@ -1928,7 +1925,7 @@ const Root$x = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBase
|
|
|
1928
1925
|
textOverflow,
|
|
1929
1926
|
weight,
|
|
1930
1927
|
...restProps
|
|
1931
|
-
} = props, $[0] = props, $[1] =
|
|
1928
|
+
} = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight) : (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]);
|
|
1932
1929
|
const accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 2 : t2;
|
|
1933
1930
|
let children = childrenProp;
|
|
1934
1931
|
if (textOverflow === "ellipsis") {
|
|
@@ -1939,7 +1936,7 @@ const Root$x = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBase
|
|
|
1939
1936
|
let t5;
|
|
1940
1937
|
$[11] !== children ? (t5 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t5) : t5 = $[12];
|
|
1941
1938
|
let t6;
|
|
1942
|
-
return $[13] !==
|
|
1939
|
+
return $[13] !== accent || $[14] !== muted || $[15] !== ref || $[16] !== restProps || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== weight ? (t6 = /* @__PURE__ */ jsx(Root$x, { "data-ui": "Text", ...restProps, $accent: accent, $align: t3, $muted: muted, ref, $size: t4, $weight: weight, children: t5 }), $[13] = accent, $[14] = muted, $[15] = ref, $[16] = restProps, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = weight, $[21] = t6) : t6 = $[21], t6;
|
|
1943
1940
|
});
|
|
1944
1941
|
Text.displayName = "ForwardRef(Text)";
|
|
1945
1942
|
function badgeStyle(props) {
|
|
@@ -1959,7 +1956,7 @@ function badgeStyle(props) {
|
|
|
1959
1956
|
}
|
|
1960
1957
|
const Root$w = styled(Box)(responsiveRadiusStyle, badgeStyle), Badge = forwardRef(function(props, ref) {
|
|
1961
1958
|
const $ = c(17);
|
|
1962
|
-
let t0, t1, t2, t3
|
|
1959
|
+
let children, restProps, t0, t1, t2, t3;
|
|
1963
1960
|
if ($[0] !== props) {
|
|
1964
1961
|
const {
|
|
1965
1962
|
children: t42,
|
|
@@ -1970,19 +1967,19 @@ const Root$w = styled(Box)(responsiveRadiusStyle, badgeStyle), Badge = forwardRe
|
|
|
1970
1967
|
tone: t8,
|
|
1971
1968
|
...t9
|
|
1972
1969
|
} = props;
|
|
1973
|
-
children = t42, t0 = t52, t1 = t62, t2 = t72, t3 = t8, restProps = t9, $[0] = props, $[1] =
|
|
1970
|
+
children = t42, t0 = t52, t1 = t62, t2 = t72, t3 = t8, restProps = t9, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2, $[6] = t3;
|
|
1974
1971
|
} else
|
|
1975
|
-
|
|
1972
|
+
children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5], t3 = $[6];
|
|
1976
1973
|
const fontSize2 = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? "full" : t2, tone = t3 === void 0 ? "default" : t3, t4 = useArrayProp(radius), t5 = useArrayProp(padding);
|
|
1977
1974
|
let t6;
|
|
1978
|
-
$[7] !==
|
|
1975
|
+
$[7] !== children || $[8] !== fontSize2 ? (t6 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children }), $[7] = children, $[8] = fontSize2, $[9] = t6) : t6 = $[9];
|
|
1979
1976
|
let t7;
|
|
1980
|
-
return $[10] !==
|
|
1977
|
+
return $[10] !== ref || $[11] !== restProps || $[12] !== t4 || $[13] !== t5 || $[14] !== t6 || $[15] !== tone ? (t7 = /* @__PURE__ */ jsx(Root$w, { "data-ui": "Badge", ...restProps, $tone: tone, $radius: t4, padding: t5, ref, children: t6 }), $[10] = ref, $[11] = restProps, $[12] = t4, $[13] = t5, $[14] = t6, $[15] = tone, $[16] = t7) : t7 = $[16], t7;
|
|
1981
1978
|
});
|
|
1982
1979
|
Badge.displayName = "ForwardRef(Badge)";
|
|
1983
1980
|
const Root$v = styled(Box)(flexItemStyle, responsiveFlexStyle), Flex = forwardRef(function(props, ref) {
|
|
1984
1981
|
const $ = c(17);
|
|
1985
|
-
let
|
|
1982
|
+
let align, as, gap, justify, restProps, t0, wrap;
|
|
1986
1983
|
$[0] !== props ? ({
|
|
1987
1984
|
align,
|
|
1988
1985
|
as,
|
|
@@ -1991,10 +1988,10 @@ const Root$v = styled(Box)(flexItemStyle, responsiveFlexStyle), Flex = forwardRe
|
|
|
1991
1988
|
justify,
|
|
1992
1989
|
wrap,
|
|
1993
1990
|
...restProps
|
|
1994
|
-
} = props, $[0] = props, $[1] =
|
|
1991
|
+
} = props, $[0] = props, $[1] = align, $[2] = as, $[3] = gap, $[4] = justify, $[5] = restProps, $[6] = t0, $[7] = wrap) : (align = $[1], as = $[2], gap = $[3], justify = $[4], restProps = $[5], t0 = $[6], wrap = $[7]);
|
|
1995
1992
|
const direction = t0 === void 0 ? "row" : t0, t1 = useArrayProp(align), t2 = useArrayProp(direction), t3 = useArrayProp(gap), t4 = useArrayProp(justify), t5 = useArrayProp(wrap);
|
|
1996
1993
|
let t6;
|
|
1997
|
-
return $[8] !==
|
|
1994
|
+
return $[8] !== as || $[9] !== ref || $[10] !== restProps || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Root$v, { "data-ui": "Flex", ...restProps, $align: t1, $direction: t2, $gap: t3, $justify: t4, $wrap: t5, forwardedAs: as, ref }), $[8] = as, $[9] = ref, $[10] = restProps, $[11] = t1, $[12] = t2, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
|
|
1998
1995
|
});
|
|
1999
1996
|
Flex.displayName = "ForwardRef(Flex)";
|
|
2000
1997
|
const rotate$1 = keyframes`
|
|
@@ -2053,10 +2050,18 @@ function _cardColorStyle(base, color, checkered = !1) {
|
|
|
2053
2050
|
"--card-badge-default-dot-color": color.badge.default.dot,
|
|
2054
2051
|
"--card-badge-default-fg-color": color.badge.default.fg,
|
|
2055
2052
|
"--card-badge-default-icon-color": color.badge.default.icon,
|
|
2053
|
+
"--card-badge-neutral-bg-color": color.badge.neutral.bg,
|
|
2054
|
+
"--card-badge-neutral-dot-color": color.badge.neutral.dot,
|
|
2055
|
+
"--card-badge-neutral-fg-color": color.badge.neutral.fg,
|
|
2056
|
+
"--card-badge-neutral-icon-color": color.badge.neutral.icon,
|
|
2056
2057
|
"--card-badge-primary-bg-color": color.badge.primary.bg,
|
|
2057
2058
|
"--card-badge-primary-dot-color": color.badge.primary.dot,
|
|
2058
2059
|
"--card-badge-primary-fg-color": color.badge.primary.fg,
|
|
2059
2060
|
"--card-badge-primary-icon-color": color.badge.primary.icon,
|
|
2061
|
+
"--card-badge-suggest-bg-color": color.badge.suggest.bg,
|
|
2062
|
+
"--card-badge-suggest-dot-color": color.badge.suggest.dot,
|
|
2063
|
+
"--card-badge-suggest-fg-color": color.badge.suggest.fg,
|
|
2064
|
+
"--card-badge-suggest-icon-color": color.badge.suggest.icon,
|
|
2060
2065
|
"--card-badge-positive-bg-color": color.badge.positive.bg,
|
|
2061
2066
|
"--card-badge-positive-dot-color": color.badge.positive.dot,
|
|
2062
2067
|
"--card-badge-positive-fg-color": color.badge.positive.fg,
|
|
@@ -2192,7 +2197,7 @@ const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColo
|
|
|
2192
2197
|
box-shadow: inherit;
|
|
2193
2198
|
`, Button = forwardRef(function(props, ref) {
|
|
2194
2199
|
const $ = c(64);
|
|
2195
|
-
let
|
|
2200
|
+
let IconComponent, IconRightComponent, children, disabled, loading, paddingBottomProp, paddingLeftProp, paddingRightProp, paddingTopProp, paddingXProp, paddingYProp, restProps, selected, t0, t1, t2, t3, t4, t5, t6, t7, t8, text, textAlign, width;
|
|
2196
2201
|
$[0] !== props ? ({
|
|
2197
2202
|
children,
|
|
2198
2203
|
disabled,
|
|
@@ -2219,12 +2224,12 @@ const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColo
|
|
|
2219
2224
|
muted: t8,
|
|
2220
2225
|
width,
|
|
2221
2226
|
...restProps
|
|
2222
|
-
} = props, $[0] = props, $[1] =
|
|
2227
|
+
} = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = loading, $[6] = paddingBottomProp, $[7] = paddingLeftProp, $[8] = paddingRightProp, $[9] = paddingTopProp, $[10] = paddingXProp, $[11] = paddingYProp, $[12] = restProps, $[13] = selected, $[14] = t0, $[15] = t1, $[16] = t2, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = t6, $[21] = t7, $[22] = t8, $[23] = text, $[24] = textAlign, $[25] = width) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], loading = $[5], paddingBottomProp = $[6], paddingLeftProp = $[7], paddingRightProp = $[8], paddingTopProp = $[9], paddingXProp = $[10], paddingYProp = $[11], restProps = $[12], selected = $[13], t0 = $[14], t1 = $[15], t2 = $[16], t3 = $[17], t4 = $[18], t5 = $[19], t6 = $[20], t7 = $[21], t8 = $[22], text = $[23], textAlign = $[24], width = $[25]);
|
|
2223
2228
|
const fontSize2 = t0 === void 0 ? 1 : t0, justifyProp = t1 === void 0 ? "center" : t1, mode = t2 === void 0 ? "default" : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, tone = t6 === void 0 ? "default" : t6, type = t7 === void 0 ? "button" : t7, muted = t8 === void 0 ? !1 : t8, {
|
|
2224
2229
|
button
|
|
2225
2230
|
} = useTheme_v2(), justify = useArrayProp(justifyProp), padding = useArrayProp(paddingProp), paddingX = useArrayProp(paddingXProp), paddingY = useArrayProp(paddingYProp), paddingTop = useArrayProp(paddingTopProp), paddingBottom = useArrayProp(paddingBottomProp), paddingLeft = useArrayProp(paddingLeftProp), paddingRight = useArrayProp(paddingRightProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp);
|
|
2226
2231
|
let t9, t10;
|
|
2227
|
-
$[26] !== padding || $[27] !==
|
|
2232
|
+
$[26] !== padding || $[27] !== paddingBottom || $[28] !== paddingLeft || $[29] !== paddingRight || $[30] !== paddingTop || $[31] !== paddingX || $[32] !== paddingY ? (t10 = {
|
|
2228
2233
|
padding,
|
|
2229
2234
|
paddingX,
|
|
2230
2235
|
paddingY,
|
|
@@ -2232,12 +2237,12 @@ const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColo
|
|
|
2232
2237
|
paddingBottom,
|
|
2233
2238
|
paddingLeft,
|
|
2234
2239
|
paddingRight
|
|
2235
|
-
}, $[26] = padding, $[27] =
|
|
2240
|
+
}, $[26] = padding, $[27] = paddingBottom, $[28] = paddingLeft, $[29] = paddingRight, $[30] = paddingTop, $[31] = paddingX, $[32] = paddingY, $[33] = t10) : t10 = $[33], t9 = t10;
|
|
2236
2241
|
const boxProps = t9, t11 = !!(loading || disabled), t12 = selected ? "" : void 0, t13 = !!(loading || disabled);
|
|
2237
2242
|
let t14;
|
|
2238
2243
|
$[34] !== loading ? (t14 = !!loading && /* @__PURE__ */ jsx(LoadingBox, { children: /* @__PURE__ */ jsx(Spinner, {}) }), $[34] = loading, $[35] = t14) : t14 = $[35];
|
|
2239
2244
|
let t15;
|
|
2240
|
-
$[36] !== IconComponent || $[37] !==
|
|
2245
|
+
$[36] !== IconComponent || $[37] !== IconRightComponent || $[38] !== boxProps || $[39] !== button || $[40] !== fontSize2 || $[41] !== justify || $[42] !== muted || $[43] !== space || $[44] !== text || $[45] !== textAlign ? (t15 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children: /* @__PURE__ */ jsxs(Flex, { as: "span", justify, gap: space, children: [
|
|
2241
2246
|
IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
|
|
2242
2247
|
isValidElement(IconComponent) && IconComponent,
|
|
2243
2248
|
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
@@ -2247,15 +2252,15 @@ const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColo
|
|
|
2247
2252
|
isValidElement(IconRightComponent) && IconRightComponent,
|
|
2248
2253
|
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
2249
2254
|
] })
|
|
2250
|
-
] }) }), $[36] = IconComponent, $[37] =
|
|
2255
|
+
] }) }), $[36] = IconComponent, $[37] = IconRightComponent, $[38] = boxProps, $[39] = button, $[40] = fontSize2, $[41] = justify, $[42] = muted, $[43] = space, $[44] = text, $[45] = textAlign, $[46] = t15) : t15 = $[46];
|
|
2251
2256
|
let t16;
|
|
2252
|
-
$[47] !==
|
|
2257
|
+
$[47] !== boxProps || $[48] !== children ? (t16 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children }), $[47] = boxProps, $[48] = children, $[49] = t16) : t16 = $[49];
|
|
2253
2258
|
let t17;
|
|
2254
|
-
return $[50] !==
|
|
2259
|
+
return $[50] !== mode || $[51] !== radius || $[52] !== ref || $[53] !== restProps || $[54] !== t11 || $[55] !== t12 || $[56] !== t13 || $[57] !== t14 || $[58] !== t15 || $[59] !== t16 || $[60] !== tone || $[61] !== type || $[62] !== width ? (t17 = /* @__PURE__ */ jsxs(Root$t, { "data-ui": "Button", ...restProps, $mode: mode, $radius: radius, $tone: tone, "data-disabled": t11, "data-selected": t12, disabled: t13, ref, type, $width: width, children: [
|
|
2255
2260
|
t14,
|
|
2256
2261
|
t15,
|
|
2257
2262
|
t16
|
|
2258
|
-
] }), $[50] =
|
|
2263
|
+
] }), $[50] = mode, $[51] = radius, $[52] = ref, $[53] = restProps, $[54] = t11, $[55] = t12, $[56] = t13, $[57] = t14, $[58] = t15, $[59] = t16, $[60] = tone, $[61] = type, $[62] = width, $[63] = t17) : t17 = $[63], t17;
|
|
2259
2264
|
});
|
|
2260
2265
|
Button.displayName = "ForwardRef(Button)";
|
|
2261
2266
|
function cardStyle(props) {
|
|
@@ -2408,7 +2413,7 @@ function cardColorStyle(props) {
|
|
|
2408
2413
|
}
|
|
2409
2414
|
const Root$s = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), Card = forwardRef(function(props, ref) {
|
|
2410
2415
|
const $ = c(42);
|
|
2411
|
-
let
|
|
2416
|
+
let asProp, border2, borderBottom2, borderLeft2, borderRight2, borderTop2, muted, pressed, restProps, scheme, selected, shadow, t0, t1, t2, t3;
|
|
2412
2417
|
$[0] !== props ? ({
|
|
2413
2418
|
__unstable_checkered: t0,
|
|
2414
2419
|
__unstable_focusRing: t1,
|
|
@@ -2426,12 +2431,12 @@ const Root$s = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, respons
|
|
|
2426
2431
|
shadow,
|
|
2427
2432
|
tone: t3,
|
|
2428
2433
|
...restProps
|
|
2429
|
-
} = props, $[0] = props, $[1] =
|
|
2434
|
+
} = props, $[0] = props, $[1] = asProp, $[2] = border2, $[3] = borderBottom2, $[4] = borderLeft2, $[5] = borderRight2, $[6] = borderTop2, $[7] = muted, $[8] = pressed, $[9] = restProps, $[10] = scheme, $[11] = selected, $[12] = shadow, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3) : (asProp = $[1], border2 = $[2], borderBottom2 = $[3], borderLeft2 = $[4], borderRight2 = $[5], borderTop2 = $[6], muted = $[7], pressed = $[8], restProps = $[9], scheme = $[10], selected = $[11], shadow = $[12], t0 = $[13], t1 = $[14], t2 = $[15], t3 = $[16]);
|
|
2430
2435
|
const checkered = t0 === void 0 ? !1 : t0, focusRing = t1 === void 0 ? !1 : t1, radius = t2 === void 0 ? 0 : t2, toneProp = t3 === void 0 ? "default" : t3, as = isValidElementType(asProp) ? asProp : "div", rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp, t4 = typeof as == "string" ? as : void 0, t5 = rootTheme.scheme, t6 = useArrayProp(border2), t7 = useArrayProp(borderTop2), t8 = useArrayProp(borderRight2), t9 = useArrayProp(borderBottom2), t10 = useArrayProp(borderLeft2), t11 = useArrayProp(radius), t12 = useArrayProp(shadow), t13 = checkered ? "" : void 0, t14 = pressed ? "" : void 0, t15 = selected ? "" : void 0;
|
|
2431
2436
|
let t16;
|
|
2432
|
-
$[17] !==
|
|
2437
|
+
$[17] !== as || $[18] !== checkered || $[19] !== focusRing || $[20] !== muted || $[21] !== ref || $[22] !== restProps || $[23] !== rootTheme.scheme || $[24] !== selected || $[25] !== t10 || $[26] !== t11 || $[27] !== t12 || $[28] !== t13 || $[29] !== t14 || $[30] !== t15 || $[31] !== t4 || $[32] !== t6 || $[33] !== t7 || $[34] !== t8 || $[35] !== t9 || $[36] !== tone ? (t16 = /* @__PURE__ */ jsx(Root$s, { "data-as": t4, "data-scheme": t5, "data-ui": "Card", "data-tone": tone, ...restProps, $border: t6, $borderTop: t7, $borderRight: t8, $borderBottom: t9, $borderLeft: t10, $checkered: checkered, $focusRing: focusRing, $muted: muted, $radius: t11, $shadow: t12, $tone: tone, "data-checkered": t13, "data-pressed": t14, "data-selected": t15, forwardedAs: as, ref, selected }), $[17] = as, $[18] = checkered, $[19] = focusRing, $[20] = muted, $[21] = ref, $[22] = restProps, $[23] = rootTheme.scheme, $[24] = selected, $[25] = t10, $[26] = t11, $[27] = t12, $[28] = t13, $[29] = t14, $[30] = t15, $[31] = t4, $[32] = t6, $[33] = t7, $[34] = t8, $[35] = t9, $[36] = tone, $[37] = t16) : t16 = $[37];
|
|
2433
2438
|
let t17;
|
|
2434
|
-
return $[38] !== scheme || $[39] !==
|
|
2439
|
+
return $[38] !== scheme || $[39] !== t16 || $[40] !== tone ? (t17 = /* @__PURE__ */ jsx(ThemeColorProvider, { scheme, tone, children: t16 }), $[38] = scheme, $[39] = t16, $[40] = tone, $[41] = t17) : t17 = $[41], t17;
|
|
2435
2440
|
});
|
|
2436
2441
|
Card.displayName = "ForwardRef(Card)";
|
|
2437
2442
|
function checkboxBaseStyles() {
|
|
@@ -2574,7 +2579,7 @@ function inputElementStyles(props) {
|
|
|
2574
2579
|
}
|
|
2575
2580
|
const Root$r = styled.div(checkboxBaseStyles), Input$5 = styled.input(inputElementStyles), Checkbox = forwardRef(function(props, forwardedRef) {
|
|
2576
2581
|
const $ = c(25);
|
|
2577
|
-
let
|
|
2582
|
+
let checked, className, customValidity, disabled, indeterminate, readOnly, restProps, style;
|
|
2578
2583
|
$[0] !== props ? ({
|
|
2579
2584
|
checked,
|
|
2580
2585
|
className,
|
|
@@ -2584,7 +2589,7 @@ const Root$r = styled.div(checkboxBaseStyles), Input$5 = styled.input(inputEleme
|
|
|
2584
2589
|
readOnly,
|
|
2585
2590
|
style,
|
|
2586
2591
|
...restProps
|
|
2587
|
-
} = props, $[0] = props, $[1] =
|
|
2592
|
+
} = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = customValidity, $[4] = disabled, $[5] = indeterminate, $[6] = readOnly, $[7] = restProps, $[8] = style) : (checked = $[1], className = $[2], customValidity = $[3], disabled = $[4], indeterminate = $[5], readOnly = $[6], restProps = $[7], style = $[8]);
|
|
2588
2593
|
const ref = useRef(null);
|
|
2589
2594
|
let t0;
|
|
2590
2595
|
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[9] = t0) : t0 = $[9], useImperativeHandle(forwardedRef, t0);
|
|
@@ -2594,7 +2599,7 @@ const Root$r = styled.div(checkboxBaseStyles), Input$5 = styled.input(inputEleme
|
|
|
2594
2599
|
}, t2 = [indeterminate], $[10] = indeterminate, $[11] = t1, $[12] = t2) : (t1 = $[11], t2 = $[12]), useEffect(t1, t2), useCustomValidity(ref, customValidity);
|
|
2595
2600
|
const t3 = !disabled && readOnly ? "" : void 0, t4 = customValidity ? "" : void 0, t5 = disabled || readOnly;
|
|
2596
2601
|
let t6;
|
|
2597
|
-
$[13] !==
|
|
2602
|
+
$[13] !== checked || $[14] !== readOnly || $[15] !== restProps || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 ? (t6 = /* @__PURE__ */ jsx(Input$5, { "data-read-only": t3, "data-error": t4, ...restProps, checked, disabled: t5, type: "checkbox", readOnly, ref }), $[13] = checked, $[14] = readOnly, $[15] = restProps, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6) : t6 = $[19];
|
|
2598
2603
|
let t7;
|
|
2599
2604
|
$[20] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsxs("span", { children: [
|
|
2600
2605
|
/* @__PURE__ */ jsx(CheckmarkIcon, {}),
|
|
@@ -2757,27 +2762,27 @@ function codeBaseStyle() {
|
|
|
2757
2762
|
}
|
|
2758
2763
|
const Root$q = styled.pre(codeBaseStyle, responsiveCodeFontStyle), Code = forwardRef(function(props, ref) {
|
|
2759
2764
|
const $ = c(23);
|
|
2760
|
-
let
|
|
2765
|
+
let children, languageProp, restProps, t0, weight;
|
|
2761
2766
|
$[0] !== props ? ({
|
|
2762
2767
|
children,
|
|
2763
2768
|
language: languageProp,
|
|
2764
2769
|
size: t0,
|
|
2765
2770
|
weight,
|
|
2766
2771
|
...restProps
|
|
2767
|
-
} = props, $[0] = props, $[1] =
|
|
2772
|
+
} = props, $[0] = props, $[1] = children, $[2] = languageProp, $[3] = restProps, $[4] = t0, $[5] = weight) : (children = $[1], languageProp = $[2], restProps = $[3], t0 = $[4], weight = $[5]);
|
|
2768
2773
|
const size2 = t0 === void 0 ? 2 : t0, language = typeof languageProp == "string" ? languageProp : void 0;
|
|
2769
2774
|
let t1;
|
|
2770
2775
|
$[6] !== language ? (t1 = language ? Refractor.hasLanguage(language) : !1, $[6] = language, $[7] = t1) : t1 = $[7];
|
|
2771
2776
|
const registered = t1, t2 = useArrayProp(size2);
|
|
2772
2777
|
let t3;
|
|
2773
|
-
$[8] !==
|
|
2778
|
+
$[8] !== children || $[9] !== language || $[10] !== registered ? (t3 = !(language && registered) && /* @__PURE__ */ jsx("code", { children }), $[8] = children, $[9] = language, $[10] = registered, $[11] = t3) : t3 = $[11];
|
|
2774
2779
|
let t4;
|
|
2775
|
-
$[12] !==
|
|
2780
|
+
$[12] !== children || $[13] !== language || $[14] !== registered ? (t4 = language && registered && /* @__PURE__ */ jsx(Refractor, { inline: !0, language, value: String(children) }), $[12] = children, $[13] = language, $[14] = registered, $[15] = t4) : t4 = $[15];
|
|
2776
2781
|
let t5;
|
|
2777
|
-
return $[16] !==
|
|
2782
|
+
return $[16] !== ref || $[17] !== restProps || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== weight ? (t5 = /* @__PURE__ */ jsxs(Root$q, { "data-ui": "Code", ...restProps, $size: t2, $weight: weight, ref, children: [
|
|
2778
2783
|
t3,
|
|
2779
2784
|
t4
|
|
2780
|
-
] }), $[16] =
|
|
2785
|
+
] }), $[16] = ref, $[17] = restProps, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = weight, $[22] = t5) : t5 = $[22], t5;
|
|
2781
2786
|
});
|
|
2782
2787
|
Code.displayName = "ForwardRef(Code)";
|
|
2783
2788
|
const BASE_STYLE$1 = {
|
|
@@ -2798,20 +2803,20 @@ function responsiveContainerWidthStyle(props) {
|
|
|
2798
2803
|
}
|
|
2799
2804
|
const Root$p = styled(Box)(containerBaseStyle, responsiveContainerWidthStyle), Container = forwardRef(function(props, ref) {
|
|
2800
2805
|
const $ = c(9);
|
|
2801
|
-
let
|
|
2806
|
+
let as, restProps, t0;
|
|
2802
2807
|
$[0] !== props ? ({
|
|
2803
2808
|
as,
|
|
2804
2809
|
width: t0,
|
|
2805
2810
|
...restProps
|
|
2806
|
-
} = props, $[0] = props, $[1] =
|
|
2811
|
+
} = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = t0) : (as = $[1], restProps = $[2], t0 = $[3]);
|
|
2807
2812
|
const t1 = useArrayProp(t0 === void 0 ? 2 : t0);
|
|
2808
2813
|
let t2;
|
|
2809
|
-
return $[4] !==
|
|
2814
|
+
return $[4] !== as || $[5] !== ref || $[6] !== restProps || $[7] !== t1 ? (t2 = /* @__PURE__ */ jsx(Root$p, { "data-ui": "Container", ...restProps, $width: t1, forwardedAs: as, ref }), $[4] = as, $[5] = ref, $[6] = restProps, $[7] = t1, $[8] = t2) : t2 = $[8], t2;
|
|
2810
2815
|
});
|
|
2811
2816
|
Container.displayName = "ForwardRef(Container)";
|
|
2812
2817
|
const Root$o = styled(Box)(responsiveGridStyle), Grid = forwardRef(function(props, ref) {
|
|
2813
2818
|
const $ = c(26);
|
|
2814
|
-
let as,
|
|
2819
|
+
let as, autoCols, autoFlow, autoRows, children, columns, gap, gapX, gapY, restProps, rows;
|
|
2815
2820
|
$[0] !== props ? ({
|
|
2816
2821
|
as,
|
|
2817
2822
|
autoRows,
|
|
@@ -2824,10 +2829,10 @@ const Root$o = styled(Box)(responsiveGridStyle), Grid = forwardRef(function(prop
|
|
|
2824
2829
|
rows,
|
|
2825
2830
|
children,
|
|
2826
2831
|
...restProps
|
|
2827
|
-
} = props, $[0] = props, $[1] = as, $[2] =
|
|
2832
|
+
} = props, $[0] = props, $[1] = as, $[2] = autoCols, $[3] = autoFlow, $[4] = autoRows, $[5] = children, $[6] = columns, $[7] = gap, $[8] = gapX, $[9] = gapY, $[10] = restProps, $[11] = rows) : (as = $[1], autoCols = $[2], autoFlow = $[3], autoRows = $[4], children = $[5], columns = $[6], gap = $[7], gapX = $[8], gapY = $[9], restProps = $[10], rows = $[11]);
|
|
2828
2833
|
const t0 = typeof as == "string" ? as : void 0, t1 = useArrayProp(autoRows), t2 = useArrayProp(autoCols), t3 = useArrayProp(autoFlow), t4 = useArrayProp(columns), t5 = useArrayProp(gap), t6 = useArrayProp(gapX), t7 = useArrayProp(gapY), t8 = useArrayProp(rows);
|
|
2829
2834
|
let t9;
|
|
2830
|
-
return $[12] !==
|
|
2835
|
+
return $[12] !== as || $[13] !== children || $[14] !== ref || $[15] !== restProps || $[16] !== t0 || $[17] !== t1 || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsx(Root$o, { "data-as": t0, "data-ui": "Grid", ...restProps, $autoRows: t1, $autoCols: t2, $autoFlow: t3, $columns: t4, $gap: t5, $gapX: t6, $gapY: t7, $rows: t8, forwardedAs: as, ref, children }), $[12] = as, $[13] = children, $[14] = ref, $[15] = restProps, $[16] = t0, $[17] = t1, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
|
|
2831
2836
|
});
|
|
2832
2837
|
Grid.displayName = "ForwardRef(Grid)";
|
|
2833
2838
|
function headingBaseStyle(props) {
|
|
@@ -2897,7 +2902,7 @@ const Root$n = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsive
|
|
|
2897
2902
|
overflow: clip;
|
|
2898
2903
|
`, Heading = forwardRef(function(props, ref) {
|
|
2899
2904
|
const $ = c(22);
|
|
2900
|
-
let
|
|
2905
|
+
let align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
|
|
2901
2906
|
$[0] !== props ? ({
|
|
2902
2907
|
accent: t0,
|
|
2903
2908
|
align,
|
|
@@ -2907,7 +2912,7 @@ const Root$n = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsive
|
|
|
2907
2912
|
textOverflow,
|
|
2908
2913
|
weight,
|
|
2909
2914
|
...restProps
|
|
2910
|
-
} = props, $[0] = props, $[1] =
|
|
2915
|
+
} = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight) : (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]);
|
|
2911
2916
|
const accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 2 : t2;
|
|
2912
2917
|
let children = childrenProp;
|
|
2913
2918
|
if (textOverflow === "ellipsis") {
|
|
@@ -2918,7 +2923,7 @@ const Root$n = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsive
|
|
|
2918
2923
|
let t5;
|
|
2919
2924
|
$[11] !== children ? (t5 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t5) : t5 = $[12];
|
|
2920
2925
|
let t6;
|
|
2921
|
-
return $[13] !==
|
|
2926
|
+
return $[13] !== accent || $[14] !== muted || $[15] !== ref || $[16] !== restProps || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== weight ? (t6 = /* @__PURE__ */ jsx(Root$n, { "data-ui": "Heading", ...restProps, $accent: accent, $align: t3, $muted: muted, $size: t4, $weight: weight, ref, children: t5 }), $[13] = accent, $[14] = muted, $[15] = ref, $[16] = restProps, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = weight, $[21] = t6) : t6 = $[21], t6;
|
|
2922
2927
|
});
|
|
2923
2928
|
Heading.displayName = "ForwardRef(Heading)";
|
|
2924
2929
|
function inlineBaseStyle() {
|
|
@@ -2949,26 +2954,24 @@ function inlineSpaceStyle(props) {
|
|
|
2949
2954
|
});
|
|
2950
2955
|
}
|
|
2951
2956
|
const Root$m = styled(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = forwardRef(function(props, ref) {
|
|
2952
|
-
const $ = c(
|
|
2953
|
-
let
|
|
2957
|
+
const $ = c(12);
|
|
2958
|
+
let as, childrenProp, restProps, space;
|
|
2954
2959
|
$[0] !== props ? ({
|
|
2955
2960
|
as,
|
|
2956
2961
|
children: childrenProp,
|
|
2957
2962
|
space,
|
|
2958
2963
|
...restProps
|
|
2959
|
-
} = props, $[0] = props, $[1] =
|
|
2964
|
+
} = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = restProps, $[4] = space) : (as = $[1], childrenProp = $[2], restProps = $[3], space = $[4]);
|
|
2960
2965
|
let t0, t1;
|
|
2961
|
-
|
|
2962
|
-
let t22;
|
|
2963
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t22 = (child) => child && /* @__PURE__ */ jsx("div", { children: child }), $[7] = t22) : t22 = $[7], t1 = Children.map(childrenProp, t22), $[5] = childrenProp, $[6] = t1;
|
|
2964
|
-
} else
|
|
2965
|
-
t1 = $[6];
|
|
2966
|
-
t0 = t1;
|
|
2966
|
+
$[5] !== childrenProp ? (t1 = Children.map(childrenProp, _temp$6), $[5] = childrenProp, $[6] = t1) : t1 = $[6], t0 = t1;
|
|
2967
2967
|
const children = t0, t2 = useArrayProp(space);
|
|
2968
2968
|
let t3;
|
|
2969
|
-
return $[
|
|
2969
|
+
return $[7] !== as || $[8] !== children || $[9] !== restProps || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(Root$m, { "data-ui": "Inline", ...restProps, $space: t2, forwardedAs: as, ref, children }), $[7] = as, $[8] = children, $[9] = restProps, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
|
|
2970
2970
|
});
|
|
2971
2971
|
Inline.displayName = "ForwardRef(Inline)";
|
|
2972
|
+
function _temp$6(child) {
|
|
2973
|
+
return child && /* @__PURE__ */ jsx("div", { children: child });
|
|
2974
|
+
}
|
|
2972
2975
|
function kbdStyle() {
|
|
2973
2976
|
return css`
|
|
2974
2977
|
--card-bg-color: var(--card-kbd-bg-color);
|
|
@@ -2988,21 +2991,21 @@ function kbdStyle() {
|
|
|
2988
2991
|
}
|
|
2989
2992
|
const Root$l = styled.kbd(responsiveRadiusStyle, kbdStyle), KBD = forwardRef(function(props, ref) {
|
|
2990
2993
|
const $ = c(17);
|
|
2991
|
-
let
|
|
2994
|
+
let children, restProps, t0, t1, t2;
|
|
2992
2995
|
$[0] !== props ? ({
|
|
2993
2996
|
children,
|
|
2994
2997
|
fontSize: t0,
|
|
2995
2998
|
padding: t1,
|
|
2996
2999
|
radius: t2,
|
|
2997
3000
|
...restProps
|
|
2998
|
-
} = props, $[0] = props, $[1] =
|
|
3001
|
+
} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2) : (children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5]);
|
|
2999
3002
|
const fontSize2 = t0 === void 0 ? 0 : t0, padding = t1 === void 0 ? 1 : t1, t3 = useArrayProp(t2 === void 0 ? 2 : t2);
|
|
3000
3003
|
let t4;
|
|
3001
|
-
$[6] !==
|
|
3004
|
+
$[6] !== children || $[7] !== fontSize2 ? (t4 = /* @__PURE__ */ jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children }), $[6] = children, $[7] = fontSize2, $[8] = t4) : t4 = $[8];
|
|
3002
3005
|
let t5;
|
|
3003
3006
|
$[9] !== padding || $[10] !== t4 ? (t5 = /* @__PURE__ */ jsx(Box, { as: "span", padding, children: t4 }), $[9] = padding, $[10] = t4, $[11] = t5) : t5 = $[11];
|
|
3004
3007
|
let t6;
|
|
3005
|
-
return $[12] !==
|
|
3008
|
+
return $[12] !== ref || $[13] !== restProps || $[14] !== t3 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Root$l, { "data-ui": "KBD", ...restProps, $radius: t3, ref, children: t5 }), $[12] = ref, $[13] = restProps, $[14] = t3, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
|
|
3006
3009
|
});
|
|
3007
3010
|
KBD.displayName = "ForwardRef(KBD)";
|
|
3008
3011
|
const origin = {
|
|
@@ -3126,13 +3129,13 @@ const Root$k = styled.div(({
|
|
|
3126
3129
|
fill: var(--card-bg-color);
|
|
3127
3130
|
`, Arrow = forwardRef(function(props, ref) {
|
|
3128
3131
|
const $ = c(24);
|
|
3129
|
-
let
|
|
3132
|
+
let h, restProps, t0, w;
|
|
3130
3133
|
$[0] !== props ? ({
|
|
3131
3134
|
width: w,
|
|
3132
3135
|
height: h,
|
|
3133
3136
|
radius: t0,
|
|
3134
3137
|
...restProps
|
|
3135
|
-
} = props, $[0] = props, $[1] =
|
|
3138
|
+
} = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = t0, $[4] = w) : (h = $[1], restProps = $[2], t0 = $[3], w = $[4]);
|
|
3136
3139
|
const radius = t0 === void 0 ? 0 : t0, {
|
|
3137
3140
|
card
|
|
3138
3141
|
} = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, points = [{
|
|
@@ -3162,13 +3165,13 @@ const Root$k = styled.div(({
|
|
|
3162
3165
|
let t5;
|
|
3163
3166
|
$[11] !== fillPath ? (t5 = /* @__PURE__ */ jsx(ShapePath, { d: fillPath }), $[11] = fillPath, $[12] = t5) : t5 = $[12];
|
|
3164
3167
|
let t6;
|
|
3165
|
-
$[13] !==
|
|
3168
|
+
$[13] !== t1 || $[14] !== t2 || $[15] !== t4 || $[16] !== t5 || $[17] !== w ? (t6 = /* @__PURE__ */ jsxs("svg", { width: w, height: w, viewBox: t1, children: [
|
|
3166
3169
|
t2,
|
|
3167
3170
|
t4,
|
|
3168
3171
|
t5
|
|
3169
|
-
] }), $[13] =
|
|
3172
|
+
] }), $[13] = t1, $[14] = t2, $[15] = t4, $[16] = t5, $[17] = w, $[18] = t6) : t6 = $[18];
|
|
3170
3173
|
let t7;
|
|
3171
|
-
return $[19] !==
|
|
3174
|
+
return $[19] !== ref || $[20] !== restProps || $[21] !== t6 || $[22] !== w ? (t7 = /* @__PURE__ */ jsx(Root$k, { ...restProps, $w: w, ref, children: t6 }), $[19] = ref, $[20] = restProps, $[21] = t6, $[22] = w, $[23] = t7) : t7 = $[23], t7;
|
|
3172
3175
|
});
|
|
3173
3176
|
Arrow.displayName = "ForwardRef(Arrow)";
|
|
3174
3177
|
const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
|
|
@@ -3184,7 +3187,7 @@ function BoundaryElementProvider(props) {
|
|
|
3184
3187
|
}, $[0] = element, $[1] = t1) : t1 = $[1], t0 = t1;
|
|
3185
3188
|
const value = t0;
|
|
3186
3189
|
let t2;
|
|
3187
|
-
return $[2] !==
|
|
3190
|
+
return $[2] !== children || $[3] !== value ? (t2 = /* @__PURE__ */ jsx(BoundaryElementContext.Provider, { value, children }), $[2] = children, $[3] = value, $[4] = t2) : t2 = $[4], t2;
|
|
3188
3191
|
}
|
|
3189
3192
|
BoundaryElementProvider.displayName = "BoundaryElementProvider";
|
|
3190
3193
|
function isRecord(value) {
|
|
@@ -3222,12 +3225,12 @@ function findMinBreakpoints(media, width) {
|
|
|
3222
3225
|
}
|
|
3223
3226
|
const ElementQuery = forwardRef(function(props, forwardedRef) {
|
|
3224
3227
|
const $ = c(18), theme = useTheme_v2();
|
|
3225
|
-
let _media,
|
|
3228
|
+
let _media, children, restProps;
|
|
3226
3229
|
$[0] !== props ? ({
|
|
3227
3230
|
children,
|
|
3228
3231
|
media: _media,
|
|
3229
3232
|
...restProps
|
|
3230
|
-
} = props, $[0] = props, $[1] = _media, $[2] =
|
|
3233
|
+
} = props, $[0] = props, $[1] = _media, $[2] = children, $[3] = restProps) : (_media = $[1], children = $[2], restProps = $[3]);
|
|
3231
3234
|
const media = _media ?? theme.media, [element, setElement] = useState(null), elementSize = useElementSize(element);
|
|
3232
3235
|
let t0;
|
|
3233
3236
|
t0 = elementSize?.border.width ?? window.innerWidth;
|
|
@@ -3251,7 +3254,7 @@ const ElementQuery = forwardRef(function(props, forwardedRef) {
|
|
|
3251
3254
|
let t5, t6;
|
|
3252
3255
|
$[10] !== element ? (t5 = () => element, t6 = [element], $[10] = element, $[11] = t5, $[12] = t6) : (t5 = $[11], t6 = $[12]), useImperativeHandle(forwardedRef, t5, t6);
|
|
3253
3256
|
let t7;
|
|
3254
|
-
return $[13] !==
|
|
3257
|
+
return $[13] !== children || $[14] !== max || $[15] !== min || $[16] !== restProps ? (t7 = /* @__PURE__ */ jsx("div", { "data-ui": "ElementQuery", ...restProps, "data-eq-max": max, "data-eq-min": min, ref: setElement, children }), $[13] = children, $[14] = max, $[15] = min, $[16] = restProps, $[17] = t7) : t7 = $[17], t7;
|
|
3255
3258
|
});
|
|
3256
3259
|
ElementQuery.displayName = "ForwardRef(ElementQuery)";
|
|
3257
3260
|
class ErrorBoundary extends Component {
|
|
@@ -3397,18 +3400,18 @@ function LayerProvider(props) {
|
|
|
3397
3400
|
[childLevel]: prevLen + 1
|
|
3398
3401
|
};
|
|
3399
3402
|
return setSize(Object.keys(nextState).length), nextState;
|
|
3400
|
-
}) : setSize(
|
|
3403
|
+
}) : setSize(_temp$5), () => {
|
|
3401
3404
|
childLevel !== void 0 ? setChildLayers((state_0) => {
|
|
3402
3405
|
const nextState_0 = {
|
|
3403
3406
|
...state_0
|
|
3404
3407
|
};
|
|
3405
3408
|
return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
|
|
3406
|
-
}) : setSize(
|
|
3409
|
+
}) : setSize(_temp2$3), parentDispose?.();
|
|
3407
3410
|
};
|
|
3408
3411
|
}, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
|
|
3409
3412
|
const registerChild = t3;
|
|
3410
3413
|
let t4, t5;
|
|
3411
|
-
$[6] !==
|
|
3414
|
+
$[6] !== level || $[7] !== parentRegisterChild ? (t4 = () => parentRegisterChild?.(level), t5 = [level, parentRegisterChild], $[6] = level, $[7] = parentRegisterChild, $[8] = t4, $[9] = t5) : (t4 = $[8], t5 = $[9]), useEffect(t4, t5);
|
|
3412
3415
|
let t6, t7;
|
|
3413
3416
|
$[10] !== isTopLayer || $[11] !== level || $[12] !== registerChild || $[13] !== size2 || $[14] !== zIndex ? (t7 = {
|
|
3414
3417
|
version: 0,
|
|
@@ -3420,21 +3423,27 @@ function LayerProvider(props) {
|
|
|
3420
3423
|
}, $[10] = isTopLayer, $[11] = level, $[12] = registerChild, $[13] = size2, $[14] = zIndex, $[15] = t7) : t7 = $[15], t6 = t7;
|
|
3421
3424
|
const value = t6;
|
|
3422
3425
|
let t8;
|
|
3423
|
-
return $[16] !==
|
|
3426
|
+
return $[16] !== children || $[17] !== value ? (t8 = /* @__PURE__ */ jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t8) : t8 = $[18], t8;
|
|
3427
|
+
}
|
|
3428
|
+
function _temp2$3(v_0) {
|
|
3429
|
+
return v_0 - 1;
|
|
3430
|
+
}
|
|
3431
|
+
function _temp$5(v) {
|
|
3432
|
+
return v + 1;
|
|
3424
3433
|
}
|
|
3425
3434
|
LayerProvider.displayName = "LayerProvider";
|
|
3426
3435
|
const Root$j = styled.div({
|
|
3427
3436
|
position: "relative"
|
|
3428
3437
|
}), LayerChildren = forwardRef(function(props, forwardedRef) {
|
|
3429
3438
|
const $ = c(22);
|
|
3430
|
-
let
|
|
3439
|
+
let children, onActivate, onFocus, restProps, t0;
|
|
3431
3440
|
$[0] !== props ? ({
|
|
3432
3441
|
children,
|
|
3433
3442
|
onActivate,
|
|
3434
3443
|
onFocus,
|
|
3435
3444
|
style: t0,
|
|
3436
3445
|
...restProps
|
|
3437
|
-
} = props, $[0] = props, $[1] =
|
|
3446
|
+
} = props, $[0] = props, $[1] = children, $[2] = onActivate, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], onActivate = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
|
|
3438
3447
|
const style = t0 === void 0 ? EMPTY_RECORD : t0, {
|
|
3439
3448
|
zIndex,
|
|
3440
3449
|
isTopLayer
|
|
@@ -3448,11 +3457,11 @@ const Root$j = styled.div({
|
|
|
3448
3457
|
}), isTopLayerRef.current = isTopLayer;
|
|
3449
3458
|
}, t3 = [isTopLayer, onActivate], $[7] = isTopLayer, $[8] = onActivate, $[9] = t2, $[10] = t3) : (t2 = $[9], t3 = $[10]), useEffect(t2, t3);
|
|
3450
3459
|
let t4;
|
|
3451
|
-
$[11] !==
|
|
3460
|
+
$[11] !== isTopLayer || $[12] !== onFocus ? (t4 = (event) => {
|
|
3452
3461
|
onFocus?.(event);
|
|
3453
3462
|
const rootElement = ref.current, target = document.activeElement;
|
|
3454
3463
|
!isTopLayer || !rootElement || !target || isHTMLElement(target) && containsOrEqualsElement(rootElement, target) && (lastFocusedRef.current = target);
|
|
3455
|
-
}, $[11] =
|
|
3464
|
+
}, $[11] = isTopLayer, $[12] = onFocus, $[13] = t4) : t4 = $[13];
|
|
3456
3465
|
const handleFocus = t4;
|
|
3457
3466
|
let t5;
|
|
3458
3467
|
$[14] !== style || $[15] !== zIndex ? (t5 = {
|
|
@@ -3460,20 +3469,20 @@ const Root$j = styled.div({
|
|
|
3460
3469
|
zIndex
|
|
3461
3470
|
}, $[14] = style, $[15] = zIndex, $[16] = t5) : t5 = $[16];
|
|
3462
3471
|
let t6;
|
|
3463
|
-
return $[17] !==
|
|
3472
|
+
return $[17] !== children || $[18] !== handleFocus || $[19] !== restProps || $[20] !== t5 ? (t6 = /* @__PURE__ */ jsx(Root$j, { ...restProps, "data-ui": "Layer", onFocus: handleFocus, ref, style: t5, children }), $[17] = children, $[18] = handleFocus, $[19] = restProps, $[20] = t5, $[21] = t6) : t6 = $[21], t6;
|
|
3464
3473
|
}), Layer = forwardRef(function(props, ref) {
|
|
3465
3474
|
const $ = c(11);
|
|
3466
|
-
let
|
|
3475
|
+
let children, restProps, t0;
|
|
3467
3476
|
$[0] !== props ? ({
|
|
3468
3477
|
children,
|
|
3469
3478
|
zOffset: t0,
|
|
3470
3479
|
...restProps
|
|
3471
|
-
} = props, $[0] = props, $[1] =
|
|
3480
|
+
} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
|
|
3472
3481
|
const zOffset = t0 === void 0 ? 1 : t0;
|
|
3473
3482
|
let t1;
|
|
3474
|
-
$[4] !==
|
|
3483
|
+
$[4] !== children || $[5] !== ref || $[6] !== restProps ? (t1 = /* @__PURE__ */ jsx(LayerChildren, { ...restProps, ref, children }), $[4] = children, $[5] = ref, $[6] = restProps, $[7] = t1) : t1 = $[7];
|
|
3475
3484
|
let t2;
|
|
3476
|
-
return $[8] !==
|
|
3485
|
+
return $[8] !== t1 || $[9] !== zOffset ? (t2 = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: t1 }), $[8] = t1, $[9] = zOffset, $[10] = t2) : t2 = $[10], t2;
|
|
3477
3486
|
});
|
|
3478
3487
|
Layer.displayName = "ForwardRef(Layer)";
|
|
3479
3488
|
const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
|
|
@@ -3510,32 +3519,32 @@ function PortalProvider(props) {
|
|
|
3510
3519
|
children,
|
|
3511
3520
|
element,
|
|
3512
3521
|
__unstable_elements: elementsProp
|
|
3513
|
-
} = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(emptySubscribe, _temp$
|
|
3522
|
+
} = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(emptySubscribe, _temp$4, _temp2$2);
|
|
3514
3523
|
let t0;
|
|
3515
3524
|
const t1 = boundaryElement || null, t2 = element || fallbackElement;
|
|
3516
3525
|
let t3;
|
|
3517
|
-
$[0] !==
|
|
3526
|
+
$[0] !== elements || $[1] !== t1 || $[2] !== t2 ? (t3 = {
|
|
3518
3527
|
version: 0,
|
|
3519
3528
|
boundaryElement: t1,
|
|
3520
3529
|
element: t2,
|
|
3521
3530
|
elements
|
|
3522
|
-
}, $[0] =
|
|
3531
|
+
}, $[0] = elements, $[1] = t1, $[2] = t2, $[3] = t3) : t3 = $[3], t0 = t3;
|
|
3523
3532
|
const value = t0;
|
|
3524
3533
|
let t4;
|
|
3525
|
-
return $[4] !==
|
|
3534
|
+
return $[4] !== children || $[5] !== value ? (t4 = /* @__PURE__ */ jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t4) : t4 = $[6], t4;
|
|
3526
3535
|
}
|
|
3527
|
-
function _temp2$
|
|
3536
|
+
function _temp2$2() {
|
|
3528
3537
|
return null;
|
|
3529
3538
|
}
|
|
3530
|
-
function _temp$
|
|
3539
|
+
function _temp$4() {
|
|
3531
3540
|
return document.body;
|
|
3532
3541
|
}
|
|
3533
3542
|
PortalProvider.displayName = "PortalProvider";
|
|
3534
3543
|
const emptySubscribe = () => () => {
|
|
3535
3544
|
};
|
|
3536
3545
|
function useUnique(value) {
|
|
3537
|
-
const
|
|
3538
|
-
return _isEqual(
|
|
3546
|
+
const valueRef = useRef(value);
|
|
3547
|
+
return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
|
|
3539
3548
|
}
|
|
3540
3549
|
function _isEqual(objA, objB) {
|
|
3541
3550
|
if (!objA || !objB)
|
|
@@ -3556,7 +3565,7 @@ const Root$i = styled.div`
|
|
|
3556
3565
|
children
|
|
3557
3566
|
} = props;
|
|
3558
3567
|
let t0;
|
|
3559
|
-
return $[0] !== as || $[1] !==
|
|
3568
|
+
return $[0] !== as || $[1] !== children || $[2] !== ref ? (t0 = /* @__PURE__ */ jsx(Root$i, { "aria-hidden": !0, as, "data-ui": "SrOnly", ref, children }), $[0] = as, $[1] = children, $[2] = ref, $[3] = t0) : t0 = $[3], t0;
|
|
3560
3569
|
});
|
|
3561
3570
|
SrOnly.displayName = "ForwardRef(SrOnly)";
|
|
3562
3571
|
const Root$h = styled.div`
|
|
@@ -3567,7 +3576,7 @@ const Root$h = styled.div`
|
|
|
3567
3576
|
right: 0;
|
|
3568
3577
|
`, VirtualList = forwardRef(function(props, forwardedRef) {
|
|
3569
3578
|
const $ = c(56);
|
|
3570
|
-
let
|
|
3579
|
+
let getItemKey, onChange, renderItem, restProps, t0, t1, t2;
|
|
3571
3580
|
$[0] !== props ? ({
|
|
3572
3581
|
as: t0,
|
|
3573
3582
|
gap: t1,
|
|
@@ -3576,7 +3585,7 @@ const Root$h = styled.div`
|
|
|
3576
3585
|
onChange,
|
|
3577
3586
|
renderItem,
|
|
3578
3587
|
...restProps
|
|
3579
|
-
} = props, $[0] = props, $[1] =
|
|
3588
|
+
} = props, $[0] = props, $[1] = getItemKey, $[2] = onChange, $[3] = renderItem, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = t2) : (getItemKey = $[1], onChange = $[2], renderItem = $[3], restProps = $[4], t0 = $[5], t1 = $[6], t2 = $[7]);
|
|
3580
3589
|
const as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1;
|
|
3581
3590
|
let t3;
|
|
3582
3591
|
$[8] !== t2 ? (t3 = t2 === void 0 ? [] : t2, $[8] = t2, $[9] = t3) : t3 = $[9];
|
|
@@ -3630,8 +3639,8 @@ const Root$h = styled.div`
|
|
|
3630
3639
|
};
|
|
3631
3640
|
}, t8 = [], $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), useEffect(t7, t8);
|
|
3632
3641
|
const len = items.length, height = itemHeight ? len * (itemHeight + space[gap]) - space[gap] : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
|
|
3633
|
-
let
|
|
3634
|
-
$[16] !==
|
|
3642
|
+
let t10, t9;
|
|
3643
|
+
$[16] !== fromIndex || $[17] !== gap || $[18] !== itemHeight || $[19] !== onChange || $[20] !== scrollHeight || $[21] !== scrollTop || $[22] !== space || $[23] !== toIndex ? (t9 = () => {
|
|
3635
3644
|
onChange && onChange({
|
|
3636
3645
|
fromIndex,
|
|
3637
3646
|
gap: space[gap],
|
|
@@ -3640,7 +3649,7 @@ const Root$h = styled.div`
|
|
|
3640
3649
|
scrollTop,
|
|
3641
3650
|
toIndex
|
|
3642
3651
|
});
|
|
3643
|
-
}, t10 = [fromIndex, gap, itemHeight, onChange, scrollHeight, scrollTop, space, toIndex], $[16] =
|
|
3652
|
+
}, t10 = [fromIndex, gap, itemHeight, onChange, scrollHeight, scrollTop, space, toIndex], $[16] = fromIndex, $[17] = gap, $[18] = itemHeight, $[19] = onChange, $[20] = scrollHeight, $[21] = scrollTop, $[22] = space, $[23] = toIndex, $[24] = t10, $[25] = t9) : (t10 = $[24], t9 = $[25]), useEffect(t9, t10);
|
|
3644
3653
|
let t11;
|
|
3645
3654
|
bb0: {
|
|
3646
3655
|
if (!renderItem || items.length === 0) {
|
|
@@ -3656,14 +3665,14 @@ const Root$h = styled.div`
|
|
|
3656
3665
|
break bb0;
|
|
3657
3666
|
}
|
|
3658
3667
|
let t122;
|
|
3659
|
-
if ($[31] !==
|
|
3668
|
+
if ($[31] !== fromIndex || $[32] !== gap || $[33] !== getItemKey || $[34] !== itemHeight || $[35] !== items || $[36] !== renderItem || $[37] !== space || $[38] !== toIndex) {
|
|
3660
3669
|
let t132;
|
|
3661
|
-
$[40] !== fromIndex || $[41] !==
|
|
3670
|
+
$[40] !== fromIndex || $[41] !== gap || $[42] !== getItemKey || $[43] !== itemHeight || $[44] !== renderItem || $[45] !== space ? (t132 = (item, _itemIndex) => {
|
|
3662
3671
|
const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
|
|
3663
3672
|
return /* @__PURE__ */ jsx(ItemWrapper, { style: {
|
|
3664
3673
|
top: itemIndex * (itemHeight + space[gap])
|
|
3665
3674
|
}, children: node }, key2);
|
|
3666
|
-
}, $[40] = fromIndex, $[41] =
|
|
3675
|
+
}, $[40] = fromIndex, $[41] = gap, $[42] = getItemKey, $[43] = itemHeight, $[44] = renderItem, $[45] = space, $[46] = t132) : t132 = $[46], t122 = items.slice(fromIndex, toIndex).map(t132), $[31] = fromIndex, $[32] = gap, $[33] = getItemKey, $[34] = itemHeight, $[35] = items, $[36] = renderItem, $[37] = space, $[38] = toIndex, $[39] = t122;
|
|
3667
3676
|
} else
|
|
3668
3677
|
t122 = $[39];
|
|
3669
3678
|
t11 = t122;
|
|
@@ -3675,7 +3684,7 @@ const Root$h = styled.div`
|
|
|
3675
3684
|
}, $[47] = height, $[48] = t13) : t13 = $[48], t12 = t13;
|
|
3676
3685
|
const wrapperStyle = t12;
|
|
3677
3686
|
let t14;
|
|
3678
|
-
$[49] !==
|
|
3687
|
+
$[49] !== children || $[50] !== wrapperStyle ? (t14 = /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[49] = children, $[50] = wrapperStyle, $[51] = t14) : t14 = $[51];
|
|
3679
3688
|
let t15;
|
|
3680
3689
|
return $[52] !== as || $[53] !== restProps || $[54] !== t14 ? (t15 = /* @__PURE__ */ jsx(Root$h, { as, "data-ui": "VirtualList", ...restProps, ref, children: t14 }), $[52] = as, $[53] = restProps, $[54] = t14, $[55] = t15) : t15 = $[55], t15;
|
|
3681
3690
|
});
|
|
@@ -3763,8 +3772,8 @@ const MotionCard$1 = styled(motion(Card))`
|
|
|
3763
3772
|
will-change: opacity;
|
|
3764
3773
|
}
|
|
3765
3774
|
`, PopoverCard = memo(forwardRef(function(props, ref) {
|
|
3766
|
-
const $ = c(
|
|
3767
|
-
let
|
|
3775
|
+
const $ = c(60);
|
|
3776
|
+
let animate, arrow2, arrowRef, arrowX, arrowY, children, marginsProp, originX, originY, overflow, padding, placement, radius, restProps, scheme, shadow, strategy, style, tone, width, xProp, yProp;
|
|
3768
3777
|
$[0] !== props ? ({
|
|
3769
3778
|
__unstable_margins: marginsProp,
|
|
3770
3779
|
animate,
|
|
@@ -3784,10 +3793,11 @@ const MotionCard$1 = styled(motion(Card))`
|
|
|
3784
3793
|
strategy,
|
|
3785
3794
|
style,
|
|
3786
3795
|
tone,
|
|
3796
|
+
width,
|
|
3787
3797
|
x: xProp,
|
|
3788
3798
|
y: yProp,
|
|
3789
3799
|
...restProps
|
|
3790
|
-
} = props, $[0] = props, $[1] =
|
|
3800
|
+
} = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = originX, $[9] = originY, $[10] = overflow, $[11] = padding, $[12] = placement, $[13] = radius, $[14] = restProps, $[15] = scheme, $[16] = shadow, $[17] = strategy, $[18] = style, $[19] = tone, $[20] = width, $[21] = xProp, $[22] = yProp) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], originX = $[8], originY = $[9], overflow = $[10], padding = $[11], placement = $[12], radius = $[13], restProps = $[14], scheme = $[15], shadow = $[16], strategy = $[17], style = $[18], tone = $[19], width = $[20], xProp = $[21], yProp = $[22]);
|
|
3791
3801
|
const {
|
|
3792
3802
|
zIndex
|
|
3793
3803
|
} = useLayer();
|
|
@@ -3797,163 +3807,139 @@ const MotionCard$1 = styled(motion(Card))`
|
|
|
3797
3807
|
let t1;
|
|
3798
3808
|
const t2 = animate ? "transform" : void 0;
|
|
3799
3809
|
let t3;
|
|
3800
|
-
$[
|
|
3810
|
+
$[23] !== originX || $[24] !== originY || $[25] !== strategy || $[26] !== style || $[27] !== t2 || $[28] !== width || $[29] !== x || $[30] !== y || $[31] !== zIndex ? (t3 = {
|
|
3801
3811
|
left: x,
|
|
3802
3812
|
originX,
|
|
3803
3813
|
originY,
|
|
3804
3814
|
position: strategy,
|
|
3805
3815
|
top: y,
|
|
3816
|
+
width,
|
|
3806
3817
|
zIndex,
|
|
3807
3818
|
willChange: t2,
|
|
3808
3819
|
...style
|
|
3809
|
-
}, $[
|
|
3820
|
+
}, $[23] = originX, $[24] = originY, $[25] = strategy, $[26] = style, $[27] = t2, $[28] = width, $[29] = x, $[30] = y, $[31] = zIndex, $[32] = t3) : t3 = $[32], t1 = t3;
|
|
3810
3821
|
const rootStyle2 = t1;
|
|
3811
3822
|
let t4;
|
|
3812
3823
|
const t5 = arrowX !== null ? arrowX : void 0, t6 = arrowY !== null ? arrowY : void 0;
|
|
3813
3824
|
let t7;
|
|
3814
|
-
$[
|
|
3825
|
+
$[33] !== t5 || $[34] !== t6 ? (t7 = {
|
|
3815
3826
|
left: t5,
|
|
3816
3827
|
top: t6,
|
|
3817
3828
|
right: void 0,
|
|
3818
3829
|
bottom: void 0
|
|
3819
|
-
}, $[
|
|
3830
|
+
}, $[33] = t5, $[34] = t6, $[35] = t7) : t7 = $[35], t4 = t7;
|
|
3820
3831
|
const arrowStyle = t4, t8 = restProps;
|
|
3821
3832
|
let t9;
|
|
3822
|
-
$[
|
|
3833
|
+
$[36] !== animate ? (t9 = animate ? POPOVER_MOTION_PROPS : {}, $[36] = animate, $[37] = t9) : t9 = $[37];
|
|
3823
3834
|
let t10;
|
|
3824
|
-
$[
|
|
3835
|
+
$[38] !== children || $[39] !== padding ? (t10 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }), $[38] = children, $[39] = padding, $[40] = t10) : t10 = $[40];
|
|
3825
3836
|
let t11;
|
|
3826
|
-
$[
|
|
3837
|
+
$[41] !== overflow || $[42] !== t10 ? (t11 = /* @__PURE__ */ jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, overflow, children: t10 }), $[41] = overflow, $[42] = t10, $[43] = t11) : t11 = $[43];
|
|
3827
3838
|
let t12;
|
|
3828
|
-
$[
|
|
3839
|
+
$[44] !== arrow2 || $[45] !== arrowRef || $[46] !== arrowStyle ? (t12 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[44] = arrow2, $[45] = arrowRef, $[46] = arrowStyle, $[47] = t12) : t12 = $[47];
|
|
3829
3840
|
let t13;
|
|
3830
|
-
return $[
|
|
3841
|
+
return $[48] !== placement || $[49] !== radius || $[50] !== ref || $[51] !== rootStyle2 || $[52] !== scheme || $[53] !== shadow || $[54] !== t11 || $[55] !== t12 || $[56] !== t8 || $[57] !== t9 || $[58] !== tone ? (t13 = /* @__PURE__ */ jsxs(MotionCard$1, { "data-ui": "Popover", ...t8, "data-placement": placement, radius, ref, scheme, shadow, sizing: "border", style: rootStyle2, tone, ...t9, children: [
|
|
3831
3842
|
t11,
|
|
3832
3843
|
t12
|
|
3833
|
-
] }), $[
|
|
3844
|
+
] }), $[48] = placement, $[49] = radius, $[50] = ref, $[51] = rootStyle2, $[52] = scheme, $[53] = shadow, $[54] = t11, $[55] = t12, $[56] = t8, $[57] = t9, $[58] = tone, $[59] = t13) : t13 = $[59], t13;
|
|
3834
3845
|
}));
|
|
3835
3846
|
PopoverCard.displayName = "Memo(ForwardRef(PopoverCard))";
|
|
3836
3847
|
const Popover = memo(forwardRef(function(props, forwardedRef) {
|
|
3837
|
-
const
|
|
3848
|
+
const {
|
|
3838
3849
|
container,
|
|
3839
3850
|
layer
|
|
3840
|
-
} = useTheme_v2(), boundaryElementContext = useBoundaryElement()
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3851
|
+
} = useTheme_v2(), boundaryElementContext = useBoundaryElement(), {
|
|
3852
|
+
__unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
|
|
3853
|
+
animate: _animate = !1,
|
|
3854
|
+
arrow: arrowProp = !1,
|
|
3855
|
+
boundaryElement = boundaryElementContext.element,
|
|
3856
|
+
children: childProp,
|
|
3857
|
+
constrainSize = !1,
|
|
3858
|
+
content,
|
|
3859
|
+
disabled,
|
|
3860
|
+
fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
|
|
3861
|
+
matchReferenceWidth,
|
|
3862
|
+
floatingBoundary = props.boundaryElement ?? boundaryElementContext.element,
|
|
3863
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3864
|
+
onActivate,
|
|
3865
|
+
open,
|
|
3866
|
+
overflow = "hidden",
|
|
3867
|
+
padding: paddingProp,
|
|
3868
|
+
placement: placementProp = "bottom",
|
|
3869
|
+
portal,
|
|
3870
|
+
preventOverflow = !0,
|
|
3871
|
+
radius: radiusProp = 3,
|
|
3872
|
+
referenceBoundary = props.boundaryElement ?? boundaryElementContext.element,
|
|
3873
|
+
referenceElement,
|
|
3874
|
+
scheme,
|
|
3875
|
+
shadow: shadowProp = 3,
|
|
3876
|
+
tone = "inherit",
|
|
3877
|
+
width: widthProp = "auto",
|
|
3878
|
+
zOffset: zOffsetProp = layer.popover.zOffset,
|
|
3879
|
+
updateRef,
|
|
3880
|
+
...restProps
|
|
3881
|
+
} = props, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = useRef(null), arrowRef = useRef(null), rootBoundary = "viewport";
|
|
3882
|
+
useImperativeHandle(forwardedRef, () => ref.current);
|
|
3883
|
+
const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
|
|
3884
|
+
container,
|
|
3885
|
+
mediaIndex,
|
|
3886
|
+
width: widthArrayProp
|
|
3887
|
+
}), widthRef = useRef(width);
|
|
3888
|
+
useEffect(() => {
|
|
3889
|
+
widthRef.current = width;
|
|
3890
|
+
}, [width]);
|
|
3891
|
+
const maxWidth = calcMaxWidth({
|
|
3892
|
+
boundaryWidth,
|
|
3893
|
+
currentWidth: width
|
|
3894
|
+
}), maxWidthRef = useRef(maxWidth);
|
|
3895
|
+
useEffect(() => {
|
|
3896
|
+
maxWidthRef.current = maxWidth;
|
|
3897
|
+
}, [maxWidth]);
|
|
3898
|
+
const referenceWidthRef = useRef();
|
|
3899
|
+
useEffect(() => {
|
|
3882
3900
|
const floatingElement = ref.current;
|
|
3883
|
-
if (!open || !floatingElement
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
fallbackPlacements,
|
|
3899
|
-
padding: DEFAULT_POPOVER_PADDING,
|
|
3900
|
-
rootBoundary: "viewport"
|
|
3901
|
-
}), $[38] = constrainSize, $[39] = preventOverflow, $[40] = floatingBoundary, $[41] = fallbackPlacements, $[42] = t14) : t14 = $[42];
|
|
3902
|
-
let t15;
|
|
3903
|
-
$[43] === Symbol.for("react.memo_cache_sentinel") ? (t15 = offset({
|
|
3904
|
-
mainAxis: DEFAULT_POPOVER_DISTANCE
|
|
3905
|
-
}), $[43] = t15) : t15 = $[43];
|
|
3906
|
-
let t16;
|
|
3907
|
-
$[44] !== constrainSize || $[45] !== matchReferenceWidth || $[46] !== container || $[47] !== mediaIndex || $[48] !== widthArrayProp || $[49] !== boundaryWidth || $[50] !== floatingBoundary || $[51] !== margins ? (t16 = (constrainSize || matchReferenceWidth) && size({
|
|
3908
|
-
apply(t172) {
|
|
3909
|
-
const {
|
|
3901
|
+
if (!open || !floatingElement) return;
|
|
3902
|
+
const referenceWidth = referenceWidthRef.current;
|
|
3903
|
+
matchReferenceWidth ? referenceWidth !== void 0 && (floatingElement.style.width = `${referenceWidth}px`) : width !== void 0 && (floatingElement.style.width = `${width}px`), typeof maxWidth == "number" && (floatingElement.style.maxWidth = `${maxWidth}px`);
|
|
3904
|
+
}, [width, matchReferenceWidth, maxWidth, open]);
|
|
3905
|
+
const middleware = useMemo(() => {
|
|
3906
|
+
const ret = [];
|
|
3907
|
+
return (constrainSize || preventOverflow) && ret.push(flip({
|
|
3908
|
+
boundary: floatingBoundary || void 0,
|
|
3909
|
+
fallbackPlacements,
|
|
3910
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
3911
|
+
rootBoundary
|
|
3912
|
+
})), ret.push(offset({
|
|
3913
|
+
mainAxis: DEFAULT_POPOVER_DISTANCE
|
|
3914
|
+
})), (constrainSize || matchReferenceWidth) && ret.push(size({
|
|
3915
|
+
apply({
|
|
3910
3916
|
availableWidth,
|
|
3911
3917
|
availableHeight,
|
|
3912
3918
|
elements,
|
|
3913
|
-
referenceWidth
|
|
3914
|
-
}
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
width:
|
|
3918
|
-
}
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
matchReferenceWidth
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
$[56] !== arrowProp || $[57] !== arrowElement ? (t18 = arrowProp && arrow({
|
|
3938
|
-
element: arrowElement,
|
|
3939
|
-
padding: DEFAULT_POPOVER_PADDING
|
|
3940
|
-
}), $[56] = arrowProp, $[57] = arrowElement, $[58] = t18) : t18 = $[58];
|
|
3941
|
-
const t19 = animate && origin, t20 = referenceBoundary || void 0;
|
|
3942
|
-
let t21;
|
|
3943
|
-
$[59] !== t20 ? (t21 = hide({
|
|
3944
|
-
boundary: t20,
|
|
3945
|
-
padding: DEFAULT_POPOVER_PADDING,
|
|
3946
|
-
strategy: "referenceHidden"
|
|
3947
|
-
}), $[59] = t20, $[60] = t21) : t21 = $[60];
|
|
3948
|
-
let t22;
|
|
3949
|
-
$[61] !== t14 || $[62] !== t16 || $[63] !== t17 || $[64] !== t18 || $[65] !== t19 || $[66] !== t21 ? (t22 = [t14, t15, t16, t17, t18, t19, t21], $[61] = t14, $[62] = t16, $[63] = t17, $[64] = t18, $[65] = t19, $[66] = t21, $[67] = t22) : t22 = $[67];
|
|
3950
|
-
let t23;
|
|
3951
|
-
$[68] !== t22 || $[69] !== placementProp ? (t23 = {
|
|
3952
|
-
middleware: t22,
|
|
3953
|
-
placement: placementProp,
|
|
3954
|
-
whileElementsMounted: autoUpdate
|
|
3955
|
-
}, $[68] = t22, $[69] = placementProp, $[70] = t23) : t23 = $[70];
|
|
3956
|
-
const {
|
|
3919
|
+
referenceWidth: referenceWidth_0
|
|
3920
|
+
}) {
|
|
3921
|
+
referenceWidthRef.current = referenceWidth_0;
|
|
3922
|
+
const _currentWidth = widthRef.current, _maxWidth = maxWidthRef.current;
|
|
3923
|
+
matchReferenceWidth ? elements.floating.style.width = `${referenceWidth_0}px` : _currentWidth !== void 0 && (elements.floating.style.width = `${_currentWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${Math.min(availableWidth, _maxWidth ?? 1 / 0)}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
|
|
3924
|
+
},
|
|
3925
|
+
boundaryElement: floatingBoundary || void 0,
|
|
3926
|
+
constrainSize,
|
|
3927
|
+
margins,
|
|
3928
|
+
matchReferenceWidth,
|
|
3929
|
+
padding: DEFAULT_POPOVER_PADDING
|
|
3930
|
+
})), preventOverflow && ret.push(shift({
|
|
3931
|
+
boundary: floatingBoundary || void 0,
|
|
3932
|
+
rootBoundary,
|
|
3933
|
+
padding: DEFAULT_POPOVER_PADDING
|
|
3934
|
+
})), arrowProp && ret.push(arrow({
|
|
3935
|
+
element: arrowRef,
|
|
3936
|
+
padding: DEFAULT_POPOVER_PADDING
|
|
3937
|
+
})), animate && ret.push(origin), ret.push(hide({
|
|
3938
|
+
boundary: referenceBoundary || void 0,
|
|
3939
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
3940
|
+
strategy: "referenceHidden"
|
|
3941
|
+
})), ret;
|
|
3942
|
+
}, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
|
|
3957
3943
|
x,
|
|
3958
3944
|
y,
|
|
3959
3945
|
middlewareData,
|
|
@@ -3961,61 +3947,35 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
|
|
|
3961
3947
|
refs,
|
|
3962
3948
|
strategy,
|
|
3963
3949
|
update
|
|
3964
|
-
} = useFloating(
|
|
3965
|
-
|
|
3966
|
-
|
|
3950
|
+
} = useFloating({
|
|
3951
|
+
middleware,
|
|
3952
|
+
placement: placementProp,
|
|
3953
|
+
whileElementsMounted: autoUpdate
|
|
3954
|
+
}), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, setArrow = useCallback((arrowEl) => {
|
|
3955
|
+
arrowRef.current = arrowEl;
|
|
3956
|
+
}, []), setFloating = useCallback((node) => {
|
|
3967
3957
|
ref.current = node, refs.setFloating(node);
|
|
3968
|
-
},
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
}
|
|
3985
|
-
let t312;
|
|
3986
|
-
$[80] !== setReference || $[81] !== childProp ? (t312 = cloneElement(childProp, {
|
|
3987
|
-
ref: setReference
|
|
3988
|
-
}), $[80] = setReference, $[81] = childProp, $[82] = t312) : t312 = $[82], t30 = t312;
|
|
3989
|
-
}
|
|
3990
|
-
const child = t30;
|
|
3991
|
-
let t31, t32;
|
|
3992
|
-
$[83] !== update ? (t31 = () => update, t32 = [update], $[83] = update, $[84] = t31, $[85] = t32) : (t31 = $[84], t32 = $[85]), useImperativeHandle(updateRef, t31, t32);
|
|
3993
|
-
let t33, t34;
|
|
3994
|
-
if ($[86] !== child || $[87] !== refs || $[88] !== referenceElement ? (t33 = () => {
|
|
3995
|
-
child || refs.setReference(referenceElement || null);
|
|
3996
|
-
}, t34 = [referenceElement, refs, child], $[86] = child, $[87] = refs, $[88] = referenceElement, $[89] = t33, $[90] = t34) : (t33 = $[89], t34 = $[90]), useEffect(t33, t34), disabled) {
|
|
3997
|
-
let t352;
|
|
3998
|
-
return $[91] !== childProp ? (t352 = childProp || /* @__PURE__ */ jsx(Fragment, {}), $[91] = childProp, $[92] = t352) : t352 = $[92], t352;
|
|
3999
|
-
}
|
|
4000
|
-
let t35;
|
|
4001
|
-
$[93] !== restProps || $[94] !== margins || $[95] !== animate || $[96] !== arrowProp || $[97] !== arrowX || $[98] !== arrowY || $[99] !== referenceHidden || $[100] !== overflow || $[101] !== padding || $[102] !== placement || $[103] !== radius || $[104] !== setFloating || $[105] !== scheme || $[106] !== shadow || $[107] !== originX || $[108] !== originY || $[109] !== strategy || $[110] !== tone || $[111] !== x || $[112] !== y || $[113] !== content ? (t35 = /* @__PURE__ */ jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrowElement, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, x, y, children: content }), $[93] = restProps, $[94] = margins, $[95] = animate, $[96] = arrowProp, $[97] = arrowX, $[98] = arrowY, $[99] = referenceHidden, $[100] = overflow, $[101] = padding, $[102] = placement, $[103] = radius, $[104] = setFloating, $[105] = scheme, $[106] = shadow, $[107] = originX, $[108] = originY, $[109] = strategy, $[110] = tone, $[111] = x, $[112] = y, $[113] = content, $[114] = t35) : t35 = $[114];
|
|
4002
|
-
let t36;
|
|
4003
|
-
$[115] !== zOffset || $[116] !== t35 ? (t36 = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: t35 }), $[115] = zOffset, $[116] = t35, $[117] = t36) : t36 = $[117];
|
|
4004
|
-
const popover = t36;
|
|
4005
|
-
let t37;
|
|
4006
|
-
$[118] !== open || $[119] !== portal || $[120] !== popover ? (t37 = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover), $[118] = open, $[119] = portal, $[120] = popover, $[121] = t37) : t37 = $[121];
|
|
4007
|
-
const children = t37;
|
|
4008
|
-
let t38;
|
|
4009
|
-
$[122] !== animate || $[123] !== children ? (t38 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[122] = animate, $[123] = children, $[124] = t38) : t38 = $[124];
|
|
4010
|
-
let t39;
|
|
4011
|
-
return $[125] !== t38 || $[126] !== child ? (t39 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4012
|
-
t38,
|
|
3958
|
+
}, [refs]), setReference = useCallback((node_0) => {
|
|
3959
|
+
refs.setReference(node_0);
|
|
3960
|
+
const childRef = getElementRef(childProp);
|
|
3961
|
+
typeof childRef == "function" ? childRef(node_0) : childRef && (childRef.current = node_0);
|
|
3962
|
+
}, [childProp, refs]), child = useMemo(() => referenceElement ? childProp : childProp ? cloneElement(childProp, {
|
|
3963
|
+
ref: setReference
|
|
3964
|
+
}) : null, [childProp, referenceElement, setReference]);
|
|
3965
|
+
if (useEffect(() => {
|
|
3966
|
+
updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
|
|
3967
|
+
}, [update, updateRef]), useEffect(() => {
|
|
3968
|
+
referenceElement && refs.setReference(referenceElement);
|
|
3969
|
+
}, [referenceElement, refs]), disabled)
|
|
3970
|
+
return childProp || /* @__PURE__ */ jsx(Fragment, {});
|
|
3971
|
+
const popover = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, width: matchReferenceWidth ? referenceWidthRef.current : width, x, y, children: content }) }), children = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
|
|
3972
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3973
|
+
animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
|
|
4013
3974
|
child
|
|
4014
|
-
] })
|
|
3975
|
+
] });
|
|
4015
3976
|
}));
|
|
4016
3977
|
Popover.displayName = "Memo(ForwardRef(Popover))";
|
|
4017
|
-
function getElementRef
|
|
4018
|
-
if (!element) return null;
|
|
3978
|
+
function getElementRef(element) {
|
|
4019
3979
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
4020
3980
|
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);
|
|
4021
3981
|
}
|
|
@@ -4135,7 +4095,7 @@ function inputElementStyle(props) {
|
|
|
4135
4095
|
}
|
|
4136
4096
|
const Root$g = styled.div(radioBaseStyle), Input$4 = styled.input(inputElementStyle), Radio = forwardRef(function(props, forwardedRef) {
|
|
4137
4097
|
const $ = c(19);
|
|
4138
|
-
let customValidity, disabled, readOnly, restProps,
|
|
4098
|
+
let className, customValidity, disabled, readOnly, restProps, style;
|
|
4139
4099
|
$[0] !== props ? ({
|
|
4140
4100
|
className,
|
|
4141
4101
|
disabled,
|
|
@@ -4143,13 +4103,13 @@ const Root$g = styled.div(radioBaseStyle), Input$4 = styled.input(inputElementSt
|
|
|
4143
4103
|
customValidity,
|
|
4144
4104
|
readOnly,
|
|
4145
4105
|
...restProps
|
|
4146
|
-
} = props, $[0] = props, $[1] =
|
|
4106
|
+
} = props, $[0] = props, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = readOnly, $[5] = restProps, $[6] = style) : (className = $[1], customValidity = $[2], disabled = $[3], readOnly = $[4], restProps = $[5], style = $[6]);
|
|
4147
4107
|
const ref = useRef(null);
|
|
4148
4108
|
let t0;
|
|
4149
4109
|
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[7] = t0) : t0 = $[7], useImperativeHandle(forwardedRef, t0), useCustomValidity(ref, customValidity);
|
|
4150
4110
|
const t1 = !disabled && readOnly ? "" : void 0, t2 = customValidity ? "" : void 0, t3 = disabled || readOnly;
|
|
4151
4111
|
let t4;
|
|
4152
|
-
$[8] !==
|
|
4112
|
+
$[8] !== readOnly || $[9] !== restProps || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsx(Input$4, { "data-read-only": t1, "data-error": t2, ...restProps, disabled: t3, readOnly, ref, type: "radio" }), $[8] = readOnly, $[9] = restProps, $[10] = t1, $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13];
|
|
4153
4113
|
let t5;
|
|
4154
4114
|
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */ jsx("span", {}), $[14] = t5) : t5 = $[14];
|
|
4155
4115
|
let t6;
|
|
@@ -4303,7 +4263,7 @@ const selectStyle = {
|
|
|
4303
4263
|
iconBox: iconBoxStyle
|
|
4304
4264
|
}, Root$f = styled.div(selectStyle.root), Input$3 = styled.select(selectStyle.input), IconBox = styled(Box)(selectStyle.iconBox), Select = forwardRef(function(props, forwardedRef) {
|
|
4305
4265
|
const $ = c(29);
|
|
4306
|
-
let
|
|
4266
|
+
let children, customValidity, disabled, readOnly, restProps, t0, t1, t2, t3;
|
|
4307
4267
|
$[0] !== props ? ({
|
|
4308
4268
|
children,
|
|
4309
4269
|
customValidity,
|
|
@@ -4314,13 +4274,13 @@ const selectStyle = {
|
|
|
4314
4274
|
readOnly,
|
|
4315
4275
|
space: t3,
|
|
4316
4276
|
...restProps
|
|
4317
|
-
} = props, $[0] = props, $[1] =
|
|
4277
|
+
} = props, $[0] = props, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = readOnly, $[5] = restProps, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3) : (children = $[1], customValidity = $[2], disabled = $[3], readOnly = $[4], restProps = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9]);
|
|
4318
4278
|
const fontSize2 = t0 === void 0 ? 2 : t0, padding = t1 === void 0 ? 3 : t1, radius = t2 === void 0 ? 2 : t2, space = t3 === void 0 ? 3 : t3, ref = useRef(null);
|
|
4319
4279
|
let t4;
|
|
4320
4280
|
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], useImperativeHandle(forwardedRef, t4), useCustomValidity(ref, customValidity);
|
|
4321
4281
|
const t5 = !disabled && readOnly ? "" : void 0, t6 = useArrayProp(fontSize2), t7 = useArrayProp(padding), t8 = useArrayProp(radius), t9 = useArrayProp(space), t10 = disabled || readOnly;
|
|
4322
4282
|
let t11;
|
|
4323
|
-
$[11] !==
|
|
4283
|
+
$[11] !== children || $[12] !== restProps || $[13] !== t10 || $[14] !== t5 || $[15] !== t6 || $[16] !== t7 || $[17] !== t8 || $[18] !== t9 ? (t11 = /* @__PURE__ */ jsx(Input$3, { "data-read-only": t5, "data-ui": "Select", ...restProps, $fontSize: t6, $padding: t7, $radius: t8, $space: t9, disabled: t10, ref, children }), $[11] = children, $[12] = restProps, $[13] = t10, $[14] = t5, $[15] = t6, $[16] = t7, $[17] = t8, $[18] = t9, $[19] = t11) : t11 = $[19];
|
|
4324
4284
|
let t12;
|
|
4325
4285
|
$[20] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx(ChevronDownIcon, {}), $[20] = t12) : t12 = $[20];
|
|
4326
4286
|
let t13;
|
|
@@ -4358,15 +4318,15 @@ function responsiveStackSpaceStyle(props) {
|
|
|
4358
4318
|
}
|
|
4359
4319
|
const Root$e = styled(Box)(stackBaseStyle, responsiveStackSpaceStyle), Stack = forwardRef(function(props, ref) {
|
|
4360
4320
|
const $ = c(10);
|
|
4361
|
-
let as,
|
|
4321
|
+
let as, restProps, space;
|
|
4362
4322
|
$[0] !== props ? ({
|
|
4363
4323
|
as,
|
|
4364
4324
|
space,
|
|
4365
4325
|
...restProps
|
|
4366
|
-
} = props, $[0] = props, $[1] = as, $[2] =
|
|
4326
|
+
} = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = space) : (as = $[1], restProps = $[2], space = $[3]);
|
|
4367
4327
|
const t0 = typeof as == "string" ? as : void 0, t1 = useArrayProp(space);
|
|
4368
4328
|
let t2;
|
|
4369
|
-
return $[4] !==
|
|
4329
|
+
return $[4] !== as || $[5] !== ref || $[6] !== restProps || $[7] !== t0 || $[8] !== t1 ? (t2 = /* @__PURE__ */ jsx(Root$e, { "data-as": t0, "data-ui": "Stack", ...restProps, $space: t1, forwardedAs: as, ref }), $[4] = as, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2) : t2 = $[9], t2;
|
|
4370
4330
|
});
|
|
4371
4331
|
Stack.displayName = "ForwardRef(Stack)";
|
|
4372
4332
|
function switchBaseStyles() {
|
|
@@ -4524,7 +4484,7 @@ function switchThumbStyles(props) {
|
|
|
4524
4484
|
}
|
|
4525
4485
|
const Root$d = styled.span(switchBaseStyles), Input$2 = styled.input(switchInputStyles), Representation = styled.span(switchRepresentationStyles), Track = styled.span(switchTrackStyles), Thumb = styled.span(switchThumbStyles), Switch = forwardRef(function(props, forwardedRef) {
|
|
4526
4486
|
const $ = c(26);
|
|
4527
|
-
let
|
|
4487
|
+
let checked, className, disabled, indeterminate, readOnly, restProps, style;
|
|
4528
4488
|
$[0] !== props ? ({
|
|
4529
4489
|
checked,
|
|
4530
4490
|
className,
|
|
@@ -4533,7 +4493,7 @@ const Root$d = styled.span(switchBaseStyles), Input$2 = styled.input(switchInput
|
|
|
4533
4493
|
readOnly,
|
|
4534
4494
|
style,
|
|
4535
4495
|
...restProps
|
|
4536
|
-
} = props, $[0] = props, $[1] =
|
|
4496
|
+
} = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = disabled, $[4] = indeterminate, $[5] = readOnly, $[6] = restProps, $[7] = style) : (checked = $[1], className = $[2], disabled = $[3], indeterminate = $[4], readOnly = $[5], restProps = $[6], style = $[7]);
|
|
4537
4497
|
const ref = useRef(null);
|
|
4538
4498
|
let t0;
|
|
4539
4499
|
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[8] = t0) : t0 = $[8], useImperativeHandle(forwardedRef, t0);
|
|
@@ -4543,7 +4503,7 @@ const Root$d = styled.span(switchBaseStyles), Input$2 = styled.input(switchInput
|
|
|
4543
4503
|
}, t2 = [indeterminate], $[9] = indeterminate, $[10] = t1, $[11] = t2) : (t1 = $[10], t2 = $[11]), useEffect(t1, t2);
|
|
4544
4504
|
const t3 = !disabled && readOnly ? "" : void 0, t4 = indeterminate !== !0 && checked, t5 = disabled || readOnly;
|
|
4545
4505
|
let t6;
|
|
4546
|
-
$[12] !==
|
|
4506
|
+
$[12] !== restProps || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Input$2, { "data-read-only": t3, ...restProps, checked: t4, disabled: t5, type: "checkbox", ref }), $[12] = restProps, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16];
|
|
4547
4507
|
let t7;
|
|
4548
4508
|
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsx(Track, {}), $[17] = t7) : t7 = $[17];
|
|
4549
4509
|
let t8;
|
|
@@ -4565,7 +4525,7 @@ const Root$c = styled.span(textInputRootStyle), InputRoot$1 = styled.span`
|
|
|
4565
4525
|
position: relative;
|
|
4566
4526
|
`, Input$1 = styled.textarea(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle), Presentation$1 = styled.div(responsiveRadiusStyle, textInputRepresentationStyle), TextArea = forwardRef(function(props, forwardedRef) {
|
|
4567
4527
|
const $ = c(29);
|
|
4568
|
-
let t0, t1, t2, t3, t4,
|
|
4528
|
+
let __unstable_disableFocusRing, customValidity, restProps, t0, t1, t2, t3, t4, weight;
|
|
4569
4529
|
$[0] !== props ? ({
|
|
4570
4530
|
border: t0,
|
|
4571
4531
|
customValidity,
|
|
@@ -4576,16 +4536,16 @@ const Root$c = styled.span(textInputRootStyle), InputRoot$1 = styled.span`
|
|
|
4576
4536
|
weight,
|
|
4577
4537
|
__unstable_disableFocusRing,
|
|
4578
4538
|
...restProps
|
|
4579
|
-
} = props, $[0] = props, $[1] =
|
|
4539
|
+
} = props, $[0] = props, $[1] = __unstable_disableFocusRing, $[2] = customValidity, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = weight) : (__unstable_disableFocusRing = $[1], customValidity = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], weight = $[9]);
|
|
4580
4540
|
const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSize2 = t2 === void 0 ? 2 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, ref = useRef(null), rootTheme = useRootTheme();
|
|
4581
4541
|
let t5;
|
|
4582
4542
|
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[10] = t5) : t5 = $[10], useImperativeHandle(forwardedRef, t5), useCustomValidity(ref, customValidity);
|
|
4583
4543
|
const t6 = rootTheme.scheme, t7 = rootTheme.tone, t8 = useArrayProp(fontSize2), t9 = useArrayProp(padding), t10 = rootTheme.scheme, t11 = useArrayProp(0);
|
|
4584
4544
|
let t12;
|
|
4585
|
-
$[11] !==
|
|
4545
|
+
$[11] !== disabled || $[12] !== restProps || $[13] !== rootTheme.scheme || $[14] !== rootTheme.tone || $[15] !== t11 || $[16] !== t8 || $[17] !== t9 || $[18] !== weight ? (t12 = /* @__PURE__ */ jsx(Input$1, { "data-as": "textarea", "data-scheme": t6, "data-tone": t7, ...restProps, $fontSize: t8, $padding: t9, $scheme: t10, $space: t11, $tone: rootTheme.tone, $weight: weight, disabled, ref }), $[11] = disabled, $[12] = restProps, $[13] = rootTheme.scheme, $[14] = rootTheme.tone, $[15] = t11, $[16] = t8, $[17] = t9, $[18] = weight, $[19] = t12) : t12 = $[19];
|
|
4586
4546
|
const t13 = useArrayProp(radius), t14 = border2 ? "" : void 0;
|
|
4587
4547
|
let t15;
|
|
4588
|
-
$[20] !==
|
|
4548
|
+
$[20] !== __unstable_disableFocusRing || $[21] !== rootTheme.scheme || $[22] !== rootTheme.tone || $[23] !== t13 || $[24] !== t14 ? (t15 = /* @__PURE__ */ jsx(Presentation$1, { $radius: t13, $unstableDisableFocusRing: __unstable_disableFocusRing, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": t14, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone }), $[20] = __unstable_disableFocusRing, $[21] = rootTheme.scheme, $[22] = rootTheme.tone, $[23] = t13, $[24] = t14, $[25] = t15) : t15 = $[25];
|
|
4589
4549
|
let t16;
|
|
4590
4550
|
return $[26] !== t12 || $[27] !== t15 ? (t16 = /* @__PURE__ */ jsx(Root$c, { "data-ui": "TextArea", children: /* @__PURE__ */ jsxs(InputRoot$1, { children: [
|
|
4591
4551
|
t12,
|
|
@@ -4640,8 +4600,8 @@ const CLEAR_BUTTON_BOX_STYLE = {
|
|
|
4640
4600
|
display: "block"
|
|
4641
4601
|
}
|
|
4642
4602
|
}), TextInput = forwardRef(function(props, forwardedRef) {
|
|
4643
|
-
const $ = c(
|
|
4644
|
-
let
|
|
4603
|
+
const $ = c(84);
|
|
4604
|
+
let IconComponent, IconRightComponent, __unstable_disableFocusRing, clearButton, customValidity, onClear, prefix, readOnly, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, weight;
|
|
4645
4605
|
$[0] !== props ? ({
|
|
4646
4606
|
__unstable_disableFocusRing,
|
|
4647
4607
|
border: t0,
|
|
@@ -4661,11 +4621,11 @@ const CLEAR_BUTTON_BOX_STYLE = {
|
|
|
4661
4621
|
type: t6,
|
|
4662
4622
|
weight,
|
|
4663
4623
|
...restProps
|
|
4664
|
-
} = props, $[0] = props, $[1] =
|
|
4624
|
+
} = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = clearButton, $[5] = customValidity, $[6] = onClear, $[7] = prefix, $[8] = readOnly, $[9] = restProps, $[10] = suffix, $[11] = t0, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5, $[17] = t6, $[18] = weight) : (IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], clearButton = $[4], customValidity = $[5], onClear = $[6], prefix = $[7], readOnly = $[8], restProps = $[9], suffix = $[10], t0 = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16], t6 = $[17], weight = $[18]);
|
|
4665
4625
|
const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = useRef(null), rootTheme = useRootTheme(), fontSize2 = useArrayProp(fontSizeProp), padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
|
|
4666
4626
|
let t7;
|
|
4667
4627
|
$[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
|
|
4668
|
-
const handleClearMouseDown = _temp$
|
|
4628
|
+
const handleClearMouseDown = _temp$3;
|
|
4669
4629
|
let t8;
|
|
4670
4630
|
$[20] !== onClear ? (t8 = (event_0) => {
|
|
4671
4631
|
event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
|
|
@@ -4687,55 +4647,51 @@ const CLEAR_BUTTON_BOX_STYLE = {
|
|
|
4687
4647
|
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
4688
4648
|
] }) }), $[29] = $hasClearButton, $[30] = IconRightComponent, $[31] = fontSize2, $[32] = padding, $[33] = t14) : t14 = $[33];
|
|
4689
4649
|
let t15;
|
|
4690
|
-
$[34] !== $hasPrefix || $[35] !==
|
|
4650
|
+
$[34] !== $hasPrefix || $[35] !== $hasSuffix || $[36] !== __unstable_disableFocusRing || $[37] !== radius || $[38] !== rootTheme.scheme || $[39] !== rootTheme.tone || $[40] !== t12 || $[41] !== t13 || $[42] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Presentation, { $hasPrefix, $unstableDisableFocusRing: __unstable_disableFocusRing, $hasSuffix, $radius: radius, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": t12, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, children: [
|
|
4691
4651
|
t13,
|
|
4692
4652
|
t14
|
|
4693
|
-
] }), $[34] = $hasPrefix, $[35] =
|
|
4653
|
+
] }), $[34] = $hasPrefix, $[35] = $hasSuffix, $[36] = __unstable_disableFocusRing, $[37] = radius, $[38] = rootTheme.scheme, $[39] = rootTheme.tone, $[40] = t12, $[41] = t13, $[42] = t14, $[43] = t15) : t15 = $[43], t11 = t15;
|
|
4694
4654
|
const presentationNode = t11;
|
|
4695
4655
|
let t16, t17;
|
|
4696
|
-
|
|
4697
|
-
let t182;
|
|
4698
|
-
$[46] === Symbol.for("react.memo_cache_sentinel") ? (t182 = (v) => v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2, $[46] = t182) : t182 = $[46], t17 = padding.map(t182), $[44] = padding, $[45] = t17;
|
|
4699
|
-
} else
|
|
4700
|
-
t17 = $[45];
|
|
4701
|
-
t16 = t17;
|
|
4656
|
+
$[44] !== padding ? (t17 = padding.map(_temp2$1), $[44] = padding, $[45] = t17) : t17 = $[45], t16 = t17;
|
|
4702
4657
|
const clearButtonBoxPadding = t16;
|
|
4703
4658
|
let t18, t19;
|
|
4704
|
-
|
|
4705
|
-
let t202;
|
|
4706
|
-
$[49] === Symbol.for("react.memo_cache_sentinel") ? (t202 = (v_0) => v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1, $[49] = t202) : t202 = $[49], t19 = padding.map(t202), $[47] = padding, $[48] = t19;
|
|
4707
|
-
} else
|
|
4708
|
-
t19 = $[48];
|
|
4709
|
-
t18 = t19;
|
|
4659
|
+
$[46] !== padding ? (t19 = padding.map(_temp3), $[46] = padding, $[47] = t19) : t19 = $[47], t18 = t19;
|
|
4710
4660
|
const clearButtonPadding = t18;
|
|
4711
4661
|
let t20;
|
|
4712
4662
|
t20 = typeof clearButton == "object" ? clearButton : EMPTY_RECORD;
|
|
4713
4663
|
const clearButtonProps = t20;
|
|
4714
4664
|
let t21, t22;
|
|
4715
|
-
$[
|
|
4665
|
+
$[48] !== clearButton || $[49] !== clearButtonBoxPadding || $[50] !== clearButtonPadding || $[51] !== clearButtonProps || $[52] !== customValidity || $[53] !== disabled || $[54] !== fontSize2 || $[55] !== handleClearClick || $[56] !== radius || $[57] !== readOnly ? (t22 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(RightCard, { forwardedAs: "span", padding: clearButtonBoxPadding, style: CLEAR_BUTTON_BOX_STYLE, tone: customValidity ? "critical" : "inherit", children: /* @__PURE__ */ jsx(TextInputClearButton, { "aria-label": "Clear", "data-qa": "clear-button", fontSize: fontSize2, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[48] = clearButton, $[49] = clearButtonBoxPadding, $[50] = clearButtonPadding, $[51] = clearButtonProps, $[52] = customValidity, $[53] = disabled, $[54] = fontSize2, $[55] = handleClearClick, $[56] = radius, $[57] = readOnly, $[58] = t22) : t22 = $[58], t21 = t22;
|
|
4716
4666
|
const clearButtonNode = t21;
|
|
4717
4667
|
let t23, t24;
|
|
4718
|
-
$[
|
|
4668
|
+
$[59] !== radius || $[60] !== suffix ? (t24 = suffix && /* @__PURE__ */ jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[59] = radius, $[60] = suffix, $[61] = t24) : t24 = $[61], t23 = t24;
|
|
4719
4669
|
const suffixNode = t23, t25 = $hasIconRight || $hasClearButton;
|
|
4720
4670
|
let t26;
|
|
4721
|
-
$[
|
|
4671
|
+
$[62] !== $hasIcon || $[63] !== disabled || $[64] !== fontSize2 || $[65] !== padding || $[66] !== readOnly || $[67] !== restProps || $[68] !== rootTheme.scheme || $[69] !== rootTheme.tone || $[70] !== space || $[71] !== t25 || $[72] !== type || $[73] !== weight ? (t26 = /* @__PURE__ */ jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: t25, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }), $[62] = $hasIcon, $[63] = disabled, $[64] = fontSize2, $[65] = padding, $[66] = readOnly, $[67] = restProps, $[68] = rootTheme.scheme, $[69] = rootTheme.tone, $[70] = space, $[71] = t25, $[72] = type, $[73] = weight, $[74] = t26) : t26 = $[74];
|
|
4722
4672
|
let t27;
|
|
4723
|
-
$[
|
|
4673
|
+
$[75] !== clearButtonNode || $[76] !== presentationNode || $[77] !== t26 ? (t27 = /* @__PURE__ */ jsxs(InputRoot, { children: [
|
|
4724
4674
|
t26,
|
|
4725
4675
|
presentationNode,
|
|
4726
4676
|
clearButtonNode
|
|
4727
|
-
] }), $[
|
|
4677
|
+
] }), $[75] = clearButtonNode, $[76] = presentationNode, $[77] = t26, $[78] = t27) : t27 = $[78];
|
|
4728
4678
|
let t28;
|
|
4729
|
-
return $[
|
|
4679
|
+
return $[79] !== prefixNode || $[80] !== rootTheme.tone || $[81] !== suffixNode || $[82] !== t27 ? (t28 = /* @__PURE__ */ jsxs(Root$b, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
|
|
4730
4680
|
prefixNode,
|
|
4731
4681
|
t27,
|
|
4732
4682
|
suffixNode
|
|
4733
|
-
] }), $[
|
|
4683
|
+
] }), $[79] = prefixNode, $[80] = rootTheme.tone, $[81] = suffixNode, $[82] = t27, $[83] = t28) : t28 = $[83], t28;
|
|
4734
4684
|
});
|
|
4735
4685
|
TextInput.displayName = "ForwardRef(TextInput)";
|
|
4736
|
-
function _temp$
|
|
4686
|
+
function _temp$3(event) {
|
|
4737
4687
|
event.preventDefault(), event.stopPropagation();
|
|
4738
4688
|
}
|
|
4689
|
+
function _temp2$1(v) {
|
|
4690
|
+
return v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2;
|
|
4691
|
+
}
|
|
4692
|
+
function _temp3(v_0) {
|
|
4693
|
+
return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1;
|
|
4694
|
+
}
|
|
4739
4695
|
function useDelayedState(initialState) {
|
|
4740
4696
|
const $ = c(3), [state, setState] = useState(initialState), delayedAction = useRef();
|
|
4741
4697
|
let t0;
|
|
@@ -4771,7 +4727,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
|
|
|
4771
4727
|
}
|
|
4772
4728
|
`, TooltipCard = memo(forwardRef(function(props, ref) {
|
|
4773
4729
|
const $ = c(42);
|
|
4774
|
-
let animate,
|
|
4730
|
+
let animate, arrow2, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style;
|
|
4775
4731
|
$[0] !== props ? ({
|
|
4776
4732
|
animate,
|
|
4777
4733
|
arrow: arrow2,
|
|
@@ -4788,16 +4744,16 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
|
|
|
4788
4744
|
shadow,
|
|
4789
4745
|
style,
|
|
4790
4746
|
...restProps
|
|
4791
|
-
} = props, $[0] = props, $[1] = animate, $[2] =
|
|
4747
|
+
} = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = restProps, $[13] = scheme, $[14] = shadow, $[15] = style) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], restProps = $[12], scheme = $[13], shadow = $[14], style = $[15]);
|
|
4792
4748
|
let t0;
|
|
4793
4749
|
const t1 = animate ? "transform" : void 0;
|
|
4794
4750
|
let t2;
|
|
4795
|
-
$[16] !== originX || $[17] !== originY || $[18] !==
|
|
4751
|
+
$[16] !== originX || $[17] !== originY || $[18] !== style || $[19] !== t1 ? (t2 = {
|
|
4796
4752
|
originX,
|
|
4797
4753
|
originY,
|
|
4798
4754
|
willChange: t1,
|
|
4799
4755
|
...style
|
|
4800
|
-
}, $[16] = originX, $[17] = originY, $[18] =
|
|
4756
|
+
}, $[16] = originX, $[17] = originY, $[18] = style, $[19] = t1, $[20] = t2) : t2 = $[20], t0 = t2;
|
|
4801
4757
|
const rootStyle2 = t0;
|
|
4802
4758
|
let t3;
|
|
4803
4759
|
const t4 = arrowX !== null ? arrowX : void 0, t5 = arrowY !== null ? arrowY : void 0;
|
|
@@ -4814,10 +4770,10 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
|
|
|
4814
4770
|
let t9;
|
|
4815
4771
|
$[26] !== arrow2 || $[27] !== arrowRef || $[28] !== arrowStyle ? (t9 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[26] = arrow2, $[27] = arrowRef, $[28] = arrowStyle, $[29] = t9) : t9 = $[29];
|
|
4816
4772
|
let t10;
|
|
4817
|
-
return $[30] !==
|
|
4773
|
+
return $[30] !== children || $[31] !== padding || $[32] !== placement || $[33] !== radius || $[34] !== ref || $[35] !== rootStyle2 || $[36] !== scheme || $[37] !== shadow || $[38] !== t7 || $[39] !== t8 || $[40] !== t9 ? (t10 = /* @__PURE__ */ jsxs(MotionCard, { "data-ui": "Tooltip__card", ...t7, "data-placement": placement, padding, radius, ref, scheme, shadow, style: rootStyle2, ...t8, children: [
|
|
4818
4774
|
children,
|
|
4819
4775
|
t9
|
|
4820
|
-
] }), $[30] =
|
|
4776
|
+
] }), $[30] = children, $[31] = padding, $[32] = placement, $[33] = radius, $[34] = ref, $[35] = rootStyle2, $[36] = scheme, $[37] = shadow, $[38] = t7, $[39] = t8, $[40] = t9, $[41] = t10) : t10 = $[41], t10;
|
|
4821
4777
|
}));
|
|
4822
4778
|
TooltipCard.displayName = "Memo(ForwardRef(TooltipCard))";
|
|
4823
4779
|
const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
|
|
@@ -4832,96 +4788,71 @@ function TooltipDelayGroupProvider(props) {
|
|
|
4832
4788
|
let t0;
|
|
4833
4789
|
const t1 = isGroupActive ? 1 : openDelay;
|
|
4834
4790
|
let t2;
|
|
4835
|
-
$[0] !==
|
|
4791
|
+
$[0] !== closeDelay || $[1] !== isGroupActive || $[2] !== openTooltipId || $[3] !== setIsGroupActive || $[4] !== setOpenTooltipId || $[5] !== t1 ? (t2 = {
|
|
4836
4792
|
isGroupActive,
|
|
4837
4793
|
setIsGroupActive,
|
|
4838
4794
|
openTooltipId,
|
|
4839
4795
|
setOpenTooltipId,
|
|
4840
4796
|
openDelay: t1,
|
|
4841
4797
|
closeDelay
|
|
4842
|
-
}, $[0] =
|
|
4798
|
+
}, $[0] = closeDelay, $[1] = isGroupActive, $[2] = openTooltipId, $[3] = setIsGroupActive, $[4] = setOpenTooltipId, $[5] = t1, $[6] = t2) : t2 = $[6], t0 = t2;
|
|
4843
4799
|
const value = t0;
|
|
4844
4800
|
let t3;
|
|
4845
|
-
return $[7] !==
|
|
4801
|
+
return $[7] !== children || $[8] !== value ? (t3 = /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, { value, children }), $[7] = children, $[8] = value, $[9] = t3) : t3 = $[9], t3;
|
|
4846
4802
|
}
|
|
4847
4803
|
TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
|
|
4848
4804
|
const Root$a = styled(Layer)`
|
|
4849
4805
|
pointer-events: none;
|
|
4850
4806
|
`, Tooltip = forwardRef(function(props, forwardedRef) {
|
|
4851
|
-
const
|
|
4807
|
+
const boundaryElementContext = useBoundaryElement(), {
|
|
4852
4808
|
layer
|
|
4853
|
-
} = useTheme_v2()
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
arrow: t1,
|
|
4858
|
-
boundaryElement: _boundaryElement,
|
|
4809
|
+
} = useTheme_v2(), {
|
|
4810
|
+
animate: _animate = !1,
|
|
4811
|
+
arrow: arrowProp = !1,
|
|
4812
|
+
boundaryElement = boundaryElementContext?.element,
|
|
4859
4813
|
children: childProp,
|
|
4860
4814
|
content,
|
|
4861
4815
|
disabled,
|
|
4862
|
-
fallbackPlacements:
|
|
4863
|
-
padding
|
|
4864
|
-
placement:
|
|
4816
|
+
fallbackPlacements: fallbackPlacementsProp = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"],
|
|
4817
|
+
padding = 2,
|
|
4818
|
+
placement: placementProp = "bottom",
|
|
4865
4819
|
portal: portalProp,
|
|
4866
|
-
radius
|
|
4820
|
+
radius = 2,
|
|
4867
4821
|
scheme,
|
|
4868
|
-
shadow
|
|
4869
|
-
zOffset
|
|
4822
|
+
shadow = 2,
|
|
4823
|
+
zOffset = layer.tooltip.zOffset,
|
|
4870
4824
|
delay,
|
|
4871
4825
|
...restProps
|
|
4872
|
-
} = props,
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
if ($[18] !== boundaryElement || $[19] !== fallbackPlacements || $[20] !== arrowProp || $[21] !== arrowElement || $[22] !== animate) {
|
|
4879
|
-
ret = [];
|
|
4880
|
-
const t82 = boundaryElement || void 0;
|
|
4881
|
-
let t92;
|
|
4882
|
-
$[24] !== t82 || $[25] !== fallbackPlacements ? (t92 = flip({
|
|
4883
|
-
boundary: t82,
|
|
4826
|
+
} = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
|
|
4827
|
+
useImperativeHandle(forwardedRef, () => ref.current);
|
|
4828
|
+
const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, middleware = useMemo(() => {
|
|
4829
|
+
const ret = [];
|
|
4830
|
+
return ret.push(flip({
|
|
4831
|
+
boundary: boundaryElement || void 0,
|
|
4884
4832
|
fallbackPlacements,
|
|
4885
4833
|
padding: DEFAULT_TOOLTIP_PADDING,
|
|
4886
|
-
rootBoundary
|
|
4887
|
-
})
|
|
4888
|
-
let t102;
|
|
4889
|
-
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t102 = offset({
|
|
4834
|
+
rootBoundary
|
|
4835
|
+
})), ret.push(offset({
|
|
4890
4836
|
mainAxis: DEFAULT_TOOLTIP_DISTANCE
|
|
4891
|
-
})
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
if ($[28] !== t112 ? (t122 = shift({
|
|
4895
|
-
boundary: t112,
|
|
4896
|
-
rootBoundary: "viewport",
|
|
4837
|
+
})), ret.push(shift({
|
|
4838
|
+
boundary: boundaryElement || void 0,
|
|
4839
|
+
rootBoundary,
|
|
4897
4840
|
padding: DEFAULT_TOOLTIP_PADDING
|
|
4898
|
-
}),
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
}), $[30] = arrowElement, $[31] = t132) : t132 = $[31], ret.push(t132);
|
|
4904
|
-
}
|
|
4905
|
-
animate && ret.push(origin), $[18] = boundaryElement, $[19] = fallbackPlacements, $[20] = arrowProp, $[21] = arrowElement, $[22] = animate, $[23] = ret;
|
|
4906
|
-
} else
|
|
4907
|
-
ret = $[23];
|
|
4908
|
-
t7 = ret;
|
|
4909
|
-
const middleware = t7;
|
|
4910
|
-
let t8;
|
|
4911
|
-
$[32] !== middleware || $[33] !== placementProp ? (t8 = {
|
|
4912
|
-
middleware,
|
|
4913
|
-
placement: placementProp,
|
|
4914
|
-
whileElementsMounted: autoUpdate
|
|
4915
|
-
}, $[32] = middleware, $[33] = placementProp, $[34] = t8) : t8 = $[34];
|
|
4916
|
-
const {
|
|
4841
|
+
})), arrowProp && ret.push(arrow({
|
|
4842
|
+
element: arrowRef,
|
|
4843
|
+
padding: DEFAULT_TOOLTIP_PADDING
|
|
4844
|
+
})), animate && ret.push(origin), ret;
|
|
4845
|
+
}, [animate, arrowProp, boundaryElement, fallbackPlacements]), {
|
|
4917
4846
|
floatingStyles,
|
|
4918
4847
|
placement,
|
|
4919
4848
|
middlewareData,
|
|
4920
4849
|
refs,
|
|
4921
4850
|
update
|
|
4922
|
-
} = useFloating(
|
|
4923
|
-
|
|
4924
|
-
|
|
4851
|
+
} = useFloating({
|
|
4852
|
+
middleware,
|
|
4853
|
+
placement: placementProp,
|
|
4854
|
+
whileElementsMounted: autoUpdate
|
|
4855
|
+
}), 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 = useTooltipDelayGroup(), showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, handleIsOpenChange = useCallback((open, immediate) => {
|
|
4925
4856
|
if (isInsideGroup)
|
|
4926
4857
|
if (open) {
|
|
4927
4858
|
const groupedOpenDelay = immediate ? 0 : openDelay;
|
|
@@ -4932,133 +4863,67 @@ const Root$a = styled(Layer)`
|
|
|
4932
4863
|
}
|
|
4933
4864
|
else
|
|
4934
4865
|
setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
|
|
4935
|
-
},
|
|
4936
|
-
const handleIsOpenChange = t9;
|
|
4937
|
-
let t10;
|
|
4938
|
-
$[42] !== handleIsOpenChange || $[43] !== childProp ? (t10 = (e) => {
|
|
4866
|
+
}, [isInsideGroup, delayGroupContext, openDelay, tooltipId, closeDelay, setIsOpen]), handleBlur = useCallback((e) => {
|
|
4939
4867
|
handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
|
|
4940
|
-
},
|
|
4941
|
-
const handleBlur = t10;
|
|
4942
|
-
let t11;
|
|
4943
|
-
$[45] !== handleIsOpenChange || $[46] !== childProp ? (t11 = (e_0) => {
|
|
4868
|
+
}, [childProp?.props, handleIsOpenChange]), handleClick = useCallback((e_0) => {
|
|
4944
4869
|
handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
|
|
4945
|
-
},
|
|
4946
|
-
const handleClick = t11;
|
|
4947
|
-
let t12;
|
|
4948
|
-
$[48] !== handleIsOpenChange || $[49] !== childProp ? (t12 = (e_1) => {
|
|
4870
|
+
}, [childProp?.props, handleIsOpenChange]), handleContextMenu = useCallback((e_1) => {
|
|
4949
4871
|
handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
|
|
4950
|
-
},
|
|
4951
|
-
const handleContextMenu = t12;
|
|
4952
|
-
let t13;
|
|
4953
|
-
$[51] !== handleIsOpenChange || $[52] !== childProp ? (t13 = (e_2) => {
|
|
4872
|
+
}, [childProp?.props, handleIsOpenChange]), handleFocus = useCallback((e_2) => {
|
|
4954
4873
|
handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
|
|
4955
|
-
},
|
|
4956
|
-
const handleFocus = t13;
|
|
4957
|
-
let t14;
|
|
4958
|
-
$[54] !== handleIsOpenChange || $[55] !== childProp ? (t14 = (e_3) => {
|
|
4874
|
+
}, [childProp?.props, handleIsOpenChange]), handleMouseEnter = useCallback((e_3) => {
|
|
4959
4875
|
handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
|
|
4960
|
-
},
|
|
4961
|
-
const handleMouseEnter = t14;
|
|
4962
|
-
let t15;
|
|
4963
|
-
$[57] !== handleIsOpenChange || $[58] !== childProp ? (t15 = (e_4) => {
|
|
4876
|
+
}, [childProp?.props, handleIsOpenChange]), handleMouseLeave = useCallback((e_4) => {
|
|
4964
4877
|
handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
|
|
4965
|
-
},
|
|
4966
|
-
|
|
4967
|
-
let t16;
|
|
4968
|
-
$[60] !== handleIsOpenChange || $[61] !== referenceElement || $[62] !== showTooltip ? (t16 = {
|
|
4878
|
+
}, [childProp?.props, handleIsOpenChange]);
|
|
4879
|
+
useCloseOnMouseLeave({
|
|
4969
4880
|
handleIsOpenChange,
|
|
4970
4881
|
referenceElement,
|
|
4971
4882
|
showTooltip
|
|
4972
|
-
},
|
|
4973
|
-
let t17, t18;
|
|
4974
|
-
$[64] !== disabled || $[65] !== showTooltip || $[66] !== handleIsOpenChange ? (t17 = () => {
|
|
4883
|
+
}), useEffect(() => {
|
|
4975
4884
|
disabled && showTooltip && handleIsOpenChange(!1);
|
|
4976
|
-
},
|
|
4977
|
-
let t19, t20;
|
|
4978
|
-
$[69] !== content || $[70] !== showTooltip || $[71] !== handleIsOpenChange ? (t19 = () => {
|
|
4885
|
+
}, [disabled, handleIsOpenChange, showTooltip]), useEffect(() => {
|
|
4979
4886
|
!content && showTooltip && handleIsOpenChange(!1);
|
|
4980
|
-
},
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
let t23, t24;
|
|
4984
|
-
$[78] !== showTooltip || $[79] !== handleIsOpenChange ? (t23 = () => {
|
|
4985
|
-
if (!showTooltip)
|
|
4986
|
-
return;
|
|
4987
|
-
const handleWindowKeyDown = function(event) {
|
|
4887
|
+
}, [content, handleIsOpenChange, showTooltip]), useEffect(() => refs.setReference(referenceElement), [referenceElement, refs]), useEffect(() => {
|
|
4888
|
+
if (!showTooltip) return;
|
|
4889
|
+
function handleWindowKeyDown(event) {
|
|
4988
4890
|
event.key === "Escape" && handleIsOpenChange(!1, !0);
|
|
4989
|
-
}
|
|
4891
|
+
}
|
|
4990
4892
|
return window.addEventListener("keydown", handleWindowKeyDown), () => {
|
|
4991
4893
|
window.removeEventListener("keydown", handleWindowKeyDown);
|
|
4992
4894
|
};
|
|
4993
|
-
},
|
|
4994
|
-
let t25, t26;
|
|
4995
|
-
$[82] !== boundaryElement || $[83] !== portalElement ? (t25 = () => {
|
|
4895
|
+
}, [handleIsOpenChange, showTooltip]), useLayoutEffect(() => {
|
|
4996
4896
|
const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
|
|
4997
4897
|
setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
|
|
4998
|
-
},
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
}, $[86] = update, $[87] = t27) : t27 = $[87];
|
|
5003
|
-
const setArrow = t27;
|
|
5004
|
-
let t28;
|
|
5005
|
-
$[88] !== refs ? (t28 = (node) => {
|
|
4898
|
+
}, [boundaryElement, portalElement]);
|
|
4899
|
+
const setArrow = useCallback((arrowEl) => {
|
|
4900
|
+
arrowRef.current = arrowEl, update();
|
|
4901
|
+
}, [update]), setFloating = useCallback((node) => {
|
|
5006
4902
|
ref.current = node, refs.setFloating(node);
|
|
5007
|
-
},
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
let t342;
|
|
5020
|
-
$[95] !== handleBlur || $[96] !== handleFocus || $[97] !== handleMouseEnter || $[98] !== handleMouseLeave || $[99] !== handleClick || $[100] !== handleContextMenu || $[101] !== childProp ? (t342 = cloneElement(childProp, {
|
|
5021
|
-
onBlur: handleBlur,
|
|
5022
|
-
onFocus: handleFocus,
|
|
5023
|
-
onMouseEnter: handleMouseEnter,
|
|
5024
|
-
onMouseLeave: handleMouseLeave,
|
|
5025
|
-
onClick: handleClick,
|
|
5026
|
-
onContextMenu: handleContextMenu,
|
|
5027
|
-
ref: setChildElement
|
|
5028
|
-
}), $[95] = handleBlur, $[96] = handleFocus, $[97] = handleMouseEnter, $[98] = handleMouseLeave, $[99] = handleClick, $[100] = handleContextMenu, $[101] = childProp, $[102] = t342) : t342 = $[102], t33 = t342;
|
|
5029
|
-
}
|
|
5030
|
-
const child = t33;
|
|
5031
|
-
let t34, t35;
|
|
5032
|
-
if ($[103] !== child ? (t34 = () => {
|
|
4903
|
+
}, [refs]), childRef = useRef(null);
|
|
4904
|
+
useImperativeHandle(childProp?.ref, () => childRef.current);
|
|
4905
|
+
const child = useMemo(() => childProp ? cloneElement(childProp, {
|
|
4906
|
+
onBlur: handleBlur,
|
|
4907
|
+
onFocus: handleFocus,
|
|
4908
|
+
onMouseEnter: handleMouseEnter,
|
|
4909
|
+
onMouseLeave: handleMouseLeave,
|
|
4910
|
+
onClick: handleClick,
|
|
4911
|
+
onContextMenu: handleContextMenu,
|
|
4912
|
+
ref: childRef
|
|
4913
|
+
}) : null, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave]);
|
|
4914
|
+
if (useEffect(() => {
|
|
5033
4915
|
if (child)
|
|
5034
4916
|
return setReferenceElement(childRef.current), () => setReferenceElement(null);
|
|
5035
|
-
},
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
}
|
|
5039
|
-
if (disabled)
|
|
5040
|
-
return child;
|
|
5041
|
-
const t36 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0;
|
|
5042
|
-
let t37;
|
|
5043
|
-
$[107] !== floatingStyles || $[108] !== t36 ? (t37 = {
|
|
4917
|
+
}, [child]), !child) return /* @__PURE__ */ jsx(Fragment, {});
|
|
4918
|
+
if (disabled) return child;
|
|
4919
|
+
const tooltip = /* @__PURE__ */ jsx(Root$a, { "data-ui": "Tooltip", ...restProps, ref: setFloating, style: {
|
|
5044
4920
|
...floatingStyles,
|
|
5045
|
-
maxWidth:
|
|
5046
|
-
},
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
let t39;
|
|
5050
|
-
$[126] !== restProps || $[127] !== setFloating || $[128] !== t37 || $[129] !== zOffset || $[130] !== t38 ? (t39 = /* @__PURE__ */ jsx(Root$a, { "data-ui": "Tooltip", ...restProps, ref: setFloating, style: t37, zOffset, children: t38 }), $[126] = restProps, $[127] = setFloating, $[128] = t37, $[129] = zOffset, $[130] = t38, $[131] = t39) : t39 = $[131];
|
|
5051
|
-
const tooltip = t39;
|
|
5052
|
-
let t40;
|
|
5053
|
-
$[132] !== showTooltip || $[133] !== portalProp || $[134] !== tooltip ? (t40 = showTooltip && (portalProp ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip), $[132] = showTooltip, $[133] = portalProp, $[134] = tooltip, $[135] = t40) : t40 = $[135];
|
|
5054
|
-
const children = t40;
|
|
5055
|
-
let t41;
|
|
5056
|
-
$[136] !== animate || $[137] !== children ? (t41 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[136] = animate, $[137] = children, $[138] = t41) : t41 = $[138];
|
|
5057
|
-
let t42;
|
|
5058
|
-
return $[139] !== t41 || $[140] !== child ? (t42 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5059
|
-
t41,
|
|
4921
|
+
maxWidth: tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0
|
|
4922
|
+
}, zOffset, children: /* @__PURE__ */ jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, children: content }) }), children = showTooltip && (portalProp ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip);
|
|
4923
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4924
|
+
animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
|
|
5060
4925
|
child
|
|
5061
|
-
] })
|
|
4926
|
+
] });
|
|
5062
4927
|
});
|
|
5063
4928
|
Tooltip.displayName = "ForwardRef(Tooltip)";
|
|
5064
4929
|
function useCloseOnMouseLeave(t0) {
|
|
@@ -5068,24 +4933,19 @@ function useCloseOnMouseLeave(t0) {
|
|
|
5068
4933
|
showTooltip
|
|
5069
4934
|
} = t0;
|
|
5070
4935
|
let t1;
|
|
5071
|
-
$[0] !==
|
|
4936
|
+
$[0] !== handleIsOpenChange || $[1] !== referenceElement ? (t1 = (target, teardown) => {
|
|
5072
4937
|
referenceElement && (referenceElement === target || target instanceof Node && referenceElement.contains(target) || (handleIsOpenChange(!1), teardown()));
|
|
5073
|
-
}, $[0] =
|
|
4938
|
+
}, $[0] = handleIsOpenChange, $[1] = referenceElement, $[2] = t1) : t1 = $[2];
|
|
5074
4939
|
const onMouseMove = useEffectEvent(t1);
|
|
5075
4940
|
let t2, t3;
|
|
5076
|
-
$[3] !==
|
|
4941
|
+
$[3] !== onMouseMove || $[4] !== showTooltip ? (t2 = () => {
|
|
5077
4942
|
if (!showTooltip)
|
|
5078
4943
|
return;
|
|
5079
4944
|
const handleMouseMove = (event) => {
|
|
5080
4945
|
onMouseMove(event.target, () => window.removeEventListener("mousemove", handleMouseMove));
|
|
5081
4946
|
};
|
|
5082
4947
|
return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
|
|
5083
|
-
}, t3 = [onMouseMove, showTooltip], $[3] =
|
|
5084
|
-
}
|
|
5085
|
-
function getElementRef(element) {
|
|
5086
|
-
if (!element) return null;
|
|
5087
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
5088
|
-
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);
|
|
4948
|
+
}, t3 = [onMouseMove, showTooltip], $[3] = onMouseMove, $[4] = showTooltip, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
|
|
5089
4949
|
}
|
|
5090
4950
|
const Root$9 = styled.div`
|
|
5091
4951
|
line-height: 0;
|
|
@@ -5127,7 +4987,7 @@ function AutocompleteOption(props) {
|
|
|
5127
4987
|
}, $[3] = handleClick, $[4] = t1) : t1 = $[4];
|
|
5128
4988
|
const handleKeyDown = t1;
|
|
5129
4989
|
let t2;
|
|
5130
|
-
return $[5] !==
|
|
4990
|
+
return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children }), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
|
|
5131
4991
|
}
|
|
5132
4992
|
function autocompleteReducer(state, msg2) {
|
|
5133
4993
|
return msg2.type === "input/change" ? {
|
|
@@ -5169,17 +5029,15 @@ function autocompleteReducer(state, msg2) {
|
|
|
5169
5029
|
} : state;
|
|
5170
5030
|
}
|
|
5171
5031
|
const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = forwardRef(function(props, forwardedRef) {
|
|
5172
|
-
const
|
|
5173
|
-
|
|
5174
|
-
$[0] !== props ? ({
|
|
5175
|
-
border: t0,
|
|
5032
|
+
const {
|
|
5033
|
+
border: border2 = !0,
|
|
5176
5034
|
customValidity,
|
|
5177
5035
|
disabled,
|
|
5178
5036
|
filterOption: filterOptionProp,
|
|
5179
|
-
fontSize:
|
|
5037
|
+
fontSize: fontSize2 = 2,
|
|
5180
5038
|
icon,
|
|
5181
5039
|
id,
|
|
5182
|
-
listBox
|
|
5040
|
+
listBox = EMPTY_RECORD,
|
|
5183
5041
|
loading,
|
|
5184
5042
|
onBlur,
|
|
5185
5043
|
onChange,
|
|
@@ -5189,63 +5047,39 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
5189
5047
|
openButton,
|
|
5190
5048
|
openOnFocus,
|
|
5191
5049
|
options: optionsProp,
|
|
5192
|
-
padding:
|
|
5193
|
-
popover
|
|
5050
|
+
padding: paddingProp = 3,
|
|
5051
|
+
popover = EMPTY_RECORD,
|
|
5194
5052
|
prefix,
|
|
5195
|
-
radius
|
|
5053
|
+
radius = 2,
|
|
5196
5054
|
readOnly,
|
|
5197
5055
|
relatedElements,
|
|
5198
5056
|
renderOption: renderOptionProp,
|
|
5199
5057
|
renderPopover,
|
|
5200
|
-
renderValue
|
|
5058
|
+
renderValue = DEFAULT_RENDER_VALUE,
|
|
5201
5059
|
suffix,
|
|
5202
5060
|
value: valueProp,
|
|
5203
5061
|
...restProps
|
|
5204
|
-
} = props,
|
|
5205
|
-
|
|
5206
|
-
let t9;
|
|
5207
|
-
$[30] !== t7 || $[31] !== t8 ? (t9 = {
|
|
5208
|
-
activeValue: t7,
|
|
5062
|
+
} = props, [state, dispatch] = useReducer(autocompleteReducer, {
|
|
5063
|
+
activeValue: valueProp || null,
|
|
5209
5064
|
focused: !1,
|
|
5210
5065
|
listFocused: !1,
|
|
5211
5066
|
query: null,
|
|
5212
|
-
value:
|
|
5213
|
-
},
|
|
5214
|
-
const [state, dispatch] = useReducer(autocompleteReducer, t9), {
|
|
5067
|
+
value: valueProp || null
|
|
5068
|
+
}), {
|
|
5215
5069
|
activeValue,
|
|
5216
5070
|
focused,
|
|
5217
5071
|
listFocused,
|
|
5218
5072
|
query,
|
|
5219
5073
|
value
|
|
5220
|
-
} = state
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
} = t112;
|
|
5226
|
-
return /* @__PURE__ */ jsx(Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", children: value_0 }) });
|
|
5227
|
-
}, $[33] = paddingProp, $[34] = fontSize2, $[35] = t10) : t10 = $[35];
|
|
5228
|
-
const renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t10, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, [rootElement, setRootElement] = useState(null), [resultsPopoverElement, setResultsPopoverElement] = useState(null), [inputElement, setInputElement] = useState(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), [popoverMouseWithin, setPopoverMouseWithin] = useState(!1);
|
|
5229
|
-
let t11, t12;
|
|
5230
|
-
$[36] !== inputElement ? (t11 = () => inputElement, t12 = [inputElement], $[36] = inputElement, $[37] = t11, $[38] = t12) : (t11 = $[37], t12 = $[38]), useImperativeHandle(forwardedRef, t11, t12);
|
|
5231
|
-
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp);
|
|
5232
|
-
let t13, t14;
|
|
5233
|
-
$[39] !== value || $[40] !== options ? (t14 = value !== null ? options.find((o) => o.value === value) : void 0, $[39] = value, $[40] = options, $[41] = t14) : t14 = $[41], t13 = t14;
|
|
5234
|
-
const currentOption = t13;
|
|
5235
|
-
let t15, t16;
|
|
5236
|
-
if ($[42] !== query || $[43] !== filterOption || $[44] !== options) {
|
|
5237
|
-
let t172;
|
|
5238
|
-
$[46] !== query || $[47] !== filterOption ? (t172 = (option) => query ? filterOption(query, option) : !0, $[46] = query, $[47] = filterOption, $[48] = t172) : t172 = $[48], t16 = options.filter(t172), $[42] = query, $[43] = filterOption, $[44] = options, $[45] = t16;
|
|
5239
|
-
} else
|
|
5240
|
-
t16 = $[45];
|
|
5241
|
-
t15 = t16;
|
|
5242
|
-
const filteredOptions = t15, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
|
|
5243
|
-
let t17;
|
|
5244
|
-
$[49] !== popoverMouseWithin || $[50] !== relatedElements || $[51] !== rootElement || $[52] !== resultsPopoverElement || $[53] !== onQueryChange || $[54] !== onBlur ? (t17 = (event) => {
|
|
5074
|
+
} = state, defaultRenderOption = useCallback(({
|
|
5075
|
+
value: value_0
|
|
5076
|
+
}) => /* @__PURE__ */ jsx(Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", children: value_0 }) }), [fontSize2, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
|
|
5077
|
+
useImperativeHandle(forwardedRef, () => inputElementRef.current);
|
|
5078
|
+
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = useCallback((event) => {
|
|
5245
5079
|
setTimeout(() => {
|
|
5246
|
-
if (
|
|
5080
|
+
if (popoverMouseWithinRef.current)
|
|
5247
5081
|
return;
|
|
5248
|
-
const elements = (relatedElements || []).concat(
|
|
5082
|
+
const elements = (relatedElements || []).concat(rootElementRef.current ? [rootElementRef.current] : [], resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []);
|
|
5249
5083
|
let focusInside = !1;
|
|
5250
5084
|
if (document.activeElement) {
|
|
5251
5085
|
for (const e of elements)
|
|
@@ -5256,32 +5090,22 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
5256
5090
|
}
|
|
5257
5091
|
focusInside === !1 && (dispatch({
|
|
5258
5092
|
type: "root/blur"
|
|
5259
|
-
}),
|
|
5093
|
+
}), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
|
|
5260
5094
|
}, 0);
|
|
5261
|
-
},
|
|
5262
|
-
const handleRootBlur = t17;
|
|
5263
|
-
let t18;
|
|
5264
|
-
$[56] === Symbol.for("react.memo_cache_sentinel") ? (t18 = (event_0) => {
|
|
5095
|
+
}, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_0) => {
|
|
5265
5096
|
const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
|
|
5266
5097
|
listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
|
|
5267
5098
|
type: "root/setListFocused",
|
|
5268
5099
|
listFocused: listFocused_0
|
|
5269
5100
|
}));
|
|
5270
|
-
},
|
|
5271
|
-
const handleRootFocus = t18;
|
|
5272
|
-
let t19;
|
|
5273
|
-
$[57] !== onSelect || $[58] !== onChange || $[59] !== onQueryChange || $[60] !== inputElement ? (t19 = (v) => {
|
|
5101
|
+
}, []), handleOptionSelect = useCallback((v) => {
|
|
5274
5102
|
dispatch({
|
|
5275
5103
|
type: "value/change",
|
|
5276
5104
|
value: v
|
|
5277
|
-
}),
|
|
5278
|
-
},
|
|
5279
|
-
const handleOptionSelect = t19;
|
|
5280
|
-
let t20;
|
|
5281
|
-
$[62] !== filteredOptionsLen || $[63] !== filteredOptions || $[64] !== activeValue || $[65] !== onQueryChange || $[66] !== inputElement ? (t20 = (event_1) => {
|
|
5105
|
+
}), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
5106
|
+
}, [onChange, onSelect, onQueryChange]), handleRootKeyDown = useCallback((event_1) => {
|
|
5282
5107
|
if (event_1.key === "ArrowDown") {
|
|
5283
|
-
if (event_1.preventDefault(), !filteredOptionsLen)
|
|
5284
|
-
return;
|
|
5108
|
+
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
5285
5109
|
const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
|
|
5286
5110
|
nextActiveOption && dispatch({
|
|
5287
5111
|
type: "root/setActiveValue",
|
|
@@ -5291,8 +5115,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
5291
5115
|
return;
|
|
5292
5116
|
}
|
|
5293
5117
|
if (event_1.key === "ArrowUp") {
|
|
5294
|
-
if (event_1.preventDefault(), !filteredOptionsLen)
|
|
5295
|
-
return;
|
|
5118
|
+
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
5296
5119
|
const activeOption_0 = filteredOptions.find((o_1) => o_1.value === activeValue), activeIndex_0 = activeOption_0 ? filteredOptions.indexOf(activeOption_0) : -1, nextActiveOption_0 = filteredOptions[activeIndex_0 === -1 ? filteredOptionsLen - 1 : (filteredOptionsLen + activeIndex_0 - 1) % filteredOptionsLen];
|
|
5297
5120
|
nextActiveOption_0 && dispatch({
|
|
5298
5121
|
type: "root/setActiveValue",
|
|
@@ -5304,66 +5127,43 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
5304
5127
|
if (event_1.key === "Escape") {
|
|
5305
5128
|
dispatch({
|
|
5306
5129
|
type: "root/escape"
|
|
5307
|
-
}),
|
|
5130
|
+
}), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
5308
5131
|
return;
|
|
5309
5132
|
}
|
|
5310
5133
|
const target = event_1.target, listEl = listBoxElementRef.current;
|
|
5311
5134
|
if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)) {
|
|
5312
|
-
|
|
5135
|
+
inputElementRef.current?.focus();
|
|
5313
5136
|
return;
|
|
5314
5137
|
}
|
|
5315
|
-
},
|
|
5316
|
-
const handleRootKeyDown = t20;
|
|
5317
|
-
let t21;
|
|
5318
|
-
$[68] !== onQueryChange ? (t21 = (event_2) => {
|
|
5138
|
+
}, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = useCallback((event_2) => {
|
|
5319
5139
|
const nextQuery = event_2.currentTarget.value;
|
|
5320
5140
|
dispatch({
|
|
5321
5141
|
type: "input/change",
|
|
5322
5142
|
query: nextQuery
|
|
5323
5143
|
}), onQueryChange && onQueryChange(nextQuery);
|
|
5324
|
-
},
|
|
5325
|
-
const handleInputChange = t21;
|
|
5326
|
-
let t22;
|
|
5327
|
-
$[70] !== value || $[71] !== renderValue || $[72] !== currentOption ? (t22 = () => {
|
|
5144
|
+
}, [onQueryChange]), dispatchOpen = useCallback(() => {
|
|
5328
5145
|
dispatch({
|
|
5329
5146
|
type: "root/open",
|
|
5330
5147
|
query: value ? renderValue(value, currentOption) : ""
|
|
5331
5148
|
});
|
|
5332
|
-
},
|
|
5333
|
-
const dispatchOpen = t22;
|
|
5334
|
-
let t23;
|
|
5335
|
-
$[74] !== focused || $[75] !== onFocus || $[76] !== openOnFocus || $[77] !== dispatchOpen ? (t23 = (event_3) => {
|
|
5149
|
+
}, [currentOption, renderValue, value]), handleInputFocus = useCallback((event_3) => {
|
|
5336
5150
|
focused || (dispatch({
|
|
5337
5151
|
type: "input/focus"
|
|
5338
5152
|
}), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
|
|
5339
|
-
},
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
}, $[79] = t24) : t24 = $[79];
|
|
5345
|
-
const handlePopoverMouseEnter = t24;
|
|
5346
|
-
let t25;
|
|
5347
|
-
$[80] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
|
|
5348
|
-
setPopoverMouseWithin(!1);
|
|
5349
|
-
}, $[80] = t25) : t25 = $[80];
|
|
5350
|
-
const handlePopoverMouseLeave = t25;
|
|
5351
|
-
let t26;
|
|
5352
|
-
$[81] !== onChange || $[82] !== onQueryChange || $[83] !== inputElement ? (t26 = () => {
|
|
5153
|
+
}, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = useCallback(() => {
|
|
5154
|
+
popoverMouseWithinRef.current = !0;
|
|
5155
|
+
}, []), handlePopoverMouseLeave = useCallback(() => {
|
|
5156
|
+
popoverMouseWithinRef.current = !1;
|
|
5157
|
+
}, []), handleClearButtonClick = useCallback(() => {
|
|
5353
5158
|
dispatch({
|
|
5354
5159
|
type: "root/clear"
|
|
5355
|
-
}), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null),
|
|
5356
|
-
},
|
|
5357
|
-
const handleClearButtonClick = t26;
|
|
5358
|
-
let t27;
|
|
5359
|
-
$[85] === Symbol.for("react.memo_cache_sentinel") ? (t27 = () => {
|
|
5160
|
+
}), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
5161
|
+
}, [onChange, onQueryChange]), handleClearButtonFocus = useCallback(() => {
|
|
5360
5162
|
dispatch({
|
|
5361
5163
|
type: "input/focus"
|
|
5362
5164
|
});
|
|
5363
|
-
},
|
|
5364
|
-
|
|
5365
|
-
let t28, t29;
|
|
5366
|
-
$[86] !== valueProp ? (t28 = () => {
|
|
5165
|
+
}, []);
|
|
5166
|
+
useEffect(() => {
|
|
5367
5167
|
if (valueProp !== valuePropRef.current) {
|
|
5368
5168
|
valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
|
|
5369
5169
|
type: "value/change",
|
|
@@ -5375,19 +5175,14 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
5375
5175
|
type: "value/change",
|
|
5376
5176
|
value: valueProp || null
|
|
5377
5177
|
}));
|
|
5378
|
-
},
|
|
5379
|
-
let t30, t31;
|
|
5380
|
-
$[89] !== focused ? (t30 = () => {
|
|
5178
|
+
}, [valueProp]), useEffect(() => {
|
|
5381
5179
|
!focused && valueRef.current && dispatch({
|
|
5382
5180
|
type: "root/setActiveValue",
|
|
5383
5181
|
value: valueRef.current
|
|
5384
5182
|
});
|
|
5385
|
-
},
|
|
5386
|
-
let t32, t33;
|
|
5387
|
-
$[92] !== filteredOptions || $[93] !== activeValue ? (t32 = () => {
|
|
5183
|
+
}, [focused]), useEffect(() => {
|
|
5388
5184
|
const listElement = listBoxElementRef.current;
|
|
5389
|
-
if (!listElement)
|
|
5390
|
-
return;
|
|
5185
|
+
if (!listElement) return;
|
|
5391
5186
|
const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
|
|
5392
5187
|
if (activeOption_1) {
|
|
5393
5188
|
const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
|
|
@@ -5397,123 +5192,35 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
5397
5192
|
focusFirstDescendant(activeItemElement);
|
|
5398
5193
|
}
|
|
5399
5194
|
}
|
|
5400
|
-
},
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
let t352;
|
|
5405
|
-
$[96] === Symbol.for("react.memo_cache_sentinel") ? (t352 = {
|
|
5195
|
+
}, [activeValue, filteredOptions]);
|
|
5196
|
+
const clearButton = useMemo(() => {
|
|
5197
|
+
if (!loading && !disabled && value)
|
|
5198
|
+
return {
|
|
5406
5199
|
"aria-label": "Clear",
|
|
5407
5200
|
onFocus: handleClearButtonFocus
|
|
5408
|
-
}
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
}
|
|
5427
|
-
|
|
5428
|
-
t37 = t38;
|
|
5429
|
-
const openButtonPadding = t37;
|
|
5430
|
-
let t39;
|
|
5431
|
-
t39 = typeof openButton == "object" ? openButton : EMPTY_RECORD;
|
|
5432
|
-
const openButtonProps = t39;
|
|
5433
|
-
let t40;
|
|
5434
|
-
$[103] !== dispatchOpen || $[104] !== openButtonProps || $[105] !== inputElement ? (t40 = (event_4) => {
|
|
5435
|
-
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElement?.focus());
|
|
5436
|
-
}, $[103] = dispatchOpen, $[104] = openButtonProps, $[105] = inputElement, $[106] = t40) : t40 = $[106];
|
|
5437
|
-
const handleOpenClick = t40;
|
|
5438
|
-
let t41, t42;
|
|
5439
|
-
$[107] !== disabled || $[108] !== readOnly || $[109] !== openButton || $[110] !== expanded || $[111] !== fontSize2 || $[112] !== openButtonPadding || $[113] !== openButtonProps || $[114] !== handleOpenClick || $[115] !== openButtonBoxPadding ? (t42 = !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, fontSize: fontSize2, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, $[107] = disabled, $[108] = readOnly, $[109] = openButton, $[110] = expanded, $[111] = fontSize2, $[112] = openButtonPadding, $[113] = openButtonProps, $[114] = handleOpenClick, $[115] = openButtonBoxPadding, $[116] = t42) : t42 = $[116], t41 = t42;
|
|
5440
|
-
const openButtonNode = t41;
|
|
5441
|
-
let t43;
|
|
5442
|
-
bb1: {
|
|
5443
|
-
if (query === null) {
|
|
5444
|
-
if (value !== null) {
|
|
5445
|
-
let t442;
|
|
5446
|
-
$[117] !== renderValue || $[118] !== value || $[119] !== currentOption ? (t442 = renderValue(value, currentOption), $[117] = renderValue, $[118] = value, $[119] = currentOption, $[120] = t442) : t442 = $[120], t43 = t442;
|
|
5447
|
-
break bb1;
|
|
5448
|
-
}
|
|
5449
|
-
t43 = "";
|
|
5450
|
-
break bb1;
|
|
5451
|
-
}
|
|
5452
|
-
t43 = query;
|
|
5453
|
-
}
|
|
5454
|
-
const inputValue = t43, t44 = loading && AnimatedSpinnerIcon, t45 = suffix || openButtonNode;
|
|
5455
|
-
let t46;
|
|
5456
|
-
$[121] !== restProps || $[122] !== activeItemId || $[123] !== expanded || $[124] !== listBoxId || $[125] !== border2 || $[126] !== clearButton || $[127] !== customValidity || $[128] !== disabled || $[129] !== fontSize2 || $[130] !== icon || $[131] !== t44 || $[132] !== id || $[133] !== handleInputChange || $[134] !== handleClearButtonClick || $[135] !== handleInputFocus || $[136] !== padding || $[137] !== prefix || $[138] !== radius || $[139] !== readOnly || $[140] !== t45 || $[141] !== inputValue ? (t46 = /* @__PURE__ */ jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border: border2, clearButton, customValidity, disabled, fontSize: fontSize2, icon, iconRight: t44, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: t45, value: inputValue }), $[121] = restProps, $[122] = activeItemId, $[123] = expanded, $[124] = listBoxId, $[125] = border2, $[126] = clearButton, $[127] = customValidity, $[128] = disabled, $[129] = fontSize2, $[130] = icon, $[131] = t44, $[132] = id, $[133] = handleInputChange, $[134] = handleClearButtonClick, $[135] = handleInputFocus, $[136] = padding, $[137] = prefix, $[138] = radius, $[139] = readOnly, $[140] = t45, $[141] = inputValue, $[142] = t46) : t46 = $[142];
|
|
5457
|
-
const input = t46;
|
|
5458
|
-
let t47;
|
|
5459
|
-
$[143] !== listFocused || $[144] !== inputElement ? (t47 = (event_5) => {
|
|
5460
|
-
event_5.key === "Tab" && listFocused && inputElement?.focus();
|
|
5461
|
-
}, $[143] = listFocused, $[144] = inputElement, $[145] = t47) : t47 = $[145];
|
|
5462
|
-
const handleListBoxKeyDown = t47;
|
|
5463
|
-
let t48;
|
|
5464
|
-
bb2: {
|
|
5465
|
-
if (filteredOptions.length === 0) {
|
|
5466
|
-
t48 = null;
|
|
5467
|
-
break bb2;
|
|
5468
|
-
}
|
|
5469
|
-
let t492;
|
|
5470
|
-
if ($[146] !== activeValue || $[147] !== currentOption || $[148] !== id || $[149] !== handleOptionSelect || $[150] !== renderOption || $[151] !== loading || $[152] !== listFocused || $[153] !== filteredOptions) {
|
|
5471
|
-
let t503;
|
|
5472
|
-
$[155] !== activeValue || $[156] !== currentOption || $[157] !== id || $[158] !== handleOptionSelect || $[159] !== renderOption || $[160] !== loading || $[161] !== listFocused ? (t503 = (option_0) => {
|
|
5473
|
-
const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
|
|
5474
|
-
return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
|
|
5475
|
-
disabled: loading,
|
|
5476
|
-
selected: active,
|
|
5477
|
-
tabIndex: listFocused && active ? 0 : -1
|
|
5478
|
-
}) }, option_0.value);
|
|
5479
|
-
}, $[155] = activeValue, $[156] = currentOption, $[157] = id, $[158] = handleOptionSelect, $[159] = renderOption, $[160] = loading, $[161] = listFocused, $[162] = t503) : t503 = $[162], t492 = filteredOptions.map(t503), $[146] = activeValue, $[147] = currentOption, $[148] = id, $[149] = handleOptionSelect, $[150] = renderOption, $[151] = loading, $[152] = listFocused, $[153] = filteredOptions, $[154] = t492;
|
|
5480
|
-
} else
|
|
5481
|
-
t492 = $[154];
|
|
5482
|
-
let t502;
|
|
5483
|
-
$[163] !== listBoxId || $[164] !== t492 ? (t502 = /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: t492 }), $[163] = listBoxId, $[164] = t492, $[165] = t502) : t502 = $[165];
|
|
5484
|
-
let t51;
|
|
5485
|
-
$[166] !== handleListBoxKeyDown || $[167] !== listBox || $[168] !== t502 ? (t51 = /* @__PURE__ */ jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: t502 }), $[166] = handleListBoxKeyDown, $[167] = listBox, $[168] = t502, $[169] = t51) : t51 = $[169], t48 = t51;
|
|
5486
|
-
}
|
|
5487
|
-
const content = t48;
|
|
5488
|
-
let t49;
|
|
5489
|
-
bb3: {
|
|
5490
|
-
if (renderPopover) {
|
|
5491
|
-
const t503 = !expanded;
|
|
5492
|
-
let t51;
|
|
5493
|
-
$[170] !== content || $[171] !== t503 || $[172] !== inputElement || $[173] !== resultsPopoverElement || $[174] !== renderPopover ? (t51 = renderPopover({
|
|
5494
|
-
content,
|
|
5495
|
-
hidden: t503,
|
|
5496
|
-
inputElement,
|
|
5497
|
-
onMouseEnter: handlePopoverMouseEnter,
|
|
5498
|
-
onMouseLeave: handlePopoverMouseLeave
|
|
5499
|
-
}, {
|
|
5500
|
-
current: resultsPopoverElement
|
|
5501
|
-
}), $[170] = content, $[171] = t503, $[172] = inputElement, $[173] = resultsPopoverElement, $[174] = renderPopover, $[175] = t51) : t51 = $[175], t49 = t51;
|
|
5502
|
-
break bb3;
|
|
5503
|
-
}
|
|
5504
|
-
if (filteredOptionsLen === 0) {
|
|
5505
|
-
t49 = null;
|
|
5506
|
-
break bb3;
|
|
5507
|
-
}
|
|
5508
|
-
let t502;
|
|
5509
|
-
$[176] !== content || $[177] !== expanded || $[178] !== radius || $[179] !== inputElement || $[180] !== popover ? (t502 = /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: setResultsPopoverElement, referenceElement: inputElement, ...popover }), $[176] = content, $[177] = expanded, $[178] = radius, $[179] = inputElement, $[180] = popover, $[181] = t502) : t502 = $[181], t49 = t502;
|
|
5510
|
-
}
|
|
5511
|
-
const results = t49;
|
|
5512
|
-
let t50;
|
|
5513
|
-
return $[182] !== handleRootBlur || $[183] !== handleRootKeyDown || $[184] !== input || $[185] !== results ? (t50 = /* @__PURE__ */ jsxs(Root$9, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: setRootElement, children: [
|
|
5201
|
+
};
|
|
5202
|
+
}, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = useMemo(() => typeof openButton == "object" ? openButton : EMPTY_RECORD, [openButton]), handleOpenClick = useCallback((event_4) => {
|
|
5203
|
+
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
5204
|
+
}, [openButtonProps, dispatchOpen]), openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, fontSize: fontSize2, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize2, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border: border2, clearButton, customValidity, disabled, fontSize: fontSize2, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = useCallback((event_5) => {
|
|
5205
|
+
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
5206
|
+
}, [listFocused]), content = useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: filteredOptions.map((option_0) => {
|
|
5207
|
+
const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
|
|
5208
|
+
return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
|
|
5209
|
+
disabled: loading,
|
|
5210
|
+
selected: active,
|
|
5211
|
+
tabIndex: listFocused && active ? 0 : -1
|
|
5212
|
+
}) }, option_0.value);
|
|
5213
|
+
}) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = useMemo(() => renderPopover ? renderPopover({
|
|
5214
|
+
content,
|
|
5215
|
+
hidden: !expanded,
|
|
5216
|
+
inputElement: inputElementRef.current,
|
|
5217
|
+
onMouseEnter: handlePopoverMouseEnter,
|
|
5218
|
+
onMouseLeave: handlePopoverMouseLeave
|
|
5219
|
+
}, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, radius, renderPopover]);
|
|
5220
|
+
return /* @__PURE__ */ jsxs(Root$9, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|
|
5514
5221
|
input,
|
|
5515
5222
|
results
|
|
5516
|
-
] })
|
|
5223
|
+
] });
|
|
5517
5224
|
});
|
|
5518
5225
|
InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
|
|
5519
5226
|
const Autocomplete = InnerAutocomplete, Root$8 = styled.ol`
|
|
@@ -5528,46 +5235,26 @@ const Autocomplete = InnerAutocomplete, Root$8 = styled.ol`
|
|
|
5528
5235
|
appearance: none;
|
|
5529
5236
|
margin: -4px;
|
|
5530
5237
|
`, Breadcrumbs = forwardRef(function(props, ref) {
|
|
5531
|
-
const
|
|
5532
|
-
let t0, children, maxLength, restProps, separator;
|
|
5533
|
-
$[0] !== props ? ({
|
|
5238
|
+
const {
|
|
5534
5239
|
children,
|
|
5535
5240
|
maxLength,
|
|
5536
5241
|
separator,
|
|
5537
|
-
space:
|
|
5242
|
+
space: spaceRaw = 2,
|
|
5538
5243
|
...restProps
|
|
5539
|
-
} = props,
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => setOpen(!1), $[6] = t1) : t1 = $[6];
|
|
5543
|
-
const collapse = t1;
|
|
5544
|
-
let t2;
|
|
5545
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => setOpen(!0), $[7] = t2) : t2 = $[7];
|
|
5546
|
-
const expand = t2;
|
|
5547
|
-
let t3;
|
|
5548
|
-
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => [expandElementRef.current, popoverElementRef.current], $[8] = t3) : t3 = $[8], useClickOutsideEvent(collapse, t3);
|
|
5549
|
-
let T0, t4, t5, t6, t7;
|
|
5550
|
-
if ($[9] !== children || $[10] !== maxLength || $[11] !== space || $[12] !== open || $[13] !== restProps || $[14] !== ref || $[15] !== separator) {
|
|
5551
|
-
const rawItems = Children.toArray(children).filter(isValidElement);
|
|
5552
|
-
let items = rawItems;
|
|
5244
|
+
} = props, space = useArrayProp(spaceRaw), [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
|
|
5245
|
+
useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
|
|
5246
|
+
const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
|
|
5553
5247
|
const len = rawItems.length;
|
|
5554
|
-
if (maxLength &&
|
|
5555
|
-
const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2)
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
|
|
5565
|
-
/* @__PURE__ */ jsx(Box, { as: "li", children: item })
|
|
5566
|
-
] }, itemIndex), $[28] = space, $[29] = separator, $[30] = t82) : t82 = $[30], t7 = items.map(t82), $[9] = children, $[10] = maxLength, $[11] = space, $[12] = open, $[13] = restProps, $[14] = ref, $[15] = separator, $[16] = T0, $[17] = t4, $[18] = t5, $[19] = t6, $[20] = t7;
|
|
5567
|
-
} else
|
|
5568
|
-
T0 = $[16], t4 = $[17], t5 = $[18], t6 = $[19], t7 = $[20];
|
|
5569
|
-
let t8;
|
|
5570
|
-
return $[31] !== T0 || $[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 ? (t8 = /* @__PURE__ */ jsx(T0, { "data-ui": t4, ...t5, ref: t6, children: t7 }), $[31] = T0, $[32] = t4, $[33] = t5, $[34] = t6, $[35] = t7, $[36] = t8) : t8 = $[36], t8;
|
|
5248
|
+
if (maxLength && len > maxLength) {
|
|
5249
|
+
const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
|
|
5250
|
+
return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: /* @__PURE__ */ jsx(Stack, { as: "ol", overflow: "auto", padding: space, space, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: open ? collapse : expand, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }) }, "button"), ...rawItems.slice(len - afterLength)];
|
|
5251
|
+
}
|
|
5252
|
+
return rawItems;
|
|
5253
|
+
}, [collapse, expand, maxLength, open, rawItems, space]);
|
|
5254
|
+
return /* @__PURE__ */ jsx(Root$8, { "data-ui": "Breadcrumbs", ...restProps, ref, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5255
|
+
itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
|
|
5256
|
+
/* @__PURE__ */ jsx(Box, { as: "li", children: item })
|
|
5257
|
+
] }, itemIndex)) });
|
|
5571
5258
|
});
|
|
5572
5259
|
Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
|
|
5573
5260
|
function dialogStyle({
|
|
@@ -5698,24 +5385,24 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
|
|
|
5698
5385
|
autoFocus && ref.current && focusFirstDescendant(ref.current);
|
|
5699
5386
|
}, t3 = [autoFocus, ref], $[2] = autoFocus, $[3] = t2, $[4] = t3) : (t2 = $[3], t3 = $[4]), useEffect(t2, t3);
|
|
5700
5387
|
let t4;
|
|
5701
|
-
$[5] !==
|
|
5388
|
+
$[5] !== boundaryElement || $[6] !== isTopLayer || $[7] !== onClose || $[8] !== portalElement ? (t4 = (event) => {
|
|
5702
5389
|
if (!isTopLayer || !onClose)
|
|
5703
5390
|
return;
|
|
5704
5391
|
const target = document.activeElement;
|
|
5705
5392
|
target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
|
|
5706
|
-
}, $[5] =
|
|
5393
|
+
}, $[5] = boundaryElement, $[6] = isTopLayer, $[7] = onClose, $[8] = portalElement, $[9] = t4) : t4 = $[9], useGlobalKeyDown(t4);
|
|
5707
5394
|
let t5;
|
|
5708
|
-
$[10] !==
|
|
5395
|
+
$[10] !== boundaryElement || $[11] !== isTopLayer || $[12] !== onClickOutside || $[13] !== portalElement ? (t5 = isTopLayer && onClickOutside && ((event_0) => {
|
|
5709
5396
|
const target_0 = event_0.target;
|
|
5710
5397
|
target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
|
|
5711
|
-
}), $[10] =
|
|
5398
|
+
}), $[10] = boundaryElement, $[11] = isTopLayer, $[12] = onClickOutside, $[13] = portalElement, $[14] = t5) : t5 = $[14];
|
|
5712
5399
|
let t6;
|
|
5713
5400
|
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => [ref.current], $[15] = t6) : t6 = $[15], useClickOutsideEvent(t5, t6);
|
|
5714
5401
|
let t7;
|
|
5715
|
-
$[16] !==
|
|
5402
|
+
$[16] !== header || $[17] !== labelId || $[18] !== onClose || $[19] !== showCloseButton || $[20] !== showHeader ? (t7 = showHeader && /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
|
|
5716
5403
|
/* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
|
|
5717
5404
|
showCloseButton && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Button, { "aria-label": "Close dialog", disabled: !onClose, icon: CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
|
|
5718
|
-
] }) }), $[16] =
|
|
5405
|
+
] }) }), $[16] = header, $[17] = labelId, $[18] = onClose, $[19] = showCloseButton, $[20] = showHeader, $[21] = t7) : t7 = $[21];
|
|
5719
5406
|
let t8;
|
|
5720
5407
|
$[22] !== children ? (t8 = /* @__PURE__ */ jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }), $[22] = children, $[23] = t8) : t8 = $[23];
|
|
5721
5408
|
let t9;
|
|
@@ -5729,14 +5416,14 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
|
|
|
5729
5416
|
let t11;
|
|
5730
5417
|
$[30] !== radius || $[31] !== scheme || $[32] !== shadow || $[33] !== t10 ? (t11 = /* @__PURE__ */ jsx(DialogCardRoot, { radius, ref, scheme, shadow, children: t10 }), $[30] = radius, $[31] = scheme, $[32] = shadow, $[33] = t10, $[34] = t11) : t11 = $[34];
|
|
5731
5418
|
let t12;
|
|
5732
|
-
return $[35] !==
|
|
5419
|
+
return $[35] !== t11 || $[36] !== width ? (t12 = /* @__PURE__ */ jsx(DialogContainer, { "data-ui": "DialogCard", width, children: t11 }), $[35] = t11, $[36] = width, $[37] = t12) : t12 = $[37], t12;
|
|
5733
5420
|
});
|
|
5734
5421
|
DialogCard.displayName = "ForwardRef(DialogCard)";
|
|
5735
5422
|
const Dialog = forwardRef(function(props, ref) {
|
|
5736
5423
|
const $ = c(60), dialog = useDialog(), {
|
|
5737
5424
|
layer
|
|
5738
5425
|
} = useTheme_v2();
|
|
5739
|
-
let
|
|
5426
|
+
let _positionProp, _zOffsetProp, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, t6;
|
|
5740
5427
|
$[0] !== props ? ({
|
|
5741
5428
|
__unstable_autoFocus: t0,
|
|
5742
5429
|
__unstable_hideCloseButton: t1,
|
|
@@ -5759,7 +5446,7 @@ const Dialog = forwardRef(function(props, ref) {
|
|
|
5759
5446
|
zOffset: _zOffsetProp,
|
|
5760
5447
|
animate: t6,
|
|
5761
5448
|
...restProps
|
|
5762
|
-
} = props, $[0] = props, $[1] =
|
|
5449
|
+
} = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = contentRef, $[5] = footer, $[6] = header, $[7] = id, $[8] = onActivate, $[9] = onClickOutside, $[10] = onClose, $[11] = onFocus, $[12] = portalProp, $[13] = restProps, $[14] = scheme, $[15] = t0, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], contentRef = $[4], footer = $[5], header = $[6], id = $[7], onActivate = $[8], onClickOutside = $[9], onClose = $[10], onFocus = $[11], portalProp = $[12], restProps = $[13], scheme = $[14], t0 = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21]);
|
|
5763
5450
|
const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 === void 0 ? !1 : t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), padding = useArrayProp(paddingProp), position = useArrayProp(positionProp), width = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
|
|
5764
5451
|
let t7;
|
|
5765
5452
|
$[22] !== onFocus ? (t7 = (event) => {
|
|
@@ -5795,15 +5482,15 @@ const Dialog = forwardRef(function(props, ref) {
|
|
|
5795
5482
|
let t9;
|
|
5796
5483
|
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[27] = t9) : t9 = $[27];
|
|
5797
5484
|
let t10;
|
|
5798
|
-
$[28] !== autoFocus || $[29] !==
|
|
5485
|
+
$[28] !== autoFocus || $[29] !== cardRadius || $[30] !== cardShadow || $[31] !== children || $[32] !== contentRef || $[33] !== footer || $[34] !== header || $[35] !== hideCloseButton || $[36] !== id || $[37] !== onClickOutside || $[38] !== onClose || $[39] !== portalProp || $[40] !== scheme || $[41] !== width ? (t10 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, width, children }), $[28] = autoFocus, $[29] = cardRadius, $[30] = cardShadow, $[31] = children, $[32] = contentRef, $[33] = footer, $[34] = header, $[35] = hideCloseButton, $[36] = id, $[37] = onClickOutside, $[38] = onClose, $[39] = portalProp, $[40] = scheme, $[41] = width, $[42] = t10) : t10 = $[42];
|
|
5799
5486
|
let t11;
|
|
5800
5487
|
$[43] === Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[43] = t11) : t11 = $[43];
|
|
5801
5488
|
let t12;
|
|
5802
|
-
$[44] !==
|
|
5489
|
+
$[44] !== animate || $[45] !== handleFocus || $[46] !== handleRootClick || $[47] !== id || $[48] !== labelId || $[49] !== onActivate || $[50] !== padding || $[51] !== position || $[52] !== ref || $[53] !== restProps || $[54] !== t10 || $[55] !== zOffset ? (t12 = /* @__PURE__ */ jsxs(Root$7, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
|
|
5803
5490
|
t9,
|
|
5804
5491
|
t10,
|
|
5805
5492
|
t11
|
|
5806
|
-
] }), $[44] =
|
|
5493
|
+
] }), $[44] = animate, $[45] = handleFocus, $[46] = handleRootClick, $[47] = id, $[48] = labelId, $[49] = onActivate, $[50] = padding, $[51] = position, $[52] = ref, $[53] = restProps, $[54] = t10, $[55] = zOffset, $[56] = t12) : t12 = $[56];
|
|
5807
5494
|
let t13;
|
|
5808
5495
|
return $[57] !== portalProp || $[58] !== t12 ? (t13 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t12 }), $[57] = portalProp, $[58] = t12, $[59] = t13) : t13 = $[59], t13;
|
|
5809
5496
|
});
|
|
@@ -5822,7 +5509,7 @@ function DialogProvider(props) {
|
|
|
5822
5509
|
}, $[0] = position, $[1] = zOffset, $[2] = t1) : t1 = $[2], t0 = t1;
|
|
5823
5510
|
const contextValue = t0;
|
|
5824
5511
|
let t2;
|
|
5825
|
-
return $[3] !==
|
|
5512
|
+
return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
|
|
5826
5513
|
}
|
|
5827
5514
|
DialogProvider.displayName = "DialogProvider";
|
|
5828
5515
|
const Root$6 = styled.kbd`
|
|
@@ -5838,7 +5525,7 @@ const Root$6 = styled.kbd`
|
|
|
5838
5525
|
}
|
|
5839
5526
|
`, Hotkeys = forwardRef(function(props, ref) {
|
|
5840
5527
|
const $ = c(24);
|
|
5841
|
-
let
|
|
5528
|
+
let fontSize2, keys, padding, radius, restProps, t0;
|
|
5842
5529
|
$[0] !== props ? ({
|
|
5843
5530
|
fontSize: fontSize2,
|
|
5844
5531
|
keys,
|
|
@@ -5846,22 +5533,22 @@ const Root$6 = styled.kbd`
|
|
|
5846
5533
|
radius,
|
|
5847
5534
|
space: t0,
|
|
5848
5535
|
...restProps
|
|
5849
|
-
} = props, $[0] = props, $[1] =
|
|
5536
|
+
} = props, $[0] = props, $[1] = fontSize2, $[2] = keys, $[3] = padding, $[4] = radius, $[5] = restProps, $[6] = t0) : (fontSize2 = $[1], keys = $[2], padding = $[3], radius = $[4], restProps = $[5], t0 = $[6]);
|
|
5850
5537
|
const space = useArrayProp(t0 === void 0 ? 0.5 : t0);
|
|
5851
5538
|
if (!keys || keys.length === 0) {
|
|
5852
5539
|
let t12;
|
|
5853
5540
|
return $[7] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx(Fragment, {}), $[7] = t12) : t12 = $[7], t12;
|
|
5854
5541
|
}
|
|
5855
5542
|
let t1;
|
|
5856
|
-
if ($[8] !== fontSize2 || $[9] !==
|
|
5543
|
+
if ($[8] !== fontSize2 || $[9] !== keys || $[10] !== padding || $[11] !== radius) {
|
|
5857
5544
|
let t22;
|
|
5858
|
-
$[13] !== fontSize2 || $[14] !== padding || $[15] !== radius ? (t22 = (key2, i) => /* @__PURE__ */ jsx(Key, { fontSize: fontSize2, padding, radius, children: key2 }, i), $[13] = fontSize2, $[14] = padding, $[15] = radius, $[16] = t22) : t22 = $[16], t1 = keys.map(t22), $[8] = fontSize2, $[9] =
|
|
5545
|
+
$[13] !== fontSize2 || $[14] !== padding || $[15] !== radius ? (t22 = (key2, i) => /* @__PURE__ */ jsx(Key, { fontSize: fontSize2, padding, radius, children: key2 }, i), $[13] = fontSize2, $[14] = padding, $[15] = radius, $[16] = t22) : t22 = $[16], t1 = keys.map(t22), $[8] = fontSize2, $[9] = keys, $[10] = padding, $[11] = radius, $[12] = t1;
|
|
5859
5546
|
} else
|
|
5860
5547
|
t1 = $[12];
|
|
5861
5548
|
let t2;
|
|
5862
5549
|
$[17] !== space || $[18] !== t1 ? (t2 = /* @__PURE__ */ jsx(Inline, { as: "span", space, children: t1 }), $[17] = space, $[18] = t1, $[19] = t2) : t2 = $[19];
|
|
5863
5550
|
let t3;
|
|
5864
|
-
return $[20] !==
|
|
5551
|
+
return $[20] !== ref || $[21] !== restProps || $[22] !== t2 ? (t3 = /* @__PURE__ */ jsx(Root$6, { "data-ui": "Hotkeys", ...restProps, ref, children: t2 }), $[20] = ref, $[21] = restProps, $[22] = t2, $[23] = t3) : t3 = $[23], t3;
|
|
5865
5552
|
});
|
|
5866
5553
|
Hotkeys.displayName = "ForwardRef(Hotkeys)";
|
|
5867
5554
|
const MenuContext = createGlobalScopedContext("@sanity/ui/context/menu", null);
|
|
@@ -5902,28 +5589,16 @@ function _sortElements(rootElement, elements) {
|
|
|
5902
5589
|
elements.sort(_sort);
|
|
5903
5590
|
}
|
|
5904
5591
|
function useMenuController(props) {
|
|
5905
|
-
const
|
|
5592
|
+
const {
|
|
5906
5593
|
onKeyDown,
|
|
5907
5594
|
originElement,
|
|
5908
5595
|
shouldFocus,
|
|
5909
5596
|
rootElementRef
|
|
5910
|
-
} = props
|
|
5911
|
-
let t0;
|
|
5912
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = [], $[0] = t0) : t0 = $[0];
|
|
5913
|
-
const elementsRef = useRef(t0), [activeIndex, _setActiveIndex] = useState(-1), activeIndexRef = useRef(activeIndex);
|
|
5914
|
-
let t1;
|
|
5915
|
-
t1 = elementsRef.current[activeIndex] || null;
|
|
5916
|
-
const activeElement = t1, mounted = !!rootElementRef.current;
|
|
5917
|
-
let t2;
|
|
5918
|
-
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = (nextActiveIndex) => {
|
|
5597
|
+
} = props, elementsRef = useRef([]), [activeIndex, _setActiveIndex] = useState(-1), activeIndexRef = useRef(activeIndex), activeElement = useMemo(() => elementsRef.current[activeIndex] || null, [activeIndex]), mounted = !!rootElementRef.current, setActiveIndex = useCallback((nextActiveIndex) => {
|
|
5919
5598
|
_setActiveIndex(nextActiveIndex), activeIndexRef.current = nextActiveIndex;
|
|
5920
|
-
},
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
$[2] !== rootElementRef.current ? (t3 = (element, selected) => {
|
|
5924
|
-
if (!element)
|
|
5925
|
-
return () => {
|
|
5926
|
-
};
|
|
5599
|
+
}, []), mount = useCallback((element, selected) => {
|
|
5600
|
+
if (!element) return () => {
|
|
5601
|
+
};
|
|
5927
5602
|
if (elementsRef.current.indexOf(element) === -1 && (elementsRef.current.push(element), _sortElements(rootElementRef.current, elementsRef.current)), selected) {
|
|
5928
5603
|
const selectedIndex = elementsRef.current.indexOf(element);
|
|
5929
5604
|
setActiveIndex(selectedIndex);
|
|
@@ -5932,10 +5607,7 @@ function useMenuController(props) {
|
|
|
5932
5607
|
const idx = elementsRef.current.indexOf(element);
|
|
5933
5608
|
idx > -1 && elementsRef.current.splice(idx, 1);
|
|
5934
5609
|
};
|
|
5935
|
-
},
|
|
5936
|
-
const mount = t3;
|
|
5937
|
-
let t4;
|
|
5938
|
-
$[4] !== originElement || $[5] !== onKeyDown ? (t4 = (event) => {
|
|
5610
|
+
}, [rootElementRef, setActiveIndex]), handleKeyDown = useCallback((event) => {
|
|
5939
5611
|
if (event.key === "Tab") {
|
|
5940
5612
|
originElement && originElement.focus();
|
|
5941
5613
|
return;
|
|
@@ -5943,8 +5615,7 @@ function useMenuController(props) {
|
|
|
5943
5615
|
if (event.key === "Home") {
|
|
5944
5616
|
event.preventDefault(), event.stopPropagation();
|
|
5945
5617
|
const el = _getFocusableElements(elementsRef.current)[0];
|
|
5946
|
-
if (!el)
|
|
5947
|
-
return;
|
|
5618
|
+
if (!el) return;
|
|
5948
5619
|
const currentIndex = elementsRef.current.indexOf(el);
|
|
5949
5620
|
setActiveIndex(currentIndex);
|
|
5950
5621
|
return;
|
|
@@ -5952,8 +5623,7 @@ function useMenuController(props) {
|
|
|
5952
5623
|
if (event.key === "End") {
|
|
5953
5624
|
event.preventDefault(), event.stopPropagation();
|
|
5954
5625
|
const focusableElements_0 = _getFocusableElements(elementsRef.current), el_0 = focusableElements_0[focusableElements_0.length - 1];
|
|
5955
|
-
if (!el_0)
|
|
5956
|
-
return;
|
|
5626
|
+
if (!el_0) return;
|
|
5957
5627
|
const currentIndex_0 = elementsRef.current.indexOf(el_0);
|
|
5958
5628
|
setActiveIndex(currentIndex_0);
|
|
5959
5629
|
return;
|
|
@@ -5961,8 +5631,7 @@ function useMenuController(props) {
|
|
|
5961
5631
|
if (event.key === "ArrowUp") {
|
|
5962
5632
|
event.preventDefault(), event.stopPropagation();
|
|
5963
5633
|
const focusableElements_1 = _getFocusableElements(elementsRef.current), focusableLen = focusableElements_1.length;
|
|
5964
|
-
if (focusableLen === 0)
|
|
5965
|
-
return;
|
|
5634
|
+
if (focusableLen === 0) return;
|
|
5966
5635
|
const focusedElement = elementsRef.current[activeIndexRef.current];
|
|
5967
5636
|
let focusedIndex = focusableElements_1.indexOf(focusedElement);
|
|
5968
5637
|
focusedIndex = (focusedIndex - 1 + focusableLen) % focusableLen;
|
|
@@ -5973,8 +5642,7 @@ function useMenuController(props) {
|
|
|
5973
5642
|
if (event.key === "ArrowDown") {
|
|
5974
5643
|
event.preventDefault(), event.stopPropagation();
|
|
5975
5644
|
const focusableElements_2 = _getFocusableElements(elementsRef.current), focusableLen_0 = focusableElements_2.length;
|
|
5976
|
-
if (focusableLen_0 === 0)
|
|
5977
|
-
return;
|
|
5645
|
+
if (focusableLen_0 === 0) return;
|
|
5978
5646
|
const focusedElement_0 = elementsRef.current[activeIndexRef.current];
|
|
5979
5647
|
let focusedIndex_0 = focusableElements_2.indexOf(focusedElement_0);
|
|
5980
5648
|
focusedIndex_0 = (focusedIndex_0 + 1) % focusableLen_0;
|
|
@@ -5983,23 +5651,14 @@ function useMenuController(props) {
|
|
|
5983
5651
|
return;
|
|
5984
5652
|
}
|
|
5985
5653
|
onKeyDown && onKeyDown(event);
|
|
5986
|
-
},
|
|
5987
|
-
const handleKeyDown = t4;
|
|
5988
|
-
let t5;
|
|
5989
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t5 = (event_0) => {
|
|
5654
|
+
}, [onKeyDown, originElement, setActiveIndex]), handleItemMouseEnter = useCallback((event_0) => {
|
|
5990
5655
|
const element_0 = event_0.currentTarget, currentIndex_3 = elementsRef.current.indexOf(element_0);
|
|
5991
5656
|
setActiveIndex(currentIndex_3);
|
|
5992
|
-
},
|
|
5993
|
-
const handleItemMouseEnter = t5;
|
|
5994
|
-
let t6;
|
|
5995
|
-
$[8] !== rootElementRef.current ? (t6 = () => {
|
|
5657
|
+
}, [setActiveIndex]), handleItemMouseLeave = useCallback(() => {
|
|
5996
5658
|
setActiveIndex(-2), rootElementRef.current?.focus();
|
|
5997
|
-
},
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
$[10] !== mounted || $[11] !== activeIndex || $[12] !== shouldFocus ? (t7 = () => {
|
|
6001
|
-
if (!mounted)
|
|
6002
|
-
return;
|
|
5659
|
+
}, [rootElementRef, setActiveIndex]);
|
|
5660
|
+
return useEffect(() => {
|
|
5661
|
+
if (!mounted) return;
|
|
6003
5662
|
const rafId = requestAnimationFrame(() => {
|
|
6004
5663
|
if (activeIndex === -1) {
|
|
6005
5664
|
if (shouldFocus === "first") {
|
|
@@ -6021,23 +5680,21 @@ function useMenuController(props) {
|
|
|
6021
5680
|
(elementsRef.current[activeIndex] || null)?.focus();
|
|
6022
5681
|
});
|
|
6023
5682
|
return () => cancelAnimationFrame(rafId);
|
|
6024
|
-
},
|
|
6025
|
-
let t9;
|
|
6026
|
-
return $[15] !== activeElement || $[16] !== activeIndex || $[17] !== handleItemMouseLeave || $[18] !== handleKeyDown || $[19] !== mount ? (t9 = {
|
|
5683
|
+
}, [activeIndex, mounted, setActiveIndex, shouldFocus]), {
|
|
6027
5684
|
activeElement,
|
|
6028
5685
|
activeIndex,
|
|
6029
5686
|
handleItemMouseEnter,
|
|
6030
5687
|
handleItemMouseLeave,
|
|
6031
5688
|
handleKeyDown,
|
|
6032
5689
|
mount
|
|
6033
|
-
}
|
|
5690
|
+
};
|
|
6034
5691
|
}
|
|
6035
5692
|
const Root$5 = styled(Box)`
|
|
6036
5693
|
outline: none;
|
|
6037
5694
|
overflow: auto;
|
|
6038
5695
|
`, Menu = forwardRef(function(props, forwardedRef) {
|
|
6039
5696
|
const $ = c(50);
|
|
6040
|
-
let
|
|
5697
|
+
let _shouldFocus, children, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, restProps, t0, t1;
|
|
6041
5698
|
if ($[0] !== props) {
|
|
6042
5699
|
const {
|
|
6043
5700
|
children: t22,
|
|
@@ -6055,9 +5712,9 @@ const Root$5 = styled(Box)`
|
|
|
6055
5712
|
space: t122,
|
|
6056
5713
|
...t132
|
|
6057
5714
|
} = props;
|
|
6058
|
-
children = t22, onClickOutside = t32, onEscape = t42, onItemClick = t52, onItemSelect = t62, onKeyDown = t72, originElement = t82, t0 = t92, registerElement = t102, _shouldFocus = t112, t1 = t122, restProps = t132, $[0] = props, $[1] =
|
|
5715
|
+
children = t22, onClickOutside = t32, onEscape = t42, onItemClick = t52, onItemSelect = t62, onKeyDown = t72, originElement = t82, t0 = t92, registerElement = t102, _shouldFocus = t112, t1 = t122, restProps = t132, $[0] = props, $[1] = _shouldFocus, $[2] = children, $[3] = onClickOutside, $[4] = onEscape, $[5] = onItemClick, $[6] = onItemSelect, $[7] = onKeyDown, $[8] = originElement, $[9] = registerElement, $[10] = restProps, $[11] = t0, $[12] = t1;
|
|
6059
5716
|
} else
|
|
6060
|
-
|
|
5717
|
+
_shouldFocus = $[1], children = $[2], onClickOutside = $[3], onEscape = $[4], onItemClick = $[5], onItemSelect = $[6], onKeyDown = $[7], originElement = $[8], registerElement = $[9], restProps = $[10], t0 = $[11], t1 = $[12];
|
|
6061
5718
|
const padding = t0 === void 0 ? 1 : t0, space = t1 === void 0 ? 1 : t1, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = useRef(null);
|
|
6062
5719
|
let t2;
|
|
6063
5720
|
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[13] = t2) : t2 = $[13], useImperativeHandle(forwardedRef, t2);
|
|
@@ -6085,9 +5742,9 @@ const Root$5 = styled(Box)`
|
|
|
6085
5742
|
}, $[18] = registerElement, $[19] = t4) : t4 = $[19];
|
|
6086
5743
|
const handleRefChange = t4;
|
|
6087
5744
|
let t5, t6;
|
|
6088
|
-
$[20] !==
|
|
5745
|
+
$[20] !== activeIndex || $[21] !== onItemSelect ? (t5 = () => {
|
|
6089
5746
|
onItemSelect && onItemSelect(activeIndex);
|
|
6090
|
-
}, t6 = [activeIndex, onItemSelect], $[20] =
|
|
5747
|
+
}, t6 = [activeIndex, onItemSelect], $[20] = activeIndex, $[21] = onItemSelect, $[22] = t5, $[23] = t6) : (t5 = $[22], t6 = $[23]), useEffect(t5, t6);
|
|
6091
5748
|
let t7;
|
|
6092
5749
|
$[24] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[24] = t7) : t7 = $[24], useClickOutsideEvent(isTopLayer && onClickOutside, t7);
|
|
6093
5750
|
let t8;
|
|
@@ -6095,7 +5752,7 @@ const Root$5 = styled(Box)`
|
|
|
6095
5752
|
isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
|
|
6096
5753
|
}, $[25] = isTopLayer, $[26] = onEscape, $[27] = t8) : t8 = $[27], useGlobalKeyDown(t8);
|
|
6097
5754
|
let t9, t10;
|
|
6098
|
-
$[28] !== activeElement || $[29] !== activeIndex || $[30] !==
|
|
5755
|
+
$[28] !== activeElement || $[29] !== activeIndex || $[30] !== handleItemMouseEnter || $[31] !== handleItemMouseLeave || $[32] !== mount || $[33] !== onClickOutside || $[34] !== onEscape || $[35] !== onItemClick || $[36] !== registerElement ? (t10 = {
|
|
6099
5756
|
version: 0,
|
|
6100
5757
|
activeElement,
|
|
6101
5758
|
activeIndex,
|
|
@@ -6108,14 +5765,14 @@ const Root$5 = styled(Box)`
|
|
|
6108
5765
|
registerElement,
|
|
6109
5766
|
onMouseEnter: handleItemMouseEnter,
|
|
6110
5767
|
onMouseLeave: handleItemMouseLeave
|
|
6111
|
-
}, $[28] = activeElement, $[29] = activeIndex, $[30] =
|
|
5768
|
+
}, $[28] = activeElement, $[29] = activeIndex, $[30] = handleItemMouseEnter, $[31] = handleItemMouseLeave, $[32] = mount, $[33] = onClickOutside, $[34] = onEscape, $[35] = onItemClick, $[36] = registerElement, $[37] = t10) : t10 = $[37], t9 = t10;
|
|
6112
5769
|
const value = t9;
|
|
6113
5770
|
let t11;
|
|
6114
|
-
$[38] !==
|
|
5771
|
+
$[38] !== children || $[39] !== space ? (t11 = /* @__PURE__ */ jsx(Stack, { space, children }), $[38] = children, $[39] = space, $[40] = t11) : t11 = $[40];
|
|
6115
5772
|
let t12;
|
|
6116
|
-
$[41] !==
|
|
5773
|
+
$[41] !== handleKeyDown || $[42] !== handleRefChange || $[43] !== padding || $[44] !== restProps || $[45] !== t11 ? (t12 = /* @__PURE__ */ jsx(Root$5, { "data-ui": "Menu", ...restProps, onKeyDown: handleKeyDown, padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t11 }), $[41] = handleKeyDown, $[42] = handleRefChange, $[43] = padding, $[44] = restProps, $[45] = t11, $[46] = t12) : t12 = $[46];
|
|
6117
5774
|
let t13;
|
|
6118
|
-
return $[47] !==
|
|
5775
|
+
return $[47] !== t12 || $[48] !== value ? (t13 = /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: t12 }), $[47] = t12, $[48] = value, $[49] = t13) : t13 = $[49], t13;
|
|
6119
5776
|
});
|
|
6120
5777
|
Menu.displayName = "ForwardRef(Menu)";
|
|
6121
5778
|
const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
@@ -6151,7 +5808,7 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
6151
5808
|
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
|
|
6152
5809
|
let t9;
|
|
6153
5810
|
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
6154
|
-
setOpen(
|
|
5811
|
+
setOpen(_temp$2), setShouldFocus(null);
|
|
6155
5812
|
}, $[12] = t9) : t9 = $[12];
|
|
6156
5813
|
const handleButtonClick = t9;
|
|
6157
5814
|
let t10;
|
|
@@ -6183,9 +5840,9 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
6183
5840
|
}, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
|
|
6184
5841
|
const handleMenuClickOutside = t12;
|
|
6185
5842
|
let t13;
|
|
6186
|
-
$[19] !==
|
|
5843
|
+
$[19] !== buttonElement || $[20] !== disableRestoreFocusOnClose ? (t13 = () => {
|
|
6187
5844
|
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
6188
|
-
}, $[19] =
|
|
5845
|
+
}, $[19] = buttonElement, $[20] = disableRestoreFocusOnClose, $[21] = t13) : t13 = $[21];
|
|
6189
5846
|
const handleMenuEscape = t13;
|
|
6190
5847
|
let t14;
|
|
6191
5848
|
$[22] !== menuElements ? (t14 = (event_2) => {
|
|
@@ -6199,15 +5856,15 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
6199
5856
|
}, $[22] = menuElements, $[23] = t14) : t14 = $[23];
|
|
6200
5857
|
const handleBlur = t14;
|
|
6201
5858
|
let t15;
|
|
6202
|
-
$[24] !==
|
|
5859
|
+
$[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t15 = () => {
|
|
6203
5860
|
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
6204
|
-
}, $[24] =
|
|
5861
|
+
}, $[24] = buttonElement, $[25] = disableRestoreFocusOnClose, $[26] = t15) : t15 = $[26];
|
|
6205
5862
|
const handleItemClick = t15;
|
|
6206
5863
|
let t16;
|
|
6207
5864
|
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t16 = (el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => setChildMenuElements((els_0) => els_0.filter((_el) => _el !== el_1))), $[27] = t16) : t16 = $[27];
|
|
6208
5865
|
const registerElement = t16;
|
|
6209
5866
|
let t17;
|
|
6210
|
-
$[28] !==
|
|
5867
|
+
$[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && cloneElement(menuProp, {
|
|
6211
5868
|
"aria-labelledby": id,
|
|
6212
5869
|
onBlurCapture: handleBlur,
|
|
6213
5870
|
onClickOutside: handleMenuClickOutside,
|
|
@@ -6216,10 +5873,10 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
6216
5873
|
originElement: buttonElement,
|
|
6217
5874
|
registerElement,
|
|
6218
5875
|
shouldFocus
|
|
6219
|
-
}), $[28] =
|
|
5876
|
+
}), $[28] = buttonElement, $[29] = handleBlur, $[30] = handleItemClick, $[31] = handleMenuClickOutside, $[32] = handleMenuEscape, $[33] = id, $[34] = menuProp, $[35] = shouldFocus, $[36] = t17) : t17 = $[36];
|
|
6220
5877
|
const menu = t17;
|
|
6221
5878
|
let t18, t19;
|
|
6222
|
-
$[37] !== buttonProp || $[38] !==
|
|
5879
|
+
$[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open ? (t19 = buttonProp && cloneElement(buttonProp, {
|
|
6223
5880
|
"data-ui": "MenuButton",
|
|
6224
5881
|
id,
|
|
6225
5882
|
onClick: handleButtonClick,
|
|
@@ -6229,14 +5886,14 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
6229
5886
|
"aria-expanded": open,
|
|
6230
5887
|
ref: setButtonElement,
|
|
6231
5888
|
selected: buttonProp.props.selected ?? open
|
|
6232
|
-
}), $[37] = buttonProp, $[38] =
|
|
5889
|
+
}), $[37] = buttonProp, $[38] = handleMouseDown, $[39] = id, $[40] = open, $[41] = t19) : t19 = $[41], t18 = t19;
|
|
6233
5890
|
const button = t18;
|
|
6234
5891
|
let t20, t21;
|
|
6235
5892
|
$[42] !== buttonElement ? (t20 = () => buttonElement, t21 = [buttonElement], $[42] = buttonElement, $[43] = t20, $[44] = t21) : (t20 = $[43], t21 = $[44]), useImperativeHandle(forwardedRef, t20, t21);
|
|
6236
5893
|
let t22, t23;
|
|
6237
5894
|
$[45] !== popover ? (t23 = popover || {}, $[45] = popover, $[46] = t23) : t23 = $[46];
|
|
6238
5895
|
let t24;
|
|
6239
|
-
$[47] !== deprecated_boundaryElement || $[48] !== deprecated_placement || $[49] !==
|
|
5896
|
+
$[47] !== deprecated_boundaryElement || $[48] !== deprecated_placement || $[49] !== deprecated_popoverRadius || $[50] !== deprecated_popoverScheme || $[51] !== deprecated_portal || $[52] !== deprecated_preventOverflow || $[53] !== t23 ? (t24 = {
|
|
6240
5897
|
boundaryElement: deprecated_boundaryElement,
|
|
6241
5898
|
overflow: "auto",
|
|
6242
5899
|
placement: deprecated_placement,
|
|
@@ -6245,14 +5902,17 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
6245
5902
|
radius: deprecated_popoverRadius,
|
|
6246
5903
|
scheme: deprecated_popoverScheme,
|
|
6247
5904
|
...t23
|
|
6248
|
-
}, $[47] = deprecated_boundaryElement, $[48] = deprecated_placement, $[49] =
|
|
5905
|
+
}, $[47] = deprecated_boundaryElement, $[48] = deprecated_placement, $[49] = deprecated_popoverRadius, $[50] = deprecated_popoverScheme, $[51] = deprecated_portal, $[52] = deprecated_preventOverflow, $[53] = t23, $[54] = t24) : t24 = $[54], t22 = t24;
|
|
6249
5906
|
const popoverProps = t22;
|
|
6250
5907
|
let t25;
|
|
6251
5908
|
$[55] !== button ? (t25 = button || /* @__PURE__ */ jsx(Fragment, {}), $[55] = button, $[56] = t25) : t25 = $[56];
|
|
6252
5909
|
let t26;
|
|
6253
|
-
return $[57] !==
|
|
5910
|
+
return $[57] !== menu || $[58] !== open || $[59] !== popoverProps || $[60] !== t25 ? (t26 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t25 }), $[57] = menu, $[58] = open, $[59] = popoverProps, $[60] = t25, $[61] = t26) : t26 = $[61], t26;
|
|
6254
5911
|
});
|
|
6255
5912
|
MenuButton.displayName = "ForwardRef(MenuButton)";
|
|
5913
|
+
function _temp$2(v) {
|
|
5914
|
+
return !v;
|
|
5915
|
+
}
|
|
6256
5916
|
const MenuDivider = styled.hr`
|
|
6257
5917
|
height: 1px;
|
|
6258
5918
|
border: 0;
|
|
@@ -6372,7 +6032,7 @@ function useMenu() {
|
|
|
6372
6032
|
}
|
|
6373
6033
|
function MenuGroup(props) {
|
|
6374
6034
|
const $ = c(77);
|
|
6375
|
-
let
|
|
6035
|
+
let IconComponent, children, onClick, popover, restProps, t0, t1, t2, t3, t4, t5, text;
|
|
6376
6036
|
$[0] !== props ? ({
|
|
6377
6037
|
as: t0,
|
|
6378
6038
|
children,
|
|
@@ -6386,7 +6046,7 @@ function MenuGroup(props) {
|
|
|
6386
6046
|
text,
|
|
6387
6047
|
tone: t5,
|
|
6388
6048
|
...restProps
|
|
6389
|
-
} = props, $[0] = props, $[1] =
|
|
6049
|
+
} = props, $[0] = props, $[1] = IconComponent, $[2] = children, $[3] = onClick, $[4] = popover, $[5] = restProps, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5, $[12] = text) : (IconComponent = $[1], children = $[2], onClick = $[3], popover = $[4], restProps = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], t5 = $[11], text = $[12]);
|
|
6390
6050
|
const as = t0 === void 0 ? "button" : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, menu = useMenu(), {
|
|
6391
6051
|
scheme
|
|
6392
6052
|
} = useRootTheme(), {
|
|
@@ -6441,7 +6101,7 @@ function MenuGroup(props) {
|
|
|
6441
6101
|
return () => cancelAnimationFrame(rafId);
|
|
6442
6102
|
}, t18 = [shouldFocus], $[32] = shouldFocus, $[33] = t17, $[34] = t18) : (t17 = $[33], t18 = $[34]), useEffect(t17, t18);
|
|
6443
6103
|
let t19;
|
|
6444
|
-
$[35] !==
|
|
6104
|
+
$[35] !== children || $[36] !== handleChildItemClick || $[37] !== handleMenuKeyDown || $[38] !== onClickOutside || $[39] !== onEscape || $[40] !== registerElement || $[41] !== shouldFocus ? (t19 = /* @__PURE__ */ jsx(Menu, { onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), $[35] = children, $[36] = handleChildItemClick, $[37] = handleMenuKeyDown, $[38] = onClickOutside, $[39] = onEscape, $[40] = registerElement, $[41] = shouldFocus, $[42] = t19) : t19 = $[42];
|
|
6445
6105
|
const childMenu = t19;
|
|
6446
6106
|
let t20;
|
|
6447
6107
|
$[43] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_2) => {
|
|
@@ -6464,20 +6124,20 @@ function MenuGroup(props) {
|
|
|
6464
6124
|
let t29;
|
|
6465
6125
|
$[51] !== fontSize2 ? (t29 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children: t28 }), $[51] = fontSize2, $[52] = t29) : t29 = $[52];
|
|
6466
6126
|
let t30;
|
|
6467
|
-
$[53] !==
|
|
6127
|
+
$[53] !== padding || $[54] !== space || $[55] !== t26 || $[56] !== t27 || $[57] !== t29 ? (t30 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
|
|
6468
6128
|
t26,
|
|
6469
6129
|
t27,
|
|
6470
6130
|
t29
|
|
6471
|
-
] }), $[53] =
|
|
6131
|
+
] }), $[53] = padding, $[54] = space, $[55] = t26, $[56] = t27, $[57] = t29, $[58] = t30) : t30 = $[58];
|
|
6472
6132
|
let t31;
|
|
6473
|
-
$[59] !== as || $[60] !==
|
|
6133
|
+
$[59] !== as || $[60] !== handleClick || $[61] !== handleMouseEnter || $[62] !== restProps || $[63] !== scheme || $[64] !== t21 || $[65] !== t22 || $[66] !== t23 || $[67] !== t24 || $[68] !== t25 || $[69] !== t30 || $[70] !== tone ? (t31 = /* @__PURE__ */ jsx(Selectable, { "data-as": as, "data-ui": "MenuGroup", forwardedAs: as, ...restProps, "aria-pressed": t21, "data-pressed": t22, "data-selected": t23, $radius: t24, $tone: tone, $scheme: scheme, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, ref: setRootElement, tabIndex: -1, type: t25, children: t30 }), $[59] = as, $[60] = handleClick, $[61] = handleMouseEnter, $[62] = restProps, $[63] = scheme, $[64] = t21, $[65] = t22, $[66] = t23, $[67] = t24, $[68] = t25, $[69] = t30, $[70] = tone, $[71] = t31) : t31 = $[71];
|
|
6474
6134
|
let t32;
|
|
6475
|
-
return $[72] !==
|
|
6135
|
+
return $[72] !== childMenu || $[73] !== open || $[74] !== popover || $[75] !== t31 ? (t32 = /* @__PURE__ */ jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t31 }), $[72] = childMenu, $[73] = open, $[74] = popover, $[75] = t31, $[76] = t32) : t32 = $[76], t32;
|
|
6476
6136
|
}
|
|
6477
6137
|
MenuGroup.displayName = "MenuGroup";
|
|
6478
6138
|
const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
6479
6139
|
const $ = c(74);
|
|
6480
|
-
let
|
|
6140
|
+
let IconComponent, IconRightComponent, children, disabled, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, restProps, selectedProp, t0, t1, t2, t3, t4, t5, text;
|
|
6481
6141
|
$[0] !== props ? ({
|
|
6482
6142
|
as: t0,
|
|
6483
6143
|
children,
|
|
@@ -6501,7 +6161,7 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
6501
6161
|
text,
|
|
6502
6162
|
tone: t5,
|
|
6503
6163
|
...restProps
|
|
6504
|
-
} = props, $[0] = props, $[1] =
|
|
6164
|
+
} = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = hotkeys, $[6] = onClick, $[7] = paddingBottom, $[8] = paddingLeft, $[9] = paddingRight, $[10] = paddingTop, $[11] = paddingX, $[12] = paddingY, $[13] = pressed, $[14] = restProps, $[15] = selectedProp, $[16] = t0, $[17] = t1, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = text) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], hotkeys = $[5], onClick = $[6], paddingBottom = $[7], paddingLeft = $[8], paddingRight = $[9], paddingTop = $[10], paddingX = $[11], paddingY = $[12], pressed = $[13], restProps = $[14], selectedProp = $[15], t0 = $[16], t1 = $[17], t2 = $[18], t3 = $[19], t4 = $[20], t5 = $[21], text = $[22]);
|
|
6505
6165
|
const as = t0 === void 0 ? "button" : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, {
|
|
6506
6166
|
scheme
|
|
6507
6167
|
} = useRootTheme(), menu = useMenu(), {
|
|
@@ -6521,7 +6181,7 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
6521
6181
|
}, $[29] = disabled, $[30] = onClick, $[31] = onItemClick, $[32] = t9) : t9 = $[32];
|
|
6522
6182
|
const handleClick = t9;
|
|
6523
6183
|
let t10, t11;
|
|
6524
|
-
$[33] !== padding || $[34] !==
|
|
6184
|
+
$[33] !== padding || $[34] !== paddingBottom || $[35] !== paddingLeft || $[36] !== paddingRight || $[37] !== paddingTop || $[38] !== paddingX || $[39] !== paddingY ? (t11 = {
|
|
6525
6185
|
padding,
|
|
6526
6186
|
paddingX,
|
|
6527
6187
|
paddingY,
|
|
@@ -6529,7 +6189,7 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
6529
6189
|
paddingRight,
|
|
6530
6190
|
paddingBottom,
|
|
6531
6191
|
paddingLeft
|
|
6532
|
-
}, $[33] = padding, $[34] =
|
|
6192
|
+
}, $[33] = padding, $[34] = paddingBottom, $[35] = paddingLeft, $[36] = paddingRight, $[37] = paddingTop, $[38] = paddingX, $[39] = paddingY, $[40] = t11) : t11 = $[40], t10 = t11;
|
|
6533
6193
|
const paddingProps = t10, t12 = useArrayProp(fontSize2);
|
|
6534
6194
|
let t13;
|
|
6535
6195
|
$[41] !== t12 ? (t13 = t12.map(_temp$1), $[41] = t12, $[42] = t13) : t13 = $[42];
|
|
@@ -6540,7 +6200,7 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
6540
6200
|
}, $[43] = t14) : t14 = $[43];
|
|
6541
6201
|
const setRef = t14, t15 = as === "button" && pressed, t16 = as !== "button" && pressed ? "" : void 0, t17 = active ? "" : void 0, t18 = disabled ? "" : void 0, t19 = useArrayProp(radius), t20 = useArrayProp(0), t21 = disabled ? "default" : tone, t22 = as === "button" ? "button" : void 0;
|
|
6542
6202
|
let t23;
|
|
6543
|
-
$[44] !== IconComponent || $[45] !==
|
|
6203
|
+
$[44] !== IconComponent || $[45] !== IconRightComponent || $[46] !== fontSize2 || $[47] !== hotkeys || $[48] !== hotkeysFontSize || $[49] !== paddingProps || $[50] !== space || $[51] !== text ? (t23 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
|
|
6544
6204
|
IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
|
|
6545
6205
|
isValidElement(IconComponent) && IconComponent,
|
|
6546
6206
|
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
@@ -6554,14 +6214,14 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
6554
6214
|
isValidElement(IconRightComponent) && IconRightComponent,
|
|
6555
6215
|
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
6556
6216
|
] })
|
|
6557
|
-
] }), $[44] = IconComponent, $[45] =
|
|
6217
|
+
] }), $[44] = IconComponent, $[45] = IconRightComponent, $[46] = fontSize2, $[47] = hotkeys, $[48] = hotkeysFontSize, $[49] = paddingProps, $[50] = space, $[51] = text, $[52] = t23) : t23 = $[52];
|
|
6558
6218
|
let t24;
|
|
6559
6219
|
$[53] !== children || $[54] !== paddingProps ? (t24 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[53] = children, $[54] = paddingProps, $[55] = t24) : t24 = $[55];
|
|
6560
6220
|
let t25;
|
|
6561
|
-
return $[56] !==
|
|
6221
|
+
return $[56] !== as || $[57] !== disabled || $[58] !== handleClick || $[59] !== onItemMouseEnter || $[60] !== onItemMouseLeave || $[61] !== restProps || $[62] !== scheme || $[63] !== t15 || $[64] !== t16 || $[65] !== t17 || $[66] !== t18 || $[67] !== t19 || $[68] !== t20 || $[69] !== t21 || $[70] !== t22 || $[71] !== t23 || $[72] !== t24 ? (t25 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", ...restProps, "aria-pressed": t15, "data-pressed": t16, "data-selected": t17, "data-disabled": t18, forwardedAs: as, $radius: t19, $padding: t20, $tone: t21, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role: "menuitem", tabIndex: -1, type: t22, children: [
|
|
6562
6222
|
t23,
|
|
6563
6223
|
t24
|
|
6564
|
-
] }), $[56] =
|
|
6224
|
+
] }), $[56] = as, $[57] = disabled, $[58] = handleClick, $[59] = onItemMouseEnter, $[60] = onItemMouseLeave, $[61] = restProps, $[62] = scheme, $[63] = t15, $[64] = t16, $[65] = t17, $[66] = t18, $[67] = t19, $[68] = t20, $[69] = t21, $[70] = t22, $[71] = t23, $[72] = t24, $[73] = t25) : t25 = $[73], t25;
|
|
6565
6225
|
});
|
|
6566
6226
|
MenuItem.displayName = "ForwardRef(MenuItem)";
|
|
6567
6227
|
function _temp$1(s) {
|
|
@@ -6609,13 +6269,13 @@ const keyframe = keyframes`
|
|
|
6609
6269
|
}
|
|
6610
6270
|
`, Root$4 = styled(Box)(responsiveRadiusStyle, skeletonStyle), Skeleton = forwardRef(function(props, ref) {
|
|
6611
6271
|
const $ = c(14);
|
|
6612
|
-
let
|
|
6272
|
+
let delay, radius, restProps, t0;
|
|
6613
6273
|
$[0] !== props ? ({
|
|
6614
6274
|
animated: t0,
|
|
6615
6275
|
delay,
|
|
6616
6276
|
radius,
|
|
6617
6277
|
...restProps
|
|
6618
|
-
} = props, $[0] = props, $[1] =
|
|
6278
|
+
} = props, $[0] = props, $[1] = delay, $[2] = radius, $[3] = restProps, $[4] = t0) : (delay = $[1], radius = $[2], restProps = $[3], t0 = $[4]);
|
|
6619
6279
|
const animated = t0 === void 0 ? !1 : t0, [visible, setVisible] = useState(!delay);
|
|
6620
6280
|
let t1, t2;
|
|
6621
6281
|
$[5] !== delay ? (t1 = () => {
|
|
@@ -6630,7 +6290,7 @@ const keyframe = keyframes`
|
|
|
6630
6290
|
}, t2 = [delay], $[5] = delay, $[6] = t1, $[7] = t2) : (t1 = $[6], t2 = $[7]), useEffect(t1, t2);
|
|
6631
6291
|
const t3 = useArrayProp(radius);
|
|
6632
6292
|
let t4;
|
|
6633
|
-
return $[8] !==
|
|
6293
|
+
return $[8] !== animated || $[9] !== ref || $[10] !== restProps || $[11] !== t3 || $[12] !== visible ? (t4 = /* @__PURE__ */ jsx(Root$4, { ...restProps, $animated: animated, $radius: t3, $visible: visible, ref }), $[8] = animated, $[9] = ref, $[10] = restProps, $[11] = t3, $[12] = visible, $[13] = t4) : t4 = $[13], t4;
|
|
6634
6294
|
});
|
|
6635
6295
|
Skeleton.displayName = "ForwardRef(Skeleton)";
|
|
6636
6296
|
const Root$3 = styled(Skeleton)((props) => {
|
|
@@ -6649,57 +6309,57 @@ const Root$3 = styled(Skeleton)((props) => {
|
|
|
6649
6309
|
});
|
|
6650
6310
|
}), TextSkeleton = forwardRef(function(props, ref) {
|
|
6651
6311
|
const $ = c(7);
|
|
6652
|
-
let
|
|
6312
|
+
let restProps, t0;
|
|
6653
6313
|
$[0] !== props ? ({
|
|
6654
6314
|
size: t0,
|
|
6655
6315
|
...restProps
|
|
6656
|
-
} = props, $[0] = props, $[1] =
|
|
6316
|
+
} = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
|
|
6657
6317
|
const $size = useArrayProp(t0 === void 0 ? 2 : t0);
|
|
6658
6318
|
let t1;
|
|
6659
|
-
return $[3] !==
|
|
6319
|
+
return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "text" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
|
|
6660
6320
|
});
|
|
6661
6321
|
TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
|
|
6662
6322
|
const LabelSkeleton = forwardRef(function(props, ref) {
|
|
6663
6323
|
const $ = c(7);
|
|
6664
|
-
let
|
|
6324
|
+
let restProps, t0;
|
|
6665
6325
|
$[0] !== props ? ({
|
|
6666
6326
|
size: t0,
|
|
6667
6327
|
...restProps
|
|
6668
|
-
} = props, $[0] = props, $[1] =
|
|
6328
|
+
} = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
|
|
6669
6329
|
const $size = useArrayProp(t0 === void 0 ? 2 : t0);
|
|
6670
6330
|
let t1;
|
|
6671
|
-
return $[3] !==
|
|
6331
|
+
return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "label" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
|
|
6672
6332
|
});
|
|
6673
6333
|
LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
|
|
6674
6334
|
const HeadingSkeleton = forwardRef(function(props, ref) {
|
|
6675
6335
|
const $ = c(7);
|
|
6676
|
-
let
|
|
6336
|
+
let restProps, t0;
|
|
6677
6337
|
$[0] !== props ? ({
|
|
6678
6338
|
size: t0,
|
|
6679
6339
|
...restProps
|
|
6680
|
-
} = props, $[0] = props, $[1] =
|
|
6340
|
+
} = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
|
|
6681
6341
|
const $size = useArrayProp(t0 === void 0 ? 2 : t0);
|
|
6682
6342
|
let t1;
|
|
6683
|
-
return $[3] !==
|
|
6343
|
+
return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "heading" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
|
|
6684
6344
|
});
|
|
6685
6345
|
HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
|
|
6686
6346
|
const CodeSkeleton = forwardRef(function(props, ref) {
|
|
6687
6347
|
const $ = c(7);
|
|
6688
|
-
let
|
|
6348
|
+
let restProps, t0;
|
|
6689
6349
|
$[0] !== props ? ({
|
|
6690
6350
|
size: t0,
|
|
6691
6351
|
...restProps
|
|
6692
|
-
} = props, $[0] = props, $[1] =
|
|
6352
|
+
} = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
|
|
6693
6353
|
const $size = useArrayProp(t0 === void 0 ? 2 : t0);
|
|
6694
6354
|
let t1;
|
|
6695
|
-
return $[3] !==
|
|
6355
|
+
return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "code" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
|
|
6696
6356
|
});
|
|
6697
6357
|
CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
|
|
6698
6358
|
const CustomButton = styled(Button)`
|
|
6699
6359
|
max-width: 100%;
|
|
6700
6360
|
`, Tab = forwardRef(function(props, forwardedRef) {
|
|
6701
6361
|
const $ = c(30);
|
|
6702
|
-
let
|
|
6362
|
+
let focused, icon, id, label, onClick, onFocus, restProps, selected, t0, t1;
|
|
6703
6363
|
$[0] !== props ? ({
|
|
6704
6364
|
icon,
|
|
6705
6365
|
id,
|
|
@@ -6711,7 +6371,7 @@ const CustomButton = styled(Button)`
|
|
|
6711
6371
|
padding: t1,
|
|
6712
6372
|
selected,
|
|
6713
6373
|
...restProps
|
|
6714
|
-
} = props, $[0] = props, $[1] =
|
|
6374
|
+
} = props, $[0] = props, $[1] = focused, $[2] = icon, $[3] = id, $[4] = label, $[5] = onClick, $[6] = onFocus, $[7] = restProps, $[8] = selected, $[9] = t0, $[10] = t1) : (focused = $[1], icon = $[2], id = $[3], label = $[4], onClick = $[5], onFocus = $[6], restProps = $[7], selected = $[8], t0 = $[9], t1 = $[10]);
|
|
6715
6375
|
const fontSize2 = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 2 : t1, ref = useRef(null), focusedRef = useRef(!1);
|
|
6716
6376
|
let t2;
|
|
6717
6377
|
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[11] = t2) : t2 = $[11], useImperativeHandle(forwardedRef, t2);
|
|
@@ -6731,7 +6391,7 @@ const CustomButton = styled(Button)`
|
|
|
6731
6391
|
}, t6 = [focused], $[15] = focused, $[16] = t5, $[17] = t6) : (t5 = $[16], t6 = $[17]), useEffect(t5, t6);
|
|
6732
6392
|
const t7 = selected ? "true" : "false", t8 = selected ? 0 : -1;
|
|
6733
6393
|
let t9;
|
|
6734
|
-
return $[18] !==
|
|
6394
|
+
return $[18] !== fontSize2 || $[19] !== handleFocus || $[20] !== icon || $[21] !== id || $[22] !== label || $[23] !== onClick || $[24] !== padding || $[25] !== restProps || $[26] !== selected || $[27] !== t7 || $[28] !== t8 ? (t9 = /* @__PURE__ */ jsx(CustomButton, { "data-ui": "Tab", ...restProps, "aria-selected": t7, fontSize: fontSize2, icon, id, mode: "bleed", onClick, onBlur: handleBlur, onFocus: handleFocus, padding, ref, role: "tab", selected, tabIndex: t8, text: label, type: "button" }), $[18] = fontSize2, $[19] = handleFocus, $[20] = icon, $[21] = id, $[22] = label, $[23] = onClick, $[24] = padding, $[25] = restProps, $[26] = selected, $[27] = t7, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
|
|
6735
6395
|
});
|
|
6736
6396
|
Tab.displayName = "ForwardRef(Tab)";
|
|
6737
6397
|
const CustomInline = styled(Inline)`
|
|
@@ -6767,19 +6427,19 @@ const CustomInline = styled(Inline)`
|
|
|
6767
6427
|
}, $[8] = numTabs, $[9] = t1) : t1 = $[9];
|
|
6768
6428
|
const handleKeyDown = t1;
|
|
6769
6429
|
let t2;
|
|
6770
|
-
return $[10] !==
|
|
6430
|
+
return $[10] !== handleKeyDown || $[11] !== ref || $[12] !== restProps || $[13] !== tabs ? (t2 = /* @__PURE__ */ jsx(CustomInline, { "data-ui": "TabList", ...restProps, onKeyDown: handleKeyDown, ref, role: "tablist", children: tabs }), $[10] = handleKeyDown, $[11] = ref, $[12] = restProps, $[13] = tabs, $[14] = t2) : t2 = $[14], t2;
|
|
6771
6431
|
});
|
|
6772
6432
|
TabList.displayName = "ForwardRef(TabList)";
|
|
6773
6433
|
const TabPanel = forwardRef(function(props, ref) {
|
|
6774
6434
|
const $ = c(9);
|
|
6775
|
-
let
|
|
6435
|
+
let flex, restProps;
|
|
6776
6436
|
$[0] !== props ? ({
|
|
6777
6437
|
flex,
|
|
6778
6438
|
...restProps
|
|
6779
|
-
} = props, $[0] = props, $[1] =
|
|
6439
|
+
} = props, $[0] = props, $[1] = flex, $[2] = restProps) : (flex = $[1], restProps = $[2]);
|
|
6780
6440
|
const t0 = props.tabIndex === void 0 ? 0 : props.tabIndex;
|
|
6781
6441
|
let t1;
|
|
6782
|
-
return $[3] !==
|
|
6442
|
+
return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ jsx(Box, { "data-ui": "TabPanel", ...restProps, flex, ref, role: "tabpanel", tabIndex: t0, children: props.children }), $[3] = flex, $[4] = props.children, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1) : t1 = $[8], t1;
|
|
6783
6443
|
});
|
|
6784
6444
|
TabPanel.displayName = "ForwardRef(TabPanel)";
|
|
6785
6445
|
const TextBox = styled(Flex)`
|
|
@@ -6830,12 +6490,12 @@ const STATUS_CARD_TONE = {
|
|
|
6830
6490
|
error: "critical",
|
|
6831
6491
|
warning: "caution",
|
|
6832
6492
|
success: "positive",
|
|
6833
|
-
info: "
|
|
6493
|
+
info: "neutral"
|
|
6834
6494
|
}, BUTTON_TONE = {
|
|
6835
6495
|
error: "critical",
|
|
6836
6496
|
warning: "caution",
|
|
6837
6497
|
success: "positive",
|
|
6838
|
-
info: "
|
|
6498
|
+
info: "neutral"
|
|
6839
6499
|
}, ROLES = {
|
|
6840
6500
|
error: "alert",
|
|
6841
6501
|
warning: "alert",
|
|
@@ -6844,7 +6504,7 @@ const STATUS_CARD_TONE = {
|
|
|
6844
6504
|
}, Root$2 = styled(Card)(rootStyles);
|
|
6845
6505
|
function Toast(props) {
|
|
6846
6506
|
const $ = c(30);
|
|
6847
|
-
let
|
|
6507
|
+
let closable, description, duration, onClose, restProps, status, t0, title;
|
|
6848
6508
|
$[0] !== props ? ({
|
|
6849
6509
|
closable,
|
|
6850
6510
|
description,
|
|
@@ -6854,7 +6514,7 @@ function Toast(props) {
|
|
|
6854
6514
|
title,
|
|
6855
6515
|
status,
|
|
6856
6516
|
...restProps
|
|
6857
|
-
} = props, $[0] = props, $[1] =
|
|
6517
|
+
} = props, $[0] = props, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = restProps, $[6] = status, $[7] = t0, $[8] = title) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], restProps = $[5], status = $[6], t0 = $[7], title = $[8]);
|
|
6858
6518
|
const radius = t0 === void 0 ? 3 : t0, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status";
|
|
6859
6519
|
let t1;
|
|
6860
6520
|
$[9] !== title ? (t1 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[9] = title, $[10] = t1) : t1 = $[10];
|
|
@@ -6866,16 +6526,16 @@ function Toast(props) {
|
|
|
6866
6526
|
t2
|
|
6867
6527
|
] }) }), $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15];
|
|
6868
6528
|
let t4;
|
|
6869
|
-
$[16] !==
|
|
6529
|
+
$[16] !== buttonTone || $[17] !== closable || $[18] !== onClose ? (t4 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
|
|
6870
6530
|
verticalAlign: "top"
|
|
6871
|
-
} }) }), $[16] =
|
|
6531
|
+
} }) }), $[16] = buttonTone, $[17] = closable, $[18] = onClose, $[19] = t4) : t4 = $[19];
|
|
6872
6532
|
let t5;
|
|
6873
6533
|
$[20] !== t3 || $[21] !== t4 ? (t5 = /* @__PURE__ */ jsxs(Flex, { align: "flex-start", children: [
|
|
6874
6534
|
t3,
|
|
6875
6535
|
t4
|
|
6876
6536
|
] }), $[20] = t3, $[21] = t4, $[22] = t5) : t5 = $[22];
|
|
6877
6537
|
let t6;
|
|
6878
|
-
return $[23] !==
|
|
6538
|
+
return $[23] !== cardTone || $[24] !== duration || $[25] !== radius || $[26] !== restProps || $[27] !== role || $[28] !== t5 ? (t6 = /* @__PURE__ */ jsx(Root$2, { "data-ui": "Toast", role, ...restProps, marginTop: 3, radius, shadow: 2, tone: cardTone, $duration: duration, children: t5 }), $[23] = cardTone, $[24] = duration, $[25] = radius, $[26] = restProps, $[27] = role, $[28] = t5, $[29] = t6) : t6 = $[29], t6;
|
|
6879
6539
|
}
|
|
6880
6540
|
Toast.displayName = "Toast";
|
|
6881
6541
|
function useMounted() {
|
|
@@ -6992,7 +6652,7 @@ function ToastProvider(props) {
|
|
|
6992
6652
|
toastsRef.current = {};
|
|
6993
6653
|
}, t13 = [], $[10] = t12, $[11] = t13) : (t12 = $[10], t13 = $[11]), useEffect(t12, t13);
|
|
6994
6654
|
let t14;
|
|
6995
|
-
$[12] !== mounted || $[13] !==
|
|
6655
|
+
$[12] !== mounted || $[13] !== padding || $[14] !== paddingX || $[15] !== paddingY || $[16] !== prefersReducedMotion || $[17] !== state || $[18] !== variants || $[19] !== zOffset ? (t14 = mounted && /* @__PURE__ */ jsx(Root$1, { "data-ui": "ToastProvider", zOffset, children: /* @__PURE__ */ jsx(ToastContainer, { children: /* @__PURE__ */ jsx(Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, children: state.map((t152) => {
|
|
6996
6656
|
const {
|
|
6997
6657
|
dismiss: dismiss_0,
|
|
6998
6658
|
id: id_0,
|
|
@@ -7005,7 +6665,7 @@ function ToastProvider(props) {
|
|
|
7005
6665
|
damping: 30,
|
|
7006
6666
|
stiffness: 400
|
|
7007
6667
|
}, children: /* @__PURE__ */ jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration }) }, id_0);
|
|
7008
|
-
}) }) }) }) }), $[12] = mounted, $[13] =
|
|
6668
|
+
}) }) }) }) }), $[12] = mounted, $[13] = padding, $[14] = paddingX, $[15] = paddingY, $[16] = prefersReducedMotion, $[17] = state, $[18] = variants, $[19] = zOffset, $[20] = t14) : t14 = $[20];
|
|
7009
6669
|
let t15;
|
|
7010
6670
|
return $[21] !== children || $[22] !== t14 ? (t15 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
|
|
7011
6671
|
children,
|
|
@@ -7077,13 +6737,13 @@ function _focusItemElement(el) {
|
|
|
7077
6737
|
}
|
|
7078
6738
|
const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = memo(forwardRef(function(props, forwardedRef) {
|
|
7079
6739
|
const $ = c(37);
|
|
7080
|
-
let
|
|
6740
|
+
let children, onFocus, restProps, t0;
|
|
7081
6741
|
$[0] !== props ? ({
|
|
7082
6742
|
children,
|
|
7083
6743
|
space: t0,
|
|
7084
6744
|
onFocus,
|
|
7085
6745
|
...restProps
|
|
7086
|
-
} = props, $[0] = props, $[1] =
|
|
6746
|
+
} = props, $[0] = props, $[1] = children, $[2] = onFocus, $[3] = restProps, $[4] = t0) : (children = $[1], onFocus = $[2], restProps = $[3], t0 = $[4]);
|
|
7087
6747
|
const space = t0 === void 0 ? 1 : t0, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
|
|
7088
6748
|
let t1, t2;
|
|
7089
6749
|
$[5] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[5] = t2) : t2 = $[5], t1 = t2;
|
|
@@ -7137,7 +6797,7 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
|
|
|
7137
6797
|
let t12;
|
|
7138
6798
|
const t13 = focusedElement || itemElements[0] || null;
|
|
7139
6799
|
let t14;
|
|
7140
|
-
$[17] !==
|
|
6800
|
+
$[17] !== space || $[18] !== state || $[19] !== t13 ? (t14 = {
|
|
7141
6801
|
version: 0,
|
|
7142
6802
|
focusedElement: t13,
|
|
7143
6803
|
level: 0,
|
|
@@ -7147,7 +6807,7 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
|
|
|
7147
6807
|
setFocusedElement,
|
|
7148
6808
|
space,
|
|
7149
6809
|
state
|
|
7150
|
-
}, $[17] =
|
|
6810
|
+
}, $[17] = space, $[18] = state, $[19] = t13, $[20] = t14) : t14 = $[20], t12 = t14;
|
|
7151
6811
|
const contextValue = t12;
|
|
7152
6812
|
let t15;
|
|
7153
6813
|
$[21] !== itemElements ? (t15 = (event) => {
|
|
@@ -7226,7 +6886,7 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
|
|
|
7226
6886
|
let t18;
|
|
7227
6887
|
$[26] !== children ? (t18 = [children], $[26] = children, $[27] = t18) : t18 = $[27], useEffect(t17, t18);
|
|
7228
6888
|
let t19;
|
|
7229
|
-
$[28] !==
|
|
6889
|
+
$[28] !== children || $[29] !== handleFocus || $[30] !== handleKeyDown || $[31] !== restProps || $[32] !== space ? (t19 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...restProps, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", space, children }), $[28] = children, $[29] = handleFocus, $[30] = handleKeyDown, $[31] = restProps, $[32] = space, $[33] = t19) : t19 = $[33];
|
|
7230
6890
|
let t20;
|
|
7231
6891
|
return $[34] !== contextValue || $[35] !== t19 ? (t20 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t19 }), $[34] = contextValue, $[35] = t19, $[36] = t20) : t20 = $[36], t20;
|
|
7232
6892
|
}));
|
|
@@ -7331,15 +6991,15 @@ function useTree() {
|
|
|
7331
6991
|
}
|
|
7332
6992
|
const TreeGroup = memo(function(props) {
|
|
7333
6993
|
const $ = c(9);
|
|
7334
|
-
let
|
|
6994
|
+
let children, restProps, t0;
|
|
7335
6995
|
$[0] !== props ? ({
|
|
7336
6996
|
children,
|
|
7337
6997
|
expanded: t0,
|
|
7338
6998
|
...restProps
|
|
7339
|
-
} = props, $[0] = props, $[1] =
|
|
6999
|
+
} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
|
|
7340
7000
|
const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
|
|
7341
7001
|
let t2;
|
|
7342
|
-
return $[4] !==
|
|
7002
|
+
return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.space ? (t2 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.space, role: "group", space: tree.space, children }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.space, $[8] = t2) : t2 = $[8], t2;
|
|
7343
7003
|
}), Root = memo(styled.li(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = styled(Box).attrs({
|
|
7344
7004
|
forwardedAs: "a"
|
|
7345
7005
|
})(treeItemBoxStyle), ToggleArrowText = styled(Text)`
|
|
@@ -7347,117 +7007,61 @@ const TreeGroup = memo(function(props) {
|
|
|
7347
7007
|
transition: transform 100ms;
|
|
7348
7008
|
}
|
|
7349
7009
|
`, TreeItem = memo(function(props) {
|
|
7350
|
-
const
|
|
7351
|
-
let t0, t1, t2, t3, t4, idProp, onClick, IconComponent, children, muted, weight, text, href, linkAs, restProps;
|
|
7352
|
-
$[0] !== props ? ({
|
|
7010
|
+
const {
|
|
7353
7011
|
children,
|
|
7354
|
-
expanded:
|
|
7355
|
-
fontSize:
|
|
7012
|
+
expanded: expandedProp = !1,
|
|
7013
|
+
fontSize: fontSize2 = 1,
|
|
7356
7014
|
href,
|
|
7357
7015
|
icon: IconComponent,
|
|
7358
7016
|
id: idProp,
|
|
7359
7017
|
linkAs,
|
|
7360
7018
|
muted,
|
|
7361
7019
|
onClick,
|
|
7362
|
-
padding
|
|
7363
|
-
selected
|
|
7364
|
-
space
|
|
7020
|
+
padding = 2,
|
|
7021
|
+
selected = !1,
|
|
7022
|
+
space = 2,
|
|
7365
7023
|
text,
|
|
7366
7024
|
weight,
|
|
7367
7025
|
...restProps
|
|
7368
|
-
} = props,
|
|
7369
|
-
const expandedProp = t0 === void 0 ? !1 : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 === void 0 ? !1 : t3, space = t4 === void 0 ? 2 : t4, [rootElement, setRootElement] = useState(null), treeitemRef = useRef(null), tree = useTree(), {
|
|
7026
|
+
} = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
|
|
7370
7027
|
path,
|
|
7371
7028
|
registerItem,
|
|
7372
7029
|
setExpanded,
|
|
7373
7030
|
setFocusedElement
|
|
7374
|
-
} = tree, _id = useId(), id = idProp || _id
|
|
7375
|
-
let t5, t6, t7;
|
|
7376
|
-
if ($[16] !== id || $[17] !== path) {
|
|
7377
|
-
const result = path.concat([id || ""]);
|
|
7378
|
-
t6 = result, t7 = result.join("/"), $[16] = id, $[17] = path, $[18] = t6, $[19] = t7;
|
|
7379
|
-
} else
|
|
7380
|
-
t6 = $[18], t7 = $[19];
|
|
7381
|
-
let t8;
|
|
7382
|
-
$[20] !== t6 || $[21] !== t7 ? (t8 = [t6, t7], $[20] = t6, $[21] = t7, $[22] = t8) : t8 = $[22], t5 = t8;
|
|
7383
|
-
const [itemPath, itemKey] = t5, itemState = tree.state[itemKey], focused = tree.focusedElement === rootElement, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootElement ? 0 : -1;
|
|
7384
|
-
let t9;
|
|
7385
|
-
const t10 = tree.level + 1;
|
|
7386
|
-
let t11;
|
|
7387
|
-
$[23] !== tree || $[24] !== t10 || $[25] !== itemPath ? (t11 = {
|
|
7031
|
+
} = tree, _id = useId(), id = idProp || _id, itemPath = useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = useMemo(() => ({
|
|
7388
7032
|
...tree,
|
|
7389
|
-
level:
|
|
7033
|
+
level: tree.level + 1,
|
|
7390
7034
|
path: itemPath
|
|
7391
|
-
},
|
|
7392
|
-
const contextValue = t9;
|
|
7393
|
-
let t12;
|
|
7394
|
-
$[27] !== onClick || $[28] !== setExpanded || $[29] !== itemKey || $[30] !== expanded || $[31] !== setFocusedElement || $[32] !== rootElement ? (t12 = (event) => {
|
|
7035
|
+
}), [itemPath, tree]), handleClick = useCallback((event) => {
|
|
7395
7036
|
onClick && onClick(event);
|
|
7396
7037
|
const target = event.target;
|
|
7397
|
-
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(
|
|
7398
|
-
},
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
t18,
|
|
7425
|
-
t19
|
|
7426
|
-
] }), $[57] = space, $[58] = t17, $[59] = t18, $[60] = t19, $[61] = t20) : t20 = $[61];
|
|
7427
|
-
let t21;
|
|
7428
|
-
$[62] !== muted || $[63] !== fontSize2 || $[64] !== weight || $[65] !== text ? (t21 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize2, textOverflow: "ellipsis", weight, children: text }) }), $[62] = muted, $[63] = fontSize2, $[64] = weight, $[65] = text, $[66] = t21) : t21 = $[66];
|
|
7429
|
-
let t22;
|
|
7430
|
-
$[67] !== padding || $[68] !== t20 || $[69] !== t21 ? (t22 = /* @__PURE__ */ jsxs(Flex, { padding, children: [
|
|
7431
|
-
t20,
|
|
7432
|
-
t21
|
|
7433
|
-
] }), $[67] = padding, $[68] = t20, $[69] = t21, $[70] = t22) : t22 = $[70];
|
|
7434
|
-
const content = t22;
|
|
7435
|
-
if (href) {
|
|
7436
|
-
const t232 = selected ? "" : void 0;
|
|
7437
|
-
let t242;
|
|
7438
|
-
$[71] !== tree.level || $[72] !== expanded || $[73] !== linkAs || $[74] !== href || $[75] !== tabIndex || $[76] !== content ? (t242 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content }), $[71] = tree.level, $[72] = expanded, $[73] = linkAs, $[74] = href, $[75] = tabIndex, $[76] = content, $[77] = t242) : t242 = $[77];
|
|
7439
|
-
let t252;
|
|
7440
|
-
$[78] !== children || $[79] !== expanded ? (t252 = children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }), $[78] = children, $[79] = expanded, $[80] = t252) : t252 = $[80];
|
|
7441
|
-
let t262;
|
|
7442
|
-
$[81] !== contextValue || $[82] !== t252 ? (t262 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t252 }), $[81] = contextValue, $[82] = t252, $[83] = t262) : t262 = $[83];
|
|
7443
|
-
let t272;
|
|
7444
|
-
return $[84] !== t232 || $[85] !== id || $[86] !== itemKey || $[87] !== restProps || $[88] !== handleClick || $[89] !== t242 || $[90] !== t262 ? (t272 = /* @__PURE__ */ jsxs(Root, { "data-selected": t232, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: setRootElement, role: "none", children: [
|
|
7445
|
-
t242,
|
|
7446
|
-
t262
|
|
7447
|
-
] }), $[84] = t232, $[85] = id, $[86] = itemKey, $[87] = restProps, $[88] = handleClick, $[89] = t242, $[90] = t262, $[91] = t272) : t272 = $[91], t272;
|
|
7448
|
-
}
|
|
7449
|
-
const t23 = selected ? "" : void 0;
|
|
7450
|
-
let t24;
|
|
7451
|
-
$[92] !== tree.level || $[93] !== content ? (t24 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content }), $[92] = tree.level, $[93] = content, $[94] = t24) : t24 = $[94];
|
|
7452
|
-
let t25;
|
|
7453
|
-
$[95] !== children || $[96] !== expanded ? (t25 = children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }), $[95] = children, $[96] = expanded, $[97] = t25) : t25 = $[97];
|
|
7454
|
-
let t26;
|
|
7455
|
-
$[98] !== contextValue || $[99] !== t25 ? (t26 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t25 }), $[98] = contextValue, $[99] = t25, $[100] = t26) : t26 = $[100];
|
|
7456
|
-
let t27;
|
|
7457
|
-
return $[101] !== t23 || $[102] !== id || $[103] !== itemKey || $[104] !== restProps || $[105] !== expanded || $[106] !== handleClick || $[107] !== handleKeyDown || $[108] !== tabIndex || $[109] !== t24 || $[110] !== t26 ? (t27 = /* @__PURE__ */ jsxs(Root, { "data-selected": t23, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: setRootElement, role: "treeitem", tabIndex, children: [
|
|
7458
|
-
t24,
|
|
7459
|
-
t26
|
|
7460
|
-
] }), $[101] = t23, $[102] = id, $[103] = itemKey, $[104] = restProps, $[105] = expanded, $[106] = handleClick, $[107] = handleKeyDown, $[108] = tabIndex, $[109] = t24, $[110] = t26, $[111] = t27) : t27 = $[111], t27;
|
|
7038
|
+
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
|
|
7039
|
+
}, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = useCallback((event_0) => {
|
|
7040
|
+
focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
|
|
7041
|
+
}, [focused]);
|
|
7042
|
+
useEffect(() => {
|
|
7043
|
+
if (rootRef.current)
|
|
7044
|
+
return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
|
|
7045
|
+
}, [expanded, itemPath, registerItem, selected]);
|
|
7046
|
+
const content = /* @__PURE__ */ jsxs(Flex, { padding, children: [
|
|
7047
|
+
/* @__PURE__ */ jsxs(Box, { marginRight: space, style: {
|
|
7048
|
+
visibility: IconComponent || children ? "visible" : "hidden",
|
|
7049
|
+
pointerEvents: "none"
|
|
7050
|
+
}, children: [
|
|
7051
|
+
IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize2, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }),
|
|
7052
|
+
!IconComponent && /* @__PURE__ */ jsx(ToggleArrowText, { muted, size: fontSize2, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
|
|
7053
|
+
transform: expanded ? "rotate(90deg)" : void 0
|
|
7054
|
+
} }) })
|
|
7055
|
+
] }),
|
|
7056
|
+
/* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize2, textOverflow: "ellipsis", weight, children: text }) })
|
|
7057
|
+
] });
|
|
7058
|
+
return href ? /* @__PURE__ */ jsxs(Root, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: rootRef, role: "none", children: [
|
|
7059
|
+
/* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content }),
|
|
7060
|
+
/* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
|
|
7061
|
+
] }) : /* @__PURE__ */ jsxs(Root, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
|
|
7062
|
+
/* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content }),
|
|
7063
|
+
/* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
|
|
7064
|
+
] });
|
|
7461
7065
|
});
|
|
7462
7066
|
TreeItem.displayName = "Memo(TreeItem)";
|
|
7463
7067
|
export {
|