@sanity/ui 3.4.3 → 3.4.5
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/refractor.cjs +18 -0
- package/dist/_chunks/refractor.cjs.map +1 -0
- package/dist/_chunks/refractor.js +9 -7
- package/dist/_chunks/refractor.js.map +1 -1
- package/dist/_chunks/{tabList.mjs → tabList.cjs} +922 -431
- package/dist/_chunks/tabList.cjs.map +1 -0
- package/dist/_chunks/tabList.js +471 -880
- package/dist/_chunks/tabList.js.map +1 -1
- package/dist/_chunks/{theme.mjs → theme.cjs} +266 -11
- package/dist/_chunks/theme.cjs.map +1 -0
- package/dist/_chunks/{theme.d.mts → theme.d.cts} +11 -11
- package/dist/_chunks/{theme.d.mts.map → theme.d.cts.map} +1 -1
- package/dist/_chunks/theme.d.ts +10 -10
- package/dist/_chunks/theme.js +10 -265
- package/dist/_chunks/theme.js.map +1 -1
- package/dist/_chunks/{useTheme.d.mts → useTheme.d.cts} +26 -26
- package/dist/_chunks/{useTheme.d.mts.map → useTheme.d.cts.map} +1 -1
- package/dist/_chunks/useTheme.d.ts +24 -24
- package/dist/_visual-editing.cjs +3 -0
- package/dist/{_visual-editing.d.mts → _visual-editing.d.cts} +1 -1
- package/dist/_visual-editing.js +2 -3
- package/dist/{index.mjs → index.cjs} +513 -511
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +12 -12
- package/dist/{index.d.mts.map → index.d.cts.map} +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +521 -501
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +3 -0
- package/dist/{theme.d.mts → theme.d.cts} +1 -1
- package/dist/theme.js +2 -3
- package/package.json +22 -23
- package/dist/_chunks/refractor.mjs +0 -20
- package/dist/_chunks/refractor.mjs.map +0 -1
- package/dist/_chunks/tabList.mjs.map +0 -1
- package/dist/_chunks/theme.mjs.map +0 -1
- package/dist/_visual-editing.mjs +0 -2
- package/dist/index.mjs.map +0 -1
- package/dist/theme.mjs +0 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { X as getTheme_v2 } from "./_chunks/theme.js";
|
|
2
|
+
import { $ as responsiveInputPaddingStyle, A as useMediaIndex, At as parseColor, B as _cardColorStyle, C as BoundaryElementContext, Ct as isHTMLTextAreaElement, D as Grid, Dt as hexToRgb, E as Inline, Et as createColorTheme, F as _ResizeObserver, Ft as studioTheme, G as SpanWithTextOverflow, H as Flex, I as useCustomValidity, J as textInputBaseStyle, K as responsiveRadiusStyle, L as useClickOutsideEvent, M as useGlobalKeyDown, Mt as rgbToHsl, N as useElementSize, Nt as rgba, O as usePrefersReducedMotion, Ot as hslToRgb, P as _elementSizeObserver, Pt as screen, Q as responsiveInputPaddingIconRightStyle, R as Card, S as isRecord, St as isHTMLSelectElement, T as KBD, Tt as EMPTY_RECORD, U as Text, V as Spinner, W as Box, X as textInputRepresentationStyle, Y as textInputFontSizeStyle, Z as textInputRootStyle, _ as usePortal, _t as containsOrEqualsElement, a as MenuDivider, at as useRootTheme, b as LayerProvider, bt as isHTMLElement, c as Tooltip, ct as responsiveTextFont, d as useDelayedState, dt as _fillCSSObject, et as focusRingBorderStyle, f as TextInput, ft as _getArrayProp, g as Portal, gt as _isEnterToClickElement, h as PortalProvider, ht as rem, i as MenuGroup, it as ThemeColorProvider, j as useMatchMedia, jt as rgbToHex, k as usePrefersDark, kt as multiply, l as useTooltipDelayGroup, lt as responsiveTextAlignStyle, m as Popover, mt as _responsive, n as Tab, nt as useTheme, o as Menu, ot as ThemeProvider, p as Stack, pt as _getResponsiveSpace, q as responsivePaddingStyle, r as MenuItem, rt as useTheme_v2, s as Hotkeys, st as createGlobalScopedContext, t as TabList, tt as focusRingStyle, u as TooltipDelayGroupContext, ut as responsiveFont, v as Layer, vt as isHTMLAnchorElement, w as Arrow, wt as EMPTY_ARRAY, x as useBoundaryElement, xt as isHTMLInputElement, y as useLayer, yt as isHTMLButtonElement, z as Button } from "./_chunks/tabList.js";
|
|
3
|
+
import { c } from "react-compiler-runtime";
|
|
4
|
+
import { ChevronDownIcon } from "@sanity/icons/ChevronDown";
|
|
5
|
+
import { Children, Component, Fragment, Suspense, cloneElement, forwardRef, isValidElement, lazy, startTransition, useContext, useEffect, useId, useImperativeHandle, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
6
|
+
import ReactIs from "react-is";
|
|
7
|
+
import { css, keyframes, styled } from "styled-components";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { SpinnerIcon } from "@sanity/icons/Spinner";
|
|
10
|
+
import { CheckmarkIcon } from "@sanity/icons/Checkmark";
|
|
11
|
+
import { RemoveIcon } from "@sanity/icons/Remove";
|
|
12
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
13
|
+
import { CloseIcon } from "@sanity/icons/Close";
|
|
14
|
+
import { ToggleArrowRightIcon } from "@sanity/icons/ToggleArrowRight";
|
|
6
15
|
/**
|
|
7
16
|
* @internal
|
|
8
17
|
*/
|
|
@@ -33,7 +42,7 @@ function _hasFocus(element) {
|
|
|
33
42
|
* @internal
|
|
34
43
|
*/
|
|
35
44
|
function isFocusable(element) {
|
|
36
|
-
return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 :
|
|
45
|
+
return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : isHTMLButtonElement(element) || isHTMLSelectElement(element) || isHTMLTextAreaElement(element) ? !element.disabled : !1;
|
|
37
46
|
}
|
|
38
47
|
/**
|
|
39
48
|
* @internal
|
|
@@ -51,7 +60,7 @@ function attemptFocus(element) {
|
|
|
51
60
|
function focusFirstDescendant(element) {
|
|
52
61
|
for (let i = 0; i < element.childNodes.length; i++) {
|
|
53
62
|
let child = element.childNodes[i];
|
|
54
|
-
if (
|
|
63
|
+
if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child))) return !0;
|
|
55
64
|
}
|
|
56
65
|
return !1;
|
|
57
66
|
}
|
|
@@ -61,7 +70,7 @@ function focusFirstDescendant(element) {
|
|
|
61
70
|
function focusLastDescendant(element) {
|
|
62
71
|
for (let i = element.childNodes.length - 1; i >= 0; i--) {
|
|
63
72
|
let child = element.childNodes[i];
|
|
64
|
-
if (
|
|
73
|
+
if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child))) return !0;
|
|
65
74
|
}
|
|
66
75
|
return !1;
|
|
67
76
|
}
|
|
@@ -78,46 +87,46 @@ function _isScrollable(el) {
|
|
|
78
87
|
* @internal
|
|
79
88
|
*/
|
|
80
89
|
function responsiveCodeFontStyle(props) {
|
|
81
|
-
return
|
|
90
|
+
return responsiveFont("code", props);
|
|
82
91
|
}
|
|
83
92
|
/**
|
|
84
93
|
* Get responsive CSS for the `heading` font style.
|
|
85
94
|
* @internal
|
|
86
95
|
*/
|
|
87
96
|
function responsiveHeadingFont(props) {
|
|
88
|
-
return
|
|
97
|
+
return responsiveFont("heading", props);
|
|
89
98
|
}
|
|
90
99
|
/**
|
|
91
100
|
* Get responsive CSS for the `label` font style.
|
|
92
101
|
* @internal
|
|
93
102
|
*/
|
|
94
103
|
function responsiveLabelFont(props) {
|
|
95
|
-
return
|
|
104
|
+
return responsiveFont("label", props);
|
|
96
105
|
}
|
|
97
106
|
function labelBaseStyle(props) {
|
|
98
|
-
let { $accent, $muted } = props, { font } =
|
|
99
|
-
return
|
|
107
|
+
let { $accent, $muted } = props, { font } = getTheme_v2(props.theme);
|
|
108
|
+
return css`text-transform:uppercase;${$accent && css`color:var(--card-accent-fg-color);`} ${$muted && css`color:var(--card-muted-fg-color);`} & code{font-family:${font.code.family};border-radius:1px;}& a{text-decoration:none;border-radius:1px;}& svg{display:inline;}& [data-sanity-icon]{vertical-align:baseline;}`;
|
|
100
109
|
}
|
|
101
|
-
const StyledLabel = /* @__PURE__ */
|
|
110
|
+
const StyledLabel = /* @__PURE__ */ styled.div.withConfig({
|
|
102
111
|
displayName: "StyledLabel",
|
|
103
112
|
componentId: "sc-rdxcu9-0"
|
|
104
|
-
})(responsiveLabelFont,
|
|
105
|
-
let $ =
|
|
113
|
+
})(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle), Label = forwardRef(function Label(props, ref) {
|
|
114
|
+
let $ = c(26), accent, align, childrenProp, restProps, t0, t1, textOverflow, weight;
|
|
106
115
|
$[0] === props ? (accent = $[1], align = $[2], childrenProp = $[3], restProps = $[4], t0 = $[5], t1 = $[6], textOverflow = $[7], weight = $[8]) : ({accent, align, children: childrenProp, muted: t0, size: t1, textOverflow, weight, ...restProps} = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = childrenProp, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = textOverflow, $[8] = weight);
|
|
107
116
|
let muted = t0 !== void 0 && t0, size = t1 === void 0 ? 2 : t1, children = childrenProp;
|
|
108
117
|
if (textOverflow === "ellipsis") {
|
|
109
118
|
let t2;
|
|
110
|
-
$[9] === children ? t2 = $[10] : (t2 = /* @__PURE__ */
|
|
119
|
+
$[9] === children ? t2 = $[10] : (t2 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t2), children = t2;
|
|
111
120
|
} else {
|
|
112
121
|
let t2;
|
|
113
|
-
$[11] === children ? t2 = $[12] : (t2 = /* @__PURE__ */
|
|
122
|
+
$[11] === children ? t2 = $[12] : (t2 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t2), children = t2;
|
|
114
123
|
}
|
|
115
124
|
let t2;
|
|
116
|
-
$[13] === align ? t2 = $[14] : (t2 =
|
|
125
|
+
$[13] === align ? t2 = $[14] : (t2 = _getArrayProp(align), $[13] = align, $[14] = t2);
|
|
117
126
|
let t3;
|
|
118
|
-
$[15] === size ? t3 = $[16] : (t3 =
|
|
127
|
+
$[15] === size ? t3 = $[16] : (t3 = _getArrayProp(size), $[15] = size, $[16] = t3);
|
|
119
128
|
let t4;
|
|
120
|
-
return $[17] !== accent || $[18] !== children || $[19] !== muted || $[20] !== ref || $[21] !== restProps || $[22] !== t2 || $[23] !== t3 || $[24] !== weight ? (t4 = /* @__PURE__ */
|
|
129
|
+
return $[17] !== accent || $[18] !== children || $[19] !== muted || $[20] !== ref || $[21] !== restProps || $[22] !== t2 || $[23] !== t3 || $[24] !== weight ? (t4 = /* @__PURE__ */ jsx(StyledLabel, {
|
|
121
130
|
"data-ui": "Label",
|
|
122
131
|
...restProps,
|
|
123
132
|
$accent: accent,
|
|
@@ -172,7 +181,7 @@ function avatarArrowStyle() {
|
|
|
172
181
|
};
|
|
173
182
|
}
|
|
174
183
|
function avatarRootStyle(props) {
|
|
175
|
-
let { $color } = props, { avatar } =
|
|
184
|
+
let { $color } = props, { avatar } = getTheme_v2(props.theme);
|
|
176
185
|
return {
|
|
177
186
|
"--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
|
|
178
187
|
"--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
|
|
@@ -192,23 +201,23 @@ function avatarRootStyle(props) {
|
|
|
192
201
|
font: "inherit",
|
|
193
202
|
color: "inherit",
|
|
194
203
|
outline: "none",
|
|
195
|
-
"&:focus": { boxShadow:
|
|
204
|
+
"&:focus": { boxShadow: focusRingStyle({ focusRing: avatar.focusRing }) },
|
|
196
205
|
"&:focus:not(:focus-visible)": { boxShadow: "none" }
|
|
197
206
|
}
|
|
198
207
|
};
|
|
199
208
|
}
|
|
200
209
|
function responsiveAvatarSizeStyle(props) {
|
|
201
|
-
let { avatar, media } =
|
|
202
|
-
return
|
|
210
|
+
let { avatar, media } = getTheme_v2(props.theme);
|
|
211
|
+
return _responsive(media, props.$size, (size) => {
|
|
203
212
|
let avatarSize = avatar.sizes[size] || avatar.sizes[0];
|
|
204
213
|
return {
|
|
205
|
-
width:
|
|
206
|
-
height:
|
|
207
|
-
borderRadius:
|
|
214
|
+
width: rem(avatarSize.size),
|
|
215
|
+
height: rem(avatarSize.size),
|
|
216
|
+
borderRadius: rem(avatarSize.size / 2),
|
|
208
217
|
"&>svg": {
|
|
209
|
-
width:
|
|
210
|
-
height:
|
|
211
|
-
borderRadius:
|
|
218
|
+
width: rem(avatarSize.size),
|
|
219
|
+
height: rem(avatarSize.size),
|
|
220
|
+
borderRadius: rem(avatarSize.size / 2)
|
|
212
221
|
}
|
|
213
222
|
};
|
|
214
223
|
});
|
|
@@ -245,86 +254,86 @@ function avatarStrokeStyle() {
|
|
|
245
254
|
}
|
|
246
255
|
};
|
|
247
256
|
}
|
|
248
|
-
const StyledAvatar = /* @__PURE__ */
|
|
257
|
+
const StyledAvatar = /* @__PURE__ */ styled.div.withConfig({
|
|
249
258
|
displayName: "StyledAvatar",
|
|
250
259
|
componentId: "sc-skil6v-0"
|
|
251
|
-
})(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1 = /* @__PURE__ */
|
|
260
|
+
})(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1 = /* @__PURE__ */ styled.div.withConfig({
|
|
252
261
|
displayName: "Arrow",
|
|
253
262
|
componentId: "sc-skil6v-1"
|
|
254
|
-
})(avatarStyle.arrow), BgStroke = /* @__PURE__ */
|
|
263
|
+
})(avatarStyle.arrow), BgStroke = /* @__PURE__ */ styled.ellipse.withConfig({
|
|
255
264
|
displayName: "BgStroke",
|
|
256
265
|
componentId: "sc-skil6v-2"
|
|
257
|
-
})(avatarStyle.bgStroke), Stroke = /* @__PURE__ */
|
|
266
|
+
})(avatarStyle.bgStroke), Stroke = /* @__PURE__ */ styled.ellipse.withConfig({
|
|
258
267
|
displayName: "Stroke",
|
|
259
268
|
componentId: "sc-skil6v-3"
|
|
260
|
-
})(avatarStyle.stroke), Initials = /* @__PURE__ */
|
|
269
|
+
})(avatarStyle.stroke), Initials = /* @__PURE__ */ styled.div.withConfig({
|
|
261
270
|
displayName: "Initials",
|
|
262
271
|
componentId: "sc-skil6v-4"
|
|
263
|
-
})(avatarStyle.initials), InitialsLabel = /* @__PURE__ */
|
|
272
|
+
})(avatarStyle.initials), InitialsLabel = /* @__PURE__ */ styled(Label).withConfig({
|
|
264
273
|
displayName: "InitialsLabel",
|
|
265
274
|
componentId: "sc-skil6v-5"
|
|
266
|
-
})({ color: "inherit" }), AvatarImage = /* @__PURE__ */
|
|
275
|
+
})({ color: "inherit" }), AvatarImage = /* @__PURE__ */ styled.svg.withConfig({
|
|
267
276
|
displayName: "AvatarImage",
|
|
268
277
|
componentId: "sc-skil6v-6"
|
|
269
|
-
})(avatarStyle.image), Avatar =
|
|
270
|
-
let $ =
|
|
278
|
+
})(avatarStyle.image), Avatar = forwardRef(function Avatar(props, ref) {
|
|
279
|
+
let $ = c(46), __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
|
|
271
280
|
$[0] === props ? (__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]) : ({__unstable_hideInnerStroke, as: asProp, color: t0, src, title, initials, onImageLoadError, arrowPosition: arrowPositionProp, animateArrowFrom, status: t1, size: t2, ...restProps} = 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);
|
|
272
|
-
let color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, { avatar } =
|
|
281
|
+
let color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, { avatar } = useTheme_v2(), as = ReactIs.isValidElementType(asProp) ? asProp : "div", size = _getArrayProp(sizeProp), _sizeRem = (avatar.sizes[size[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = useId(), [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = useState(!1), imageId = `avatar-image-${elementId}`, t3, t4;
|
|
273
282
|
$[13] !== arrowPosition || $[14] !== arrowPositionProp ? (t3 = () => {
|
|
274
283
|
if (arrowPosition === arrowPositionProp) return;
|
|
275
284
|
let raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
|
|
276
285
|
return () => cancelAnimationFrame(raf);
|
|
277
|
-
}, t4 = [arrowPosition, arrowPositionProp], $[13] = arrowPosition, $[14] = arrowPositionProp, $[15] = t3, $[16] = t4) : (t3 = $[15], t4 = $[16]),
|
|
286
|
+
}, t4 = [arrowPosition, arrowPositionProp], $[13] = arrowPosition, $[14] = arrowPositionProp, $[15] = t3, $[16] = t4) : (t3 = $[15], t4 = $[16]), useEffect(t3, t4);
|
|
278
287
|
let t5, t6;
|
|
279
288
|
$[17] === src ? (t5 = $[18], t6 = $[19]) : (t5 = () => {
|
|
280
289
|
src && setImageFailed(!1);
|
|
281
|
-
}, t6 = [src], $[17] = src, $[18] = t5, $[19] = t6),
|
|
290
|
+
}, t6 = [src], $[17] = src, $[18] = t5, $[19] = t6), useEffect(t5, t6);
|
|
282
291
|
let t7;
|
|
283
292
|
$[20] === onImageLoadError ? t7 = $[21] : (t7 = () => {
|
|
284
293
|
setImageFailed(!0), onImageLoadError && onImageLoadError(/* @__PURE__ */ Error("Avatar: the image failed to load"));
|
|
285
294
|
}, $[20] = onImageLoadError, $[21] = t7);
|
|
286
295
|
let handleImageError = t7, T0 = StyledAvatar, t8 = typeof as == "string" ? as : void 0, t10;
|
|
287
|
-
$[22] === color ? t10 = $[23] : (t10 = /* @__PURE__ */
|
|
296
|
+
$[22] === color ? t10 = $[23] : (t10 = /* @__PURE__ */ jsx(Arrow$1, { children: /* @__PURE__ */ jsx("svg", {
|
|
288
297
|
width: "11",
|
|
289
298
|
height: "7",
|
|
290
299
|
viewBox: "0 0 11 7",
|
|
291
300
|
fill: "none",
|
|
292
|
-
children: /* @__PURE__ */
|
|
301
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
293
302
|
d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z",
|
|
294
303
|
fill: color
|
|
295
304
|
})
|
|
296
305
|
}) }), $[22] = color, $[23] = t10);
|
|
297
306
|
let t11;
|
|
298
|
-
$[24] !== __unstable_hideInnerStroke || $[25] !== _radius || $[26] !== _sizeRem || $[27] !== handleImageError || $[28] !== imageFailed || $[29] !== imageId || $[30] !== src ? (t11 = !imageFailed && src && /* @__PURE__ */
|
|
307
|
+
$[24] !== __unstable_hideInnerStroke || $[25] !== _radius || $[26] !== _sizeRem || $[27] !== handleImageError || $[28] !== imageFailed || $[29] !== imageId || $[30] !== src ? (t11 = !imageFailed && src && /* @__PURE__ */ jsxs(AvatarImage, {
|
|
299
308
|
viewBox: `0 0 ${_sizeRem} ${_sizeRem}`,
|
|
300
309
|
fill: "none",
|
|
301
310
|
children: [
|
|
302
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", {
|
|
303
312
|
id: imageId,
|
|
304
313
|
patternContentUnits: "objectBoundingBox",
|
|
305
314
|
width: "1",
|
|
306
315
|
height: "1",
|
|
307
|
-
children: /* @__PURE__ */
|
|
316
|
+
children: /* @__PURE__ */ jsx("image", {
|
|
308
317
|
href: src,
|
|
309
318
|
width: "1",
|
|
310
319
|
height: "1",
|
|
311
320
|
onError: handleImageError
|
|
312
321
|
})
|
|
313
322
|
}) }),
|
|
314
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ jsx("circle", {
|
|
315
324
|
cx: _radius,
|
|
316
325
|
cy: _radius,
|
|
317
326
|
r: _radius,
|
|
318
327
|
fill: `url(#${imageId})`
|
|
319
328
|
}),
|
|
320
|
-
!__unstable_hideInnerStroke && /* @__PURE__ */
|
|
329
|
+
!__unstable_hideInnerStroke && /* @__PURE__ */ jsx(BgStroke, {
|
|
321
330
|
cx: _radius,
|
|
322
331
|
cy: _radius,
|
|
323
332
|
rx: _radius,
|
|
324
333
|
ry: _radius,
|
|
325
334
|
vectorEffect: "non-scaling-stroke"
|
|
326
335
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ jsx(Stroke, {
|
|
328
337
|
cx: _radius,
|
|
329
338
|
cy: _radius,
|
|
330
339
|
rx: _radius,
|
|
@@ -333,13 +342,13 @@ const StyledAvatar = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
|
333
342
|
})
|
|
334
343
|
]
|
|
335
344
|
}), $[24] = __unstable_hideInnerStroke, $[25] = _radius, $[26] = _sizeRem, $[27] = handleImageError, $[28] = imageFailed, $[29] = imageId, $[30] = src, $[31] = t11) : t11 = $[31];
|
|
336
|
-
let t12 = (imageFailed || !src) && initials && /* @__PURE__ */
|
|
345
|
+
let t12 = (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Initials, { children: /* @__PURE__ */ jsx(InitialsLabel, {
|
|
337
346
|
forwardedAs: "span",
|
|
338
|
-
size: size.map(_temp$
|
|
347
|
+
size: size.map(_temp$5),
|
|
339
348
|
weight: "medium",
|
|
340
349
|
children: initials
|
|
341
350
|
}) }) }), t13;
|
|
342
|
-
return $[32] !== T0 || $[33] !== arrowPosition || $[34] !== as || $[35] !== color || $[36] !== ref || $[37] !== restProps || $[38] !== size || $[39] !== status || $[40] !== t10 || $[41] !== t11 || $[42] !== t12 || $[43] !== t8 || $[44] !== title ? (t13 = /* @__PURE__ */
|
|
351
|
+
return $[32] !== T0 || $[33] !== arrowPosition || $[34] !== as || $[35] !== color || $[36] !== ref || $[37] !== restProps || $[38] !== size || $[39] !== status || $[40] !== t10 || $[41] !== t11 || $[42] !== t12 || $[43] !== t8 || $[44] !== title ? (t13 = /* @__PURE__ */ jsxs(T0, {
|
|
343
352
|
as,
|
|
344
353
|
"data-as": t8,
|
|
345
354
|
"data-ui": "Avatar",
|
|
@@ -358,85 +367,85 @@ const StyledAvatar = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
|
358
367
|
]
|
|
359
368
|
}), $[32] = T0, $[33] = arrowPosition, $[34] = as, $[35] = color, $[36] = ref, $[37] = restProps, $[38] = size, $[39] = status, $[40] = t10, $[41] = t11, $[42] = t12, $[43] = t8, $[44] = title, $[45] = t13) : t13 = $[45], t13;
|
|
360
369
|
});
|
|
361
|
-
function _temp$
|
|
370
|
+
function _temp$5(s) {
|
|
362
371
|
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
363
372
|
}
|
|
364
373
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
365
|
-
let { avatar, media } =
|
|
366
|
-
return
|
|
374
|
+
let { avatar, media } = getTheme_v2(props.theme);
|
|
375
|
+
return _responsive(media, props.$size, (size) => {
|
|
367
376
|
let avatarSize = avatar.sizes[size];
|
|
368
377
|
return avatarSize ? {
|
|
369
|
-
borderRadius:
|
|
370
|
-
minWidth:
|
|
371
|
-
height:
|
|
372
|
-
} :
|
|
378
|
+
borderRadius: rem(avatarSize.size / 2),
|
|
379
|
+
minWidth: rem(avatarSize.size),
|
|
380
|
+
height: rem(avatarSize.size)
|
|
381
|
+
} : EMPTY_RECORD;
|
|
373
382
|
});
|
|
374
383
|
}
|
|
375
384
|
function _avatarCounterBaseStyle(props) {
|
|
376
|
-
let { space } =
|
|
377
|
-
return
|
|
385
|
+
let { space } = getTheme_v2(props.theme);
|
|
386
|
+
return css`align-items:center;justify-content:center;box-sizing:border-box;user-select:none;color:inherit;color:var(--card-fg-color);background:var(--card-bg-color);box-shadow:0 0 0 1px var(--card-bg-color),inset 0 0 0 1px var(--card-hairline-hard-color);padding:0 ${rem(space[2])};&:not([hidden]){display:flex;}`;
|
|
378
387
|
}
|
|
379
|
-
const StyledAvatarCounter = /* @__PURE__ */
|
|
388
|
+
const StyledAvatarCounter = /* @__PURE__ */ styled.div.withConfig({
|
|
380
389
|
displayName: "StyledAvatarCounter",
|
|
381
390
|
componentId: "sc-6uv8jj-0"
|
|
382
|
-
})(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter =
|
|
383
|
-
let $ =
|
|
391
|
+
})(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = forwardRef(function AvatarCounter(props, ref) {
|
|
392
|
+
let $ = c(20), { count, size: t0 } = props, sizeProp = t0 === void 0 ? 1 : t0, T0, T1, t1, t2, t3, t4, t5;
|
|
384
393
|
if ($[0] !== ref || $[1] !== sizeProp) {
|
|
385
|
-
let size =
|
|
386
|
-
T1 = StyledAvatarCounter, t3 = size, t4 = "AvatarCounter", t5 = ref, T0 = Label, t1 = "span", t2 = size.map(_temp$
|
|
394
|
+
let size = _getArrayProp(sizeProp);
|
|
395
|
+
T1 = StyledAvatarCounter, t3 = size, t4 = "AvatarCounter", t5 = ref, T0 = Label, t1 = "span", t2 = size.map(_temp$4), $[0] = ref, $[1] = sizeProp, $[2] = T0, $[3] = T1, $[4] = t1, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5;
|
|
387
396
|
} else T0 = $[2], T1 = $[3], t1 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8];
|
|
388
397
|
let t6;
|
|
389
|
-
$[9] !== T0 || $[10] !== count || $[11] !== t1 || $[12] !== t2 ? (t6 = /* @__PURE__ */
|
|
398
|
+
$[9] !== T0 || $[10] !== count || $[11] !== t1 || $[12] !== t2 ? (t6 = /* @__PURE__ */ jsx(T0, {
|
|
390
399
|
as: t1,
|
|
391
400
|
size: t2,
|
|
392
401
|
weight: "medium",
|
|
393
402
|
children: count
|
|
394
403
|
}), $[9] = T0, $[10] = count, $[11] = t1, $[12] = t2, $[13] = t6) : t6 = $[13];
|
|
395
404
|
let t7;
|
|
396
|
-
return $[14] !== T1 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */
|
|
405
|
+
return $[14] !== T1 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsx(T1, {
|
|
397
406
|
$size: t3,
|
|
398
407
|
"data-ui": t4,
|
|
399
408
|
ref: t5,
|
|
400
409
|
children: t6
|
|
401
410
|
}), $[14] = T1, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19], t7;
|
|
402
411
|
});
|
|
403
|
-
function _temp$
|
|
412
|
+
function _temp$4(s) {
|
|
404
413
|
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
405
414
|
}
|
|
406
|
-
const BASE_STYLES =
|
|
415
|
+
const BASE_STYLES = css`white-space:nowrap;& > div{vertical-align:top;&:not([hidden]){display:inline-block;}}`;
|
|
407
416
|
function avatarStackStyle() {
|
|
408
417
|
return BASE_STYLES;
|
|
409
418
|
}
|
|
410
419
|
function responsiveAvatarStackSizeStyle(props) {
|
|
411
|
-
let { avatar, media } =
|
|
412
|
-
return
|
|
420
|
+
let { avatar, media } = getTheme_v2(props.theme);
|
|
421
|
+
return _responsive(media, props.$size, (size) => {
|
|
413
422
|
let avatarSize = avatar.sizes[size];
|
|
414
|
-
return avatarSize ? { "& > div + div": { marginLeft:
|
|
423
|
+
return avatarSize ? { "& > div + div": { marginLeft: rem(avatarSize.distance) } } : EMPTY_RECORD;
|
|
415
424
|
});
|
|
416
425
|
}
|
|
417
|
-
const StyledAvatarStack = /* @__PURE__ */
|
|
426
|
+
const StyledAvatarStack = /* @__PURE__ */ styled.div.withConfig({
|
|
418
427
|
displayName: "StyledAvatarStack",
|
|
419
428
|
componentId: "sc-ttibh-0"
|
|
420
|
-
})(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack =
|
|
421
|
-
let $ =
|
|
429
|
+
})(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = forwardRef(function AvatarStack(props, ref) {
|
|
430
|
+
let $ = c(38), childrenProp, restProps, t0, t1;
|
|
422
431
|
$[0] === props ? (childrenProp = $[1], restProps = $[2], t0 = $[3], t1 = $[4]) : ({children: childrenProp, maxLength: t0, size: t1, ...restProps} = props, $[0] = props, $[1] = childrenProp, $[2] = restProps, $[3] = t0, $[4] = t1);
|
|
423
432
|
let maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1, T0, t2, t3, t4, t5, t6, t7, t8;
|
|
424
433
|
if ($[5] !== childrenProp || $[6] !== maxLengthProp || $[7] !== ref || $[8] !== restProps || $[9] !== sizeProp) {
|
|
425
|
-
let children =
|
|
426
|
-
$[18] === sizeProp ? t9 = $[19] : (t9 =
|
|
434
|
+
let children = Children.toArray(childrenProp).filter(isValidElement), maxLength = Math.max(maxLengthProp, 0), t9;
|
|
435
|
+
$[18] === sizeProp ? t9 = $[19] : (t9 = _getArrayProp(sizeProp), $[18] = sizeProp, $[19] = t9);
|
|
427
436
|
let size = t9, len = children.length, extraCount = len - (maxLength - 1), visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
|
|
428
|
-
T0 = StyledAvatarStack, t2 = "AvatarStack", t3 = restProps, t4 = ref, t5 = size, $[20] !== len || $[21] !== size ? (t6 = len === 0 && /* @__PURE__ */
|
|
437
|
+
T0 = StyledAvatarStack, t2 = "AvatarStack", t3 = restProps, t4 = ref, t5 = size, $[20] !== len || $[21] !== size ? (t6 = len === 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, {
|
|
429
438
|
count: len,
|
|
430
439
|
size
|
|
431
|
-
}) }), $[20] = len, $[21] = size, $[22] = t6) : t6 = $[22], $[23] !== extraCount || $[24] !== len || $[25] !== size ? (t7 = len !== 0 && extraCount > 1 && /* @__PURE__ */
|
|
440
|
+
}) }), $[20] = len, $[21] = size, $[22] = t6) : t6 = $[22], $[23] !== extraCount || $[24] !== len || $[25] !== size ? (t7 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, {
|
|
432
441
|
count: extraCount,
|
|
433
442
|
size
|
|
434
443
|
}) }), $[23] = extraCount, $[24] = len, $[25] = size, $[26] = t7) : t7 = $[26];
|
|
435
444
|
let t10;
|
|
436
|
-
$[27] === size ? t10 = $[28] : (t10 = (child, childIndex) => /* @__PURE__ */
|
|
445
|
+
$[27] === size ? t10 = $[28] : (t10 = (child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, { size }) }, String(childIndex)), $[27] = size, $[28] = t10), t8 = visibleChildren.map(t10), $[5] = childrenProp, $[6] = maxLengthProp, $[7] = ref, $[8] = restProps, $[9] = sizeProp, $[10] = T0, $[11] = t2, $[12] = t3, $[13] = t4, $[14] = t5, $[15] = t6, $[16] = t7, $[17] = t8;
|
|
437
446
|
} else T0 = $[10], t2 = $[11], t3 = $[12], t4 = $[13], t5 = $[14], t6 = $[15], t7 = $[16], t8 = $[17];
|
|
438
447
|
let t9;
|
|
439
|
-
return $[29] !== T0 || $[30] !== t2 || $[31] !== t3 || $[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8 ? (t9 = /* @__PURE__ */
|
|
448
|
+
return $[29] !== T0 || $[30] !== t2 || $[31] !== t3 || $[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8 ? (t9 = /* @__PURE__ */ jsxs(T0, {
|
|
440
449
|
"data-ui": t2,
|
|
441
450
|
...t3,
|
|
442
451
|
ref: t4,
|
|
@@ -461,26 +470,26 @@ function badgeStyle(props) {
|
|
|
461
470
|
}
|
|
462
471
|
};
|
|
463
472
|
}
|
|
464
|
-
const StyledBadge = /* @__PURE__ */
|
|
473
|
+
const StyledBadge = /* @__PURE__ */ styled(Box).withConfig({
|
|
465
474
|
displayName: "StyledBadge",
|
|
466
475
|
componentId: "sc-nx309b-0"
|
|
467
|
-
})(
|
|
468
|
-
let $ =
|
|
476
|
+
})(responsiveRadiusStyle, badgeStyle), Badge = forwardRef(function Badge(props, ref) {
|
|
477
|
+
let $ = c(21), children, restProps, t0, t1, t2, t3;
|
|
469
478
|
if ($[0] !== props) {
|
|
470
479
|
let { children: t4, fontSize: t5, mode: _deprecated_mode, padding: t6, radius: t7, tone: t8, ...t9 } = props;
|
|
471
480
|
children = t4, t0 = t5, t1 = t6, t2 = t7, t3 = t8, restProps = t9, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2, $[6] = t3;
|
|
472
481
|
} else children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5], t3 = $[6];
|
|
473
482
|
let fontSize = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? "full" : t2, tone = t3 === void 0 ? "default" : t3, t4;
|
|
474
|
-
$[7] === radius ? t4 = $[8] : (t4 =
|
|
483
|
+
$[7] === radius ? t4 = $[8] : (t4 = _getArrayProp(radius), $[7] = radius, $[8] = t4);
|
|
475
484
|
let t5;
|
|
476
|
-
$[9] === padding ? t5 = $[10] : (t5 =
|
|
485
|
+
$[9] === padding ? t5 = $[10] : (t5 = _getArrayProp(padding), $[9] = padding, $[10] = t5);
|
|
477
486
|
let t6;
|
|
478
|
-
$[11] !== children || $[12] !== fontSize ? (t6 = /* @__PURE__ */
|
|
487
|
+
$[11] !== children || $[12] !== fontSize ? (t6 = /* @__PURE__ */ jsx(Text, {
|
|
479
488
|
size: fontSize,
|
|
480
489
|
children
|
|
481
490
|
}), $[11] = children, $[12] = fontSize, $[13] = t6) : t6 = $[13];
|
|
482
491
|
let t7;
|
|
483
|
-
return $[14] !== ref || $[15] !== restProps || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 || $[19] !== tone ? (t7 = /* @__PURE__ */
|
|
492
|
+
return $[14] !== ref || $[15] !== restProps || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 || $[19] !== tone ? (t7 = /* @__PURE__ */ jsx(StyledBadge, {
|
|
484
493
|
"data-ui": "Badge",
|
|
485
494
|
...restProps,
|
|
486
495
|
$tone: tone,
|
|
@@ -495,7 +504,8 @@ const StyledBadge = /* @__PURE__ */ (0, styled_components.styled)(require_tabLis
|
|
|
495
504
|
* @beta
|
|
496
505
|
*/
|
|
497
506
|
function useArrayProp(val, defaultVal) {
|
|
498
|
-
|
|
507
|
+
let $ = c(3), t0;
|
|
508
|
+
return $[0] !== defaultVal || $[1] !== val ? (t0 = _getArrayProp(val, defaultVal), $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2], t0;
|
|
499
509
|
}
|
|
500
510
|
function _getElements(element, elementsArg) {
|
|
501
511
|
let ret = [element];
|
|
@@ -517,9 +527,11 @@ function _getElements(element, elementsArg) {
|
|
|
517
527
|
* return <button ref={buttonRef} />
|
|
518
528
|
* ```
|
|
519
529
|
*/
|
|
520
|
-
function useClickOutside(listener,
|
|
521
|
-
let
|
|
522
|
-
|
|
530
|
+
function useClickOutside(listener, t0, boundaryElement) {
|
|
531
|
+
let $ = c(12), elementsArg = t0 === void 0 ? EMPTY_ARRAY : t0, [element, setElement] = useState(null), t1;
|
|
532
|
+
$[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
|
|
533
|
+
let [elements, setElements] = useState(t1), elementsRef = useRef(elements), t2, t3;
|
|
534
|
+
$[3] !== element || $[4] !== elementsArg ? (t2 = () => {
|
|
523
535
|
let prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
|
|
524
536
|
if (prevElements.length !== nextElements.length) {
|
|
525
537
|
setElements(nextElements), elementsRef.current = nextElements;
|
|
@@ -529,27 +541,29 @@ function useClickOutside(listener, elementsArg = require_tabList.wt, boundaryEle
|
|
|
529
541
|
setElements(nextElements), elementsRef.current = nextElements;
|
|
530
542
|
return;
|
|
531
543
|
}
|
|
532
|
-
for (let
|
|
544
|
+
for (let el_0 of nextElements) if (!prevElements.includes(el_0)) {
|
|
533
545
|
setElements(nextElements), elementsRef.current = nextElements;
|
|
534
546
|
return;
|
|
535
547
|
}
|
|
536
|
-
}, [element, elementsArg]
|
|
548
|
+
}, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
|
|
549
|
+
let t4, t5;
|
|
550
|
+
return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
|
|
537
551
|
if (!listener) return;
|
|
538
552
|
let handleWindowMouseDown = (evt) => {
|
|
539
553
|
let target = evt.target;
|
|
540
554
|
if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
|
|
541
|
-
for (let
|
|
555
|
+
for (let el_1 of elements) if (target === el_1 || el_1.contains(target)) return;
|
|
542
556
|
listener(evt);
|
|
543
557
|
}
|
|
544
558
|
};
|
|
545
559
|
return window.addEventListener("mousedown", handleWindowMouseDown), () => {
|
|
546
560
|
window.removeEventListener("mousedown", handleWindowMouseDown);
|
|
547
561
|
};
|
|
548
|
-
}, [
|
|
562
|
+
}, t5 = [
|
|
549
563
|
boundaryElement,
|
|
550
564
|
listener,
|
|
551
565
|
elements
|
|
552
|
-
]), setElement;
|
|
566
|
+
], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
|
|
553
567
|
}
|
|
554
568
|
/**
|
|
555
569
|
* Subscribe to the rect of a DOM element.
|
|
@@ -558,7 +572,7 @@ function useClickOutside(listener, elementsArg = require_tabList.wt, boundaryEle
|
|
|
558
572
|
* @deprecated Use `useElementSize` instead
|
|
559
573
|
*/
|
|
560
574
|
function useElementRect(element) {
|
|
561
|
-
return
|
|
575
|
+
return useElementSize(element)?._contentRect || null;
|
|
562
576
|
}
|
|
563
577
|
/**
|
|
564
578
|
* @beta
|
|
@@ -571,27 +585,27 @@ function useElementRect(element) {
|
|
|
571
585
|
* ```
|
|
572
586
|
*/
|
|
573
587
|
function useForwardedRef(ref) {
|
|
574
|
-
let
|
|
575
|
-
return
|
|
588
|
+
let $ = c(1), innerRef = useRef(null), t0;
|
|
589
|
+
return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], useImperativeHandle(ref, t0), innerRef;
|
|
576
590
|
}
|
|
577
591
|
function checkboxBaseStyles() {
|
|
578
|
-
return
|
|
592
|
+
return css`position:relative;display:inline-block;`;
|
|
579
593
|
}
|
|
580
594
|
function inputElementStyles(props) {
|
|
581
|
-
let { color, input, radius } =
|
|
582
|
-
return
|
|
595
|
+
let { color, input, radius } = getTheme_v2(props.theme), { focusRing } = input.checkbox;
|
|
596
|
+
return css`position:absolute;top:0;left:0;width:100%;height:100%;outline:none;opacity:0;z-index:1;padding:0;margin:0;& + span{position:relative;display:block;height:${rem(input.checkbox.size)};width:${rem(input.checkbox.size)};box-sizing:border-box;box-shadow:${focusRingBorderStyle({
|
|
583
597
|
color: color.input.default.enabled.border,
|
|
584
598
|
width: input.border.width
|
|
585
|
-
})};border-radius:${
|
|
599
|
+
})};border-radius:${rem(radius[2])};line-height:1;background-color:${color.input.default.enabled.bg};& > svg{display:block;position:absolute;opacity:0;height:100%;width:100%;& > path{vector-effect:non-scaling-stroke;stroke-width:1.5px !important;}}}&:checked + span{background:${color.input.default.enabled.fg};box-shadow:${focusRingBorderStyle({
|
|
586
600
|
color: color.input.default.enabled.fg,
|
|
587
601
|
width: input.border.width
|
|
588
|
-
})};color:${color.input.default.enabled.bg};}&:not(:disabled):focus:focus-visible + span{box-shadow:${
|
|
602
|
+
})};color:${color.input.default.enabled.bg};}&:not(:disabled):focus:focus-visible + span{box-shadow:${focusRingStyle({ focusRing })};}&:not(:disabled):focus:focus-visible&:checked + span{box-shadow:${focusRingStyle({ focusRing: {
|
|
589
603
|
width: 1,
|
|
590
604
|
offset: 1
|
|
591
|
-
} })};}&[data-error] + span{background-color:${color.input.invalid.enabled.border};box-shadow:${
|
|
605
|
+
} })};}&[data-error] + span{background-color:${color.input.invalid.enabled.border};box-shadow:${focusRingBorderStyle({
|
|
592
606
|
width: input.border.width,
|
|
593
607
|
color: color.input.invalid.enabled.muted.bg
|
|
594
|
-
})};color:${color.input.default.disabled.fg};}&[data-error]&:checked + span{background-color:${color.input.invalid.enabled.muted.bg};color:${color.input.default.enabled.bg};}&[data-error]&:checked&:not(:disabled):focus:focus-visible + span{box-shadow:${
|
|
608
|
+
})};color:${color.input.default.disabled.fg};}&[data-error]&:checked + span{background-color:${color.input.invalid.enabled.muted.bg};color:${color.input.default.enabled.bg};}&[data-error]&:checked&:not(:disabled):focus:focus-visible + span{box-shadow:${focusRingStyle({
|
|
595
609
|
border: {
|
|
596
610
|
width: input.border.width,
|
|
597
611
|
color: color.input.invalid.readOnly.muted.bg
|
|
@@ -600,31 +614,31 @@ function inputElementStyles(props) {
|
|
|
600
614
|
width: 1,
|
|
601
615
|
offset: 1
|
|
602
616
|
}
|
|
603
|
-
})};}&:disabled + span{background-color:${color.input.default.disabled.bg};box-shadow:${
|
|
617
|
+
})};}&:disabled + span{background-color:${color.input.default.disabled.bg};box-shadow:${focusRingBorderStyle({
|
|
604
618
|
width: input.border.width,
|
|
605
619
|
color: color.input.default.disabled.border
|
|
606
|
-
})};color:${color.input.default.disabled.fg};}&:disabled&:checked + span{background-color:${color.input.default.disabled.muted.bg};}&[data-read-only] + span{background-color:${color.input.default.readOnly.bg};box-shadow:${
|
|
620
|
+
})};color:${color.input.default.disabled.fg};}&:disabled&:checked + span{background-color:${color.input.default.disabled.muted.bg};}&[data-read-only] + span{background-color:${color.input.default.readOnly.bg};box-shadow:${focusRingBorderStyle({
|
|
607
621
|
width: input.border.width,
|
|
608
622
|
color: color.input.default.readOnly.border
|
|
609
623
|
})};color:${color.input.default.readOnly.fg};}&[data-read-only]&:checked + span{background-color:${color.input.default.readOnly.muted.bg};}&:checked + span > svg:first-child{opacity:1;}&:indeterminate + span > svg:last-child{opacity:1;}`;
|
|
610
624
|
}
|
|
611
|
-
const StyledCheckbox = /* @__PURE__ */
|
|
625
|
+
const StyledCheckbox = /* @__PURE__ */ styled.div.withConfig({
|
|
612
626
|
displayName: "StyledCheckbox",
|
|
613
627
|
componentId: "sc-964wbx-0"
|
|
614
|
-
})(checkboxBaseStyles), Input$4 = /* @__PURE__ */
|
|
628
|
+
})(checkboxBaseStyles), Input$4 = /* @__PURE__ */ styled.input.withConfig({
|
|
615
629
|
displayName: "Input",
|
|
616
630
|
componentId: "sc-964wbx-1"
|
|
617
|
-
})(inputElementStyles), Checkbox =
|
|
618
|
-
let $ =
|
|
631
|
+
})(inputElementStyles), Checkbox = forwardRef(function Checkbox(props, forwardedRef) {
|
|
632
|
+
let $ = c(25), checked, className, customValidity, disabled, indeterminate, readOnly, restProps, style;
|
|
619
633
|
$[0] === props ? (checked = $[1], className = $[2], customValidity = $[3], disabled = $[4], indeterminate = $[5], readOnly = $[6], restProps = $[7], style = $[8]) : ({checked, className, disabled, indeterminate, customValidity, readOnly, style, ...restProps} = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = customValidity, $[4] = disabled, $[5] = indeterminate, $[6] = readOnly, $[7] = restProps, $[8] = style);
|
|
620
|
-
let ref =
|
|
621
|
-
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[9] = t0) : t0 = $[9],
|
|
634
|
+
let ref = useRef(null), t0;
|
|
635
|
+
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[9] = t0) : t0 = $[9], useImperativeHandle(forwardedRef, t0);
|
|
622
636
|
let t1, t2;
|
|
623
637
|
$[10] === indeterminate ? (t1 = $[11], t2 = $[12]) : (t1 = () => {
|
|
624
638
|
ref.current && (ref.current.indeterminate = indeterminate || !1);
|
|
625
|
-
}, t2 = [indeterminate], $[10] = indeterminate, $[11] = t1, $[12] = t2),
|
|
639
|
+
}, t2 = [indeterminate], $[10] = indeterminate, $[11] = t1, $[12] = t2), useEffect(t1, t2), useCustomValidity(ref, customValidity);
|
|
626
640
|
let t3 = !disabled && readOnly ? "" : void 0, t4 = customValidity ? "" : void 0, t5 = disabled || readOnly, t6;
|
|
627
|
-
$[13] !== checked || $[14] !== readOnly || $[15] !== restProps || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 ? (t6 = /* @__PURE__ */
|
|
641
|
+
$[13] !== checked || $[14] !== readOnly || $[15] !== restProps || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 ? (t6 = /* @__PURE__ */ jsx(Input$4, {
|
|
628
642
|
"data-read-only": t3,
|
|
629
643
|
"data-error": t4,
|
|
630
644
|
...restProps,
|
|
@@ -635,9 +649,9 @@ const StyledCheckbox = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
|
635
649
|
ref
|
|
636
650
|
}), $[13] = checked, $[14] = readOnly, $[15] = restProps, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6) : t6 = $[19];
|
|
637
651
|
let t7;
|
|
638
|
-
$[20] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */
|
|
652
|
+
$[20] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx(CheckmarkIcon, {}), /* @__PURE__ */ jsx(RemoveIcon, {})] }), $[20] = t7) : t7 = $[20];
|
|
639
653
|
let t8;
|
|
640
|
-
return $[21] !== className || $[22] !== style || $[23] !== t6 ? (t8 = /* @__PURE__ */
|
|
654
|
+
return $[21] !== className || $[22] !== style || $[23] !== t6 ? (t8 = /* @__PURE__ */ jsxs(StyledCheckbox, {
|
|
641
655
|
className,
|
|
642
656
|
"data-ui": "Checkbox",
|
|
643
657
|
style,
|
|
@@ -645,7 +659,7 @@ const StyledCheckbox = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
|
645
659
|
}), $[21] = className, $[22] = style, $[23] = t6, $[24] = t8) : t8 = $[24], t8;
|
|
646
660
|
});
|
|
647
661
|
function codeSyntaxHighlightingStyle({ theme }) {
|
|
648
|
-
let { color: { syntax: color } } =
|
|
662
|
+
let { color: { syntax: color } } = getTheme_v2(theme);
|
|
649
663
|
return {
|
|
650
664
|
"&.atrule": { color: color.atrule },
|
|
651
665
|
"&.attr-name": { color: color.attrName },
|
|
@@ -686,30 +700,30 @@ function codeSyntaxHighlightingStyle({ theme }) {
|
|
|
686
700
|
};
|
|
687
701
|
}
|
|
688
702
|
function codeBaseStyle() {
|
|
689
|
-
return
|
|
703
|
+
return css`color:var(--card-code-fg-color);& code{font-family:inherit;&.refractor .token{${codeSyntaxHighlightingStyle}}}& a{color:inherit;text-decoration:underline;border-radius:1px;}& svg{display:inline;}& [data-sanity-icon]{vertical-align:baseline;}`;
|
|
690
704
|
}
|
|
691
|
-
const LazyRefractor =
|
|
705
|
+
const LazyRefractor = lazy(() => import("./_chunks/refractor.js")), StyledCode = /* @__PURE__ */ styled.pre.withConfig({
|
|
692
706
|
displayName: "StyledCode",
|
|
693
707
|
componentId: "sc-yq3svj-0"
|
|
694
|
-
})(codeBaseStyle, responsiveCodeFontStyle), Code =
|
|
695
|
-
let $ =
|
|
708
|
+
})(codeBaseStyle, responsiveCodeFontStyle), Code = forwardRef(function Code(props, ref) {
|
|
709
|
+
let $ = c(22), children, language, restProps, t0, weight;
|
|
696
710
|
$[0] === props ? (children = $[1], language = $[2], restProps = $[3], t0 = $[4], weight = $[5]) : ({children, language, size: t0, weight, ...restProps} = props, $[0] = props, $[1] = children, $[2] = language, $[3] = restProps, $[4] = t0, $[5] = weight);
|
|
697
711
|
let size = t0 === void 0 ? 2 : t0, t1;
|
|
698
|
-
$[6] === size ? t1 = $[7] : (t1 =
|
|
712
|
+
$[6] === size ? t1 = $[7] : (t1 = _getArrayProp(size), $[6] = size, $[7] = t1);
|
|
699
713
|
let t2 = weight, t3;
|
|
700
|
-
$[8] === children ? t3 = $[9] : (t3 = /* @__PURE__ */
|
|
714
|
+
$[8] === children ? t3 = $[9] : (t3 = /* @__PURE__ */ jsx("code", { children }), $[8] = children, $[9] = t3);
|
|
701
715
|
let t4;
|
|
702
|
-
$[10] !== children || $[11] !== language ? (t4 = /* @__PURE__ */
|
|
716
|
+
$[10] !== children || $[11] !== language ? (t4 = /* @__PURE__ */ jsx(LazyRefractor, {
|
|
703
717
|
language,
|
|
704
718
|
value: children
|
|
705
719
|
}), $[10] = children, $[11] = language, $[12] = t4) : t4 = $[12];
|
|
706
720
|
let t5;
|
|
707
|
-
$[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */
|
|
721
|
+
$[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */ jsx(Suspense, {
|
|
708
722
|
fallback: t3,
|
|
709
723
|
children: t4
|
|
710
724
|
}), $[13] = t3, $[14] = t4, $[15] = t5) : t5 = $[15];
|
|
711
725
|
let t6;
|
|
712
|
-
return $[16] !== ref || $[17] !== restProps || $[18] !== t1 || $[19] !== t2 || $[20] !== t5 ? (t6 = /* @__PURE__ */
|
|
726
|
+
return $[16] !== ref || $[17] !== restProps || $[18] !== t1 || $[19] !== t2 || $[20] !== t5 ? (t6 = /* @__PURE__ */ jsx(StyledCode, {
|
|
713
727
|
"data-ui": "Code",
|
|
714
728
|
...restProps,
|
|
715
729
|
$size: t1,
|
|
@@ -725,19 +739,19 @@ function containerBaseStyle() {
|
|
|
725
739
|
return BASE_STYLE;
|
|
726
740
|
}
|
|
727
741
|
function responsiveContainerWidthStyle(props) {
|
|
728
|
-
let { container, media } =
|
|
729
|
-
return
|
|
742
|
+
let { container, media } = getTheme_v2(props.theme);
|
|
743
|
+
return _responsive(media, props.$width, (val) => ({ maxWidth: val === "auto" ? "none" : rem(container[val]) }));
|
|
730
744
|
}
|
|
731
|
-
const StyledContainer = /* @__PURE__ */
|
|
745
|
+
const StyledContainer = /* @__PURE__ */ styled(Box).withConfig({
|
|
732
746
|
displayName: "StyledContainer",
|
|
733
747
|
componentId: "sc-kuh7wj-0"
|
|
734
|
-
})(containerBaseStyle, responsiveContainerWidthStyle), Container =
|
|
735
|
-
let $ =
|
|
748
|
+
})(containerBaseStyle, responsiveContainerWidthStyle), Container = forwardRef(function Container(props, ref) {
|
|
749
|
+
let $ = c(11), as, restProps, t0;
|
|
736
750
|
$[0] === props ? (as = $[1], restProps = $[2], t0 = $[3]) : ({as, width: t0, ...restProps} = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = t0);
|
|
737
751
|
let width = t0 === void 0 ? 2 : t0, t1;
|
|
738
|
-
$[4] === width ? t1 = $[5] : (t1 =
|
|
752
|
+
$[4] === width ? t1 = $[5] : (t1 = _getArrayProp(width), $[4] = width, $[5] = t1);
|
|
739
753
|
let t2;
|
|
740
|
-
return $[6] !== as || $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */
|
|
754
|
+
return $[6] !== as || $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(StyledContainer, {
|
|
741
755
|
"data-ui": "Container",
|
|
742
756
|
...restProps,
|
|
743
757
|
$width: t1,
|
|
@@ -746,28 +760,28 @@ const StyledContainer = /* @__PURE__ */ (0, styled_components.styled)(require_ta
|
|
|
746
760
|
}), $[6] = as, $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
|
|
747
761
|
});
|
|
748
762
|
function headingBaseStyle(props) {
|
|
749
|
-
let { $accent, $muted } = props, { font } =
|
|
750
|
-
return
|
|
763
|
+
let { $accent, $muted } = props, { font } = getTheme_v2(props.theme);
|
|
764
|
+
return css`${$accent && css`color:var(--card-accent-fg-color);`} ${$muted && css`color:var(--card-muted-fg-color);`} & code{font-family:${font.code.family};border-radius:1px;}& a{text-decoration:none;border-radius:1px;color:var(--card-link-color);outline:none;@media (hover:hover){&:hover{text-decoration:underline;}}&:focus{box-shadow:0 0 0 1px var(--card-bg-color),0 0 0 3px var(--card-focus-ring-color);}&:focus:not(:focus-visible){box-shadow:none;}}& strong{font-weight:${font.heading.weights.bold};}& svg{display:inline;}& [data-sanity-icon]{vertical-align:baseline;}`;
|
|
751
765
|
}
|
|
752
|
-
const StyledHeading = /* @__PURE__ */
|
|
766
|
+
const StyledHeading = /* @__PURE__ */ styled.div.withConfig({
|
|
753
767
|
displayName: "StyledHeading",
|
|
754
768
|
componentId: "sc-48fn8j-0"
|
|
755
|
-
})(headingBaseStyle,
|
|
756
|
-
let $ =
|
|
769
|
+
})(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont), Heading = forwardRef(function Heading(props, ref) {
|
|
770
|
+
let $ = c(26), align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
|
|
757
771
|
$[0] === props ? (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]) : ({accent: t0, align, children: childrenProp, muted: t1, size: t2, textOverflow, weight, ...restProps} = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight);
|
|
758
772
|
let accent = t0 !== void 0 && t0, muted = t1 !== void 0 && t1, size = t2 === void 0 ? 2 : t2, children = childrenProp;
|
|
759
773
|
if (textOverflow === "ellipsis") {
|
|
760
774
|
let t3;
|
|
761
|
-
$[9] === children ? t3 = $[10] : (t3 = /* @__PURE__ */
|
|
775
|
+
$[9] === children ? t3 = $[10] : (t3 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t3), children = t3;
|
|
762
776
|
}
|
|
763
777
|
let t3;
|
|
764
|
-
$[11] === align ? t3 = $[12] : (t3 =
|
|
778
|
+
$[11] === align ? t3 = $[12] : (t3 = _getArrayProp(align), $[11] = align, $[12] = t3);
|
|
765
779
|
let t4;
|
|
766
|
-
$[13] === size ? t4 = $[14] : (t4 =
|
|
780
|
+
$[13] === size ? t4 = $[14] : (t4 = _getArrayProp(size), $[13] = size, $[14] = t4);
|
|
767
781
|
let t5;
|
|
768
|
-
$[15] === children ? t5 = $[16] : (t5 = /* @__PURE__ */
|
|
782
|
+
$[15] === children ? t5 = $[16] : (t5 = /* @__PURE__ */ jsx("span", { children }), $[15] = children, $[16] = t5);
|
|
769
783
|
let t6;
|
|
770
|
-
return $[17] !== accent || $[18] !== muted || $[19] !== ref || $[20] !== restProps || $[21] !== t3 || $[22] !== t4 || $[23] !== t5 || $[24] !== weight ? (t6 = /* @__PURE__ */
|
|
784
|
+
return $[17] !== accent || $[18] !== muted || $[19] !== ref || $[20] !== restProps || $[21] !== t3 || $[22] !== t4 || $[23] !== t5 || $[24] !== weight ? (t6 = /* @__PURE__ */ jsx(StyledHeading, {
|
|
771
785
|
"data-ui": "Heading",
|
|
772
786
|
...restProps,
|
|
773
787
|
$accent: accent,
|
|
@@ -783,13 +797,13 @@ const StyledHeading = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
|
783
797
|
* @public
|
|
784
798
|
*/
|
|
785
799
|
function BoundaryElementProvider(props) {
|
|
786
|
-
let $ =
|
|
800
|
+
let $ = c(5), { children, element } = props, t0;
|
|
787
801
|
$[0] === element ? t0 = $[1] : (t0 = {
|
|
788
802
|
version: 0,
|
|
789
803
|
element
|
|
790
804
|
}, $[0] = element, $[1] = t0);
|
|
791
805
|
let value = t0, t1;
|
|
792
|
-
return $[2] !== children || $[3] !== value ? (t1 = /* @__PURE__ */
|
|
806
|
+
return $[2] !== children || $[3] !== value ? (t1 = /* @__PURE__ */ jsx(BoundaryElementContext.Provider, {
|
|
793
807
|
value,
|
|
794
808
|
children
|
|
795
809
|
}), $[2] = children, $[3] = value, $[4] = t1) : t1 = $[4], t1;
|
|
@@ -815,10 +829,10 @@ function findMinBreakpoints(media, width) {
|
|
|
815
829
|
* DO NOT USE IN PRODUCTION.
|
|
816
830
|
* @beta
|
|
817
831
|
*/
|
|
818
|
-
const ElementQuery =
|
|
819
|
-
let $ =
|
|
832
|
+
const ElementQuery = forwardRef(function ElementQuery(props, forwardedRef) {
|
|
833
|
+
let $ = c(18), theme = useTheme_v2(), _media, children, restProps;
|
|
820
834
|
$[0] === props ? (_media = $[1], children = $[2], restProps = $[3]) : ({children, media: _media, ...restProps} = props, $[0] = props, $[1] = _media, $[2] = children, $[3] = restProps);
|
|
821
|
-
let media = _media ?? theme.media, [element, setElement] =
|
|
835
|
+
let media = _media ?? theme.media, [element, setElement] = useState(null), width = useElementSize(element)?.border.width ?? window.innerWidth, t0;
|
|
822
836
|
if ($[4] !== media || $[5] !== width) {
|
|
823
837
|
let eq = findMaxBreakpoints(media, width);
|
|
824
838
|
t0 = eq.length ? eq.join(" ") : void 0, $[4] = media, $[5] = width, $[6] = t0;
|
|
@@ -829,9 +843,9 @@ const ElementQuery = (0, react.forwardRef)(function ElementQuery(props, forwarde
|
|
|
829
843
|
t1 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = media, $[8] = width, $[9] = t1;
|
|
830
844
|
} else t1 = $[9];
|
|
831
845
|
let min = t1, t2, t3;
|
|
832
|
-
$[10] === element ? (t2 = $[11], t3 = $[12]) : (t2 = () => element, t3 = [element], $[10] = element, $[11] = t2, $[12] = t3),
|
|
846
|
+
$[10] === element ? (t2 = $[11], t3 = $[12]) : (t2 = () => element, t3 = [element], $[10] = element, $[11] = t2, $[12] = t3), useImperativeHandle(forwardedRef, t2, t3);
|
|
833
847
|
let t4;
|
|
834
|
-
return $[13] !== children || $[14] !== max || $[15] !== min || $[16] !== restProps ? (t4 = /* @__PURE__ */
|
|
848
|
+
return $[13] !== children || $[14] !== max || $[15] !== min || $[16] !== restProps ? (t4 = /* @__PURE__ */ jsx("div", {
|
|
835
849
|
"data-ui": "ElementQuery",
|
|
836
850
|
...restProps,
|
|
837
851
|
"data-eq-max": max,
|
|
@@ -844,7 +858,7 @@ const ElementQuery = (0, react.forwardRef)(function ElementQuery(props, forwarde
|
|
|
844
858
|
* DO NOT USE IN PRODUCTION
|
|
845
859
|
* @beta
|
|
846
860
|
*/
|
|
847
|
-
var ErrorBoundary = class extends
|
|
861
|
+
var ErrorBoundary = class extends Component {
|
|
848
862
|
state = { error: null };
|
|
849
863
|
static getDerivedStateFromError(error) {
|
|
850
864
|
return { error };
|
|
@@ -857,34 +871,34 @@ var ErrorBoundary = class extends react.Component {
|
|
|
857
871
|
}
|
|
858
872
|
render() {
|
|
859
873
|
let { error } = this.state;
|
|
860
|
-
return error ? /* @__PURE__ */
|
|
874
|
+
return error ? /* @__PURE__ */ jsx(Code, { children: typeof error?.message == "string" ? error.message : "Error" }) : this.props.children;
|
|
861
875
|
}
|
|
862
876
|
};
|
|
863
|
-
const StyledSrOnly =
|
|
877
|
+
const StyledSrOnly = styled.div.withConfig({
|
|
864
878
|
displayName: "StyledSrOnly",
|
|
865
879
|
componentId: "sc-ow9exq-0"
|
|
866
|
-
})`display:block;width:0;height:0;position:absolute;overflow:hidden;overflow:clip;`, SrOnly =
|
|
867
|
-
let $ =
|
|
868
|
-
return $[0] !== as || $[1] !== children || $[2] !== ref ? (t0 = /* @__PURE__ */
|
|
880
|
+
})`display:block;width:0;height:0;position:absolute;overflow:hidden;overflow:clip;`, SrOnly = forwardRef(function SrOnly(props, ref) {
|
|
881
|
+
let $ = c(4), { as, children } = props, t0;
|
|
882
|
+
return $[0] !== as || $[1] !== children || $[2] !== ref ? (t0 = /* @__PURE__ */ jsx(StyledSrOnly, {
|
|
869
883
|
"aria-hidden": !0,
|
|
870
884
|
as,
|
|
871
885
|
"data-ui": "SrOnly",
|
|
872
886
|
ref,
|
|
873
887
|
children
|
|
874
888
|
}), $[0] = as, $[1] = children, $[2] = ref, $[3] = t0) : t0 = $[3], t0;
|
|
875
|
-
}), StyledVirtualList =
|
|
889
|
+
}), StyledVirtualList = styled.div.withConfig({
|
|
876
890
|
displayName: "StyledVirtualList",
|
|
877
891
|
componentId: "sc-ok1q5x-0"
|
|
878
|
-
})`position:relative;`, ItemWrapper =
|
|
892
|
+
})`position:relative;`, ItemWrapper = styled.div.withConfig({
|
|
879
893
|
displayName: "ItemWrapper",
|
|
880
894
|
componentId: "sc-ok1q5x-1"
|
|
881
|
-
})`position:absolute;left:0;right:0;`, VirtualList =
|
|
882
|
-
let $ =
|
|
895
|
+
})`position:absolute;left:0;right:0;`, VirtualList = forwardRef(function VirtualList(props, forwardedRef) {
|
|
896
|
+
let $ = c(44), getItemKey, onChange, renderItem, restProps, t0, t1, t2;
|
|
883
897
|
$[0] === props ? (getItemKey = $[1], onChange = $[2], renderItem = $[3], restProps = $[4], t0 = $[5], t1 = $[6], t2 = $[7]) : ({as: t0, gap: t1, getItemKey, items: t2, onChange, renderItem, ...restProps} = props, $[0] = props, $[1] = getItemKey, $[2] = onChange, $[3] = renderItem, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = t2);
|
|
884
898
|
let as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1, t3;
|
|
885
899
|
$[8] === t2 ? t3 = $[9] : (t3 = t2 === void 0 ? [] : t2, $[8] = t2, $[9] = t3);
|
|
886
|
-
let items = t3, { space } =
|
|
887
|
-
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10],
|
|
900
|
+
let items = t3, { space } = useTheme_v2(), ref = useRef(null), wrapperRef = useRef(null), [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), [itemHeight, setItemHeight] = useState(-1), t4;
|
|
901
|
+
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], useImperativeHandle(forwardedRef, t4);
|
|
888
902
|
let t5;
|
|
889
903
|
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
|
|
890
904
|
if (!wrapperRef.current) return;
|
|
@@ -892,7 +906,7 @@ const StyledSrOnly = styled_components.styled.div.withConfig({
|
|
|
892
906
|
firstElement instanceof HTMLElement && setItemHeight(firstElement.offsetHeight);
|
|
893
907
|
}, $[11] = t5) : t5 = $[11];
|
|
894
908
|
let t6;
|
|
895
|
-
$[12] === renderItem ? t6 = $[13] : (t6 = [renderItem], $[12] = renderItem, $[13] = t6),
|
|
909
|
+
$[12] === renderItem ? t6 = $[13] : (t6 = [renderItem], $[12] = renderItem, $[13] = t6), useEffect(t5, t6);
|
|
896
910
|
let t7, t8;
|
|
897
911
|
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => {
|
|
898
912
|
if (!ref.current) return;
|
|
@@ -903,7 +917,7 @@ const StyledSrOnly = styled_components.styled.div.withConfig({
|
|
|
903
917
|
setScrollTop(scrollEl.scrollTop);
|
|
904
918
|
};
|
|
905
919
|
scrollEl.addEventListener("scroll", handleScroll, { passive: !0 });
|
|
906
|
-
let ro = new
|
|
920
|
+
let ro = new _ResizeObserver((entries) => {
|
|
907
921
|
setScrollHeight(entries[0].contentRect.height);
|
|
908
922
|
});
|
|
909
923
|
return ro.observe(scrollEl), handleScroll(), () => {
|
|
@@ -918,7 +932,7 @@ const StyledSrOnly = styled_components.styled.div.withConfig({
|
|
|
918
932
|
return window.addEventListener("scroll", handleScroll_0, { passive: !0 }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
|
|
919
933
|
window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
|
|
920
934
|
};
|
|
921
|
-
}, t8 = [], $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]),
|
|
935
|
+
}, t8 = [], $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), useEffect(t7, t8);
|
|
922
936
|
let 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, t10, t9;
|
|
923
937
|
$[16] !== fromIndex || $[17] !== gap || $[18] !== itemHeight || $[19] !== onChange || $[20] !== scrollHeight || $[21] !== scrollTop || $[22] !== space || $[23] !== toIndex ? (t9 = () => {
|
|
924
938
|
onChange && onChange({
|
|
@@ -938,7 +952,7 @@ const StyledSrOnly = styled_components.styled.div.withConfig({
|
|
|
938
952
|
scrollTop,
|
|
939
953
|
space,
|
|
940
954
|
toIndex
|
|
941
|
-
], $[16] = fromIndex, $[17] = gap, $[18] = itemHeight, $[19] = onChange, $[20] = scrollHeight, $[21] = scrollTop, $[22] = space, $[23] = toIndex, $[24] = t10, $[25] = t9) : (t10 = $[24], t9 = $[25]),
|
|
955
|
+
], $[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);
|
|
942
956
|
let t11;
|
|
943
957
|
$[26] !== fromIndex || $[27] !== gap || $[28] !== getItemKey || $[29] !== itemHeight || $[30] !== items || $[31] !== renderItem || $[32] !== space || $[33] !== toIndex ? (t11 = {
|
|
944
958
|
fromIndex,
|
|
@@ -953,13 +967,13 @@ const StyledSrOnly = styled_components.styled.div.withConfig({
|
|
|
953
967
|
let children = useChildren(t11), t12;
|
|
954
968
|
$[35] === height ? t12 = $[36] : (t12 = { height }, $[35] = height, $[36] = t12);
|
|
955
969
|
let t13;
|
|
956
|
-
$[37] !== children || $[38] !== t12 ? (t13 = /* @__PURE__ */
|
|
970
|
+
$[37] !== children || $[38] !== t12 ? (t13 = /* @__PURE__ */ jsx("div", {
|
|
957
971
|
ref: wrapperRef,
|
|
958
972
|
style: t12,
|
|
959
973
|
children
|
|
960
974
|
}), $[37] = children, $[38] = t12, $[39] = t13) : t13 = $[39];
|
|
961
975
|
let t14;
|
|
962
|
-
return $[40] !== as || $[41] !== restProps || $[42] !== t13 ? (t14 = /* @__PURE__ */
|
|
976
|
+
return $[40] !== as || $[41] !== restProps || $[42] !== t13 ? (t14 = /* @__PURE__ */ jsx(StyledVirtualList, {
|
|
963
977
|
as,
|
|
964
978
|
"data-ui": "VirtualList",
|
|
965
979
|
...restProps,
|
|
@@ -968,20 +982,20 @@ const StyledSrOnly = styled_components.styled.div.withConfig({
|
|
|
968
982
|
}), $[40] = as, $[41] = restProps, $[42] = t13, $[43] = t14) : t14 = $[43], t14;
|
|
969
983
|
});
|
|
970
984
|
function useChildren(t0) {
|
|
971
|
-
let $ =
|
|
985
|
+
let $ = c(21), { fromIndex, gap, getItemKey, itemHeight, items, renderItem, space, toIndex } = t0;
|
|
972
986
|
if (!renderItem || items.length === 0) return null;
|
|
973
987
|
if (itemHeight === -1) {
|
|
974
988
|
let t1;
|
|
975
989
|
$[0] !== items[0] || $[1] !== renderItem ? (t1 = renderItem(items[0]), $[0] = items[0], $[1] = renderItem, $[2] = t1) : t1 = $[2];
|
|
976
990
|
let t2;
|
|
977
|
-
return $[3] === t1 ? t2 = $[4] : (t2 = [/* @__PURE__ */
|
|
991
|
+
return $[3] === t1 ? t2 = $[4] : (t2 = [/* @__PURE__ */ jsx(ItemWrapper, { children: t1 }, 0)], $[3] = t1, $[4] = t2), t2;
|
|
978
992
|
}
|
|
979
993
|
let t1;
|
|
980
994
|
if ($[5] !== fromIndex || $[6] !== gap || $[7] !== getItemKey || $[8] !== itemHeight || $[9] !== items || $[10] !== renderItem || $[11] !== space || $[12] !== toIndex) {
|
|
981
995
|
let t2;
|
|
982
996
|
$[14] !== fromIndex || $[15] !== gap || $[16] !== getItemKey || $[17] !== itemHeight || $[18] !== renderItem || $[19] !== space ? (t2 = (item, _itemIndex) => {
|
|
983
997
|
let itemIndex = fromIndex + _itemIndex, node = renderItem(item), key = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
|
|
984
|
-
return /* @__PURE__ */
|
|
998
|
+
return /* @__PURE__ */ jsx(ItemWrapper, {
|
|
985
999
|
style: { top: itemIndex * (itemHeight + space[gap]) },
|
|
986
1000
|
children: node
|
|
987
1001
|
}, key);
|
|
@@ -995,40 +1009,40 @@ function findScrollable(parentNode) {
|
|
|
995
1009
|
return _scrollEl;
|
|
996
1010
|
}
|
|
997
1011
|
function radioBaseStyle() {
|
|
998
|
-
return
|
|
1012
|
+
return css`position:relative;&:not([hidden]){display:inline-block;}&[data-read-only]{outline:1px solid red;}`;
|
|
999
1013
|
}
|
|
1000
1014
|
function inputElementStyle(props) {
|
|
1001
|
-
let { color, input } =
|
|
1002
|
-
return
|
|
1015
|
+
let { color, input } = getTheme_v2(props.theme), dist = (input.radio.size - input.radio.markSize) / 2;
|
|
1016
|
+
return css`appearance:none;position:absolute;top:0;left:0;opacity:0;height:100%;width:100%;outline:none;z-index:1;padding:0;margin:0;border-radius:${rem(input.radio.size / 2)};border:none;& + span{display:block;position:relative;height:${rem(input.radio.size)};width:${rem(input.radio.size)};border-radius:${rem(input.radio.size / 2)};background:${color.input.default.enabled.bg};box-shadow:${focusRingBorderStyle({
|
|
1003
1017
|
color: color.input.default.enabled.border,
|
|
1004
1018
|
width: input.border.width
|
|
1005
|
-
})};&::after{content:'';position:absolute;top:${
|
|
1019
|
+
})};&::after{content:'';position:absolute;top:${rem(dist)};left:${rem(dist)};height:${rem(input.radio.markSize)};width:${rem(input.radio.markSize)};border-radius:${rem(input.radio.markSize / 2)};background:${color.input.default.enabled.fg};opacity:0;}}&:not(:disabled):focus + span{box-shadow:${focusRingStyle({
|
|
1006
1020
|
border: {
|
|
1007
1021
|
width: input.border.width,
|
|
1008
1022
|
color: color.input.default.enabled.border
|
|
1009
1023
|
},
|
|
1010
1024
|
focusRing: input.radio.focusRing
|
|
1011
|
-
})};}&:not(:disabled):focus:not(:focus-visible) + span{box-shadow:${
|
|
1025
|
+
})};}&:not(:disabled):focus:not(:focus-visible) + span{box-shadow:${focusRingBorderStyle({
|
|
1012
1026
|
color: color.input.default.enabled.border,
|
|
1013
1027
|
width: input.border.width
|
|
1014
|
-
})};}&:checked + span::after{opacity:1;}&[data-error] + span{background-color:${color.input.invalid.enabled.border};box-shadow:${
|
|
1028
|
+
})};}&:checked + span::after{opacity:1;}&[data-error] + span{background-color:${color.input.invalid.enabled.border};box-shadow:${focusRingBorderStyle({
|
|
1015
1029
|
width: input.border.width,
|
|
1016
1030
|
color: color.input.invalid.enabled.muted.bg
|
|
1017
1031
|
})};&::after{background:${color.input.invalid.enabled.muted.bg};}}&[data-read-only] + span{box-shadow:0 0 0 1px ${color.input.default.readOnly.border};background:${color.input.default.readOnly.bg};&::after{background:${color.input.default.readOnly.border};}}&:not([data-read-only]):disabled + span{box-shadow:0 0 0 1px ${color.input.default.disabled.border};background:${color.input.default.disabled.bg};&::after{background:${color.input.default.disabled.border};}}`;
|
|
1018
1032
|
}
|
|
1019
|
-
const StyledRadio = /* @__PURE__ */
|
|
1033
|
+
const StyledRadio = /* @__PURE__ */ styled.div.withConfig({
|
|
1020
1034
|
displayName: "StyledRadio",
|
|
1021
1035
|
componentId: "sc-zbat2j-0"
|
|
1022
|
-
})(radioBaseStyle), Input$3 = /* @__PURE__ */
|
|
1036
|
+
})(radioBaseStyle), Input$3 = /* @__PURE__ */ styled.input.withConfig({
|
|
1023
1037
|
displayName: "Input",
|
|
1024
1038
|
componentId: "sc-zbat2j-1"
|
|
1025
|
-
})(inputElementStyle), Radio =
|
|
1026
|
-
let $ =
|
|
1039
|
+
})(inputElementStyle), Radio = forwardRef(function Radio(props, forwardedRef) {
|
|
1040
|
+
let $ = c(19), className, customValidity, disabled, readOnly, restProps, style;
|
|
1027
1041
|
$[0] === props ? (className = $[1], customValidity = $[2], disabled = $[3], readOnly = $[4], restProps = $[5], style = $[6]) : ({className, disabled, style, customValidity, readOnly, ...restProps} = props, $[0] = props, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = readOnly, $[5] = restProps, $[6] = style);
|
|
1028
|
-
let ref =
|
|
1029
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[7] = t0) : t0 = $[7],
|
|
1042
|
+
let ref = useRef(null), t0;
|
|
1043
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[7] = t0) : t0 = $[7], useImperativeHandle(forwardedRef, t0), useCustomValidity(ref, customValidity);
|
|
1030
1044
|
let t1 = !disabled && readOnly ? "" : void 0, t2 = customValidity ? "" : void 0, t3 = disabled || readOnly, t4;
|
|
1031
|
-
$[8] !== readOnly || $[9] !== restProps || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */
|
|
1045
|
+
$[8] !== readOnly || $[9] !== restProps || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsx(Input$3, {
|
|
1032
1046
|
"data-read-only": t1,
|
|
1033
1047
|
"data-error": t2,
|
|
1034
1048
|
...restProps,
|
|
@@ -1038,9 +1052,9 @@ const StyledRadio = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
|
1038
1052
|
type: "radio"
|
|
1039
1053
|
}), $[8] = readOnly, $[9] = restProps, $[10] = t1, $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13];
|
|
1040
1054
|
let t5;
|
|
1041
|
-
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */
|
|
1055
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */ jsx("span", {}), $[14] = t5) : t5 = $[14];
|
|
1042
1056
|
let t6;
|
|
1043
|
-
return $[15] !== className || $[16] !== style || $[17] !== t4 ? (t6 = /* @__PURE__ */
|
|
1057
|
+
return $[15] !== className || $[16] !== style || $[17] !== t4 ? (t6 = /* @__PURE__ */ jsxs(StyledRadio, {
|
|
1044
1058
|
className,
|
|
1045
1059
|
"data-ui": "Radio",
|
|
1046
1060
|
style,
|
|
@@ -1048,85 +1062,85 @@ const StyledRadio = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
|
1048
1062
|
}), $[15] = className, $[16] = style, $[17] = t4, $[18] = t6) : t6 = $[18], t6;
|
|
1049
1063
|
});
|
|
1050
1064
|
function rootStyle() {
|
|
1051
|
-
return
|
|
1065
|
+
return css`position:relative;width:-moz-available;width:-webkit-fill-available;width:stretch;&:not([hidden]){display:inline-block;}`;
|
|
1052
1066
|
}
|
|
1053
1067
|
function inputBaseStyle(props) {
|
|
1054
|
-
let { font } =
|
|
1055
|
-
return
|
|
1068
|
+
let { font } = getTheme_v2(props.theme);
|
|
1069
|
+
return css`-webkit-font-smoothing:antialiased;appearance:none;border:0;font-family:${font.text.family};color:inherit;width:100%;outline:none;margin:0;&:disabled{opacity:1;}`;
|
|
1056
1070
|
}
|
|
1057
1071
|
function inputColorStyle(props) {
|
|
1058
|
-
let { color, input } =
|
|
1059
|
-
return
|
|
1072
|
+
let { color, input } = getTheme_v2(props.theme);
|
|
1073
|
+
return css`background-color:${color.input.default.enabled.bg};color:${color.input.default.enabled.fg};box-shadow:${focusRingBorderStyle({
|
|
1060
1074
|
color: color.input.default.enabled.border,
|
|
1061
1075
|
width: input.border.width
|
|
1062
|
-
})};@media (hover:hover){&:not(:disabled):hover{background-color:${color.input.default.hovered.bg};color:${color.input.default.hovered.fg};box-shadow:${
|
|
1076
|
+
})};@media (hover:hover){&:not(:disabled):hover{background-color:${color.input.default.hovered.bg};color:${color.input.default.hovered.fg};box-shadow:${focusRingBorderStyle({
|
|
1063
1077
|
color: color.input.default.hovered.border,
|
|
1064
1078
|
width: input.border.width
|
|
1065
|
-
})};}}&:not(:disabled):focus{box-shadow:${
|
|
1079
|
+
})};}}&:not(:disabled):focus{box-shadow:${focusRingStyle({
|
|
1066
1080
|
border: {
|
|
1067
1081
|
width: input.border.width,
|
|
1068
1082
|
color: color.input.default.enabled.border
|
|
1069
1083
|
},
|
|
1070
1084
|
focusRing: input.select.focusRing
|
|
1071
|
-
})};}&[data-read-only]{background-color:${color.input.default.readOnly.bg};color:${color.input.default.readOnly.fg};box-shadow:${
|
|
1085
|
+
})};}&[data-read-only]{background-color:${color.input.default.readOnly.bg};color:${color.input.default.readOnly.fg};box-shadow:${focusRingBorderStyle({
|
|
1072
1086
|
color: color.input.default.readOnly.border,
|
|
1073
1087
|
width: input.border.width
|
|
1074
|
-
})};}&:not([data-read-only]):disabled{background-color:${color.input.default.disabled.bg};color:${color.input.default.disabled.fg};box-shadow:${
|
|
1088
|
+
})};}&:not([data-read-only]):disabled{background-color:${color.input.default.disabled.bg};color:${color.input.default.disabled.fg};box-shadow:${focusRingBorderStyle({
|
|
1075
1089
|
color: color.input.default.disabled.border,
|
|
1076
1090
|
width: input.border.width
|
|
1077
1091
|
})};}`;
|
|
1078
1092
|
}
|
|
1079
1093
|
function textSize(size) {
|
|
1080
1094
|
return {
|
|
1081
|
-
fontSize:
|
|
1082
|
-
lineHeight: `${
|
|
1095
|
+
fontSize: rem(size.fontSize),
|
|
1096
|
+
lineHeight: `${rem(size.lineHeight)}`
|
|
1083
1097
|
};
|
|
1084
1098
|
}
|
|
1085
1099
|
function inputTextSizeStyle(props) {
|
|
1086
|
-
let { $fontSize } = props, { font, media } =
|
|
1087
|
-
return
|
|
1100
|
+
let { $fontSize } = props, { font, media } = getTheme_v2(props.theme);
|
|
1101
|
+
return _responsive(media, $fontSize, (sizeIndex) => textSize(font.text.sizes[sizeIndex] || font.text.sizes[2]));
|
|
1088
1102
|
}
|
|
1089
1103
|
function inputStyle() {
|
|
1090
1104
|
return [
|
|
1091
|
-
|
|
1105
|
+
responsiveRadiusStyle,
|
|
1092
1106
|
inputBaseStyle,
|
|
1093
1107
|
inputColorStyle,
|
|
1094
1108
|
inputTextSizeStyle,
|
|
1095
|
-
|
|
1109
|
+
responsiveInputPaddingIconRightStyle
|
|
1096
1110
|
];
|
|
1097
1111
|
}
|
|
1098
1112
|
function iconBoxStyle(props) {
|
|
1099
|
-
let { color } =
|
|
1100
|
-
return
|
|
1113
|
+
let { color } = getTheme_v2(props.theme);
|
|
1114
|
+
return css`pointer-events:none;position:absolute;top:0;right:0;--card-fg-color:${color.input.default.enabled.fg};@media (hover:hover){select:not(disabled):not(:read-only):hover + &&{--card-fg-color:${color.input.default.hovered.fg};}}select:disabled + &&{--card-fg-color:${color.input.default.disabled.fg};}select[data-read-only] + &&{--card-fg-color:${color.input.default.readOnly.fg};}`;
|
|
1101
1115
|
}
|
|
1102
1116
|
const selectStyle = {
|
|
1103
1117
|
root: rootStyle,
|
|
1104
1118
|
input: inputStyle,
|
|
1105
1119
|
iconBox: iconBoxStyle
|
|
1106
|
-
}, StyledSelect = /* @__PURE__ */
|
|
1120
|
+
}, StyledSelect = /* @__PURE__ */ styled.div.withConfig({
|
|
1107
1121
|
displayName: "StyledSelect",
|
|
1108
1122
|
componentId: "sc-ecog6m-0"
|
|
1109
|
-
})(selectStyle.root), Input$2 = /* @__PURE__ */
|
|
1123
|
+
})(selectStyle.root), Input$2 = /* @__PURE__ */ styled.select.withConfig({
|
|
1110
1124
|
displayName: "Input",
|
|
1111
1125
|
componentId: "sc-ecog6m-1"
|
|
1112
|
-
})(selectStyle.input), IconBox = /* @__PURE__ */
|
|
1126
|
+
})(selectStyle.input), IconBox = /* @__PURE__ */ styled(Box).withConfig({
|
|
1113
1127
|
displayName: "IconBox",
|
|
1114
1128
|
componentId: "sc-ecog6m-2"
|
|
1115
|
-
})(selectStyle.iconBox), Select =
|
|
1116
|
-
let $ =
|
|
1129
|
+
})(selectStyle.iconBox), Select = forwardRef(function Select(props, forwardedRef) {
|
|
1130
|
+
let $ = c(38), children, customValidity, disabled, gap, readOnly, restProps, t0, t1, t2, t3;
|
|
1117
1131
|
$[0] === props ? (children = $[1], customValidity = $[2], disabled = $[3], gap = $[4], readOnly = $[5], restProps = $[6], t0 = $[7], t1 = $[8], t2 = $[9], t3 = $[10]) : ({children, customValidity, disabled, fontSize: t0, gap, padding: t1, radius: t2, readOnly, space: t3, ...restProps} = props, $[0] = props, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = gap, $[5] = readOnly, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2, $[10] = t3);
|
|
1118
|
-
let fontSize = t0 === void 0 ? 2 : t0, padding = t1 === void 0 ? 3 : t1, radius = t2 === void 0 ? 2 : t2, spacing = gap === void 0 ? t3 === void 0 ? 3 : t3 : gap, ref =
|
|
1119
|
-
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[11] = t4) : t4 = $[11],
|
|
1132
|
+
let fontSize = t0 === void 0 ? 2 : t0, padding = t1 === void 0 ? 3 : t1, radius = t2 === void 0 ? 2 : t2, spacing = gap === void 0 ? t3 === void 0 ? 3 : t3 : gap, ref = useRef(null), t4;
|
|
1133
|
+
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[11] = t4) : t4 = $[11], useImperativeHandle(forwardedRef, t4), useCustomValidity(ref, customValidity);
|
|
1120
1134
|
let t5 = !disabled && readOnly ? "" : void 0, t6;
|
|
1121
|
-
$[12] === fontSize ? t6 = $[13] : (t6 =
|
|
1135
|
+
$[12] === fontSize ? t6 = $[13] : (t6 = _getArrayProp(fontSize), $[12] = fontSize, $[13] = t6);
|
|
1122
1136
|
let t7;
|
|
1123
|
-
$[14] === padding ? t7 = $[15] : (t7 =
|
|
1137
|
+
$[14] === padding ? t7 = $[15] : (t7 = _getArrayProp(padding), $[14] = padding, $[15] = t7);
|
|
1124
1138
|
let t8;
|
|
1125
|
-
$[16] === radius ? t8 = $[17] : (t8 =
|
|
1139
|
+
$[16] === radius ? t8 = $[17] : (t8 = _getArrayProp(radius), $[16] = radius, $[17] = t8);
|
|
1126
1140
|
let t9;
|
|
1127
|
-
$[18] === spacing ? t9 = $[19] : (t9 =
|
|
1141
|
+
$[18] === spacing ? t9 = $[19] : (t9 = _getArrayProp(spacing), $[18] = spacing, $[19] = t9);
|
|
1128
1142
|
let t10 = disabled || readOnly, t11;
|
|
1129
|
-
$[20] !== children || $[21] !== restProps || $[22] !== t10 || $[23] !== t5 || $[24] !== t6 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9 ? (t11 = /* @__PURE__ */
|
|
1143
|
+
$[20] !== children || $[21] !== restProps || $[22] !== t10 || $[23] !== t5 || $[24] !== t6 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9 ? (t11 = /* @__PURE__ */ jsx(Input$2, {
|
|
1130
1144
|
"data-read-only": t5,
|
|
1131
1145
|
"data-ui": "Select",
|
|
1132
1146
|
...restProps,
|
|
@@ -1139,67 +1153,67 @@ const selectStyle = {
|
|
|
1139
1153
|
children
|
|
1140
1154
|
}), $[20] = children, $[21] = restProps, $[22] = t10, $[23] = t5, $[24] = t6, $[25] = t7, $[26] = t8, $[27] = t9, $[28] = t11) : t11 = $[28];
|
|
1141
1155
|
let t12;
|
|
1142
|
-
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */
|
|
1156
|
+
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx(ChevronDownIcon, {}), $[29] = t12) : t12 = $[29];
|
|
1143
1157
|
let t13;
|
|
1144
|
-
$[30] === fontSize ? t13 = $[31] : (t13 = /* @__PURE__ */
|
|
1158
|
+
$[30] === fontSize ? t13 = $[31] : (t13 = /* @__PURE__ */ jsx(Text, {
|
|
1145
1159
|
size: fontSize,
|
|
1146
1160
|
children: t12
|
|
1147
1161
|
}), $[30] = fontSize, $[31] = t13);
|
|
1148
1162
|
let t14;
|
|
1149
|
-
$[32] !== padding || $[33] !== t13 ? (t14 = /* @__PURE__ */
|
|
1163
|
+
$[32] !== padding || $[33] !== t13 ? (t14 = /* @__PURE__ */ jsx(IconBox, {
|
|
1150
1164
|
padding,
|
|
1151
1165
|
children: t13
|
|
1152
1166
|
}), $[32] = padding, $[33] = t13, $[34] = t14) : t14 = $[34];
|
|
1153
1167
|
let t15;
|
|
1154
|
-
return $[35] !== t11 || $[36] !== t14 ? (t15 = /* @__PURE__ */
|
|
1168
|
+
return $[35] !== t11 || $[36] !== t14 ? (t15 = /* @__PURE__ */ jsxs(StyledSelect, {
|
|
1155
1169
|
"data-ui": "Select",
|
|
1156
1170
|
children: [t11, t14]
|
|
1157
1171
|
}), $[35] = t11, $[36] = t14, $[37] = t15) : t15 = $[37], t15;
|
|
1158
1172
|
});
|
|
1159
1173
|
function switchBaseStyles() {
|
|
1160
|
-
return
|
|
1174
|
+
return css`position:relative;&:not([hidden]){display:inline-block;}`;
|
|
1161
1175
|
}
|
|
1162
1176
|
function switchInputStyles() {
|
|
1163
|
-
return
|
|
1177
|
+
return css`position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;height:100%;width:100%;outline:none;padding:0;margin:0;z-index:1;`;
|
|
1164
1178
|
}
|
|
1165
1179
|
function switchRepresentationStyles(props) {
|
|
1166
|
-
let { color, input } =
|
|
1167
|
-
return
|
|
1180
|
+
let { color, input } = getTheme_v2(props.theme);
|
|
1181
|
+
return css`--switch-bg-color:${color.input.default.enabled.border};--switch-fg-color:${color.input.default.enabled.bg};--switch-box-shadow:none;&:not([hidden]){display:block;}position:relative;width:${rem(input.switch.width)};height:${rem(input.switch.height)};border-radius:${rem(input.switch.height / 2)};pointer-events:none;&:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;box-shadow:var(--switch-box-shadow);border-radius:inherit;}input:focus + &&{--switch-box-shadow:${focusRingStyle({ focusRing: input.switch.focusRing })};}input:focus:not(:focus-visible) + &&{--switch-box-shadow:none;}input:checked + &&{--switch-bg-color:${color.input.default.enabled.fg};--switch-fg-color:${color.input.default.enabled.bg};}@media (hover:hover){input:not(:disabled):hover + &&{--switch-bg-color:${color.input.default.hovered.border};--switch-fg-color:${color.input.default.hovered.bg};}input:not(:disabled):checked:hover + &&{--switch-bg-color:${color.input.default.enabled.fg};--switch-fg-color:${color.input.default.enabled.bg};}}input:not([data-read-only]):disabled + &&{--switch-bg-color:${color.input.default.disabled.border};--switch-fg-color:${color.input.default.disabled.bg};}input[data-read-only]:disabled + &&{--switch-bg-color:${color.input.default.readOnly.border};--switch-fg-color:${color.input.default.readOnly.bg};}input:checked[data-read-only]:disabled + &&{--switch-bg-color:${color.input.default.readOnly.fg};--switch-fg-color:${color.input.default.readOnly.bg};}`;
|
|
1168
1182
|
}
|
|
1169
1183
|
function switchTrackStyles(props) {
|
|
1170
|
-
let { input } =
|
|
1171
|
-
return
|
|
1184
|
+
let { input } = getTheme_v2(props.theme);
|
|
1185
|
+
return css`&:not([hidden]){display:block;}background-color:var(--switch-bg-color);position:absolute;left:0;top:0;width:${rem(input.switch.width)};height:${rem(input.switch.height)};border-radius:${rem(input.switch.height / 2)};`;
|
|
1172
1186
|
}
|
|
1173
1187
|
function switchThumbStyles(props) {
|
|
1174
|
-
let { $indeterminate } = props, { input } =
|
|
1175
|
-
return
|
|
1188
|
+
let { $indeterminate } = props, { input } = getTheme_v2(props.theme), trackWidth = input.switch.width, trackHeight = input.switch.height, trackPadding = input.switch.padding, size = trackHeight - input.switch.padding * 2, checkedOffset = trackWidth - trackPadding * 2 - size, indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding, checked = $indeterminate !== !0 && props.$checked === !0;
|
|
1189
|
+
return css`&:not([hidden]){display:block;}position:absolute;left:${rem(trackPadding)};top:${rem(trackPadding)};height:${rem(size)};width:${rem(size)};border-radius:${rem(size / 2)};transition-property:transform;transition-duration:${input.switch.transitionDurationMs}ms;transition-timing-function:${input.switch.transitionTimingFunction};background:var(--switch-fg-color);transform:translate3d(0,0,0);box-shadow:0px 1px 0px 0px rgba(0,0,0,0.05);${checked && css`transform:translate3d(${checkedOffset}px,0,0);`} ${$indeterminate && css`transform:translate3d(${indeterminateOffset}px,0,0);`}`;
|
|
1176
1190
|
}
|
|
1177
|
-
const StyledSwitch = /* @__PURE__ */
|
|
1191
|
+
const StyledSwitch = /* @__PURE__ */ styled.span.withConfig({
|
|
1178
1192
|
displayName: "StyledSwitch",
|
|
1179
1193
|
componentId: "sc-aod7y9-0"
|
|
1180
|
-
})(switchBaseStyles), Input$1 = /* @__PURE__ */
|
|
1194
|
+
})(switchBaseStyles), Input$1 = /* @__PURE__ */ styled.input.withConfig({
|
|
1181
1195
|
displayName: "Input",
|
|
1182
1196
|
componentId: "sc-aod7y9-1"
|
|
1183
|
-
})(switchInputStyles), Representation = /* @__PURE__ */
|
|
1197
|
+
})(switchInputStyles), Representation = /* @__PURE__ */ styled.span.withConfig({
|
|
1184
1198
|
displayName: "Representation",
|
|
1185
1199
|
componentId: "sc-aod7y9-2"
|
|
1186
|
-
})(switchRepresentationStyles), Track = /* @__PURE__ */
|
|
1200
|
+
})(switchRepresentationStyles), Track = /* @__PURE__ */ styled.span.withConfig({
|
|
1187
1201
|
displayName: "Track",
|
|
1188
1202
|
componentId: "sc-aod7y9-3"
|
|
1189
|
-
})(switchTrackStyles), Thumb = /* @__PURE__ */
|
|
1203
|
+
})(switchTrackStyles), Thumb = /* @__PURE__ */ styled.span.withConfig({
|
|
1190
1204
|
displayName: "Thumb",
|
|
1191
1205
|
componentId: "sc-aod7y9-4"
|
|
1192
|
-
})(switchThumbStyles), Switch =
|
|
1193
|
-
let $ =
|
|
1206
|
+
})(switchThumbStyles), Switch = forwardRef(function Switch(props, forwardedRef) {
|
|
1207
|
+
let $ = c(26), checked, className, disabled, indeterminate, readOnly, restProps, style;
|
|
1194
1208
|
$[0] === props ? (checked = $[1], className = $[2], disabled = $[3], indeterminate = $[4], readOnly = $[5], restProps = $[6], style = $[7]) : ({checked, className, disabled, indeterminate, readOnly, style, ...restProps} = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = disabled, $[4] = indeterminate, $[5] = readOnly, $[6] = restProps, $[7] = style);
|
|
1195
|
-
let ref =
|
|
1196
|
-
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[8] = t0) : t0 = $[8],
|
|
1209
|
+
let ref = useRef(null), t0;
|
|
1210
|
+
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[8] = t0) : t0 = $[8], useImperativeHandle(forwardedRef, t0);
|
|
1197
1211
|
let t1, t2;
|
|
1198
1212
|
$[9] === indeterminate ? (t1 = $[10], t2 = $[11]) : (t1 = () => {
|
|
1199
1213
|
ref.current && (ref.current.indeterminate = indeterminate || !1);
|
|
1200
|
-
}, t2 = [indeterminate], $[9] = indeterminate, $[10] = t1, $[11] = t2),
|
|
1214
|
+
}, t2 = [indeterminate], $[9] = indeterminate, $[10] = t1, $[11] = t2), useEffect(t1, t2);
|
|
1201
1215
|
let t3 = !disabled && readOnly ? "" : void 0, t4 = indeterminate !== !0 && checked, t5 = disabled || readOnly, t6;
|
|
1202
|
-
$[12] !== restProps || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */
|
|
1216
|
+
$[12] !== restProps || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Input$1, {
|
|
1203
1217
|
"data-read-only": t3,
|
|
1204
1218
|
...restProps,
|
|
1205
1219
|
checked: t4,
|
|
@@ -1208,48 +1222,48 @@ const StyledSwitch = /* @__PURE__ */ styled_components.styled.span.withConfig({
|
|
|
1208
1222
|
ref
|
|
1209
1223
|
}), $[12] = restProps, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16];
|
|
1210
1224
|
let t7;
|
|
1211
|
-
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */
|
|
1225
|
+
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsx(Track, {}), $[17] = t7) : t7 = $[17];
|
|
1212
1226
|
let t8;
|
|
1213
|
-
$[18] !== checked || $[19] !== indeterminate ? (t8 = /* @__PURE__ */
|
|
1227
|
+
$[18] !== checked || $[19] !== indeterminate ? (t8 = /* @__PURE__ */ jsxs(Representation, {
|
|
1214
1228
|
"aria-hidden": !0,
|
|
1215
1229
|
"data-name": "representation",
|
|
1216
|
-
children: [t7, /* @__PURE__ */
|
|
1230
|
+
children: [t7, /* @__PURE__ */ jsx(Thumb, {
|
|
1217
1231
|
$checked: checked,
|
|
1218
1232
|
$indeterminate: indeterminate
|
|
1219
1233
|
})]
|
|
1220
1234
|
}), $[18] = checked, $[19] = indeterminate, $[20] = t8) : t8 = $[20];
|
|
1221
1235
|
let t9;
|
|
1222
|
-
return $[21] !== className || $[22] !== style || $[23] !== t6 || $[24] !== t8 ? (t9 = /* @__PURE__ */
|
|
1236
|
+
return $[21] !== className || $[22] !== style || $[23] !== t6 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxs(StyledSwitch, {
|
|
1223
1237
|
className,
|
|
1224
1238
|
"data-ui": "Switch",
|
|
1225
1239
|
style,
|
|
1226
1240
|
children: [t6, t8]
|
|
1227
1241
|
}), $[21] = className, $[22] = style, $[23] = t6, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
|
|
1228
|
-
}), StyledTextArea = /* @__PURE__ */
|
|
1242
|
+
}), StyledTextArea = /* @__PURE__ */ styled.span.withConfig({
|
|
1229
1243
|
displayName: "StyledTextArea",
|
|
1230
1244
|
componentId: "sc-vgfdnn-0"
|
|
1231
|
-
})(
|
|
1245
|
+
})(textInputRootStyle), InputRoot = styled.span.withConfig({
|
|
1232
1246
|
displayName: "InputRoot",
|
|
1233
1247
|
componentId: "sc-vgfdnn-1"
|
|
1234
|
-
})`flex:1;min-width:0;display:block;position:relative;`, Input = /* @__PURE__ */
|
|
1248
|
+
})`flex:1;min-width:0;display:block;position:relative;`, Input = /* @__PURE__ */ styled.textarea.withConfig({
|
|
1235
1249
|
displayName: "Input",
|
|
1236
1250
|
componentId: "sc-vgfdnn-2"
|
|
1237
|
-
})(
|
|
1251
|
+
})(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle), Presentation = /* @__PURE__ */ styled.div.withConfig({
|
|
1238
1252
|
displayName: "Presentation",
|
|
1239
1253
|
componentId: "sc-vgfdnn-3"
|
|
1240
|
-
})(
|
|
1241
|
-
let $ =
|
|
1254
|
+
})(responsiveRadiusStyle, textInputRepresentationStyle), TextArea = forwardRef(function TextArea(props, forwardedRef) {
|
|
1255
|
+
let $ = c(35), __unstable_disableFocusRing, customValidity, restProps, t0, t1, t2, t3, t4, weight;
|
|
1242
1256
|
$[0] === props ? (__unstable_disableFocusRing = $[1], customValidity = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], weight = $[9]) : ({border: t0, customValidity, disabled: t1, fontSize: t2, padding: t3, radius: t4, weight, __unstable_disableFocusRing, ...restProps} = props, $[0] = props, $[1] = __unstable_disableFocusRing, $[2] = customValidity, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = weight);
|
|
1243
|
-
let border = t0 === void 0 || t0, disabled = t1 !== void 0 && t1, fontSize = t2 === void 0 ? 2 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, ref =
|
|
1244
|
-
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[10] = t5) : t5 = $[10],
|
|
1257
|
+
let border = t0 === void 0 || t0, disabled = t1 !== void 0 && t1, fontSize = t2 === void 0 ? 2 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, ref = useRef(null), rootTheme = useRootTheme(), t5;
|
|
1258
|
+
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[10] = t5) : t5 = $[10], useImperativeHandle(forwardedRef, t5), useCustomValidity(ref, customValidity);
|
|
1245
1259
|
let t6 = rootTheme.scheme, t7 = rootTheme.tone, t8;
|
|
1246
|
-
$[11] === fontSize ? t8 = $[12] : (t8 =
|
|
1260
|
+
$[11] === fontSize ? t8 = $[12] : (t8 = _getArrayProp(fontSize), $[11] = fontSize, $[12] = t8);
|
|
1247
1261
|
let t9;
|
|
1248
|
-
$[13] === padding ? t9 = $[14] : (t9 =
|
|
1262
|
+
$[13] === padding ? t9 = $[14] : (t9 = _getArrayProp(padding), $[13] = padding, $[14] = t9);
|
|
1249
1263
|
let t10 = rootTheme.scheme, t11;
|
|
1250
|
-
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 =
|
|
1264
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = _getArrayProp(0), $[15] = t11) : t11 = $[15];
|
|
1251
1265
|
let t12;
|
|
1252
|
-
$[16] !== disabled || $[17] !== restProps || $[18] !== rootTheme.scheme || $[19] !== rootTheme.tone || $[20] !== t8 || $[21] !== t9 || $[22] !== weight ? (t12 = /* @__PURE__ */
|
|
1266
|
+
$[16] !== disabled || $[17] !== restProps || $[18] !== rootTheme.scheme || $[19] !== rootTheme.tone || $[20] !== t8 || $[21] !== t9 || $[22] !== weight ? (t12 = /* @__PURE__ */ jsx(Input, {
|
|
1253
1267
|
"data-as": "textarea",
|
|
1254
1268
|
"data-scheme": t6,
|
|
1255
1269
|
"data-tone": t7,
|
|
@@ -1264,9 +1278,9 @@ const StyledSwitch = /* @__PURE__ */ styled_components.styled.span.withConfig({
|
|
|
1264
1278
|
ref
|
|
1265
1279
|
}), $[16] = disabled, $[17] = restProps, $[18] = rootTheme.scheme, $[19] = rootTheme.tone, $[20] = t8, $[21] = t9, $[22] = weight, $[23] = t12) : t12 = $[23];
|
|
1266
1280
|
let t13;
|
|
1267
|
-
$[24] === radius ? t13 = $[25] : (t13 =
|
|
1281
|
+
$[24] === radius ? t13 = $[25] : (t13 = _getArrayProp(radius), $[24] = radius, $[25] = t13);
|
|
1268
1282
|
let t14 = border ? "" : void 0, t15;
|
|
1269
|
-
$[26] !== __unstable_disableFocusRing || $[27] !== rootTheme.scheme || $[28] !== rootTheme.tone || $[29] !== t13 || $[30] !== t14 ? (t15 = /* @__PURE__ */
|
|
1283
|
+
$[26] !== __unstable_disableFocusRing || $[27] !== rootTheme.scheme || $[28] !== rootTheme.tone || $[29] !== t13 || $[30] !== t14 ? (t15 = /* @__PURE__ */ jsx(Presentation, {
|
|
1270
1284
|
$radius: t13,
|
|
1271
1285
|
$unstableDisableFocusRing: __unstable_disableFocusRing,
|
|
1272
1286
|
$scheme: rootTheme.scheme,
|
|
@@ -1276,9 +1290,9 @@ const StyledSwitch = /* @__PURE__ */ styled_components.styled.span.withConfig({
|
|
|
1276
1290
|
"data-tone": rootTheme.tone
|
|
1277
1291
|
}), $[26] = __unstable_disableFocusRing, $[27] = rootTheme.scheme, $[28] = rootTheme.tone, $[29] = t13, $[30] = t14, $[31] = t15) : t15 = $[31];
|
|
1278
1292
|
let t16;
|
|
1279
|
-
return $[32] !== t12 || $[33] !== t15 ? (t16 = /* @__PURE__ */
|
|
1293
|
+
return $[32] !== t12 || $[33] !== t15 ? (t16 = /* @__PURE__ */ jsx(StyledTextArea, {
|
|
1280
1294
|
"data-ui": "TextArea",
|
|
1281
|
-
children: /* @__PURE__ */
|
|
1295
|
+
children: /* @__PURE__ */ jsxs(InputRoot, { children: [t12, t15] })
|
|
1282
1296
|
}), $[32] = t12, $[33] = t15, $[34] = t16) : t16 = $[34], t16;
|
|
1283
1297
|
});
|
|
1284
1298
|
/**
|
|
@@ -1287,7 +1301,7 @@ const StyledSwitch = /* @__PURE__ */ styled_components.styled.span.withConfig({
|
|
|
1287
1301
|
* which temporarily becomes 1 ms after the first floating element of the group opens.
|
|
1288
1302
|
*/
|
|
1289
1303
|
function TooltipDelayGroupProvider(props) {
|
|
1290
|
-
let $ =
|
|
1304
|
+
let $ = c(9), { children, delay } = props, [isGroupActive, setIsGroupActive] = useDelayedState(!1), [openTooltipId, setOpenTooltipId] = useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0, t0 = isGroupActive ? 1 : openDelay, t1;
|
|
1291
1305
|
$[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t0 ? (t1 = {
|
|
1292
1306
|
setIsGroupActive,
|
|
1293
1307
|
openTooltipId,
|
|
@@ -1296,7 +1310,7 @@ function TooltipDelayGroupProvider(props) {
|
|
|
1296
1310
|
closeDelay
|
|
1297
1311
|
}, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t0, $[5] = t1) : t1 = $[5];
|
|
1298
1312
|
let value = t1, t2;
|
|
1299
|
-
return $[6] !== children || $[7] !== value ? (t2 = /* @__PURE__ */
|
|
1313
|
+
return $[6] !== children || $[7] !== value ? (t2 = /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, {
|
|
1300
1314
|
value,
|
|
1301
1315
|
children
|
|
1302
1316
|
}), $[6] = children, $[7] = value, $[8] = t2) : t2 = $[8], t2;
|
|
@@ -1304,18 +1318,18 @@ function TooltipDelayGroupProvider(props) {
|
|
|
1304
1318
|
/**
|
|
1305
1319
|
* @internal
|
|
1306
1320
|
*/
|
|
1307
|
-
const StyledAutocomplete =
|
|
1321
|
+
const StyledAutocomplete = styled.div.withConfig({
|
|
1308
1322
|
displayName: "StyledAutocomplete",
|
|
1309
1323
|
componentId: "sc-hv7uk8-0"
|
|
1310
|
-
})`line-height:0;`, ListBox =
|
|
1324
|
+
})`line-height:0;`, ListBox = styled(Box).withConfig({
|
|
1311
1325
|
displayName: "ListBox",
|
|
1312
1326
|
componentId: "sc-hv7uk8-1"
|
|
1313
|
-
})`& > ul{list-style:none;padding:0;margin:0;}`, rotate =
|
|
1327
|
+
})`& > ul{list-style:none;padding:0;margin:0;}`, rotate = keyframes`from{transform:rotate(0deg);}to{transform:rotate(360deg);}`, AnimatedSpinnerIcon = styled(SpinnerIcon).withConfig({
|
|
1314
1328
|
displayName: "AnimatedSpinnerIcon",
|
|
1315
1329
|
componentId: "sc-hv7uk8-2"
|
|
1316
1330
|
})`animation:${rotate} 500ms linear infinite;`;
|
|
1317
1331
|
function AutocompleteOption(props) {
|
|
1318
|
-
let $ =
|
|
1332
|
+
let $ = c(11), { children, id, onSelect, selected, value } = props, t0;
|
|
1319
1333
|
$[0] !== onSelect || $[1] !== value ? (t0 = () => {
|
|
1320
1334
|
setTimeout(() => {
|
|
1321
1335
|
onSelect(value);
|
|
@@ -1323,10 +1337,10 @@ function AutocompleteOption(props) {
|
|
|
1323
1337
|
}, $[0] = onSelect, $[1] = value, $[2] = t0) : t0 = $[2];
|
|
1324
1338
|
let handleClick = t0, t1;
|
|
1325
1339
|
$[3] === handleClick ? t1 = $[4] : (t1 = (event) => {
|
|
1326
|
-
event.key === "Enter" && !
|
|
1340
|
+
event.key === "Enter" && !_isEnterToClickElement(event.currentTarget) && handleClick();
|
|
1327
1341
|
}, $[3] = handleClick, $[4] = t1);
|
|
1328
1342
|
let handleKeyDown = t1, t2;
|
|
1329
|
-
return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */
|
|
1343
|
+
return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsx("li", {
|
|
1330
1344
|
"aria-selected": selected,
|
|
1331
1345
|
"data-ui": "AutocompleteOption",
|
|
1332
1346
|
id,
|
|
@@ -1393,10 +1407,10 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1393
1407
|
"Meta",
|
|
1394
1408
|
"Tab",
|
|
1395
1409
|
"CapsLock"
|
|
1396
|
-
], 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 =
|
|
1397
|
-
let $ =
|
|
1410
|
+
], 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 Autocomplete(props, forwardedRef) {
|
|
1411
|
+
let $ = c(181), customValidity, disabled, filterOptionProp, icon, id, loading, onBlur, onChange, onFocus, onQueryChange, onSelect, openButton, openOnFocus, optionsProp, prefix, readOnly, relatedElements, renderOptionProp, renderPopover, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, valueProp;
|
|
1398
1412
|
$[0] === props ? (customValidity = $[1], disabled = $[2], filterOptionProp = $[3], icon = $[4], id = $[5], loading = $[6], onBlur = $[7], onChange = $[8], onFocus = $[9], onQueryChange = $[10], onSelect = $[11], openButton = $[12], openOnFocus = $[13], optionsProp = $[14], prefix = $[15], readOnly = $[16], relatedElements = $[17], renderOptionProp = $[18], renderPopover = $[19], restProps = $[20], suffix = $[21], t0 = $[22], t1 = $[23], t2 = $[24], t3 = $[25], t4 = $[26], t5 = $[27], t6 = $[28], valueProp = $[29]) : ({border: t0, customValidity, disabled, filterOption: filterOptionProp, fontSize: t1, icon, id, listBox: t2, loading, onBlur, onChange, onFocus, onQueryChange, onSelect, openButton, openOnFocus, options: optionsProp, padding: t3, popover: t4, prefix, radius: t5, readOnly, relatedElements, renderOption: renderOptionProp, renderPopover, renderValue: t6, suffix, value: valueProp, ...restProps} = props, $[0] = props, $[1] = customValidity, $[2] = disabled, $[3] = filterOptionProp, $[4] = icon, $[5] = id, $[6] = loading, $[7] = onBlur, $[8] = onChange, $[9] = onFocus, $[10] = onQueryChange, $[11] = onSelect, $[12] = openButton, $[13] = openOnFocus, $[14] = optionsProp, $[15] = prefix, $[16] = readOnly, $[17] = relatedElements, $[18] = renderOptionProp, $[19] = renderPopover, $[20] = restProps, $[21] = suffix, $[22] = t0, $[23] = t1, $[24] = t2, $[25] = t3, $[26] = t4, $[27] = t5, $[28] = t6, $[29] = valueProp);
|
|
1399
|
-
let border = t0 === void 0 || t0, fontSize = t1 === void 0 ? 2 : t1, listBox = t2 === void 0 ?
|
|
1413
|
+
let border = t0 === void 0 || t0, fontSize = t1 === void 0 ? 2 : t1, listBox = t2 === void 0 ? EMPTY_RECORD : t2, paddingProp = t3 === void 0 ? 3 : t3, popover = t4 === void 0 ? EMPTY_RECORD : t4, radius = t5 === void 0 ? 2 : t5, renderValue = t6 === void 0 ? DEFAULT_RENDER_VALUE : t6, t7 = valueProp || null, t8 = valueProp || null, t9;
|
|
1400
1414
|
$[30] !== t7 || $[31] !== t8 ? (t9 = {
|
|
1401
1415
|
activeValue: t7,
|
|
1402
1416
|
focused: !1,
|
|
@@ -1404,30 +1418,30 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1404
1418
|
query: null,
|
|
1405
1419
|
value: t8
|
|
1406
1420
|
}, $[30] = t7, $[31] = t8, $[32] = t9) : t9 = $[32];
|
|
1407
|
-
let [state, dispatch] =
|
|
1421
|
+
let [state, dispatch] = useReducer(autocompleteReducer, t9), { activeValue, focused, listFocused, query, value } = state, t10;
|
|
1408
1422
|
$[33] !== fontSize || $[34] !== paddingProp ? (t10 = (t11) => {
|
|
1409
1423
|
let { value: value_0 } = t11;
|
|
1410
|
-
return /* @__PURE__ */
|
|
1424
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
1411
1425
|
"data-as": "button",
|
|
1412
1426
|
padding: paddingProp,
|
|
1413
1427
|
radius: 2,
|
|
1414
1428
|
tone: "inherit",
|
|
1415
|
-
children: /* @__PURE__ */
|
|
1429
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
1416
1430
|
size: fontSize,
|
|
1417
1431
|
textOverflow: "ellipsis",
|
|
1418
1432
|
children: value_0
|
|
1419
1433
|
})
|
|
1420
1434
|
});
|
|
1421
1435
|
}, $[33] = fontSize, $[34] = paddingProp, $[35] = t10) : t10 = $[35];
|
|
1422
|
-
let renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t10, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef =
|
|
1436
|
+
let renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t10, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), [inputElement, _setInputElement] = useState(null), t11;
|
|
1423
1437
|
$[36] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (node) => {
|
|
1424
|
-
|
|
1438
|
+
startTransition(() => _setInputElement(node));
|
|
1425
1439
|
}, $[36] = t11) : t11 = $[36];
|
|
1426
|
-
let setInputElement = t11, listFocusedRef =
|
|
1427
|
-
$[37] === inputElement ? (t12 = $[38], t13 = $[39]) : (t12 = () => inputElement, t13 = [inputElement], $[37] = inputElement, $[38] = t12, $[39] = t13),
|
|
1440
|
+
let setInputElement = t11, listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1), t12, t13;
|
|
1441
|
+
$[37] === inputElement ? (t12 = $[38], t13 = $[39]) : (t12 = () => inputElement, t13 = [inputElement], $[37] = inputElement, $[38] = t12, $[39] = t13), useImperativeHandle(inputElementRef, t12, t13);
|
|
1428
1442
|
let t14, t15;
|
|
1429
|
-
$[40] === inputElement ? (t14 = $[41], t15 = $[42]) : (t14 = () => inputElement, t15 = [inputElement], $[40] = inputElement, $[41] = t14, $[42] = t15),
|
|
1430
|
-
let listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp :
|
|
1443
|
+
$[40] === inputElement ? (t14 = $[41], t15 = $[42]) : (t14 = () => inputElement, t15 = [inputElement], $[40] = inputElement, $[41] = t14, $[42] = t15), useImperativeHandle(forwardedRef, t14, t15);
|
|
1444
|
+
let listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = _getArrayProp(paddingProp), t16;
|
|
1431
1445
|
$[43] !== options || $[44] !== value ? (t16 = value === null ? void 0 : options.find((o) => o.value === value), $[43] = options, $[44] = value, $[45] = t16) : t16 = $[45];
|
|
1432
1446
|
let currentOption = t16, t17;
|
|
1433
1447
|
if ($[46] !== filterOption || $[47] !== options || $[48] !== query) {
|
|
@@ -1543,14 +1557,14 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1543
1557
|
type: "value/change",
|
|
1544
1558
|
value: valueProp || null
|
|
1545
1559
|
}));
|
|
1546
|
-
}, t30 = [valueProp], $[84] = valueProp, $[85] = t29, $[86] = t30),
|
|
1560
|
+
}, t30 = [valueProp], $[84] = valueProp, $[85] = t29, $[86] = t30), useEffect(t29, t30);
|
|
1547
1561
|
let t31, t32;
|
|
1548
1562
|
$[87] === focused ? (t31 = $[88], t32 = $[89]) : (t31 = () => {
|
|
1549
1563
|
!focused && valueRef.current && dispatch({
|
|
1550
1564
|
type: "root/setActiveValue",
|
|
1551
1565
|
value: valueRef.current
|
|
1552
1566
|
});
|
|
1553
|
-
}, t32 = [focused], $[87] = focused, $[88] = t31, $[89] = t32),
|
|
1567
|
+
}, t32 = [focused], $[87] = focused, $[88] = t31, $[89] = t32), useEffect(t31, t32);
|
|
1554
1568
|
let t33, t34;
|
|
1555
1569
|
$[90] !== activeValue || $[91] !== filteredOptions ? (t33 = () => {
|
|
1556
1570
|
let listElement = listBoxElementRef.current;
|
|
@@ -1563,7 +1577,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1563
1577
|
focusFirstDescendant(activeItemElement);
|
|
1564
1578
|
}
|
|
1565
1579
|
}
|
|
1566
|
-
}, t34 = [activeValue, filteredOptions], $[90] = activeValue, $[91] = filteredOptions, $[92] = t33, $[93] = t34) : (t33 = $[92], t34 = $[93]),
|
|
1580
|
+
}, t34 = [activeValue, filteredOptions], $[90] = activeValue, $[91] = filteredOptions, $[92] = t33, $[93] = t34) : (t33 = $[92], t34 = $[93]), useEffect(t33, t34);
|
|
1567
1581
|
let t35;
|
|
1568
1582
|
bb0: {
|
|
1569
1583
|
if (!loading && !disabled && value) {
|
|
@@ -1576,19 +1590,19 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1576
1590
|
}
|
|
1577
1591
|
t35 = void 0;
|
|
1578
1592
|
}
|
|
1579
|
-
let clearButton = t35, openButtonBoxPadding = padding.map(_temp$
|
|
1593
|
+
let clearButton = t35, openButtonBoxPadding = padding.map(_temp$3), openButtonPadding = padding.map(_temp2$1), openButtonProps = typeof openButton == "object" ? openButton : EMPTY_RECORD, t36;
|
|
1580
1594
|
$[95] !== dispatchOpen || $[96] !== openButtonProps ? (t36 = (event_4) => {
|
|
1581
1595
|
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
1582
1596
|
}, $[95] = dispatchOpen, $[96] = openButtonProps, $[97] = t36) : t36 = $[97];
|
|
1583
1597
|
let handleOpenClick = t36, t37;
|
|
1584
|
-
$[98] !== disabled || $[99] !== expanded || $[100] !== fontSize || $[101] !== handleOpenClick || $[102] !== openButton || $[103] !== openButtonBoxPadding || $[104] !== openButtonPadding || $[105] !== openButtonProps || $[106] !== readOnly ? (t37 = !disabled && !readOnly && openButton ? /* @__PURE__ */
|
|
1598
|
+
$[98] !== disabled || $[99] !== expanded || $[100] !== fontSize || $[101] !== handleOpenClick || $[102] !== openButton || $[103] !== openButtonBoxPadding || $[104] !== openButtonPadding || $[105] !== openButtonProps || $[106] !== readOnly ? (t37 = !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, {
|
|
1585
1599
|
"aria-hidden": expanded,
|
|
1586
1600
|
padding: openButtonBoxPadding,
|
|
1587
|
-
children: /* @__PURE__ */
|
|
1601
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
1588
1602
|
"aria-label": "Open",
|
|
1589
1603
|
disabled: expanded,
|
|
1590
1604
|
fontSize,
|
|
1591
|
-
icon:
|
|
1605
|
+
icon: ChevronDownIcon,
|
|
1592
1606
|
mode: "bleed",
|
|
1593
1607
|
padding: openButtonPadding,
|
|
1594
1608
|
...openButtonProps,
|
|
@@ -1623,12 +1637,12 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1623
1637
|
let t42;
|
|
1624
1638
|
$[123] !== activeValue || $[124] !== currentOption || $[125] !== handleOptionSelect || $[126] !== id || $[127] !== listFocused || $[128] !== loading || $[129] !== renderOption ? (t42 = (option_0) => {
|
|
1625
1639
|
let active = activeValue === null ? currentOption === option_0 : option_0.value === activeValue;
|
|
1626
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ jsx(AutocompleteOption, {
|
|
1627
1641
|
id: `${id}-option-${option_0.value}`,
|
|
1628
1642
|
onSelect: handleOptionSelect,
|
|
1629
1643
|
selected: active,
|
|
1630
1644
|
value: option_0.value,
|
|
1631
|
-
children:
|
|
1645
|
+
children: cloneElement(renderOption(option_0), {
|
|
1632
1646
|
disabled: loading,
|
|
1633
1647
|
selected: active,
|
|
1634
1648
|
tabIndex: listFocused && active ? 0 : -1
|
|
@@ -1637,7 +1651,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1637
1651
|
}, $[123] = activeValue, $[124] = currentOption, $[125] = handleOptionSelect, $[126] = id, $[127] = listFocused, $[128] = loading, $[129] = renderOption, $[130] = t42) : t42 = $[130], t41 = filteredOptions.map(t42), $[114] = activeValue, $[115] = currentOption, $[116] = filteredOptions, $[117] = handleOptionSelect, $[118] = id, $[119] = listFocused, $[120] = loading, $[121] = renderOption, $[122] = t41;
|
|
1638
1652
|
} else t41 = $[122];
|
|
1639
1653
|
let t42;
|
|
1640
|
-
$[131] !== listBoxId || $[132] !== t41 ? (t42 = /* @__PURE__ */
|
|
1654
|
+
$[131] !== listBoxId || $[132] !== t41 ? (t42 = /* @__PURE__ */ jsx(Stack, {
|
|
1641
1655
|
as: "ul",
|
|
1642
1656
|
"aria-multiselectable": !1,
|
|
1643
1657
|
"data-ui": "AutoComplete__resultsList",
|
|
@@ -1648,7 +1662,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1648
1662
|
children: t41
|
|
1649
1663
|
}), $[131] = listBoxId, $[132] = t41, $[133] = t42) : t42 = $[133];
|
|
1650
1664
|
let t43;
|
|
1651
|
-
$[134] !== handleListBoxKeyDown || $[135] !== listBox || $[136] !== t42 ? (t43 = /* @__PURE__ */
|
|
1665
|
+
$[134] !== handleListBoxKeyDown || $[135] !== listBox || $[136] !== t42 ? (t43 = /* @__PURE__ */ jsx(ListBox, {
|
|
1652
1666
|
"data-ui": "AutoComplete__results",
|
|
1653
1667
|
onKeyDown: handleListBoxKeyDown,
|
|
1654
1668
|
padding: 1,
|
|
@@ -1661,7 +1675,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1661
1675
|
bb3: {
|
|
1662
1676
|
if (renderPopover) {
|
|
1663
1677
|
let t42 = !expanded, t43;
|
|
1664
|
-
$[138] !== content || $[139] !== handlePopoverMouseEnter || $[140] !== handlePopoverMouseLeave || $[141] !== inputElement || $[142] !== renderPopover || $[143] !== t42 ? (t43 = /* @__PURE__ */
|
|
1678
|
+
$[138] !== content || $[139] !== handlePopoverMouseEnter || $[140] !== handlePopoverMouseLeave || $[141] !== inputElement || $[142] !== renderPopover || $[143] !== t42 ? (t43 = /* @__PURE__ */ jsx(RenderPopover, {
|
|
1665
1679
|
content,
|
|
1666
1680
|
hidden: t42,
|
|
1667
1681
|
inputElement,
|
|
@@ -1677,7 +1691,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1677
1691
|
break bb3;
|
|
1678
1692
|
}
|
|
1679
1693
|
let t42;
|
|
1680
|
-
$[145] !== content || $[146] !== expanded || $[147] !== handlePopoverMouseEnter || $[148] !== handlePopoverMouseLeave || $[149] !== inputElement || $[150] !== popover || $[151] !== radius ? (t42 = /* @__PURE__ */
|
|
1694
|
+
$[145] !== content || $[146] !== expanded || $[147] !== handlePopoverMouseEnter || $[148] !== handlePopoverMouseLeave || $[149] !== inputElement || $[150] !== popover || $[151] !== radius ? (t42 = /* @__PURE__ */ jsx(Popover, {
|
|
1681
1695
|
arrow: !1,
|
|
1682
1696
|
constrainSize: !0,
|
|
1683
1697
|
content,
|
|
@@ -1696,7 +1710,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1696
1710
|
}), $[145] = content, $[146] = expanded, $[147] = handlePopoverMouseEnter, $[148] = handlePopoverMouseLeave, $[149] = inputElement, $[150] = popover, $[151] = radius, $[152] = t42) : t42 = $[152], t41 = t42;
|
|
1697
1711
|
}
|
|
1698
1712
|
let results = t41, t42 = loading && AnimatedSpinnerIcon, t43 = suffix || openButtonNode, t44;
|
|
1699
|
-
$[153] !== activeItemId || $[154] !== border || $[155] !== clearButton || $[156] !== customValidity || $[157] !== disabled || $[158] !== expanded || $[159] !== fontSize || $[160] !== handleClearButtonClick || $[161] !== handleInputChange || $[162] !== handleInputFocus || $[163] !== icon || $[164] !== id || $[165] !== inputValue || $[166] !== listBoxId || $[167] !== padding || $[168] !== prefix || $[169] !== radius || $[170] !== readOnly || $[171] !== restProps || $[172] !== t42 || $[173] !== t43 ? (t44 = /* @__PURE__ */
|
|
1713
|
+
$[153] !== activeItemId || $[154] !== border || $[155] !== clearButton || $[156] !== customValidity || $[157] !== disabled || $[158] !== expanded || $[159] !== fontSize || $[160] !== handleClearButtonClick || $[161] !== handleInputChange || $[162] !== handleInputFocus || $[163] !== icon || $[164] !== id || $[165] !== inputValue || $[166] !== listBoxId || $[167] !== padding || $[168] !== prefix || $[169] !== radius || $[170] !== readOnly || $[171] !== restProps || $[172] !== t42 || $[173] !== t43 ? (t44 = /* @__PURE__ */ jsx(TextInput, {
|
|
1700
1714
|
...restProps,
|
|
1701
1715
|
"aria-activedescendant": activeItemId,
|
|
1702
1716
|
"aria-autocomplete": "list",
|
|
@@ -1728,7 +1742,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
1728
1742
|
value: inputValue
|
|
1729
1743
|
}), $[153] = activeItemId, $[154] = border, $[155] = clearButton, $[156] = customValidity, $[157] = disabled, $[158] = expanded, $[159] = fontSize, $[160] = handleClearButtonClick, $[161] = handleInputChange, $[162] = handleInputFocus, $[163] = icon, $[164] = id, $[165] = inputValue, $[166] = listBoxId, $[167] = padding, $[168] = prefix, $[169] = radius, $[170] = readOnly, $[171] = restProps, $[172] = t42, $[173] = t43, $[174] = t44) : t44 = $[174];
|
|
1730
1744
|
let t45;
|
|
1731
|
-
return $[175] !== handleRootBlur || $[176] !== handleRootFocus || $[177] !== handleRootKeyDown || $[178] !== results || $[179] !== t44 ? (t45 = /* @__PURE__ */
|
|
1745
|
+
return $[175] !== handleRootBlur || $[176] !== handleRootFocus || $[177] !== handleRootKeyDown || $[178] !== results || $[179] !== t44 ? (t45 = /* @__PURE__ */ jsxs(StyledAutocomplete, {
|
|
1732
1746
|
"data-ui": "Autocomplete",
|
|
1733
1747
|
onBlur: handleRootBlur,
|
|
1734
1748
|
onFocus: handleRootFocus,
|
|
@@ -1753,31 +1767,31 @@ function RenderPopover({ renderPopover, content, hidden, inputElement, onMouseEn
|
|
|
1753
1767
|
* @public
|
|
1754
1768
|
*/
|
|
1755
1769
|
const Autocomplete = InnerAutocomplete;
|
|
1756
|
-
function _temp$
|
|
1770
|
+
function _temp$3(v_0) {
|
|
1757
1771
|
return v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2;
|
|
1758
1772
|
}
|
|
1759
|
-
function _temp2(v_1) {
|
|
1773
|
+
function _temp2$1(v_1) {
|
|
1760
1774
|
return Math.max(v_1 - 1, 0);
|
|
1761
1775
|
}
|
|
1762
|
-
const StyledBreadcrumbs =
|
|
1776
|
+
const StyledBreadcrumbs = styled.ol.withConfig({
|
|
1763
1777
|
displayName: "StyledBreadcrumbs",
|
|
1764
|
-
componentId: "sc-
|
|
1765
|
-
})`margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;`, ExpandButton =
|
|
1778
|
+
componentId: "sc-1nquj0-0"
|
|
1779
|
+
})`margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;`, ExpandButton = styled(Button).withConfig({
|
|
1766
1780
|
displayName: "ExpandButton",
|
|
1767
|
-
componentId: "sc-
|
|
1768
|
-
})`appearance:none;margin:-4px;`, Breadcrumbs =
|
|
1769
|
-
let $ =
|
|
1781
|
+
componentId: "sc-1nquj0-1"
|
|
1782
|
+
})`appearance:none;margin:-4px;`, Breadcrumbs = forwardRef(function Breadcrumbs(props, ref) {
|
|
1783
|
+
let $ = c(30), children, gap, maxLength, restProps, separator, t0;
|
|
1770
1784
|
$[0] === props ? (children = $[1], gap = $[2], maxLength = $[3], restProps = $[4], separator = $[5], t0 = $[6]) : ({children, gap, maxLength, separator, space: t0, ...restProps} = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = maxLength, $[4] = restProps, $[5] = separator, $[6] = t0);
|
|
1771
1785
|
let t1 = gap === void 0 ? t0 === void 0 ? 2 : t0 : gap, t2;
|
|
1772
|
-
$[7] === t1 ? t2 = $[8] : (t2 =
|
|
1773
|
-
let space = t2, [open, setOpen] =
|
|
1786
|
+
$[7] === t1 ? t2 = $[8] : (t2 = _getArrayProp(t1), $[7] = t1, $[8] = t2);
|
|
1787
|
+
let space = t2, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), t3;
|
|
1774
1788
|
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => setOpen(!1), $[9] = t3) : t3 = $[9];
|
|
1775
1789
|
let collapse = t3, t4;
|
|
1776
1790
|
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => setOpen(!0), $[10] = t4) : t4 = $[10];
|
|
1777
1791
|
let expand = t4, t5;
|
|
1778
|
-
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => [expandElementRef.current, popoverElementRef.current], $[11] = t5) : t5 = $[11],
|
|
1792
|
+
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => [expandElementRef.current, popoverElementRef.current], $[11] = t5) : t5 = $[11], useClickOutsideEvent(collapse, t5);
|
|
1779
1793
|
let t6;
|
|
1780
|
-
$[12] === children ? t6 = $[13] : (t6 =
|
|
1794
|
+
$[12] === children ? t6 = $[13] : (t6 = Children.toArray(children).filter(isValidElement), $[12] = children, $[13] = t6);
|
|
1781
1795
|
let rawItems = t6, t7;
|
|
1782
1796
|
$[14] !== maxLength || $[15] !== open || $[16] !== rawItems || $[17] !== space ? (t7 = {
|
|
1783
1797
|
collapse,
|
|
@@ -1792,21 +1806,21 @@ const StyledBreadcrumbs = styled_components.styled.ol.withConfig({
|
|
|
1792
1806
|
let items = useItems(t7), t8;
|
|
1793
1807
|
if ($[19] !== items || $[20] !== separator || $[21] !== space) {
|
|
1794
1808
|
let t9;
|
|
1795
|
-
$[23] !== separator || $[24] !== space ? (t9 = (item, itemIndex) => /* @__PURE__ */
|
|
1809
|
+
$[23] !== separator || $[24] !== space ? (t9 = (item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [itemIndex > 0 && /* @__PURE__ */ jsx(Box, {
|
|
1796
1810
|
"aria-hidden": !0,
|
|
1797
1811
|
as: "li",
|
|
1798
1812
|
paddingX: space,
|
|
1799
|
-
children: separator || /* @__PURE__ */
|
|
1813
|
+
children: separator || /* @__PURE__ */ jsx(Text, {
|
|
1800
1814
|
muted: !0,
|
|
1801
1815
|
children: "/"
|
|
1802
1816
|
})
|
|
1803
|
-
}), /* @__PURE__ */
|
|
1817
|
+
}), /* @__PURE__ */ jsx(Box, {
|
|
1804
1818
|
as: "li",
|
|
1805
1819
|
children: item
|
|
1806
1820
|
})] }, itemIndex), $[23] = separator, $[24] = space, $[25] = t9) : t9 = $[25], t8 = items.map(t9), $[19] = items, $[20] = separator, $[21] = space, $[22] = t8;
|
|
1807
1821
|
} else t8 = $[22];
|
|
1808
1822
|
let t9;
|
|
1809
|
-
return $[26] !== ref || $[27] !== restProps || $[28] !== t8 ? (t9 = /* @__PURE__ */
|
|
1823
|
+
return $[26] !== ref || $[27] !== restProps || $[28] !== t8 ? (t9 = /* @__PURE__ */ jsx(StyledBreadcrumbs, {
|
|
1810
1824
|
"data-ui": "Breadcrumbs",
|
|
1811
1825
|
...restProps,
|
|
1812
1826
|
ref,
|
|
@@ -1814,14 +1828,14 @@ const StyledBreadcrumbs = styled_components.styled.ol.withConfig({
|
|
|
1814
1828
|
}), $[26] = ref, $[27] = restProps, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
|
|
1815
1829
|
});
|
|
1816
1830
|
function useItems(t0) {
|
|
1817
|
-
let $ =
|
|
1831
|
+
let $ = c(28), { collapse, expand, expandElementRef, maxLength, open, popoverElementRef, rawItems, space } = t0, len = rawItems.length;
|
|
1818
1832
|
if (maxLength && len > maxLength) {
|
|
1819
1833
|
let beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2), t1;
|
|
1820
1834
|
if ($[0] !== afterLength || $[1] !== beforeLength || $[2] !== collapse || $[3] !== expand || $[4] !== expandElementRef || $[5] !== len || $[6] !== open || $[7] !== popoverElementRef || $[8] !== rawItems || $[9] !== space) {
|
|
1821
1835
|
let t2 = rawItems.slice(0, beforeLength - 1), t3;
|
|
1822
1836
|
$[11] !== afterLength || $[12] !== beforeLength || $[13] !== len || $[14] !== rawItems ? (t3 = rawItems.slice(beforeLength - 1, len - afterLength), $[11] = afterLength, $[12] = beforeLength, $[13] = len, $[14] = rawItems, $[15] = t3) : t3 = $[15];
|
|
1823
1837
|
let t4;
|
|
1824
|
-
$[16] !== space || $[17] !== t3 ? (t4 = /* @__PURE__ */
|
|
1838
|
+
$[16] !== space || $[17] !== t3 ? (t4 = /* @__PURE__ */ jsx(Stack, {
|
|
1825
1839
|
as: "ol",
|
|
1826
1840
|
overflow: "auto",
|
|
1827
1841
|
padding: space,
|
|
@@ -1829,7 +1843,7 @@ function useItems(t0) {
|
|
|
1829
1843
|
children: t3
|
|
1830
1844
|
}), $[16] = space, $[17] = t3, $[18] = t4) : t4 = $[18];
|
|
1831
1845
|
let t5 = open ? collapse : expand, t6;
|
|
1832
|
-
$[19] !== expandElementRef || $[20] !== open || $[21] !== t5 ? (t6 = /* @__PURE__ */
|
|
1846
|
+
$[19] !== expandElementRef || $[20] !== open || $[21] !== t5 ? (t6 = /* @__PURE__ */ jsx(ExpandButton, {
|
|
1833
1847
|
fontSize: 1,
|
|
1834
1848
|
mode: "bleed",
|
|
1835
1849
|
onClick: t5,
|
|
@@ -1839,7 +1853,7 @@ function useItems(t0) {
|
|
|
1839
1853
|
text: "…"
|
|
1840
1854
|
}), $[19] = expandElementRef, $[20] = open, $[21] = t5, $[22] = t6) : t6 = $[22];
|
|
1841
1855
|
let t7;
|
|
1842
|
-
$[23] !== open || $[24] !== popoverElementRef || $[25] !== t4 || $[26] !== t6 ? (t7 = /* @__PURE__ */
|
|
1856
|
+
$[23] !== open || $[24] !== popoverElementRef || $[25] !== t4 || $[26] !== t6 ? (t7 = /* @__PURE__ */ jsx(Popover, {
|
|
1843
1857
|
constrainSize: !0,
|
|
1844
1858
|
content: t4,
|
|
1845
1859
|
open,
|
|
@@ -1858,7 +1872,7 @@ function useItems(t0) {
|
|
|
1858
1872
|
return rawItems;
|
|
1859
1873
|
}
|
|
1860
1874
|
function dialogStyle({ theme }) {
|
|
1861
|
-
let { color } =
|
|
1875
|
+
let { color } = getTheme_v2(theme);
|
|
1862
1876
|
return {
|
|
1863
1877
|
"&:not([hidden])": { display: "flex" },
|
|
1864
1878
|
top: 0,
|
|
@@ -1872,94 +1886,94 @@ function dialogStyle({ theme }) {
|
|
|
1872
1886
|
};
|
|
1873
1887
|
}
|
|
1874
1888
|
function responsiveDialogPositionStyle(props) {
|
|
1875
|
-
let { media } =
|
|
1876
|
-
return
|
|
1889
|
+
let { media } = getTheme_v2(props.theme);
|
|
1890
|
+
return _responsive(media, props.$position, (position) => ({ "&&": { position } }));
|
|
1877
1891
|
}
|
|
1878
1892
|
function animationDialogStyle(props) {
|
|
1879
|
-
return props.$animate ?
|
|
1893
|
+
return props.$animate ? css`@keyframes zoomIn{from{opacity:0;transform:scale(0.95);}to{opacity:1;transform:scale(1);}}@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}animation:fadeIn 200ms ease-out;& > [data-ui='DialogCard']{animation:zoomIn 200ms ease-out;}` : css``;
|
|
1880
1894
|
}
|
|
1881
1895
|
/**
|
|
1882
1896
|
* @internal
|
|
1883
1897
|
*/
|
|
1884
|
-
const DialogContext =
|
|
1898
|
+
const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", { version: 0 });
|
|
1885
1899
|
/**
|
|
1886
1900
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1887
1901
|
* @beta
|
|
1888
1902
|
*/
|
|
1889
1903
|
function useDialog() {
|
|
1890
|
-
return
|
|
1904
|
+
return useContext(DialogContext);
|
|
1891
1905
|
}
|
|
1892
1906
|
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
1893
|
-
return !boundaryElement || !portalElement ||
|
|
1907
|
+
return !boundaryElement || !portalElement || containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
1894
1908
|
}
|
|
1895
|
-
const StyledDialog = /* @__PURE__ */
|
|
1909
|
+
const StyledDialog = /* @__PURE__ */ styled(Layer).withConfig({
|
|
1896
1910
|
displayName: "StyledDialog",
|
|
1897
1911
|
componentId: "sc-2s0up-0"
|
|
1898
|
-
})(
|
|
1912
|
+
})(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle, animationDialogStyle), DialogContainer = styled(Container).withConfig({
|
|
1899
1913
|
displayName: "DialogContainer",
|
|
1900
1914
|
componentId: "sc-2s0up-1"
|
|
1901
|
-
})`&:not([hidden]){display:flex;}width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;`, DialogCardRoot =
|
|
1915
|
+
})`&:not([hidden]){display:flex;}width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;`, DialogCardRoot = styled(Card).withConfig({
|
|
1902
1916
|
displayName: "DialogCardRoot",
|
|
1903
1917
|
componentId: "sc-2s0up-2"
|
|
1904
|
-
})`&:not([hidden]){display:flex;}width:100%;min-height:0;max-height:100%;overflow:hidden;overflow:clip;`, DialogLayout =
|
|
1918
|
+
})`&:not([hidden]){display:flex;}width:100%;min-height:0;max-height:100%;overflow:hidden;overflow:clip;`, DialogLayout = styled(Flex).withConfig({
|
|
1905
1919
|
displayName: "DialogLayout",
|
|
1906
1920
|
componentId: "sc-2s0up-3"
|
|
1907
|
-
})`flex:1;min-height:0;width:100%;`, DialogHeader =
|
|
1921
|
+
})`flex:1;min-height:0;width:100%;`, DialogHeader = styled(Box).withConfig({
|
|
1908
1922
|
displayName: "DialogHeader",
|
|
1909
1923
|
componentId: "sc-2s0up-4"
|
|
1910
|
-
})`position:relative;z-index:2;`, DialogContent =
|
|
1924
|
+
})`position:relative;z-index:2;`, DialogContent = styled(Box).withConfig({
|
|
1911
1925
|
displayName: "DialogContent",
|
|
1912
1926
|
componentId: "sc-2s0up-5"
|
|
1913
|
-
})`position:relative;z-index:1;overflow:auto;outline:none;`, DialogFooter =
|
|
1927
|
+
})`position:relative;z-index:1;overflow:auto;outline:none;`, DialogFooter = styled(Box).withConfig({
|
|
1914
1928
|
displayName: "DialogFooter",
|
|
1915
1929
|
componentId: "sc-2s0up-6"
|
|
1916
|
-
})`position:relative;z-index:3;`, DialogCard =
|
|
1917
|
-
let $ =
|
|
1918
|
-
$[0] === radiusProp ? t0 = $[1] : (t0 =
|
|
1930
|
+
})`position:relative;z-index:3;`, DialogCard = forwardRef(function DialogCard(props, forwardedRef) {
|
|
1931
|
+
let $ = c(44), { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, children, contentRef: forwardedContentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: radiusProp, scheme, shadow: shadowProp, width: widthProp } = props, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, t0;
|
|
1932
|
+
$[0] === radiusProp ? t0 = $[1] : (t0 = _getArrayProp(radiusProp), $[0] = radiusProp, $[1] = t0);
|
|
1919
1933
|
let radius = t0, t1;
|
|
1920
|
-
$[2] === shadowProp ? t1 = $[3] : (t1 =
|
|
1934
|
+
$[2] === shadowProp ? t1 = $[3] : (t1 = _getArrayProp(shadowProp), $[2] = shadowProp, $[3] = t1);
|
|
1921
1935
|
let shadow = t1, t2;
|
|
1922
|
-
$[4] === widthProp ? t2 = $[5] : (t2 =
|
|
1923
|
-
let width = t2, ref =
|
|
1924
|
-
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => ref.current, $[6] = t3) : t3 = $[6],
|
|
1936
|
+
$[4] === widthProp ? t2 = $[5] : (t2 = _getArrayProp(widthProp), $[4] = widthProp, $[5] = t2);
|
|
1937
|
+
let width = t2, ref = useRef(null), contentRef = useRef(null), { isTopLayer } = useLayer(), labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton, t3;
|
|
1938
|
+
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => ref.current, $[6] = t3) : t3 = $[6], useImperativeHandle(forwardedRef, t3);
|
|
1925
1939
|
let t4;
|
|
1926
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => contentRef.current, $[7] = t4) : t4 = $[7],
|
|
1940
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => contentRef.current, $[7] = t4) : t4 = $[7], useImperativeHandle(forwardedContentRef, t4);
|
|
1927
1941
|
let t5, t6;
|
|
1928
1942
|
$[8] === autoFocus ? (t5 = $[9], t6 = $[10]) : (t5 = () => {
|
|
1929
1943
|
autoFocus && ref.current && focusFirstDescendant(ref.current);
|
|
1930
|
-
}, t6 = [autoFocus, ref], $[8] = autoFocus, $[9] = t5, $[10] = t6),
|
|
1944
|
+
}, t6 = [autoFocus, ref], $[8] = autoFocus, $[9] = t5, $[10] = t6), useEffect(t5, t6);
|
|
1931
1945
|
let t7;
|
|
1932
1946
|
$[11] !== boundaryElement || $[12] !== isTopLayer || $[13] !== onClose || $[14] !== portalElement ? (t7 = (event) => {
|
|
1933
1947
|
if (!isTopLayer || !onClose) return;
|
|
1934
1948
|
let target = document.activeElement;
|
|
1935
1949
|
target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
|
|
1936
|
-
}, $[11] = boundaryElement, $[12] = isTopLayer, $[13] = onClose, $[14] = portalElement, $[15] = t7) : t7 = $[15],
|
|
1950
|
+
}, $[11] = boundaryElement, $[12] = isTopLayer, $[13] = onClose, $[14] = portalElement, $[15] = t7) : t7 = $[15], useGlobalKeyDown(t7);
|
|
1937
1951
|
let t8;
|
|
1938
1952
|
$[16] !== boundaryElement || $[17] !== isTopLayer || $[18] !== onClickOutside || $[19] !== portalElement ? (t8 = isTopLayer && onClickOutside && ((event_0) => {
|
|
1939
1953
|
let target_0 = event_0.target;
|
|
1940
1954
|
target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
|
|
1941
1955
|
}), $[16] = boundaryElement, $[17] = isTopLayer, $[18] = onClickOutside, $[19] = portalElement, $[20] = t8) : t8 = $[20];
|
|
1942
1956
|
let t9;
|
|
1943
|
-
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[21] = t9) : t9 = $[21],
|
|
1957
|
+
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[21] = t9) : t9 = $[21], useClickOutsideEvent(t8, t9);
|
|
1944
1958
|
let t10;
|
|
1945
|
-
$[22] !== header || $[23] !== labelId || $[24] !== onClose || $[25] !== showCloseButton || $[26] !== showHeader ? (t10 = showHeader && /* @__PURE__ */
|
|
1959
|
+
$[22] !== header || $[23] !== labelId || $[24] !== onClose || $[25] !== showCloseButton || $[26] !== showHeader ? (t10 = showHeader && /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(Flex, {
|
|
1946
1960
|
align: "flex-start",
|
|
1947
1961
|
padding: 3,
|
|
1948
|
-
children: [/* @__PURE__ */
|
|
1962
|
+
children: [/* @__PURE__ */ jsx(Box, {
|
|
1949
1963
|
flex: 1,
|
|
1950
1964
|
padding: 2,
|
|
1951
|
-
children: header && /* @__PURE__ */
|
|
1965
|
+
children: header && /* @__PURE__ */ jsx(Text, {
|
|
1952
1966
|
id: labelId,
|
|
1953
1967
|
size: 1,
|
|
1954
1968
|
weight: "semibold",
|
|
1955
1969
|
children: header
|
|
1956
1970
|
})
|
|
1957
|
-
}), showCloseButton && /* @__PURE__ */
|
|
1971
|
+
}), showCloseButton && /* @__PURE__ */ jsx(Box, {
|
|
1958
1972
|
flex: "none",
|
|
1959
|
-
children: /* @__PURE__ */
|
|
1973
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
1960
1974
|
"aria-label": "Close dialog",
|
|
1961
1975
|
disabled: !onClose,
|
|
1962
|
-
icon:
|
|
1976
|
+
icon: CloseIcon,
|
|
1963
1977
|
mode: "bleed",
|
|
1964
1978
|
onClick: onClose,
|
|
1965
1979
|
padding: 2
|
|
@@ -1967,16 +1981,16 @@ const StyledDialog = /* @__PURE__ */ (0, styled_components.styled)(require_tabLi
|
|
|
1967
1981
|
})]
|
|
1968
1982
|
}) }), $[22] = header, $[23] = labelId, $[24] = onClose, $[25] = showCloseButton, $[26] = showHeader, $[27] = t10) : t10 = $[27];
|
|
1969
1983
|
let t11;
|
|
1970
|
-
$[28] === children ? t11 = $[29] : (t11 = /* @__PURE__ */
|
|
1984
|
+
$[28] === children ? t11 = $[29] : (t11 = /* @__PURE__ */ jsx(DialogContent, {
|
|
1971
1985
|
flex: 1,
|
|
1972
1986
|
ref: contentRef,
|
|
1973
1987
|
tabIndex: -1,
|
|
1974
1988
|
children
|
|
1975
1989
|
}), $[28] = children, $[29] = t11);
|
|
1976
1990
|
let t12;
|
|
1977
|
-
$[30] === footer ? t12 = $[31] : (t12 = footer && /* @__PURE__ */
|
|
1991
|
+
$[30] === footer ? t12 = $[31] : (t12 = footer && /* @__PURE__ */ jsx(DialogFooter, { children: footer }), $[30] = footer, $[31] = t12);
|
|
1978
1992
|
let t13;
|
|
1979
|
-
$[32] !== t10 || $[33] !== t11 || $[34] !== t12 ? (t13 = /* @__PURE__ */
|
|
1993
|
+
$[32] !== t10 || $[33] !== t11 || $[34] !== t12 ? (t13 = /* @__PURE__ */ jsxs(DialogLayout, {
|
|
1980
1994
|
direction: "column",
|
|
1981
1995
|
children: [
|
|
1982
1996
|
t10,
|
|
@@ -1985,7 +1999,7 @@ const StyledDialog = /* @__PURE__ */ (0, styled_components.styled)(require_tabLi
|
|
|
1985
1999
|
]
|
|
1986
2000
|
}), $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13) : t13 = $[35];
|
|
1987
2001
|
let t14;
|
|
1988
|
-
$[36] !== radius || $[37] !== scheme || $[38] !== shadow || $[39] !== t13 ? (t14 = /* @__PURE__ */
|
|
2002
|
+
$[36] !== radius || $[37] !== scheme || $[38] !== shadow || $[39] !== t13 ? (t14 = /* @__PURE__ */ jsx(DialogCardRoot, {
|
|
1989
2003
|
radius,
|
|
1990
2004
|
ref,
|
|
1991
2005
|
scheme,
|
|
@@ -1993,25 +2007,25 @@ const StyledDialog = /* @__PURE__ */ (0, styled_components.styled)(require_tabLi
|
|
|
1993
2007
|
children: t13
|
|
1994
2008
|
}), $[36] = radius, $[37] = scheme, $[38] = shadow, $[39] = t13, $[40] = t14) : t14 = $[40];
|
|
1995
2009
|
let t15;
|
|
1996
|
-
return $[41] !== t14 || $[42] !== width ? (t15 = /* @__PURE__ */
|
|
2010
|
+
return $[41] !== t14 || $[42] !== width ? (t15 = /* @__PURE__ */ jsx(DialogContainer, {
|
|
1997
2011
|
"data-ui": "DialogCard",
|
|
1998
2012
|
width,
|
|
1999
2013
|
children: t14
|
|
2000
2014
|
}), $[41] = t14, $[42] = width, $[43] = t15) : t15 = $[43], t15;
|
|
2001
|
-
}), Dialog =
|
|
2002
|
-
let $ =
|
|
2015
|
+
}), Dialog = forwardRef(function Dialog(props, ref) {
|
|
2016
|
+
let $ = c(70), dialog = useDialog(), { layer } = useTheme_v2(), _positionProp, _zOffsetProp, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, t6;
|
|
2003
2017
|
$[0] === props ? (_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]) : ({__unstable_autoFocus: t0, __unstable_hideCloseButton: t1, cardRadius: t2, cardShadow: t3, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, padding: t4, portal: portalProp, position: _positionProp, scheme, width: t5, zOffset: _zOffsetProp, animate: t6, ...restProps} = 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);
|
|
2004
|
-
let autoFocus = t0 === void 0 || t0, hideCloseButton = t1 !== void 0 && 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 && t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = !
|
|
2005
|
-
$[22] === cardRadiusProp ? t7 = $[23] : (t7 =
|
|
2018
|
+
let autoFocus = t0 === void 0 || t0, hideCloseButton = t1 !== void 0 && 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 && t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = !usePrefersReducedMotion() && _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, t7;
|
|
2019
|
+
$[22] === cardRadiusProp ? t7 = $[23] : (t7 = _getArrayProp(cardRadiusProp), $[22] = cardRadiusProp, $[23] = t7);
|
|
2006
2020
|
let cardRadius = t7, t8;
|
|
2007
|
-
$[24] === paddingProp ? t8 = $[25] : (t8 =
|
|
2021
|
+
$[24] === paddingProp ? t8 = $[25] : (t8 = _getArrayProp(paddingProp), $[24] = paddingProp, $[25] = t8);
|
|
2008
2022
|
let padding = t8, t9;
|
|
2009
|
-
$[26] === positionProp ? t9 = $[27] : (t9 =
|
|
2023
|
+
$[26] === positionProp ? t9 = $[27] : (t9 = _getArrayProp(positionProp), $[26] = positionProp, $[27] = t9);
|
|
2010
2024
|
let position = t9, t10;
|
|
2011
|
-
$[28] === widthProp ? t10 = $[29] : (t10 =
|
|
2025
|
+
$[28] === widthProp ? t10 = $[29] : (t10 = _getArrayProp(widthProp), $[28] = widthProp, $[29] = t10);
|
|
2012
2026
|
let width = t10, t11;
|
|
2013
|
-
$[30] === zOffsetProp ? t11 = $[31] : (t11 =
|
|
2014
|
-
let zOffset = t11, preDivRef =
|
|
2027
|
+
$[30] === zOffsetProp ? t11 = $[31] : (t11 = _getArrayProp(zOffsetProp), $[30] = zOffsetProp, $[31] = t11);
|
|
2028
|
+
let zOffset = t11, preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null), t12;
|
|
2015
2029
|
$[32] === onFocus ? t12 = $[33] : (t12 = (event) => {
|
|
2016
2030
|
onFocus?.(event);
|
|
2017
2031
|
let target = event.target, cardElement = cardRef.current;
|
|
@@ -2023,9 +2037,9 @@ const StyledDialog = /* @__PURE__ */ (0, styled_components.styled)(require_tabLi
|
|
|
2023
2037
|
focusFirstDescendant(cardElement);
|
|
2024
2038
|
return;
|
|
2025
2039
|
}
|
|
2026
|
-
|
|
2040
|
+
isHTMLElement(event.target) && (focusedElementRef.current = event.target);
|
|
2027
2041
|
}, $[32] = onFocus, $[33] = t12);
|
|
2028
|
-
let handleFocus = t12, labelId = `${id}_label`, rootClickTimeoutRef =
|
|
2042
|
+
let handleFocus = t12, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0), t13;
|
|
2029
2043
|
$[34] !== boundaryElement || $[35] !== portalElement ? (t13 = () => {
|
|
2030
2044
|
rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
|
|
2031
2045
|
let activeElement = document.activeElement;
|
|
@@ -2041,12 +2055,12 @@ const StyledDialog = /* @__PURE__ */ (0, styled_components.styled)(require_tabLi
|
|
|
2041
2055
|
}, 0);
|
|
2042
2056
|
}, $[34] = boundaryElement, $[35] = portalElement, $[36] = t13) : t13 = $[36];
|
|
2043
2057
|
let handleRootClick = t13, t14;
|
|
2044
|
-
$[37] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */
|
|
2058
|
+
$[37] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsx("div", {
|
|
2045
2059
|
ref: preDivRef,
|
|
2046
2060
|
tabIndex: 0
|
|
2047
2061
|
}), $[37] = t14) : t14 = $[37];
|
|
2048
2062
|
let t15;
|
|
2049
|
-
$[38] !== autoFocus || $[39] !== cardRadius || $[40] !== cardShadow || $[41] !== children || $[42] !== contentRef || $[43] !== footer || $[44] !== header || $[45] !== hideCloseButton || $[46] !== id || $[47] !== onClickOutside || $[48] !== onClose || $[49] !== portalProp || $[50] !== scheme || $[51] !== width ? (t15 = /* @__PURE__ */
|
|
2063
|
+
$[38] !== autoFocus || $[39] !== cardRadius || $[40] !== cardShadow || $[41] !== children || $[42] !== contentRef || $[43] !== footer || $[44] !== header || $[45] !== hideCloseButton || $[46] !== id || $[47] !== onClickOutside || $[48] !== onClose || $[49] !== portalProp || $[50] !== scheme || $[51] !== width ? (t15 = /* @__PURE__ */ jsx(DialogCard, {
|
|
2050
2064
|
__unstable_autoFocus: autoFocus,
|
|
2051
2065
|
__unstable_hideCloseButton: hideCloseButton,
|
|
2052
2066
|
contentRef,
|
|
@@ -2064,12 +2078,12 @@ const StyledDialog = /* @__PURE__ */ (0, styled_components.styled)(require_tabLi
|
|
|
2064
2078
|
children
|
|
2065
2079
|
}), $[38] = autoFocus, $[39] = cardRadius, $[40] = cardShadow, $[41] = children, $[42] = contentRef, $[43] = footer, $[44] = header, $[45] = hideCloseButton, $[46] = id, $[47] = onClickOutside, $[48] = onClose, $[49] = portalProp, $[50] = scheme, $[51] = width, $[52] = t15) : t15 = $[52];
|
|
2066
2080
|
let t16;
|
|
2067
|
-
$[53] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */
|
|
2081
|
+
$[53] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", {
|
|
2068
2082
|
ref: postDivRef,
|
|
2069
2083
|
tabIndex: 0
|
|
2070
2084
|
}), $[53] = t16) : t16 = $[53];
|
|
2071
2085
|
let t17;
|
|
2072
|
-
$[54] !== animate || $[55] !== handleFocus || $[56] !== handleRootClick || $[57] !== id || $[58] !== labelId || $[59] !== onActivate || $[60] !== padding || $[61] !== position || $[62] !== ref || $[63] !== restProps || $[64] !== t15 || $[65] !== zOffset ? (t17 = /* @__PURE__ */
|
|
2086
|
+
$[54] !== animate || $[55] !== handleFocus || $[56] !== handleRootClick || $[57] !== id || $[58] !== labelId || $[59] !== onActivate || $[60] !== padding || $[61] !== position || $[62] !== ref || $[63] !== restProps || $[64] !== t15 || $[65] !== zOffset ? (t17 = /* @__PURE__ */ jsxs(StyledDialog, {
|
|
2073
2087
|
...restProps,
|
|
2074
2088
|
$animate: animate,
|
|
2075
2089
|
$padding: padding,
|
|
@@ -2091,7 +2105,7 @@ const StyledDialog = /* @__PURE__ */ (0, styled_components.styled)(require_tabLi
|
|
|
2091
2105
|
]
|
|
2092
2106
|
}), $[54] = animate, $[55] = handleFocus, $[56] = handleRootClick, $[57] = id, $[58] = labelId, $[59] = onActivate, $[60] = padding, $[61] = position, $[62] = ref, $[63] = restProps, $[64] = t15, $[65] = zOffset, $[66] = t17) : t17 = $[66];
|
|
2093
2107
|
let t18;
|
|
2094
|
-
return $[67] !== portalProp || $[68] !== t17 ? (t18 = /* @__PURE__ */
|
|
2108
|
+
return $[67] !== portalProp || $[68] !== t17 ? (t18 = /* @__PURE__ */ jsx(Portal, {
|
|
2095
2109
|
__unstable_name: portalProp,
|
|
2096
2110
|
children: t17
|
|
2097
2111
|
}), $[67] = portalProp, $[68] = t17, $[69] = t18) : t18 = $[69], t18;
|
|
@@ -2101,14 +2115,14 @@ const StyledDialog = /* @__PURE__ */ (0, styled_components.styled)(require_tabLi
|
|
|
2101
2115
|
* @beta
|
|
2102
2116
|
*/
|
|
2103
2117
|
function DialogProvider(props) {
|
|
2104
|
-
let $ =
|
|
2118
|
+
let $ = c(6), { children, position, zOffset } = props, t0;
|
|
2105
2119
|
$[0] !== position || $[1] !== zOffset ? (t0 = {
|
|
2106
2120
|
version: 0,
|
|
2107
2121
|
position,
|
|
2108
2122
|
zOffset
|
|
2109
2123
|
}, $[0] = position, $[1] = zOffset, $[2] = t0) : t0 = $[2];
|
|
2110
2124
|
let contextValue = t0, t1;
|
|
2111
|
-
return $[3] !== children || $[4] !== contextValue ? (t1 = /* @__PURE__ */
|
|
2125
|
+
return $[3] !== children || $[4] !== contextValue ? (t1 = /* @__PURE__ */ jsx(DialogContext.Provider, {
|
|
2112
2126
|
value: contextValue,
|
|
2113
2127
|
children
|
|
2114
2128
|
}), $[3] = children, $[4] = contextValue, $[5] = t1) : t1 = $[5], t1;
|
|
@@ -2118,24 +2132,24 @@ function DialogProvider(props) {
|
|
|
2118
2132
|
*
|
|
2119
2133
|
* @public
|
|
2120
2134
|
*/
|
|
2121
|
-
const MenuButton =
|
|
2122
|
-
let $ =
|
|
2135
|
+
const MenuButton = forwardRef(function MenuButton(props, forwardedRef) {
|
|
2136
|
+
let $ = c(62), { __unstable_disableRestoreFocusOnClose: t0, boundaryElement: deprecated_boundaryElement, button: buttonProp, id, menu: menuProp, onClose, onOpen, placement: deprecated_placement, popoverScheme: deprecated_popoverScheme, portal: t1, popover, popoverRadius: deprecated_popoverRadius, preventOverflow: deprecated_preventOverflow } = props, disableRestoreFocusOnClose = t0 !== void 0 && t0, deprecated_portal = t1 === void 0 || t1, [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), [buttonElement, setButtonElement] = useState(null), t2;
|
|
2123
2137
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
|
|
2124
|
-
let [menuElements, setChildMenuElements] =
|
|
2138
|
+
let [menuElements, setChildMenuElements] = useState(t2), openRef = useRef(open), t3, t4;
|
|
2125
2139
|
$[1] !== onOpen || $[2] !== open ? (t3 = () => {
|
|
2126
2140
|
onOpen && open && !openRef.current && onOpen();
|
|
2127
|
-
}, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]),
|
|
2141
|
+
}, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
|
|
2128
2142
|
let t5, t6;
|
|
2129
2143
|
$[5] !== onClose || $[6] !== open ? (t5 = () => {
|
|
2130
2144
|
onClose && !open && openRef.current && onClose();
|
|
2131
|
-
}, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]),
|
|
2145
|
+
}, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), useEffect(t5, t6);
|
|
2132
2146
|
let t7, t8;
|
|
2133
2147
|
$[9] === open ? (t7 = $[10], t8 = $[11]) : (t7 = () => {
|
|
2134
2148
|
openRef.current = open;
|
|
2135
|
-
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8),
|
|
2149
|
+
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8), useEffect(t7, t8);
|
|
2136
2150
|
let t9;
|
|
2137
2151
|
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
2138
|
-
setOpen(_temp$
|
|
2152
|
+
setOpen(_temp$2), setShouldFocus(null);
|
|
2139
2153
|
}, $[12] = t9) : t9 = $[12];
|
|
2140
2154
|
let handleButtonClick = t9, t10;
|
|
2141
2155
|
$[13] === open ? t10 = $[14] : (t10 = (event) => {
|
|
@@ -2179,7 +2193,7 @@ const MenuButton = (0, react.forwardRef)(function MenuButton(props, forwardedRef
|
|
|
2179
2193
|
let handleItemClick = t15, t16;
|
|
2180
2194
|
$[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];
|
|
2181
2195
|
let registerElement = t16, t17;
|
|
2182
|
-
$[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp &&
|
|
2196
|
+
$[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && cloneElement(menuProp, {
|
|
2183
2197
|
"aria-labelledby": id,
|
|
2184
2198
|
onBlurCapture: handleBlur,
|
|
2185
2199
|
onClickOutside: handleMenuClickOutside,
|
|
@@ -2190,7 +2204,7 @@ const MenuButton = (0, react.forwardRef)(function MenuButton(props, forwardedRef
|
|
|
2190
2204
|
shouldFocus
|
|
2191
2205
|
}), $[28] = buttonElement, $[29] = handleBlur, $[30] = handleItemClick, $[31] = handleMenuClickOutside, $[32] = handleMenuEscape, $[33] = id, $[34] = menuProp, $[35] = shouldFocus, $[36] = t17) : t17 = $[36];
|
|
2192
2206
|
let menu = t17, t18;
|
|
2193
|
-
$[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open ? (t18 = buttonProp &&
|
|
2207
|
+
$[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open ? (t18 = buttonProp && cloneElement(buttonProp, {
|
|
2194
2208
|
"data-ui": "MenuButton",
|
|
2195
2209
|
id,
|
|
2196
2210
|
onClick: handleButtonClick,
|
|
@@ -2202,7 +2216,7 @@ const MenuButton = (0, react.forwardRef)(function MenuButton(props, forwardedRef
|
|
|
2202
2216
|
selected: buttonProp.props.selected ?? open
|
|
2203
2217
|
}), $[37] = buttonProp, $[38] = handleMouseDown, $[39] = id, $[40] = open, $[41] = t18) : t18 = $[41];
|
|
2204
2218
|
let button = t18, t19, t20;
|
|
2205
|
-
$[42] === buttonElement ? (t19 = $[43], t20 = $[44]) : (t19 = () => buttonElement, t20 = [buttonElement], $[42] = buttonElement, $[43] = t19, $[44] = t20),
|
|
2219
|
+
$[42] === buttonElement ? (t19 = $[43], t20 = $[44]) : (t19 = () => buttonElement, t20 = [buttonElement], $[42] = buttonElement, $[43] = t19, $[44] = t20), useImperativeHandle(forwardedRef, t19, t20);
|
|
2206
2220
|
let t21;
|
|
2207
2221
|
$[45] === popover ? t21 = $[46] : (t21 = popover || {}, $[45] = popover, $[46] = t21);
|
|
2208
2222
|
let t22;
|
|
@@ -2217,9 +2231,9 @@ const MenuButton = (0, react.forwardRef)(function MenuButton(props, forwardedRef
|
|
|
2217
2231
|
...t21
|
|
2218
2232
|
}, $[47] = deprecated_boundaryElement, $[48] = deprecated_placement, $[49] = deprecated_popoverRadius, $[50] = deprecated_popoverScheme, $[51] = deprecated_portal, $[52] = deprecated_preventOverflow, $[53] = t21, $[54] = t22) : t22 = $[54];
|
|
2219
2233
|
let popoverProps = t22, t23;
|
|
2220
|
-
$[55] === button ? t23 = $[56] : (t23 = button || /* @__PURE__ */
|
|
2234
|
+
$[55] === button ? t23 = $[56] : (t23 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[55] = button, $[56] = t23);
|
|
2221
2235
|
let t24;
|
|
2222
|
-
return $[57] !== menu || $[58] !== open || $[59] !== popoverProps || $[60] !== t23 ? (t24 = /* @__PURE__ */
|
|
2236
|
+
return $[57] !== menu || $[58] !== open || $[59] !== popoverProps || $[60] !== t23 ? (t24 = /* @__PURE__ */ jsx(Popover, {
|
|
2223
2237
|
"data-ui": "MenuButton__popover",
|
|
2224
2238
|
...popoverProps,
|
|
2225
2239
|
content: menu,
|
|
@@ -2227,16 +2241,16 @@ const MenuButton = (0, react.forwardRef)(function MenuButton(props, forwardedRef
|
|
|
2227
2241
|
children: t23
|
|
2228
2242
|
}), $[57] = menu, $[58] = open, $[59] = popoverProps, $[60] = t23, $[61] = t24) : t24 = $[61], t24;
|
|
2229
2243
|
});
|
|
2230
|
-
function _temp$
|
|
2244
|
+
function _temp$2(v) {
|
|
2231
2245
|
return !v;
|
|
2232
2246
|
}
|
|
2233
|
-
const animation =
|
|
2247
|
+
const animation = css`background-image:linear-gradient( to right,var(--card-skeleton-color-from),var(--card-skeleton-color-to),var(--card-skeleton-color-from),var(--card-skeleton-color-from),var(--card-skeleton-color-from) );background-position:100%;background-size:200% 100%;background-attachment:fixed;animation-name:${keyframes`0%{background-position:100%;}100%{background-position:-100%;}`};animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-duration:2000ms;`, skeletonStyle = css`opacity:${({ $visible }) => +!!$visible};transition:opacity 200ms ease-in;@media screen and (prefers-reduced-motion:no-preference){${({ $animated }) => $animated ? animation : css`background-color:var(--card-skeleton-color-from);`}}@media screen and (prefers-reduced-motion:reduce){background-color:var(--card-skeleton-color-from);}`, StyledSkeleton$1 = /* @__PURE__ */ styled(Box).withConfig({
|
|
2234
2248
|
displayName: "StyledSkeleton",
|
|
2235
2249
|
componentId: "sc-xewr8x-0"
|
|
2236
|
-
})(
|
|
2237
|
-
let $ =
|
|
2250
|
+
})(responsiveRadiusStyle, skeletonStyle), Skeleton = forwardRef(function Skeleton(props, ref) {
|
|
2251
|
+
let $ = c(16), delay, radius, restProps, t0;
|
|
2238
2252
|
$[0] === props ? (delay = $[1], radius = $[2], restProps = $[3], t0 = $[4]) : ({animated: t0, delay, radius, ...restProps} = props, $[0] = props, $[1] = delay, $[2] = radius, $[3] = restProps, $[4] = t0);
|
|
2239
|
-
let animated = t0 !== void 0 && t0, [visible, setVisible] =
|
|
2253
|
+
let animated = t0 !== void 0 && t0, [visible, setVisible] = useState(!delay), t1, t2;
|
|
2240
2254
|
$[5] === delay ? (t1 = $[6], t2 = $[7]) : (t1 = () => {
|
|
2241
2255
|
if (!delay) return;
|
|
2242
2256
|
let timeout = setTimeout(() => {
|
|
@@ -2245,79 +2259,79 @@ const animation = styled_components.css`background-image:linear-gradient( to rig
|
|
|
2245
2259
|
return () => {
|
|
2246
2260
|
clearTimeout(timeout);
|
|
2247
2261
|
};
|
|
2248
|
-
}, t2 = [delay], $[5] = delay, $[6] = t1, $[7] = t2),
|
|
2262
|
+
}, t2 = [delay], $[5] = delay, $[6] = t1, $[7] = t2), useEffect(t1, t2);
|
|
2249
2263
|
let t3;
|
|
2250
|
-
$[8] === radius ? t3 = $[9] : (t3 =
|
|
2264
|
+
$[8] === radius ? t3 = $[9] : (t3 = _getArrayProp(radius), $[8] = radius, $[9] = t3);
|
|
2251
2265
|
let t4 = !delay || visible, t5;
|
|
2252
|
-
return $[10] !== animated || $[11] !== ref || $[12] !== restProps || $[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */
|
|
2266
|
+
return $[10] !== animated || $[11] !== ref || $[12] !== restProps || $[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */ jsx(StyledSkeleton$1, {
|
|
2253
2267
|
...restProps,
|
|
2254
2268
|
$animated: animated,
|
|
2255
2269
|
$radius: t3,
|
|
2256
2270
|
$visible: t4,
|
|
2257
2271
|
ref
|
|
2258
2272
|
}), $[10] = animated, $[11] = ref, $[12] = restProps, $[13] = t3, $[14] = t4, $[15] = t5) : t5 = $[15], t5;
|
|
2259
|
-
}), StyledSkeleton = /* @__PURE__ */
|
|
2273
|
+
}), StyledSkeleton = /* @__PURE__ */ styled(Skeleton).withConfig({
|
|
2260
2274
|
displayName: "StyledSkeleton",
|
|
2261
2275
|
componentId: "sc-d8ims-0"
|
|
2262
2276
|
})((props) => {
|
|
2263
|
-
let { $size, $style } = props, { font, media } =
|
|
2264
|
-
return
|
|
2277
|
+
let { $size, $style } = props, { font, media } = getTheme_v2(props.theme), fontStyle = font[$style];
|
|
2278
|
+
return _responsive(media, $size, (sizeIndex) => {
|
|
2265
2279
|
let fontSize = fontStyle.sizes[sizeIndex];
|
|
2266
2280
|
return { height: fontSize.lineHeight - fontSize.ascenderHeight - fontSize.descenderHeight };
|
|
2267
2281
|
});
|
|
2268
|
-
}), TextSkeleton =
|
|
2269
|
-
let $ =
|
|
2282
|
+
}), TextSkeleton = forwardRef(function TextSkeleton(props, ref) {
|
|
2283
|
+
let $ = c(9), restProps, t0;
|
|
2270
2284
|
$[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
|
|
2271
2285
|
let size = t0 === void 0 ? 2 : t0, t1;
|
|
2272
|
-
$[3] === size ? t1 = $[4] : (t1 =
|
|
2286
|
+
$[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
|
|
2273
2287
|
let $size = t1, t2;
|
|
2274
|
-
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */
|
|
2288
|
+
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
|
|
2275
2289
|
...restProps,
|
|
2276
2290
|
$size,
|
|
2277
2291
|
ref,
|
|
2278
2292
|
$style: "text"
|
|
2279
2293
|
}), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
|
|
2280
|
-
}), LabelSkeleton =
|
|
2281
|
-
let $ =
|
|
2294
|
+
}), LabelSkeleton = forwardRef(function LabelSkeleton(props, ref) {
|
|
2295
|
+
let $ = c(9), restProps, t0;
|
|
2282
2296
|
$[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
|
|
2283
2297
|
let size = t0 === void 0 ? 2 : t0, t1;
|
|
2284
|
-
$[3] === size ? t1 = $[4] : (t1 =
|
|
2298
|
+
$[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
|
|
2285
2299
|
let $size = t1, t2;
|
|
2286
|
-
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */
|
|
2300
|
+
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
|
|
2287
2301
|
...restProps,
|
|
2288
2302
|
$size,
|
|
2289
2303
|
ref,
|
|
2290
2304
|
$style: "label"
|
|
2291
2305
|
}), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
|
|
2292
|
-
}), HeadingSkeleton =
|
|
2293
|
-
let $ =
|
|
2306
|
+
}), HeadingSkeleton = forwardRef(function HeadingSkeleton(props, ref) {
|
|
2307
|
+
let $ = c(9), restProps, t0;
|
|
2294
2308
|
$[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
|
|
2295
2309
|
let size = t0 === void 0 ? 2 : t0, t1;
|
|
2296
|
-
$[3] === size ? t1 = $[4] : (t1 =
|
|
2310
|
+
$[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
|
|
2297
2311
|
let $size = t1, t2;
|
|
2298
|
-
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */
|
|
2312
|
+
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
|
|
2299
2313
|
...restProps,
|
|
2300
2314
|
$size,
|
|
2301
2315
|
ref,
|
|
2302
2316
|
$style: "heading"
|
|
2303
2317
|
}), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
|
|
2304
|
-
}), CodeSkeleton =
|
|
2305
|
-
let $ =
|
|
2318
|
+
}), CodeSkeleton = forwardRef(function CodeSkeleton(props, ref) {
|
|
2319
|
+
let $ = c(9), restProps, t0;
|
|
2306
2320
|
$[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
|
|
2307
2321
|
let size = t0 === void 0 ? 2 : t0, t1;
|
|
2308
|
-
$[3] === size ? t1 = $[4] : (t1 =
|
|
2322
|
+
$[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
|
|
2309
2323
|
let $size = t1, t2;
|
|
2310
|
-
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */
|
|
2324
|
+
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
|
|
2311
2325
|
...restProps,
|
|
2312
2326
|
$size,
|
|
2313
2327
|
ref,
|
|
2314
2328
|
$style: "code"
|
|
2315
2329
|
}), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
|
|
2316
|
-
}), TabPanel =
|
|
2317
|
-
let $ =
|
|
2330
|
+
}), TabPanel = forwardRef(function TabPanel(props, ref) {
|
|
2331
|
+
let $ = c(9), flex, restProps;
|
|
2318
2332
|
$[0] === props ? (flex = $[1], restProps = $[2]) : ({flex, ...restProps} = props, $[0] = props, $[1] = flex, $[2] = restProps);
|
|
2319
2333
|
let t0 = props.tabIndex === void 0 ? 0 : props.tabIndex, t1;
|
|
2320
|
-
return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */
|
|
2334
|
+
return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ jsx(Box, {
|
|
2321
2335
|
"data-ui": "TabPanel",
|
|
2322
2336
|
...restProps,
|
|
2323
2337
|
flex,
|
|
@@ -2336,23 +2350,23 @@ const animation = styled_components.css`background-image:linear-gradient( to rig
|
|
|
2336
2350
|
warning: "caution",
|
|
2337
2351
|
success: "positive",
|
|
2338
2352
|
info: "neutral"
|
|
2339
|
-
}, TextBox =
|
|
2353
|
+
}, TextBox = styled(Flex).withConfig({
|
|
2340
2354
|
displayName: "TextBox",
|
|
2341
|
-
componentId: "sc-
|
|
2342
|
-
})`overflow-x:auto;`, StyledToast =
|
|
2355
|
+
componentId: "sc-wxn2nh-0"
|
|
2356
|
+
})`overflow-x:auto;`, StyledToast = styled(Card).withConfig({
|
|
2343
2357
|
displayName: "StyledToast",
|
|
2344
|
-
componentId: "sc-
|
|
2345
|
-
})`pointer-events:all;width:100%;position:relative;overflow:hidden;overflow:clip;&[data-has-duration]{padding-bottom:calc(${2}px / 2);}`, LoadingBar =
|
|
2358
|
+
componentId: "sc-wxn2nh-1"
|
|
2359
|
+
})`pointer-events:all;width:100%;position:relative;overflow:hidden;overflow:clip;&[data-has-duration]{padding-bottom:calc(${2}px / 2);}`, LoadingBar = styled.div.withConfig({
|
|
2346
2360
|
displayName: "LoadingBar",
|
|
2347
|
-
componentId: "sc-
|
|
2348
|
-
})`display:flex;position:absolute;bottom:0px;top:0px;left:0px;right:0px;pointer-events:none;z-index:-1;overflow:hidden;overflow:clip;background:transparent;align-items:flex-end;will-change:opacity;`, LoadingBarMask =
|
|
2361
|
+
componentId: "sc-wxn2nh-2"
|
|
2362
|
+
})`display:flex;position:absolute;bottom:0px;top:0px;left:0px;right:0px;pointer-events:none;z-index:-1;overflow:hidden;overflow:clip;background:transparent;align-items:flex-end;will-change:opacity;`, LoadingBarMask = styled(Card).withConfig({
|
|
2349
2363
|
displayName: "LoadingBarMask",
|
|
2350
|
-
componentId: "sc-
|
|
2351
|
-
})`position:absolute;top:0;left:-${2}px;right:-${2}px;bottom:${2}px;z-index:1;`, LoadingBarProgress =
|
|
2364
|
+
componentId: "sc-wxn2nh-3"
|
|
2365
|
+
})`position:absolute;top:0;left:-${2}px;right:-${2}px;bottom:${2}px;z-index:1;`, LoadingBarProgress = styled(Card).withConfig({
|
|
2352
2366
|
displayName: "LoadingBarProgress",
|
|
2353
|
-
componentId: "sc-
|
|
2367
|
+
componentId: "sc-wxn2nh-4"
|
|
2354
2368
|
})`display:block;height:100%;width:100%;transform-origin:0% 50%;background-color:${(props) => {
|
|
2355
|
-
let { color } =
|
|
2369
|
+
let { color } = getTheme_v2(props.theme);
|
|
2356
2370
|
return color.button.default[props.tone].enabled.bg;
|
|
2357
2371
|
}};`, ROLES = {
|
|
2358
2372
|
error: "alert",
|
|
@@ -2368,9 +2382,9 @@ const animation = styled_components.css`background-image:linear-gradient( to rig
|
|
|
2368
2382
|
* @public
|
|
2369
2383
|
*/
|
|
2370
2384
|
function Toast(props) {
|
|
2371
|
-
let $ =
|
|
2385
|
+
let $ = c(50), closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
|
|
2372
2386
|
$[0] === props ? (closable = $[1], description = $[2], duration = $[3], onClose = $[4], restProps = $[5], status = $[6], t0 = $[7], title = $[8], updatedAt = $[9]) : ({closable, description, duration, onClose, radius: t0, title, status, updatedAt, ...restProps} = props, $[0] = props, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = restProps, $[6] = status, $[7] = t0, $[8] = title, $[9] = updatedAt);
|
|
2373
|
-
let radius = t0 === void 0 ? 3 : t0, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration =
|
|
2387
|
+
let radius = t0 === void 0 ? 3 : t0, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = usePrefersReducedMotion() ? 0 : .26, t1;
|
|
2374
2388
|
$[10] === visualDuration ? t1 = $[11] : (t1 = visualDuration ? {
|
|
2375
2389
|
type: "spring",
|
|
2376
2390
|
visualDuration,
|
|
@@ -2383,13 +2397,13 @@ function Toast(props) {
|
|
|
2383
2397
|
let animate = t3, t4;
|
|
2384
2398
|
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
|
|
2385
2399
|
let exit = t4, t5 = hasDuration ? "" : void 0, t6;
|
|
2386
|
-
$[15] === title ? t6 = $[16] : (t6 = title && /* @__PURE__ */
|
|
2400
|
+
$[15] === title ? t6 = $[16] : (t6 = title && /* @__PURE__ */ jsx(Text, {
|
|
2387
2401
|
size: 1,
|
|
2388
2402
|
weight: "medium",
|
|
2389
2403
|
children: title
|
|
2390
2404
|
}), $[15] = title, $[16] = t6);
|
|
2391
2405
|
let t7;
|
|
2392
|
-
$[17] !== description || $[18] !== transition ? (t7 = description && /* @__PURE__ */
|
|
2406
|
+
$[17] !== description || $[18] !== transition ? (t7 = description && /* @__PURE__ */ jsx(MotionText, {
|
|
2393
2407
|
muted: !0,
|
|
2394
2408
|
size: 1,
|
|
2395
2409
|
variants: content,
|
|
@@ -2397,20 +2411,20 @@ function Toast(props) {
|
|
|
2397
2411
|
children: description
|
|
2398
2412
|
}), $[17] = description, $[18] = transition, $[19] = t7) : t7 = $[19];
|
|
2399
2413
|
let t8;
|
|
2400
|
-
$[20] !== t6 || $[21] !== t7 ? (t8 = /* @__PURE__ */
|
|
2414
|
+
$[20] !== t6 || $[21] !== t7 ? (t8 = /* @__PURE__ */ jsx(TextBox, {
|
|
2401
2415
|
flex: 1,
|
|
2402
2416
|
padding: 3,
|
|
2403
|
-
children: /* @__PURE__ */
|
|
2417
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
2404
2418
|
space: 3,
|
|
2405
2419
|
children: [t6, t7]
|
|
2406
2420
|
})
|
|
2407
2421
|
}), $[20] = t6, $[21] = t7, $[22] = t8) : t8 = $[22];
|
|
2408
2422
|
let t9;
|
|
2409
|
-
$[23] !== buttonTone || $[24] !== closable || $[25] !== onClose ? (t9 = closable && /* @__PURE__ */
|
|
2423
|
+
$[23] !== buttonTone || $[24] !== closable || $[25] !== onClose ? (t9 = closable && /* @__PURE__ */ jsx(Box, {
|
|
2410
2424
|
padding: 1,
|
|
2411
|
-
children: /* @__PURE__ */
|
|
2425
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
2412
2426
|
as: "button",
|
|
2413
|
-
icon:
|
|
2427
|
+
icon: CloseIcon,
|
|
2414
2428
|
mode: "bleed",
|
|
2415
2429
|
padding: 2,
|
|
2416
2430
|
tone: buttonTone,
|
|
@@ -2419,20 +2433,20 @@ function Toast(props) {
|
|
|
2419
2433
|
})
|
|
2420
2434
|
}), $[23] = buttonTone, $[24] = closable, $[25] = onClose, $[26] = t9) : t9 = $[26];
|
|
2421
2435
|
let t10;
|
|
2422
|
-
$[27] !== t8 || $[28] !== t9 || $[29] !== transition ? (t10 = /* @__PURE__ */
|
|
2436
|
+
$[27] !== t8 || $[28] !== t9 || $[29] !== transition ? (t10 = /* @__PURE__ */ jsxs(MotionFlex, {
|
|
2423
2437
|
align: "flex-start",
|
|
2424
2438
|
variants: content,
|
|
2425
2439
|
transition,
|
|
2426
2440
|
children: [t8, t9]
|
|
2427
2441
|
}), $[27] = t8, $[28] = t9, $[29] = transition, $[30] = t10) : t10 = $[30];
|
|
2428
2442
|
let t11;
|
|
2429
|
-
$[31] !== cardTone || $[32] !== duration || $[33] !== hasDuration || $[34] !== onClose || $[35] !== radius || $[36] !== transition || $[37] !== updatedAt || $[38] !== visualDuration ? (t11 = hasDuration && /* @__PURE__ */
|
|
2443
|
+
$[31] !== cardTone || $[32] !== duration || $[33] !== hasDuration || $[34] !== onClose || $[35] !== radius || $[36] !== transition || $[37] !== updatedAt || $[38] !== visualDuration ? (t11 = hasDuration && /* @__PURE__ */ jsxs(MotionLoadingBar, {
|
|
2430
2444
|
variants: content,
|
|
2431
2445
|
transition,
|
|
2432
|
-
children: [/* @__PURE__ */
|
|
2446
|
+
children: [/* @__PURE__ */ jsx(LoadingBarMask, {
|
|
2433
2447
|
tone: cardTone,
|
|
2434
2448
|
radius
|
|
2435
|
-
}), /* @__PURE__ */
|
|
2449
|
+
}), /* @__PURE__ */ jsx(MotionLoadingBarProgress, {
|
|
2436
2450
|
tone: cardTone,
|
|
2437
2451
|
initial: { scaleX: 0 },
|
|
2438
2452
|
animate: { scaleX: 1 },
|
|
@@ -2445,7 +2459,7 @@ function Toast(props) {
|
|
|
2445
2459
|
}, `progress-${updatedAt}`)]
|
|
2446
2460
|
}), $[31] = cardTone, $[32] = duration, $[33] = hasDuration, $[34] = onClose, $[35] = radius, $[36] = transition, $[37] = updatedAt, $[38] = visualDuration, $[39] = t11) : t11 = $[39];
|
|
2447
2461
|
let t12;
|
|
2448
|
-
return $[40] !== cardTone || $[41] !== radius || $[42] !== restProps || $[43] !== role || $[44] !== t10 || $[45] !== t11 || $[46] !== t5 || $[47] !== transition || $[48] !== visualDuration ? (t12 = /* @__PURE__ */
|
|
2462
|
+
return $[40] !== cardTone || $[41] !== radius || $[42] !== restProps || $[43] !== role || $[44] !== t10 || $[45] !== t11 || $[46] !== t5 || $[47] !== transition || $[48] !== visualDuration ? (t12 = /* @__PURE__ */ jsxs(MotionToast, {
|
|
2449
2463
|
"data-ui": "Toast",
|
|
2450
2464
|
role,
|
|
2451
2465
|
...restProps,
|
|
@@ -2491,23 +2505,29 @@ const container = {
|
|
|
2491
2505
|
initial: { willChange: "transform" },
|
|
2492
2506
|
hidden: { opacity: 0 },
|
|
2493
2507
|
visible: { opacity: 1 }
|
|
2494
|
-
}, MotionToast =
|
|
2508
|
+
}, MotionToast = motion.create(StyledToast), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionLoadingBar = motion.create(LoadingBar), MotionLoadingBarProgress = motion.create(LoadingBarProgress);
|
|
2495
2509
|
/**
|
|
2496
2510
|
* Some components should only render after mounting to the DOM, and not be rendered at all during SSR renderToString or equivalent.
|
|
2497
2511
|
* @public
|
|
2498
2512
|
*/
|
|
2499
2513
|
function useMounted() {
|
|
2500
|
-
return
|
|
2514
|
+
return useSyncExternalStore(subscribe, _temp$1, _temp2);
|
|
2515
|
+
}
|
|
2516
|
+
function _temp2() {
|
|
2517
|
+
return !1;
|
|
2518
|
+
}
|
|
2519
|
+
function _temp$1() {
|
|
2520
|
+
return !0;
|
|
2501
2521
|
}
|
|
2502
|
-
const subscribe = () => () => {}, ToastContext =
|
|
2522
|
+
const subscribe = () => () => {}, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null);
|
|
2503
2523
|
/**
|
|
2504
2524
|
* @internal
|
|
2505
2525
|
*/
|
|
2506
2526
|
function ToastLayer(props) {
|
|
2507
|
-
let $ =
|
|
2527
|
+
let $ = c(9), { children, padding: t0, paddingX, paddingY, gap: t1 } = props, padding = t0 === void 0 ? 4 : t0, gap = t1 === void 0 ? 3 : t1, { zIndex } = useLayer(), t2;
|
|
2508
2528
|
$[0] === zIndex ? t2 = $[1] : (t2 = { zIndex }, $[0] = zIndex, $[1] = t2);
|
|
2509
2529
|
let t3;
|
|
2510
|
-
return $[2] !== children || $[3] !== gap || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== t2 ? (t3 = /* @__PURE__ */
|
|
2530
|
+
return $[2] !== children || $[3] !== gap || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== t2 ? (t3 = /* @__PURE__ */ jsx(StyledLayer, {
|
|
2511
2531
|
forwardedAs: "ul",
|
|
2512
2532
|
"data-ui": "ToastProvider",
|
|
2513
2533
|
padding,
|
|
@@ -2519,7 +2539,7 @@ function ToastLayer(props) {
|
|
|
2519
2539
|
children
|
|
2520
2540
|
}), $[2] = children, $[3] = gap, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = t2, $[8] = t3) : t3 = $[8], t3;
|
|
2521
2541
|
}
|
|
2522
|
-
const StyledLayer =
|
|
2542
|
+
const StyledLayer = styled(Grid).withConfig({
|
|
2523
2543
|
displayName: "StyledLayer",
|
|
2524
2544
|
componentId: "sc-chanfh-0"
|
|
2525
2545
|
})`box-sizing:border-box;position:fixed;right:0;bottom:0;list-style:none;pointer-events:none;max-width:420px;width:100%;`;
|
|
@@ -2532,16 +2552,16 @@ function generateToastId() {
|
|
|
2532
2552
|
* @public
|
|
2533
2553
|
*/
|
|
2534
2554
|
function ToastProvider(props) {
|
|
2535
|
-
let $ =
|
|
2555
|
+
let $ = c(13), { children, padding, paddingX, paddingY, gap, zOffset: t0 } = props, zOffset = t0 === void 0 ? 1 : t0, t1;
|
|
2536
2556
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
|
|
2537
|
-
let [state, setState] =
|
|
2557
|
+
let [state, setState] = useState(t1), mounted = useMounted(), t2;
|
|
2538
2558
|
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2539
2559
|
let push = (params) => {
|
|
2540
2560
|
let id = params.id || generateToastId(), duration = params.duration || 5e3;
|
|
2541
|
-
return
|
|
2561
|
+
return startTransition(() => {
|
|
2542
2562
|
setState((prevState) => {
|
|
2543
2563
|
if (duration === .01) return prevState.filter((toast) => toast.id !== id);
|
|
2544
|
-
let dismiss = () =>
|
|
2564
|
+
let dismiss = () => startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
|
|
2545
2565
|
return [...prevState.filter((toast_1) => toast_1.id !== id), {
|
|
2546
2566
|
dismiss,
|
|
2547
2567
|
id,
|
|
@@ -2560,14 +2580,14 @@ function ToastProvider(props) {
|
|
|
2560
2580
|
}, $[1] = t2;
|
|
2561
2581
|
} else t2 = $[1];
|
|
2562
2582
|
let value = t2, t3;
|
|
2563
|
-
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = mounted && /* @__PURE__ */
|
|
2583
|
+
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = mounted && /* @__PURE__ */ jsx(LayerProvider, {
|
|
2564
2584
|
zOffset,
|
|
2565
|
-
children: /* @__PURE__ */
|
|
2585
|
+
children: /* @__PURE__ */ jsx(ToastLayer, {
|
|
2566
2586
|
padding,
|
|
2567
2587
|
paddingX,
|
|
2568
2588
|
paddingY,
|
|
2569
2589
|
gap,
|
|
2570
|
-
children: /* @__PURE__ */
|
|
2590
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
2571
2591
|
initial: !1,
|
|
2572
2592
|
mode: "popLayout",
|
|
2573
2593
|
children: state.map(_temp)
|
|
@@ -2575,14 +2595,14 @@ function ToastProvider(props) {
|
|
|
2575
2595
|
})
|
|
2576
2596
|
}), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t3) : t3 = $[9];
|
|
2577
2597
|
let t4;
|
|
2578
|
-
return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */
|
|
2598
|
+
return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxs(ToastContext.Provider, {
|
|
2579
2599
|
value,
|
|
2580
2600
|
children: [children, t3]
|
|
2581
2601
|
}), $[10] = children, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
|
|
2582
2602
|
}
|
|
2583
2603
|
function _temp(t0) {
|
|
2584
2604
|
let { dismiss: dismiss_0, id: id_0, params: params_0, updatedAt } = t0;
|
|
2585
|
-
return /* @__PURE__ */
|
|
2605
|
+
return /* @__PURE__ */ jsx(Toast, {
|
|
2586
2606
|
closable: params_0.closable,
|
|
2587
2607
|
description: params_0.description,
|
|
2588
2608
|
onClose: dismiss_0,
|
|
@@ -2596,9 +2616,9 @@ function _temp(t0) {
|
|
|
2596
2616
|
* @public
|
|
2597
2617
|
*/
|
|
2598
2618
|
function useToast() {
|
|
2599
|
-
let value =
|
|
2619
|
+
let value = useContext(ToastContext);
|
|
2600
2620
|
if (!value) throw Error("useToast(): missing context value");
|
|
2601
|
-
if (!
|
|
2621
|
+
if (!isRecord(value) || value.version !== 0) throw Error("useToast(): the context value is not compatible");
|
|
2602
2622
|
return value;
|
|
2603
2623
|
}
|
|
2604
2624
|
function _findPrevItemElement(state, itemElements, focusedElement) {
|
|
@@ -2643,25 +2663,25 @@ function _focusItemElement(el) {
|
|
|
2643
2663
|
/**
|
|
2644
2664
|
* @internal
|
|
2645
2665
|
*/
|
|
2646
|
-
const TreeContext =
|
|
2647
|
-
let $ =
|
|
2666
|
+
const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = forwardRef(function Tree(props, forwardedRef) {
|
|
2667
|
+
let $ = c(38), children, gap, onFocus, restProps, t0;
|
|
2648
2668
|
$[0] === props ? (children = $[1], gap = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]) : ({children, gap, space: t0, onFocus, ...restProps} = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = onFocus, $[4] = restProps, $[5] = t0);
|
|
2649
|
-
let spacing = gap === void 0 ? t0 === void 0 ? 1 : t0 : gap, ref =
|
|
2669
|
+
let spacing = gap === void 0 ? t0 === void 0 ? 1 : t0 : gap, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement), t1;
|
|
2650
2670
|
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[6] = t1) : t1 = $[6];
|
|
2651
2671
|
let path = t1, t2;
|
|
2652
2672
|
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[7] = t2) : t2 = $[7];
|
|
2653
|
-
let [itemElements, setItemElements] =
|
|
2673
|
+
let [itemElements, setItemElements] = useState(t2), t3;
|
|
2654
2674
|
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[8] = t3) : t3 = $[8];
|
|
2655
|
-
let [state, setState] =
|
|
2656
|
-
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[9] = t4) : t4 = $[9],
|
|
2675
|
+
let [state, setState] = useState(t3), stateRef = useRef(state), t4;
|
|
2676
|
+
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[9] = t4) : t4 = $[9], useImperativeHandle(forwardedRef, t4);
|
|
2657
2677
|
let t5, t6;
|
|
2658
2678
|
$[10] === focusedElement ? (t5 = $[11], t6 = $[12]) : (t5 = () => {
|
|
2659
2679
|
focusedElementRef.current = focusedElement;
|
|
2660
|
-
}, t6 = [focusedElement], $[10] = focusedElement, $[11] = t5, $[12] = t6),
|
|
2680
|
+
}, t6 = [focusedElement], $[10] = focusedElement, $[11] = t5, $[12] = t6), useEffect(t5, t6);
|
|
2661
2681
|
let t7, t8;
|
|
2662
2682
|
$[13] === state ? (t7 = $[14], t8 = $[15]) : (t7 = () => {
|
|
2663
2683
|
stateRef.current = state;
|
|
2664
|
-
}, t8 = [state], $[13] = state, $[14] = t7, $[15] = t8),
|
|
2684
|
+
}, t8 = [state], $[13] = state, $[14] = t7, $[15] = t8), useEffect(t7, t8);
|
|
2665
2685
|
let t9;
|
|
2666
2686
|
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t9 = (element, path_0, expanded, selected) => (setState((s) => ({
|
|
2667
2687
|
...s,
|
|
@@ -2769,9 +2789,9 @@ const TreeContext = require_tabList.st("@sanity/ui/context/tree", null), Tree =
|
|
|
2769
2789
|
setItemElements(_itemElements);
|
|
2770
2790
|
}, $[26] = t15) : t15 = $[26];
|
|
2771
2791
|
let t16;
|
|
2772
|
-
$[27] === children ? t16 = $[28] : (t16 = [children], $[27] = children, $[28] = t16),
|
|
2792
|
+
$[27] === children ? t16 = $[28] : (t16 = [children], $[27] = children, $[28] = t16), useEffect(t15, t16);
|
|
2773
2793
|
let t17;
|
|
2774
|
-
$[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== spacing ? (t17 = /* @__PURE__ */
|
|
2794
|
+
$[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== spacing ? (t17 = /* @__PURE__ */ jsx(Stack, {
|
|
2775
2795
|
as: "ul",
|
|
2776
2796
|
"data-ui": "Tree",
|
|
2777
2797
|
...restProps,
|
|
@@ -2783,35 +2803,35 @@ const TreeContext = require_tabList.st("@sanity/ui/context/tree", null), Tree =
|
|
|
2783
2803
|
children
|
|
2784
2804
|
}), $[29] = children, $[30] = handleFocus, $[31] = handleKeyDown, $[32] = restProps, $[33] = spacing, $[34] = t17) : t17 = $[34];
|
|
2785
2805
|
let t18;
|
|
2786
|
-
return $[35] !== contextValue || $[36] !== t17 ? (t18 = /* @__PURE__ */
|
|
2806
|
+
return $[35] !== contextValue || $[36] !== t17 ? (t18 = /* @__PURE__ */ jsx(TreeContext.Provider, {
|
|
2787
2807
|
value: contextValue,
|
|
2788
2808
|
children: t17
|
|
2789
2809
|
}), $[35] = contextValue, $[36] = t17, $[37] = t18) : t18 = $[37], t18;
|
|
2790
2810
|
});
|
|
2791
2811
|
function treeItemRootStyle() {
|
|
2792
|
-
return
|
|
2812
|
+
return css`&[role='none'] > [role='treeitem']{outline:none;cursor:default;border-radius:3px;background-color:var(--card-bg-color);color:var(--treeitem-fg-color);&:focus{position:relative;}}&[role='treeitem']{outline:none;& > div{cursor:default;border-radius:3px;background-color:var(--card-bg-color);color:var(--treeitem-fg-color);}&:focus > div{position:relative;}}`;
|
|
2793
2813
|
}
|
|
2794
2814
|
function treeItemRootColorStyle(props) {
|
|
2795
|
-
let { color } =
|
|
2796
|
-
return
|
|
2815
|
+
let { color } = getTheme_v2(props.theme), tone = color.selectable.default;
|
|
2816
|
+
return css`&[role='none']{& > [role='treeitem']{${_cardColorStyle(color, tone.enabled)}}&[data-selected] > [role='treeitem']{${_cardColorStyle(color, tone.pressed)}}@media (hover:hover){&:not([data-selected]) > [role='treeitem']:not(:focus):hover{${_cardColorStyle(color, tone.hovered)}}& > [role='treeitem']:focus{${_cardColorStyle(color, tone.selected)}}}}&[role='treeitem']{& > [data-ui='TreeItem__box']{${_cardColorStyle(color, tone.enabled)}}&[data-selected] > [data-ui='TreeItem__box']{${_cardColorStyle(color, tone.pressed)}}@media (hover:hover){&:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover{${_cardColorStyle(color, tone.hovered)}}&:focus > [data-ui='TreeItem__box']{${_cardColorStyle(color, tone.selected)}}}}`;
|
|
2797
2817
|
}
|
|
2798
2818
|
function treeItemBoxStyle(props) {
|
|
2799
|
-
let { $level } = props, { space } =
|
|
2800
|
-
return
|
|
2819
|
+
let { $level } = props, { space } = getTheme_v2(props.theme);
|
|
2820
|
+
return css`padding-left:${rem(space[2] * $level)};&[data-as='a']{text-decoration:none;}`;
|
|
2801
2821
|
}
|
|
2802
2822
|
/**
|
|
2803
2823
|
* @beta
|
|
2804
2824
|
*/
|
|
2805
2825
|
function useTree() {
|
|
2806
|
-
let tree =
|
|
2826
|
+
let tree = useContext(TreeContext);
|
|
2807
2827
|
if (!tree) throw Error("Tree: missing context value");
|
|
2808
2828
|
return tree;
|
|
2809
2829
|
}
|
|
2810
2830
|
function TreeGroup(props) {
|
|
2811
|
-
let $ =
|
|
2831
|
+
let $ = c(9), children, restProps, t0;
|
|
2812
2832
|
$[0] === props ? (children = $[1], restProps = $[2], t0 = $[3]) : ({children, expanded: t0, ...restProps} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0);
|
|
2813
2833
|
let expanded = t0 !== void 0 && t0, tree = useTree(), t1 = !expanded, t2;
|
|
2814
|
-
return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.gap ? (t2 = /* @__PURE__ */
|
|
2834
|
+
return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.gap ? (t2 = /* @__PURE__ */ jsx(Stack, {
|
|
2815
2835
|
as: "ul",
|
|
2816
2836
|
"data-ui": "TreeGroup",
|
|
2817
2837
|
...restProps,
|
|
@@ -2822,13 +2842,13 @@ function TreeGroup(props) {
|
|
|
2822
2842
|
children
|
|
2823
2843
|
}), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.gap, $[8] = t2) : t2 = $[8], t2;
|
|
2824
2844
|
}
|
|
2825
|
-
const StyledTreeItem = /* @__PURE__ */
|
|
2845
|
+
const StyledTreeItem = /* @__PURE__ */ styled.li.withConfig({
|
|
2826
2846
|
displayName: "StyledTreeItem",
|
|
2827
2847
|
componentId: "sc-lxy9gh-0"
|
|
2828
|
-
})(treeItemRootStyle, treeItemRootColorStyle), TreeItemBox = /* @__PURE__ */
|
|
2848
|
+
})(treeItemRootStyle, treeItemRootColorStyle), TreeItemBox = /* @__PURE__ */ styled(Box).attrs({ forwardedAs: "a" }).withConfig({
|
|
2829
2849
|
displayName: "TreeItemBox",
|
|
2830
2850
|
componentId: "sc-lxy9gh-1"
|
|
2831
|
-
})(treeItemBoxStyle), ToggleArrowText =
|
|
2851
|
+
})(treeItemBoxStyle), ToggleArrowText = styled(Text).withConfig({
|
|
2832
2852
|
displayName: "ToggleArrowText",
|
|
2833
2853
|
componentId: "sc-lxy9gh-2"
|
|
2834
2854
|
})`& > svg{transition:transform 100ms;}`;
|
|
@@ -2837,13 +2857,13 @@ const StyledTreeItem = /* @__PURE__ */ styled_components.styled.li.withConfig({
|
|
|
2837
2857
|
* @beta
|
|
2838
2858
|
*/
|
|
2839
2859
|
function TreeItem(props) {
|
|
2840
|
-
let $ =
|
|
2860
|
+
let $ = c(114), IconComponent, children, gap, href, idProp, linkAs, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
|
|
2841
2861
|
$[0] === props ? (IconComponent = $[1], children = $[2], gap = $[3], href = $[4], idProp = $[5], linkAs = $[6], muted = $[7], onClick = $[8], restProps = $[9], t0 = $[10], t1 = $[11], t2 = $[12], t3 = $[13], t4 = $[14], text = $[15], weight = $[16]) : ({children, expanded: t0, fontSize: t1, href, icon: IconComponent, id: idProp, linkAs, muted, onClick, padding: t2, selected: t3, gap, space: t4, text, weight, ...restProps} = props, $[0] = props, $[1] = IconComponent, $[2] = children, $[3] = gap, $[4] = href, $[5] = idProp, $[6] = linkAs, $[7] = muted, $[8] = onClick, $[9] = restProps, $[10] = t0, $[11] = t1, $[12] = t2, $[13] = t3, $[14] = t4, $[15] = text, $[16] = weight);
|
|
2842
|
-
let expandedProp = t0 !== void 0 && t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 !== void 0 && t3, spacing = gap === void 0 ? t4 === void 0 ? 2 : t4 : gap, [rootElement, _setRootElement] =
|
|
2862
|
+
let expandedProp = t0 !== void 0 && t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 !== void 0 && t3, spacing = gap === void 0 ? t4 === void 0 ? 2 : t4 : gap, [rootElement, _setRootElement] = useState(null), t5;
|
|
2843
2863
|
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t5 = (node) => {
|
|
2844
|
-
|
|
2864
|
+
startTransition(() => _setRootElement(node));
|
|
2845
2865
|
}, $[17] = t5) : t5 = $[17];
|
|
2846
|
-
let setRootElement = t5, treeitemRef =
|
|
2866
|
+
let setRootElement = t5, treeitemRef = useRef(null), tree = useTree(), { path, registerItem, setExpanded, setFocusedElement } = tree, _id = useId(), id = idProp || _id, t6, t7;
|
|
2847
2867
|
if ($[18] !== id || $[19] !== path) {
|
|
2848
2868
|
let itemPath = path.concat([id || ""]);
|
|
2849
2869
|
t6 = itemPath, t7 = itemPath.join("/"), $[18] = id, $[19] = path, $[20] = t6, $[21] = t7;
|
|
@@ -2875,36 +2895,36 @@ function TreeItem(props) {
|
|
|
2875
2895
|
registerItem,
|
|
2876
2896
|
rootElement,
|
|
2877
2897
|
selected
|
|
2878
|
-
], $[39] = expanded, $[40] = itemKey, $[41] = registerItem, $[42] = rootElement, $[43] = selected, $[44] = t13, $[45] = t14) : (t13 = $[44], t14 = $[45]),
|
|
2898
|
+
], $[39] = expanded, $[40] = itemKey, $[41] = registerItem, $[42] = rootElement, $[43] = selected, $[44] = t13, $[45] = t14) : (t13 = $[44], t14 = $[45]), useEffect(t13, t14);
|
|
2879
2899
|
let t15 = IconComponent || children ? "visible" : "hidden", t16;
|
|
2880
2900
|
$[46] === t15 ? t16 = $[47] : (t16 = {
|
|
2881
2901
|
visibility: t15,
|
|
2882
2902
|
pointerEvents: "none"
|
|
2883
2903
|
}, $[46] = t15, $[47] = t16);
|
|
2884
2904
|
let t17;
|
|
2885
|
-
$[48] !== IconComponent || $[49] !== fontSize || $[50] !== muted || $[51] !== weight ? (t17 = IconComponent && /* @__PURE__ */
|
|
2905
|
+
$[48] !== IconComponent || $[49] !== fontSize || $[50] !== muted || $[51] !== weight ? (t17 = IconComponent && /* @__PURE__ */ jsx(Text, {
|
|
2886
2906
|
muted,
|
|
2887
2907
|
size: fontSize,
|
|
2888
2908
|
weight,
|
|
2889
|
-
children: /* @__PURE__ */
|
|
2909
|
+
children: /* @__PURE__ */ jsx(IconComponent, {})
|
|
2890
2910
|
}), $[48] = IconComponent, $[49] = fontSize, $[50] = muted, $[51] = weight, $[52] = t17) : t17 = $[52];
|
|
2891
2911
|
let t18;
|
|
2892
|
-
$[53] !== IconComponent || $[54] !== expanded || $[55] !== fontSize || $[56] !== muted || $[57] !== weight ? (t18 = !IconComponent && /* @__PURE__ */
|
|
2912
|
+
$[53] !== IconComponent || $[54] !== expanded || $[55] !== fontSize || $[56] !== muted || $[57] !== weight ? (t18 = !IconComponent && /* @__PURE__ */ jsx(ToggleArrowText, {
|
|
2893
2913
|
muted,
|
|
2894
2914
|
size: fontSize,
|
|
2895
2915
|
weight,
|
|
2896
|
-
children: /* @__PURE__ */
|
|
2916
|
+
children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: { transform: expanded ? "rotate(90deg)" : void 0 } })
|
|
2897
2917
|
}), $[53] = IconComponent, $[54] = expanded, $[55] = fontSize, $[56] = muted, $[57] = weight, $[58] = t18) : t18 = $[58];
|
|
2898
2918
|
let t19;
|
|
2899
|
-
$[59] !== spacing || $[60] !== t16 || $[61] !== t17 || $[62] !== t18 ? (t19 = /* @__PURE__ */
|
|
2919
|
+
$[59] !== spacing || $[60] !== t16 || $[61] !== t17 || $[62] !== t18 ? (t19 = /* @__PURE__ */ jsxs(Box, {
|
|
2900
2920
|
marginRight: spacing,
|
|
2901
2921
|
style: t16,
|
|
2902
2922
|
children: [t17, t18]
|
|
2903
2923
|
}), $[59] = spacing, $[60] = t16, $[61] = t17, $[62] = t18, $[63] = t19) : t19 = $[63];
|
|
2904
2924
|
let t20;
|
|
2905
|
-
$[64] !== fontSize || $[65] !== muted || $[66] !== text || $[67] !== weight ? (t20 = /* @__PURE__ */
|
|
2925
|
+
$[64] !== fontSize || $[65] !== muted || $[66] !== text || $[67] !== weight ? (t20 = /* @__PURE__ */ jsx(Box, {
|
|
2906
2926
|
flex: 1,
|
|
2907
|
-
children: /* @__PURE__ */
|
|
2927
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
2908
2928
|
muted,
|
|
2909
2929
|
size: fontSize,
|
|
2910
2930
|
textOverflow: "ellipsis",
|
|
@@ -2913,14 +2933,14 @@ function TreeItem(props) {
|
|
|
2913
2933
|
})
|
|
2914
2934
|
}), $[64] = fontSize, $[65] = muted, $[66] = text, $[67] = weight, $[68] = t20) : t20 = $[68];
|
|
2915
2935
|
let t21;
|
|
2916
|
-
$[69] !== padding || $[70] !== t19 || $[71] !== t20 ? (t21 = /* @__PURE__ */
|
|
2936
|
+
$[69] !== padding || $[70] !== t19 || $[71] !== t20 ? (t21 = /* @__PURE__ */ jsxs(Flex, {
|
|
2917
2937
|
padding,
|
|
2918
2938
|
children: [t19, t20]
|
|
2919
2939
|
}), $[69] = padding, $[70] = t19, $[71] = t20, $[72] = t21) : t21 = $[72];
|
|
2920
2940
|
let content = t21;
|
|
2921
2941
|
if (href) {
|
|
2922
2942
|
let t22 = selected ? "" : void 0, t23;
|
|
2923
|
-
$[73] !== content || $[74] !== expanded || $[75] !== href || $[76] !== linkAs || $[77] !== tabIndex || $[78] !== tree.level ? (t23 = /* @__PURE__ */
|
|
2943
|
+
$[73] !== content || $[74] !== expanded || $[75] !== href || $[76] !== linkAs || $[77] !== tabIndex || $[78] !== tree.level ? (t23 = /* @__PURE__ */ jsx(TreeItemBox, {
|
|
2924
2944
|
$level: tree.level,
|
|
2925
2945
|
"aria-expanded": expanded,
|
|
2926
2946
|
as: linkAs,
|
|
@@ -2932,17 +2952,17 @@ function TreeItem(props) {
|
|
|
2932
2952
|
children: content
|
|
2933
2953
|
}), $[73] = content, $[74] = expanded, $[75] = href, $[76] = linkAs, $[77] = tabIndex, $[78] = tree.level, $[79] = t23) : t23 = $[79];
|
|
2934
2954
|
let t24;
|
|
2935
|
-
$[80] !== children || $[81] !== expanded ? (t24 = children && /* @__PURE__ */
|
|
2955
|
+
$[80] !== children || $[81] !== expanded ? (t24 = children && /* @__PURE__ */ jsx(TreeGroup, {
|
|
2936
2956
|
hidden: !expanded,
|
|
2937
2957
|
children
|
|
2938
2958
|
}), $[80] = children, $[81] = expanded, $[82] = t24) : t24 = $[82];
|
|
2939
2959
|
let t25;
|
|
2940
|
-
$[83] !== contextValue || $[84] !== t24 ? (t25 = /* @__PURE__ */
|
|
2960
|
+
$[83] !== contextValue || $[84] !== t24 ? (t25 = /* @__PURE__ */ jsx(TreeContext.Provider, {
|
|
2941
2961
|
value: contextValue,
|
|
2942
2962
|
children: t24
|
|
2943
2963
|
}), $[83] = contextValue, $[84] = t24, $[85] = t25) : t25 = $[85];
|
|
2944
2964
|
let t26;
|
|
2945
|
-
return $[86] !== handleClick || $[87] !== id || $[88] !== itemKey || $[89] !== restProps || $[90] !== t22 || $[91] !== t23 || $[92] !== t25 ? (t26 = /* @__PURE__ */
|
|
2965
|
+
return $[86] !== handleClick || $[87] !== id || $[88] !== itemKey || $[89] !== restProps || $[90] !== t22 || $[91] !== t23 || $[92] !== t25 ? (t26 = /* @__PURE__ */ jsxs(StyledTreeItem, {
|
|
2946
2966
|
"data-selected": t22,
|
|
2947
2967
|
"data-tree-id": id,
|
|
2948
2968
|
"data-tree-key": itemKey,
|
|
@@ -2955,24 +2975,24 @@ function TreeItem(props) {
|
|
|
2955
2975
|
}), $[86] = handleClick, $[87] = id, $[88] = itemKey, $[89] = restProps, $[90] = t22, $[91] = t23, $[92] = t25, $[93] = t26) : t26 = $[93], t26;
|
|
2956
2976
|
}
|
|
2957
2977
|
let t22 = selected ? "" : void 0, t23;
|
|
2958
|
-
$[94] !== content || $[95] !== tree.level ? (t23 = /* @__PURE__ */
|
|
2978
|
+
$[94] !== content || $[95] !== tree.level ? (t23 = /* @__PURE__ */ jsx(TreeItemBox, {
|
|
2959
2979
|
$level: tree.level,
|
|
2960
2980
|
as: "div",
|
|
2961
2981
|
"data-ui": "TreeItem__box",
|
|
2962
2982
|
children: content
|
|
2963
2983
|
}), $[94] = content, $[95] = tree.level, $[96] = t23) : t23 = $[96];
|
|
2964
2984
|
let t24;
|
|
2965
|
-
$[97] !== children || $[98] !== expanded ? (t24 = children && /* @__PURE__ */
|
|
2985
|
+
$[97] !== children || $[98] !== expanded ? (t24 = children && /* @__PURE__ */ jsx(TreeGroup, {
|
|
2966
2986
|
expanded,
|
|
2967
2987
|
children
|
|
2968
2988
|
}), $[97] = children, $[98] = expanded, $[99] = t24) : t24 = $[99];
|
|
2969
2989
|
let t25;
|
|
2970
|
-
$[100] !== contextValue || $[101] !== t24 ? (t25 = /* @__PURE__ */
|
|
2990
|
+
$[100] !== contextValue || $[101] !== t24 ? (t25 = /* @__PURE__ */ jsx(TreeContext.Provider, {
|
|
2971
2991
|
value: contextValue,
|
|
2972
2992
|
children: t24
|
|
2973
2993
|
}), $[100] = contextValue, $[101] = t24, $[102] = t25) : t25 = $[102];
|
|
2974
2994
|
let t26;
|
|
2975
|
-
return $[103] !== expanded || $[104] !== handleClick || $[105] !== handleKeyDown || $[106] !== id || $[107] !== itemKey || $[108] !== restProps || $[109] !== t22 || $[110] !== t23 || $[111] !== t25 || $[112] !== tabIndex ? (t26 = /* @__PURE__ */
|
|
2995
|
+
return $[103] !== expanded || $[104] !== handleClick || $[105] !== handleKeyDown || $[106] !== id || $[107] !== itemKey || $[108] !== restProps || $[109] !== t22 || $[110] !== t23 || $[111] !== t25 || $[112] !== tabIndex ? (t26 = /* @__PURE__ */ jsxs(StyledTreeItem, {
|
|
2976
2996
|
"data-selected": t22,
|
|
2977
2997
|
"data-ui": "TreeItem",
|
|
2978
2998
|
"data-tree-id": id,
|
|
@@ -2987,6 +3007,6 @@ function TreeItem(props) {
|
|
|
2987
3007
|
children: [t23, t25]
|
|
2988
3008
|
}), $[103] = expanded, $[104] = handleClick, $[105] = handleKeyDown, $[106] = id, $[107] = itemKey, $[108] = restProps, $[109] = t22, $[110] = t23, $[111] = t25, $[112] = tabIndex, $[113] = t26) : t26 = $[113], t26;
|
|
2989
3009
|
}
|
|
2990
|
-
|
|
3010
|
+
export { Arrow, Autocomplete, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Box, Breadcrumbs, Button, Card, Checkbox, Code, CodeSkeleton, ConditionalWrapper, Container, Dialog, DialogContext, DialogProvider, ElementQuery, ErrorBoundary, Flex, Grid, Heading, HeadingSkeleton, Hotkeys, Inline, KBD, Label, LabelSkeleton, Layer, LayerProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, Popover, Portal, PortalProvider, Radio, Select, Skeleton, Spinner, SrOnly, Stack, Switch, Tab, TabList, TabPanel, Text, TextArea, TextInput, TextSkeleton, ThemeColorProvider, ThemeProvider, Toast, ToastProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, Tree, TreeItem, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, _responsive, attemptFocus, containsOrEqualsElement, createColorTheme, focusFirstDescendant, focusLastDescendant, hexToRgb, hslToRgb, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, multiply, parseColor, rem, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useArrayProp, useBoundaryElement, useClickOutside, useClickOutsideEvent, useCustomValidity, useDialog, useElementRect, useElementSize, useForwardedRef, useGlobalKeyDown, useLayer, useMatchMedia, useMediaIndex, usePortal, usePrefersDark, usePrefersReducedMotion, useRootTheme, useTheme, useTheme_v2, useToast, useTooltipDelayGroup, useTree };
|
|
2991
3011
|
|
|
2992
3012
|
//# sourceMappingURL=index.js.map
|