@sanity/ui 2.15.1 → 2.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js DELETED
@@ -1,1730 +0,0 @@
1
- import { EMPTY_ARRAY, useElementSize, Code, isHTMLElement, isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, Box, _isEnterToClickElement, Card, Text, useArrayProp, EMPTY_RECORD, Button, Stack, Popover, TextInput, useClickOutsideEvent, _responsive, createGlobalScopedContext, Container, Flex, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, useTheme_v2, usePrefersReducedMotion, Portal, containsOrEqualsElement, Layer, responsivePaddingStyle, responsiveRadiusStyle, Grid, LayerProvider, isRecord, _cardColorStyle, rem } from "./_legacy/_visual-editing.esm.js";
2
- import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Checkbox, ConditionalWrapper, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _isScrollable, createColorTheme, hexToRgb, hslToRgb, multiply, parseColor, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTooltipDelayGroup } from "./_legacy/_visual-editing.esm.js";
3
- import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
4
- import { SpinnerIcon, ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
5
- import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
6
- import { styled, keyframes, css } from "styled-components";
7
- import { c } from "react-compiler-runtime";
8
- import { getTheme_v2 } from "@sanity/ui/theme";
9
- import { motion, AnimatePresence } from "framer-motion";
10
- import { getTheme_v2 as getTheme_v2$1 } from "./_legacy/getTheme_v2.esm.js";
11
- function _getElements(element, elementsArg) {
12
- const ret = [element];
13
- for (const el of elementsArg)
14
- Array.isArray(el) ? ret.push(...el) : ret.push(el);
15
- return ret.filter(Boolean);
16
- }
17
- function useClickOutside(listener, t0, boundaryElement) {
18
- const $ = c(12), elementsArg = t0 === void 0 ? EMPTY_ARRAY : t0, [element, setElement] = useState(null);
19
- let t1;
20
- $[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
21
- const [elements, setElements] = useState(t1), elementsRef = useRef(elements);
22
- let t2, t3;
23
- $[3] !== element || $[4] !== elementsArg ? (t2 = () => {
24
- const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
25
- if (prevElements.length !== nextElements.length) {
26
- setElements(nextElements), elementsRef.current = nextElements;
27
- return;
28
- }
29
- for (const el of prevElements)
30
- if (!nextElements.includes(el)) {
31
- setElements(nextElements), elementsRef.current = nextElements;
32
- return;
33
- }
34
- for (const el_0 of nextElements)
35
- if (!prevElements.includes(el_0)) {
36
- setElements(nextElements), elementsRef.current = nextElements;
37
- return;
38
- }
39
- }, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
40
- let t4, t5;
41
- return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
42
- if (!listener)
43
- return;
44
- const handleWindowMouseDown = (evt) => {
45
- const target = evt.target;
46
- if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
47
- for (const el_1 of elements)
48
- if (target === el_1 || el_1.contains(target))
49
- return;
50
- listener(evt);
51
- }
52
- };
53
- return window.addEventListener("mousedown", handleWindowMouseDown), () => {
54
- window.removeEventListener("mousedown", handleWindowMouseDown);
55
- };
56
- }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
57
- }
58
- function useElementRect(element) {
59
- return useElementSize(element)?._contentRect || null;
60
- }
61
- function useForwardedRef(ref) {
62
- const $ = c(1), innerRef = useRef(null);
63
- let t0;
64
- return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], useImperativeHandle(ref, t0), innerRef;
65
- }
66
- class ErrorBoundary extends Component {
67
- state = {
68
- error: null
69
- };
70
- static getDerivedStateFromError(error) {
71
- return {
72
- error
73
- };
74
- }
75
- componentDidCatch(error, info) {
76
- this.props.onCatch({
77
- error,
78
- info
79
- });
80
- }
81
- render() {
82
- const {
83
- error
84
- } = this.state;
85
- if (error) {
86
- const message = typeof error?.message == "string" ? error.message : "Error";
87
- return /* @__PURE__ */ jsx(Code, { children: message });
88
- }
89
- return this.props.children;
90
- }
91
- }
92
- function _raf(fn) {
93
- const frameId = requestAnimationFrame(fn);
94
- return () => {
95
- cancelAnimationFrame(frameId);
96
- };
97
- }
98
- function _raf2(fn) {
99
- let innerDispose = null;
100
- const outerDispose = _raf(() => {
101
- innerDispose = _raf(fn);
102
- });
103
- return () => {
104
- innerDispose && innerDispose(), outerDispose();
105
- };
106
- }
107
- function _hasFocus(element) {
108
- return !!document.activeElement && element.contains(document.activeElement);
109
- }
110
- function isFocusable(element) {
111
- 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;
112
- }
113
- function attemptFocus(element) {
114
- if (!isFocusable(element))
115
- return !1;
116
- try {
117
- element.focus();
118
- } catch {
119
- }
120
- return document.activeElement === element;
121
- }
122
- function focusFirstDescendant(element) {
123
- for (let i = 0; i < element.childNodes.length; i++) {
124
- const child = element.childNodes[i];
125
- if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
126
- return !0;
127
- }
128
- return !1;
129
- }
130
- function focusLastDescendant(element) {
131
- for (let i = element.childNodes.length - 1; i >= 0; i--) {
132
- const child = element.childNodes[i];
133
- if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
134
- return !0;
135
- }
136
- return !1;
137
- }
138
- const StyledAutocomplete = styled.div.withConfig({
139
- displayName: "StyledAutocomplete",
140
- componentId: "sc-1igauft-0"
141
- })`line-height:0;`, ListBox = styled(Box).withConfig({
142
- displayName: "ListBox",
143
- componentId: "sc-1igauft-1"
144
- })`& > ul{list-style:none;padding:0;margin:0;}`, rotate = keyframes`
145
- from {
146
- transform: rotate(0deg);
147
- }
148
-
149
- to {
150
- transform: rotate(360deg);
151
- }
152
- `, AnimatedSpinnerIcon = styled(SpinnerIcon).withConfig({
153
- displayName: "AnimatedSpinnerIcon",
154
- componentId: "sc-1igauft-2"
155
- })`animation:${rotate} 500ms linear infinite;`;
156
- function AutocompleteOption(props) {
157
- const $ = c(11), {
158
- children,
159
- id,
160
- onSelect,
161
- selected,
162
- value
163
- } = props;
164
- let t0;
165
- $[0] !== onSelect || $[1] !== value ? (t0 = () => {
166
- setTimeout(() => {
167
- onSelect(value);
168
- }, 0);
169
- }, $[0] = onSelect, $[1] = value, $[2] = t0) : t0 = $[2];
170
- const handleClick = t0;
171
- let t1;
172
- $[3] !== handleClick ? (t1 = (event) => {
173
- event.key === "Enter" && !_isEnterToClickElement(event.currentTarget) && handleClick();
174
- }, $[3] = handleClick, $[4] = t1) : t1 = $[4];
175
- const handleKeyDown = t1;
176
- let t2;
177
- return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children }), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
178
- }
179
- function autocompleteReducer(state, msg) {
180
- return msg.type === "input/change" ? {
181
- ...state,
182
- activeValue: null,
183
- focused: !0,
184
- query: msg.query
185
- } : msg.type === "input/focus" ? {
186
- ...state,
187
- focused: !0
188
- } : msg.type === "root/blur" ? {
189
- ...state,
190
- focused: !1,
191
- query: null
192
- } : msg.type === "root/clear" ? {
193
- ...state,
194
- activeValue: null,
195
- query: null,
196
- value: null
197
- } : msg.type === "root/escape" ? {
198
- ...state,
199
- focused: !1,
200
- query: null
201
- } : msg.type === "root/open" ? {
202
- ...state,
203
- query: state.query || msg.query
204
- } : msg.type === "root/setActiveValue" ? {
205
- ...state,
206
- activeValue: msg.value,
207
- listFocused: msg.listFocused || state.listFocused
208
- } : msg.type === "root/setListFocused" ? {
209
- ...state,
210
- listFocused: msg.listFocused
211
- } : msg.type === "value/change" ? {
212
- ...state,
213
- activeValue: msg.value,
214
- query: null,
215
- value: msg.value
216
- } : state;
217
- }
218
- const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = forwardRef(function(props, forwardedRef) {
219
- const {
220
- border = !0,
221
- customValidity,
222
- disabled,
223
- filterOption: filterOptionProp,
224
- fontSize = 2,
225
- icon,
226
- id,
227
- listBox = EMPTY_RECORD,
228
- loading,
229
- onBlur,
230
- onChange,
231
- onFocus,
232
- onQueryChange,
233
- onSelect,
234
- openButton,
235
- openOnFocus,
236
- options: optionsProp,
237
- padding: paddingProp = 3,
238
- popover = EMPTY_RECORD,
239
- prefix,
240
- radius = 2,
241
- readOnly,
242
- relatedElements,
243
- renderOption: renderOptionProp,
244
- renderPopover,
245
- renderValue = DEFAULT_RENDER_VALUE,
246
- suffix,
247
- value: valueProp,
248
- ...restProps
249
- } = props, [state, dispatch] = useReducer(autocompleteReducer, {
250
- activeValue: valueProp || null,
251
- focused: !1,
252
- listFocused: !1,
253
- query: null,
254
- value: valueProp || null
255
- }), {
256
- activeValue,
257
- focused,
258
- listFocused,
259
- query,
260
- value
261
- } = state, defaultRenderOption = useCallback(({
262
- value: value_0
263
- }) => /* @__PURE__ */ jsx(Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) }), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
264
- useImperativeHandle(forwardedRef, () => inputElementRef.current);
265
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = useCallback((event) => {
266
- setTimeout(() => {
267
- if (popoverMouseWithinRef.current)
268
- return;
269
- const elements = (relatedElements || []).concat(rootElementRef.current ? [rootElementRef.current] : [], resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []);
270
- let focusInside = !1;
271
- if (document.activeElement) {
272
- for (const e of elements)
273
- if (e === document.activeElement || e.contains(document.activeElement)) {
274
- focusInside = !0;
275
- break;
276
- }
277
- }
278
- focusInside === !1 && (dispatch({
279
- type: "root/blur"
280
- }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
281
- }, 0);
282
- }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_0) => {
283
- const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
284
- listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
285
- type: "root/setListFocused",
286
- listFocused: listFocused_0
287
- }));
288
- }, []), handleOptionSelect = useCallback((v) => {
289
- dispatch({
290
- type: "value/change",
291
- value: v
292
- }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
293
- }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = useCallback((event_1) => {
294
- if (event_1.key === "ArrowDown") {
295
- if (event_1.preventDefault(), !filteredOptionsLen) return;
296
- const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
297
- nextActiveOption && dispatch({
298
- type: "root/setActiveValue",
299
- value: nextActiveOption.value,
300
- listFocused: !0
301
- });
302
- return;
303
- }
304
- if (event_1.key === "ArrowUp") {
305
- if (event_1.preventDefault(), !filteredOptionsLen) return;
306
- const activeOption_0 = filteredOptions.find((o_1) => o_1.value === activeValue), activeIndex_0 = activeOption_0 ? filteredOptions.indexOf(activeOption_0) : -1, nextActiveOption_0 = filteredOptions[activeIndex_0 === -1 ? filteredOptionsLen - 1 : (filteredOptionsLen + activeIndex_0 - 1) % filteredOptionsLen];
307
- nextActiveOption_0 && dispatch({
308
- type: "root/setActiveValue",
309
- value: nextActiveOption_0.value,
310
- listFocused: !0
311
- });
312
- return;
313
- }
314
- if (event_1.key === "Escape") {
315
- dispatch({
316
- type: "root/escape"
317
- }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
318
- return;
319
- }
320
- const target = event_1.target, listEl = listBoxElementRef.current;
321
- if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)) {
322
- inputElementRef.current?.focus();
323
- return;
324
- }
325
- }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = useCallback((event_2) => {
326
- const nextQuery = event_2.currentTarget.value;
327
- dispatch({
328
- type: "input/change",
329
- query: nextQuery
330
- }), onQueryChange && onQueryChange(nextQuery);
331
- }, [onQueryChange]), dispatchOpen = useCallback(() => {
332
- dispatch({
333
- type: "root/open",
334
- query: value ? renderValue(value, currentOption) : ""
335
- });
336
- }, [currentOption, renderValue, value]), handleInputFocus = useCallback((event_3) => {
337
- focused || (dispatch({
338
- type: "input/focus"
339
- }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
340
- }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = useCallback(() => {
341
- popoverMouseWithinRef.current = !0;
342
- }, []), handlePopoverMouseLeave = useCallback(() => {
343
- popoverMouseWithinRef.current = !1;
344
- }, []), handleClearButtonClick = useCallback(() => {
345
- dispatch({
346
- type: "root/clear"
347
- }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
348
- }, [onChange, onQueryChange]), handleClearButtonFocus = useCallback(() => {
349
- dispatch({
350
- type: "input/focus"
351
- });
352
- }, []);
353
- useEffect(() => {
354
- if (valueProp !== valuePropRef.current) {
355
- valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
356
- type: "value/change",
357
- value: valueProp
358
- }), valueRef.current = valueProp);
359
- return;
360
- }
361
- valueProp !== valueRef.current && (valueRef.current = valueProp || null, dispatch({
362
- type: "value/change",
363
- value: valueProp || null
364
- }));
365
- }, [valueProp]), useEffect(() => {
366
- !focused && valueRef.current && dispatch({
367
- type: "root/setActiveValue",
368
- value: valueRef.current
369
- });
370
- }, [focused]), useEffect(() => {
371
- const listElement = listBoxElementRef.current;
372
- if (!listElement) return;
373
- const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
374
- if (activeOption_1) {
375
- const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
376
- if (activeItemElement) {
377
- if (_hasFocus(activeItemElement))
378
- return;
379
- focusFirstDescendant(activeItemElement);
380
- }
381
- }
382
- }, [activeValue, filteredOptions]);
383
- const clearButton = useMemo(() => {
384
- if (!loading && !disabled && value)
385
- return {
386
- "aria-label": "Clear",
387
- onFocus: handleClearButtonFocus
388
- };
389
- }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = useMemo(() => typeof openButton == "object" ? openButton : EMPTY_RECORD, [openButton]), handleOpenClick = useCallback((event_4) => {
390
- dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
391
- }, [openButtonProps, dispatchOpen]), openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, fontSize, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = useCallback((event_5) => {
392
- event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
393
- }, [listFocused]), content2 = useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: filteredOptions.map((option_0) => {
394
- const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
395
- return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
396
- disabled: loading,
397
- selected: active,
398
- tabIndex: listFocused && active ? 0 : -1
399
- }) }, option_0.value);
400
- }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = useMemo(() => renderPopover ? renderPopover({
401
- content: content2,
402
- hidden: !expanded,
403
- inputElement: inputElementRef.current,
404
- onMouseEnter: handlePopoverMouseEnter,
405
- onMouseLeave: handlePopoverMouseLeave
406
- }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, radius, renderPopover]);
407
- return /* @__PURE__ */ jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
408
- input,
409
- results
410
- ] });
411
- });
412
- InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
413
- const Autocomplete = InnerAutocomplete, StyledBreadcrumbs = styled.ol.withConfig({
414
- displayName: "StyledBreadcrumbs",
415
- componentId: "sc-1es8h8q-0"
416
- })`margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;`, ExpandButton = styled(Button).withConfig({
417
- displayName: "ExpandButton",
418
- componentId: "sc-1es8h8q-1"
419
- })`appearance:none;margin:-4px;`, Breadcrumbs = forwardRef(function(props, ref) {
420
- const {
421
- children,
422
- maxLength,
423
- separator,
424
- space: spaceRaw = 2,
425
- ...restProps
426
- } = props, space = useArrayProp(spaceRaw), [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
427
- useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
428
- const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
429
- const len = rawItems.length;
430
- if (maxLength && len > maxLength) {
431
- const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
432
- return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: /* @__PURE__ */ jsx(Stack, { as: "ol", overflow: "auto", padding: space, space, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: open ? collapse : expand, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }) }, "button"), ...rawItems.slice(len - afterLength)];
433
- }
434
- return rawItems;
435
- }, [collapse, expand, maxLength, open, rawItems, space]);
436
- return /* @__PURE__ */ jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
437
- itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
438
- /* @__PURE__ */ jsx(Box, { as: "li", children: item })
439
- ] }, itemIndex)) });
440
- });
441
- Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
442
- function dialogStyle({
443
- theme
444
- }) {
445
- const {
446
- color
447
- } = getTheme_v2(theme);
448
- return {
449
- "&:not([hidden])": {
450
- display: "flex"
451
- },
452
- top: 0,
453
- left: 0,
454
- right: 0,
455
- bottom: 0,
456
- alignItems: "center",
457
- justifyContent: "center",
458
- outline: "none",
459
- background: color.backdrop
460
- };
461
- }
462
- function responsiveDialogPositionStyle(props) {
463
- const {
464
- media
465
- } = getTheme_v2(props.theme);
466
- return _responsive(media, props.$position, (position) => ({
467
- "&&": {
468
- position
469
- }
470
- }));
471
- }
472
- function animationDialogStyle(props) {
473
- return props.$animate ? css`
474
- @keyframes zoomIn {
475
- from {
476
- opacity: 0;
477
- transform: scale(0.95);
478
- }
479
- to {
480
- opacity: 1;
481
- transform: scale(1);
482
- }
483
- }
484
- @keyframes fadeIn {
485
- from {
486
- opacity: 0;
487
- }
488
- to {
489
- opacity: 1;
490
- }
491
- }
492
-
493
- animation: fadeIn 200ms ease-out;
494
- // Animates the dialog card.
495
- & > [data-ui='DialogCard'] {
496
- animation: zoomIn 200ms ease-out;
497
- }
498
- ` : css``;
499
- }
500
- const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
501
- version: 0
502
- });
503
- function useDialog() {
504
- return useContext(DialogContext);
505
- }
506
- function isTargetWithinScope(boundaryElement, portalElement, target) {
507
- return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
508
- }
509
- const StyledDialog = /* @__PURE__ */ styled(Layer).withConfig({
510
- displayName: "StyledDialog",
511
- componentId: "sc-4n4xb3-0"
512
- })(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle, animationDialogStyle), DialogContainer = styled(Container).withConfig({
513
- displayName: "DialogContainer",
514
- componentId: "sc-4n4xb3-1"
515
- })`&:not([hidden]){display:flex;}width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;`, DialogCardRoot = styled(Card).withConfig({
516
- displayName: "DialogCardRoot",
517
- componentId: "sc-4n4xb3-2"
518
- })`&:not([hidden]){display:flex;}width:100%;min-height:0;max-height:100%;overflow:hidden;overflow:clip;`, DialogLayout = styled(Flex).withConfig({
519
- displayName: "DialogLayout",
520
- componentId: "sc-4n4xb3-3"
521
- })`flex:1;min-height:0;width:100%;`, DialogHeader = styled(Box).withConfig({
522
- displayName: "DialogHeader",
523
- componentId: "sc-4n4xb3-4"
524
- })`position:relative;z-index:2;`, DialogContent = styled(Box).withConfig({
525
- displayName: "DialogContent",
526
- componentId: "sc-4n4xb3-5"
527
- })`position:relative;z-index:1;overflow:auto;outline:none;`, DialogFooter = styled(Box).withConfig({
528
- displayName: "DialogFooter",
529
- componentId: "sc-4n4xb3-6"
530
- })`position:relative;z-index:3;`, DialogCard = forwardRef(function(props, forwardedRef) {
531
- const $ = c(38), {
532
- __unstable_autoFocus: autoFocus,
533
- __unstable_hideCloseButton: hideCloseButton,
534
- children,
535
- contentRef: forwardedContentRef,
536
- footer,
537
- header,
538
- id,
539
- onClickOutside,
540
- onClose,
541
- portal: portalProp,
542
- radius: radiusProp,
543
- scheme,
544
- shadow: shadowProp,
545
- width: widthProp
546
- } = props, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), width = useArrayProp(widthProp), ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
547
- isTopLayer
548
- } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
549
- let t0;
550
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[0] = t0) : t0 = $[0], useImperativeHandle(forwardedRef, t0);
551
- let t1;
552
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => contentRef.current, $[1] = t1) : t1 = $[1], useImperativeHandle(forwardedContentRef, t1);
553
- let t2, t3;
554
- $[2] !== autoFocus ? (t2 = () => {
555
- autoFocus && ref.current && focusFirstDescendant(ref.current);
556
- }, t3 = [autoFocus, ref], $[2] = autoFocus, $[3] = t2, $[4] = t3) : (t2 = $[3], t3 = $[4]), useEffect(t2, t3);
557
- let t4;
558
- $[5] !== boundaryElement || $[6] !== isTopLayer || $[7] !== onClose || $[8] !== portalElement ? (t4 = (event) => {
559
- if (!isTopLayer || !onClose)
560
- return;
561
- const target = document.activeElement;
562
- target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
563
- }, $[5] = boundaryElement, $[6] = isTopLayer, $[7] = onClose, $[8] = portalElement, $[9] = t4) : t4 = $[9], useGlobalKeyDown(t4);
564
- let t5;
565
- $[10] !== boundaryElement || $[11] !== isTopLayer || $[12] !== onClickOutside || $[13] !== portalElement ? (t5 = isTopLayer && onClickOutside && ((event_0) => {
566
- const target_0 = event_0.target;
567
- target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
568
- }), $[10] = boundaryElement, $[11] = isTopLayer, $[12] = onClickOutside, $[13] = portalElement, $[14] = t5) : t5 = $[14];
569
- let t6;
570
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => [ref.current], $[15] = t6) : t6 = $[15], useClickOutsideEvent(t5, t6);
571
- let t7;
572
- $[16] !== header || $[17] !== labelId || $[18] !== onClose || $[19] !== showCloseButton || $[20] !== showHeader ? (t7 = showHeader && /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
573
- /* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
574
- showCloseButton && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Button, { "aria-label": "Close dialog", disabled: !onClose, icon: CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
575
- ] }) }), $[16] = header, $[17] = labelId, $[18] = onClose, $[19] = showCloseButton, $[20] = showHeader, $[21] = t7) : t7 = $[21];
576
- let t8;
577
- $[22] !== children ? (t8 = /* @__PURE__ */ jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }), $[22] = children, $[23] = t8) : t8 = $[23];
578
- let t9;
579
- $[24] !== footer ? (t9 = footer && /* @__PURE__ */ jsx(DialogFooter, { children: footer }), $[24] = footer, $[25] = t9) : t9 = $[25];
580
- let t10;
581
- $[26] !== t7 || $[27] !== t8 || $[28] !== t9 ? (t10 = /* @__PURE__ */ jsxs(DialogLayout, { direction: "column", children: [
582
- t7,
583
- t8,
584
- t9
585
- ] }), $[26] = t7, $[27] = t8, $[28] = t9, $[29] = t10) : t10 = $[29];
586
- let t11;
587
- $[30] !== radius || $[31] !== scheme || $[32] !== shadow || $[33] !== t10 ? (t11 = /* @__PURE__ */ jsx(DialogCardRoot, { radius, ref, scheme, shadow, children: t10 }), $[30] = radius, $[31] = scheme, $[32] = shadow, $[33] = t10, $[34] = t11) : t11 = $[34];
588
- let t12;
589
- return $[35] !== t11 || $[36] !== width ? (t12 = /* @__PURE__ */ jsx(DialogContainer, { "data-ui": "DialogCard", width, children: t11 }), $[35] = t11, $[36] = width, $[37] = t12) : t12 = $[37], t12;
590
- });
591
- DialogCard.displayName = "ForwardRef(DialogCard)";
592
- const Dialog = forwardRef(function(props, ref) {
593
- const $ = c(60), dialog = useDialog(), {
594
- layer
595
- } = useTheme_v2();
596
- let _positionProp, _zOffsetProp, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, t6;
597
- $[0] !== props ? ({
598
- __unstable_autoFocus: t0,
599
- __unstable_hideCloseButton: t1,
600
- cardRadius: t2,
601
- cardShadow: t3,
602
- children,
603
- contentRef,
604
- footer,
605
- header,
606
- id,
607
- onActivate,
608
- onClickOutside,
609
- onClose,
610
- onFocus,
611
- padding: t4,
612
- portal: portalProp,
613
- position: _positionProp,
614
- scheme,
615
- width: t5,
616
- zOffset: _zOffsetProp,
617
- animate: t6,
618
- ...restProps
619
- } = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = contentRef, $[5] = footer, $[6] = header, $[7] = id, $[8] = onActivate, $[9] = onClickOutside, $[10] = onClose, $[11] = onFocus, $[12] = portalProp, $[13] = restProps, $[14] = scheme, $[15] = t0, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], contentRef = $[4], footer = $[5], header = $[6], id = $[7], onActivate = $[8], onClickOutside = $[9], onClose = $[10], onFocus = $[11], portalProp = $[12], restProps = $[13], scheme = $[14], t0 = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21]);
620
- const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 === void 0 ? !1 : t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), padding = useArrayProp(paddingProp), position = useArrayProp(positionProp), width = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
621
- let t7;
622
- $[22] !== onFocus ? (t7 = (event) => {
623
- onFocus?.(event);
624
- const target = event.target, cardElement = cardRef.current;
625
- if (cardElement && target === preDivRef.current) {
626
- focusLastDescendant(cardElement);
627
- return;
628
- }
629
- if (cardElement && target === postDivRef.current) {
630
- focusFirstDescendant(cardElement);
631
- return;
632
- }
633
- isHTMLElement(event.target) && (focusedElementRef.current = event.target);
634
- }, $[22] = onFocus, $[23] = t7) : t7 = $[23];
635
- const handleFocus = t7, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
636
- let t8;
637
- $[24] !== boundaryElement || $[25] !== portalElement ? (t8 = () => {
638
- rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
639
- const activeElement = document.activeElement;
640
- if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
641
- const target_0 = focusedElementRef.current;
642
- if (!target_0 || !document.body.contains(target_0)) {
643
- const cardElement_0 = cardRef.current;
644
- cardElement_0 && focusFirstDescendant(cardElement_0);
645
- return;
646
- }
647
- target_0.focus();
648
- }
649
- }, 0);
650
- }, $[24] = boundaryElement, $[25] = portalElement, $[26] = t8) : t8 = $[26];
651
- const handleRootClick = t8;
652
- let t9;
653
- $[27] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[27] = t9) : t9 = $[27];
654
- let t10;
655
- $[28] !== autoFocus || $[29] !== cardRadius || $[30] !== cardShadow || $[31] !== children || $[32] !== contentRef || $[33] !== footer || $[34] !== header || $[35] !== hideCloseButton || $[36] !== id || $[37] !== onClickOutside || $[38] !== onClose || $[39] !== portalProp || $[40] !== scheme || $[41] !== width ? (t10 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, width, children }), $[28] = autoFocus, $[29] = cardRadius, $[30] = cardShadow, $[31] = children, $[32] = contentRef, $[33] = footer, $[34] = header, $[35] = hideCloseButton, $[36] = id, $[37] = onClickOutside, $[38] = onClose, $[39] = portalProp, $[40] = scheme, $[41] = width, $[42] = t10) : t10 = $[42];
656
- let t11;
657
- $[43] === Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[43] = t11) : t11 = $[43];
658
- let t12;
659
- $[44] !== animate || $[45] !== handleFocus || $[46] !== handleRootClick || $[47] !== id || $[48] !== labelId || $[49] !== onActivate || $[50] !== padding || $[51] !== position || $[52] !== ref || $[53] !== restProps || $[54] !== t10 || $[55] !== zOffset ? (t12 = /* @__PURE__ */ jsxs(StyledDialog, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
660
- t9,
661
- t10,
662
- t11
663
- ] }), $[44] = animate, $[45] = handleFocus, $[46] = handleRootClick, $[47] = id, $[48] = labelId, $[49] = onActivate, $[50] = padding, $[51] = position, $[52] = ref, $[53] = restProps, $[54] = t10, $[55] = zOffset, $[56] = t12) : t12 = $[56];
664
- let t13;
665
- return $[57] !== portalProp || $[58] !== t12 ? (t13 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t12 }), $[57] = portalProp, $[58] = t12, $[59] = t13) : t13 = $[59], t13;
666
- });
667
- Dialog.displayName = "ForwardRef(Dialog)";
668
- function DialogProvider(props) {
669
- const $ = c(6), {
670
- children,
671
- position,
672
- zOffset
673
- } = props;
674
- let t0, t1;
675
- $[0] !== position || $[1] !== zOffset ? (t1 = {
676
- version: 0,
677
- position,
678
- zOffset
679
- }, $[0] = position, $[1] = zOffset, $[2] = t1) : t1 = $[2], t0 = t1;
680
- const contextValue = t0;
681
- let t2;
682
- return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
683
- }
684
- DialogProvider.displayName = "DialogProvider";
685
- const MenuButton = forwardRef(function(props, forwardedRef) {
686
- const $ = c(62), {
687
- __unstable_disableRestoreFocusOnClose: t0,
688
- boundaryElement: deprecated_boundaryElement,
689
- button: buttonProp,
690
- id,
691
- menu: menuProp,
692
- onClose,
693
- onOpen,
694
- placement: deprecated_placement,
695
- popoverScheme: deprecated_popoverScheme,
696
- portal: t1,
697
- popover,
698
- popoverRadius: deprecated_popoverRadius,
699
- preventOverflow: deprecated_preventOverflow
700
- } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), [buttonElement, setButtonElement] = useState(null);
701
- let t2;
702
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
703
- const [menuElements, setChildMenuElements] = useState(t2), openRef = useRef(open);
704
- let t3, t4;
705
- $[1] !== onOpen || $[2] !== open ? (t3 = () => {
706
- onOpen && open && !openRef.current && onOpen();
707
- }, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
708
- let t5, t6;
709
- $[5] !== onClose || $[6] !== open ? (t5 = () => {
710
- onClose && !open && openRef.current && onClose();
711
- }, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), useEffect(t5, t6);
712
- let t7, t8;
713
- $[9] !== open ? (t7 = () => {
714
- openRef.current = open;
715
- }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
716
- let t9;
717
- $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
718
- setOpen(_temp$2), setShouldFocus(null);
719
- }, $[12] = t9) : t9 = $[12];
720
- const handleButtonClick = t9;
721
- let t10;
722
- $[13] !== open ? (t10 = (event) => {
723
- open && event.preventDefault();
724
- }, $[13] = open, $[14] = t10) : t10 = $[14];
725
- const handleMouseDown = t10;
726
- let t11;
727
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (event_0) => {
728
- if (event_0.key === "ArrowDown" || event_0.key === "Enter" || event_0.key === " ") {
729
- event_0.preventDefault(), setOpen(!0), setShouldFocus("first");
730
- return;
731
- }
732
- if (event_0.key === "ArrowUp") {
733
- event_0.preventDefault(), setOpen(!0), setShouldFocus("last");
734
- return;
735
- }
736
- }, $[15] = t11) : t11 = $[15];
737
- const handleButtonKeyDown = t11;
738
- let t12;
739
- $[16] !== buttonElement || $[17] !== menuElements ? (t12 = (event_1) => {
740
- const target = event_1.target;
741
- if (target instanceof Node && !(buttonElement && (target === buttonElement || buttonElement.contains(target)))) {
742
- for (const el of menuElements)
743
- if (target === el || el.contains(target))
744
- return;
745
- setOpen(!1);
746
- }
747
- }, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
748
- const handleMenuClickOutside = t12;
749
- let t13;
750
- $[19] !== buttonElement || $[20] !== disableRestoreFocusOnClose ? (t13 = () => {
751
- setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
752
- }, $[19] = buttonElement, $[20] = disableRestoreFocusOnClose, $[21] = t13) : t13 = $[21];
753
- const handleMenuEscape = t13;
754
- let t14;
755
- $[22] !== menuElements ? (t14 = (event_2) => {
756
- const target_0 = event_2.relatedTarget;
757
- if (target_0 instanceof Node) {
758
- for (const el_0 of menuElements)
759
- if (el_0 === target_0 || el_0.contains(target_0))
760
- return;
761
- setOpen(!1);
762
- }
763
- }, $[22] = menuElements, $[23] = t14) : t14 = $[23];
764
- const handleBlur = t14;
765
- let t15;
766
- $[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t15 = () => {
767
- setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
768
- }, $[24] = buttonElement, $[25] = disableRestoreFocusOnClose, $[26] = t15) : t15 = $[26];
769
- const handleItemClick = t15;
770
- let t16;
771
- $[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];
772
- const registerElement = t16;
773
- let t17;
774
- $[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && cloneElement(menuProp, {
775
- "aria-labelledby": id,
776
- onBlurCapture: handleBlur,
777
- onClickOutside: handleMenuClickOutside,
778
- onEscape: handleMenuEscape,
779
- onItemClick: handleItemClick,
780
- originElement: buttonElement,
781
- registerElement,
782
- shouldFocus
783
- }), $[28] = buttonElement, $[29] = handleBlur, $[30] = handleItemClick, $[31] = handleMenuClickOutside, $[32] = handleMenuEscape, $[33] = id, $[34] = menuProp, $[35] = shouldFocus, $[36] = t17) : t17 = $[36];
784
- const menu = t17;
785
- let t18, t19;
786
- $[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open ? (t19 = buttonProp && cloneElement(buttonProp, {
787
- "data-ui": "MenuButton",
788
- id,
789
- onClick: handleButtonClick,
790
- onKeyDown: handleButtonKeyDown,
791
- onMouseDown: handleMouseDown,
792
- "aria-haspopup": !0,
793
- "aria-expanded": open,
794
- ref: setButtonElement,
795
- selected: buttonProp.props.selected ?? open
796
- }), $[37] = buttonProp, $[38] = handleMouseDown, $[39] = id, $[40] = open, $[41] = t19) : t19 = $[41], t18 = t19;
797
- const button = t18;
798
- let t20, t21;
799
- $[42] !== buttonElement ? (t20 = () => buttonElement, t21 = [buttonElement], $[42] = buttonElement, $[43] = t20, $[44] = t21) : (t20 = $[43], t21 = $[44]), useImperativeHandle(forwardedRef, t20, t21);
800
- let t22, t23;
801
- $[45] !== popover ? (t23 = popover || {}, $[45] = popover, $[46] = t23) : t23 = $[46];
802
- let t24;
803
- $[47] !== deprecated_boundaryElement || $[48] !== deprecated_placement || $[49] !== deprecated_popoverRadius || $[50] !== deprecated_popoverScheme || $[51] !== deprecated_portal || $[52] !== deprecated_preventOverflow || $[53] !== t23 ? (t24 = {
804
- boundaryElement: deprecated_boundaryElement,
805
- overflow: "auto",
806
- placement: deprecated_placement,
807
- portal: deprecated_portal,
808
- preventOverflow: deprecated_preventOverflow,
809
- radius: deprecated_popoverRadius,
810
- scheme: deprecated_popoverScheme,
811
- ...t23
812
- }, $[47] = deprecated_boundaryElement, $[48] = deprecated_placement, $[49] = deprecated_popoverRadius, $[50] = deprecated_popoverScheme, $[51] = deprecated_portal, $[52] = deprecated_preventOverflow, $[53] = t23, $[54] = t24) : t24 = $[54], t22 = t24;
813
- const popoverProps = t22;
814
- let t25;
815
- $[55] !== button ? (t25 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[55] = button, $[56] = t25) : t25 = $[56];
816
- let t26;
817
- return $[57] !== menu || $[58] !== open || $[59] !== popoverProps || $[60] !== t25 ? (t26 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t25 }), $[57] = menu, $[58] = open, $[59] = popoverProps, $[60] = t25, $[61] = t26) : t26 = $[61], t26;
818
- });
819
- MenuButton.displayName = "ForwardRef(MenuButton)";
820
- function _temp$2(v) {
821
- return !v;
822
- }
823
- const keyframe = keyframes`
824
- 0% {
825
- background-position: 100%;
826
- }
827
- 100% {
828
- background-position: -100%;
829
- }
830
- `, animation = css`
831
- background-image: linear-gradient(
832
- to right,
833
- var(--card-skeleton-color-from),
834
- var(--card-skeleton-color-to),
835
- var(--card-skeleton-color-from),
836
- var(--card-skeleton-color-from),
837
- var(--card-skeleton-color-from)
838
- );
839
- background-position: 100%;
840
- background-size: 200% 100%;
841
- background-attachment: fixed;
842
- animation-name: ${keyframe};
843
- animation-timing-function: ease-in-out;
844
- animation-iteration-count: infinite;
845
- animation-duration: 2000ms;
846
- `, skeletonStyle = css`
847
- opacity: ${({
848
- $visible
849
- }) => $visible ? 1 : 0};
850
- transition: opacity 200ms ease-in;
851
-
852
- @media screen and (prefers-reduced-motion: no-preference) {
853
- ${({
854
- $animated
855
- }) => $animated ? animation : css`
856
- background-color: var(--card-skeleton-color-from);
857
- `}
858
- }
859
-
860
- @media screen and (prefers-reduced-motion: reduce) {
861
- background-color: var(--card-skeleton-color-from);
862
- }
863
- `, StyledSkeleton$1 = /* @__PURE__ */ styled(Box).withConfig({
864
- displayName: "StyledSkeleton",
865
- componentId: "sc-ebtpni-0"
866
- })(responsiveRadiusStyle, skeletonStyle), Skeleton = forwardRef(function(props, ref) {
867
- const $ = c(14);
868
- let delay, radius, restProps, t0;
869
- $[0] !== props ? ({
870
- animated: t0,
871
- delay,
872
- radius,
873
- ...restProps
874
- } = props, $[0] = props, $[1] = delay, $[2] = radius, $[3] = restProps, $[4] = t0) : (delay = $[1], radius = $[2], restProps = $[3], t0 = $[4]);
875
- const animated = t0 === void 0 ? !1 : t0, [visible, setVisible] = useState(!delay);
876
- let t1, t2;
877
- $[5] !== delay ? (t1 = () => {
878
- if (!delay)
879
- return setVisible(!0);
880
- const timeout = setTimeout(() => {
881
- setVisible(!0);
882
- }, delay);
883
- return () => {
884
- clearTimeout(timeout);
885
- };
886
- }, t2 = [delay], $[5] = delay, $[6] = t1, $[7] = t2) : (t1 = $[6], t2 = $[7]), useEffect(t1, t2);
887
- const t3 = useArrayProp(radius);
888
- let t4;
889
- return $[8] !== animated || $[9] !== ref || $[10] !== restProps || $[11] !== t3 || $[12] !== visible ? (t4 = /* @__PURE__ */ jsx(StyledSkeleton$1, { ...restProps, $animated: animated, $radius: t3, $visible: visible, ref }), $[8] = animated, $[9] = ref, $[10] = restProps, $[11] = t3, $[12] = visible, $[13] = t4) : t4 = $[13], t4;
890
- });
891
- Skeleton.displayName = "ForwardRef(Skeleton)";
892
- const StyledSkeleton = /* @__PURE__ */ styled(Skeleton).withConfig({
893
- displayName: "StyledSkeleton",
894
- componentId: "sc-2p7a1v-0"
895
- })((props) => {
896
- const {
897
- $size,
898
- $style
899
- } = props, {
900
- font,
901
- media
902
- } = getTheme_v2(props.theme), fontStyle = font[$style];
903
- return _responsive(media, $size, (sizeIndex) => {
904
- const fontSize = fontStyle.sizes[sizeIndex];
905
- return {
906
- height: fontSize.lineHeight - fontSize.ascenderHeight - fontSize.descenderHeight
907
- };
908
- });
909
- }), TextSkeleton = forwardRef(function(props, ref) {
910
- const $ = c(7);
911
- let restProps, t0;
912
- $[0] !== props ? ({
913
- size: t0,
914
- ...restProps
915
- } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
916
- const $size = useArrayProp(t0 === void 0 ? 2 : t0);
917
- let t1;
918
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "text" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
919
- });
920
- TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
921
- const LabelSkeleton = forwardRef(function(props, ref) {
922
- const $ = c(7);
923
- let restProps, t0;
924
- $[0] !== props ? ({
925
- size: t0,
926
- ...restProps
927
- } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
928
- const $size = useArrayProp(t0 === void 0 ? 2 : t0);
929
- let t1;
930
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "label" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
931
- });
932
- LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
933
- const HeadingSkeleton = forwardRef(function(props, ref) {
934
- const $ = c(7);
935
- let restProps, t0;
936
- $[0] !== props ? ({
937
- size: t0,
938
- ...restProps
939
- } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
940
- const $size = useArrayProp(t0 === void 0 ? 2 : t0);
941
- let t1;
942
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "heading" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
943
- });
944
- HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
945
- const CodeSkeleton = forwardRef(function(props, ref) {
946
- const $ = c(7);
947
- let restProps, t0;
948
- $[0] !== props ? ({
949
- size: t0,
950
- ...restProps
951
- } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
952
- const $size = useArrayProp(t0 === void 0 ? 2 : t0);
953
- let t1;
954
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "code" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
955
- });
956
- CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
957
- const TabPanel = forwardRef(function(props, ref) {
958
- const $ = c(9);
959
- let flex, restProps;
960
- $[0] !== props ? ({
961
- flex,
962
- ...restProps
963
- } = props, $[0] = props, $[1] = flex, $[2] = restProps) : (flex = $[1], restProps = $[2]);
964
- const t0 = props.tabIndex === void 0 ? 0 : props.tabIndex;
965
- let t1;
966
- return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ jsx(Box, { "data-ui": "TabPanel", ...restProps, flex, ref, role: "tabpanel", tabIndex: t0, children: props.children }), $[3] = flex, $[4] = props.children, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1) : t1 = $[8], t1;
967
- });
968
- TabPanel.displayName = "ForwardRef(TabPanel)";
969
- const LOADING_BAR_HEIGHT = 2, STATUS_CARD_TONE = {
970
- error: "critical",
971
- warning: "caution",
972
- success: "positive",
973
- info: "neutral"
974
- }, BUTTON_TONE = {
975
- error: "critical",
976
- warning: "caution",
977
- success: "positive",
978
- info: "neutral"
979
- }, TextBox = styled(Flex).withConfig({
980
- displayName: "TextBox",
981
- componentId: "sc-1rr7rxo-0"
982
- })`overflow-x:auto;`, StyledToast = styled(Card).withConfig({
983
- displayName: "StyledToast",
984
- componentId: "sc-1rr7rxo-1"
985
- })`pointer-events:all;width:100%;position:relative;overflow:hidden;overflow:clip;&[data-has-duration]{padding-bottom:calc(${LOADING_BAR_HEIGHT}px / 2);}`, LoadingBar = styled.div.withConfig({
986
- displayName: "LoadingBar",
987
- componentId: "sc-1rr7rxo-2"
988
- })`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({
989
- displayName: "LoadingBarMask",
990
- componentId: "sc-1rr7rxo-3"
991
- })`position:absolute;top:0;left:-${LOADING_BAR_HEIGHT}px;right:-${LOADING_BAR_HEIGHT}px;bottom:${LOADING_BAR_HEIGHT}px;z-index:1;`, LoadingBarProgress = styled(Card).withConfig({
992
- displayName: "LoadingBarProgress",
993
- componentId: "sc-1rr7rxo-4"
994
- })`display:block;height:100%;width:100%;transform-origin:0% 50%;background-color:${(props) => {
995
- const {
996
- color
997
- } = getTheme_v2$1(props.theme);
998
- return color.button.default[props.tone].enabled.bg;
999
- }};`, ROLES = {
1000
- error: "alert",
1001
- warning: "alert",
1002
- success: "alert",
1003
- info: "alert"
1004
- }, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
1005
- function Toast(props) {
1006
- const $ = c(52);
1007
- let closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
1008
- $[0] !== props ? ({
1009
- closable,
1010
- description,
1011
- duration,
1012
- onClose,
1013
- radius: t0,
1014
- title,
1015
- status,
1016
- updatedAt,
1017
- ...restProps
1018
- } = props, $[0] = props, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = restProps, $[6] = status, $[7] = t0, $[8] = title, $[9] = updatedAt) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], restProps = $[5], status = $[6], t0 = $[7], title = $[8], updatedAt = $[9]);
1019
- const radius = t0 === void 0 ? 3 : t0, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = usePrefersReducedMotion() ? 0 : 0.26;
1020
- let t1;
1021
- $[10] !== visualDuration ? (t1 = visualDuration ? {
1022
- type: "spring",
1023
- visualDuration,
1024
- bounce: 0.25
1025
- } : {
1026
- duration: 0
1027
- }, $[10] = visualDuration, $[11] = t1) : t1 = $[11];
1028
- const transition = t1;
1029
- let t2;
1030
- $[12] !== duration ? (t2 = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG, $[12] = duration, $[13] = t2) : t2 = $[13];
1031
- const hasDuration = t2;
1032
- let t3;
1033
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["hidden", "initial"], $[14] = t3) : t3 = $[14];
1034
- const initial = t3;
1035
- let t4;
1036
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["visible", "slideIn"], $[15] = t4) : t4 = $[15];
1037
- const animate = t4;
1038
- let t5;
1039
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t5 = ["hidden", "slideOut"], $[16] = t5) : t5 = $[16];
1040
- const exit = t5, t6 = hasDuration ? "" : void 0;
1041
- let t7;
1042
- $[17] !== title ? (t7 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[17] = title, $[18] = t7) : t7 = $[18];
1043
- let t8;
1044
- $[19] !== description || $[20] !== transition ? (t8 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[19] = description, $[20] = transition, $[21] = t8) : t8 = $[21];
1045
- let t9;
1046
- $[22] !== t7 || $[23] !== t8 ? (t9 = /* @__PURE__ */ jsx(TextBox, { flex: 1, padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
1047
- t7,
1048
- t8
1049
- ] }) }), $[22] = t7, $[23] = t8, $[24] = t9) : t9 = $[24];
1050
- let t10;
1051
- $[25] !== buttonTone || $[26] !== closable || $[27] !== onClose ? (t10 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
1052
- verticalAlign: "top"
1053
- } }) }), $[25] = buttonTone, $[26] = closable, $[27] = onClose, $[28] = t10) : t10 = $[28];
1054
- let t11;
1055
- $[29] !== t10 || $[30] !== t9 || $[31] !== transition ? (t11 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
1056
- t9,
1057
- t10
1058
- ] }), $[29] = t10, $[30] = t9, $[31] = transition, $[32] = t11) : t11 = $[32];
1059
- let t12;
1060
- $[33] !== cardTone || $[34] !== duration || $[35] !== hasDuration || $[36] !== onClose || $[37] !== radius || $[38] !== transition || $[39] !== updatedAt || $[40] !== visualDuration ? (t12 = hasDuration && /* @__PURE__ */ jsxs(MotionLoadingBar, { variants: content, transition, children: [
1061
- /* @__PURE__ */ jsx(LoadingBarMask, { tone: cardTone, radius }),
1062
- /* @__PURE__ */ jsx(MotionLoadingBarProgress, { tone: cardTone, initial: {
1063
- scaleX: 0
1064
- }, animate: {
1065
- scaleX: 1
1066
- }, transition: {
1067
- delay: visualDuration,
1068
- duration: duration / 1e3,
1069
- ease: "linear"
1070
- }, onAnimationComplete: onClose }, `progress-${updatedAt}`)
1071
- ] }), $[33] = cardTone, $[34] = duration, $[35] = hasDuration, $[36] = onClose, $[37] = radius, $[38] = transition, $[39] = updatedAt, $[40] = visualDuration, $[41] = t12) : t12 = $[41];
1072
- let t13;
1073
- return $[42] !== cardTone || $[43] !== radius || $[44] !== restProps || $[45] !== role || $[46] !== t11 || $[47] !== t12 || $[48] !== t6 || $[49] !== transition || $[50] !== visualDuration ? (t13 = /* @__PURE__ */ jsxs(MotionToast, { "data-ui": "Toast", role, ...restProps, "data-has-duration": t6, custom: visualDuration, radius, shadow: 2, tone: cardTone, forwardedAs: "li", layout: "position", variants: container, initial, animate, exit, transition, children: [
1074
- t11,
1075
- t12
1076
- ] }), $[42] = cardTone, $[43] = radius, $[44] = restProps, $[45] = role, $[46] = t11, $[47] = t12, $[48] = t6, $[49] = transition, $[50] = visualDuration, $[51] = t13) : t13 = $[51], t13;
1077
- }
1078
- Toast.displayName = "Toast";
1079
- const container = {
1080
- initial: {
1081
- y: 32,
1082
- scale: 0.5,
1083
- zIndex: 1
1084
- },
1085
- hidden: {
1086
- opacity: 0
1087
- },
1088
- visible: (visualDuration) => visualDuration ? {
1089
- opacity: 1,
1090
- transition: {
1091
- when: "beforeChildren",
1092
- staggerChildren: visualDuration / 3,
1093
- duration: visualDuration / 3
1094
- }
1095
- } : {
1096
- opacity: 1
1097
- },
1098
- slideIn: {
1099
- y: 0,
1100
- scale: 1
1101
- },
1102
- slideOut: {
1103
- zIndex: 0,
1104
- scale: 0.75
1105
- }
1106
- }, content = {
1107
- initial: {
1108
- willChange: "transform"
1109
- },
1110
- hidden: {
1111
- opacity: 0
1112
- },
1113
- visible: {
1114
- opacity: 1
1115
- }
1116
- }, MotionToast = motion.create(StyledToast), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionLoadingBar = motion.create(LoadingBar), MotionLoadingBarProgress = motion.create(LoadingBarProgress);
1117
- function useMounted() {
1118
- return useSyncExternalStore(subscribe, _temp$1, _temp2);
1119
- }
1120
- function _temp2() {
1121
- return !1;
1122
- }
1123
- function _temp$1() {
1124
- return !0;
1125
- }
1126
- const subscribe = () => () => {
1127
- }, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null);
1128
- function ToastLayer(props) {
1129
- const $ = c(9), {
1130
- children,
1131
- padding: t0,
1132
- paddingX,
1133
- paddingY,
1134
- gap: t1
1135
- } = props, padding = t0 === void 0 ? 4 : t0, gap = t1 === void 0 ? 3 : t1, {
1136
- zIndex
1137
- } = useLayer();
1138
- let t2;
1139
- $[0] !== zIndex ? (t2 = {
1140
- zIndex
1141
- }, $[0] = zIndex, $[1] = t2) : t2 = $[1];
1142
- let t3;
1143
- return $[2] !== children || $[3] !== gap || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== t2 ? (t3 = /* @__PURE__ */ jsx(StyledLayer, { forwardedAs: "ul", "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t2, children }), $[2] = children, $[3] = gap, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = t2, $[8] = t3) : t3 = $[8], t3;
1144
- }
1145
- ToastLayer.displayName = "ToastLayer";
1146
- const StyledLayer = styled(Grid).withConfig({
1147
- displayName: "StyledLayer",
1148
- componentId: "sc-1tbwn58-0"
1149
- })`box-sizing:border-box;position:fixed;right:0;bottom:0;list-style:none;pointer-events:none;max-width:420px;width:100%;`;
1150
- let toastId = 0;
1151
- function generateToastId() {
1152
- return String(toastId++);
1153
- }
1154
- function ToastProvider(props) {
1155
- const $ = c(13), {
1156
- children,
1157
- padding,
1158
- paddingX,
1159
- paddingY,
1160
- gap,
1161
- zOffset: t0
1162
- } = props, zOffset = t0 === void 0 ? 1 : t0;
1163
- let t1;
1164
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
1165
- const [state, setState] = useState(t1), mounted = useMounted();
1166
- let t2, t3;
1167
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
1168
- version: 0,
1169
- push: (params) => {
1170
- const id = params.id || generateToastId(), duration = params.duration || 5e3;
1171
- return startTransition(() => {
1172
- setState((prevState) => {
1173
- if (duration === 0.01)
1174
- return prevState.filter((toast) => toast.id !== id);
1175
- const dismiss = () => startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
1176
- return [...prevState.filter((toast_1) => toast_1.id !== id), {
1177
- dismiss,
1178
- id,
1179
- updatedAt: Date.now(),
1180
- params: {
1181
- ...params,
1182
- duration
1183
- }
1184
- }];
1185
- });
1186
- }), id;
1187
- }
1188
- }, $[1] = t3) : t3 = $[1], t2 = t3;
1189
- const value = t2;
1190
- let t4;
1191
- $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
1192
- let t5;
1193
- return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
1194
- children,
1195
- t4
1196
- ] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
1197
- }
1198
- function _temp(t0) {
1199
- const {
1200
- dismiss: dismiss_0,
1201
- id: id_0,
1202
- params: params_0,
1203
- updatedAt
1204
- } = t0;
1205
- return /* @__PURE__ */ jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration, updatedAt }, id_0);
1206
- }
1207
- ToastProvider.displayName = "ToastProvider";
1208
- function useToast() {
1209
- const value = useContext(ToastContext);
1210
- if (!value)
1211
- throw new Error("useToast(): missing context value");
1212
- if (!isRecord(value) || value.version !== 0)
1213
- throw new Error("useToast(): the context value is not compatible");
1214
- return value;
1215
- }
1216
- function _findPrevItemElement(state, itemElements, focusedElement) {
1217
- const idx = itemElements.indexOf(focusedElement), els = itemElements.slice(0, idx), len = els.length;
1218
- for (let i = len - 1; i >= 0; i -= 1) {
1219
- const itemKey = els[i].getAttribute("data-tree-key");
1220
- if (!itemKey)
1221
- continue;
1222
- const segments = itemKey.split("/");
1223
- segments.pop();
1224
- const p = [];
1225
- let expanded = !0;
1226
- for (let j = 0; j < segments.length; j += 1) {
1227
- p.push(segments[j]);
1228
- const k = p.join("/");
1229
- if (!state[k]?.expanded) {
1230
- expanded = !1;
1231
- break;
1232
- }
1233
- }
1234
- if (expanded)
1235
- return els[i];
1236
- }
1237
- return null;
1238
- }
1239
- function _findNextItemElement(state, itemElements, focusedElement) {
1240
- const idx = itemElements.indexOf(focusedElement), els = itemElements.slice(idx), len = itemElements.length;
1241
- for (let i = 1; i < len; i += 1) {
1242
- if (!els[i])
1243
- continue;
1244
- const itemKey = els[i].getAttribute("data-tree-key");
1245
- if (!itemKey)
1246
- continue;
1247
- const segments = itemKey.split("/");
1248
- segments.pop();
1249
- const p = [];
1250
- let expanded = !0;
1251
- for (let j = 0; j < segments.length; j += 1) {
1252
- p.push(segments[j]);
1253
- const k = p.join("/");
1254
- if (!state[k]?.expanded) {
1255
- expanded = !1;
1256
- break;
1257
- }
1258
- }
1259
- if (expanded)
1260
- return els[i];
1261
- }
1262
- return null;
1263
- }
1264
- function _focusItemElement(el) {
1265
- if (el.getAttribute("role") === "treeitem" && el.focus(), el.getAttribute("role") === "none") {
1266
- const firstChild = el.firstChild;
1267
- firstChild && firstChild instanceof HTMLElement && firstChild.focus();
1268
- }
1269
- }
1270
- const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = memo(forwardRef(function(props, forwardedRef) {
1271
- const $ = c(37);
1272
- let children, onFocus, restProps, t0;
1273
- $[0] !== props ? ({
1274
- children,
1275
- space: t0,
1276
- onFocus,
1277
- ...restProps
1278
- } = props, $[0] = props, $[1] = children, $[2] = onFocus, $[3] = restProps, $[4] = t0) : (children = $[1], onFocus = $[2], restProps = $[3], t0 = $[4]);
1279
- const space = t0 === void 0 ? 1 : t0, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
1280
- let t1, t2;
1281
- $[5] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[5] = t2) : t2 = $[5], t1 = t2;
1282
- const path = t1;
1283
- let t3;
1284
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[6] = t3) : t3 = $[6];
1285
- const [itemElements, setItemElements] = useState(t3);
1286
- let t4;
1287
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {}, $[7] = t4) : t4 = $[7];
1288
- const [state, setState] = useState(t4), stateRef = useRef(state);
1289
- let t5;
1290
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[8] = t5) : t5 = $[8], useImperativeHandle(forwardedRef, t5);
1291
- let t6, t7;
1292
- $[9] !== focusedElement ? (t6 = () => {
1293
- focusedElementRef.current = focusedElement;
1294
- }, t7 = [focusedElement], $[9] = focusedElement, $[10] = t6, $[11] = t7) : (t6 = $[10], t7 = $[11]), useEffect(t6, t7);
1295
- let t8, t9;
1296
- $[12] !== state ? (t8 = () => {
1297
- stateRef.current = state;
1298
- }, t9 = [state], $[12] = state, $[13] = t8, $[14] = t9) : (t8 = $[13], t9 = $[14]), useEffect(t8, t9);
1299
- let t10;
1300
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (element, path_0, expanded, selected) => (setState((s) => ({
1301
- ...s,
1302
- [path_0]: {
1303
- element,
1304
- expanded
1305
- }
1306
- })), selected && setFocusedElement(element), () => {
1307
- setState((s_0) => {
1308
- const newState = {
1309
- ...s_0
1310
- };
1311
- return delete newState[path_0], newState;
1312
- });
1313
- }), $[15] = t10) : t10 = $[15];
1314
- const registerItem = t10;
1315
- let t11;
1316
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (path_1, expanded_0) => {
1317
- setState((s_1) => {
1318
- const itemState = s_1[path_1];
1319
- return itemState ? {
1320
- ...s_1,
1321
- [path_1]: {
1322
- ...itemState,
1323
- expanded: expanded_0
1324
- }
1325
- } : s_1;
1326
- });
1327
- }, $[16] = t11) : t11 = $[16];
1328
- const setExpanded = t11;
1329
- let t12;
1330
- const t13 = focusedElement || itemElements[0] || null;
1331
- let t14;
1332
- $[17] !== space || $[18] !== state || $[19] !== t13 ? (t14 = {
1333
- version: 0,
1334
- focusedElement: t13,
1335
- level: 0,
1336
- path,
1337
- registerItem,
1338
- setExpanded,
1339
- setFocusedElement,
1340
- space,
1341
- state
1342
- }, $[17] = space, $[18] = state, $[19] = t13, $[20] = t14) : t14 = $[20], t12 = t14;
1343
- const contextValue = t12;
1344
- let t15;
1345
- $[21] !== itemElements ? (t15 = (event) => {
1346
- if (focusedElementRef.current) {
1347
- if (event.key === "ArrowDown") {
1348
- event.preventDefault();
1349
- const nextEl = _findNextItemElement(stateRef.current, itemElements, focusedElementRef.current);
1350
- nextEl && (_focusItemElement(nextEl), setFocusedElement(nextEl));
1351
- return;
1352
- }
1353
- if (event.key === "ArrowUp") {
1354
- event.preventDefault();
1355
- const prevEl = _findPrevItemElement(stateRef.current, itemElements, focusedElementRef.current);
1356
- prevEl && (_focusItemElement(prevEl), setFocusedElement(prevEl));
1357
- return;
1358
- }
1359
- if (event.key === "ArrowLeft") {
1360
- event.preventDefault();
1361
- const itemKey = focusedElementRef.current.getAttribute("data-tree-key");
1362
- if (!itemKey)
1363
- return;
1364
- const itemState_0 = stateRef.current[itemKey];
1365
- if (!itemState_0)
1366
- return;
1367
- if (itemState_0.expanded)
1368
- setState((s_2) => {
1369
- const itemState_1 = s_2[itemKey];
1370
- return itemState_1 ? {
1371
- ...s_2,
1372
- [itemKey]: {
1373
- ...itemState_1,
1374
- expanded: !1
1375
- }
1376
- } : s_2;
1377
- });
1378
- else {
1379
- const itemPath = itemKey.split("/");
1380
- itemPath.pop();
1381
- const parentKey = itemPath.join("/"), parentState = parentKey && stateRef.current[parentKey];
1382
- parentState && (parentState.element.focus(), setFocusedElement(parentState.element));
1383
- }
1384
- return;
1385
- }
1386
- if (event.key === "ArrowRight") {
1387
- event.preventDefault();
1388
- const focusedKey = focusedElementRef.current.getAttribute("data-tree-key");
1389
- if (!focusedKey)
1390
- return;
1391
- stateRef.current[focusedKey]?.expanded || setState((s_3) => {
1392
- const itemState_2 = s_3[focusedKey];
1393
- return itemState_2 ? {
1394
- ...s_3,
1395
- [focusedKey]: {
1396
- ...itemState_2,
1397
- expanded: !0
1398
- }
1399
- } : s_3;
1400
- });
1401
- return;
1402
- }
1403
- }
1404
- }, $[21] = itemElements, $[22] = t15) : t15 = $[22];
1405
- const handleKeyDown = t15;
1406
- let t16;
1407
- $[23] !== onFocus ? (t16 = (event_0) => {
1408
- setFocusedElement(event_0.target), onFocus?.(event_0);
1409
- }, $[23] = onFocus, $[24] = t16) : t16 = $[24];
1410
- const handleFocus = t16;
1411
- let t17;
1412
- $[25] === Symbol.for("react.memo_cache_sentinel") ? (t17 = () => {
1413
- if (!ref.current)
1414
- return;
1415
- const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
1416
- setItemElements(_itemElements);
1417
- }, $[25] = t17) : t17 = $[25];
1418
- let t18;
1419
- $[26] !== children ? (t18 = [children], $[26] = children, $[27] = t18) : t18 = $[27], useEffect(t17, t18);
1420
- let t19;
1421
- $[28] !== children || $[29] !== handleFocus || $[30] !== handleKeyDown || $[31] !== restProps || $[32] !== space ? (t19 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...restProps, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", space, children }), $[28] = children, $[29] = handleFocus, $[30] = handleKeyDown, $[31] = restProps, $[32] = space, $[33] = t19) : t19 = $[33];
1422
- let t20;
1423
- return $[34] !== contextValue || $[35] !== t19 ? (t20 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t19 }), $[34] = contextValue, $[35] = t19, $[36] = t20) : t20 = $[36], t20;
1424
- }));
1425
- Tree.displayName = "Memo(ForwardRef(Tree))";
1426
- function treeItemRootStyle() {
1427
- return css`
1428
- &[role='none'] > [role='treeitem'] {
1429
- outline: none;
1430
- cursor: default;
1431
- border-radius: 3px;
1432
-
1433
- background-color: var(--card-bg-color);
1434
- color: var(--treeitem-fg-color);
1435
-
1436
- &:focus {
1437
- position: relative;
1438
- }
1439
- }
1440
-
1441
- &[role='treeitem'] {
1442
- outline: none;
1443
-
1444
- & > div {
1445
- cursor: default;
1446
- border-radius: 3px;
1447
-
1448
- background-color: var(--card-bg-color);
1449
- color: var(--treeitem-fg-color);
1450
- }
1451
-
1452
- &:focus > div {
1453
- position: relative;
1454
- }
1455
- }
1456
- `;
1457
- }
1458
- function treeItemRootColorStyle(props) {
1459
- const $tone = "default", {
1460
- color
1461
- } = getTheme_v2(props.theme), tone = color.selectable[$tone];
1462
- return css`
1463
- &[role='none'] {
1464
- & > [role='treeitem'] {
1465
- ${_cardColorStyle(color, tone.enabled)}
1466
- }
1467
-
1468
- &[data-selected] > [role='treeitem'] {
1469
- ${_cardColorStyle(color, tone.pressed)}
1470
- }
1471
-
1472
- @media (hover: hover) {
1473
- &:not([data-selected]) > [role='treeitem']:not(:focus):hover {
1474
- ${_cardColorStyle(color, tone.hovered)}
1475
- }
1476
-
1477
- & > [role='treeitem']:focus {
1478
- ${_cardColorStyle(color, tone.selected)}
1479
- }
1480
- }
1481
- }
1482
-
1483
- &[role='treeitem'] {
1484
- & > [data-ui='TreeItem__box'] {
1485
- ${_cardColorStyle(color, tone.enabled)}
1486
- }
1487
-
1488
- &[data-selected] > [data-ui='TreeItem__box'] {
1489
- ${_cardColorStyle(color, tone.pressed)}
1490
- }
1491
-
1492
- @media (hover: hover) {
1493
- &:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {
1494
- ${_cardColorStyle(color, tone.hovered)}
1495
- }
1496
-
1497
- &:focus > [data-ui='TreeItem__box'] {
1498
- ${_cardColorStyle(color, tone.selected)}
1499
- }
1500
- }
1501
- }
1502
- `;
1503
- }
1504
- function treeItemBoxStyle(props) {
1505
- const {
1506
- $level
1507
- } = props, {
1508
- space
1509
- } = getTheme_v2(props.theme);
1510
- return css`
1511
- padding-left: ${rem(space[2] * $level)};
1512
-
1513
- &[data-as='a'] {
1514
- text-decoration: none;
1515
- }
1516
- `;
1517
- }
1518
- function useTree() {
1519
- const tree = useContext(TreeContext);
1520
- if (!tree)
1521
- throw new Error("Tree: missing context value");
1522
- return tree;
1523
- }
1524
- const TreeGroup = memo(function(props) {
1525
- const $ = c(9);
1526
- let children, restProps, t0;
1527
- $[0] !== props ? ({
1528
- children,
1529
- expanded: t0,
1530
- ...restProps
1531
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
1532
- const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
1533
- let t2;
1534
- return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.space ? (t2 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.space, role: "group", space: tree.space, children }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.space, $[8] = t2) : t2 = $[8], t2;
1535
- }), StyledTreeItem = memo(styled.li.withConfig({
1536
- displayName: "StyledTreeItem",
1537
- componentId: "sc-iiskig-0"
1538
- })(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = /* @__PURE__ */ styled(Box).attrs({
1539
- forwardedAs: "a"
1540
- }).withConfig({
1541
- displayName: "TreeItemBox",
1542
- componentId: "sc-iiskig-1"
1543
- })(treeItemBoxStyle), ToggleArrowText = styled(Text).withConfig({
1544
- displayName: "ToggleArrowText",
1545
- componentId: "sc-iiskig-2"
1546
- })`& > svg{transition:transform 100ms;}`, TreeItem = memo(function(props) {
1547
- const {
1548
- children,
1549
- expanded: expandedProp = !1,
1550
- fontSize = 1,
1551
- href,
1552
- icon: IconComponent,
1553
- id: idProp,
1554
- linkAs,
1555
- muted,
1556
- onClick,
1557
- padding = 2,
1558
- selected = !1,
1559
- space = 2,
1560
- text,
1561
- weight,
1562
- ...restProps
1563
- } = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
1564
- path,
1565
- registerItem,
1566
- setExpanded,
1567
- setFocusedElement
1568
- } = tree, _id = useId(), id = idProp || _id, itemPath = useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = useMemo(() => ({
1569
- ...tree,
1570
- level: tree.level + 1,
1571
- path: itemPath
1572
- }), [itemPath, tree]), handleClick = useCallback((event) => {
1573
- onClick && onClick(event);
1574
- const target = event.target;
1575
- target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
1576
- }, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = useCallback((event_0) => {
1577
- focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
1578
- }, [focused]);
1579
- useEffect(() => {
1580
- if (rootRef.current)
1581
- return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
1582
- }, [expanded, itemPath, registerItem, selected]);
1583
- const content2 = /* @__PURE__ */ jsxs(Flex, { padding, children: [
1584
- /* @__PURE__ */ jsxs(Box, { marginRight: space, style: {
1585
- visibility: IconComponent || children ? "visible" : "hidden",
1586
- pointerEvents: "none"
1587
- }, children: [
1588
- IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }),
1589
- !IconComponent && /* @__PURE__ */ jsx(ToggleArrowText, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
1590
- transform: expanded ? "rotate(90deg)" : void 0
1591
- } }) })
1592
- ] }),
1593
- /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1594
- ] });
1595
- return href ? /* @__PURE__ */ jsxs(StyledTreeItem, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: rootRef, role: "none", children: [
1596
- /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content2 }),
1597
- /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
1598
- ] }) : /* @__PURE__ */ jsxs(StyledTreeItem, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
1599
- /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content2 }),
1600
- /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
1601
- ] });
1602
- });
1603
- TreeItem.displayName = "Memo(TreeItem)";
1604
- export {
1605
- Arrow,
1606
- Autocomplete,
1607
- Avatar,
1608
- AvatarCounter,
1609
- AvatarStack,
1610
- Badge,
1611
- BoundaryElementProvider,
1612
- Box,
1613
- Breadcrumbs,
1614
- Button,
1615
- Card,
1616
- Checkbox,
1617
- Code,
1618
- CodeSkeleton,
1619
- ConditionalWrapper,
1620
- Container,
1621
- Dialog,
1622
- DialogContext,
1623
- DialogProvider,
1624
- ElementQuery,
1625
- ErrorBoundary,
1626
- Flex,
1627
- Grid,
1628
- Heading,
1629
- HeadingSkeleton,
1630
- Hotkeys,
1631
- Inline,
1632
- KBD,
1633
- Label,
1634
- LabelSkeleton,
1635
- Layer,
1636
- LayerProvider,
1637
- Menu,
1638
- MenuButton,
1639
- MenuDivider,
1640
- MenuGroup,
1641
- MenuItem,
1642
- Popover,
1643
- Portal,
1644
- PortalProvider,
1645
- Radio,
1646
- Select,
1647
- Skeleton,
1648
- Spinner,
1649
- SrOnly,
1650
- Stack,
1651
- Switch,
1652
- Tab,
1653
- TabList,
1654
- TabPanel,
1655
- Text,
1656
- TextArea,
1657
- TextInput,
1658
- TextSkeleton,
1659
- ThemeColorProvider,
1660
- ThemeProvider,
1661
- Toast,
1662
- ToastProvider,
1663
- Tooltip,
1664
- TooltipDelayGroupContext,
1665
- TooltipDelayGroupProvider,
1666
- Tree,
1667
- TreeItem,
1668
- VirtualList,
1669
- _ResizeObserver,
1670
- _elementSizeObserver,
1671
- _fillCSSObject,
1672
- _getArrayProp,
1673
- _getResponsiveSpace,
1674
- _hasFocus,
1675
- _isEnterToClickElement,
1676
- _isScrollable,
1677
- _raf,
1678
- _raf2,
1679
- _responsive,
1680
- attemptFocus,
1681
- containsOrEqualsElement,
1682
- createColorTheme,
1683
- focusFirstDescendant,
1684
- focusLastDescendant,
1685
- hexToRgb,
1686
- hslToRgb,
1687
- isFocusable,
1688
- isHTMLAnchorElement,
1689
- isHTMLButtonElement,
1690
- isHTMLElement,
1691
- isHTMLInputElement,
1692
- isHTMLSelectElement,
1693
- isHTMLTextAreaElement,
1694
- multiply,
1695
- parseColor,
1696
- rem,
1697
- responsiveCodeFontStyle,
1698
- responsiveHeadingFont,
1699
- responsiveLabelFont,
1700
- responsiveTextAlignStyle,
1701
- responsiveTextFont,
1702
- rgbToHex,
1703
- rgbToHsl,
1704
- rgba,
1705
- screen,
1706
- studioTheme,
1707
- useArrayProp,
1708
- useBoundaryElement,
1709
- useClickOutside,
1710
- useClickOutsideEvent,
1711
- useCustomValidity,
1712
- useDialog,
1713
- useElementRect,
1714
- useElementSize,
1715
- useForwardedRef,
1716
- useGlobalKeyDown,
1717
- useLayer,
1718
- useMatchMedia,
1719
- useMediaIndex,
1720
- usePortal,
1721
- usePrefersDark,
1722
- usePrefersReducedMotion,
1723
- useRootTheme,
1724
- useTheme,
1725
- useTheme_v2,
1726
- useToast,
1727
- useTooltipDelayGroup,
1728
- useTree
1729
- };
1730
- //# sourceMappingURL=index.esm.js.map