@sanity/ui 4.0.0-next.0 → 4.0.0-next.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/{_chunks/getScopedTheme.js → getScopedTheme-CqaSCfTH.js} +1 -1
- package/dist/getScopedTheme-CqaSCfTH.js.map +1 -0
- package/dist/index.d.ts +1105 -48
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3580 -352
- package/dist/index.js.map +1 -1
- package/dist/{_chunks/refractor.js → refractor-CC48DwHi.js} +2 -2
- package/dist/refractor-CC48DwHi.js.map +1 -0
- package/dist/{_chunks/rgba.d.cts → rgba-LmTDhX0u.d.ts} +1 -1
- package/dist/rgba-LmTDhX0u.d.ts.map +1 -0
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +1 -1
- package/package.json +7 -30
- package/dist/_chunks/getScopedTheme.cjs +0 -4043
- package/dist/_chunks/getScopedTheme.cjs.map +0 -1
- package/dist/_chunks/getScopedTheme.js.map +0 -1
- package/dist/_chunks/portalProvider.cjs +0 -3750
- package/dist/_chunks/portalProvider.cjs.map +0 -1
- package/dist/_chunks/portalProvider.d.cts +0 -1067
- package/dist/_chunks/portalProvider.d.cts.map +0 -1
- package/dist/_chunks/portalProvider.d.ts +0 -1067
- package/dist/_chunks/portalProvider.d.ts.map +0 -1
- package/dist/_chunks/portalProvider.js +0 -3300
- package/dist/_chunks/portalProvider.js.map +0 -1
- package/dist/_chunks/refractor.cjs +0 -18
- package/dist/_chunks/refractor.cjs.map +0 -1
- package/dist/_chunks/refractor.js.map +0 -1
- package/dist/_chunks/rgba.d.cts.map +0 -1
- package/dist/_chunks/rgba.d.ts +0 -929
- package/dist/_chunks/rgba.d.ts.map +0 -1
- package/dist/_visual-editing.cjs +0 -4
- package/dist/_visual-editing.d.cts +0 -2
- package/dist/_visual-editing.d.ts +0 -2
- package/dist/_visual-editing.js +0 -3
- package/dist/index.cjs +0 -3007
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -1275
- package/dist/index.d.cts.map +0 -1
- package/dist/theme.cjs +0 -54
- package/dist/theme.cjs.map +0 -1
- package/dist/theme.d.cts +0 -278
- package/dist/theme.d.cts.map +0 -1
package/dist/index.cjs
DELETED
|
@@ -1,3007 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_portalProvider = require("./_chunks/portalProvider.cjs"), require_getScopedTheme = require("./_chunks/getScopedTheme.cjs");
|
|
4
|
-
let react_compiler_runtime = require("react-compiler-runtime"), _sanity_icons_ChevronDown = require("@sanity/icons/ChevronDown"), react = require("react"), styled_components = require("styled-components"), react_jsx_runtime = require("react/jsx-runtime"), react_is = require("react-is");
|
|
5
|
-
react_is = require_portalProvider.It(react_is, 1);
|
|
6
|
-
let _sanity_icons_Spinner = require("@sanity/icons/Spinner"), motion_react = require("motion/react"), _sanity_icons_Close = require("@sanity/icons/Close"), _sanity_icons_ToggleArrowRight = require("@sanity/icons/ToggleArrowRight"), _sanity_icons_Checkmark = require("@sanity/icons/Checkmark"), _sanity_icons_Remove = require("@sanity/icons/Remove");
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
function _raf(fn) {
|
|
11
|
-
let frameId = requestAnimationFrame(fn);
|
|
12
|
-
return () => {
|
|
13
|
-
cancelAnimationFrame(frameId);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
function _raf2(fn) {
|
|
20
|
-
let innerDispose = null, outerDispose = _raf(() => {
|
|
21
|
-
innerDispose = _raf(fn);
|
|
22
|
-
});
|
|
23
|
-
return () => {
|
|
24
|
-
innerDispose && innerDispose(), outerDispose();
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @internal
|
|
29
|
-
*/
|
|
30
|
-
function _hasFocus(element) {
|
|
31
|
-
return !!document.activeElement && element.contains(document.activeElement);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
function isFocusable(element) {
|
|
37
|
-
return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : require_portalProvider.vt(element) ? !!element.href && element.rel !== "ignore" : require_portalProvider.xt(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : require_portalProvider.yt(element) || require_portalProvider.St(element) || require_portalProvider.Ct(element) ? !element.disabled : !1;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
function attemptFocus(element) {
|
|
43
|
-
if (!isFocusable(element)) return !1;
|
|
44
|
-
try {
|
|
45
|
-
element.focus();
|
|
46
|
-
} catch {}
|
|
47
|
-
return document.activeElement === element;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
52
|
-
function focusFirstDescendant(element) {
|
|
53
|
-
for (let i = 0; i < element.childNodes.length; i++) {
|
|
54
|
-
let child = element.childNodes[i];
|
|
55
|
-
if (require_portalProvider.bt(child) && (attemptFocus(child) || focusFirstDescendant(child))) return !0;
|
|
56
|
-
}
|
|
57
|
-
return !1;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
62
|
-
function focusLastDescendant(element) {
|
|
63
|
-
for (let i = element.childNodes.length - 1; i >= 0; i--) {
|
|
64
|
-
let child = element.childNodes[i];
|
|
65
|
-
if (require_portalProvider.bt(child) && (attemptFocus(child) || focusLastDescendant(child))) return !0;
|
|
66
|
-
}
|
|
67
|
-
return !1;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @internal
|
|
71
|
-
*/
|
|
72
|
-
const StyledAutocomplete = styled_components.styled.div.withConfig({
|
|
73
|
-
displayName: "StyledAutocomplete",
|
|
74
|
-
componentId: "sc-ilitn5-0"
|
|
75
|
-
})`line-height:0;`, ListBox = (0, styled_components.styled)(require_portalProvider.lt).withConfig({
|
|
76
|
-
displayName: "ListBox",
|
|
77
|
-
componentId: "sc-ilitn5-1"
|
|
78
|
-
})`& > ul{list-style:none;padding:0;margin:0;}`, rotate = styled_components.keyframes`from{transform:rotate(0deg);}to{transform:rotate(360deg);}`, AnimatedSpinnerIcon = (0, styled_components.styled)(_sanity_icons_Spinner.SpinnerIcon).withConfig({
|
|
79
|
-
displayName: "AnimatedSpinnerIcon",
|
|
80
|
-
componentId: "sc-ilitn5-2"
|
|
81
|
-
})`animation:${rotate} 500ms linear infinite;`;
|
|
82
|
-
function AutocompleteOption(props) {
|
|
83
|
-
let $ = (0, react_compiler_runtime.c)(11), { children, id, onSelect, selected, value } = props, t0;
|
|
84
|
-
$[0] !== onSelect || $[1] !== value ? (t0 = () => {
|
|
85
|
-
setTimeout(() => {
|
|
86
|
-
onSelect(value);
|
|
87
|
-
}, 0);
|
|
88
|
-
}, $[0] = onSelect, $[1] = value, $[2] = t0) : t0 = $[2];
|
|
89
|
-
let handleClick = t0, t1;
|
|
90
|
-
$[3] === handleClick ? t1 = $[4] : (t1 = (event) => {
|
|
91
|
-
event.key === "Enter" && !require_portalProvider.gt(event.currentTarget) && handleClick();
|
|
92
|
-
}, $[3] = handleClick, $[4] = t1);
|
|
93
|
-
let handleKeyDown = t1, t2;
|
|
94
|
-
return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
95
|
-
"aria-selected": selected,
|
|
96
|
-
"data-ui": "AutocompleteOption",
|
|
97
|
-
id,
|
|
98
|
-
role: "option",
|
|
99
|
-
onClick: handleClick,
|
|
100
|
-
onKeyDown: handleKeyDown,
|
|
101
|
-
children
|
|
102
|
-
}), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* @internal
|
|
106
|
-
*/
|
|
107
|
-
function autocompleteReducer(state, msg) {
|
|
108
|
-
return msg.type === "input/change" ? {
|
|
109
|
-
...state,
|
|
110
|
-
activeValue: null,
|
|
111
|
-
focused: !0,
|
|
112
|
-
query: msg.query
|
|
113
|
-
} : msg.type === "input/focus" ? {
|
|
114
|
-
...state,
|
|
115
|
-
focused: !0
|
|
116
|
-
} : msg.type === "root/blur" ? {
|
|
117
|
-
...state,
|
|
118
|
-
focused: !1,
|
|
119
|
-
query: null
|
|
120
|
-
} : msg.type === "root/clear" ? {
|
|
121
|
-
...state,
|
|
122
|
-
activeValue: null,
|
|
123
|
-
query: null,
|
|
124
|
-
value: null
|
|
125
|
-
} : msg.type === "root/escape" ? {
|
|
126
|
-
...state,
|
|
127
|
-
focused: !1,
|
|
128
|
-
query: null
|
|
129
|
-
} : msg.type === "root/open" ? {
|
|
130
|
-
...state,
|
|
131
|
-
query: state.query || msg.query
|
|
132
|
-
} : msg.type === "root/setActiveValue" ? {
|
|
133
|
-
...state,
|
|
134
|
-
activeValue: msg.value,
|
|
135
|
-
listFocused: msg.listFocused || state.listFocused
|
|
136
|
-
} : msg.type === "root/setListFocused" ? {
|
|
137
|
-
...state,
|
|
138
|
-
listFocused: msg.listFocused
|
|
139
|
-
} : msg.type === "value/change" ? {
|
|
140
|
-
...state,
|
|
141
|
-
activeValue: msg.value,
|
|
142
|
-
query: null,
|
|
143
|
-
value: msg.value
|
|
144
|
-
} : state;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* @internal
|
|
148
|
-
*/
|
|
149
|
-
const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
150
|
-
"Control",
|
|
151
|
-
"Shift",
|
|
152
|
-
"Alt",
|
|
153
|
-
"Enter",
|
|
154
|
-
"Home",
|
|
155
|
-
"End",
|
|
156
|
-
"PageUp",
|
|
157
|
-
"PageDown",
|
|
158
|
-
"Meta",
|
|
159
|
-
"Tab",
|
|
160
|
-
"CapsLock"
|
|
161
|
-
], 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 = (0, react.forwardRef)(function Autocomplete(props, forwardedRef) {
|
|
162
|
-
let $ = (0, react_compiler_runtime.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;
|
|
163
|
-
$[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);
|
|
164
|
-
let border = t0 === void 0 || t0, fontSize = t1 === void 0 ? 2 : t1, listBox = t2 === void 0 ? require_portalProvider.Tt : t2, paddingProp = t3 === void 0 ? 3 : t3, popover = t4 === void 0 ? require_portalProvider.Tt : t4, radius = t5 === void 0 ? 2 : t5, renderValue = t6 === void 0 ? DEFAULT_RENDER_VALUE : t6, t7 = valueProp || null, t8 = valueProp || null, t9;
|
|
165
|
-
$[30] !== t7 || $[31] !== t8 ? (t9 = {
|
|
166
|
-
activeValue: t7,
|
|
167
|
-
focused: !1,
|
|
168
|
-
listFocused: !1,
|
|
169
|
-
query: null,
|
|
170
|
-
value: t8
|
|
171
|
-
}, $[30] = t7, $[31] = t8, $[32] = t9) : t9 = $[32];
|
|
172
|
-
let [state, dispatch] = (0, react.useReducer)(autocompleteReducer, t9), { activeValue, focused, listFocused, query, value } = state, t10;
|
|
173
|
-
$[33] !== fontSize || $[34] !== paddingProp ? (t10 = (t11) => {
|
|
174
|
-
let { value: value_0 } = t11;
|
|
175
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.W, {
|
|
176
|
-
"data-as": "button",
|
|
177
|
-
padding: paddingProp,
|
|
178
|
-
radius: 2,
|
|
179
|
-
tone: "inherit",
|
|
180
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.et, {
|
|
181
|
-
size: fontSize,
|
|
182
|
-
textOverflow: "ellipsis",
|
|
183
|
-
children: value_0
|
|
184
|
-
})
|
|
185
|
-
});
|
|
186
|
-
}, $[33] = fontSize, $[34] = paddingProp, $[35] = t10) : t10 = $[35];
|
|
187
|
-
let renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t10, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = (0, react.useRef)(null), resultsPopoverElementRef = (0, react.useRef)(null), inputElementRef = (0, react.useRef)(null), listBoxElementRef = (0, react.useRef)(null), [inputElement, _setInputElement] = (0, react.useState)(null), t11;
|
|
188
|
-
$[36] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (node) => {
|
|
189
|
-
(0, react.startTransition)(() => _setInputElement(node));
|
|
190
|
-
}, $[36] = t11) : t11 = $[36];
|
|
191
|
-
let setInputElement = t11, listFocusedRef = (0, react.useRef)(!1), valueRef = (0, react.useRef)(value), valuePropRef = (0, react.useRef)(valueProp), popoverMouseWithinRef = (0, react.useRef)(!1), t12, t13;
|
|
192
|
-
$[37] === inputElement ? (t12 = $[38], t13 = $[39]) : (t12 = () => inputElement, t13 = [inputElement], $[37] = inputElement, $[38] = t12, $[39] = t13), (0, react.useImperativeHandle)(inputElementRef, t12, t13);
|
|
193
|
-
let t14, t15;
|
|
194
|
-
$[40] === inputElement ? (t14 = $[41], t15 = $[42]) : (t14 = () => inputElement, t15 = [inputElement], $[40] = inputElement, $[41] = t14, $[42] = t15), (0, react.useImperativeHandle)(forwardedRef, t14, t15);
|
|
195
|
-
let listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : require_portalProvider.wt, padding = require_portalProvider.ft(paddingProp), t16;
|
|
196
|
-
$[43] !== options || $[44] !== value ? (t16 = value === null ? void 0 : options.find((o) => o.value === value), $[43] = options, $[44] = value, $[45] = t16) : t16 = $[45];
|
|
197
|
-
let currentOption = t16, t17;
|
|
198
|
-
if ($[46] !== filterOption || $[47] !== options || $[48] !== query) {
|
|
199
|
-
let t18;
|
|
200
|
-
$[50] !== filterOption || $[51] !== query ? (t18 = (option) => !query || filterOption(query, option), $[50] = filterOption, $[51] = query, $[52] = t18) : t18 = $[52], t17 = options.filter(t18), $[46] = filterOption, $[47] = options, $[48] = query, $[49] = t17;
|
|
201
|
-
} else t17 = $[49];
|
|
202
|
-
let filteredOptions = t17, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, t18;
|
|
203
|
-
$[53] !== onBlur || $[54] !== onQueryChange || $[55] !== relatedElements ? (t18 = (event) => {
|
|
204
|
-
setTimeout(() => {
|
|
205
|
-
if (popoverMouseWithinRef.current) return;
|
|
206
|
-
let elements = (relatedElements || []).concat(rootElementRef.current ? [rootElementRef.current] : [], resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []), focusInside = !1;
|
|
207
|
-
if (document.activeElement) {
|
|
208
|
-
for (let e of elements) if (e === document.activeElement || e.contains(document.activeElement)) {
|
|
209
|
-
focusInside = !0;
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
focusInside === !1 && (dispatch({ type: "root/blur" }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
|
|
214
|
-
}, 0);
|
|
215
|
-
}, $[53] = onBlur, $[54] = onQueryChange, $[55] = relatedElements, $[56] = t18) : t18 = $[56];
|
|
216
|
-
let handleRootBlur = t18, t19;
|
|
217
|
-
$[57] === Symbol.for("react.memo_cache_sentinel") ? (t19 = (event_0) => {
|
|
218
|
-
let listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
|
|
219
|
-
listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
|
|
220
|
-
type: "root/setListFocused",
|
|
221
|
-
listFocused: listFocused_0
|
|
222
|
-
}));
|
|
223
|
-
}, $[57] = t19) : t19 = $[57];
|
|
224
|
-
let handleRootFocus = t19, t20;
|
|
225
|
-
$[58] !== onChange || $[59] !== onQueryChange || $[60] !== onSelect ? (t20 = (v) => {
|
|
226
|
-
dispatch({
|
|
227
|
-
type: "value/change",
|
|
228
|
-
value: v
|
|
229
|
-
}), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
230
|
-
}, $[58] = onChange, $[59] = onQueryChange, $[60] = onSelect, $[61] = t20) : t20 = $[61];
|
|
231
|
-
let handleOptionSelect = t20, t21;
|
|
232
|
-
$[62] !== activeValue || $[63] !== filteredOptions || $[64] !== filteredOptionsLen || $[65] !== onQueryChange ? (t21 = (event_1) => {
|
|
233
|
-
if (event_1.key === "ArrowDown") {
|
|
234
|
-
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
235
|
-
let activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
|
|
236
|
-
nextActiveOption && dispatch({
|
|
237
|
-
type: "root/setActiveValue",
|
|
238
|
-
value: nextActiveOption.value,
|
|
239
|
-
listFocused: !0
|
|
240
|
-
});
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
if (event_1.key === "ArrowUp") {
|
|
244
|
-
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
245
|
-
let 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];
|
|
246
|
-
nextActiveOption_0 && dispatch({
|
|
247
|
-
type: "root/setActiveValue",
|
|
248
|
-
value: nextActiveOption_0.value,
|
|
249
|
-
listFocused: !0
|
|
250
|
-
});
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
if (event_1.key === "Escape") {
|
|
254
|
-
dispatch({ type: "root/escape" }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
let target = event_1.target, listEl = listBoxElementRef.current;
|
|
258
|
-
if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)) {
|
|
259
|
-
inputElementRef.current?.focus();
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
}, $[62] = activeValue, $[63] = filteredOptions, $[64] = filteredOptionsLen, $[65] = onQueryChange, $[66] = t21) : t21 = $[66];
|
|
263
|
-
let handleRootKeyDown = t21, t22;
|
|
264
|
-
$[67] === onQueryChange ? t22 = $[68] : (t22 = (event_2) => {
|
|
265
|
-
let nextQuery = event_2.currentTarget.value;
|
|
266
|
-
dispatch({
|
|
267
|
-
type: "input/change",
|
|
268
|
-
query: nextQuery
|
|
269
|
-
}), onQueryChange && onQueryChange(nextQuery);
|
|
270
|
-
}, $[67] = onQueryChange, $[68] = t22);
|
|
271
|
-
let handleInputChange = t22, t23;
|
|
272
|
-
$[69] !== currentOption || $[70] !== renderValue || $[71] !== value ? (t23 = () => {
|
|
273
|
-
dispatch({
|
|
274
|
-
type: "root/open",
|
|
275
|
-
query: value ? renderValue(value, currentOption) : ""
|
|
276
|
-
});
|
|
277
|
-
}, $[69] = currentOption, $[70] = renderValue, $[71] = value, $[72] = t23) : t23 = $[72];
|
|
278
|
-
let dispatchOpen = t23, t24;
|
|
279
|
-
$[73] !== dispatchOpen || $[74] !== focused || $[75] !== onFocus || $[76] !== openOnFocus ? (t24 = (event_3) => {
|
|
280
|
-
focused || (dispatch({ type: "input/focus" }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
|
|
281
|
-
}, $[73] = dispatchOpen, $[74] = focused, $[75] = onFocus, $[76] = openOnFocus, $[77] = t24) : t24 = $[77];
|
|
282
|
-
let handleInputFocus = t24, t25;
|
|
283
|
-
$[78] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
|
|
284
|
-
popoverMouseWithinRef.current = !0;
|
|
285
|
-
}, $[78] = t25) : t25 = $[78];
|
|
286
|
-
let handlePopoverMouseEnter = t25, t26;
|
|
287
|
-
$[79] === Symbol.for("react.memo_cache_sentinel") ? (t26 = () => {
|
|
288
|
-
popoverMouseWithinRef.current = !1;
|
|
289
|
-
}, $[79] = t26) : t26 = $[79];
|
|
290
|
-
let handlePopoverMouseLeave = t26, t27;
|
|
291
|
-
$[80] !== onChange || $[81] !== onQueryChange ? (t27 = () => {
|
|
292
|
-
dispatch({ type: "root/clear" }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
293
|
-
}, $[80] = onChange, $[81] = onQueryChange, $[82] = t27) : t27 = $[82];
|
|
294
|
-
let handleClearButtonClick = t27, t28;
|
|
295
|
-
$[83] === Symbol.for("react.memo_cache_sentinel") ? (t28 = () => {
|
|
296
|
-
dispatch({ type: "input/focus" });
|
|
297
|
-
}, $[83] = t28) : t28 = $[83];
|
|
298
|
-
let handleClearButtonFocus = t28, t29, t30;
|
|
299
|
-
$[84] === valueProp ? (t29 = $[85], t30 = $[86]) : (t29 = () => {
|
|
300
|
-
if (valueProp !== valuePropRef.current) {
|
|
301
|
-
valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
|
|
302
|
-
type: "value/change",
|
|
303
|
-
value: valueProp
|
|
304
|
-
}), valueRef.current = valueProp);
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
valueProp !== valueRef.current && (valueRef.current = valueProp || null, dispatch({
|
|
308
|
-
type: "value/change",
|
|
309
|
-
value: valueProp || null
|
|
310
|
-
}));
|
|
311
|
-
}, t30 = [valueProp], $[84] = valueProp, $[85] = t29, $[86] = t30), (0, react.useEffect)(t29, t30);
|
|
312
|
-
let t31, t32;
|
|
313
|
-
$[87] === focused ? (t31 = $[88], t32 = $[89]) : (t31 = () => {
|
|
314
|
-
!focused && valueRef.current && dispatch({
|
|
315
|
-
type: "root/setActiveValue",
|
|
316
|
-
value: valueRef.current
|
|
317
|
-
});
|
|
318
|
-
}, t32 = [focused], $[87] = focused, $[88] = t31, $[89] = t32), (0, react.useEffect)(t31, t32);
|
|
319
|
-
let t33, t34;
|
|
320
|
-
$[90] !== activeValue || $[91] !== filteredOptions ? (t33 = () => {
|
|
321
|
-
let listElement = listBoxElementRef.current;
|
|
322
|
-
if (!listElement) return;
|
|
323
|
-
let activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
|
|
324
|
-
if (activeOption_1) {
|
|
325
|
-
let activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
|
|
326
|
-
if (activeItemElement) {
|
|
327
|
-
if (_hasFocus(activeItemElement)) return;
|
|
328
|
-
focusFirstDescendant(activeItemElement);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}, t34 = [activeValue, filteredOptions], $[90] = activeValue, $[91] = filteredOptions, $[92] = t33, $[93] = t34) : (t33 = $[92], t34 = $[93]), (0, react.useEffect)(t33, t34);
|
|
332
|
-
let t35;
|
|
333
|
-
bb0: {
|
|
334
|
-
if (!loading && !disabled && value) {
|
|
335
|
-
let t36;
|
|
336
|
-
$[94] === Symbol.for("react.memo_cache_sentinel") ? (t36 = {
|
|
337
|
-
"aria-label": "Clear",
|
|
338
|
-
onFocus: handleClearButtonFocus
|
|
339
|
-
}, $[94] = t36) : t36 = $[94], t35 = t36;
|
|
340
|
-
break bb0;
|
|
341
|
-
}
|
|
342
|
-
t35 = void 0;
|
|
343
|
-
}
|
|
344
|
-
let clearButton = t35, openButtonBoxPadding = padding.map(_temp$5), openButtonPadding = padding.map(_temp2$1), openButtonProps = typeof openButton == "object" ? openButton : require_portalProvider.Tt, t36;
|
|
345
|
-
$[95] !== dispatchOpen || $[96] !== openButtonProps ? (t36 = (event_4) => {
|
|
346
|
-
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
347
|
-
}, $[95] = dispatchOpen, $[96] = openButtonProps, $[97] = t36) : t36 = $[97];
|
|
348
|
-
let handleOpenClick = t36, t37;
|
|
349
|
-
$[98] !== disabled || $[99] !== expanded || $[100] !== fontSize || $[101] !== handleOpenClick || $[102] !== openButton || $[103] !== openButtonBoxPadding || $[104] !== openButtonPadding || $[105] !== openButtonProps || $[106] !== readOnly ? (t37 = !disabled && !readOnly && openButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.lt, {
|
|
350
|
-
"aria-hidden": expanded,
|
|
351
|
-
padding: openButtonBoxPadding,
|
|
352
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.Y, {
|
|
353
|
-
"aria-label": "Open",
|
|
354
|
-
disabled: expanded,
|
|
355
|
-
fontSize,
|
|
356
|
-
icon: _sanity_icons_ChevronDown.ChevronDownIcon,
|
|
357
|
-
mode: "bleed",
|
|
358
|
-
padding: openButtonPadding,
|
|
359
|
-
...openButtonProps,
|
|
360
|
-
onClick: handleOpenClick
|
|
361
|
-
})
|
|
362
|
-
}) : void 0, $[98] = disabled, $[99] = expanded, $[100] = fontSize, $[101] = handleOpenClick, $[102] = openButton, $[103] = openButtonBoxPadding, $[104] = openButtonPadding, $[105] = openButtonProps, $[106] = readOnly, $[107] = t37) : t37 = $[107];
|
|
363
|
-
let openButtonNode = t37, t38;
|
|
364
|
-
bb1: {
|
|
365
|
-
if (query === null) {
|
|
366
|
-
if (value !== null) {
|
|
367
|
-
let t39;
|
|
368
|
-
$[108] !== currentOption || $[109] !== renderValue || $[110] !== value ? (t39 = renderValue(value, currentOption), $[108] = currentOption, $[109] = renderValue, $[110] = value, $[111] = t39) : t39 = $[111], t38 = t39;
|
|
369
|
-
break bb1;
|
|
370
|
-
}
|
|
371
|
-
t38 = "";
|
|
372
|
-
break bb1;
|
|
373
|
-
}
|
|
374
|
-
t38 = query;
|
|
375
|
-
}
|
|
376
|
-
let inputValue = t38, t39;
|
|
377
|
-
$[112] === listFocused ? t39 = $[113] : (t39 = (event_5) => {
|
|
378
|
-
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
379
|
-
}, $[112] = listFocused, $[113] = t39);
|
|
380
|
-
let handleListBoxKeyDown = t39, t40;
|
|
381
|
-
bb2: {
|
|
382
|
-
if (filteredOptions.length === 0) {
|
|
383
|
-
t40 = null;
|
|
384
|
-
break bb2;
|
|
385
|
-
}
|
|
386
|
-
let t41;
|
|
387
|
-
if ($[114] !== activeValue || $[115] !== currentOption || $[116] !== filteredOptions || $[117] !== handleOptionSelect || $[118] !== id || $[119] !== listFocused || $[120] !== loading || $[121] !== renderOption) {
|
|
388
|
-
let t42;
|
|
389
|
-
$[123] !== activeValue || $[124] !== currentOption || $[125] !== handleOptionSelect || $[126] !== id || $[127] !== listFocused || $[128] !== loading || $[129] !== renderOption ? (t42 = (option_0) => {
|
|
390
|
-
let active = activeValue === null ? currentOption === option_0 : option_0.value === activeValue;
|
|
391
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AutocompleteOption, {
|
|
392
|
-
id: `${id}-option-${option_0.value}`,
|
|
393
|
-
onSelect: handleOptionSelect,
|
|
394
|
-
selected: active,
|
|
395
|
-
value: option_0.value,
|
|
396
|
-
children: (0, react.cloneElement)(renderOption(option_0), {
|
|
397
|
-
disabled: loading,
|
|
398
|
-
selected: active,
|
|
399
|
-
tabIndex: listFocused && active ? 0 : -1
|
|
400
|
-
})
|
|
401
|
-
}, option_0.value);
|
|
402
|
-
}, $[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;
|
|
403
|
-
} else t41 = $[122];
|
|
404
|
-
let t42;
|
|
405
|
-
$[131] !== listBoxId || $[132] !== t41 ? (t42 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.O, {
|
|
406
|
-
as: "ul",
|
|
407
|
-
"aria-multiselectable": !1,
|
|
408
|
-
"data-ui": "AutoComplete__resultsList",
|
|
409
|
-
id: listBoxId,
|
|
410
|
-
ref: listBoxElementRef,
|
|
411
|
-
role: "listbox",
|
|
412
|
-
gap: 1,
|
|
413
|
-
children: t41
|
|
414
|
-
}), $[131] = listBoxId, $[132] = t41, $[133] = t42) : t42 = $[133];
|
|
415
|
-
let t43;
|
|
416
|
-
$[134] !== handleListBoxKeyDown || $[135] !== listBox || $[136] !== t42 ? (t43 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ListBox, {
|
|
417
|
-
"data-ui": "AutoComplete__results",
|
|
418
|
-
onKeyDown: handleListBoxKeyDown,
|
|
419
|
-
padding: 1,
|
|
420
|
-
...listBox,
|
|
421
|
-
tabIndex: -1,
|
|
422
|
-
children: t42
|
|
423
|
-
}), $[134] = handleListBoxKeyDown, $[135] = listBox, $[136] = t42, $[137] = t43) : t43 = $[137], t40 = t43;
|
|
424
|
-
}
|
|
425
|
-
let content = t40, t41;
|
|
426
|
-
bb3: {
|
|
427
|
-
if (renderPopover) {
|
|
428
|
-
let t42 = !expanded, t43;
|
|
429
|
-
$[138] !== content || $[139] !== handlePopoverMouseEnter || $[140] !== handlePopoverMouseLeave || $[141] !== inputElement || $[142] !== renderPopover || $[143] !== t42 ? (t43 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RenderPopover, {
|
|
430
|
-
content,
|
|
431
|
-
hidden: t42,
|
|
432
|
-
inputElement,
|
|
433
|
-
onMouseEnter: handlePopoverMouseEnter,
|
|
434
|
-
onMouseLeave: handlePopoverMouseLeave,
|
|
435
|
-
resultsPopoverElementRef,
|
|
436
|
-
renderPopover
|
|
437
|
-
}), $[138] = content, $[139] = handlePopoverMouseEnter, $[140] = handlePopoverMouseLeave, $[141] = inputElement, $[142] = renderPopover, $[143] = t42, $[144] = t43) : t43 = $[144], t41 = t43;
|
|
438
|
-
break bb3;
|
|
439
|
-
}
|
|
440
|
-
if (filteredOptionsLen === 0) {
|
|
441
|
-
t41 = null;
|
|
442
|
-
break bb3;
|
|
443
|
-
}
|
|
444
|
-
let t42;
|
|
445
|
-
$[145] !== content || $[146] !== expanded || $[147] !== handlePopoverMouseEnter || $[148] !== handlePopoverMouseLeave || $[149] !== inputElement || $[150] !== popover || $[151] !== radius ? (t42 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.k, {
|
|
446
|
-
arrow: !1,
|
|
447
|
-
constrainSize: !0,
|
|
448
|
-
content,
|
|
449
|
-
fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS,
|
|
450
|
-
matchReferenceWidth: !0,
|
|
451
|
-
onMouseEnter: handlePopoverMouseEnter,
|
|
452
|
-
onMouseLeave: handlePopoverMouseLeave,
|
|
453
|
-
open: expanded,
|
|
454
|
-
overflow: "auto",
|
|
455
|
-
placement: "bottom-start",
|
|
456
|
-
portal: !0,
|
|
457
|
-
radius,
|
|
458
|
-
ref: resultsPopoverElementRef,
|
|
459
|
-
referenceElement: inputElement,
|
|
460
|
-
...popover
|
|
461
|
-
}), $[145] = content, $[146] = expanded, $[147] = handlePopoverMouseEnter, $[148] = handlePopoverMouseLeave, $[149] = inputElement, $[150] = popover, $[151] = radius, $[152] = t42) : t42 = $[152], t41 = t42;
|
|
462
|
-
}
|
|
463
|
-
let results = t41, t42 = loading && AnimatedSpinnerIcon, t43 = suffix || openButtonNode, t44;
|
|
464
|
-
$[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__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.b, {
|
|
465
|
-
...restProps,
|
|
466
|
-
"aria-activedescendant": activeItemId,
|
|
467
|
-
"aria-autocomplete": "list",
|
|
468
|
-
"aria-expanded": expanded,
|
|
469
|
-
"aria-owns": listBoxId,
|
|
470
|
-
autoCapitalize: "off",
|
|
471
|
-
autoComplete: "off",
|
|
472
|
-
autoCorrect: "off",
|
|
473
|
-
border,
|
|
474
|
-
clearButton,
|
|
475
|
-
customValidity,
|
|
476
|
-
disabled,
|
|
477
|
-
fontSize,
|
|
478
|
-
icon,
|
|
479
|
-
iconRight: t42,
|
|
480
|
-
id,
|
|
481
|
-
inputMode: "search",
|
|
482
|
-
onChange: handleInputChange,
|
|
483
|
-
onClear: handleClearButtonClick,
|
|
484
|
-
onFocus: handleInputFocus,
|
|
485
|
-
padding,
|
|
486
|
-
prefix,
|
|
487
|
-
radius,
|
|
488
|
-
readOnly,
|
|
489
|
-
ref: setInputElement,
|
|
490
|
-
role: "combobox",
|
|
491
|
-
spellCheck: !1,
|
|
492
|
-
suffix: t43,
|
|
493
|
-
value: inputValue
|
|
494
|
-
}), $[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];
|
|
495
|
-
let t45;
|
|
496
|
-
return $[175] !== handleRootBlur || $[176] !== handleRootFocus || $[177] !== handleRootKeyDown || $[178] !== results || $[179] !== t44 ? (t45 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledAutocomplete, {
|
|
497
|
-
"data-ui": "Autocomplete",
|
|
498
|
-
onBlur: handleRootBlur,
|
|
499
|
-
onFocus: handleRootFocus,
|
|
500
|
-
onKeyDown: handleRootKeyDown,
|
|
501
|
-
ref: rootElementRef,
|
|
502
|
-
children: [t44, results]
|
|
503
|
-
}), $[175] = handleRootBlur, $[176] = handleRootFocus, $[177] = handleRootKeyDown, $[178] = results, $[179] = t44, $[180] = t45) : t45 = $[180], t45;
|
|
504
|
-
});
|
|
505
|
-
function RenderPopover({ renderPopover, content, hidden, inputElement, onMouseEnter, onMouseLeave, resultsPopoverElementRef }) {
|
|
506
|
-
return renderPopover({
|
|
507
|
-
content,
|
|
508
|
-
hidden,
|
|
509
|
-
inputElement,
|
|
510
|
-
onMouseEnter,
|
|
511
|
-
onMouseLeave
|
|
512
|
-
}, resultsPopoverElementRef);
|
|
513
|
-
}
|
|
514
|
-
/**
|
|
515
|
-
* The Autocomplete component is typically used for search components.
|
|
516
|
-
* It consists of a text input for writing a query, and properties for rendering suggestions.
|
|
517
|
-
*
|
|
518
|
-
* @public
|
|
519
|
-
*/
|
|
520
|
-
const Autocomplete = InnerAutocomplete;
|
|
521
|
-
function _temp$5(v_0) {
|
|
522
|
-
return v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2;
|
|
523
|
-
}
|
|
524
|
-
function _temp2$1(v_1) {
|
|
525
|
-
return Math.max(v_1 - 1, 0);
|
|
526
|
-
}
|
|
527
|
-
const StyledBreadcrumbs = styled_components.styled.ol.withConfig({
|
|
528
|
-
displayName: "StyledBreadcrumbs",
|
|
529
|
-
componentId: "sc-s3y9xo-0"
|
|
530
|
-
})`margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;`, ExpandButton = (0, styled_components.styled)(require_portalProvider.Y).withConfig({
|
|
531
|
-
displayName: "ExpandButton",
|
|
532
|
-
componentId: "sc-s3y9xo-1"
|
|
533
|
-
})`appearance:none;margin:-4px;`, Breadcrumbs = (0, react.forwardRef)(function Breadcrumbs(props, ref) {
|
|
534
|
-
let $ = (0, react_compiler_runtime.c)(30), children, gap, maxLength, restProps, separator, t0;
|
|
535
|
-
$[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);
|
|
536
|
-
let t1 = gap === void 0 ? t0 === void 0 ? 2 : t0 : gap, t2;
|
|
537
|
-
$[7] === t1 ? t2 = $[8] : (t2 = require_portalProvider.ft(t1), $[7] = t1, $[8] = t2);
|
|
538
|
-
let space = t2, [open, setOpen] = (0, react.useState)(!1), expandElementRef = (0, react.useRef)(null), popoverElementRef = (0, react.useRef)(null), t3;
|
|
539
|
-
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => setOpen(!1), $[9] = t3) : t3 = $[9];
|
|
540
|
-
let collapse = t3, t4;
|
|
541
|
-
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => setOpen(!0), $[10] = t4) : t4 = $[10];
|
|
542
|
-
let expand = t4, t5;
|
|
543
|
-
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => [expandElementRef.current, popoverElementRef.current], $[11] = t5) : t5 = $[11], require_portalProvider.y(collapse, t5);
|
|
544
|
-
let t6;
|
|
545
|
-
$[12] === children ? t6 = $[13] : (t6 = react.Children.toArray(children).filter(react.isValidElement), $[12] = children, $[13] = t6);
|
|
546
|
-
let rawItems = t6, t7;
|
|
547
|
-
$[14] !== maxLength || $[15] !== open || $[16] !== rawItems || $[17] !== space ? (t7 = {
|
|
548
|
-
collapse,
|
|
549
|
-
expand,
|
|
550
|
-
expandElementRef,
|
|
551
|
-
maxLength,
|
|
552
|
-
open,
|
|
553
|
-
popoverElementRef,
|
|
554
|
-
rawItems,
|
|
555
|
-
space
|
|
556
|
-
}, $[14] = maxLength, $[15] = open, $[16] = rawItems, $[17] = space, $[18] = t7) : t7 = $[18];
|
|
557
|
-
let items = useItems(t7), t8;
|
|
558
|
-
if ($[19] !== items || $[20] !== separator || $[21] !== space) {
|
|
559
|
-
let t9;
|
|
560
|
-
$[23] !== separator || $[24] !== space ? (t9 = (item, itemIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [itemIndex > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.lt, {
|
|
561
|
-
"aria-hidden": !0,
|
|
562
|
-
as: "li",
|
|
563
|
-
paddingX: space,
|
|
564
|
-
children: separator || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.et, {
|
|
565
|
-
muted: !0,
|
|
566
|
-
children: "/"
|
|
567
|
-
})
|
|
568
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.lt, {
|
|
569
|
-
as: "li",
|
|
570
|
-
children: item
|
|
571
|
-
})] }, itemIndex), $[23] = separator, $[24] = space, $[25] = t9) : t9 = $[25], t8 = items.map(t9), $[19] = items, $[20] = separator, $[21] = space, $[22] = t8;
|
|
572
|
-
} else t8 = $[22];
|
|
573
|
-
let t9;
|
|
574
|
-
return $[26] !== ref || $[27] !== restProps || $[28] !== t8 ? (t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledBreadcrumbs, {
|
|
575
|
-
"data-ui": "Breadcrumbs",
|
|
576
|
-
...restProps,
|
|
577
|
-
ref,
|
|
578
|
-
children: t8
|
|
579
|
-
}), $[26] = ref, $[27] = restProps, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
|
|
580
|
-
});
|
|
581
|
-
function useItems(t0) {
|
|
582
|
-
let $ = (0, react_compiler_runtime.c)(28), { collapse, expand, expandElementRef, maxLength, open, popoverElementRef, rawItems, space } = t0, len = rawItems.length;
|
|
583
|
-
if (maxLength && len > maxLength) {
|
|
584
|
-
let beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2), t1;
|
|
585
|
-
if ($[0] !== afterLength || $[1] !== beforeLength || $[2] !== collapse || $[3] !== expand || $[4] !== expandElementRef || $[5] !== len || $[6] !== open || $[7] !== popoverElementRef || $[8] !== rawItems || $[9] !== space) {
|
|
586
|
-
let t2 = rawItems.slice(0, beforeLength - 1), t3;
|
|
587
|
-
$[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];
|
|
588
|
-
let t4;
|
|
589
|
-
$[16] !== space || $[17] !== t3 ? (t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.O, {
|
|
590
|
-
as: "ol",
|
|
591
|
-
overflow: "auto",
|
|
592
|
-
padding: space,
|
|
593
|
-
gap: space,
|
|
594
|
-
children: t3
|
|
595
|
-
}), $[16] = space, $[17] = t3, $[18] = t4) : t4 = $[18];
|
|
596
|
-
let t5 = open ? collapse : expand, t6;
|
|
597
|
-
$[19] !== expandElementRef || $[20] !== open || $[21] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandButton, {
|
|
598
|
-
fontSize: 1,
|
|
599
|
-
mode: "bleed",
|
|
600
|
-
onClick: t5,
|
|
601
|
-
padding: 1,
|
|
602
|
-
ref: expandElementRef,
|
|
603
|
-
selected: open,
|
|
604
|
-
text: "…"
|
|
605
|
-
}), $[19] = expandElementRef, $[20] = open, $[21] = t5, $[22] = t6) : t6 = $[22];
|
|
606
|
-
let t7;
|
|
607
|
-
$[23] !== open || $[24] !== popoverElementRef || $[25] !== t4 || $[26] !== t6 ? (t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.k, {
|
|
608
|
-
constrainSize: !0,
|
|
609
|
-
content: t4,
|
|
610
|
-
open,
|
|
611
|
-
placement: "top",
|
|
612
|
-
portal: !0,
|
|
613
|
-
ref: popoverElementRef,
|
|
614
|
-
children: t6
|
|
615
|
-
}, "button"), $[23] = open, $[24] = popoverElementRef, $[25] = t4, $[26] = t6, $[27] = t7) : t7 = $[27], t1 = [
|
|
616
|
-
...t2,
|
|
617
|
-
t7,
|
|
618
|
-
...rawItems.slice(len - afterLength)
|
|
619
|
-
], $[0] = afterLength, $[1] = beforeLength, $[2] = collapse, $[3] = expand, $[4] = expandElementRef, $[5] = len, $[6] = open, $[7] = popoverElementRef, $[8] = rawItems, $[9] = space, $[10] = t1;
|
|
620
|
-
} else t1 = $[10];
|
|
621
|
-
return t1;
|
|
622
|
-
}
|
|
623
|
-
return rawItems;
|
|
624
|
-
}
|
|
625
|
-
const BASE_STYLE = {
|
|
626
|
-
width: "100%",
|
|
627
|
-
margin: "0 auto"
|
|
628
|
-
};
|
|
629
|
-
function containerBaseStyle() {
|
|
630
|
-
return BASE_STYLE;
|
|
631
|
-
}
|
|
632
|
-
function responsiveContainerWidthStyle(props) {
|
|
633
|
-
let { container, media } = require_getScopedTheme.i(props.theme);
|
|
634
|
-
return require_portalProvider.mt(media, props.$width, (val) => ({ maxWidth: val === "auto" ? "none" : require_portalProvider.ht(container[val]) }));
|
|
635
|
-
}
|
|
636
|
-
const StyledContainer = /* @__PURE__ */ (0, styled_components.styled)(require_portalProvider.lt).withConfig({
|
|
637
|
-
displayName: "StyledContainer",
|
|
638
|
-
componentId: "sc-nbeafu-0"
|
|
639
|
-
})(containerBaseStyle, responsiveContainerWidthStyle), Container = (0, react.forwardRef)(function Container(props, ref) {
|
|
640
|
-
let $ = (0, react_compiler_runtime.c)(11), as, restProps, t0;
|
|
641
|
-
$[0] === props ? (as = $[1], restProps = $[2], t0 = $[3]) : ({as, width: t0, ...restProps} = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = t0);
|
|
642
|
-
let width = t0 === void 0 ? 2 : t0, t1;
|
|
643
|
-
$[4] === width ? t1 = $[5] : (t1 = require_portalProvider.ft(width), $[4] = width, $[5] = t1);
|
|
644
|
-
let t2;
|
|
645
|
-
return $[6] !== as || $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledContainer, {
|
|
646
|
-
"data-ui": "Container",
|
|
647
|
-
...restProps,
|
|
648
|
-
$width: t1,
|
|
649
|
-
forwardedAs: as,
|
|
650
|
-
ref
|
|
651
|
-
}), $[6] = as, $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
|
|
652
|
-
});
|
|
653
|
-
function dialogStyle({ theme }) {
|
|
654
|
-
let { color } = require_getScopedTheme.i(theme);
|
|
655
|
-
return {
|
|
656
|
-
"&:not([hidden])": { display: "flex" },
|
|
657
|
-
top: 0,
|
|
658
|
-
left: 0,
|
|
659
|
-
right: 0,
|
|
660
|
-
bottom: 0,
|
|
661
|
-
alignItems: "center",
|
|
662
|
-
justifyContent: "center",
|
|
663
|
-
outline: "none",
|
|
664
|
-
background: color.backdrop
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
function responsiveDialogPositionStyle(props) {
|
|
668
|
-
let { media } = require_getScopedTheme.i(props.theme);
|
|
669
|
-
return require_portalProvider.mt(media, props.$position, (position) => ({ "&&": { position } }));
|
|
670
|
-
}
|
|
671
|
-
function animationDialogStyle(props) {
|
|
672
|
-
return props.$animate ? styled_components.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;}` : styled_components.css``;
|
|
673
|
-
}
|
|
674
|
-
/**
|
|
675
|
-
* @internal
|
|
676
|
-
*/
|
|
677
|
-
const DialogContext = require_portalProvider.J("@sanity/ui/context/dialog", { version: 0 });
|
|
678
|
-
/**
|
|
679
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
680
|
-
* @beta
|
|
681
|
-
*/
|
|
682
|
-
function useDialog() {
|
|
683
|
-
return (0, react.useContext)(DialogContext);
|
|
684
|
-
}
|
|
685
|
-
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
686
|
-
return !boundaryElement || !portalElement || require_portalProvider._t(boundaryElement, target) || require_portalProvider._t(portalElement, target);
|
|
687
|
-
}
|
|
688
|
-
const StyledDialog = /* @__PURE__ */ (0, styled_components.styled)(require_portalProvider._).withConfig({
|
|
689
|
-
displayName: "StyledDialog",
|
|
690
|
-
componentId: "sc-x279l-0"
|
|
691
|
-
})(require_portalProvider.ut, dialogStyle, responsiveDialogPositionStyle, animationDialogStyle), DialogContainer = (0, styled_components.styled)(Container).withConfig({
|
|
692
|
-
displayName: "DialogContainer",
|
|
693
|
-
componentId: "sc-x279l-1"
|
|
694
|
-
})`&:not([hidden]){display:flex;}width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;`, DialogCardRoot = (0, styled_components.styled)(require_portalProvider.W).withConfig({
|
|
695
|
-
displayName: "DialogCardRoot",
|
|
696
|
-
componentId: "sc-x279l-2"
|
|
697
|
-
})`&:not([hidden]){display:flex;}width:100%;min-height:0;max-height:100%;overflow:hidden;overflow:clip;`, DialogLayout = (0, styled_components.styled)(require_portalProvider.at).withConfig({
|
|
698
|
-
displayName: "DialogLayout",
|
|
699
|
-
componentId: "sc-x279l-3"
|
|
700
|
-
})`flex:1;min-height:0;width:100%;`, DialogHeader = (0, styled_components.styled)(require_portalProvider.lt).withConfig({
|
|
701
|
-
displayName: "DialogHeader",
|
|
702
|
-
componentId: "sc-x279l-4"
|
|
703
|
-
})`position:relative;z-index:2;`, DialogContent = (0, styled_components.styled)(require_portalProvider.lt).withConfig({
|
|
704
|
-
displayName: "DialogContent",
|
|
705
|
-
componentId: "sc-x279l-5"
|
|
706
|
-
})`position:relative;z-index:1;overflow:auto;outline:none;`, DialogFooter = (0, styled_components.styled)(require_portalProvider.lt).withConfig({
|
|
707
|
-
displayName: "DialogFooter",
|
|
708
|
-
componentId: "sc-x279l-6"
|
|
709
|
-
})`position:relative;z-index:3;`, DialogCard = (0, react.forwardRef)(function DialogCard(props, forwardedRef) {
|
|
710
|
-
let $ = (0, react_compiler_runtime.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 = require_portalProvider.M(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = require_portalProvider.F().element, t0;
|
|
711
|
-
$[0] === radiusProp ? t0 = $[1] : (t0 = require_portalProvider.ft(radiusProp), $[0] = radiusProp, $[1] = t0);
|
|
712
|
-
let radius = t0, t1;
|
|
713
|
-
$[2] === shadowProp ? t1 = $[3] : (t1 = require_portalProvider.ft(shadowProp), $[2] = shadowProp, $[3] = t1);
|
|
714
|
-
let shadow = t1, t2;
|
|
715
|
-
$[4] === widthProp ? t2 = $[5] : (t2 = require_portalProvider.ft(widthProp), $[4] = widthProp, $[5] = t2);
|
|
716
|
-
let width = t2, ref = (0, react.useRef)(null), contentRef = (0, react.useRef)(null), { isTopLayer } = require_portalProvider.N(), labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton, t3;
|
|
717
|
-
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => ref.current, $[6] = t3) : t3 = $[6], (0, react.useImperativeHandle)(forwardedRef, t3);
|
|
718
|
-
let t4;
|
|
719
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => contentRef.current, $[7] = t4) : t4 = $[7], (0, react.useImperativeHandle)(forwardedContentRef, t4);
|
|
720
|
-
let t5, t6;
|
|
721
|
-
$[8] === autoFocus ? (t5 = $[9], t6 = $[10]) : (t5 = () => {
|
|
722
|
-
autoFocus && ref.current && focusFirstDescendant(ref.current);
|
|
723
|
-
}, t6 = [autoFocus, ref], $[8] = autoFocus, $[9] = t5, $[10] = t6), (0, react.useEffect)(t5, t6);
|
|
724
|
-
let t7;
|
|
725
|
-
$[11] !== boundaryElement || $[12] !== isTopLayer || $[13] !== onClose || $[14] !== portalElement ? (t7 = (event) => {
|
|
726
|
-
if (!isTopLayer || !onClose) return;
|
|
727
|
-
let target = document.activeElement;
|
|
728
|
-
target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
|
|
729
|
-
}, $[11] = boundaryElement, $[12] = isTopLayer, $[13] = onClose, $[14] = portalElement, $[15] = t7) : t7 = $[15], require_portalProvider.v(t7);
|
|
730
|
-
let t8;
|
|
731
|
-
$[16] !== boundaryElement || $[17] !== isTopLayer || $[18] !== onClickOutside || $[19] !== portalElement ? (t8 = isTopLayer && onClickOutside && ((event_0) => {
|
|
732
|
-
let target_0 = event_0.target;
|
|
733
|
-
target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
|
|
734
|
-
}), $[16] = boundaryElement, $[17] = isTopLayer, $[18] = onClickOutside, $[19] = portalElement, $[20] = t8) : t8 = $[20];
|
|
735
|
-
let t9;
|
|
736
|
-
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[21] = t9) : t9 = $[21], require_portalProvider.y(t8, t9);
|
|
737
|
-
let t10;
|
|
738
|
-
$[22] !== header || $[23] !== labelId || $[24] !== onClose || $[25] !== showCloseButton || $[26] !== showHeader ? (t10 = showHeader && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_portalProvider.at, {
|
|
739
|
-
align: "flex-start",
|
|
740
|
-
padding: 3,
|
|
741
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.lt, {
|
|
742
|
-
flex: 1,
|
|
743
|
-
padding: 2,
|
|
744
|
-
children: header && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.et, {
|
|
745
|
-
id: labelId,
|
|
746
|
-
size: 1,
|
|
747
|
-
weight: "semibold",
|
|
748
|
-
children: header
|
|
749
|
-
})
|
|
750
|
-
}), showCloseButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.lt, {
|
|
751
|
-
flex: "none",
|
|
752
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.Y, {
|
|
753
|
-
"aria-label": "Close dialog",
|
|
754
|
-
disabled: !onClose,
|
|
755
|
-
icon: _sanity_icons_Close.CloseIcon,
|
|
756
|
-
mode: "bleed",
|
|
757
|
-
onClick: onClose,
|
|
758
|
-
padding: 2
|
|
759
|
-
})
|
|
760
|
-
})]
|
|
761
|
-
}) }), $[22] = header, $[23] = labelId, $[24] = onClose, $[25] = showCloseButton, $[26] = showHeader, $[27] = t10) : t10 = $[27];
|
|
762
|
-
let t11;
|
|
763
|
-
$[28] === children ? t11 = $[29] : (t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogContent, {
|
|
764
|
-
flex: 1,
|
|
765
|
-
ref: contentRef,
|
|
766
|
-
tabIndex: -1,
|
|
767
|
-
children
|
|
768
|
-
}), $[28] = children, $[29] = t11);
|
|
769
|
-
let t12;
|
|
770
|
-
$[30] === footer ? t12 = $[31] : (t12 = footer && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogFooter, { children: footer }), $[30] = footer, $[31] = t12);
|
|
771
|
-
let t13;
|
|
772
|
-
$[32] !== t10 || $[33] !== t11 || $[34] !== t12 ? (t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DialogLayout, {
|
|
773
|
-
direction: "column",
|
|
774
|
-
children: [
|
|
775
|
-
t10,
|
|
776
|
-
t11,
|
|
777
|
-
t12
|
|
778
|
-
]
|
|
779
|
-
}), $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13) : t13 = $[35];
|
|
780
|
-
let t14;
|
|
781
|
-
$[36] !== radius || $[37] !== scheme || $[38] !== shadow || $[39] !== t13 ? (t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogCardRoot, {
|
|
782
|
-
radius,
|
|
783
|
-
ref,
|
|
784
|
-
scheme,
|
|
785
|
-
shadow,
|
|
786
|
-
children: t13
|
|
787
|
-
}), $[36] = radius, $[37] = scheme, $[38] = shadow, $[39] = t13, $[40] = t14) : t14 = $[40];
|
|
788
|
-
let t15;
|
|
789
|
-
return $[41] !== t14 || $[42] !== width ? (t15 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogContainer, {
|
|
790
|
-
"data-ui": "DialogCard",
|
|
791
|
-
width,
|
|
792
|
-
children: t14
|
|
793
|
-
}), $[41] = t14, $[42] = width, $[43] = t15) : t15 = $[43], t15;
|
|
794
|
-
}), Dialog = (0, react.forwardRef)(function Dialog(props, ref) {
|
|
795
|
-
let $ = (0, react_compiler_runtime.c)(70), dialog = useDialog(), { layer } = require_portalProvider.st(), _positionProp, _zOffsetProp, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, t6;
|
|
796
|
-
$[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);
|
|
797
|
-
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 = !require_portalProvider.R() && _animate, portal = require_portalProvider.M(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = require_portalProvider.F().element, t7;
|
|
798
|
-
$[22] === cardRadiusProp ? t7 = $[23] : (t7 = require_portalProvider.ft(cardRadiusProp), $[22] = cardRadiusProp, $[23] = t7);
|
|
799
|
-
let cardRadius = t7, t8;
|
|
800
|
-
$[24] === paddingProp ? t8 = $[25] : (t8 = require_portalProvider.ft(paddingProp), $[24] = paddingProp, $[25] = t8);
|
|
801
|
-
let padding = t8, t9;
|
|
802
|
-
$[26] === positionProp ? t9 = $[27] : (t9 = require_portalProvider.ft(positionProp), $[26] = positionProp, $[27] = t9);
|
|
803
|
-
let position = t9, t10;
|
|
804
|
-
$[28] === widthProp ? t10 = $[29] : (t10 = require_portalProvider.ft(widthProp), $[28] = widthProp, $[29] = t10);
|
|
805
|
-
let width = t10, t11;
|
|
806
|
-
$[30] === zOffsetProp ? t11 = $[31] : (t11 = require_portalProvider.ft(zOffsetProp), $[30] = zOffsetProp, $[31] = t11);
|
|
807
|
-
let zOffset = t11, preDivRef = (0, react.useRef)(null), postDivRef = (0, react.useRef)(null), cardRef = (0, react.useRef)(null), focusedElementRef = (0, react.useRef)(null), t12;
|
|
808
|
-
$[32] === onFocus ? t12 = $[33] : (t12 = (event) => {
|
|
809
|
-
onFocus?.(event);
|
|
810
|
-
let target = event.target, cardElement = cardRef.current;
|
|
811
|
-
if (cardElement && target === preDivRef.current) {
|
|
812
|
-
focusLastDescendant(cardElement);
|
|
813
|
-
return;
|
|
814
|
-
}
|
|
815
|
-
if (cardElement && target === postDivRef.current) {
|
|
816
|
-
focusFirstDescendant(cardElement);
|
|
817
|
-
return;
|
|
818
|
-
}
|
|
819
|
-
require_portalProvider.bt(event.target) && (focusedElementRef.current = event.target);
|
|
820
|
-
}, $[32] = onFocus, $[33] = t12);
|
|
821
|
-
let handleFocus = t12, labelId = `${id}_label`, rootClickTimeoutRef = (0, react.useRef)(void 0), t13;
|
|
822
|
-
$[34] !== boundaryElement || $[35] !== portalElement ? (t13 = () => {
|
|
823
|
-
rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
|
|
824
|
-
let activeElement = document.activeElement;
|
|
825
|
-
if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
|
|
826
|
-
let target_0 = focusedElementRef.current;
|
|
827
|
-
if (!target_0 || !document.body.contains(target_0)) {
|
|
828
|
-
let cardElement_0 = cardRef.current;
|
|
829
|
-
cardElement_0 && focusFirstDescendant(cardElement_0);
|
|
830
|
-
return;
|
|
831
|
-
}
|
|
832
|
-
target_0.focus();
|
|
833
|
-
}
|
|
834
|
-
}, 0);
|
|
835
|
-
}, $[34] = boundaryElement, $[35] = portalElement, $[36] = t13) : t13 = $[36];
|
|
836
|
-
let handleRootClick = t13, t14;
|
|
837
|
-
$[37] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
838
|
-
ref: preDivRef,
|
|
839
|
-
tabIndex: 0
|
|
840
|
-
}), $[37] = t14) : t14 = $[37];
|
|
841
|
-
let t15;
|
|
842
|
-
$[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__ */ (0, react_jsx_runtime.jsx)(DialogCard, {
|
|
843
|
-
__unstable_autoFocus: autoFocus,
|
|
844
|
-
__unstable_hideCloseButton: hideCloseButton,
|
|
845
|
-
contentRef,
|
|
846
|
-
footer,
|
|
847
|
-
header,
|
|
848
|
-
id,
|
|
849
|
-
onClickOutside,
|
|
850
|
-
onClose,
|
|
851
|
-
portal: portalProp,
|
|
852
|
-
radius: cardRadius,
|
|
853
|
-
ref: cardRef,
|
|
854
|
-
scheme,
|
|
855
|
-
shadow: cardShadow,
|
|
856
|
-
width,
|
|
857
|
-
children
|
|
858
|
-
}), $[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];
|
|
859
|
-
let t16;
|
|
860
|
-
$[53] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
861
|
-
ref: postDivRef,
|
|
862
|
-
tabIndex: 0
|
|
863
|
-
}), $[53] = t16) : t16 = $[53];
|
|
864
|
-
let t17;
|
|
865
|
-
$[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__ */ (0, react_jsx_runtime.jsxs)(StyledDialog, {
|
|
866
|
-
...restProps,
|
|
867
|
-
$animate: animate,
|
|
868
|
-
$padding: padding,
|
|
869
|
-
$position: position,
|
|
870
|
-
"aria-labelledby": labelId,
|
|
871
|
-
"aria-modal": !0,
|
|
872
|
-
"data-ui": "Dialog",
|
|
873
|
-
id,
|
|
874
|
-
onActivate,
|
|
875
|
-
onClick: handleRootClick,
|
|
876
|
-
onFocus: handleFocus,
|
|
877
|
-
ref,
|
|
878
|
-
role: "dialog",
|
|
879
|
-
zOffset,
|
|
880
|
-
children: [
|
|
881
|
-
t14,
|
|
882
|
-
t15,
|
|
883
|
-
t16
|
|
884
|
-
]
|
|
885
|
-
}), $[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];
|
|
886
|
-
let t18;
|
|
887
|
-
return $[67] !== portalProp || $[68] !== t17 ? (t18 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.j, {
|
|
888
|
-
__unstable_name: portalProp,
|
|
889
|
-
children: t17
|
|
890
|
-
}), $[67] = portalProp, $[68] = t17, $[69] = t18) : t18 = $[69], t18;
|
|
891
|
-
});
|
|
892
|
-
/**
|
|
893
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
894
|
-
* @beta
|
|
895
|
-
*/
|
|
896
|
-
function DialogProvider(props) {
|
|
897
|
-
let $ = (0, react_compiler_runtime.c)(6), { children, position, zOffset } = props, t0;
|
|
898
|
-
$[0] !== position || $[1] !== zOffset ? (t0 = {
|
|
899
|
-
version: 0,
|
|
900
|
-
position,
|
|
901
|
-
zOffset
|
|
902
|
-
}, $[0] = position, $[1] = zOffset, $[2] = t0) : t0 = $[2];
|
|
903
|
-
let contextValue = t0, t1;
|
|
904
|
-
return $[3] !== children || $[4] !== contextValue ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogContext.Provider, {
|
|
905
|
-
value: contextValue,
|
|
906
|
-
children
|
|
907
|
-
}), $[3] = children, $[4] = contextValue, $[5] = t1) : t1 = $[5], t1;
|
|
908
|
-
}
|
|
909
|
-
/**
|
|
910
|
-
* The `MenuButton` component follows the WAI-ARIA specification for menu buttons.
|
|
911
|
-
*
|
|
912
|
-
* @public
|
|
913
|
-
*/
|
|
914
|
-
const MenuButton = (0, react.forwardRef)(function MenuButton(props, forwardedRef) {
|
|
915
|
-
let $ = (0, react_compiler_runtime.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] = (0, react.useState)(!1), [shouldFocus, setShouldFocus] = (0, react.useState)(null), [buttonElement, setButtonElement] = (0, react.useState)(null), t2;
|
|
916
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
|
|
917
|
-
let [menuElements, setChildMenuElements] = (0, react.useState)(t2), openRef = (0, react.useRef)(open), t3, t4;
|
|
918
|
-
$[1] !== onOpen || $[2] !== open ? (t3 = () => {
|
|
919
|
-
onOpen && open && !openRef.current && onOpen();
|
|
920
|
-
}, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), (0, react.useEffect)(t3, t4);
|
|
921
|
-
let t5, t6;
|
|
922
|
-
$[5] !== onClose || $[6] !== open ? (t5 = () => {
|
|
923
|
-
onClose && !open && openRef.current && onClose();
|
|
924
|
-
}, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), (0, react.useEffect)(t5, t6);
|
|
925
|
-
let t7, t8;
|
|
926
|
-
$[9] === open ? (t7 = $[10], t8 = $[11]) : (t7 = () => {
|
|
927
|
-
openRef.current = open;
|
|
928
|
-
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8), (0, react.useEffect)(t7, t8);
|
|
929
|
-
let t9;
|
|
930
|
-
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
931
|
-
setOpen(_temp$4), setShouldFocus(null);
|
|
932
|
-
}, $[12] = t9) : t9 = $[12];
|
|
933
|
-
let handleButtonClick = t9, t10;
|
|
934
|
-
$[13] === open ? t10 = $[14] : (t10 = (event) => {
|
|
935
|
-
open && event.preventDefault();
|
|
936
|
-
}, $[13] = open, $[14] = t10);
|
|
937
|
-
let handleMouseDown = t10, t11;
|
|
938
|
-
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (event_0) => {
|
|
939
|
-
if (event_0.key === "ArrowDown" || event_0.key === "Enter" || event_0.key === " ") {
|
|
940
|
-
event_0.preventDefault(), setOpen(!0), setShouldFocus("first");
|
|
941
|
-
return;
|
|
942
|
-
}
|
|
943
|
-
if (event_0.key === "ArrowUp") {
|
|
944
|
-
event_0.preventDefault(), setOpen(!0), setShouldFocus("last");
|
|
945
|
-
return;
|
|
946
|
-
}
|
|
947
|
-
}, $[15] = t11) : t11 = $[15];
|
|
948
|
-
let handleButtonKeyDown = t11, t12;
|
|
949
|
-
$[16] !== buttonElement || $[17] !== menuElements ? (t12 = (event_1) => {
|
|
950
|
-
let target = event_1.target;
|
|
951
|
-
if (target instanceof Node && !(buttonElement && (target === buttonElement || buttonElement.contains(target)))) {
|
|
952
|
-
for (let el of menuElements) if (target === el || el.contains(target)) return;
|
|
953
|
-
setOpen(!1);
|
|
954
|
-
}
|
|
955
|
-
}, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
|
|
956
|
-
let handleMenuClickOutside = t12, t13;
|
|
957
|
-
$[19] !== buttonElement || $[20] !== disableRestoreFocusOnClose ? (t13 = () => {
|
|
958
|
-
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
959
|
-
}, $[19] = buttonElement, $[20] = disableRestoreFocusOnClose, $[21] = t13) : t13 = $[21];
|
|
960
|
-
let handleMenuEscape = t13, t14;
|
|
961
|
-
$[22] === menuElements ? t14 = $[23] : (t14 = (event_2) => {
|
|
962
|
-
let target_0 = event_2.relatedTarget;
|
|
963
|
-
if (target_0 instanceof Node) {
|
|
964
|
-
for (let el_0 of menuElements) if (el_0 === target_0 || el_0.contains(target_0)) return;
|
|
965
|
-
setOpen(!1);
|
|
966
|
-
}
|
|
967
|
-
}, $[22] = menuElements, $[23] = t14);
|
|
968
|
-
let handleBlur = t14, t15;
|
|
969
|
-
$[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t15 = () => {
|
|
970
|
-
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
971
|
-
}, $[24] = buttonElement, $[25] = disableRestoreFocusOnClose, $[26] = t15) : t15 = $[26];
|
|
972
|
-
let handleItemClick = t15, t16;
|
|
973
|
-
$[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];
|
|
974
|
-
let registerElement = t16, t17;
|
|
975
|
-
$[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && (0, react.cloneElement)(menuProp, {
|
|
976
|
-
"aria-labelledby": id,
|
|
977
|
-
onBlurCapture: handleBlur,
|
|
978
|
-
onClickOutside: handleMenuClickOutside,
|
|
979
|
-
onEscape: handleMenuEscape,
|
|
980
|
-
onItemClick: handleItemClick,
|
|
981
|
-
originElement: buttonElement,
|
|
982
|
-
registerElement,
|
|
983
|
-
shouldFocus
|
|
984
|
-
}), $[28] = buttonElement, $[29] = handleBlur, $[30] = handleItemClick, $[31] = handleMenuClickOutside, $[32] = handleMenuEscape, $[33] = id, $[34] = menuProp, $[35] = shouldFocus, $[36] = t17) : t17 = $[36];
|
|
985
|
-
let menu = t17, t18;
|
|
986
|
-
$[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open ? (t18 = buttonProp && (0, react.cloneElement)(buttonProp, {
|
|
987
|
-
"data-ui": "MenuButton",
|
|
988
|
-
id,
|
|
989
|
-
onClick: handleButtonClick,
|
|
990
|
-
onKeyDown: handleButtonKeyDown,
|
|
991
|
-
onMouseDown: handleMouseDown,
|
|
992
|
-
"aria-haspopup": !0,
|
|
993
|
-
"aria-expanded": open,
|
|
994
|
-
ref: setButtonElement,
|
|
995
|
-
selected: buttonProp.props.selected ?? open
|
|
996
|
-
}), $[37] = buttonProp, $[38] = handleMouseDown, $[39] = id, $[40] = open, $[41] = t18) : t18 = $[41];
|
|
997
|
-
let button = t18, t19, t20;
|
|
998
|
-
$[42] === buttonElement ? (t19 = $[43], t20 = $[44]) : (t19 = () => buttonElement, t20 = [buttonElement], $[42] = buttonElement, $[43] = t19, $[44] = t20), (0, react.useImperativeHandle)(forwardedRef, t19, t20);
|
|
999
|
-
let t21;
|
|
1000
|
-
$[45] === popover ? t21 = $[46] : (t21 = popover || {}, $[45] = popover, $[46] = t21);
|
|
1001
|
-
let t22;
|
|
1002
|
-
$[47] !== deprecated_boundaryElement || $[48] !== deprecated_placement || $[49] !== deprecated_popoverRadius || $[50] !== deprecated_popoverScheme || $[51] !== deprecated_portal || $[52] !== deprecated_preventOverflow || $[53] !== t21 ? (t22 = {
|
|
1003
|
-
boundaryElement: deprecated_boundaryElement,
|
|
1004
|
-
overflow: "auto",
|
|
1005
|
-
placement: deprecated_placement,
|
|
1006
|
-
portal: deprecated_portal,
|
|
1007
|
-
preventOverflow: deprecated_preventOverflow,
|
|
1008
|
-
radius: deprecated_popoverRadius,
|
|
1009
|
-
scheme: deprecated_popoverScheme,
|
|
1010
|
-
...t21
|
|
1011
|
-
}, $[47] = deprecated_boundaryElement, $[48] = deprecated_placement, $[49] = deprecated_popoverRadius, $[50] = deprecated_popoverScheme, $[51] = deprecated_portal, $[52] = deprecated_preventOverflow, $[53] = t21, $[54] = t22) : t22 = $[54];
|
|
1012
|
-
let popoverProps = t22, t23;
|
|
1013
|
-
$[55] === button ? t23 = $[56] : (t23 = button || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {}), $[55] = button, $[56] = t23);
|
|
1014
|
-
let t24;
|
|
1015
|
-
return $[57] !== menu || $[58] !== open || $[59] !== popoverProps || $[60] !== t23 ? (t24 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.k, {
|
|
1016
|
-
"data-ui": "MenuButton__popover",
|
|
1017
|
-
...popoverProps,
|
|
1018
|
-
content: menu,
|
|
1019
|
-
open,
|
|
1020
|
-
children: t23
|
|
1021
|
-
}), $[57] = menu, $[58] = open, $[59] = popoverProps, $[60] = t23, $[61] = t24) : t24 = $[61], t24;
|
|
1022
|
-
});
|
|
1023
|
-
function _temp$4(v) {
|
|
1024
|
-
return !v;
|
|
1025
|
-
}
|
|
1026
|
-
const animation = styled_components.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:${styled_components.keyframes`0%{background-position:100%;}100%{background-position:-100%;}`};animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-duration:2000ms;`, skeletonStyle = styled_components.css`opacity:${({ $visible }) => +!!$visible};transition:opacity 200ms ease-in;@media screen and (prefers-reduced-motion:no-preference){${({ $animated }) => $animated ? animation : styled_components.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__ */ (0, styled_components.styled)(require_portalProvider.lt).withConfig({
|
|
1027
|
-
displayName: "StyledSkeleton",
|
|
1028
|
-
componentId: "sc-6p2gkd-0"
|
|
1029
|
-
})(require_portalProvider.ct, skeletonStyle), Skeleton = (0, react.forwardRef)(function Skeleton(props, ref) {
|
|
1030
|
-
let $ = (0, react_compiler_runtime.c)(16), delay, radius, restProps, t0;
|
|
1031
|
-
$[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);
|
|
1032
|
-
let animated = t0 !== void 0 && t0, [visible, setVisible] = (0, react.useState)(!delay), t1, t2;
|
|
1033
|
-
$[5] === delay ? (t1 = $[6], t2 = $[7]) : (t1 = () => {
|
|
1034
|
-
if (!delay) return;
|
|
1035
|
-
let timeout = setTimeout(() => {
|
|
1036
|
-
setVisible(!0);
|
|
1037
|
-
}, delay);
|
|
1038
|
-
return () => {
|
|
1039
|
-
clearTimeout(timeout);
|
|
1040
|
-
};
|
|
1041
|
-
}, t2 = [delay], $[5] = delay, $[6] = t1, $[7] = t2), (0, react.useEffect)(t1, t2);
|
|
1042
|
-
let t3;
|
|
1043
|
-
$[8] === radius ? t3 = $[9] : (t3 = require_portalProvider.ft(radius), $[8] = radius, $[9] = t3);
|
|
1044
|
-
let t4 = !delay || visible, t5;
|
|
1045
|
-
return $[10] !== animated || $[11] !== ref || $[12] !== restProps || $[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSkeleton$1, {
|
|
1046
|
-
...restProps,
|
|
1047
|
-
$animated: animated,
|
|
1048
|
-
$radius: t3,
|
|
1049
|
-
$visible: t4,
|
|
1050
|
-
ref
|
|
1051
|
-
}), $[10] = animated, $[11] = ref, $[12] = restProps, $[13] = t3, $[14] = t4, $[15] = t5) : t5 = $[15], t5;
|
|
1052
|
-
}), StyledSkeleton = /* @__PURE__ */ (0, styled_components.styled)(Skeleton).withConfig({
|
|
1053
|
-
displayName: "StyledSkeleton",
|
|
1054
|
-
componentId: "sc-ilblpm-0"
|
|
1055
|
-
})((props) => {
|
|
1056
|
-
let { $size, $style } = props, { font, media } = require_getScopedTheme.i(props.theme), fontStyle = font[$style];
|
|
1057
|
-
return require_portalProvider.mt(media, $size, (sizeIndex) => {
|
|
1058
|
-
let fontSize = fontStyle.sizes[sizeIndex];
|
|
1059
|
-
return { height: fontSize.lineHeight - fontSize.ascenderHeight - fontSize.descenderHeight };
|
|
1060
|
-
});
|
|
1061
|
-
}), TextSkeleton = (0, react.forwardRef)(function TextSkeleton(props, ref) {
|
|
1062
|
-
let $ = (0, react_compiler_runtime.c)(9), restProps, t0;
|
|
1063
|
-
$[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
|
|
1064
|
-
let size = t0 === void 0 ? 2 : t0, t1;
|
|
1065
|
-
$[3] === size ? t1 = $[4] : (t1 = require_portalProvider.ft(size), $[3] = size, $[4] = t1);
|
|
1066
|
-
let $size = t1, t2;
|
|
1067
|
-
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSkeleton, {
|
|
1068
|
-
...restProps,
|
|
1069
|
-
$size,
|
|
1070
|
-
ref,
|
|
1071
|
-
$style: "text"
|
|
1072
|
-
}), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
|
|
1073
|
-
}), LabelSkeleton = (0, react.forwardRef)(function LabelSkeleton(props, ref) {
|
|
1074
|
-
let $ = (0, react_compiler_runtime.c)(9), restProps, t0;
|
|
1075
|
-
$[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
|
|
1076
|
-
let size = t0 === void 0 ? 2 : t0, t1;
|
|
1077
|
-
$[3] === size ? t1 = $[4] : (t1 = require_portalProvider.ft(size), $[3] = size, $[4] = t1);
|
|
1078
|
-
let $size = t1, t2;
|
|
1079
|
-
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSkeleton, {
|
|
1080
|
-
...restProps,
|
|
1081
|
-
$size,
|
|
1082
|
-
ref,
|
|
1083
|
-
$style: "label"
|
|
1084
|
-
}), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
|
|
1085
|
-
}), HeadingSkeleton = (0, react.forwardRef)(function HeadingSkeleton(props, ref) {
|
|
1086
|
-
let $ = (0, react_compiler_runtime.c)(9), restProps, t0;
|
|
1087
|
-
$[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
|
|
1088
|
-
let size = t0 === void 0 ? 2 : t0, t1;
|
|
1089
|
-
$[3] === size ? t1 = $[4] : (t1 = require_portalProvider.ft(size), $[3] = size, $[4] = t1);
|
|
1090
|
-
let $size = t1, t2;
|
|
1091
|
-
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSkeleton, {
|
|
1092
|
-
...restProps,
|
|
1093
|
-
$size,
|
|
1094
|
-
ref,
|
|
1095
|
-
$style: "heading"
|
|
1096
|
-
}), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
|
|
1097
|
-
}), CodeSkeleton = (0, react.forwardRef)(function CodeSkeleton(props, ref) {
|
|
1098
|
-
let $ = (0, react_compiler_runtime.c)(9), restProps, t0;
|
|
1099
|
-
$[0] === props ? (restProps = $[1], t0 = $[2]) : ({size: t0, ...restProps} = props, $[0] = props, $[1] = restProps, $[2] = t0);
|
|
1100
|
-
let size = t0 === void 0 ? 2 : t0, t1;
|
|
1101
|
-
$[3] === size ? t1 = $[4] : (t1 = require_portalProvider.ft(size), $[3] = size, $[4] = t1);
|
|
1102
|
-
let $size = t1, t2;
|
|
1103
|
-
return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSkeleton, {
|
|
1104
|
-
...restProps,
|
|
1105
|
-
$size,
|
|
1106
|
-
ref,
|
|
1107
|
-
$style: "code"
|
|
1108
|
-
}), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
|
|
1109
|
-
}), TabPanel = (0, react.forwardRef)(function TabPanel(props, ref) {
|
|
1110
|
-
let $ = (0, react_compiler_runtime.c)(9), flex, restProps;
|
|
1111
|
-
$[0] === props ? (flex = $[1], restProps = $[2]) : ({flex, ...restProps} = props, $[0] = props, $[1] = flex, $[2] = restProps);
|
|
1112
|
-
let t0 = props.tabIndex === void 0 ? 0 : props.tabIndex, t1;
|
|
1113
|
-
return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.lt, {
|
|
1114
|
-
"data-ui": "TabPanel",
|
|
1115
|
-
...restProps,
|
|
1116
|
-
flex,
|
|
1117
|
-
ref,
|
|
1118
|
-
role: "tabpanel",
|
|
1119
|
-
tabIndex: t0,
|
|
1120
|
-
children: props.children
|
|
1121
|
-
}), $[3] = flex, $[4] = props.children, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1) : t1 = $[8], t1;
|
|
1122
|
-
}), STATUS_CARD_TONE = {
|
|
1123
|
-
error: "critical",
|
|
1124
|
-
warning: "caution",
|
|
1125
|
-
success: "positive",
|
|
1126
|
-
info: "neutral"
|
|
1127
|
-
}, BUTTON_TONE = {
|
|
1128
|
-
error: "critical",
|
|
1129
|
-
warning: "caution",
|
|
1130
|
-
success: "positive",
|
|
1131
|
-
info: "neutral"
|
|
1132
|
-
}, TextBox = (0, styled_components.styled)(require_portalProvider.at).withConfig({
|
|
1133
|
-
displayName: "TextBox",
|
|
1134
|
-
componentId: "sc-xd2ehd-0"
|
|
1135
|
-
})`overflow-x:auto;`, StyledToast = (0, styled_components.styled)(require_portalProvider.W).withConfig({
|
|
1136
|
-
displayName: "StyledToast",
|
|
1137
|
-
componentId: "sc-xd2ehd-1"
|
|
1138
|
-
})`pointer-events:all;width:100%;position:relative;overflow:hidden;overflow:clip;&[data-has-duration]{padding-bottom:calc(${2}px / 2);}`, LoadingBar = styled_components.styled.div.withConfig({
|
|
1139
|
-
displayName: "LoadingBar",
|
|
1140
|
-
componentId: "sc-xd2ehd-2"
|
|
1141
|
-
})`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 = (0, styled_components.styled)(require_portalProvider.W).withConfig({
|
|
1142
|
-
displayName: "LoadingBarMask",
|
|
1143
|
-
componentId: "sc-xd2ehd-3"
|
|
1144
|
-
})`position:absolute;top:0;left:-${2}px;right:-${2}px;bottom:${2}px;z-index:1;`, LoadingBarProgress = (0, styled_components.styled)(require_portalProvider.W).withConfig({
|
|
1145
|
-
displayName: "LoadingBarProgress",
|
|
1146
|
-
componentId: "sc-xd2ehd-4"
|
|
1147
|
-
})`display:block;height:100%;width:100%;transform-origin:0% 50%;background-color:${(props) => {
|
|
1148
|
-
let { color } = require_getScopedTheme.i(props.theme);
|
|
1149
|
-
return color.button.default[props.tone].enabled.bg;
|
|
1150
|
-
}};`, ROLES = {
|
|
1151
|
-
error: "alert",
|
|
1152
|
-
warning: "alert",
|
|
1153
|
-
success: "alert",
|
|
1154
|
-
info: "alert"
|
|
1155
|
-
};
|
|
1156
|
-
/**
|
|
1157
|
-
* The `Toast` component gives feedback to users when an action has taken place.
|
|
1158
|
-
*
|
|
1159
|
-
* Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
|
|
1160
|
-
*
|
|
1161
|
-
* @public
|
|
1162
|
-
*/
|
|
1163
|
-
function Toast(props) {
|
|
1164
|
-
let $ = (0, react_compiler_runtime.c)(50), closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
|
|
1165
|
-
$[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);
|
|
1166
|
-
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 = require_portalProvider.R() ? 0 : .26, t1;
|
|
1167
|
-
$[10] === visualDuration ? t1 = $[11] : (t1 = visualDuration ? {
|
|
1168
|
-
type: "spring",
|
|
1169
|
-
visualDuration,
|
|
1170
|
-
bounce: .25
|
|
1171
|
-
} : { duration: 0 }, $[10] = visualDuration, $[11] = t1);
|
|
1172
|
-
let transition = t1, hasDuration = duration && isFinite(duration) && duration < 20736e5, t2;
|
|
1173
|
-
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
|
|
1174
|
-
let initial = t2, t3;
|
|
1175
|
-
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
|
|
1176
|
-
let animate = t3, t4;
|
|
1177
|
-
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
|
|
1178
|
-
let exit = t4, t5 = hasDuration ? "" : void 0, t6;
|
|
1179
|
-
$[15] === title ? t6 = $[16] : (t6 = title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.et, {
|
|
1180
|
-
size: 1,
|
|
1181
|
-
weight: "medium",
|
|
1182
|
-
children: title
|
|
1183
|
-
}), $[15] = title, $[16] = t6);
|
|
1184
|
-
let t7;
|
|
1185
|
-
$[17] !== description || $[18] !== transition ? (t7 = description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MotionText, {
|
|
1186
|
-
muted: !0,
|
|
1187
|
-
size: 1,
|
|
1188
|
-
variants: content,
|
|
1189
|
-
transition,
|
|
1190
|
-
children: description
|
|
1191
|
-
}), $[17] = description, $[18] = transition, $[19] = t7) : t7 = $[19];
|
|
1192
|
-
let t8;
|
|
1193
|
-
$[20] !== t6 || $[21] !== t7 ? (t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextBox, {
|
|
1194
|
-
flex: 1,
|
|
1195
|
-
padding: 3,
|
|
1196
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_portalProvider.O, {
|
|
1197
|
-
gap: 3,
|
|
1198
|
-
children: [t6, t7]
|
|
1199
|
-
})
|
|
1200
|
-
}), $[20] = t6, $[21] = t7, $[22] = t8) : t8 = $[22];
|
|
1201
|
-
let t9;
|
|
1202
|
-
$[23] !== buttonTone || $[24] !== closable || $[25] !== onClose ? (t9 = closable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.lt, {
|
|
1203
|
-
padding: 1,
|
|
1204
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.Y, {
|
|
1205
|
-
as: "button",
|
|
1206
|
-
icon: _sanity_icons_Close.CloseIcon,
|
|
1207
|
-
mode: "bleed",
|
|
1208
|
-
padding: 2,
|
|
1209
|
-
tone: buttonTone,
|
|
1210
|
-
onClick: onClose,
|
|
1211
|
-
style: { verticalAlign: "top" }
|
|
1212
|
-
})
|
|
1213
|
-
}), $[23] = buttonTone, $[24] = closable, $[25] = onClose, $[26] = t9) : t9 = $[26];
|
|
1214
|
-
let t10;
|
|
1215
|
-
$[27] !== t8 || $[28] !== t9 || $[29] !== transition ? (t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MotionFlex, {
|
|
1216
|
-
align: "flex-start",
|
|
1217
|
-
variants: content,
|
|
1218
|
-
transition,
|
|
1219
|
-
children: [t8, t9]
|
|
1220
|
-
}), $[27] = t8, $[28] = t9, $[29] = transition, $[30] = t10) : t10 = $[30];
|
|
1221
|
-
let t11;
|
|
1222
|
-
$[31] !== cardTone || $[32] !== duration || $[33] !== hasDuration || $[34] !== onClose || $[35] !== radius || $[36] !== transition || $[37] !== updatedAt || $[38] !== visualDuration ? (t11 = hasDuration && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MotionLoadingBar, {
|
|
1223
|
-
variants: content,
|
|
1224
|
-
transition,
|
|
1225
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadingBarMask, {
|
|
1226
|
-
tone: cardTone,
|
|
1227
|
-
radius
|
|
1228
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MotionLoadingBarProgress, {
|
|
1229
|
-
tone: cardTone,
|
|
1230
|
-
initial: { scaleX: 0 },
|
|
1231
|
-
animate: { scaleX: 1 },
|
|
1232
|
-
transition: {
|
|
1233
|
-
delay: visualDuration,
|
|
1234
|
-
duration: duration / 1e3,
|
|
1235
|
-
ease: "linear"
|
|
1236
|
-
},
|
|
1237
|
-
onAnimationComplete: onClose
|
|
1238
|
-
}, `progress-${updatedAt}`)]
|
|
1239
|
-
}), $[31] = cardTone, $[32] = duration, $[33] = hasDuration, $[34] = onClose, $[35] = radius, $[36] = transition, $[37] = updatedAt, $[38] = visualDuration, $[39] = t11) : t11 = $[39];
|
|
1240
|
-
let t12;
|
|
1241
|
-
return $[40] !== cardTone || $[41] !== radius || $[42] !== restProps || $[43] !== role || $[44] !== t10 || $[45] !== t11 || $[46] !== t5 || $[47] !== transition || $[48] !== visualDuration ? (t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MotionToast, {
|
|
1242
|
-
"data-ui": "Toast",
|
|
1243
|
-
role,
|
|
1244
|
-
...restProps,
|
|
1245
|
-
"data-has-duration": t5,
|
|
1246
|
-
custom: visualDuration,
|
|
1247
|
-
radius,
|
|
1248
|
-
shadow: 2,
|
|
1249
|
-
tone: cardTone,
|
|
1250
|
-
forwardedAs: "li",
|
|
1251
|
-
layout: "position",
|
|
1252
|
-
variants: container,
|
|
1253
|
-
initial,
|
|
1254
|
-
animate,
|
|
1255
|
-
exit,
|
|
1256
|
-
transition,
|
|
1257
|
-
children: [t10, t11]
|
|
1258
|
-
}), $[40] = cardTone, $[41] = radius, $[42] = restProps, $[43] = role, $[44] = t10, $[45] = t11, $[46] = t5, $[47] = transition, $[48] = visualDuration, $[49] = t12) : t12 = $[49], t12;
|
|
1259
|
-
}
|
|
1260
|
-
const container = {
|
|
1261
|
-
initial: {
|
|
1262
|
-
y: 32,
|
|
1263
|
-
scale: .5,
|
|
1264
|
-
zIndex: 1
|
|
1265
|
-
},
|
|
1266
|
-
hidden: { opacity: 0 },
|
|
1267
|
-
visible: (visualDuration) => visualDuration ? {
|
|
1268
|
-
opacity: 1,
|
|
1269
|
-
transition: {
|
|
1270
|
-
when: "beforeChildren",
|
|
1271
|
-
delayChildren: (0, motion_react.stagger)(visualDuration / 3),
|
|
1272
|
-
duration: visualDuration / 3
|
|
1273
|
-
}
|
|
1274
|
-
} : { opacity: 1 },
|
|
1275
|
-
slideIn: {
|
|
1276
|
-
y: 0,
|
|
1277
|
-
scale: 1
|
|
1278
|
-
},
|
|
1279
|
-
slideOut: {
|
|
1280
|
-
zIndex: 0,
|
|
1281
|
-
scale: .75
|
|
1282
|
-
}
|
|
1283
|
-
}, content = {
|
|
1284
|
-
initial: { willChange: "transform" },
|
|
1285
|
-
hidden: { opacity: 0 },
|
|
1286
|
-
visible: { opacity: 1 }
|
|
1287
|
-
}, MotionToast = motion_react.motion.create(StyledToast), MotionFlex = motion_react.motion.create(require_portalProvider.at), MotionText = motion_react.motion.create(require_portalProvider.et), MotionLoadingBar = motion_react.motion.create(LoadingBar), MotionLoadingBarProgress = motion_react.motion.create(LoadingBarProgress);
|
|
1288
|
-
/**
|
|
1289
|
-
* Some components should only render after mounting to the DOM, and not be rendered at all during SSR renderToString or equivalent.
|
|
1290
|
-
* @public
|
|
1291
|
-
*/
|
|
1292
|
-
function useMounted() {
|
|
1293
|
-
return (0, react.useSyncExternalStore)(subscribe, _temp$3, _temp2);
|
|
1294
|
-
}
|
|
1295
|
-
function _temp2() {
|
|
1296
|
-
return !1;
|
|
1297
|
-
}
|
|
1298
|
-
function _temp$3() {
|
|
1299
|
-
return !0;
|
|
1300
|
-
}
|
|
1301
|
-
const subscribe = () => () => {}, ToastContext = require_portalProvider.J("@sanity/ui/context/toast", null);
|
|
1302
|
-
/**
|
|
1303
|
-
* @internal
|
|
1304
|
-
*/
|
|
1305
|
-
function ToastLayer(props) {
|
|
1306
|
-
let $ = (0, react_compiler_runtime.c)(9), { children, padding: t0, paddingX, paddingY, gap: t1 } = props, padding = t0 === void 0 ? 4 : t0, gap = t1 === void 0 ? 3 : t1, { zIndex } = require_portalProvider.N(), t2;
|
|
1307
|
-
$[0] === zIndex ? t2 = $[1] : (t2 = { zIndex }, $[0] = zIndex, $[1] = t2);
|
|
1308
|
-
let t3;
|
|
1309
|
-
return $[2] !== children || $[3] !== gap || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== t2 ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledLayer, {
|
|
1310
|
-
forwardedAs: "ul",
|
|
1311
|
-
"data-ui": "ToastProvider",
|
|
1312
|
-
padding,
|
|
1313
|
-
paddingX,
|
|
1314
|
-
paddingY,
|
|
1315
|
-
gap,
|
|
1316
|
-
columns: 1,
|
|
1317
|
-
style: t2,
|
|
1318
|
-
children
|
|
1319
|
-
}), $[2] = children, $[3] = gap, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = t2, $[8] = t3) : t3 = $[8], t3;
|
|
1320
|
-
}
|
|
1321
|
-
const StyledLayer = (0, styled_components.styled)(require_portalProvider.s).withConfig({
|
|
1322
|
-
displayName: "StyledLayer",
|
|
1323
|
-
componentId: "sc-vx00k8-0"
|
|
1324
|
-
})`box-sizing:border-box;position:fixed;right:0;bottom:0;list-style:none;pointer-events:none;max-width:420px;width:100%;`;
|
|
1325
|
-
let toastId = 0;
|
|
1326
|
-
/** @internal */
|
|
1327
|
-
function generateToastId() {
|
|
1328
|
-
return String(toastId++);
|
|
1329
|
-
}
|
|
1330
|
-
/**
|
|
1331
|
-
* @public
|
|
1332
|
-
*/
|
|
1333
|
-
function ToastProvider(props) {
|
|
1334
|
-
let $ = (0, react_compiler_runtime.c)(13), { children, padding, paddingX, paddingY, gap, zOffset: t0 } = props, zOffset = t0 === void 0 ? 1 : t0, t1;
|
|
1335
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
|
|
1336
|
-
let [state, setState] = (0, react.useState)(t1), mounted = useMounted(), t2;
|
|
1337
|
-
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1338
|
-
let push = (params) => {
|
|
1339
|
-
let id = params.id || generateToastId(), duration = params.duration || 5e3;
|
|
1340
|
-
return (0, react.startTransition)(() => {
|
|
1341
|
-
setState((prevState) => {
|
|
1342
|
-
if (duration === .01) return prevState.filter((toast) => toast.id !== id);
|
|
1343
|
-
let dismiss = () => (0, react.startTransition)(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
|
|
1344
|
-
return [...prevState.filter((toast_1) => toast_1.id !== id), {
|
|
1345
|
-
dismiss,
|
|
1346
|
-
id,
|
|
1347
|
-
updatedAt: Date.now(),
|
|
1348
|
-
params: {
|
|
1349
|
-
...params,
|
|
1350
|
-
duration
|
|
1351
|
-
}
|
|
1352
|
-
}];
|
|
1353
|
-
});
|
|
1354
|
-
}), id;
|
|
1355
|
-
};
|
|
1356
|
-
t2 = {
|
|
1357
|
-
version: 0,
|
|
1358
|
-
push
|
|
1359
|
-
}, $[1] = t2;
|
|
1360
|
-
} else t2 = $[1];
|
|
1361
|
-
let value = t2, t3;
|
|
1362
|
-
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = mounted && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.P, {
|
|
1363
|
-
zOffset,
|
|
1364
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastLayer, {
|
|
1365
|
-
padding,
|
|
1366
|
-
paddingX,
|
|
1367
|
-
paddingY,
|
|
1368
|
-
gap,
|
|
1369
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.AnimatePresence, {
|
|
1370
|
-
initial: !1,
|
|
1371
|
-
mode: "popLayout",
|
|
1372
|
-
children: state.map(_temp$2)
|
|
1373
|
-
})
|
|
1374
|
-
})
|
|
1375
|
-
}), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t3) : t3 = $[9];
|
|
1376
|
-
let t4;
|
|
1377
|
-
return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToastContext.Provider, {
|
|
1378
|
-
value,
|
|
1379
|
-
children: [children, t3]
|
|
1380
|
-
}), $[10] = children, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
|
|
1381
|
-
}
|
|
1382
|
-
function _temp$2(t0) {
|
|
1383
|
-
let { dismiss: dismiss_0, id: id_0, params: params_0, updatedAt } = t0;
|
|
1384
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Toast, {
|
|
1385
|
-
closable: params_0.closable,
|
|
1386
|
-
description: params_0.description,
|
|
1387
|
-
onClose: dismiss_0,
|
|
1388
|
-
status: params_0.status,
|
|
1389
|
-
title: params_0.title,
|
|
1390
|
-
duration: params_0.duration,
|
|
1391
|
-
updatedAt
|
|
1392
|
-
}, id_0);
|
|
1393
|
-
}
|
|
1394
|
-
/**
|
|
1395
|
-
* @public
|
|
1396
|
-
*/
|
|
1397
|
-
function useToast() {
|
|
1398
|
-
let value = (0, react.useContext)(ToastContext);
|
|
1399
|
-
if (!value) throw Error("useToast(): missing context value");
|
|
1400
|
-
if (!require_portalProvider.L(value) || value.version !== 0) throw Error("useToast(): the context value is not compatible");
|
|
1401
|
-
return value;
|
|
1402
|
-
}
|
|
1403
|
-
function _findPrevItemElement(state, itemElements, focusedElement) {
|
|
1404
|
-
let idx = itemElements.indexOf(focusedElement), els = itemElements.slice(0, idx), len = els.length;
|
|
1405
|
-
for (let i = len - 1; i >= 0; --i) {
|
|
1406
|
-
let itemKey = els[i].getAttribute("data-tree-key");
|
|
1407
|
-
if (!itemKey) continue;
|
|
1408
|
-
let segments = itemKey.split("/");
|
|
1409
|
-
segments.pop();
|
|
1410
|
-
let p = [], expanded = !0;
|
|
1411
|
-
for (let j = 0; j < segments.length; j += 1) if (p.push(segments[j]), !state[p.join("/")]?.expanded) {
|
|
1412
|
-
expanded = !1;
|
|
1413
|
-
break;
|
|
1414
|
-
}
|
|
1415
|
-
if (expanded) return els[i];
|
|
1416
|
-
}
|
|
1417
|
-
return null;
|
|
1418
|
-
}
|
|
1419
|
-
function _findNextItemElement(state, itemElements, focusedElement) {
|
|
1420
|
-
let idx = itemElements.indexOf(focusedElement), els = itemElements.slice(idx), len = itemElements.length;
|
|
1421
|
-
for (let i = 1; i < len; i += 1) {
|
|
1422
|
-
if (!els[i]) continue;
|
|
1423
|
-
let itemKey = els[i].getAttribute("data-tree-key");
|
|
1424
|
-
if (!itemKey) continue;
|
|
1425
|
-
let segments = itemKey.split("/");
|
|
1426
|
-
segments.pop();
|
|
1427
|
-
let p = [], expanded = !0;
|
|
1428
|
-
for (let j = 0; j < segments.length; j += 1) if (p.push(segments[j]), !state[p.join("/")]?.expanded) {
|
|
1429
|
-
expanded = !1;
|
|
1430
|
-
break;
|
|
1431
|
-
}
|
|
1432
|
-
if (expanded) return els[i];
|
|
1433
|
-
}
|
|
1434
|
-
return null;
|
|
1435
|
-
}
|
|
1436
|
-
function _focusItemElement(el) {
|
|
1437
|
-
if (el.getAttribute("role") === "treeitem" && el.focus(), el.getAttribute("role") === "none") {
|
|
1438
|
-
let firstChild = el.firstChild;
|
|
1439
|
-
firstChild && firstChild instanceof HTMLElement && firstChild.focus();
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
/**
|
|
1443
|
-
* @internal
|
|
1444
|
-
*/
|
|
1445
|
-
const TreeContext = require_portalProvider.J("@sanity/ui/context/tree", null), Tree = (0, react.forwardRef)(function Tree(props, forwardedRef) {
|
|
1446
|
-
let $ = (0, react_compiler_runtime.c)(38), children, gap, onFocus, restProps, t0;
|
|
1447
|
-
$[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);
|
|
1448
|
-
let spacing = gap === void 0 ? t0 === void 0 ? 1 : t0 : gap, ref = (0, react.useRef)(null), [focusedElement, setFocusedElement] = (0, react.useState)(null), focusedElementRef = (0, react.useRef)(focusedElement), t1;
|
|
1449
|
-
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[6] = t1) : t1 = $[6];
|
|
1450
|
-
let path = t1, t2;
|
|
1451
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[7] = t2) : t2 = $[7];
|
|
1452
|
-
let [itemElements, setItemElements] = (0, react.useState)(t2), t3;
|
|
1453
|
-
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[8] = t3) : t3 = $[8];
|
|
1454
|
-
let [state, setState] = (0, react.useState)(t3), stateRef = (0, react.useRef)(state), t4;
|
|
1455
|
-
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[9] = t4) : t4 = $[9], (0, react.useImperativeHandle)(forwardedRef, t4);
|
|
1456
|
-
let t5, t6;
|
|
1457
|
-
$[10] === focusedElement ? (t5 = $[11], t6 = $[12]) : (t5 = () => {
|
|
1458
|
-
focusedElementRef.current = focusedElement;
|
|
1459
|
-
}, t6 = [focusedElement], $[10] = focusedElement, $[11] = t5, $[12] = t6), (0, react.useEffect)(t5, t6);
|
|
1460
|
-
let t7, t8;
|
|
1461
|
-
$[13] === state ? (t7 = $[14], t8 = $[15]) : (t7 = () => {
|
|
1462
|
-
stateRef.current = state;
|
|
1463
|
-
}, t8 = [state], $[13] = state, $[14] = t7, $[15] = t8), (0, react.useEffect)(t7, t8);
|
|
1464
|
-
let t9;
|
|
1465
|
-
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t9 = (element, path_0, expanded, selected) => (setState((s) => ({
|
|
1466
|
-
...s,
|
|
1467
|
-
[path_0]: {
|
|
1468
|
-
element,
|
|
1469
|
-
expanded
|
|
1470
|
-
}
|
|
1471
|
-
})), selected && setFocusedElement(element), () => {
|
|
1472
|
-
setState((s_0) => {
|
|
1473
|
-
let newState = { ...s_0 };
|
|
1474
|
-
return delete newState[path_0], newState;
|
|
1475
|
-
});
|
|
1476
|
-
}), $[16] = t9) : t9 = $[16];
|
|
1477
|
-
let registerItem = t9, t10;
|
|
1478
|
-
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (path_1, expanded_0) => {
|
|
1479
|
-
setState((s_1) => {
|
|
1480
|
-
let itemState = s_1[path_1];
|
|
1481
|
-
return itemState ? {
|
|
1482
|
-
...s_1,
|
|
1483
|
-
[path_1]: {
|
|
1484
|
-
...itemState,
|
|
1485
|
-
expanded: expanded_0
|
|
1486
|
-
}
|
|
1487
|
-
} : s_1;
|
|
1488
|
-
});
|
|
1489
|
-
}, $[17] = t10) : t10 = $[17];
|
|
1490
|
-
let setExpanded = t10, t11 = focusedElement || itemElements[0] || null, t12;
|
|
1491
|
-
$[18] !== spacing || $[19] !== state || $[20] !== t11 ? (t12 = {
|
|
1492
|
-
version: 0,
|
|
1493
|
-
focusedElement: t11,
|
|
1494
|
-
level: 0,
|
|
1495
|
-
path,
|
|
1496
|
-
registerItem,
|
|
1497
|
-
setExpanded,
|
|
1498
|
-
setFocusedElement,
|
|
1499
|
-
gap: spacing,
|
|
1500
|
-
space: spacing,
|
|
1501
|
-
state
|
|
1502
|
-
}, $[18] = spacing, $[19] = state, $[20] = t11, $[21] = t12) : t12 = $[21];
|
|
1503
|
-
let contextValue = t12, t13;
|
|
1504
|
-
$[22] === itemElements ? t13 = $[23] : (t13 = (event) => {
|
|
1505
|
-
if (focusedElementRef.current) {
|
|
1506
|
-
if (event.key === "ArrowDown") {
|
|
1507
|
-
event.preventDefault();
|
|
1508
|
-
let nextEl = _findNextItemElement(stateRef.current, itemElements, focusedElementRef.current);
|
|
1509
|
-
nextEl && (_focusItemElement(nextEl), setFocusedElement(nextEl));
|
|
1510
|
-
return;
|
|
1511
|
-
}
|
|
1512
|
-
if (event.key === "ArrowUp") {
|
|
1513
|
-
event.preventDefault();
|
|
1514
|
-
let prevEl = _findPrevItemElement(stateRef.current, itemElements, focusedElementRef.current);
|
|
1515
|
-
prevEl && (_focusItemElement(prevEl), setFocusedElement(prevEl));
|
|
1516
|
-
return;
|
|
1517
|
-
}
|
|
1518
|
-
if (event.key === "ArrowLeft") {
|
|
1519
|
-
event.preventDefault();
|
|
1520
|
-
let itemKey = focusedElementRef.current.getAttribute("data-tree-key");
|
|
1521
|
-
if (!itemKey) return;
|
|
1522
|
-
let itemState_0 = stateRef.current[itemKey];
|
|
1523
|
-
if (!itemState_0) return;
|
|
1524
|
-
if (itemState_0.expanded) setState((s_2) => {
|
|
1525
|
-
let itemState_1 = s_2[itemKey];
|
|
1526
|
-
return itemState_1 ? {
|
|
1527
|
-
...s_2,
|
|
1528
|
-
[itemKey]: {
|
|
1529
|
-
...itemState_1,
|
|
1530
|
-
expanded: !1
|
|
1531
|
-
}
|
|
1532
|
-
} : s_2;
|
|
1533
|
-
});
|
|
1534
|
-
else {
|
|
1535
|
-
let itemPath = itemKey.split("/");
|
|
1536
|
-
itemPath.pop();
|
|
1537
|
-
let parentKey = itemPath.join("/"), parentState = parentKey && stateRef.current[parentKey];
|
|
1538
|
-
parentState && (parentState.element.focus(), setFocusedElement(parentState.element));
|
|
1539
|
-
}
|
|
1540
|
-
return;
|
|
1541
|
-
}
|
|
1542
|
-
if (event.key === "ArrowRight") {
|
|
1543
|
-
event.preventDefault();
|
|
1544
|
-
let focusedKey = focusedElementRef.current.getAttribute("data-tree-key");
|
|
1545
|
-
if (!focusedKey) return;
|
|
1546
|
-
stateRef.current[focusedKey]?.expanded || setState((s_3) => {
|
|
1547
|
-
let itemState_2 = s_3[focusedKey];
|
|
1548
|
-
return itemState_2 ? {
|
|
1549
|
-
...s_3,
|
|
1550
|
-
[focusedKey]: {
|
|
1551
|
-
...itemState_2,
|
|
1552
|
-
expanded: !0
|
|
1553
|
-
}
|
|
1554
|
-
} : s_3;
|
|
1555
|
-
});
|
|
1556
|
-
return;
|
|
1557
|
-
}
|
|
1558
|
-
}
|
|
1559
|
-
}, $[22] = itemElements, $[23] = t13);
|
|
1560
|
-
let handleKeyDown = t13, t14;
|
|
1561
|
-
$[24] === onFocus ? t14 = $[25] : (t14 = (event_0) => {
|
|
1562
|
-
setFocusedElement(event_0.target), onFocus?.(event_0);
|
|
1563
|
-
}, $[24] = onFocus, $[25] = t14);
|
|
1564
|
-
let handleFocus = t14, t15;
|
|
1565
|
-
$[26] === Symbol.for("react.memo_cache_sentinel") ? (t15 = () => {
|
|
1566
|
-
if (!ref.current) return;
|
|
1567
|
-
let _itemElements = Array.from(ref.current.querySelectorAll("[data-ui=\"TreeItem\"]"));
|
|
1568
|
-
setItemElements(_itemElements);
|
|
1569
|
-
}, $[26] = t15) : t15 = $[26];
|
|
1570
|
-
let t16;
|
|
1571
|
-
$[27] === children ? t16 = $[28] : (t16 = [children], $[27] = children, $[28] = t16), (0, react.useEffect)(t15, t16);
|
|
1572
|
-
let t17;
|
|
1573
|
-
$[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== spacing ? (t17 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.O, {
|
|
1574
|
-
as: "ul",
|
|
1575
|
-
"data-ui": "Tree",
|
|
1576
|
-
...restProps,
|
|
1577
|
-
onFocus: handleFocus,
|
|
1578
|
-
onKeyDown: handleKeyDown,
|
|
1579
|
-
ref,
|
|
1580
|
-
role: "tree",
|
|
1581
|
-
gap: spacing,
|
|
1582
|
-
children
|
|
1583
|
-
}), $[29] = children, $[30] = handleFocus, $[31] = handleKeyDown, $[32] = restProps, $[33] = spacing, $[34] = t17) : t17 = $[34];
|
|
1584
|
-
let t18;
|
|
1585
|
-
return $[35] !== contextValue || $[36] !== t17 ? (t18 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeContext.Provider, {
|
|
1586
|
-
value: contextValue,
|
|
1587
|
-
children: t17
|
|
1588
|
-
}), $[35] = contextValue, $[36] = t17, $[37] = t18) : t18 = $[37], t18;
|
|
1589
|
-
});
|
|
1590
|
-
function treeItemRootStyle() {
|
|
1591
|
-
return styled_components.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;}}`;
|
|
1592
|
-
}
|
|
1593
|
-
function treeItemRootColorStyle(props) {
|
|
1594
|
-
let { color } = require_getScopedTheme.i(props.theme), tone = color.selectable.default;
|
|
1595
|
-
return styled_components.css`&[role='none']{& > [role='treeitem']{${require_portalProvider.Q(color, tone.enabled)}}&[data-selected] > [role='treeitem']{${require_portalProvider.Q(color, tone.pressed)}}@media (hover:hover){&:not([data-selected]) > [role='treeitem']:not(:focus):hover{${require_portalProvider.Q(color, tone.hovered)}}& > [role='treeitem']:focus{${require_portalProvider.Q(color, tone.selected)}}}}&[role='treeitem']{& > [data-ui='TreeItem__box']{${require_portalProvider.Q(color, tone.enabled)}}&[data-selected] > [data-ui='TreeItem__box']{${require_portalProvider.Q(color, tone.pressed)}}@media (hover:hover){&:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover{${require_portalProvider.Q(color, tone.hovered)}}&:focus > [data-ui='TreeItem__box']{${require_portalProvider.Q(color, tone.selected)}}}}`;
|
|
1596
|
-
}
|
|
1597
|
-
function treeItemBoxStyle(props) {
|
|
1598
|
-
let { $level } = props, { space } = require_getScopedTheme.i(props.theme);
|
|
1599
|
-
return styled_components.css`display:block;padding-left:${require_portalProvider.ht(space[2] * $level)};text-decoration:none;`;
|
|
1600
|
-
}
|
|
1601
|
-
/**
|
|
1602
|
-
* @beta
|
|
1603
|
-
*/
|
|
1604
|
-
function useTree() {
|
|
1605
|
-
let tree = (0, react.useContext)(TreeContext);
|
|
1606
|
-
if (!tree) throw Error("Tree: missing context value");
|
|
1607
|
-
return tree;
|
|
1608
|
-
}
|
|
1609
|
-
function TreeGroup(props) {
|
|
1610
|
-
let $ = (0, react_compiler_runtime.c)(9), children, restProps, t0;
|
|
1611
|
-
$[0] === props ? (children = $[1], restProps = $[2], t0 = $[3]) : ({children, expanded: t0, ...restProps} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0);
|
|
1612
|
-
let expanded = t0 !== void 0 && t0, tree = useTree(), t1 = !expanded, t2;
|
|
1613
|
-
return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.gap ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.O, {
|
|
1614
|
-
as: "ul",
|
|
1615
|
-
"data-ui": "TreeGroup",
|
|
1616
|
-
...restProps,
|
|
1617
|
-
hidden: t1,
|
|
1618
|
-
marginTop: tree.gap,
|
|
1619
|
-
role: "group",
|
|
1620
|
-
gap: tree.gap,
|
|
1621
|
-
children
|
|
1622
|
-
}), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.gap, $[8] = t2) : t2 = $[8], t2;
|
|
1623
|
-
}
|
|
1624
|
-
const StyledTreeItem = /* @__PURE__ */ styled_components.styled.li.withConfig({
|
|
1625
|
-
displayName: "StyledTreeItem",
|
|
1626
|
-
componentId: "sc-qnd0f7-0"
|
|
1627
|
-
})(treeItemRootStyle, treeItemRootColorStyle), TreeItemBox = /* @__PURE__ */ styled_components.styled.a.withConfig({
|
|
1628
|
-
displayName: "TreeItemBox",
|
|
1629
|
-
componentId: "sc-qnd0f7-1"
|
|
1630
|
-
})(treeItemBoxStyle), ToggleArrowText = (0, styled_components.styled)(require_portalProvider.et).withConfig({
|
|
1631
|
-
displayName: "ToggleArrowText",
|
|
1632
|
-
componentId: "sc-qnd0f7-2"
|
|
1633
|
-
})`& > svg{transition:transform 100ms;}`;
|
|
1634
|
-
/**
|
|
1635
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1636
|
-
* @beta
|
|
1637
|
-
*/
|
|
1638
|
-
function TreeItem(props) {
|
|
1639
|
-
let $ = (0, react_compiler_runtime.c)(117), IconComponent, children, gap, href, idProp, linkAs, linkProps, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
|
|
1640
|
-
$[0] === props ? (IconComponent = $[1], children = $[2], gap = $[3], href = $[4], idProp = $[5], linkAs = $[6], linkProps = $[7], muted = $[8], onClick = $[9], restProps = $[10], t0 = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], text = $[16], weight = $[17]) : ({children, expanded: t0, fontSize: t1, href, icon: IconComponent, id: idProp, linkAs, linkProps, 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] = linkProps, $[8] = muted, $[9] = onClick, $[10] = restProps, $[11] = t0, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = text, $[17] = weight);
|
|
1641
|
-
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] = (0, react.useState)(null), t5;
|
|
1642
|
-
$[18] === Symbol.for("react.memo_cache_sentinel") ? (t5 = (node) => {
|
|
1643
|
-
(0, react.startTransition)(() => _setRootElement(node));
|
|
1644
|
-
}, $[18] = t5) : t5 = $[18];
|
|
1645
|
-
let setRootElement = t5, treeitemRef = (0, react.useRef)(null), tree = useTree(), { path, registerItem, setExpanded, setFocusedElement } = tree, _id = (0, react.useId)(), id = idProp || _id, t6, t7;
|
|
1646
|
-
if ($[19] !== id || $[20] !== path) {
|
|
1647
|
-
let itemPath = path.concat([id || ""]);
|
|
1648
|
-
t6 = itemPath, t7 = itemPath.join("/"), $[19] = id, $[20] = path, $[21] = t6, $[22] = t7;
|
|
1649
|
-
} else t6 = $[21], t7 = $[22];
|
|
1650
|
-
let t8;
|
|
1651
|
-
$[23] !== t6 || $[24] !== t7 ? (t8 = [t6, t7], $[23] = t6, $[24] = t7, $[25] = t8) : t8 = $[25];
|
|
1652
|
-
let [itemPath_0, itemKey] = t8, itemState = tree.state[itemKey], focused = tree.focusedElement === rootElement, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootElement ? 0 : -1, t9 = tree.level + 1, t10;
|
|
1653
|
-
$[26] !== itemPath_0 || $[27] !== t9 || $[28] !== tree ? (t10 = {
|
|
1654
|
-
...tree,
|
|
1655
|
-
level: t9,
|
|
1656
|
-
path: itemPath_0
|
|
1657
|
-
}, $[26] = itemPath_0, $[27] = t9, $[28] = tree, $[29] = t10) : t10 = $[29];
|
|
1658
|
-
let contextValue = t10, t11;
|
|
1659
|
-
$[30] !== expanded || $[31] !== itemKey || $[32] !== onClick || $[33] !== rootElement || $[34] !== setExpanded || $[35] !== setFocusedElement ? (t11 = (event) => {
|
|
1660
|
-
onClick && onClick(event);
|
|
1661
|
-
let target = event.target;
|
|
1662
|
-
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest("[data-ui=\"TreeItem__box\"]")) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
|
|
1663
|
-
}, $[30] = expanded, $[31] = itemKey, $[32] = onClick, $[33] = rootElement, $[34] = setExpanded, $[35] = setFocusedElement, $[36] = t11) : t11 = $[36];
|
|
1664
|
-
let handleClick = t11, t12;
|
|
1665
|
-
$[37] !== focused || $[38] !== rootElement ? (t12 = (event_0) => {
|
|
1666
|
-
focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
|
|
1667
|
-
}, $[37] = focused, $[38] = rootElement, $[39] = t12) : t12 = $[39];
|
|
1668
|
-
let handleKeyDown = t12, t13, t14;
|
|
1669
|
-
$[40] !== expanded || $[41] !== itemKey || $[42] !== registerItem || $[43] !== rootElement || $[44] !== selected ? (t13 = () => {
|
|
1670
|
-
if (rootElement) return registerItem(rootElement, itemKey, expanded, selected);
|
|
1671
|
-
}, t14 = [
|
|
1672
|
-
expanded,
|
|
1673
|
-
itemKey,
|
|
1674
|
-
registerItem,
|
|
1675
|
-
rootElement,
|
|
1676
|
-
selected
|
|
1677
|
-
], $[40] = expanded, $[41] = itemKey, $[42] = registerItem, $[43] = rootElement, $[44] = selected, $[45] = t13, $[46] = t14) : (t13 = $[45], t14 = $[46]), (0, react.useEffect)(t13, t14);
|
|
1678
|
-
let t15 = IconComponent || children ? "visible" : "hidden", t16;
|
|
1679
|
-
$[47] === t15 ? t16 = $[48] : (t16 = {
|
|
1680
|
-
visibility: t15,
|
|
1681
|
-
pointerEvents: "none"
|
|
1682
|
-
}, $[47] = t15, $[48] = t16);
|
|
1683
|
-
let t17;
|
|
1684
|
-
$[49] !== IconComponent || $[50] !== fontSize || $[51] !== muted || $[52] !== weight ? (t17 = IconComponent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.et, {
|
|
1685
|
-
muted,
|
|
1686
|
-
size: fontSize,
|
|
1687
|
-
weight,
|
|
1688
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconComponent, {})
|
|
1689
|
-
}), $[49] = IconComponent, $[50] = fontSize, $[51] = muted, $[52] = weight, $[53] = t17) : t17 = $[53];
|
|
1690
|
-
let t18;
|
|
1691
|
-
$[54] !== IconComponent || $[55] !== expanded || $[56] !== fontSize || $[57] !== muted || $[58] !== weight ? (t18 = !IconComponent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleArrowText, {
|
|
1692
|
-
muted,
|
|
1693
|
-
size: fontSize,
|
|
1694
|
-
weight,
|
|
1695
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_sanity_icons_ToggleArrowRight.ToggleArrowRightIcon, { style: { transform: expanded ? "rotate(90deg)" : void 0 } })
|
|
1696
|
-
}), $[54] = IconComponent, $[55] = expanded, $[56] = fontSize, $[57] = muted, $[58] = weight, $[59] = t18) : t18 = $[59];
|
|
1697
|
-
let t19;
|
|
1698
|
-
$[60] !== spacing || $[61] !== t16 || $[62] !== t17 || $[63] !== t18 ? (t19 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_portalProvider.lt, {
|
|
1699
|
-
marginRight: spacing,
|
|
1700
|
-
style: t16,
|
|
1701
|
-
children: [t17, t18]
|
|
1702
|
-
}), $[60] = spacing, $[61] = t16, $[62] = t17, $[63] = t18, $[64] = t19) : t19 = $[64];
|
|
1703
|
-
let t20;
|
|
1704
|
-
$[65] !== fontSize || $[66] !== muted || $[67] !== text || $[68] !== weight ? (t20 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.lt, {
|
|
1705
|
-
flex: 1,
|
|
1706
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.et, {
|
|
1707
|
-
muted,
|
|
1708
|
-
size: fontSize,
|
|
1709
|
-
textOverflow: "ellipsis",
|
|
1710
|
-
weight,
|
|
1711
|
-
children: text
|
|
1712
|
-
})
|
|
1713
|
-
}), $[65] = fontSize, $[66] = muted, $[67] = text, $[68] = weight, $[69] = t20) : t20 = $[69];
|
|
1714
|
-
let t21;
|
|
1715
|
-
$[70] !== padding || $[71] !== t19 || $[72] !== t20 ? (t21 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_portalProvider.at, {
|
|
1716
|
-
padding,
|
|
1717
|
-
children: [t19, t20]
|
|
1718
|
-
}), $[70] = padding, $[71] = t19, $[72] = t20, $[73] = t21) : t21 = $[73];
|
|
1719
|
-
let content = t21;
|
|
1720
|
-
if (href) {
|
|
1721
|
-
let t22 = selected ? "" : void 0, t23 = typeof linkAs == "string" ? linkAs : "a", t24;
|
|
1722
|
-
$[74] !== content || $[75] !== expanded || $[76] !== href || $[77] !== linkAs || $[78] !== linkProps || $[79] !== t23 || $[80] !== tabIndex || $[81] !== tree.level ? (t24 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeItemBox, {
|
|
1723
|
-
...linkProps,
|
|
1724
|
-
$level: tree.level,
|
|
1725
|
-
"aria-expanded": expanded,
|
|
1726
|
-
as: linkAs,
|
|
1727
|
-
"data-as": t23,
|
|
1728
|
-
"data-ui": "TreeItem__box",
|
|
1729
|
-
href,
|
|
1730
|
-
ref: treeitemRef,
|
|
1731
|
-
role: "treeitem",
|
|
1732
|
-
tabIndex,
|
|
1733
|
-
children: content
|
|
1734
|
-
}), $[74] = content, $[75] = expanded, $[76] = href, $[77] = linkAs, $[78] = linkProps, $[79] = t23, $[80] = tabIndex, $[81] = tree.level, $[82] = t24) : t24 = $[82];
|
|
1735
|
-
let t25;
|
|
1736
|
-
$[83] !== children || $[84] !== expanded ? (t25 = children && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeGroup, {
|
|
1737
|
-
hidden: !expanded,
|
|
1738
|
-
children
|
|
1739
|
-
}), $[83] = children, $[84] = expanded, $[85] = t25) : t25 = $[85];
|
|
1740
|
-
let t26;
|
|
1741
|
-
$[86] !== contextValue || $[87] !== t25 ? (t26 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeContext.Provider, {
|
|
1742
|
-
value: contextValue,
|
|
1743
|
-
children: t25
|
|
1744
|
-
}), $[86] = contextValue, $[87] = t25, $[88] = t26) : t26 = $[88];
|
|
1745
|
-
let t27;
|
|
1746
|
-
return $[89] !== handleClick || $[90] !== id || $[91] !== itemKey || $[92] !== restProps || $[93] !== t22 || $[94] !== t24 || $[95] !== t26 ? (t27 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledTreeItem, {
|
|
1747
|
-
"data-selected": t22,
|
|
1748
|
-
"data-tree-id": id,
|
|
1749
|
-
"data-tree-key": itemKey,
|
|
1750
|
-
"data-ui": "TreeItem",
|
|
1751
|
-
...restProps,
|
|
1752
|
-
onClick: handleClick,
|
|
1753
|
-
ref: setRootElement,
|
|
1754
|
-
role: "none",
|
|
1755
|
-
children: [t24, t26]
|
|
1756
|
-
}), $[89] = handleClick, $[90] = id, $[91] = itemKey, $[92] = restProps, $[93] = t22, $[94] = t24, $[95] = t26, $[96] = t27) : t27 = $[96], t27;
|
|
1757
|
-
}
|
|
1758
|
-
let t22 = selected ? "" : void 0, t23;
|
|
1759
|
-
$[97] !== content || $[98] !== tree.level ? (t23 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeItemBox, {
|
|
1760
|
-
$level: tree.level,
|
|
1761
|
-
as: "div",
|
|
1762
|
-
"data-ui": "TreeItem__box",
|
|
1763
|
-
children: content
|
|
1764
|
-
}), $[97] = content, $[98] = tree.level, $[99] = t23) : t23 = $[99];
|
|
1765
|
-
let t24;
|
|
1766
|
-
$[100] !== children || $[101] !== expanded ? (t24 = children && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeGroup, {
|
|
1767
|
-
expanded,
|
|
1768
|
-
children
|
|
1769
|
-
}), $[100] = children, $[101] = expanded, $[102] = t24) : t24 = $[102];
|
|
1770
|
-
let t25;
|
|
1771
|
-
$[103] !== contextValue || $[104] !== t24 ? (t25 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeContext.Provider, {
|
|
1772
|
-
value: contextValue,
|
|
1773
|
-
children: t24
|
|
1774
|
-
}), $[103] = contextValue, $[104] = t24, $[105] = t25) : t25 = $[105];
|
|
1775
|
-
let t26;
|
|
1776
|
-
return $[106] !== expanded || $[107] !== handleClick || $[108] !== handleKeyDown || $[109] !== id || $[110] !== itemKey || $[111] !== restProps || $[112] !== t22 || $[113] !== t23 || $[114] !== t25 || $[115] !== tabIndex ? (t26 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledTreeItem, {
|
|
1777
|
-
"data-selected": t22,
|
|
1778
|
-
"data-ui": "TreeItem",
|
|
1779
|
-
"data-tree-id": id,
|
|
1780
|
-
"data-tree-key": itemKey,
|
|
1781
|
-
...restProps,
|
|
1782
|
-
"aria-expanded": expanded,
|
|
1783
|
-
onClick: handleClick,
|
|
1784
|
-
onKeyDown: handleKeyDown,
|
|
1785
|
-
ref: setRootElement,
|
|
1786
|
-
role: "treeitem",
|
|
1787
|
-
tabIndex,
|
|
1788
|
-
children: [t23, t25]
|
|
1789
|
-
}), $[106] = expanded, $[107] = handleClick, $[108] = handleKeyDown, $[109] = id, $[110] = itemKey, $[111] = restProps, $[112] = t22, $[113] = t23, $[114] = t25, $[115] = tabIndex, $[116] = t26) : t26 = $[116], t26;
|
|
1790
|
-
}
|
|
1791
|
-
/**
|
|
1792
|
-
* @internal
|
|
1793
|
-
*/
|
|
1794
|
-
function _isScrollable(el) {
|
|
1795
|
-
if (!(el instanceof Element)) return !1;
|
|
1796
|
-
let style = window.getComputedStyle(el);
|
|
1797
|
-
return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
|
|
1798
|
-
}
|
|
1799
|
-
/**
|
|
1800
|
-
* @deprecated instead of `useArrayProp(width)` use `Array.isArray(width) ? width : [width]` instead
|
|
1801
|
-
* @beta
|
|
1802
|
-
*/
|
|
1803
|
-
function useArrayProp(val, defaultVal) {
|
|
1804
|
-
let $ = (0, react_compiler_runtime.c)(3), t0;
|
|
1805
|
-
return $[0] !== defaultVal || $[1] !== val ? (t0 = require_portalProvider.ft(val, defaultVal), $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2], t0;
|
|
1806
|
-
}
|
|
1807
|
-
function _getElements(element, elementsArg) {
|
|
1808
|
-
let ret = [element];
|
|
1809
|
-
for (let el of elementsArg) Array.isArray(el) ? ret.push(...el) : ret.push(el);
|
|
1810
|
-
return ret.filter(Boolean);
|
|
1811
|
-
}
|
|
1812
|
-
/**
|
|
1813
|
-
* @public
|
|
1814
|
-
* @deprecated replaced by the new `useClickOutsideEvent` hook, instead of:
|
|
1815
|
-
* ```tsx
|
|
1816
|
-
* const [button, setButtonElement] = useState(null)
|
|
1817
|
-
* useClickOutside((event) => {}, [button])
|
|
1818
|
-
* return <button ref={setButtonElement} />
|
|
1819
|
-
* ```
|
|
1820
|
-
* do:
|
|
1821
|
-
* ```tsx
|
|
1822
|
-
* const buttonRef = useRef()
|
|
1823
|
-
* useClickOutsideEvent((event) => {}, () => [buttonRef.current])
|
|
1824
|
-
* return <button ref={buttonRef} />
|
|
1825
|
-
* ```
|
|
1826
|
-
*/
|
|
1827
|
-
function useClickOutside(listener, t0, boundaryElement) {
|
|
1828
|
-
let $ = (0, react_compiler_runtime.c)(12), elementsArg = t0 === void 0 ? require_portalProvider.wt : t0, [element, setElement] = (0, react.useState)(null), t1;
|
|
1829
|
-
$[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
|
|
1830
|
-
let [elements, setElements] = (0, react.useState)(t1), elementsRef = (0, react.useRef)(elements), t2, t3;
|
|
1831
|
-
$[3] !== element || $[4] !== elementsArg ? (t2 = () => {
|
|
1832
|
-
let prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
|
|
1833
|
-
if (prevElements.length !== nextElements.length) {
|
|
1834
|
-
setElements(nextElements), elementsRef.current = nextElements;
|
|
1835
|
-
return;
|
|
1836
|
-
}
|
|
1837
|
-
for (let el of prevElements) if (!nextElements.includes(el)) {
|
|
1838
|
-
setElements(nextElements), elementsRef.current = nextElements;
|
|
1839
|
-
return;
|
|
1840
|
-
}
|
|
1841
|
-
for (let el_0 of nextElements) if (!prevElements.includes(el_0)) {
|
|
1842
|
-
setElements(nextElements), elementsRef.current = nextElements;
|
|
1843
|
-
return;
|
|
1844
|
-
}
|
|
1845
|
-
}, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), (0, react.useEffect)(t2, t3);
|
|
1846
|
-
let t4, t5;
|
|
1847
|
-
return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
|
|
1848
|
-
if (!listener) return;
|
|
1849
|
-
let handleWindowMouseDown = (evt) => {
|
|
1850
|
-
let target = evt.target;
|
|
1851
|
-
if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
|
|
1852
|
-
for (let el_1 of elements) if (target === el_1 || el_1.contains(target)) return;
|
|
1853
|
-
listener(evt);
|
|
1854
|
-
}
|
|
1855
|
-
};
|
|
1856
|
-
return window.addEventListener("mousedown", handleWindowMouseDown), () => {
|
|
1857
|
-
window.removeEventListener("mousedown", handleWindowMouseDown);
|
|
1858
|
-
};
|
|
1859
|
-
}, t5 = [
|
|
1860
|
-
boundaryElement,
|
|
1861
|
-
listener,
|
|
1862
|
-
elements
|
|
1863
|
-
], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), (0, react.useEffect)(t4, t5), setElement;
|
|
1864
|
-
}
|
|
1865
|
-
/**
|
|
1866
|
-
* Subscribe to the rect of a DOM element.
|
|
1867
|
-
* @beta
|
|
1868
|
-
*
|
|
1869
|
-
* @deprecated Use `useElementSize` instead
|
|
1870
|
-
*/
|
|
1871
|
-
function useElementRect(element) {
|
|
1872
|
-
return require_portalProvider.V(element)?._contentRect || null;
|
|
1873
|
-
}
|
|
1874
|
-
/**
|
|
1875
|
-
* @beta
|
|
1876
|
-
* @deprecated use `useImperativeHandle` instead
|
|
1877
|
-
* @example
|
|
1878
|
-
* ```diff
|
|
1879
|
-
* -const ref = useForwardedRef(forwardedRef)
|
|
1880
|
-
* +const ref = useRef(null)
|
|
1881
|
-
* +useImperativeHandle(forwardedRef, () => ref.current)
|
|
1882
|
-
* ```
|
|
1883
|
-
*/
|
|
1884
|
-
function useForwardedRef(ref) {
|
|
1885
|
-
let $ = (0, react_compiler_runtime.c)(1), innerRef = (0, react.useRef)(null), t0;
|
|
1886
|
-
return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], (0, react.useImperativeHandle)(ref, t0), innerRef;
|
|
1887
|
-
}
|
|
1888
|
-
/**
|
|
1889
|
-
* Get responsive CSS for the `label` font style.
|
|
1890
|
-
* @internal
|
|
1891
|
-
*/
|
|
1892
|
-
function responsiveLabelFont(props) {
|
|
1893
|
-
return require_portalProvider.rt("label", props);
|
|
1894
|
-
}
|
|
1895
|
-
function labelBaseStyle(props) {
|
|
1896
|
-
let { $accent, $muted } = props, { font } = require_getScopedTheme.i(props.theme);
|
|
1897
|
-
return styled_components.css`text-transform:uppercase;${$accent && styled_components.css`color:var(--card-accent-fg-color);`} ${$muted && styled_components.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;}`;
|
|
1898
|
-
}
|
|
1899
|
-
const StyledLabel = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
1900
|
-
displayName: "StyledLabel",
|
|
1901
|
-
componentId: "sc-6qcmll-0"
|
|
1902
|
-
})(responsiveLabelFont, require_portalProvider.it, labelBaseStyle), Label = (0, react.forwardRef)(function Label(props, ref) {
|
|
1903
|
-
let $ = (0, react_compiler_runtime.c)(26), accent, align, childrenProp, restProps, t0, t1, textOverflow, weight;
|
|
1904
|
-
$[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);
|
|
1905
|
-
let muted = t0 !== void 0 && t0, size = t1 === void 0 ? 2 : t1, children = childrenProp;
|
|
1906
|
-
if (textOverflow === "ellipsis") {
|
|
1907
|
-
let t2;
|
|
1908
|
-
$[9] === children ? t2 = $[10] : (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.tt, { children }), $[9] = children, $[10] = t2), children = t2;
|
|
1909
|
-
} else {
|
|
1910
|
-
let t2;
|
|
1911
|
-
$[11] === children ? t2 = $[12] : (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children }), $[11] = children, $[12] = t2), children = t2;
|
|
1912
|
-
}
|
|
1913
|
-
let t2;
|
|
1914
|
-
$[13] === align ? t2 = $[14] : (t2 = require_portalProvider.ft(align), $[13] = align, $[14] = t2);
|
|
1915
|
-
let t3;
|
|
1916
|
-
$[15] === size ? t3 = $[16] : (t3 = require_portalProvider.ft(size), $[15] = size, $[16] = t3);
|
|
1917
|
-
let t4;
|
|
1918
|
-
return $[17] !== accent || $[18] !== children || $[19] !== muted || $[20] !== ref || $[21] !== restProps || $[22] !== t2 || $[23] !== t3 || $[24] !== weight ? (t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledLabel, {
|
|
1919
|
-
"data-ui": "Label",
|
|
1920
|
-
...restProps,
|
|
1921
|
-
$accent: accent,
|
|
1922
|
-
$align: t2,
|
|
1923
|
-
$muted: muted,
|
|
1924
|
-
$size: t3,
|
|
1925
|
-
$weight: weight,
|
|
1926
|
-
ref,
|
|
1927
|
-
children
|
|
1928
|
-
}), $[17] = accent, $[18] = children, $[19] = muted, $[20] = ref, $[21] = restProps, $[22] = t2, $[23] = t3, $[24] = weight, $[25] = t4) : t4 = $[25], t4;
|
|
1929
|
-
}), avatarStyle = {
|
|
1930
|
-
root: avatarRootStyle,
|
|
1931
|
-
arrow: avatarArrowStyle,
|
|
1932
|
-
bgStroke: avatarBgStrokeStyle,
|
|
1933
|
-
stroke: avatarStrokeStyle,
|
|
1934
|
-
initials: avatarInitialsStyle,
|
|
1935
|
-
image: avatarImageStyle
|
|
1936
|
-
};
|
|
1937
|
-
function avatarArrowStyle() {
|
|
1938
|
-
return {
|
|
1939
|
-
position: "absolute",
|
|
1940
|
-
boxSizing: "border-box",
|
|
1941
|
-
zIndex: "0",
|
|
1942
|
-
opacity: "0",
|
|
1943
|
-
transition: "all 0.2s linear",
|
|
1944
|
-
transform: "rotate(-90deg) translate3d(0, 6px, 0)",
|
|
1945
|
-
left: 0,
|
|
1946
|
-
right: 0,
|
|
1947
|
-
top: 0,
|
|
1948
|
-
bottom: 0,
|
|
1949
|
-
"& > svg": {
|
|
1950
|
-
width: "11px",
|
|
1951
|
-
height: "7px",
|
|
1952
|
-
position: "absolute",
|
|
1953
|
-
top: "-5px",
|
|
1954
|
-
left: "50%",
|
|
1955
|
-
transform: "translateX(-6px)",
|
|
1956
|
-
"&:not([hidden])": { display: "block" }
|
|
1957
|
-
},
|
|
1958
|
-
"[data-arrow-position='inside'] > &": {
|
|
1959
|
-
transform: "rotate(-90deg) translate3d(0, 6px, 0)",
|
|
1960
|
-
opacity: "0"
|
|
1961
|
-
},
|
|
1962
|
-
"[data-arrow-position='top'] > &": {
|
|
1963
|
-
opacity: "1",
|
|
1964
|
-
transform: "rotate(0deg)"
|
|
1965
|
-
},
|
|
1966
|
-
"[data-arrow-position='bottom'] > &": {
|
|
1967
|
-
opacity: "1",
|
|
1968
|
-
transform: "rotate(-180deg)"
|
|
1969
|
-
}
|
|
1970
|
-
};
|
|
1971
|
-
}
|
|
1972
|
-
function avatarRootStyle(props) {
|
|
1973
|
-
let { $color } = props, { avatar } = require_getScopedTheme.i(props.theme);
|
|
1974
|
-
return {
|
|
1975
|
-
"--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
|
|
1976
|
-
"--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
|
|
1977
|
-
backgroundColor: "var(--avatar-bg-color)",
|
|
1978
|
-
position: "relative",
|
|
1979
|
-
boxSizing: "border-box",
|
|
1980
|
-
userSelect: "none",
|
|
1981
|
-
boxShadow: "0 0 0 1px var(--card-bg-color)",
|
|
1982
|
-
"&[data-status=\"inactive\"]": { opacity: "0.5" },
|
|
1983
|
-
"&>svg": { "&:not([hidden])": { display: "block" } },
|
|
1984
|
-
"&[data-as=\"button\"]": {
|
|
1985
|
-
WebkitFontSmoothing: "inherit",
|
|
1986
|
-
appearance: "none",
|
|
1987
|
-
margin: 0,
|
|
1988
|
-
padding: 0,
|
|
1989
|
-
border: 0,
|
|
1990
|
-
font: "inherit",
|
|
1991
|
-
color: "inherit",
|
|
1992
|
-
outline: "none",
|
|
1993
|
-
"&:focus": { boxShadow: require_portalProvider.Z({ focusRing: avatar.focusRing }) },
|
|
1994
|
-
"&:focus:not(:focus-visible)": { boxShadow: "none" }
|
|
1995
|
-
}
|
|
1996
|
-
};
|
|
1997
|
-
}
|
|
1998
|
-
function responsiveAvatarSizeStyle(props) {
|
|
1999
|
-
let { avatar, media } = require_getScopedTheme.i(props.theme);
|
|
2000
|
-
return require_portalProvider.mt(media, props.$size, (size) => {
|
|
2001
|
-
let avatarSize = avatar.sizes[size] || avatar.sizes[0];
|
|
2002
|
-
return {
|
|
2003
|
-
width: require_portalProvider.ht(avatarSize.size),
|
|
2004
|
-
height: require_portalProvider.ht(avatarSize.size),
|
|
2005
|
-
borderRadius: require_portalProvider.ht(avatarSize.size / 2),
|
|
2006
|
-
"&>svg": {
|
|
2007
|
-
width: require_portalProvider.ht(avatarSize.size),
|
|
2008
|
-
height: require_portalProvider.ht(avatarSize.size),
|
|
2009
|
-
borderRadius: require_portalProvider.ht(avatarSize.size / 2)
|
|
2010
|
-
}
|
|
2011
|
-
};
|
|
2012
|
-
});
|
|
2013
|
-
}
|
|
2014
|
-
function avatarImageStyle() {
|
|
2015
|
-
return { position: "relative" };
|
|
2016
|
-
}
|
|
2017
|
-
function avatarInitialsStyle() {
|
|
2018
|
-
return {
|
|
2019
|
-
width: "100%",
|
|
2020
|
-
height: "100%",
|
|
2021
|
-
color: "var(--avatar-fg-color)",
|
|
2022
|
-
alignItems: "center",
|
|
2023
|
-
justifyContent: "center",
|
|
2024
|
-
textTransform: "uppercase",
|
|
2025
|
-
textAlign: "center",
|
|
2026
|
-
borderRadius: "50%",
|
|
2027
|
-
"&:not([hidden])": { display: "flex" }
|
|
2028
|
-
};
|
|
2029
|
-
}
|
|
2030
|
-
function avatarBgStrokeStyle() {
|
|
2031
|
-
return {
|
|
2032
|
-
strokeWidth: "4px",
|
|
2033
|
-
stroke: "var(--card-bg-color)"
|
|
2034
|
-
};
|
|
2035
|
-
}
|
|
2036
|
-
function avatarStrokeStyle() {
|
|
2037
|
-
return {
|
|
2038
|
-
strokeWidth: "2px",
|
|
2039
|
-
stroke: "var(--avatar-bg-color)",
|
|
2040
|
-
"[data-status=\"editing\"] &": {
|
|
2041
|
-
strokeDasharray: "2 4",
|
|
2042
|
-
strokeLinecap: "round"
|
|
2043
|
-
}
|
|
2044
|
-
};
|
|
2045
|
-
}
|
|
2046
|
-
const StyledAvatar = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
2047
|
-
displayName: "StyledAvatar",
|
|
2048
|
-
componentId: "sc-hfmugy-0"
|
|
2049
|
-
})(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1 = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
2050
|
-
displayName: "Arrow",
|
|
2051
|
-
componentId: "sc-hfmugy-1"
|
|
2052
|
-
})(avatarStyle.arrow), BgStroke = /* @__PURE__ */ styled_components.styled.ellipse.withConfig({
|
|
2053
|
-
displayName: "BgStroke",
|
|
2054
|
-
componentId: "sc-hfmugy-2"
|
|
2055
|
-
})(avatarStyle.bgStroke), Stroke = /* @__PURE__ */ styled_components.styled.ellipse.withConfig({
|
|
2056
|
-
displayName: "Stroke",
|
|
2057
|
-
componentId: "sc-hfmugy-3"
|
|
2058
|
-
})(avatarStyle.stroke), Initials = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
2059
|
-
displayName: "Initials",
|
|
2060
|
-
componentId: "sc-hfmugy-4"
|
|
2061
|
-
})(avatarStyle.initials), InitialsLabel = /* @__PURE__ */ (0, styled_components.styled)(Label).withConfig({
|
|
2062
|
-
displayName: "InitialsLabel",
|
|
2063
|
-
componentId: "sc-hfmugy-5"
|
|
2064
|
-
})({ color: "inherit" }), AvatarImage = /* @__PURE__ */ styled_components.styled.svg.withConfig({
|
|
2065
|
-
displayName: "AvatarImage",
|
|
2066
|
-
componentId: "sc-hfmugy-6"
|
|
2067
|
-
})(avatarStyle.image), Avatar = (0, react.forwardRef)(function Avatar(props, ref) {
|
|
2068
|
-
let $ = (0, react_compiler_runtime.c)(46), __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
|
|
2069
|
-
$[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);
|
|
2070
|
-
let color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, { avatar } = require_portalProvider.st(), as = react_is.default.isValidElementType(asProp) ? asProp : "div", size = require_portalProvider.ft(sizeProp), _sizeRem = (avatar.sizes[size[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = (0, react.useId)(), [arrowPosition, setArrowPosition] = (0, react.useState)(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = (0, react.useState)(!1), imageId = `avatar-image-${elementId}`, t3, t4;
|
|
2071
|
-
$[13] !== arrowPosition || $[14] !== arrowPositionProp ? (t3 = () => {
|
|
2072
|
-
if (arrowPosition === arrowPositionProp) return;
|
|
2073
|
-
let raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
|
|
2074
|
-
return () => cancelAnimationFrame(raf);
|
|
2075
|
-
}, t4 = [arrowPosition, arrowPositionProp], $[13] = arrowPosition, $[14] = arrowPositionProp, $[15] = t3, $[16] = t4) : (t3 = $[15], t4 = $[16]), (0, react.useEffect)(t3, t4);
|
|
2076
|
-
let t5, t6;
|
|
2077
|
-
$[17] === src ? (t5 = $[18], t6 = $[19]) : (t5 = () => {
|
|
2078
|
-
src && setImageFailed(!1);
|
|
2079
|
-
}, t6 = [src], $[17] = src, $[18] = t5, $[19] = t6), (0, react.useEffect)(t5, t6);
|
|
2080
|
-
let t7;
|
|
2081
|
-
$[20] === onImageLoadError ? t7 = $[21] : (t7 = () => {
|
|
2082
|
-
setImageFailed(!0), onImageLoadError && onImageLoadError(/* @__PURE__ */ Error("Avatar: the image failed to load"));
|
|
2083
|
-
}, $[20] = onImageLoadError, $[21] = t7);
|
|
2084
|
-
let handleImageError = t7, T0 = StyledAvatar, t8 = typeof as == "string" ? as : void 0, t10;
|
|
2085
|
-
$[22] === color ? t10 = $[23] : (t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Arrow$1, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
2086
|
-
width: "11",
|
|
2087
|
-
height: "7",
|
|
2088
|
-
viewBox: "0 0 11 7",
|
|
2089
|
-
fill: "none",
|
|
2090
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
2091
|
-
d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z",
|
|
2092
|
-
fill: color
|
|
2093
|
-
})
|
|
2094
|
-
}) }), $[22] = color, $[23] = t10);
|
|
2095
|
-
let t11;
|
|
2096
|
-
$[24] !== __unstable_hideInnerStroke || $[25] !== _radius || $[26] !== _sizeRem || $[27] !== handleImageError || $[28] !== imageFailed || $[29] !== imageId || $[30] !== src ? (t11 = !imageFailed && src && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AvatarImage, {
|
|
2097
|
-
viewBox: `0 0 ${_sizeRem} ${_sizeRem}`,
|
|
2098
|
-
fill: "none",
|
|
2099
|
-
children: [
|
|
2100
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pattern", {
|
|
2101
|
-
id: imageId,
|
|
2102
|
-
patternContentUnits: "objectBoundingBox",
|
|
2103
|
-
width: "1",
|
|
2104
|
-
height: "1",
|
|
2105
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("image", {
|
|
2106
|
-
href: src,
|
|
2107
|
-
width: "1",
|
|
2108
|
-
height: "1",
|
|
2109
|
-
onError: handleImageError
|
|
2110
|
-
})
|
|
2111
|
-
}) }),
|
|
2112
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
2113
|
-
cx: _radius,
|
|
2114
|
-
cy: _radius,
|
|
2115
|
-
r: _radius,
|
|
2116
|
-
fill: `url(#${imageId})`
|
|
2117
|
-
}),
|
|
2118
|
-
!__unstable_hideInnerStroke && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BgStroke, {
|
|
2119
|
-
cx: _radius,
|
|
2120
|
-
cy: _radius,
|
|
2121
|
-
rx: _radius,
|
|
2122
|
-
ry: _radius,
|
|
2123
|
-
vectorEffect: "non-scaling-stroke"
|
|
2124
|
-
}),
|
|
2125
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Stroke, {
|
|
2126
|
-
cx: _radius,
|
|
2127
|
-
cy: _radius,
|
|
2128
|
-
rx: _radius,
|
|
2129
|
-
ry: _radius,
|
|
2130
|
-
vectorEffect: "non-scaling-stroke"
|
|
2131
|
-
})
|
|
2132
|
-
]
|
|
2133
|
-
}), $[24] = __unstable_hideInnerStroke, $[25] = _radius, $[26] = _sizeRem, $[27] = handleImageError, $[28] = imageFailed, $[29] = imageId, $[30] = src, $[31] = t11) : t11 = $[31];
|
|
2134
|
-
let t12 = (imageFailed || !src) && initials && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Initials, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InitialsLabel, {
|
|
2135
|
-
forwardedAs: "span",
|
|
2136
|
-
size: size.map(_temp$1),
|
|
2137
|
-
weight: "medium",
|
|
2138
|
-
children: initials
|
|
2139
|
-
}) }) }), t13;
|
|
2140
|
-
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__ */ (0, react_jsx_runtime.jsxs)(T0, {
|
|
2141
|
-
as,
|
|
2142
|
-
"data-as": t8,
|
|
2143
|
-
"data-ui": "Avatar",
|
|
2144
|
-
...restProps,
|
|
2145
|
-
$color: color,
|
|
2146
|
-
$size: size,
|
|
2147
|
-
"aria-label": title,
|
|
2148
|
-
"data-arrow-position": arrowPosition,
|
|
2149
|
-
"data-status": status,
|
|
2150
|
-
ref,
|
|
2151
|
-
title,
|
|
2152
|
-
children: [
|
|
2153
|
-
t10,
|
|
2154
|
-
t11,
|
|
2155
|
-
t12
|
|
2156
|
-
]
|
|
2157
|
-
}), $[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;
|
|
2158
|
-
});
|
|
2159
|
-
function _temp$1(s) {
|
|
2160
|
-
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
2161
|
-
}
|
|
2162
|
-
function _responsiveAvatarCounterSizeStyle(props) {
|
|
2163
|
-
let { avatar, media } = require_getScopedTheme.i(props.theme);
|
|
2164
|
-
return require_portalProvider.mt(media, props.$size, (size) => {
|
|
2165
|
-
let avatarSize = avatar.sizes[size];
|
|
2166
|
-
return avatarSize ? {
|
|
2167
|
-
borderRadius: require_portalProvider.ht(avatarSize.size / 2),
|
|
2168
|
-
minWidth: require_portalProvider.ht(avatarSize.size),
|
|
2169
|
-
height: require_portalProvider.ht(avatarSize.size)
|
|
2170
|
-
} : require_portalProvider.Tt;
|
|
2171
|
-
});
|
|
2172
|
-
}
|
|
2173
|
-
function _avatarCounterBaseStyle(props) {
|
|
2174
|
-
let { space } = require_getScopedTheme.i(props.theme);
|
|
2175
|
-
return styled_components.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 ${require_portalProvider.ht(space[2])};&:not([hidden]){display:flex;}`;
|
|
2176
|
-
}
|
|
2177
|
-
const StyledAvatarCounter = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
2178
|
-
displayName: "StyledAvatarCounter",
|
|
2179
|
-
componentId: "sc-miwe8s-0"
|
|
2180
|
-
})(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = (0, react.forwardRef)(function AvatarCounter(props, ref) {
|
|
2181
|
-
let $ = (0, react_compiler_runtime.c)(20), { count, size: t0 } = props, sizeProp = t0 === void 0 ? 1 : t0, T0, T1, t1, t2, t3, t4, t5;
|
|
2182
|
-
if ($[0] !== ref || $[1] !== sizeProp) {
|
|
2183
|
-
let size = require_portalProvider.ft(sizeProp);
|
|
2184
|
-
T1 = StyledAvatarCounter, t3 = size, t4 = "AvatarCounter", t5 = ref, T0 = Label, t1 = "span", t2 = size.map(_temp), $[0] = ref, $[1] = sizeProp, $[2] = T0, $[3] = T1, $[4] = t1, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5;
|
|
2185
|
-
} else T0 = $[2], T1 = $[3], t1 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8];
|
|
2186
|
-
let t6;
|
|
2187
|
-
$[9] !== T0 || $[10] !== count || $[11] !== t1 || $[12] !== t2 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(T0, {
|
|
2188
|
-
as: t1,
|
|
2189
|
-
size: t2,
|
|
2190
|
-
weight: "medium",
|
|
2191
|
-
children: count
|
|
2192
|
-
}), $[9] = T0, $[10] = count, $[11] = t1, $[12] = t2, $[13] = t6) : t6 = $[13];
|
|
2193
|
-
let t7;
|
|
2194
|
-
return $[14] !== T1 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(T1, {
|
|
2195
|
-
$size: t3,
|
|
2196
|
-
"data-ui": t4,
|
|
2197
|
-
ref: t5,
|
|
2198
|
-
children: t6
|
|
2199
|
-
}), $[14] = T1, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19], t7;
|
|
2200
|
-
});
|
|
2201
|
-
function _temp(s) {
|
|
2202
|
-
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
2203
|
-
}
|
|
2204
|
-
const BASE_STYLES = styled_components.css`white-space:nowrap;& > div{vertical-align:top;&:not([hidden]){display:inline-block;}}`;
|
|
2205
|
-
function avatarStackStyle() {
|
|
2206
|
-
return BASE_STYLES;
|
|
2207
|
-
}
|
|
2208
|
-
function responsiveAvatarStackSizeStyle(props) {
|
|
2209
|
-
let { avatar, media } = require_getScopedTheme.i(props.theme);
|
|
2210
|
-
return require_portalProvider.mt(media, props.$size, (size) => {
|
|
2211
|
-
let avatarSize = avatar.sizes[size];
|
|
2212
|
-
return avatarSize ? { "& > div + div": { marginLeft: require_portalProvider.ht(avatarSize.distance) } } : require_portalProvider.Tt;
|
|
2213
|
-
});
|
|
2214
|
-
}
|
|
2215
|
-
const StyledAvatarStack = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
2216
|
-
displayName: "StyledAvatarStack",
|
|
2217
|
-
componentId: "sc-m8rww4-0"
|
|
2218
|
-
})(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = (0, react.forwardRef)(function AvatarStack(props, ref) {
|
|
2219
|
-
let $ = (0, react_compiler_runtime.c)(38), childrenProp, restProps, t0, t1;
|
|
2220
|
-
$[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);
|
|
2221
|
-
let maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1, T0, t2, t3, t4, t5, t6, t7, t8;
|
|
2222
|
-
if ($[5] !== childrenProp || $[6] !== maxLengthProp || $[7] !== ref || $[8] !== restProps || $[9] !== sizeProp) {
|
|
2223
|
-
let children = react.Children.toArray(childrenProp).filter(react.isValidElement), maxLength = Math.max(maxLengthProp, 0), t9;
|
|
2224
|
-
$[18] === sizeProp ? t9 = $[19] : (t9 = require_portalProvider.ft(sizeProp), $[18] = sizeProp, $[19] = t9);
|
|
2225
|
-
let size = t9, len = children.length, extraCount = len - (maxLength - 1), visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
|
|
2226
|
-
T0 = StyledAvatarStack, t2 = "AvatarStack", t3 = restProps, t4 = ref, t5 = size, $[20] !== len || $[21] !== size ? (t6 = len === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AvatarCounter, {
|
|
2227
|
-
count: len,
|
|
2228
|
-
size
|
|
2229
|
-
}) }), $[20] = len, $[21] = size, $[22] = t6) : t6 = $[22], $[23] !== extraCount || $[24] !== len || $[25] !== size ? (t7 = len !== 0 && extraCount > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AvatarCounter, {
|
|
2230
|
-
count: extraCount,
|
|
2231
|
-
size
|
|
2232
|
-
}) }), $[23] = extraCount, $[24] = len, $[25] = size, $[26] = t7) : t7 = $[26];
|
|
2233
|
-
let t10;
|
|
2234
|
-
$[27] === size ? t10 = $[28] : (t10 = (child, childIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: (0, react.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;
|
|
2235
|
-
} else T0 = $[10], t2 = $[11], t3 = $[12], t4 = $[13], t5 = $[14], t6 = $[15], t7 = $[16], t8 = $[17];
|
|
2236
|
-
let t9;
|
|
2237
|
-
return $[29] !== T0 || $[30] !== t2 || $[31] !== t3 || $[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8 ? (t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(T0, {
|
|
2238
|
-
"data-ui": t2,
|
|
2239
|
-
...t3,
|
|
2240
|
-
ref: t4,
|
|
2241
|
-
$size: t5,
|
|
2242
|
-
children: [
|
|
2243
|
-
t6,
|
|
2244
|
-
t7,
|
|
2245
|
-
t8
|
|
2246
|
-
]
|
|
2247
|
-
}), $[29] = T0, $[30] = t2, $[31] = t3, $[32] = t4, $[33] = t5, $[34] = t6, $[35] = t7, $[36] = t8, $[37] = t9) : t9 = $[37], t9;
|
|
2248
|
-
});
|
|
2249
|
-
function badgeStyle(props) {
|
|
2250
|
-
let { $tone } = props;
|
|
2251
|
-
return {
|
|
2252
|
-
"--card-bg-color": `var(--card-badge-${$tone}-bg-color)`,
|
|
2253
|
-
"--card-fg-color": `var(--card-badge-${$tone}-fg-color)`,
|
|
2254
|
-
backgroundColor: "var(--card-bg-color)",
|
|
2255
|
-
cursor: "default",
|
|
2256
|
-
"&:not([hidden])": {
|
|
2257
|
-
display: "inline-block",
|
|
2258
|
-
verticalAlign: "top"
|
|
2259
|
-
}
|
|
2260
|
-
};
|
|
2261
|
-
}
|
|
2262
|
-
const StyledBadge = /* @__PURE__ */ (0, styled_components.styled)(require_portalProvider.lt).withConfig({
|
|
2263
|
-
displayName: "StyledBadge",
|
|
2264
|
-
componentId: "sc-4z4hgx-0"
|
|
2265
|
-
})(require_portalProvider.ct, badgeStyle), Badge = (0, react.forwardRef)(function Badge(props, ref) {
|
|
2266
|
-
let $ = (0, react_compiler_runtime.c)(21), children, restProps, t0, t1, t2, t3;
|
|
2267
|
-
if ($[0] !== props) {
|
|
2268
|
-
let { children: t4, fontSize: t5, mode: _deprecated_mode, padding: t6, radius: t7, tone: t8, ...t9 } = props;
|
|
2269
|
-
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;
|
|
2270
|
-
} else children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5], t3 = $[6];
|
|
2271
|
-
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;
|
|
2272
|
-
$[7] === radius ? t4 = $[8] : (t4 = require_portalProvider.ft(radius), $[7] = radius, $[8] = t4);
|
|
2273
|
-
let t5;
|
|
2274
|
-
$[9] === padding ? t5 = $[10] : (t5 = require_portalProvider.ft(padding), $[9] = padding, $[10] = t5);
|
|
2275
|
-
let t6;
|
|
2276
|
-
$[11] !== children || $[12] !== fontSize ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.et, {
|
|
2277
|
-
size: fontSize,
|
|
2278
|
-
children
|
|
2279
|
-
}), $[11] = children, $[12] = fontSize, $[13] = t6) : t6 = $[13];
|
|
2280
|
-
let t7;
|
|
2281
|
-
return $[14] !== ref || $[15] !== restProps || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 || $[19] !== tone ? (t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledBadge, {
|
|
2282
|
-
"data-ui": "Badge",
|
|
2283
|
-
...restProps,
|
|
2284
|
-
$tone: tone,
|
|
2285
|
-
$radius: t4,
|
|
2286
|
-
padding: t5,
|
|
2287
|
-
ref,
|
|
2288
|
-
children: t6
|
|
2289
|
-
}), $[14] = ref, $[15] = restProps, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = tone, $[20] = t7) : t7 = $[20], t7;
|
|
2290
|
-
});
|
|
2291
|
-
function checkboxBaseStyles() {
|
|
2292
|
-
return styled_components.css`position:relative;display:inline-block;`;
|
|
2293
|
-
}
|
|
2294
|
-
function inputElementStyles(props) {
|
|
2295
|
-
let { color, input, radius } = require_getScopedTheme.i(props.theme), { focusRing } = input.checkbox;
|
|
2296
|
-
return styled_components.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:${require_portalProvider.ht(input.checkbox.size)};width:${require_portalProvider.ht(input.checkbox.size)};box-sizing:border-box;box-shadow:${require_portalProvider.X({
|
|
2297
|
-
color: color.input.default.enabled.border,
|
|
2298
|
-
width: input.border.width
|
|
2299
|
-
})};border-radius:${require_portalProvider.ht(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:${require_portalProvider.X({
|
|
2300
|
-
color: color.input.default.enabled.fg,
|
|
2301
|
-
width: input.border.width
|
|
2302
|
-
})};color:${color.input.default.enabled.bg};}&:not(:disabled):focus:focus-visible + span{box-shadow:${require_portalProvider.Z({ focusRing })};}&:not(:disabled):focus:focus-visible&:checked + span{box-shadow:${require_portalProvider.Z({ focusRing: {
|
|
2303
|
-
width: 1,
|
|
2304
|
-
offset: 1
|
|
2305
|
-
} })};}&[data-error] + span{background-color:${color.input.invalid.enabled.border};box-shadow:${require_portalProvider.X({
|
|
2306
|
-
width: input.border.width,
|
|
2307
|
-
color: color.input.invalid.enabled.muted.bg
|
|
2308
|
-
})};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:${require_portalProvider.Z({
|
|
2309
|
-
border: {
|
|
2310
|
-
width: input.border.width,
|
|
2311
|
-
color: color.input.invalid.readOnly.muted.bg
|
|
2312
|
-
},
|
|
2313
|
-
focusRing: {
|
|
2314
|
-
width: 1,
|
|
2315
|
-
offset: 1
|
|
2316
|
-
}
|
|
2317
|
-
})};}&:disabled + span{background-color:${color.input.default.disabled.bg};box-shadow:${require_portalProvider.X({
|
|
2318
|
-
width: input.border.width,
|
|
2319
|
-
color: color.input.default.disabled.border
|
|
2320
|
-
})};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:${require_portalProvider.X({
|
|
2321
|
-
width: input.border.width,
|
|
2322
|
-
color: color.input.default.readOnly.border
|
|
2323
|
-
})};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;}`;
|
|
2324
|
-
}
|
|
2325
|
-
const StyledCheckbox = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
2326
|
-
displayName: "StyledCheckbox",
|
|
2327
|
-
componentId: "sc-33tf77-0"
|
|
2328
|
-
})(checkboxBaseStyles), Input$4 = /* @__PURE__ */ styled_components.styled.input.withConfig({
|
|
2329
|
-
displayName: "Input",
|
|
2330
|
-
componentId: "sc-33tf77-1"
|
|
2331
|
-
})(inputElementStyles), Checkbox = (0, react.forwardRef)(function Checkbox(props, forwardedRef) {
|
|
2332
|
-
let $ = (0, react_compiler_runtime.c)(25), checked, className, customValidity, disabled, indeterminate, readOnly, restProps, style;
|
|
2333
|
-
$[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);
|
|
2334
|
-
let ref = (0, react.useRef)(null), t0;
|
|
2335
|
-
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[9] = t0) : t0 = $[9], (0, react.useImperativeHandle)(forwardedRef, t0);
|
|
2336
|
-
let t1, t2;
|
|
2337
|
-
$[10] === indeterminate ? (t1 = $[11], t2 = $[12]) : (t1 = () => {
|
|
2338
|
-
ref.current && (ref.current.indeterminate = indeterminate || !1);
|
|
2339
|
-
}, t2 = [indeterminate], $[10] = indeterminate, $[11] = t1, $[12] = t2), (0, react.useEffect)(t1, t2), require_portalProvider.D(ref, customValidity);
|
|
2340
|
-
let t3 = !disabled && readOnly ? "" : void 0, t4 = customValidity ? "" : void 0, t5 = disabled || readOnly, t6;
|
|
2341
|
-
$[13] !== checked || $[14] !== readOnly || $[15] !== restProps || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input$4, {
|
|
2342
|
-
"data-read-only": t3,
|
|
2343
|
-
"data-error": t4,
|
|
2344
|
-
...restProps,
|
|
2345
|
-
checked,
|
|
2346
|
-
disabled: t5,
|
|
2347
|
-
type: "checkbox",
|
|
2348
|
-
readOnly,
|
|
2349
|
-
ref
|
|
2350
|
-
}), $[13] = checked, $[14] = readOnly, $[15] = restProps, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6) : t6 = $[19];
|
|
2351
|
-
let t7;
|
|
2352
|
-
$[20] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_sanity_icons_Checkmark.CheckmarkIcon, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_sanity_icons_Remove.RemoveIcon, {})] }), $[20] = t7) : t7 = $[20];
|
|
2353
|
-
let t8;
|
|
2354
|
-
return $[21] !== className || $[22] !== style || $[23] !== t6 ? (t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledCheckbox, {
|
|
2355
|
-
className,
|
|
2356
|
-
"data-ui": "Checkbox",
|
|
2357
|
-
style,
|
|
2358
|
-
children: [t6, t7]
|
|
2359
|
-
}), $[21] = className, $[22] = style, $[23] = t6, $[24] = t8) : t8 = $[24], t8;
|
|
2360
|
-
});
|
|
2361
|
-
/**
|
|
2362
|
-
* Get responsive CSS for the `code` font style.
|
|
2363
|
-
* @internal
|
|
2364
|
-
*/
|
|
2365
|
-
function responsiveCodeFontStyle(props) {
|
|
2366
|
-
return require_portalProvider.rt("code", props);
|
|
2367
|
-
}
|
|
2368
|
-
function codeSyntaxHighlightingStyle({ theme }) {
|
|
2369
|
-
let { color: { syntax: color } } = require_getScopedTheme.i(theme);
|
|
2370
|
-
return {
|
|
2371
|
-
"&.atrule": { color: color.atrule },
|
|
2372
|
-
"&.attr-name": { color: color.attrName },
|
|
2373
|
-
"&.attr-value": { color: color.attrValue },
|
|
2374
|
-
"&.attribute": { color: color.attribute },
|
|
2375
|
-
"&.boolean": { color: color.boolean },
|
|
2376
|
-
"&.builtin": { color: color.builtin },
|
|
2377
|
-
"&.cdata": { color: color.cdata },
|
|
2378
|
-
"&.char": { color: color.char },
|
|
2379
|
-
"&.class": { color: color.class },
|
|
2380
|
-
"&.class-name": { color: color.className },
|
|
2381
|
-
"&.comment": { color: color.comment },
|
|
2382
|
-
"&.constant": { color: color.constant },
|
|
2383
|
-
"&.deleted": { color: color.deleted },
|
|
2384
|
-
"&.doctype": { color: color.doctype },
|
|
2385
|
-
"&.entity": { color: color.entity },
|
|
2386
|
-
"&.function": { color: color.function },
|
|
2387
|
-
"&.hexcode": { color: color.hexcode },
|
|
2388
|
-
"&.id": { color: color.id },
|
|
2389
|
-
"&.important": { color: color.important },
|
|
2390
|
-
"&.inserted": { color: color.inserted },
|
|
2391
|
-
"&.keyword": { color: color.keyword },
|
|
2392
|
-
"&.number": { color: color.number },
|
|
2393
|
-
"&.operator": { color: color.operator },
|
|
2394
|
-
"&.prolog": { color: color.prolog },
|
|
2395
|
-
"&.property": { color: color.property },
|
|
2396
|
-
"&.pseudo-class": { color: color.pseudoClass },
|
|
2397
|
-
"&.pseudo-element": { color: color.pseudoElement },
|
|
2398
|
-
"&.punctuation": { color: color.punctuation },
|
|
2399
|
-
"&.regex": { color: color.regex },
|
|
2400
|
-
"&.selector": { color: color.selector },
|
|
2401
|
-
"&.string": { color: color.string },
|
|
2402
|
-
"&.symbol": { color: color.symbol },
|
|
2403
|
-
"&.tag": { color: color.tag },
|
|
2404
|
-
"&.unit": { color: color.unit },
|
|
2405
|
-
"&.url": { color: color.url },
|
|
2406
|
-
"&.variable": { color: color.variable }
|
|
2407
|
-
};
|
|
2408
|
-
}
|
|
2409
|
-
function codeBaseStyle() {
|
|
2410
|
-
return styled_components.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;}`;
|
|
2411
|
-
}
|
|
2412
|
-
const LazyRefractor = (0, react.lazy)(() => Promise.resolve().then(() => require("./_chunks/refractor.cjs"))), StyledCode = /* @__PURE__ */ styled_components.styled.pre.withConfig({
|
|
2413
|
-
displayName: "StyledCode",
|
|
2414
|
-
componentId: "sc-4i8yh-0"
|
|
2415
|
-
})(codeBaseStyle, responsiveCodeFontStyle), Code = (0, react.forwardRef)(function Code(props, ref) {
|
|
2416
|
-
let $ = (0, react_compiler_runtime.c)(22), children, language, restProps, t0, weight;
|
|
2417
|
-
$[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);
|
|
2418
|
-
let size = t0 === void 0 ? 2 : t0, t1;
|
|
2419
|
-
$[6] === size ? t1 = $[7] : (t1 = require_portalProvider.ft(size), $[6] = size, $[7] = t1);
|
|
2420
|
-
let t2 = weight, t3;
|
|
2421
|
-
$[8] === children ? t3 = $[9] : (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children }), $[8] = children, $[9] = t3);
|
|
2422
|
-
let t4;
|
|
2423
|
-
$[10] !== children || $[11] !== language ? (t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LazyRefractor, {
|
|
2424
|
-
language,
|
|
2425
|
-
value: children
|
|
2426
|
-
}), $[10] = children, $[11] = language, $[12] = t4) : t4 = $[12];
|
|
2427
|
-
let t5;
|
|
2428
|
-
$[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
|
|
2429
|
-
fallback: t3,
|
|
2430
|
-
children: t4
|
|
2431
|
-
}), $[13] = t3, $[14] = t4, $[15] = t5) : t5 = $[15];
|
|
2432
|
-
let t6;
|
|
2433
|
-
return $[16] !== ref || $[17] !== restProps || $[18] !== t1 || $[19] !== t2 || $[20] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledCode, {
|
|
2434
|
-
"data-ui": "Code",
|
|
2435
|
-
...restProps,
|
|
2436
|
-
$size: t1,
|
|
2437
|
-
$weight: t2,
|
|
2438
|
-
ref,
|
|
2439
|
-
children: t5
|
|
2440
|
-
}), $[16] = ref, $[17] = restProps, $[18] = t1, $[19] = t2, $[20] = t5, $[21] = t6) : t6 = $[21], t6;
|
|
2441
|
-
});
|
|
2442
|
-
/**
|
|
2443
|
-
* Get responsive CSS for the `heading` font style.
|
|
2444
|
-
* @internal
|
|
2445
|
-
*/
|
|
2446
|
-
function responsiveHeadingFont(props) {
|
|
2447
|
-
return require_portalProvider.rt("heading", props);
|
|
2448
|
-
}
|
|
2449
|
-
function headingBaseStyle(props) {
|
|
2450
|
-
let { $accent, $muted } = props, { font } = require_getScopedTheme.i(props.theme);
|
|
2451
|
-
return styled_components.css`${$accent && styled_components.css`color:var(--card-accent-fg-color);`} ${$muted && styled_components.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;}`;
|
|
2452
|
-
}
|
|
2453
|
-
const StyledHeading = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
2454
|
-
displayName: "StyledHeading",
|
|
2455
|
-
componentId: "sc-kfxezu-0"
|
|
2456
|
-
})(headingBaseStyle, require_portalProvider.it, responsiveHeadingFont), Heading = (0, react.forwardRef)(function Heading(props, ref) {
|
|
2457
|
-
let $ = (0, react_compiler_runtime.c)(26), align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
|
|
2458
|
-
$[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);
|
|
2459
|
-
let accent = t0 !== void 0 && t0, muted = t1 !== void 0 && t1, size = t2 === void 0 ? 2 : t2, children = childrenProp;
|
|
2460
|
-
if (textOverflow === "ellipsis") {
|
|
2461
|
-
let t3;
|
|
2462
|
-
$[9] === children ? t3 = $[10] : (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.tt, { children }), $[9] = children, $[10] = t3), children = t3;
|
|
2463
|
-
}
|
|
2464
|
-
let t3;
|
|
2465
|
-
$[11] === align ? t3 = $[12] : (t3 = require_portalProvider.ft(align), $[11] = align, $[12] = t3);
|
|
2466
|
-
let t4;
|
|
2467
|
-
$[13] === size ? t4 = $[14] : (t4 = require_portalProvider.ft(size), $[13] = size, $[14] = t4);
|
|
2468
|
-
let t5;
|
|
2469
|
-
$[15] === children ? t5 = $[16] : (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children }), $[15] = children, $[16] = t5);
|
|
2470
|
-
let t6;
|
|
2471
|
-
return $[17] !== accent || $[18] !== muted || $[19] !== ref || $[20] !== restProps || $[21] !== t3 || $[22] !== t4 || $[23] !== t5 || $[24] !== weight ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledHeading, {
|
|
2472
|
-
"data-ui": "Heading",
|
|
2473
|
-
...restProps,
|
|
2474
|
-
$accent: accent,
|
|
2475
|
-
$align: t3,
|
|
2476
|
-
$muted: muted,
|
|
2477
|
-
$size: t4,
|
|
2478
|
-
$weight: weight,
|
|
2479
|
-
ref,
|
|
2480
|
-
children: t5
|
|
2481
|
-
}), $[17] = accent, $[18] = muted, $[19] = ref, $[20] = restProps, $[21] = t3, $[22] = t4, $[23] = t5, $[24] = weight, $[25] = t6) : t6 = $[25], t6;
|
|
2482
|
-
});
|
|
2483
|
-
function radioBaseStyle() {
|
|
2484
|
-
return styled_components.css`position:relative;&:not([hidden]){display:inline-block;}&[data-read-only]{outline:1px solid red;}`;
|
|
2485
|
-
}
|
|
2486
|
-
function inputElementStyle(props) {
|
|
2487
|
-
let { color, input } = require_getScopedTheme.i(props.theme), dist = (input.radio.size - input.radio.markSize) / 2;
|
|
2488
|
-
return styled_components.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:${require_portalProvider.ht(input.radio.size / 2)};border:none;& + span{display:block;position:relative;height:${require_portalProvider.ht(input.radio.size)};width:${require_portalProvider.ht(input.radio.size)};border-radius:${require_portalProvider.ht(input.radio.size / 2)};background:${color.input.default.enabled.bg};box-shadow:${require_portalProvider.X({
|
|
2489
|
-
color: color.input.default.enabled.border,
|
|
2490
|
-
width: input.border.width
|
|
2491
|
-
})};&::after{content:'';position:absolute;top:${require_portalProvider.ht(dist)};left:${require_portalProvider.ht(dist)};height:${require_portalProvider.ht(input.radio.markSize)};width:${require_portalProvider.ht(input.radio.markSize)};border-radius:${require_portalProvider.ht(input.radio.markSize / 2)};background:${color.input.default.enabled.fg};opacity:0;}}&:not(:disabled):focus + span{box-shadow:${require_portalProvider.Z({
|
|
2492
|
-
border: {
|
|
2493
|
-
width: input.border.width,
|
|
2494
|
-
color: color.input.default.enabled.border
|
|
2495
|
-
},
|
|
2496
|
-
focusRing: input.radio.focusRing
|
|
2497
|
-
})};}&:not(:disabled):focus:not(:focus-visible) + span{box-shadow:${require_portalProvider.X({
|
|
2498
|
-
color: color.input.default.enabled.border,
|
|
2499
|
-
width: input.border.width
|
|
2500
|
-
})};}&:checked + span::after{opacity:1;}&[data-error] + span{background-color:${color.input.invalid.enabled.border};box-shadow:${require_portalProvider.X({
|
|
2501
|
-
width: input.border.width,
|
|
2502
|
-
color: color.input.invalid.enabled.muted.bg
|
|
2503
|
-
})};&::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};}}`;
|
|
2504
|
-
}
|
|
2505
|
-
const StyledRadio = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
2506
|
-
displayName: "StyledRadio",
|
|
2507
|
-
componentId: "sc-f02knx-0"
|
|
2508
|
-
})(radioBaseStyle), Input$3 = /* @__PURE__ */ styled_components.styled.input.withConfig({
|
|
2509
|
-
displayName: "Input",
|
|
2510
|
-
componentId: "sc-f02knx-1"
|
|
2511
|
-
})(inputElementStyle), Radio = (0, react.forwardRef)(function Radio(props, forwardedRef) {
|
|
2512
|
-
let $ = (0, react_compiler_runtime.c)(19), className, customValidity, disabled, readOnly, restProps, style;
|
|
2513
|
-
$[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);
|
|
2514
|
-
let ref = (0, react.useRef)(null), t0;
|
|
2515
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[7] = t0) : t0 = $[7], (0, react.useImperativeHandle)(forwardedRef, t0), require_portalProvider.D(ref, customValidity);
|
|
2516
|
-
let t1 = !disabled && readOnly ? "" : void 0, t2 = customValidity ? "" : void 0, t3 = disabled || readOnly, t4;
|
|
2517
|
-
$[8] !== readOnly || $[9] !== restProps || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input$3, {
|
|
2518
|
-
"data-read-only": t1,
|
|
2519
|
-
"data-error": t2,
|
|
2520
|
-
...restProps,
|
|
2521
|
-
disabled: t3,
|
|
2522
|
-
readOnly,
|
|
2523
|
-
ref,
|
|
2524
|
-
type: "radio"
|
|
2525
|
-
}), $[8] = readOnly, $[9] = restProps, $[10] = t1, $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13];
|
|
2526
|
-
let t5;
|
|
2527
|
-
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {}), $[14] = t5) : t5 = $[14];
|
|
2528
|
-
let t6;
|
|
2529
|
-
return $[15] !== className || $[16] !== style || $[17] !== t4 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledRadio, {
|
|
2530
|
-
className,
|
|
2531
|
-
"data-ui": "Radio",
|
|
2532
|
-
style,
|
|
2533
|
-
children: [t4, t5]
|
|
2534
|
-
}), $[15] = className, $[16] = style, $[17] = t4, $[18] = t6) : t6 = $[18], t6;
|
|
2535
|
-
});
|
|
2536
|
-
function rootStyle() {
|
|
2537
|
-
return styled_components.css`position:relative;width:-moz-available;width:-webkit-fill-available;width:stretch;&:not([hidden]){display:inline-block;}`;
|
|
2538
|
-
}
|
|
2539
|
-
function inputBaseStyle(props) {
|
|
2540
|
-
let { font } = require_getScopedTheme.i(props.theme);
|
|
2541
|
-
return styled_components.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;}`;
|
|
2542
|
-
}
|
|
2543
|
-
function inputColorStyle(props) {
|
|
2544
|
-
let { color, input } = require_getScopedTheme.i(props.theme);
|
|
2545
|
-
return styled_components.css`background-color:${color.input.default.enabled.bg};color:${color.input.default.enabled.fg};box-shadow:${require_portalProvider.X({
|
|
2546
|
-
color: color.input.default.enabled.border,
|
|
2547
|
-
width: input.border.width
|
|
2548
|
-
})};@media (hover:hover){&:not(:disabled):hover{background-color:${color.input.default.hovered.bg};color:${color.input.default.hovered.fg};box-shadow:${require_portalProvider.X({
|
|
2549
|
-
color: color.input.default.hovered.border,
|
|
2550
|
-
width: input.border.width
|
|
2551
|
-
})};}}&:not(:disabled):focus{box-shadow:${require_portalProvider.Z({
|
|
2552
|
-
border: {
|
|
2553
|
-
width: input.border.width,
|
|
2554
|
-
color: color.input.default.enabled.border
|
|
2555
|
-
},
|
|
2556
|
-
focusRing: input.select.focusRing
|
|
2557
|
-
})};}&[data-read-only]{background-color:${color.input.default.readOnly.bg};color:${color.input.default.readOnly.fg};box-shadow:${require_portalProvider.X({
|
|
2558
|
-
color: color.input.default.readOnly.border,
|
|
2559
|
-
width: input.border.width
|
|
2560
|
-
})};}&:not([data-read-only]):disabled{background-color:${color.input.default.disabled.bg};color:${color.input.default.disabled.fg};box-shadow:${require_portalProvider.X({
|
|
2561
|
-
color: color.input.default.disabled.border,
|
|
2562
|
-
width: input.border.width
|
|
2563
|
-
})};}`;
|
|
2564
|
-
}
|
|
2565
|
-
function textSize(size) {
|
|
2566
|
-
return {
|
|
2567
|
-
fontSize: require_portalProvider.ht(size.fontSize),
|
|
2568
|
-
lineHeight: `${require_portalProvider.ht(size.lineHeight)}`
|
|
2569
|
-
};
|
|
2570
|
-
}
|
|
2571
|
-
function inputTextSizeStyle(props) {
|
|
2572
|
-
let { $fontSize } = props, { font, media } = require_getScopedTheme.i(props.theme);
|
|
2573
|
-
return require_portalProvider.mt(media, $fontSize, (sizeIndex) => textSize(font.text.sizes[sizeIndex] || font.text.sizes[2]));
|
|
2574
|
-
}
|
|
2575
|
-
function inputStyle() {
|
|
2576
|
-
return [
|
|
2577
|
-
require_portalProvider.ct,
|
|
2578
|
-
inputBaseStyle,
|
|
2579
|
-
inputColorStyle,
|
|
2580
|
-
inputTextSizeStyle,
|
|
2581
|
-
require_portalProvider.T
|
|
2582
|
-
];
|
|
2583
|
-
}
|
|
2584
|
-
function iconBoxStyle(props) {
|
|
2585
|
-
let { color } = require_getScopedTheme.i(props.theme);
|
|
2586
|
-
return styled_components.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};}`;
|
|
2587
|
-
}
|
|
2588
|
-
const selectStyle = {
|
|
2589
|
-
root: rootStyle,
|
|
2590
|
-
input: inputStyle,
|
|
2591
|
-
iconBox: iconBoxStyle
|
|
2592
|
-
}, StyledSelect = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
2593
|
-
displayName: "StyledSelect",
|
|
2594
|
-
componentId: "sc-fjdmul-0"
|
|
2595
|
-
})(selectStyle.root), Input$2 = /* @__PURE__ */ styled_components.styled.select.withConfig({
|
|
2596
|
-
displayName: "Input",
|
|
2597
|
-
componentId: "sc-fjdmul-1"
|
|
2598
|
-
})(selectStyle.input), IconBox = /* @__PURE__ */ (0, styled_components.styled)(require_portalProvider.lt).withConfig({
|
|
2599
|
-
displayName: "IconBox",
|
|
2600
|
-
componentId: "sc-fjdmul-2"
|
|
2601
|
-
})(selectStyle.iconBox), Select = (0, react.forwardRef)(function Select(props, forwardedRef) {
|
|
2602
|
-
let $ = (0, react_compiler_runtime.c)(38), children, customValidity, disabled, gap, readOnly, restProps, t0, t1, t2, t3;
|
|
2603
|
-
$[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);
|
|
2604
|
-
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 = (0, react.useRef)(null), t4;
|
|
2605
|
-
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[11] = t4) : t4 = $[11], (0, react.useImperativeHandle)(forwardedRef, t4), require_portalProvider.D(ref, customValidity);
|
|
2606
|
-
let t5 = !disabled && readOnly ? "" : void 0, t6;
|
|
2607
|
-
$[12] === fontSize ? t6 = $[13] : (t6 = require_portalProvider.ft(fontSize), $[12] = fontSize, $[13] = t6);
|
|
2608
|
-
let t7;
|
|
2609
|
-
$[14] === padding ? t7 = $[15] : (t7 = require_portalProvider.ft(padding), $[14] = padding, $[15] = t7);
|
|
2610
|
-
let t8;
|
|
2611
|
-
$[16] === radius ? t8 = $[17] : (t8 = require_portalProvider.ft(radius), $[16] = radius, $[17] = t8);
|
|
2612
|
-
let t9;
|
|
2613
|
-
$[18] === spacing ? t9 = $[19] : (t9 = require_portalProvider.ft(spacing), $[18] = spacing, $[19] = t9);
|
|
2614
|
-
let t10 = disabled || readOnly, t11;
|
|
2615
|
-
$[20] !== children || $[21] !== restProps || $[22] !== t10 || $[23] !== t5 || $[24] !== t6 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9 ? (t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input$2, {
|
|
2616
|
-
"data-read-only": t5,
|
|
2617
|
-
"data-ui": "Select",
|
|
2618
|
-
...restProps,
|
|
2619
|
-
$fontSize: t6,
|
|
2620
|
-
$padding: t7,
|
|
2621
|
-
$radius: t8,
|
|
2622
|
-
$space: t9,
|
|
2623
|
-
disabled: t10,
|
|
2624
|
-
ref,
|
|
2625
|
-
children
|
|
2626
|
-
}), $[20] = children, $[21] = restProps, $[22] = t10, $[23] = t5, $[24] = t6, $[25] = t7, $[26] = t8, $[27] = t9, $[28] = t11) : t11 = $[28];
|
|
2627
|
-
let t12;
|
|
2628
|
-
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_sanity_icons_ChevronDown.ChevronDownIcon, {}), $[29] = t12) : t12 = $[29];
|
|
2629
|
-
let t13;
|
|
2630
|
-
$[30] === fontSize ? t13 = $[31] : (t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.et, {
|
|
2631
|
-
size: fontSize,
|
|
2632
|
-
children: t12
|
|
2633
|
-
}), $[30] = fontSize, $[31] = t13);
|
|
2634
|
-
let t14;
|
|
2635
|
-
$[32] !== padding || $[33] !== t13 ? (t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconBox, {
|
|
2636
|
-
padding,
|
|
2637
|
-
children: t13
|
|
2638
|
-
}), $[32] = padding, $[33] = t13, $[34] = t14) : t14 = $[34];
|
|
2639
|
-
let t15;
|
|
2640
|
-
return $[35] !== t11 || $[36] !== t14 ? (t15 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledSelect, {
|
|
2641
|
-
"data-ui": "Select",
|
|
2642
|
-
children: [t11, t14]
|
|
2643
|
-
}), $[35] = t11, $[36] = t14, $[37] = t15) : t15 = $[37], t15;
|
|
2644
|
-
});
|
|
2645
|
-
function switchBaseStyles() {
|
|
2646
|
-
return styled_components.css`position:relative;&:not([hidden]){display:inline-block;}`;
|
|
2647
|
-
}
|
|
2648
|
-
function switchInputStyles() {
|
|
2649
|
-
return styled_components.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;`;
|
|
2650
|
-
}
|
|
2651
|
-
function switchRepresentationStyles(props) {
|
|
2652
|
-
let { color, input } = require_getScopedTheme.i(props.theme);
|
|
2653
|
-
return styled_components.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:${require_portalProvider.ht(input.switch.width)};height:${require_portalProvider.ht(input.switch.height)};border-radius:${require_portalProvider.ht(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:${require_portalProvider.Z({ 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};}`;
|
|
2654
|
-
}
|
|
2655
|
-
function switchTrackStyles(props) {
|
|
2656
|
-
let { input } = require_getScopedTheme.i(props.theme);
|
|
2657
|
-
return styled_components.css`&:not([hidden]){display:block;}background-color:var(--switch-bg-color);position:absolute;left:0;top:0;width:${require_portalProvider.ht(input.switch.width)};height:${require_portalProvider.ht(input.switch.height)};border-radius:${require_portalProvider.ht(input.switch.height / 2)};`;
|
|
2658
|
-
}
|
|
2659
|
-
function switchThumbStyles(props) {
|
|
2660
|
-
let { $indeterminate } = props, { input } = require_getScopedTheme.i(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;
|
|
2661
|
-
return styled_components.css`&:not([hidden]){display:block;}position:absolute;left:${require_portalProvider.ht(trackPadding)};top:${require_portalProvider.ht(trackPadding)};height:${require_portalProvider.ht(size)};width:${require_portalProvider.ht(size)};border-radius:${require_portalProvider.ht(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 && styled_components.css`transform:translate3d(${checkedOffset}px,0,0);`} ${$indeterminate && styled_components.css`transform:translate3d(${indeterminateOffset}px,0,0);`}`;
|
|
2662
|
-
}
|
|
2663
|
-
const StyledSwitch = /* @__PURE__ */ styled_components.styled.span.withConfig({
|
|
2664
|
-
displayName: "StyledSwitch",
|
|
2665
|
-
componentId: "sc-aod7y9-0"
|
|
2666
|
-
})(switchBaseStyles), Input$1 = /* @__PURE__ */ styled_components.styled.input.withConfig({
|
|
2667
|
-
displayName: "Input",
|
|
2668
|
-
componentId: "sc-aod7y9-1"
|
|
2669
|
-
})(switchInputStyles), Representation = /* @__PURE__ */ styled_components.styled.span.withConfig({
|
|
2670
|
-
displayName: "Representation",
|
|
2671
|
-
componentId: "sc-aod7y9-2"
|
|
2672
|
-
})(switchRepresentationStyles), Track = /* @__PURE__ */ styled_components.styled.span.withConfig({
|
|
2673
|
-
displayName: "Track",
|
|
2674
|
-
componentId: "sc-aod7y9-3"
|
|
2675
|
-
})(switchTrackStyles), Thumb = /* @__PURE__ */ styled_components.styled.span.withConfig({
|
|
2676
|
-
displayName: "Thumb",
|
|
2677
|
-
componentId: "sc-aod7y9-4"
|
|
2678
|
-
})(switchThumbStyles), Switch = (0, react.forwardRef)(function Switch(props, forwardedRef) {
|
|
2679
|
-
let $ = (0, react_compiler_runtime.c)(26), checked, className, disabled, indeterminate, readOnly, restProps, style;
|
|
2680
|
-
$[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);
|
|
2681
|
-
let ref = (0, react.useRef)(null), t0;
|
|
2682
|
-
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[8] = t0) : t0 = $[8], (0, react.useImperativeHandle)(forwardedRef, t0);
|
|
2683
|
-
let t1, t2;
|
|
2684
|
-
$[9] === indeterminate ? (t1 = $[10], t2 = $[11]) : (t1 = () => {
|
|
2685
|
-
ref.current && (ref.current.indeterminate = indeterminate || !1);
|
|
2686
|
-
}, t2 = [indeterminate], $[9] = indeterminate, $[10] = t1, $[11] = t2), (0, react.useEffect)(t1, t2);
|
|
2687
|
-
let t3 = !disabled && readOnly ? "" : void 0, t4 = indeterminate !== !0 && checked, t5 = disabled || readOnly, t6;
|
|
2688
|
-
$[12] !== restProps || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input$1, {
|
|
2689
|
-
"data-read-only": t3,
|
|
2690
|
-
...restProps,
|
|
2691
|
-
checked: t4,
|
|
2692
|
-
disabled: t5,
|
|
2693
|
-
type: "checkbox",
|
|
2694
|
-
ref
|
|
2695
|
-
}), $[12] = restProps, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16];
|
|
2696
|
-
let t7;
|
|
2697
|
-
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Track, {}), $[17] = t7) : t7 = $[17];
|
|
2698
|
-
let t8;
|
|
2699
|
-
$[18] !== checked || $[19] !== indeterminate ? (t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Representation, {
|
|
2700
|
-
"aria-hidden": !0,
|
|
2701
|
-
"data-name": "representation",
|
|
2702
|
-
children: [t7, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Thumb, {
|
|
2703
|
-
$checked: checked,
|
|
2704
|
-
$indeterminate: indeterminate
|
|
2705
|
-
})]
|
|
2706
|
-
}), $[18] = checked, $[19] = indeterminate, $[20] = t8) : t8 = $[20];
|
|
2707
|
-
let t9;
|
|
2708
|
-
return $[21] !== className || $[22] !== style || $[23] !== t6 || $[24] !== t8 ? (t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledSwitch, {
|
|
2709
|
-
className,
|
|
2710
|
-
"data-ui": "Switch",
|
|
2711
|
-
style,
|
|
2712
|
-
children: [t6, t8]
|
|
2713
|
-
}), $[21] = className, $[22] = style, $[23] = t6, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
|
|
2714
|
-
}), StyledTextArea = /* @__PURE__ */ styled_components.styled.span.withConfig({
|
|
2715
|
-
displayName: "StyledTextArea",
|
|
2716
|
-
componentId: "sc-ndqkyw-0"
|
|
2717
|
-
})(require_portalProvider.w), InputRoot = styled_components.styled.span.withConfig({
|
|
2718
|
-
displayName: "InputRoot",
|
|
2719
|
-
componentId: "sc-ndqkyw-1"
|
|
2720
|
-
})`flex:1;min-width:0;display:block;position:relative;`, Input = /* @__PURE__ */ styled_components.styled.textarea.withConfig({
|
|
2721
|
-
displayName: "Input",
|
|
2722
|
-
componentId: "sc-ndqkyw-2"
|
|
2723
|
-
})(require_portalProvider.E, require_portalProvider.x, require_portalProvider.S), Presentation = /* @__PURE__ */ styled_components.styled.div.withConfig({
|
|
2724
|
-
displayName: "Presentation",
|
|
2725
|
-
componentId: "sc-ndqkyw-3"
|
|
2726
|
-
})(require_portalProvider.ct, require_portalProvider.C), TextArea = (0, react.forwardRef)(function TextArea(props, forwardedRef) {
|
|
2727
|
-
let $ = (0, react_compiler_runtime.c)(35), __unstable_disableFocusRing, customValidity, restProps, t0, t1, t2, t3, t4, weight;
|
|
2728
|
-
$[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);
|
|
2729
|
-
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 = (0, react.useRef)(null), rootTheme = require_portalProvider.K(), t5;
|
|
2730
|
-
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[10] = t5) : t5 = $[10], (0, react.useImperativeHandle)(forwardedRef, t5), require_portalProvider.D(ref, customValidity);
|
|
2731
|
-
let t6 = rootTheme.scheme, t7 = rootTheme.tone, t8;
|
|
2732
|
-
$[11] === fontSize ? t8 = $[12] : (t8 = require_portalProvider.ft(fontSize), $[11] = fontSize, $[12] = t8);
|
|
2733
|
-
let t9;
|
|
2734
|
-
$[13] === padding ? t9 = $[14] : (t9 = require_portalProvider.ft(padding), $[13] = padding, $[14] = t9);
|
|
2735
|
-
let t10 = rootTheme.scheme, t11;
|
|
2736
|
-
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = require_portalProvider.ft(0), $[15] = t11) : t11 = $[15];
|
|
2737
|
-
let t12;
|
|
2738
|
-
$[16] !== disabled || $[17] !== restProps || $[18] !== rootTheme.scheme || $[19] !== rootTheme.tone || $[20] !== t8 || $[21] !== t9 || $[22] !== weight ? (t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
|
|
2739
|
-
"data-as": "textarea",
|
|
2740
|
-
"data-scheme": t6,
|
|
2741
|
-
"data-tone": t7,
|
|
2742
|
-
...restProps,
|
|
2743
|
-
$fontSize: t8,
|
|
2744
|
-
$padding: t9,
|
|
2745
|
-
$scheme: t10,
|
|
2746
|
-
$space: t11,
|
|
2747
|
-
$tone: rootTheme.tone,
|
|
2748
|
-
$weight: weight,
|
|
2749
|
-
disabled,
|
|
2750
|
-
ref
|
|
2751
|
-
}), $[16] = disabled, $[17] = restProps, $[18] = rootTheme.scheme, $[19] = rootTheme.tone, $[20] = t8, $[21] = t9, $[22] = weight, $[23] = t12) : t12 = $[23];
|
|
2752
|
-
let t13;
|
|
2753
|
-
$[24] === radius ? t13 = $[25] : (t13 = require_portalProvider.ft(radius), $[24] = radius, $[25] = t13);
|
|
2754
|
-
let t14 = border ? "" : void 0, t15;
|
|
2755
|
-
$[26] !== __unstable_disableFocusRing || $[27] !== rootTheme.scheme || $[28] !== rootTheme.tone || $[29] !== t13 || $[30] !== t14 ? (t15 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Presentation, {
|
|
2756
|
-
$radius: t13,
|
|
2757
|
-
$unstableDisableFocusRing: __unstable_disableFocusRing,
|
|
2758
|
-
$scheme: rootTheme.scheme,
|
|
2759
|
-
$tone: rootTheme.tone,
|
|
2760
|
-
"data-border": t14,
|
|
2761
|
-
"data-scheme": rootTheme.scheme,
|
|
2762
|
-
"data-tone": rootTheme.tone
|
|
2763
|
-
}), $[26] = __unstable_disableFocusRing, $[27] = rootTheme.scheme, $[28] = rootTheme.tone, $[29] = t13, $[30] = t14, $[31] = t15) : t15 = $[31];
|
|
2764
|
-
let t16;
|
|
2765
|
-
return $[32] !== t12 || $[33] !== t15 ? (t16 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTextArea, {
|
|
2766
|
-
"data-ui": "TextArea",
|
|
2767
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(InputRoot, { children: [t12, t15] })
|
|
2768
|
-
}), $[32] = t12, $[33] = t15, $[34] = t16) : t16 = $[34], t16;
|
|
2769
|
-
});
|
|
2770
|
-
/**
|
|
2771
|
-
* @public
|
|
2772
|
-
* Provides context for a group of tooltip elements that should share a delay
|
|
2773
|
-
* which temporarily becomes 1 ms after the first floating element of the group opens.
|
|
2774
|
-
*/
|
|
2775
|
-
function TooltipDelayGroupProvider(props) {
|
|
2776
|
-
let $ = (0, react_compiler_runtime.c)(9), { children, delay } = props, [isGroupActive, setIsGroupActive] = require_portalProvider.a(!1), [openTooltipId, setOpenTooltipId] = require_portalProvider.a(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0, t0 = isGroupActive ? 1 : openDelay, t1;
|
|
2777
|
-
$[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t0 ? (t1 = {
|
|
2778
|
-
setIsGroupActive,
|
|
2779
|
-
openTooltipId,
|
|
2780
|
-
setOpenTooltipId,
|
|
2781
|
-
openDelay: t0,
|
|
2782
|
-
closeDelay
|
|
2783
|
-
}, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t0, $[5] = t1) : t1 = $[5];
|
|
2784
|
-
let value = t1, t2;
|
|
2785
|
-
return $[6] !== children || $[7] !== value ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.i.Provider, {
|
|
2786
|
-
value,
|
|
2787
|
-
children
|
|
2788
|
-
}), $[6] = children, $[7] = value, $[8] = t2) : t2 = $[8], t2;
|
|
2789
|
-
}
|
|
2790
|
-
/**
|
|
2791
|
-
* @public
|
|
2792
|
-
*/
|
|
2793
|
-
function BoundaryElementProvider(props) {
|
|
2794
|
-
let $ = (0, react_compiler_runtime.c)(5), { children, element } = props, t0;
|
|
2795
|
-
$[0] === element ? t0 = $[1] : (t0 = {
|
|
2796
|
-
version: 0,
|
|
2797
|
-
element
|
|
2798
|
-
}, $[0] = element, $[1] = t0);
|
|
2799
|
-
let value = t0, t1;
|
|
2800
|
-
return $[2] !== children || $[3] !== value ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portalProvider.I.Provider, {
|
|
2801
|
-
value,
|
|
2802
|
-
children
|
|
2803
|
-
}), $[2] = children, $[3] = value, $[4] = t1) : t1 = $[4], t1;
|
|
2804
|
-
}
|
|
2805
|
-
/**
|
|
2806
|
-
* @internal
|
|
2807
|
-
* @deprecated this component will be removed in the next major release
|
|
2808
|
-
*/
|
|
2809
|
-
function ConditionalWrapper({ children, condition, wrapper }) {
|
|
2810
|
-
return condition ? wrapper(children) : children;
|
|
2811
|
-
}
|
|
2812
|
-
function findMaxBreakpoints(media, width) {
|
|
2813
|
-
let ret = [];
|
|
2814
|
-
for (let i = 0; i < media.length; i += 1) media[i] > width && ret.push(i);
|
|
2815
|
-
return ret;
|
|
2816
|
-
}
|
|
2817
|
-
function findMinBreakpoints(media, width) {
|
|
2818
|
-
let ret = [];
|
|
2819
|
-
for (let i = 0; i < media.length; i += 1) media[i] <= width && ret.push(i);
|
|
2820
|
-
return ret;
|
|
2821
|
-
}
|
|
2822
|
-
/**
|
|
2823
|
-
* DO NOT USE IN PRODUCTION.
|
|
2824
|
-
* @beta
|
|
2825
|
-
*/
|
|
2826
|
-
const ElementQuery = (0, react.forwardRef)(function ElementQuery(props, forwardedRef) {
|
|
2827
|
-
let $ = (0, react_compiler_runtime.c)(18), theme = require_portalProvider.st(), _media, children, restProps;
|
|
2828
|
-
$[0] === props ? (_media = $[1], children = $[2], restProps = $[3]) : ({children, media: _media, ...restProps} = props, $[0] = props, $[1] = _media, $[2] = children, $[3] = restProps);
|
|
2829
|
-
let media = _media ?? theme.media, [element, setElement] = (0, react.useState)(null), width = require_portalProvider.V(element)?.border.width ?? window.innerWidth, t0;
|
|
2830
|
-
if ($[4] !== media || $[5] !== width) {
|
|
2831
|
-
let eq = findMaxBreakpoints(media, width);
|
|
2832
|
-
t0 = eq.length ? eq.join(" ") : void 0, $[4] = media, $[5] = width, $[6] = t0;
|
|
2833
|
-
} else t0 = $[6];
|
|
2834
|
-
let max = t0, t1;
|
|
2835
|
-
if ($[7] !== media || $[8] !== width) {
|
|
2836
|
-
let eq_0 = findMinBreakpoints(media, width);
|
|
2837
|
-
t1 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = media, $[8] = width, $[9] = t1;
|
|
2838
|
-
} else t1 = $[9];
|
|
2839
|
-
let min = t1, t2, t3;
|
|
2840
|
-
$[10] === element ? (t2 = $[11], t3 = $[12]) : (t2 = () => element, t3 = [element], $[10] = element, $[11] = t2, $[12] = t3), (0, react.useImperativeHandle)(forwardedRef, t2, t3);
|
|
2841
|
-
let t4;
|
|
2842
|
-
return $[13] !== children || $[14] !== max || $[15] !== min || $[16] !== restProps ? (t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2843
|
-
"data-ui": "ElementQuery",
|
|
2844
|
-
...restProps,
|
|
2845
|
-
"data-eq-max": max,
|
|
2846
|
-
"data-eq-min": min,
|
|
2847
|
-
ref: setElement,
|
|
2848
|
-
children
|
|
2849
|
-
}), $[13] = children, $[14] = max, $[15] = min, $[16] = restProps, $[17] = t4) : t4 = $[17], t4;
|
|
2850
|
-
});
|
|
2851
|
-
/**
|
|
2852
|
-
* DO NOT USE IN PRODUCTION
|
|
2853
|
-
* @beta
|
|
2854
|
-
*/
|
|
2855
|
-
var ErrorBoundary = class extends react.Component {
|
|
2856
|
-
state = { error: null };
|
|
2857
|
-
static getDerivedStateFromError(error) {
|
|
2858
|
-
return { error };
|
|
2859
|
-
}
|
|
2860
|
-
componentDidCatch(error, info) {
|
|
2861
|
-
this.props.onCatch({
|
|
2862
|
-
error,
|
|
2863
|
-
info
|
|
2864
|
-
});
|
|
2865
|
-
}
|
|
2866
|
-
render() {
|
|
2867
|
-
let { error } = this.state;
|
|
2868
|
-
return error ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Code, { children: typeof error?.message == "string" ? error.message : "Error" }) : this.props.children;
|
|
2869
|
-
}
|
|
2870
|
-
};
|
|
2871
|
-
const StyledSrOnly = styled_components.styled.div.withConfig({
|
|
2872
|
-
displayName: "StyledSrOnly",
|
|
2873
|
-
componentId: "sc-ow9exq-0"
|
|
2874
|
-
})`display:block;width:0;height:0;position:absolute;overflow:hidden;overflow:clip;`, SrOnly = (0, react.forwardRef)(function SrOnly(props, ref) {
|
|
2875
|
-
let $ = (0, react_compiler_runtime.c)(4), { as, children } = props, t0;
|
|
2876
|
-
return $[0] !== as || $[1] !== children || $[2] !== ref ? (t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSrOnly, {
|
|
2877
|
-
"aria-hidden": !0,
|
|
2878
|
-
as,
|
|
2879
|
-
"data-ui": "SrOnly",
|
|
2880
|
-
ref,
|
|
2881
|
-
children
|
|
2882
|
-
}), $[0] = as, $[1] = children, $[2] = ref, $[3] = t0) : t0 = $[3], t0;
|
|
2883
|
-
}), StyledVirtualList = styled_components.styled.div.withConfig({
|
|
2884
|
-
displayName: "StyledVirtualList",
|
|
2885
|
-
componentId: "sc-lfoa81-0"
|
|
2886
|
-
})`position:relative;`, ItemWrapper = styled_components.styled.div.withConfig({
|
|
2887
|
-
displayName: "ItemWrapper",
|
|
2888
|
-
componentId: "sc-lfoa81-1"
|
|
2889
|
-
})`position:absolute;left:0;right:0;`, VirtualList = (0, react.forwardRef)(function VirtualList(props, forwardedRef) {
|
|
2890
|
-
let $ = (0, react_compiler_runtime.c)(44), getItemKey, onChange, renderItem, restProps, t0, t1, t2;
|
|
2891
|
-
$[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);
|
|
2892
|
-
let as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1, t3;
|
|
2893
|
-
$[8] === t2 ? t3 = $[9] : (t3 = t2 === void 0 ? [] : t2, $[8] = t2, $[9] = t3);
|
|
2894
|
-
let items = t3, { space } = require_portalProvider.st(), ref = (0, react.useRef)(null), wrapperRef = (0, react.useRef)(null), [scrollTop, setScrollTop] = (0, react.useState)(0), [scrollHeight, setScrollHeight] = (0, react.useState)(0), [itemHeight, setItemHeight] = (0, react.useState)(-1), t4;
|
|
2895
|
-
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], (0, react.useImperativeHandle)(forwardedRef, t4);
|
|
2896
|
-
let t5;
|
|
2897
|
-
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
|
|
2898
|
-
if (!wrapperRef.current) return;
|
|
2899
|
-
let firstElement = wrapperRef.current.firstChild;
|
|
2900
|
-
firstElement instanceof HTMLElement && setItemHeight(firstElement.offsetHeight);
|
|
2901
|
-
}, $[11] = t5) : t5 = $[11];
|
|
2902
|
-
let t6;
|
|
2903
|
-
$[12] === renderItem ? t6 = $[13] : (t6 = [renderItem], $[12] = renderItem, $[13] = t6), (0, react.useEffect)(t5, t6);
|
|
2904
|
-
let t7, t8;
|
|
2905
|
-
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => {
|
|
2906
|
-
if (!ref.current) return;
|
|
2907
|
-
let scrollEl = findScrollable(ref.current.parentNode);
|
|
2908
|
-
if (scrollEl) {
|
|
2909
|
-
if (!(scrollEl instanceof HTMLElement)) return;
|
|
2910
|
-
let handleScroll = () => {
|
|
2911
|
-
setScrollTop(scrollEl.scrollTop);
|
|
2912
|
-
};
|
|
2913
|
-
scrollEl.addEventListener("scroll", handleScroll, { passive: !0 });
|
|
2914
|
-
let ro = new require_portalProvider.U((entries) => {
|
|
2915
|
-
setScrollHeight(entries[0].contentRect.height);
|
|
2916
|
-
});
|
|
2917
|
-
return ro.observe(scrollEl), handleScroll(), () => {
|
|
2918
|
-
scrollEl.removeEventListener("scroll", handleScroll), ro.unobserve(scrollEl), ro.disconnect();
|
|
2919
|
-
};
|
|
2920
|
-
}
|
|
2921
|
-
let handleScroll_0 = () => {
|
|
2922
|
-
setScrollTop(window.scrollY);
|
|
2923
|
-
}, handleResize = () => {
|
|
2924
|
-
setScrollHeight(window.innerHeight);
|
|
2925
|
-
};
|
|
2926
|
-
return window.addEventListener("scroll", handleScroll_0, { passive: !0 }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
|
|
2927
|
-
window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
|
|
2928
|
-
};
|
|
2929
|
-
}, t8 = [], $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), (0, react.useEffect)(t7, t8);
|
|
2930
|
-
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;
|
|
2931
|
-
$[16] !== fromIndex || $[17] !== gap || $[18] !== itemHeight || $[19] !== onChange || $[20] !== scrollHeight || $[21] !== scrollTop || $[22] !== space || $[23] !== toIndex ? (t9 = () => {
|
|
2932
|
-
onChange && onChange({
|
|
2933
|
-
fromIndex,
|
|
2934
|
-
gap: space[gap],
|
|
2935
|
-
itemHeight,
|
|
2936
|
-
scrollHeight,
|
|
2937
|
-
scrollTop,
|
|
2938
|
-
toIndex
|
|
2939
|
-
});
|
|
2940
|
-
}, t10 = [
|
|
2941
|
-
fromIndex,
|
|
2942
|
-
gap,
|
|
2943
|
-
itemHeight,
|
|
2944
|
-
onChange,
|
|
2945
|
-
scrollHeight,
|
|
2946
|
-
scrollTop,
|
|
2947
|
-
space,
|
|
2948
|
-
toIndex
|
|
2949
|
-
], $[16] = fromIndex, $[17] = gap, $[18] = itemHeight, $[19] = onChange, $[20] = scrollHeight, $[21] = scrollTop, $[22] = space, $[23] = toIndex, $[24] = t10, $[25] = t9) : (t10 = $[24], t9 = $[25]), (0, react.useEffect)(t9, t10);
|
|
2950
|
-
let t11;
|
|
2951
|
-
$[26] !== fromIndex || $[27] !== gap || $[28] !== getItemKey || $[29] !== itemHeight || $[30] !== items || $[31] !== renderItem || $[32] !== space || $[33] !== toIndex ? (t11 = {
|
|
2952
|
-
fromIndex,
|
|
2953
|
-
gap,
|
|
2954
|
-
itemHeight,
|
|
2955
|
-
space,
|
|
2956
|
-
toIndex,
|
|
2957
|
-
getItemKey,
|
|
2958
|
-
items,
|
|
2959
|
-
renderItem
|
|
2960
|
-
}, $[26] = fromIndex, $[27] = gap, $[28] = getItemKey, $[29] = itemHeight, $[30] = items, $[31] = renderItem, $[32] = space, $[33] = toIndex, $[34] = t11) : t11 = $[34];
|
|
2961
|
-
let children = useChildren(t11), t12;
|
|
2962
|
-
$[35] === height ? t12 = $[36] : (t12 = { height }, $[35] = height, $[36] = t12);
|
|
2963
|
-
let t13;
|
|
2964
|
-
$[37] !== children || $[38] !== t12 ? (t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2965
|
-
ref: wrapperRef,
|
|
2966
|
-
style: t12,
|
|
2967
|
-
children
|
|
2968
|
-
}), $[37] = children, $[38] = t12, $[39] = t13) : t13 = $[39];
|
|
2969
|
-
let t14;
|
|
2970
|
-
return $[40] !== as || $[41] !== restProps || $[42] !== t13 ? (t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledVirtualList, {
|
|
2971
|
-
as,
|
|
2972
|
-
"data-ui": "VirtualList",
|
|
2973
|
-
...restProps,
|
|
2974
|
-
ref,
|
|
2975
|
-
children: t13
|
|
2976
|
-
}), $[40] = as, $[41] = restProps, $[42] = t13, $[43] = t14) : t14 = $[43], t14;
|
|
2977
|
-
});
|
|
2978
|
-
function useChildren(t0) {
|
|
2979
|
-
let $ = (0, react_compiler_runtime.c)(21), { fromIndex, gap, getItemKey, itemHeight, items, renderItem, space, toIndex } = t0;
|
|
2980
|
-
if (!renderItem || items.length === 0) return null;
|
|
2981
|
-
if (itemHeight === -1) {
|
|
2982
|
-
let t1;
|
|
2983
|
-
$[0] !== items[0] || $[1] !== renderItem ? (t1 = renderItem(items[0]), $[0] = items[0], $[1] = renderItem, $[2] = t1) : t1 = $[2];
|
|
2984
|
-
let t2;
|
|
2985
|
-
return $[3] === t1 ? t2 = $[4] : (t2 = [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemWrapper, { children: t1 }, 0)], $[3] = t1, $[4] = t2), t2;
|
|
2986
|
-
}
|
|
2987
|
-
let t1;
|
|
2988
|
-
if ($[5] !== fromIndex || $[6] !== gap || $[7] !== getItemKey || $[8] !== itemHeight || $[9] !== items || $[10] !== renderItem || $[11] !== space || $[12] !== toIndex) {
|
|
2989
|
-
let t2;
|
|
2990
|
-
$[14] !== fromIndex || $[15] !== gap || $[16] !== getItemKey || $[17] !== itemHeight || $[18] !== renderItem || $[19] !== space ? (t2 = (item, _itemIndex) => {
|
|
2991
|
-
let itemIndex = fromIndex + _itemIndex, node = renderItem(item), key = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
|
|
2992
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemWrapper, {
|
|
2993
|
-
style: { top: itemIndex * (itemHeight + space[gap]) },
|
|
2994
|
-
children: node
|
|
2995
|
-
}, key);
|
|
2996
|
-
}, $[14] = fromIndex, $[15] = gap, $[16] = getItemKey, $[17] = itemHeight, $[18] = renderItem, $[19] = space, $[20] = t2) : t2 = $[20], t1 = items.slice(fromIndex, toIndex).map(t2), $[5] = fromIndex, $[6] = gap, $[7] = getItemKey, $[8] = itemHeight, $[9] = items, $[10] = renderItem, $[11] = space, $[12] = toIndex, $[13] = t1;
|
|
2997
|
-
} else t1 = $[13];
|
|
2998
|
-
return t1;
|
|
2999
|
-
}
|
|
3000
|
-
function findScrollable(parentNode) {
|
|
3001
|
-
let _scrollEl = parentNode;
|
|
3002
|
-
for (; _scrollEl && !_isScrollable(_scrollEl);) _scrollEl = _scrollEl.parentNode;
|
|
3003
|
-
return _scrollEl;
|
|
3004
|
-
}
|
|
3005
|
-
exports.Arrow = require_portalProvider.A, exports.Autocomplete = Autocomplete, exports.Avatar = Avatar, exports.AvatarCounter = AvatarCounter, exports.AvatarStack = AvatarStack, exports.Badge = Badge, exports.BoundaryElementProvider = BoundaryElementProvider, exports.Box = require_portalProvider.lt, exports.Breadcrumbs = Breadcrumbs, exports.Button = require_portalProvider.Y, exports.Card = require_portalProvider.W, exports.Checkbox = Checkbox, exports.Code = Code, exports.CodeSkeleton = CodeSkeleton, exports.ConditionalWrapper = ConditionalWrapper, exports.Container = Container, exports.Dialog = Dialog, exports.DialogContext = DialogContext, exports.DialogProvider = DialogProvider, exports.ElementQuery = ElementQuery, exports.ErrorBoundary = ErrorBoundary, exports.Flex = require_portalProvider.at, exports.Grid = require_portalProvider.s, exports.Heading = Heading, exports.HeadingSkeleton = HeadingSkeleton, exports.Hotkeys = require_portalProvider.m, exports.Inline = require_portalProvider.g, exports.KBD = require_portalProvider.h, exports.Label = Label, exports.LabelSkeleton = LabelSkeleton, exports.Layer = require_portalProvider._, exports.LayerProvider = require_portalProvider.P, exports.Menu = require_portalProvider.p, exports.MenuButton = MenuButton, exports.MenuDivider = require_portalProvider.f, exports.MenuGroup = require_portalProvider.d, exports.MenuItem = require_portalProvider.u, exports.Popover = require_portalProvider.k, exports.Portal = require_portalProvider.j, exports.PortalProvider = require_portalProvider.t, exports.Radio = Radio, exports.Select = Select, exports.Skeleton = Skeleton, exports.Spinner = require_portalProvider.$, exports.SrOnly = SrOnly, exports.Stack = require_portalProvider.O, exports.Switch = Switch, exports.Tab = require_portalProvider.l, exports.TabList = require_portalProvider.c, exports.TabPanel = TabPanel, exports.Text = require_portalProvider.et, exports.TextArea = TextArea, exports.TextInput = require_portalProvider.b, exports.TextSkeleton = TextSkeleton, exports.ThemeColorProvider = require_portalProvider.G, exports.ThemeProvider = require_portalProvider.q, exports.Toast = Toast, exports.ToastProvider = ToastProvider, exports.Tooltip = require_portalProvider.n, exports.TooltipDelayGroupContext = require_portalProvider.i, exports.TooltipDelayGroupProvider = TooltipDelayGroupProvider, exports.Tree = Tree, exports.TreeItem = TreeItem, exports.VirtualList = VirtualList, exports._ResizeObserver = require_portalProvider.U, exports._elementSizeObserver = require_portalProvider.H, exports._fillCSSObject = require_portalProvider.dt, exports._getArrayProp = require_portalProvider.ft, exports._getResponsiveSpace = require_portalProvider.pt, exports._hasFocus = _hasFocus, exports._isEnterToClickElement = require_portalProvider.gt, exports._isScrollable = _isScrollable, exports._raf = _raf, exports._raf2 = _raf2, exports._responsive = require_portalProvider.mt, exports.attemptFocus = attemptFocus, exports.containsOrEqualsElement = require_portalProvider._t, exports.createColorTheme = require_portalProvider.Et, exports.focusFirstDescendant = focusFirstDescendant, exports.focusLastDescendant = focusLastDescendant, exports.hexToRgb = require_portalProvider.Dt, exports.hslToRgb = require_portalProvider.Ot, exports.isFocusable = isFocusable, exports.isHTMLAnchorElement = require_portalProvider.vt, exports.isHTMLButtonElement = require_portalProvider.yt, exports.isHTMLElement = require_portalProvider.bt, exports.isHTMLInputElement = require_portalProvider.xt, exports.isHTMLSelectElement = require_portalProvider.St, exports.isHTMLTextAreaElement = require_portalProvider.Ct, exports.multiply = require_portalProvider.kt, exports.parseColor = require_portalProvider.At, exports.rem = require_portalProvider.ht, exports.responsiveCodeFontStyle = responsiveCodeFontStyle, exports.responsiveHeadingFont = responsiveHeadingFont, exports.responsiveLabelFont = responsiveLabelFont, exports.responsiveTextAlignStyle = require_portalProvider.it, exports.responsiveTextFont = require_portalProvider.nt, exports.rgbToHex = require_portalProvider.jt, exports.rgbToHsl = require_portalProvider.Mt, exports.rgba = require_portalProvider.Nt, exports.screen = require_portalProvider.Pt, exports.studioTheme = require_portalProvider.Ft, exports.useArrayProp = useArrayProp, exports.useBoundaryElement = require_portalProvider.F, exports.useClickOutside = useClickOutside, exports.useClickOutsideEvent = require_portalProvider.y, exports.useCustomValidity = require_portalProvider.D, exports.useDialog = useDialog, exports.useElementRect = useElementRect, exports.useElementSize = require_portalProvider.V, exports.useForwardedRef = useForwardedRef, exports.useGlobalKeyDown = require_portalProvider.v, exports.useLayer = require_portalProvider.N, exports.useMatchMedia = require_portalProvider.z, exports.useMediaIndex = require_portalProvider.B, exports.usePortal = require_portalProvider.M, exports.usePrefersDark = require_portalProvider.o, exports.usePrefersReducedMotion = require_portalProvider.R, exports.useRootTheme = require_portalProvider.K, exports.useTheme = require_portalProvider.ot, exports.useTheme_v2 = require_portalProvider.st, exports.useToast = useToast, exports.useTooltipDelayGroup = require_portalProvider.r, exports.useTree = useTree;
|
|
3006
|
-
|
|
3007
|
-
//# sourceMappingURL=index.cjs.map
|