@sanity/ui 2.8.24-canary.2 → 2.8.24

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.
Files changed (45) hide show
  1. package/dist/index.d.mts +2 -11
  2. package/dist/index.d.ts +2 -11
  3. package/dist/index.esm.js +2149 -2162
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +2148 -2161
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +2149 -2162
  8. package/dist/index.mjs.map +1 -1
  9. package/package.json +39 -31
  10. package/src/core/components/autocomplete/autocomplete.tsx +1 -1
  11. package/src/core/components/breadcrumbs/breadcrumbs.tsx +1 -2
  12. package/src/core/components/dialog/dialog.tsx +6 -2
  13. package/src/core/components/hotkeys/hotkeys.tsx +1 -1
  14. package/src/core/components/menu/menuGroup.tsx +1 -1
  15. package/src/core/components/menu/menuItem.tsx +1 -1
  16. package/src/core/components/skeleton/skeleton.tsx +1 -1
  17. package/src/core/components/skeleton/textSkeleton.tsx +1 -1
  18. package/src/core/hooks/index.ts +1 -1
  19. package/src/core/hooks/useArrayProp.ts +6 -8
  20. package/src/core/primitives/avatar/avatar.tsx +1 -1
  21. package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
  22. package/src/core/primitives/avatar/avatarStack.tsx +1 -1
  23. package/src/core/primitives/badge/badge.tsx +1 -1
  24. package/src/core/primitives/box/box.tsx +1 -1
  25. package/src/core/primitives/button/button.tsx +1 -1
  26. package/src/core/primitives/card/card.tsx +1 -1
  27. package/src/core/primitives/code/code.tsx +1 -1
  28. package/src/core/primitives/container/container.tsx +1 -1
  29. package/src/core/primitives/flex/flex.tsx +1 -1
  30. package/src/core/primitives/grid/grid.tsx +1 -1
  31. package/src/core/primitives/heading/heading.tsx +1 -1
  32. package/src/core/primitives/inline/inline.tsx +1 -1
  33. package/src/core/primitives/kbd/kbd.tsx +1 -1
  34. package/src/core/primitives/label/label.tsx +1 -1
  35. package/src/core/primitives/popover/popover.tsx +1 -2
  36. package/src/core/primitives/select/select.tsx +1 -2
  37. package/src/core/primitives/stack/stack.tsx +1 -1
  38. package/src/core/primitives/text/text.tsx +1 -1
  39. package/src/core/primitives/textArea/textArea.tsx +1 -2
  40. package/src/core/primitives/textInput/textInput.tsx +1 -2
  41. package/src/core/primitives/tooltip/tooltip.tsx +1 -2
  42. package/src/core/styles/helpers.ts +2 -2
  43. package/src/core/utils/layer/layerProvider.tsx +1 -2
  44. package/src/core/utils/portal/portalProvider.tsx +8 -10
  45. package/src/core/hooks/useArrayPropLegacy.ts +0 -30
package/dist/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { buildTheme, createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, getTheme_v2, getScopedTheme } from "@sanity/ui/theme";
2
2
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
3
  import { c } from "react-compiler-runtime";
4
- import { useState, createContext, useContext, forwardRef, useId, useEffect, Children, isValidElement, cloneElement, useRef, useDebugValue, useImperativeHandle, useMemo, useSyncExternalStore, Component, memo, useCallback, useLayoutEffect, useReducer, Fragment as Fragment$1, startTransition } from "react";
4
+ import { useState, useRef, useEffect, useDebugValue, useImperativeHandle, useMemo, useSyncExternalStore, createContext, useContext, forwardRef, useId, Children, isValidElement, cloneElement, Component, memo, useCallback, useLayoutEffect, useReducer, Fragment as Fragment$1, startTransition } from "react";
5
5
  import ReactIs, { isValidElementType } from "react-is";
6
6
  import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css, styled, keyframes } from "styled-components";
7
7
  import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon, ToggleArrowRightIcon } from "@sanity/icons";
@@ -45,8 +45,8 @@ function _responsive(media, values, callback) {
45
45
  [`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
46
46
  });
47
47
  }
48
- function _getArrayProp(val) {
49
- return val === void 0 ? EMPTY_ARRAY : Array.isArray(val) ? val : [val];
48
+ function _getArrayProp(val, defaultVal) {
49
+ return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
50
50
  }
51
51
  function _getResponsiveSpace(theme, props, spaceIndexes = EMPTY_ARRAY) {
52
52
  if (!Array.isArray(spaceIndexes))
@@ -153,2300 +153,2284 @@ function responsiveTextAlignStyle(props) {
153
153
  function responsiveTextFont(props) {
154
154
  return responsiveFont("text", props);
155
155
  }
156
- function useArrayProp$1(val) {
157
- const $ = c(6);
156
+ function useArrayProp(val, defaultVal) {
157
+ const $ = c(3);
158
158
  let t0;
159
- $[0] !== val ? (t0 = () => [_getArrayProp(val), JSON.stringify(val)], $[0] = val, $[1] = t0) : t0 = $[1];
160
- const [t1, setCache] = useState(t0), [cachedVal, cachedHash] = t1;
161
- let result = cachedVal, t2;
162
- $[2] !== val ? (t2 = JSON.stringify(val), $[2] = val, $[3] = t2) : t2 = $[3];
163
- const hash = t2;
164
- if (hash !== cachedHash) {
165
- let t3;
166
- $[4] !== val ? (t3 = _getArrayProp(val), $[4] = val, $[5] = t3) : t3 = $[5];
167
- const current = t3;
168
- setCache([current, hash]), result = current;
169
- }
170
- return result;
171
- }
172
- function getGlobalScope() {
173
- if (typeof globalThis < "u") return globalThis;
174
- if (typeof window < "u") return window;
175
- if (typeof self < "u") return self;
176
- if (typeof global < "u") return global;
177
- throw new Error("@sanity/ui: could not locate global scope");
159
+ $[0] !== defaultVal || $[1] !== val ? (t0 = () => [_getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
160
+ const [t1, setCache] = useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
161
+ return hash !== cachedHash && setCache([_getArrayProp(val, defaultVal), hash]), cachedVal;
178
162
  }
179
- const globalScope = getGlobalScope();
180
- function createGlobalScopedContext(key2, defaultValue) {
181
- const symbol = Symbol.for(key2);
182
- return typeof document > "u" ? createContext(defaultValue) : (globalScope[symbol] = globalScope[symbol] || createContext(defaultValue), globalScope[symbol]);
163
+ function _getElements(element, elementsArg) {
164
+ const ret = [element];
165
+ for (const el of elementsArg)
166
+ Array.isArray(el) ? ret.push(...el) : ret.push(el);
167
+ return ret.filter(Boolean);
183
168
  }
184
- const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
185
- function ThemeProvider(props) {
186
- const $ = c(15), parentTheme = useContext(ThemeContext), {
187
- children
188
- } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
189
- let t0;
190
- bb0: {
191
- if (!rootTheme) {
192
- t0 = null;
193
- break bb0;
194
- }
195
- let t12;
196
- $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
197
- version: 0,
198
- theme: rootTheme,
199
- scheme,
200
- tone
201
- }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
202
- }
203
- const themeContext = t0;
169
+ function useClickOutside(listener, t0, boundaryElement) {
170
+ const $ = c(12), elementsArg = t0 === void 0 ? EMPTY_ARRAY : t0, [element, setElement] = useState(null);
204
171
  let t1;
205
- bb1: {
206
- if (!rootTheme) {
207
- t1 = null;
208
- break bb1;
172
+ $[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
173
+ const [elements, setElements] = useState(t1), elementsRef = useRef(elements);
174
+ let t2, t3;
175
+ $[3] !== element || $[4] !== elementsArg ? (t2 = () => {
176
+ const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
177
+ if (prevElements.length !== nextElements.length) {
178
+ setElements(nextElements), elementsRef.current = nextElements;
179
+ return;
209
180
  }
210
- let t22;
211
- $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
212
- }
213
- const theme = t1;
214
- if (!theme) {
215
- let t22;
216
- return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
217
- }
218
- let t2;
219
- $[9] !== children || $[10] !== theme ? (t2 = /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }), $[9] = children, $[10] = theme, $[11] = t2) : t2 = $[11];
220
- let t3;
221
- return $[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14], t3;
222
- }
223
- ThemeProvider.displayName = "ThemeProvider";
224
- function useRootTheme() {
225
- const value = useContext(ThemeContext);
226
- if (!value)
227
- throw new Error("useRootTheme(): missing context value");
228
- return value;
181
+ for (const el of prevElements)
182
+ if (!nextElements.includes(el)) {
183
+ setElements(nextElements), elementsRef.current = nextElements;
184
+ return;
185
+ }
186
+ for (const el_0 of nextElements)
187
+ if (!prevElements.includes(el_0)) {
188
+ setElements(nextElements), elementsRef.current = nextElements;
189
+ return;
190
+ }
191
+ }, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
192
+ let t4, t5;
193
+ return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
194
+ if (!listener)
195
+ return;
196
+ const handleWindowMouseDown = (evt) => {
197
+ const target = evt.target;
198
+ if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
199
+ for (const el_1 of elements)
200
+ if (target === el_1 || el_1.contains(target))
201
+ return;
202
+ listener(evt);
203
+ }
204
+ };
205
+ return window.addEventListener("mousedown", handleWindowMouseDown), () => {
206
+ window.removeEventListener("mousedown", handleWindowMouseDown);
207
+ };
208
+ }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
229
209
  }
230
- function ThemeColorProvider(props) {
231
- const $ = c(5), {
232
- children,
233
- scheme,
234
- tone
235
- } = props, root = useRootTheme(), t0 = scheme || root.scheme;
210
+ function useClickOutsideEvent(listener, t0, boundaryElement) {
211
+ const $ = c(8), elementsArg = t0 === void 0 ? _temp$b : t0;
236
212
  let t1;
237
- return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ jsx(ThemeProvider, { scheme: t0, theme: root.theme, tone, children }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
213
+ $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
214
+ if (!listener)
215
+ return;
216
+ const target = evt.target;
217
+ if (!(target instanceof Node))
218
+ return;
219
+ const resolvedBoundaryElement = boundaryElement?.();
220
+ if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target))
221
+ return;
222
+ const elements = elementsArg().flat();
223
+ for (const el of elements)
224
+ if (el && (target === el || el.contains(target)))
225
+ return;
226
+ listener(evt);
227
+ }, $[0] = boundaryElement, $[1] = elementsArg, $[2] = listener, $[3] = t1) : t1 = $[3];
228
+ const onEvent = useEffectEvent(t1), hasListener = !!listener;
229
+ let t2, t3;
230
+ $[4] !== hasListener || $[5] !== onEvent ? (t2 = () => {
231
+ if (!hasListener)
232
+ return;
233
+ const handleEvent = (evt_0) => onEvent(evt_0);
234
+ return document.addEventListener("mousedown", handleEvent), () => {
235
+ document.removeEventListener("mousedown", handleEvent);
236
+ };
237
+ }, t3 = [hasListener, onEvent], $[4] = hasListener, $[5] = onEvent, $[6] = t2, $[7] = t3) : (t2 = $[6], t3 = $[7]), useEffect(t2, t3), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
238
238
  }
239
- ThemeColorProvider.displayName = "ThemeColorProvider";
240
- function useTheme() {
241
- return useTheme$1();
239
+ function _temp$b() {
240
+ return EMPTY_ARRAY;
242
241
  }
243
- function useTheme_v2() {
244
- const $ = c(2), t0 = useTheme$1();
242
+ function useCustomValidity(ref, customValidity) {
243
+ const $ = c(6);
244
+ let t0;
245
+ $[0] !== customValidity || $[1] !== ref.current ? (t0 = () => {
246
+ ref.current?.setCustomValidity(customValidity || "");
247
+ }, $[0] = customValidity, $[1] = ref.current, $[2] = t0) : t0 = $[2];
245
248
  let t1;
246
- return $[0] !== t0 ? (t1 = getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
247
- }
248
- function responsiveBorderStyle() {
249
- return [border, borderTop, borderRight, borderBottom, borderLeft];
250
- }
251
- function border(props) {
252
- const {
253
- card,
254
- media
255
- } = getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
256
- return _responsive(media, props.$border, (value) => value ? {
257
- "&&": {
258
- border: borderStyle
259
- }
260
- } : {
261
- "&&": {
262
- border: 0
263
- }
264
- });
265
- }
266
- function borderTop(props) {
267
- const {
268
- card,
269
- media
270
- } = getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
271
- return _responsive(media, props.$borderTop, (value) => value ? {
272
- "&&": {
273
- borderTop: borderStyle
274
- }
275
- } : {
276
- "&&": {
277
- borderTop: 0
278
- }
279
- });
280
- }
281
- function borderRight(props) {
282
- const {
283
- card,
284
- media
285
- } = getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
286
- return _responsive(media, props.$borderRight, (value) => value ? {
287
- "&&": {
288
- borderRight: borderStyle
289
- }
290
- } : {
291
- "&&": {
292
- borderRight: 0
293
- }
294
- });
249
+ $[3] !== customValidity || $[4] !== ref ? (t1 = [customValidity, ref], $[3] = customValidity, $[4] = ref, $[5] = t1) : t1 = $[5], useEffect(t0, t1);
295
250
  }
296
- function borderBottom(props) {
297
- const {
298
- card,
299
- media
300
- } = getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
301
- return _responsive(media, props.$borderBottom, (value) => value ? {
302
- "&&": {
303
- borderBottom: borderStyle
304
- }
305
- } : {
306
- "&&": {
307
- borderBottom: 0
308
- }
251
+ var resizeObservers = [], hasActiveObservations = function() {
252
+ return resizeObservers.some(function(ro) {
253
+ return ro.activeTargets.length > 0;
309
254
  });
310
- }
311
- function borderLeft(props) {
312
- const {
313
- card,
314
- media
315
- } = getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
316
- return _responsive(media, props.$borderLeft, (value) => value ? {
317
- "&&": {
318
- borderLeft: borderStyle
319
- }
320
- } : {
321
- "&&": {
322
- borderLeft: 0
323
- }
255
+ }, hasSkippedObservations = function() {
256
+ return resizeObservers.some(function(ro) {
257
+ return ro.skippedTargets.length > 0;
324
258
  });
325
- }
326
- const BASE_STYLE$4 = {
327
- '&[data-as="ul"],&[data-as="ol"]': {
328
- listStyle: "none"
259
+ }, msg = "ResizeObserver loop completed with undelivered notifications.", deliverResizeLoopError = function() {
260
+ var event;
261
+ typeof ErrorEvent == "function" ? event = new ErrorEvent("error", {
262
+ message: msg
263
+ }) : (event = document.createEvent("Event"), event.initEvent("error", !1, !1), event.message = msg), window.dispatchEvent(event);
264
+ }, ResizeObserverBoxOptions;
265
+ (function(ResizeObserverBoxOptions2) {
266
+ ResizeObserverBoxOptions2.BORDER_BOX = "border-box", ResizeObserverBoxOptions2.CONTENT_BOX = "content-box", ResizeObserverBoxOptions2.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
267
+ })(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {}));
268
+ var freeze = function(obj) {
269
+ return Object.freeze(obj);
270
+ }, ResizeObserverSize = /* @__PURE__ */ function() {
271
+ function ResizeObserverSize2(inlineSize, blockSize) {
272
+ this.inlineSize = inlineSize, this.blockSize = blockSize, freeze(this);
329
273
  }
330
- }, BOX_SIZING = {
331
- content: "content-box",
332
- border: "border-box"
333
- }, BOX_HEIGHT = {
334
- stretch: "stretch",
335
- fill: "100%"
336
- };
337
- function boxStyle() {
338
- return BASE_STYLE$4;
339
- }
340
- function responsiveBoxStyle() {
341
- return [responsiveBoxSizingStyle, responsiveBoxHeightStyle, responsiveBoxOverflowStyle, responsiveBoxDisplayStyle];
342
- }
343
- function responsiveBoxDisplayStyle(props) {
344
- const {
345
- media
346
- } = getTheme_v2(props.theme);
347
- return _responsive(media, props.$display, (display) => ({
348
- "&:not([hidden])": {
349
- display
274
+ return ResizeObserverSize2;
275
+ }(), DOMRectReadOnly = function() {
276
+ function DOMRectReadOnly2(x, y, width, height) {
277
+ return this.x = x, this.y = y, this.width = width, this.height = height, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, freeze(this);
278
+ }
279
+ return DOMRectReadOnly2.prototype.toJSON = function() {
280
+ var _a = this, x = _a.x, y = _a.y, top = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left, width = _a.width, height = _a.height;
281
+ return {
282
+ x,
283
+ y,
284
+ top,
285
+ right,
286
+ bottom,
287
+ left,
288
+ width,
289
+ height
290
+ };
291
+ }, DOMRectReadOnly2.fromRect = function(rectangle) {
292
+ return new DOMRectReadOnly2(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
293
+ }, DOMRectReadOnly2;
294
+ }(), isSVG = function(target) {
295
+ return target instanceof SVGElement && "getBBox" in target;
296
+ }, isHidden = function(target) {
297
+ if (isSVG(target)) {
298
+ var _a = target.getBBox(), width = _a.width, height = _a.height;
299
+ return !width && !height;
300
+ }
301
+ var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight;
302
+ return !(offsetWidth || offsetHeight || target.getClientRects().length);
303
+ }, isElement = function(obj) {
304
+ var _a;
305
+ if (obj instanceof Element)
306
+ return !0;
307
+ var scope = (_a = obj?.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
308
+ return !!(scope && obj instanceof scope.Element);
309
+ }, isReplacedElement = function(target) {
310
+ switch (target.tagName) {
311
+ case "INPUT":
312
+ if (target.type !== "image")
313
+ break;
314
+ case "VIDEO":
315
+ case "AUDIO":
316
+ case "EMBED":
317
+ case "OBJECT":
318
+ case "CANVAS":
319
+ case "IFRAME":
320
+ case "IMG":
321
+ return !0;
322
+ }
323
+ return !1;
324
+ }, global$1 = typeof window < "u" ? window : {}, cache = /* @__PURE__ */ new WeakMap(), scrollRegexp = /auto|scroll/, verticalRegexp = /^tb|vertical/, IE = /msie|trident/i.test(global$1.navigator && global$1.navigator.userAgent), parseDimension = function(pixel) {
325
+ return parseFloat(pixel || "0");
326
+ }, size$1 = function(inlineSize, blockSize, switchSizes) {
327
+ return inlineSize === void 0 && (inlineSize = 0), blockSize === void 0 && (blockSize = 0), switchSizes === void 0 && (switchSizes = !1), new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
328
+ }, zeroBoxes = freeze({
329
+ devicePixelContentBoxSize: size$1(),
330
+ borderBoxSize: size$1(),
331
+ contentBoxSize: size$1(),
332
+ contentRect: new DOMRectReadOnly(0, 0, 0, 0)
333
+ }), calculateBoxSizes = function(target, forceRecalculation) {
334
+ if (forceRecalculation === void 0 && (forceRecalculation = !1), cache.has(target) && !forceRecalculation)
335
+ return cache.get(target);
336
+ if (isHidden(target))
337
+ return cache.set(target, zeroBoxes), zeroBoxes;
338
+ var cs = getComputedStyle(target), svg = isSVG(target) && target.ownerSVGElement && target.getBBox(), removePadding = !IE && cs.boxSizing === "border-box", switchSizes = verticalRegexp.test(cs.writingMode || ""), canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || ""), canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || ""), paddingTop = svg ? 0 : parseDimension(cs.paddingTop), paddingRight = svg ? 0 : parseDimension(cs.paddingRight), paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom), paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft), borderTop2 = svg ? 0 : parseDimension(cs.borderTopWidth), borderRight2 = svg ? 0 : parseDimension(cs.borderRightWidth), borderBottom2 = svg ? 0 : parseDimension(cs.borderBottomWidth), borderLeft2 = svg ? 0 : parseDimension(cs.borderLeftWidth), horizontalPadding = paddingLeft + paddingRight, verticalPadding = paddingTop + paddingBottom, horizontalBorderArea = borderLeft2 + borderRight2, verticalBorderArea = borderTop2 + borderBottom2, horizontalScrollbarThickness = canScrollHorizontally ? target.offsetHeight - verticalBorderArea - target.clientHeight : 0, verticalScrollbarThickness = canScrollVertically ? target.offsetWidth - horizontalBorderArea - target.clientWidth : 0, widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0, heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0, contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness, contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness, borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea, borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea, boxes = freeze({
339
+ devicePixelContentBoxSize: size$1(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),
340
+ borderBoxSize: size$1(borderBoxWidth, borderBoxHeight, switchSizes),
341
+ contentBoxSize: size$1(contentWidth, contentHeight, switchSizes),
342
+ contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight)
343
+ });
344
+ return cache.set(target, boxes), boxes;
345
+ }, calculateBoxSize = function(target, observedBox, forceRecalculation) {
346
+ var _a = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a.borderBoxSize, contentBoxSize = _a.contentBoxSize, devicePixelContentBoxSize = _a.devicePixelContentBoxSize;
347
+ switch (observedBox) {
348
+ case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:
349
+ return devicePixelContentBoxSize;
350
+ case ResizeObserverBoxOptions.BORDER_BOX:
351
+ return borderBoxSize;
352
+ default:
353
+ return contentBoxSize;
354
+ }
355
+ }, ResizeObserverEntry = /* @__PURE__ */ function() {
356
+ function ResizeObserverEntry2(target) {
357
+ var boxes = calculateBoxSizes(target);
358
+ this.target = target, this.contentRect = boxes.contentRect, this.borderBoxSize = freeze([boxes.borderBoxSize]), this.contentBoxSize = freeze([boxes.contentBoxSize]), this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);
359
+ }
360
+ return ResizeObserverEntry2;
361
+ }(), calculateDepthForNode = function(node) {
362
+ if (isHidden(node))
363
+ return 1 / 0;
364
+ for (var depth = 0, parent = node.parentNode; parent; )
365
+ depth += 1, parent = parent.parentNode;
366
+ return depth;
367
+ }, broadcastActiveObservations = function() {
368
+ var shallowestDepth = 1 / 0, callbacks2 = [];
369
+ resizeObservers.forEach(function(ro) {
370
+ if (ro.activeTargets.length !== 0) {
371
+ var entries = [];
372
+ ro.activeTargets.forEach(function(ot) {
373
+ var entry = new ResizeObserverEntry(ot.target), targetDepth = calculateDepthForNode(ot.target);
374
+ entries.push(entry), ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox), targetDepth < shallowestDepth && (shallowestDepth = targetDepth);
375
+ }), callbacks2.push(function() {
376
+ ro.callback.call(ro.observer, entries, ro.observer);
377
+ }), ro.activeTargets.splice(0, ro.activeTargets.length);
378
+ }
379
+ });
380
+ for (var _i = 0, callbacks_1 = callbacks2; _i < callbacks_1.length; _i++) {
381
+ var callback = callbacks_1[_i];
382
+ callback();
383
+ }
384
+ return shallowestDepth;
385
+ }, gatherActiveObservationsAtDepth = function(depth) {
386
+ resizeObservers.forEach(function(ro) {
387
+ ro.activeTargets.splice(0, ro.activeTargets.length), ro.skippedTargets.splice(0, ro.skippedTargets.length), ro.observationTargets.forEach(function(ot) {
388
+ ot.isActive() && (calculateDepthForNode(ot.target) > depth ? ro.activeTargets.push(ot) : ro.skippedTargets.push(ot));
389
+ });
390
+ });
391
+ }, process = function() {
392
+ var depth = 0;
393
+ for (gatherActiveObservationsAtDepth(depth); hasActiveObservations(); )
394
+ depth = broadcastActiveObservations(), gatherActiveObservationsAtDepth(depth);
395
+ return hasSkippedObservations() && deliverResizeLoopError(), depth > 0;
396
+ }, trigger, callbacks = [], notify = function() {
397
+ return callbacks.splice(0).forEach(function(cb) {
398
+ return cb();
399
+ });
400
+ }, queueMicroTask = function(callback) {
401
+ if (!trigger) {
402
+ var toggle_1 = 0, el_1 = document.createTextNode(""), config = {
403
+ characterData: !0
404
+ };
405
+ new MutationObserver(function() {
406
+ return notify();
407
+ }).observe(el_1, config), trigger = function() {
408
+ el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++);
409
+ };
410
+ }
411
+ callbacks.push(callback), trigger();
412
+ }, queueResizeObserver = function(cb) {
413
+ queueMicroTask(function() {
414
+ requestAnimationFrame(cb);
415
+ });
416
+ }, watching = 0, isWatching = function() {
417
+ return !!watching;
418
+ }, CATCH_PERIOD = 250, observerConfig = {
419
+ attributes: !0,
420
+ characterData: !0,
421
+ childList: !0,
422
+ subtree: !0
423
+ }, events = ["resize", "load", "transitionend", "animationend", "animationstart", "animationiteration", "keyup", "keydown", "mouseup", "mousedown", "mouseover", "mouseout", "blur", "focus"], time = function(timeout) {
424
+ return timeout === void 0 && (timeout = 0), Date.now() + timeout;
425
+ }, scheduled = !1, Scheduler = function() {
426
+ function Scheduler2() {
427
+ var _this = this;
428
+ this.stopped = !0, this.listener = function() {
429
+ return _this.schedule();
430
+ };
431
+ }
432
+ return Scheduler2.prototype.run = function(timeout) {
433
+ var _this = this;
434
+ if (timeout === void 0 && (timeout = CATCH_PERIOD), !scheduled) {
435
+ scheduled = !0;
436
+ var until = time(timeout);
437
+ queueResizeObserver(function() {
438
+ var elementsHaveResized = !1;
439
+ try {
440
+ elementsHaveResized = process();
441
+ } finally {
442
+ if (scheduled = !1, timeout = until - time(), !isWatching())
443
+ return;
444
+ elementsHaveResized ? _this.run(1e3) : timeout > 0 ? _this.run(timeout) : _this.start();
445
+ }
446
+ });
447
+ }
448
+ }, Scheduler2.prototype.schedule = function() {
449
+ this.stop(), this.run();
450
+ }, Scheduler2.prototype.observe = function() {
451
+ var _this = this, cb = function() {
452
+ return _this.observer && _this.observer.observe(document.body, observerConfig);
453
+ };
454
+ document.body ? cb() : global$1.addEventListener("DOMContentLoaded", cb);
455
+ }, Scheduler2.prototype.start = function() {
456
+ var _this = this;
457
+ this.stopped && (this.stopped = !1, this.observer = new MutationObserver(this.listener), this.observe(), events.forEach(function(name) {
458
+ return global$1.addEventListener(name, _this.listener, !0);
459
+ }));
460
+ }, Scheduler2.prototype.stop = function() {
461
+ var _this = this;
462
+ this.stopped || (this.observer && this.observer.disconnect(), events.forEach(function(name) {
463
+ return global$1.removeEventListener(name, _this.listener, !0);
464
+ }), this.stopped = !0);
465
+ }, Scheduler2;
466
+ }(), scheduler = new Scheduler(), updateCount = function(n) {
467
+ !watching && n > 0 && scheduler.start(), watching += n, !watching && scheduler.stop();
468
+ }, skipNotifyOnElement = function(target) {
469
+ return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === "inline";
470
+ }, ResizeObservation = function() {
471
+ function ResizeObservation2(target, observedBox) {
472
+ this.target = target, this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX, this.lastReportedSize = {
473
+ inlineSize: 0,
474
+ blockSize: 0
475
+ };
476
+ }
477
+ return ResizeObservation2.prototype.isActive = function() {
478
+ var size2 = calculateBoxSize(this.target, this.observedBox, !0);
479
+ return skipNotifyOnElement(this.target) && (this.lastReportedSize = size2), this.lastReportedSize.inlineSize !== size2.inlineSize || this.lastReportedSize.blockSize !== size2.blockSize;
480
+ }, ResizeObservation2;
481
+ }(), ResizeObserverDetail = /* @__PURE__ */ function() {
482
+ function ResizeObserverDetail2(resizeObserver, callback) {
483
+ this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = resizeObserver, this.callback = callback;
484
+ }
485
+ return ResizeObserverDetail2;
486
+ }(), observerMap = /* @__PURE__ */ new WeakMap(), getObservationIndex = function(observationTargets, target) {
487
+ for (var i = 0; i < observationTargets.length; i += 1)
488
+ if (observationTargets[i].target === target)
489
+ return i;
490
+ return -1;
491
+ }, ResizeObserverController = function() {
492
+ function ResizeObserverController2() {
493
+ }
494
+ return ResizeObserverController2.connect = function(resizeObserver, callback) {
495
+ var detail = new ResizeObserverDetail(resizeObserver, callback);
496
+ observerMap.set(resizeObserver, detail);
497
+ }, ResizeObserverController2.observe = function(resizeObserver, target, options) {
498
+ var detail = observerMap.get(resizeObserver), firstObservation = detail.observationTargets.length === 0;
499
+ getObservationIndex(detail.observationTargets, target) < 0 && (firstObservation && resizeObservers.push(detail), detail.observationTargets.push(new ResizeObservation(target, options && options.box)), updateCount(1), scheduler.schedule());
500
+ }, ResizeObserverController2.unobserve = function(resizeObserver, target) {
501
+ var detail = observerMap.get(resizeObserver), index = getObservationIndex(detail.observationTargets, target), lastObservation = detail.observationTargets.length === 1;
502
+ index >= 0 && (lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1), detail.observationTargets.splice(index, 1), updateCount(-1));
503
+ }, ResizeObserverController2.disconnect = function(resizeObserver) {
504
+ var _this = this, detail = observerMap.get(resizeObserver);
505
+ detail.observationTargets.slice().forEach(function(ot) {
506
+ return _this.unobserve(resizeObserver, ot.target);
507
+ }), detail.activeTargets.splice(0, detail.activeTargets.length);
508
+ }, ResizeObserverController2;
509
+ }(), ResizeObserver = function() {
510
+ function ResizeObserver2(callback) {
511
+ if (arguments.length === 0)
512
+ throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
513
+ if (typeof callback != "function")
514
+ throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
515
+ ResizeObserverController.connect(this, callback);
516
+ }
517
+ return ResizeObserver2.prototype.observe = function(target, options) {
518
+ if (arguments.length === 0)
519
+ throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
520
+ if (!isElement(target))
521
+ throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
522
+ ResizeObserverController.observe(this, target, options);
523
+ }, ResizeObserver2.prototype.unobserve = function(target) {
524
+ if (arguments.length === 0)
525
+ throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
526
+ if (!isElement(target))
527
+ throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
528
+ ResizeObserverController.unobserve(this, target);
529
+ }, ResizeObserver2.prototype.disconnect = function() {
530
+ ResizeObserverController.disconnect(this);
531
+ }, ResizeObserver2.toString = function() {
532
+ return "function ResizeObserver () { [polyfill code] }";
533
+ }, ResizeObserver2;
534
+ }();
535
+ const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
536
+ function _createElementRectValueListener() {
537
+ return {
538
+ subscribe(element, subscriber) {
539
+ const resizeObserver = new _ResizeObserver(([entry]) => {
540
+ subscriber({
541
+ _contentRect: entry.contentRect,
542
+ border: {
543
+ width: entry.borderBoxSize[0].inlineSize,
544
+ height: entry.borderBoxSize[0].blockSize
545
+ },
546
+ content: {
547
+ width: entry.contentRect.width,
548
+ height: entry.contentRect.height
549
+ }
550
+ });
551
+ });
552
+ return resizeObserver.observe(element), () => {
553
+ resizeObserver.unobserve(element), resizeObserver.disconnect();
554
+ };
350
555
  }
351
- }));
352
- }
353
- function responsiveBoxSizingStyle(props) {
354
- const {
355
- media
356
- } = getTheme_v2(props.theme);
357
- return _responsive(media, props.$sizing, (sizing) => ({
358
- boxSizing: BOX_SIZING[sizing]
359
- }));
556
+ };
360
557
  }
361
- function responsiveBoxHeightStyle(props) {
362
- const {
363
- media
364
- } = getTheme_v2(props.theme);
365
- return _responsive(media, props.$height, (height) => ({
366
- height: BOX_HEIGHT[height]
367
- }));
558
+ function _createElementSizeObserver() {
559
+ const disposeCache = /* @__PURE__ */ new WeakMap(), subscribersCache = /* @__PURE__ */ new WeakMap();
560
+ return {
561
+ subscribe(element, subscriber) {
562
+ const subscribers = subscribersCache.get(element) || [];
563
+ let dispose = disposeCache.get(element);
564
+ return subscribersCache.has(element) || (subscribersCache.set(element, subscribers), dispose = _createElementRectValueListener().subscribe(element, (elementRect) => {
565
+ for (const sub of subscribers)
566
+ sub(elementRect);
567
+ })), subscribers.push(subscriber), () => {
568
+ const idx = subscribers.indexOf(subscriber);
569
+ idx > -1 && subscribers.splice(idx, 1), subscribers.length === 0 && dispose && dispose();
570
+ };
571
+ }
572
+ };
368
573
  }
369
- function responsiveBoxOverflowStyle(props) {
370
- const {
371
- media
372
- } = getTheme_v2(props.theme);
373
- return _responsive(media, props.$overflow, (overflow) => ({
374
- overflow
375
- }));
574
+ function useElementSize(element) {
575
+ const $ = c(3), [size2, setSize] = useState(null);
576
+ let t0, t1;
577
+ return $[0] !== element ? (t0 = () => {
578
+ if (element)
579
+ return _elementSizeObserver.subscribe(element, setSize);
580
+ }, t1 = [element], $[0] = element, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), useEffect(t0, t1), size2;
376
581
  }
377
- const BASE_STYLE$3 = {
378
- "&&:not([hidden])": {
379
- display: "flex"
380
- }
381
- };
382
- function responsiveFlexStyle() {
383
- return [BASE_STYLE$3, responsiveFlexAlignStyle, responsiveFlexGapStyle, responsiveFlexWrapStyle, responsiveFlexJustifyStyle, responsiveFlexDirectionStyle];
582
+ function useElementRect(element) {
583
+ return useElementSize(element)?._contentRect || null;
384
584
  }
385
- function responsiveFlexAlignStyle(props) {
386
- const {
387
- media
388
- } = getTheme_v2(props.theme);
389
- return _responsive(media, props.$align, (align) => ({
390
- alignItems: align
391
- }));
585
+ function useForwardedRef(ref) {
586
+ const $ = c(1), innerRef = useRef(null);
587
+ let t0;
588
+ return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], useImperativeHandle(ref, t0), innerRef;
392
589
  }
393
- function responsiveFlexGapStyle(props) {
394
- const {
395
- media,
396
- space
397
- } = getTheme_v2(props.theme);
398
- return _responsive(media, props.$gap, (gap) => ({
399
- gap: gap ? rem(space[gap]) : void 0
400
- }));
590
+ function useGlobalKeyDown(onKeyDown) {
591
+ const $ = c(3);
592
+ let t0, t1;
593
+ return $[0] !== onKeyDown ? (t0 = () => (addEventListener("keydown", onKeyDown), () => removeEventListener("keydown", onKeyDown)), t1 = [onKeyDown], $[0] = onKeyDown, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), useEffect(t0, t1);
401
594
  }
402
- function responsiveFlexWrapStyle(props) {
595
+ function useMatchMedia(mediaQueryString, getServerSnapshot2) {
403
596
  const {
404
- media
405
- } = getTheme_v2(props.theme);
406
- return _responsive(media, props.$wrap, (wrap) => ({
407
- flexWrap: wrap
408
- }));
597
+ subscribe: subscribe2,
598
+ getSnapshot
599
+ } = useMemo(() => {
600
+ let MEDIA_QUERY_CACHE;
601
+ const getMatchMedia = () => (MEDIA_QUERY_CACHE || (MEDIA_QUERY_CACHE = window.matchMedia(mediaQueryString)), MEDIA_QUERY_CACHE);
602
+ return {
603
+ subscribe: (onStoreChange) => {
604
+ const matchMedia = getMatchMedia();
605
+ return matchMedia.addEventListener("change", onStoreChange), () => matchMedia.removeEventListener("change", onStoreChange);
606
+ },
607
+ getSnapshot: () => getMatchMedia().matches
608
+ };
609
+ }, [mediaQueryString]);
610
+ return useDebugValue(mediaQueryString), useSyncExternalStore(subscribe2, getSnapshot, getServerSnapshot2);
409
611
  }
410
- function responsiveFlexJustifyStyle(props) {
411
- const {
412
- media
413
- } = getTheme_v2(props.theme);
414
- return _responsive(media, props.$justify, (justify) => ({
415
- justifyContent: justify
416
- }));
612
+ function getGlobalScope() {
613
+ if (typeof globalThis < "u") return globalThis;
614
+ if (typeof window < "u") return window;
615
+ if (typeof self < "u") return self;
616
+ if (typeof global < "u") return global;
617
+ throw new Error("@sanity/ui: could not locate global scope");
417
618
  }
418
- function responsiveFlexDirectionStyle(props) {
419
- const {
420
- media
421
- } = getTheme_v2(props.theme);
422
- return _responsive(media, props.$direction, (direction) => ({
423
- flexDirection: direction
424
- }));
619
+ const globalScope = getGlobalScope();
620
+ function createGlobalScopedContext(key2, defaultValue) {
621
+ const symbol = Symbol.for(key2);
622
+ return typeof document > "u" ? createContext(defaultValue) : (globalScope[symbol] = globalScope[symbol] || createContext(defaultValue), globalScope[symbol]);
425
623
  }
426
- const BASE_STYLE$2 = {
427
- minWidth: 0,
428
- minHeight: 0
429
- };
430
- function flexItemStyle() {
431
- return [BASE_STYLE$2, responsiveFlexItemStyle];
624
+ const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
625
+ function ThemeProvider(props) {
626
+ const $ = c(15), parentTheme = useContext(ThemeContext), {
627
+ children
628
+ } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
629
+ let t0;
630
+ bb0: {
631
+ if (!rootTheme) {
632
+ t0 = null;
633
+ break bb0;
634
+ }
635
+ let t12;
636
+ $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
637
+ version: 0,
638
+ theme: rootTheme,
639
+ scheme,
640
+ tone
641
+ }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
642
+ }
643
+ const themeContext = t0;
644
+ let t1;
645
+ bb1: {
646
+ if (!rootTheme) {
647
+ t1 = null;
648
+ break bb1;
649
+ }
650
+ let t22;
651
+ $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
652
+ }
653
+ const theme = t1;
654
+ if (!theme) {
655
+ let t22;
656
+ return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
657
+ }
658
+ let t2;
659
+ $[9] !== children || $[10] !== theme ? (t2 = /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }), $[9] = children, $[10] = theme, $[11] = t2) : t2 = $[11];
660
+ let t3;
661
+ return $[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14], t3;
432
662
  }
433
- function responsiveFlexItemStyle(props) {
434
- const {
435
- media
436
- } = getTheme_v2(props.theme);
437
- return props.$flex ? _responsive(media, props.$flex, (flex) => ({
438
- flex
439
- })) : EMPTY_ARRAY;
663
+ ThemeProvider.displayName = "ThemeProvider";
664
+ function useRootTheme() {
665
+ const value = useContext(ThemeContext);
666
+ if (!value)
667
+ throw new Error("useRootTheme(): missing context value");
668
+ return value;
440
669
  }
441
- function focusRingBorderStyle(border2) {
442
- return `inset 0 0 0 ${border2.width}px ${border2.color}`;
670
+ function ThemeColorProvider(props) {
671
+ const $ = c(5), {
672
+ children,
673
+ scheme,
674
+ tone
675
+ } = props, root = useRootTheme(), t0 = scheme || root.scheme;
676
+ let t1;
677
+ return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ jsx(ThemeProvider, { scheme: t0, theme: root.theme, tone, children }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
443
678
  }
444
- function focusRingStyle(opts) {
445
- const {
446
- base,
447
- border: border2,
448
- focusRing
449
- } = opts, focusRingOutsetWidth = focusRing.offset + focusRing.width, focusRingInsetWidth = 0 - focusRing.offset, bgColor = base ? base.bg : "var(--card-bg-color)";
450
- return [focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`, border2 && focusRingBorderStyle(border2), focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`, focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`].filter(Boolean).join(",");
679
+ ThemeColorProvider.displayName = "ThemeColorProvider";
680
+ function useTheme() {
681
+ return useTheme$1();
451
682
  }
452
- const GRID_CSS = {
453
- "&&:not([hidden])": {
454
- display: "grid"
455
- },
456
- '&[data-as="ul"],&[data-as="ol"]': {
457
- listStyle: "none"
458
- }
459
- }, GRID_AUTO_COLUMS = {
460
- auto: "auto",
461
- min: "min-content",
462
- max: "max-content",
463
- fr: "minmax(0, 1fr)"
464
- }, GRID_AUTO_ROWS = {
465
- auto: "auto",
466
- min: "min-content",
467
- max: "max-content",
468
- fr: "minmax(0, 1fr)"
469
- };
470
- function responsiveGridStyle() {
471
- return [GRID_CSS, responsiveGridAutoFlowStyle, responsiveGridAutoRowsStyle, responsiveGridAutoColsStyle, responsiveGridColumnsStyle, responsiveGridRowsStyle, responsiveGridGapStyle, responsiveGridGapXStyle, responsiveGridGapYStyle];
683
+ function useTheme_v2() {
684
+ const $ = c(2), t0 = useTheme$1();
685
+ let t1;
686
+ return $[0] !== t0 ? (t1 = getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
472
687
  }
473
- function responsiveGridAutoFlowStyle(props) {
474
- const {
475
- media
476
- } = getTheme_v2(props.theme);
477
- return _responsive(media, props.$autoFlow, (autoFlow) => ({
478
- gridAutoFlow: autoFlow
479
- }));
688
+ function _getMediaQuery(media, index) {
689
+ return index === 0 ? `screen and (max-width: ${media[index] - 1}px)` : index === media.length ? `screen and (min-width: ${media[index - 1]}px)` : `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`;
480
690
  }
481
- function responsiveGridAutoRowsStyle(props) {
482
- const {
483
- media
484
- } = getTheme_v2(props.theme);
485
- return _responsive(media, props.$autoRows, (autoRows) => ({
486
- gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows]
487
- }));
691
+ function _createMediaStore(media) {
692
+ const mediaLen = media.length;
693
+ let sizes;
694
+ const getSizes = () => {
695
+ if (!sizes) {
696
+ sizes = [];
697
+ for (let index = mediaLen; index > -1; index -= 1) {
698
+ const mediaQuery = _getMediaQuery(media, index);
699
+ sizes.push({
700
+ index,
701
+ mq: window.matchMedia(mediaQuery)
702
+ });
703
+ }
704
+ }
705
+ return sizes;
706
+ };
707
+ return {
708
+ getSnapshot: () => {
709
+ for (const {
710
+ index,
711
+ mq
712
+ } of getSizes())
713
+ if (mq.matches) return index;
714
+ return 0;
715
+ },
716
+ subscribe: (onStoreChange) => {
717
+ const disposeFns = [];
718
+ for (const {
719
+ mq
720
+ } of getSizes()) {
721
+ const handleChange = () => {
722
+ mq.matches && onStoreChange();
723
+ };
724
+ mq.addEventListener("change", handleChange), disposeFns.push(() => mq.removeEventListener("change", handleChange));
725
+ }
726
+ return () => {
727
+ for (const disposeFn of disposeFns)
728
+ disposeFn();
729
+ };
730
+ }
731
+ };
488
732
  }
489
- function responsiveGridAutoColsStyle(props) {
490
- const {
491
- media
492
- } = getTheme_v2(props.theme);
493
- return _responsive(media, props.$autoCols, (autoCols) => ({
494
- gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols]
495
- }));
733
+ function getServerSnapshot() {
734
+ return 0;
496
735
  }
497
- function responsiveGridColumnsStyle(props) {
498
- const {
736
+ function useMediaIndex() {
737
+ const $ = c(2), {
499
738
  media
500
- } = getTheme_v2(props.theme);
501
- return _responsive(media, props.$columns, (columns) => ({
502
- gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));`
503
- }));
739
+ } = useTheme_v2();
740
+ let t0, t1;
741
+ $[0] !== media ? (t1 = _createMediaStore(media), $[0] = media, $[1] = t1) : t1 = $[1], t0 = t1;
742
+ const store = t0;
743
+ return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
504
744
  }
505
- function responsiveGridRowsStyle(props) {
506
- const {
507
- media
508
- } = getTheme_v2(props.theme);
509
- return _responsive(media, props.$rows, (rows) => ({
510
- gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));`
511
- }));
745
+ function usePrefersDark(t0) {
746
+ return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$a : t0);
512
747
  }
513
- function responsiveGridGapStyle(props) {
514
- const {
515
- media,
516
- space
517
- } = getTheme_v2(props.theme);
518
- return _responsive(media, props.$gap, (gap) => ({
519
- gridGap: gap ? rem(space[gap]) : void 0
520
- }));
748
+ function _temp$a() {
749
+ return !1;
521
750
  }
522
- function responsiveGridGapXStyle(props) {
523
- const {
524
- media,
525
- space
526
- } = getTheme_v2(props.theme);
527
- return _responsive(media, props.$gapX, (gapX) => ({
528
- columnGap: gapX ? rem(space[gapX]) : void 0
529
- }));
751
+ function usePrefersReducedMotion(t0) {
752
+ return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$9 : t0);
530
753
  }
531
- function responsiveGridGapYStyle(props) {
532
- const {
533
- media,
534
- space
535
- } = getTheme_v2(props.theme);
536
- return _responsive(media, props.$gapY, (gapY) => ({
537
- rowGap: gapY ? rem(space[gapY]) : void 0
538
- }));
754
+ function _temp$9() {
755
+ return !1;
539
756
  }
540
- function responsiveGridItemStyle() {
541
- return [responsiveGridItemRowStyle, responsiveGridItemRowStartStyle, responsiveGridItemRowEndStyle, responsiveGridItemColumnStyle, responsiveGridItemColumnStartStyle, responsiveGridItemColumnEndStyle];
757
+ function responsiveBorderStyle() {
758
+ return [border, borderTop, borderRight, borderBottom, borderLeft];
542
759
  }
543
- const GRID_ITEM_ROW = {
544
- auto: "auto",
545
- full: "1 / -1"
546
- }, GRID_ITEM_COLUMN = {
547
- auto: "auto",
548
- full: "1 / -1"
549
- };
550
- function responsiveGridItemRowStyle(props) {
760
+ function border(props) {
551
761
  const {
762
+ card,
552
763
  media
553
- } = getTheme_v2(props.theme);
554
- return _responsive(media, props.$row, (row) => typeof row == "number" ? {
555
- gridRow: `span ${row} / span ${row}`
764
+ } = getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
765
+ return _responsive(media, props.$border, (value) => value ? {
766
+ "&&": {
767
+ border: borderStyle
768
+ }
556
769
  } : {
557
- gridRow: GRID_ITEM_ROW[row]
770
+ "&&": {
771
+ border: 0
772
+ }
558
773
  });
559
774
  }
560
- function responsiveGridItemRowStartStyle(props) {
561
- const {
562
- media
563
- } = getTheme_v2(props.theme);
564
- return _responsive(media, props.$rowStart, (rowStart) => ({
565
- gridRowStart: rowStart
566
- }));
567
- }
568
- function responsiveGridItemRowEndStyle(props) {
775
+ function borderTop(props) {
569
776
  const {
777
+ card,
570
778
  media
571
- } = getTheme_v2(props.theme);
572
- return _responsive(media, props.$rowEnd, (rowEnd) => ({
573
- gridRowEnd: rowEnd
574
- }));
779
+ } = getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
780
+ return _responsive(media, props.$borderTop, (value) => value ? {
781
+ "&&": {
782
+ borderTop: borderStyle
783
+ }
784
+ } : {
785
+ "&&": {
786
+ borderTop: 0
787
+ }
788
+ });
575
789
  }
576
- function responsiveGridItemColumnStyle(props) {
790
+ function borderRight(props) {
577
791
  const {
792
+ card,
578
793
  media
579
- } = getTheme_v2(props.theme);
580
- return _responsive(media, props.$column, (column) => typeof column == "number" ? {
581
- gridColumn: `span ${column} / span ${column}`
794
+ } = getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
795
+ return _responsive(media, props.$borderRight, (value) => value ? {
796
+ "&&": {
797
+ borderRight: borderStyle
798
+ }
582
799
  } : {
583
- gridColumn: GRID_ITEM_COLUMN[column]
800
+ "&&": {
801
+ borderRight: 0
802
+ }
584
803
  });
585
804
  }
586
- function responsiveGridItemColumnStartStyle(props) {
805
+ function borderBottom(props) {
587
806
  const {
807
+ card,
588
808
  media
589
- } = getTheme_v2(props.theme);
590
- return _responsive(media, props.$columnStart, (columnStart) => ({
591
- gridColumnStart: columnStart
592
- }));
809
+ } = getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
810
+ return _responsive(media, props.$borderBottom, (value) => value ? {
811
+ "&&": {
812
+ borderBottom: borderStyle
813
+ }
814
+ } : {
815
+ "&&": {
816
+ borderBottom: 0
817
+ }
818
+ });
593
819
  }
594
- function responsiveGridItemColumnEndStyle(props) {
820
+ function borderLeft(props) {
595
821
  const {
822
+ card,
596
823
  media
597
- } = getTheme_v2(props.theme);
598
- return _responsive(media, props.$columnEnd, (columnEnd) => ({
599
- gridColumnEnd: columnEnd
600
- }));
601
- }
602
- function responsiveInputPaddingStyle(props) {
603
- const {
604
- $fontSize,
605
- $iconLeft,
606
- $iconRight,
607
- $padding,
608
- $space
609
- } = props, {
610
- font,
611
- media,
612
- space
613
- } = getTheme_v2(props.theme), len = Math.max($padding.length, $space.length, $fontSize.length), _padding = [], _space = [], _fontSize = [];
614
- for (let i = 0; i < len; i += 1)
615
- _fontSize[i] = $fontSize[i] === void 0 ? _fontSize[i - 1] : $fontSize[i], _padding[i] = $padding[i] === void 0 ? _padding[i - 1] : $padding[i], _space[i] = $space[i] === void 0 ? _space[i - 1] : $space[i];
616
- return _responsive(media, _padding, (_, i) => {
617
- const size2 = font.text.sizes[_fontSize[i]] || font.text.sizes[2], emSize = size2.lineHeight - size2.ascenderHeight - size2.descenderHeight, p = space[_padding[i]], s = space[_space[i]], styles = {
618
- paddingTop: rem(p - size2.ascenderHeight),
619
- paddingRight: rem(p),
620
- paddingBottom: rem(p - size2.descenderHeight),
621
- paddingLeft: rem(p)
622
- };
623
- return $iconRight && (styles.paddingRight = rem(p + emSize + s)), $iconLeft && (styles.paddingLeft = rem(p + emSize + s)), styles;
824
+ } = getTheme_v2(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
825
+ return _responsive(media, props.$borderLeft, (value) => value ? {
826
+ "&&": {
827
+ borderLeft: borderStyle
828
+ }
829
+ } : {
830
+ "&&": {
831
+ borderLeft: 0
832
+ }
624
833
  });
625
834
  }
626
- function responsiveInputPaddingIconRightStyle(props) {
627
- return responsiveInputPaddingStyle({
628
- ...props,
629
- $iconRight: !0
630
- });
835
+ const BASE_STYLE$4 = {
836
+ '&[data-as="ul"],&[data-as="ol"]': {
837
+ listStyle: "none"
838
+ }
839
+ }, BOX_SIZING = {
840
+ content: "content-box",
841
+ border: "border-box"
842
+ }, BOX_HEIGHT = {
843
+ stretch: "stretch",
844
+ fill: "100%"
845
+ };
846
+ function boxStyle() {
847
+ return BASE_STYLE$4;
631
848
  }
632
- const ROOT_STYLE = css`
633
- &:not([hidden]) {
634
- display: flex;
635
- }
636
-
637
- align-items: center;
638
- `;
639
- function textInputRootStyle() {
640
- return ROOT_STYLE;
849
+ function responsiveBoxStyle() {
850
+ return [responsiveBoxSizingStyle, responsiveBoxHeightStyle, responsiveBoxOverflowStyle, responsiveBoxDisplayStyle];
641
851
  }
642
- function textInputBaseStyle(props) {
852
+ function responsiveBoxDisplayStyle(props) {
643
853
  const {
644
- $scheme,
645
- $tone,
646
- $weight
647
- } = props, {
648
- color,
649
- font
854
+ media
650
855
  } = getTheme_v2(props.theme);
651
- return css`
652
- appearance: none;
653
- background: none;
654
- border: 0;
655
- border-radius: 0;
656
- outline: none;
657
- width: 100%;
658
- box-sizing: border-box;
659
- font-family: ${font.text.family};
660
- font-weight: ${$weight && font.text.weights[$weight] || font.text.weights.regular};
661
- margin: 0;
662
- position: relative;
663
- z-index: 1;
664
- display: block;
665
-
666
- /* NOTE: This is a hack to disable Chrome’s autofill styles */
667
- &:-webkit-autofill,
668
- &:-webkit-autofill:hover,
669
- &:-webkit-autofill:focus,
670
- &:-webkit-autofill:active {
671
- -webkit-text-fill-color: var(--input-fg-color) !important;
672
- transition: background-color 5000s;
673
- transition-delay: 86400s /* 24h */;
674
- }
675
-
676
- /* &:is(textarea) */
677
- &[data-as='textarea'] {
678
- resize: none;
679
- }
680
-
681
- color: var(--input-fg-color);
682
-
683
- &::placeholder {
684
- color: var(--input-placeholder-color);
685
- }
686
-
687
- &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
688
- --input-fg-color: ${color.input.default.enabled.fg};
689
- --input-placeholder-color: ${color.input.default.enabled.placeholder};
690
-
691
- /* enabled */
692
- &:not(:invalid):not(:disabled):not(:read-only) {
693
- --input-fg-color: ${color.input.default.enabled.fg};
694
- --input-placeholder-color: ${color.input.default.enabled.placeholder};
695
- }
696
-
697
- /* disabled */
698
- &:not(:invalid):disabled {
699
- --input-fg-color: ${color.input.default.disabled.fg};
700
- --input-placeholder-color: ${color.input.default.disabled.placeholder};
701
- }
702
-
703
- /* invalid */
704
- &:invalid {
705
- --input-fg-color: ${color.input.invalid.enabled.fg};
706
- --input-placeholder-color: ${color.input.invalid.enabled.placeholder};
707
- }
708
-
709
- /* readOnly */
710
- &:read-only {
711
- --input-fg-color: ${color.input.default.readOnly.fg};
712
- --input-placeholder-color: ${color.input.default.readOnly.placeholder};
713
- }
856
+ return _responsive(media, props.$display, (display) => ({
857
+ "&:not([hidden])": {
858
+ display
714
859
  }
715
- `;
860
+ }));
716
861
  }
717
- function textInputFontSizeStyle(props) {
862
+ function responsiveBoxSizingStyle(props) {
718
863
  const {
719
- font,
720
864
  media
721
865
  } = getTheme_v2(props.theme);
722
- return _responsive(media, props.$fontSize, (sizeIndex) => {
723
- const size2 = font.text.sizes[sizeIndex] || font.text.sizes[2];
724
- return {
725
- fontSize: rem(size2.fontSize),
726
- lineHeight: size2.lineHeight / size2.fontSize
727
- };
728
- });
866
+ return _responsive(media, props.$sizing, (sizing) => ({
867
+ boxSizing: BOX_SIZING[sizing]
868
+ }));
729
869
  }
730
- function textInputRepresentationStyle(props) {
870
+ function responsiveBoxHeightStyle(props) {
731
871
  const {
732
- $hasPrefix,
733
- $hasSuffix,
734
- $scheme,
735
- $tone,
736
- $unstableDisableFocusRing
737
- } = props, {
738
- color,
739
- input
872
+ media
740
873
  } = getTheme_v2(props.theme);
741
- return css`
742
- --input-box-shadow: none;
743
-
744
- position: absolute;
745
- top: 0;
746
- left: 0;
747
- right: 0;
748
- bottom: 0;
749
- display: block;
750
- pointer-events: none;
751
- z-index: 0;
752
-
753
- background-color: var(--card-bg-color);
754
- box-shadow: var(--input-box-shadow);
755
-
756
- border-top-left-radius: ${$hasPrefix ? 0 : void 0};
757
- border-bottom-left-radius: ${$hasPrefix ? 0 : void 0};
758
- border-top-right-radius: ${$hasSuffix ? 0 : void 0};
759
- border-bottom-right-radius: ${$hasSuffix ? 0 : void 0};
760
-
761
- &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
762
- --card-bg-color: ${color.input.default.enabled.bg};
763
- --card-fg-color: ${color.input.default.enabled.fg};
764
-
765
- /* enabled */
766
- *:not(:disabled) + &[data-border] {
767
- --input-box-shadow: ${focusRingBorderStyle({
768
- color: color.input.default.enabled.border,
769
- width: input.border.width
770
- })};
771
- }
772
-
773
- /* invalid */
774
- *:not(:disabled):invalid + & {
775
- --card-bg-color: ${color.input.invalid.enabled.bg};
776
- --card-fg-color: ${color.input.invalid.enabled.fg};
777
-
778
- &[data-border] {
779
- --input-box-shadow: ${focusRingBorderStyle({
780
- color: color.input.invalid.enabled.border,
781
- width: input.border.width
782
- })};
783
- }
784
- }
785
-
786
- /* focused */
787
- *:not(:disabled):focus + & {
788
- &[data-border] {
789
- --input-box-shadow: ${$unstableDisableFocusRing ? void 0 : focusRingStyle({
790
- border: {
791
- color: color.input.default.enabled.border,
792
- width: input.border.width
793
- },
794
- focusRing: input.text.focusRing
795
- })};
796
- }
797
-
798
- &:not([data-border]) {
799
- --input-box-shadow: ${$unstableDisableFocusRing ? void 0 : focusRingStyle({
800
- focusRing: input.text.focusRing
801
- })};
802
- }
803
- }
804
-
805
- /* disabled */
806
- *:not(:invalid):disabled + & {
807
- --card-bg-color: ${color.input.default.disabled.bg} !important;
808
- --card-fg-color: ${color.input.default.disabled.fg} !important;
809
- --card-icon-color: ${color.input.default.disabled.fg} !important;
810
-
811
- &[data-border] {
812
- --input-box-shadow: ${focusRingBorderStyle({
813
- color: color.input.default.disabled.border,
814
- width: input.border.width
815
- })};
816
- }
817
- }
818
-
819
- *:invalid:disabled + & {
820
- --card-bg-color: ${color.input.invalid.disabled.bg} !important;
821
- --card-fg-color: ${color.input.invalid.disabled.fg} !important;
822
- --card-icon-color: ${color.input.invalid.disabled.fg} !important;
823
-
824
- &[data-border] {
825
- --input-box-shadow: ${focusRingBorderStyle({
826
- color: color.input.invalid.disabled.border,
827
- width: input.border.width
828
- })};
829
- }
830
- }
831
-
832
- /* readOnly */
833
- *:not(:invalid):read-only + & {
834
- --card-bg-color: ${color.input.default.readOnly.bg} !important;
835
- --card-fg-color: ${color.input.default.readOnly.fg} !important;
836
- }
837
-
838
- *:invalid:read-only + & {
839
- --card-bg-color: ${color.input.invalid.readOnly.bg} !important;
840
- --card-fg-color: ${color.input.invalid.readOnly.fg} !important;
841
- }
842
-
843
- /* hovered */
844
- @media (hover: hover) {
845
- *:not(:disabled):not(:read-only):not(:invalid):hover + & {
846
- --card-bg-color: ${color.input.default.hovered.bg};
847
- --card-fg-color: ${color.input.default.hovered.fg};
848
- }
849
-
850
- *:invalid:not(:disabled):not(:read-only):hover + & {
851
- --card-bg-color: ${color.input.invalid.hovered.bg};
852
- --card-fg-color: ${color.input.invalid.hovered.fg};
853
- }
854
-
855
- *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {
856
- --input-box-shadow: ${focusRingBorderStyle({
857
- color: color.input.default.hovered.border,
858
- width: input.border.width
859
- })};
860
- }
861
-
862
- *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {
863
- --input-box-shadow: ${focusRingBorderStyle({
864
- color: color.input.invalid.hovered.border,
865
- width: input.border.width
866
- })};
867
- }
868
- }
869
- }
870
- `;
874
+ return _responsive(media, props.$height, (height) => ({
875
+ height: BOX_HEIGHT[height]
876
+ }));
871
877
  }
872
- function responsiveMarginStyle(props) {
878
+ function responsiveBoxOverflowStyle(props) {
873
879
  const {
874
- theme
875
- } = props;
876
- return [_getResponsiveSpace(theme, ["margin"], props.$margin), _getResponsiveSpace(theme, ["marginLeft", "marginRight"], props.$marginX), _getResponsiveSpace(theme, ["marginTop", "marginBottom"], props.$marginY), _getResponsiveSpace(theme, ["marginTop"], props.$marginTop), _getResponsiveSpace(theme, ["marginRight"], props.$marginRight), _getResponsiveSpace(theme, ["marginBottom"], props.$marginBottom), _getResponsiveSpace(theme, ["marginLeft"], props.$marginLeft)].filter(Boolean);
880
+ media
881
+ } = getTheme_v2(props.theme);
882
+ return _responsive(media, props.$overflow, (overflow) => ({
883
+ overflow
884
+ }));
885
+ }
886
+ const BASE_STYLE$3 = {
887
+ "&&:not([hidden])": {
888
+ display: "flex"
889
+ }
890
+ };
891
+ function responsiveFlexStyle() {
892
+ return [BASE_STYLE$3, responsiveFlexAlignStyle, responsiveFlexGapStyle, responsiveFlexWrapStyle, responsiveFlexJustifyStyle, responsiveFlexDirectionStyle];
877
893
  }
878
- function responsivePaddingStyle(props) {
894
+ function responsiveFlexAlignStyle(props) {
879
895
  const {
880
- theme
881
- } = props;
882
- return [_getResponsiveSpace(theme, ["padding"], props.$padding), _getResponsiveSpace(theme, ["paddingLeft", "paddingRight"], props.$paddingX), _getResponsiveSpace(theme, ["paddingTop", "paddingBottom"], props.$paddingY), _getResponsiveSpace(theme, ["paddingTop"], props.$paddingTop), _getResponsiveSpace(theme, ["paddingRight"], props.$paddingRight), _getResponsiveSpace(theme, ["paddingBottom"], props.$paddingBottom), _getResponsiveSpace(theme, ["paddingLeft"], props.$paddingLeft)].filter(Boolean);
896
+ media
897
+ } = getTheme_v2(props.theme);
898
+ return _responsive(media, props.$align, (align) => ({
899
+ alignItems: align
900
+ }));
883
901
  }
884
- function responsiveRadiusStyle(props) {
902
+ function responsiveFlexGapStyle(props) {
885
903
  const {
886
904
  media,
887
- radius
905
+ space
888
906
  } = getTheme_v2(props.theme);
889
- return _responsive(media, props.$radius, (value) => {
890
- let borderRadius = 0;
891
- return typeof value == "number" && (borderRadius = rem(radius[value])), value === "full" && (borderRadius = "9999px"), {
892
- borderRadius
893
- };
894
- });
895
- }
896
- function toBoxShadow(shadow, color) {
897
- return `${shadow.map(rem).join(" ")} ${color}`;
907
+ return _responsive(media, props.$gap, (gap) => ({
908
+ gap: gap ? rem(space[gap]) : void 0
909
+ }));
898
910
  }
899
- function shadowStyle(shadow, outlineWidth = 1) {
900
- if (!shadow) return EMPTY_RECORD;
901
- const outline = `0 0 0 ${rem(outlineWidth)} var(--card-shadow-outline-color)`, umbra = toBoxShadow(shadow.umbra, "var(--card-shadow-umbra-color)"), penumbra = toBoxShadow(shadow.penumbra, "var(--card-shadow-penumbra-color)"), ambient = toBoxShadow(shadow.ambient, "var(--card-shadow-ambient-color)");
902
- return {
903
- boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}`
904
- };
911
+ function responsiveFlexWrapStyle(props) {
912
+ const {
913
+ media
914
+ } = getTheme_v2(props.theme);
915
+ return _responsive(media, props.$wrap, (wrap) => ({
916
+ flexWrap: wrap
917
+ }));
905
918
  }
906
- function responsiveShadowStyle(props) {
919
+ function responsiveFlexJustifyStyle(props) {
907
920
  const {
908
- card,
909
- media,
910
- shadow
921
+ media
911
922
  } = getTheme_v2(props.theme);
912
- return _responsive(media, props.$shadow, (index) => shadowStyle(shadow[index], card.shadow.outline));
923
+ return _responsive(media, props.$justify, (justify) => ({
924
+ justifyContent: justify
925
+ }));
913
926
  }
914
- function labelBaseStyle(props) {
927
+ function responsiveFlexDirectionStyle(props) {
915
928
  const {
916
- $accent,
917
- $muted
918
- } = props, {
919
- font
929
+ media
920
930
  } = getTheme_v2(props.theme);
921
- return css`
922
- text-transform: uppercase;
923
-
924
- ${$accent && css`
925
- color: var(--card-accent-fg-color);
926
- `}
927
-
928
- ${$muted && css`
929
- color: var(--card-muted-fg-color);
930
- `}
931
-
932
- & code {
933
- font-family: ${font.code.family};
934
- border-radius: 1px;
935
- }
936
-
937
- & a {
938
- text-decoration: none;
939
- border-radius: 1px;
940
- }
941
-
942
- & svg {
943
- /* Certain popular CSS libraries changes the defaults for SVG display */
944
- /* Make sure SVGs are rendered as inline elements */
945
- display: inline;
946
- }
947
-
948
- & [data-sanity-icon] {
949
- vertical-align: baseline;
950
- }
951
- `;
931
+ return _responsive(media, props.$direction, (direction) => ({
932
+ flexDirection: direction
933
+ }));
952
934
  }
953
- const Root$C = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle), SpanWithTextOverflow$2 = styled.span`
954
- display: block;
955
- white-space: nowrap;
956
- text-overflow: ellipsis;
957
- overflow: hidden;
958
- overflow: clip;
959
- `, Label = forwardRef(function(props, ref) {
960
- const $ = c(22);
961
- let accent, align, childrenProp, restProps, t0, t1, textOverflow, weight;
962
- $[0] !== props ? ({
963
- accent,
964
- align,
965
- children: childrenProp,
966
- muted: t0,
967
- size: t1,
968
- textOverflow,
969
- weight,
970
- ...restProps
971
- } = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = childrenProp, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = textOverflow, $[8] = weight) : (accent = $[1], align = $[2], childrenProp = $[3], restProps = $[4], t0 = $[5], t1 = $[6], textOverflow = $[7], weight = $[8]);
972
- const muted = t0 === void 0 ? !1 : t0, size2 = t1 === void 0 ? 2 : t1;
973
- let children = childrenProp;
974
- if (textOverflow === "ellipsis") {
975
- let t22;
976
- $[9] !== children ? (t22 = /* @__PURE__ */ jsx(SpanWithTextOverflow$2, { children }), $[9] = children, $[10] = t22) : t22 = $[10], children = t22;
977
- } else {
978
- let t22;
979
- $[11] !== children ? (t22 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t22) : t22 = $[12], children = t22;
980
- }
981
- const t2 = useArrayProp$1(align), t3 = useArrayProp$1(size2);
982
- let t4;
983
- return $[13] !== accent || $[14] !== children || $[15] !== muted || $[16] !== ref || $[17] !== restProps || $[18] !== t2 || $[19] !== t3 || $[20] !== weight ? (t4 = /* @__PURE__ */ jsx(Root$C, { "data-ui": "Label", ...restProps, $accent: accent, $align: t2, $muted: muted, $size: t3, $weight: weight, ref, children }), $[13] = accent, $[14] = children, $[15] = muted, $[16] = ref, $[17] = restProps, $[18] = t2, $[19] = t3, $[20] = weight, $[21] = t4) : t4 = $[21], t4;
984
- });
985
- Label.displayName = "ForwardRef(Label)";
986
- const avatarStyle = {
987
- root: avatarRootStyle,
988
- arrow: avatarArrowStyle,
989
- bgStroke: avatarBgStrokeStyle,
990
- stroke: avatarStrokeStyle,
991
- initials: avatarInitialsStyle,
992
- image: avatarImageStyle
935
+ const BASE_STYLE$2 = {
936
+ minWidth: 0,
937
+ minHeight: 0
993
938
  };
994
- function avatarArrowStyle() {
995
- return {
996
- position: "absolute",
997
- boxSizing: "border-box",
998
- zIndex: 0,
999
- opacity: 0,
1000
- transition: "all 0.2s linear",
1001
- transform: "rotate(-90deg) translate3d(0, 6px, 0)",
1002
- left: 0,
1003
- right: 0,
1004
- top: 0,
1005
- bottom: 0,
1006
- "& > svg": {
1007
- width: "11px",
1008
- height: "7px",
1009
- position: "absolute",
1010
- top: "-5px",
1011
- left: "50%",
1012
- transform: "translateX(-6px)",
1013
- "&:not([hidden])": {
1014
- display: "block"
1015
- }
1016
- },
1017
- "[data-arrow-position='inside'] > &": {
1018
- transform: "rotate(-90deg) translate3d(0, 6px, 0)",
1019
- opacity: 0
1020
- },
1021
- "[data-arrow-position='top'] > &": {
1022
- opacity: 1,
1023
- transform: "rotate(0deg)"
1024
- },
1025
- "[data-arrow-position='bottom'] > &": {
1026
- opacity: 1,
1027
- transform: "rotate(-180deg)"
1028
- }
1029
- };
939
+ function flexItemStyle() {
940
+ return [BASE_STYLE$2, responsiveFlexItemStyle];
1030
941
  }
1031
- function avatarRootStyle(props) {
942
+ function responsiveFlexItemStyle(props) {
1032
943
  const {
1033
- $color
1034
- } = props, {
1035
- avatar
944
+ media
1036
945
  } = getTheme_v2(props.theme);
1037
- return {
1038
- "--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
1039
- "--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
1040
- backgroundColor: "var(--avatar-bg-color)",
1041
- position: "relative",
1042
- boxSizing: "border-box",
1043
- userSelect: "none",
1044
- boxShadow: "0 0 0 1px var(--card-bg-color)",
1045
- '&[data-status="inactive"]': {
1046
- opacity: 0.5
1047
- },
1048
- "&>svg": {
1049
- "&:not([hidden])": {
1050
- display: "block"
1051
- }
1052
- },
1053
- /* &:is(button) */
1054
- '&[data-as="button"]': {
1055
- WebkitFontSmoothing: "inherit",
1056
- appearance: "none",
1057
- margin: 0,
1058
- padding: 0,
1059
- border: 0,
1060
- font: "inherit",
1061
- color: "inherit",
1062
- outline: "none",
1063
- "&:focus": {
1064
- boxShadow: focusRingStyle({
1065
- focusRing: avatar.focusRing
1066
- })
1067
- },
1068
- "&:focus:not(:focus-visible)": {
1069
- boxShadow: "none"
1070
- }
1071
- }
1072
- };
946
+ return props.$flex ? _responsive(media, props.$flex, (flex) => ({
947
+ flex
948
+ })) : EMPTY_ARRAY;
1073
949
  }
1074
- function responsiveAvatarSizeStyle(props) {
950
+ function focusRingBorderStyle(border2) {
951
+ return `inset 0 0 0 ${border2.width}px ${border2.color}`;
952
+ }
953
+ function focusRingStyle(opts) {
954
+ const {
955
+ base,
956
+ border: border2,
957
+ focusRing
958
+ } = opts, focusRingOutsetWidth = focusRing.offset + focusRing.width, focusRingInsetWidth = 0 - focusRing.offset, bgColor = base ? base.bg : "var(--card-bg-color)";
959
+ return [focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`, border2 && focusRingBorderStyle(border2), focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`, focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`].filter(Boolean).join(",");
960
+ }
961
+ const GRID_CSS = {
962
+ "&&:not([hidden])": {
963
+ display: "grid"
964
+ },
965
+ '&[data-as="ul"],&[data-as="ol"]': {
966
+ listStyle: "none"
967
+ }
968
+ }, GRID_AUTO_COLUMS = {
969
+ auto: "auto",
970
+ min: "min-content",
971
+ max: "max-content",
972
+ fr: "minmax(0, 1fr)"
973
+ }, GRID_AUTO_ROWS = {
974
+ auto: "auto",
975
+ min: "min-content",
976
+ max: "max-content",
977
+ fr: "minmax(0, 1fr)"
978
+ };
979
+ function responsiveGridStyle() {
980
+ return [GRID_CSS, responsiveGridAutoFlowStyle, responsiveGridAutoRowsStyle, responsiveGridAutoColsStyle, responsiveGridColumnsStyle, responsiveGridRowsStyle, responsiveGridGapStyle, responsiveGridGapXStyle, responsiveGridGapYStyle];
981
+ }
982
+ function responsiveGridAutoFlowStyle(props) {
1075
983
  const {
1076
- avatar,
1077
984
  media
1078
985
  } = getTheme_v2(props.theme);
1079
- return _responsive(media, props.$size, (size2) => {
1080
- const avatarSize = avatar.sizes[size2] || avatar.sizes[0];
1081
- return {
1082
- width: rem(avatarSize.size),
1083
- height: rem(avatarSize.size),
1084
- borderRadius: rem(avatarSize.size / 2),
1085
- "&>svg": {
1086
- width: rem(avatarSize.size),
1087
- height: rem(avatarSize.size),
1088
- borderRadius: rem(avatarSize.size / 2)
1089
- }
1090
- };
1091
- });
1092
- }
1093
- function avatarImageStyle() {
1094
- return {
1095
- position: "relative"
1096
- };
1097
- }
1098
- function avatarInitialsStyle() {
1099
- return {
1100
- width: "100%",
1101
- height: "100%",
1102
- color: "var(--avatar-fg-color)",
1103
- alignItems: "center",
1104
- justifyContent: "center",
1105
- textTransform: "uppercase",
1106
- textAlign: "center",
1107
- borderRadius: "50%",
1108
- "&:not([hidden])": {
1109
- display: "flex"
1110
- }
1111
- };
1112
- }
1113
- function avatarBgStrokeStyle() {
1114
- return {
1115
- strokeWidth: "4px",
1116
- stroke: "var(--card-bg-color)"
1117
- };
1118
- }
1119
- function avatarStrokeStyle() {
1120
- return {
1121
- strokeWidth: "2px",
1122
- stroke: "var(--avatar-bg-color)",
1123
- '[data-status="editing"] &': {
1124
- strokeDasharray: "2 4",
1125
- strokeLinecap: "round"
1126
- }
1127
- };
986
+ return _responsive(media, props.$autoFlow, (autoFlow) => ({
987
+ gridAutoFlow: autoFlow
988
+ }));
1128
989
  }
1129
- const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1 = styled.div(avatarStyle.arrow), BgStroke = styled.ellipse(avatarStyle.bgStroke), Stroke = styled.ellipse(avatarStyle.stroke), Initials = styled.div(avatarStyle.initials), InitialsLabel = styled(Label)({
1130
- color: "inherit"
1131
- }), Image = styled.svg(avatarStyle.image), Avatar = forwardRef(function(props, ref) {
1132
- const $ = c(53);
1133
- let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
1134
- $[0] !== props ? ({
1135
- __unstable_hideInnerStroke,
1136
- as: asProp,
1137
- color: t0,
1138
- src,
1139
- title,
1140
- initials,
1141
- onImageLoadError,
1142
- arrowPosition: arrowPositionProp,
1143
- animateArrowFrom,
1144
- status: t1,
1145
- size: t2,
1146
- ...restProps
1147
- } = props, $[0] = props, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = asProp, $[5] = initials, $[6] = onImageLoadError, $[7] = restProps, $[8] = src, $[9] = t0, $[10] = t1, $[11] = t2, $[12] = title) : (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], asProp = $[4], initials = $[5], onImageLoadError = $[6], restProps = $[7], src = $[8], t0 = $[9], t1 = $[10], t2 = $[11], title = $[12]);
1148
- const color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, {
1149
- avatar
1150
- } = useTheme_v2(), as = ReactIs.isValidElementType(asProp) ? asProp : "div", size2 = useArrayProp$1(sizeProp), _sizeRem = (avatar.sizes[size2[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = useId(), [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = useState(!1), imageId = `avatar-image-${elementId}`;
1151
- let t3, t4;
1152
- $[13] !== arrowPosition || $[14] !== arrowPositionProp ? (t3 = () => {
1153
- if (arrowPosition === arrowPositionProp)
1154
- return;
1155
- const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
1156
- return () => cancelAnimationFrame(raf);
1157
- }, t4 = [arrowPosition, arrowPositionProp], $[13] = arrowPosition, $[14] = arrowPositionProp, $[15] = t3, $[16] = t4) : (t3 = $[15], t4 = $[16]), useEffect(t3, t4);
1158
- let t5, t6;
1159
- $[17] !== src ? (t5 = () => {
1160
- src && setImageFailed(!1);
1161
- }, t6 = [src], $[17] = src, $[18] = t5, $[19] = t6) : (t5 = $[18], t6 = $[19]), useEffect(t5, t6);
1162
- let t7;
1163
- $[20] !== onImageLoadError ? (t7 = () => {
1164
- setImageFailed(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
1165
- }, $[20] = onImageLoadError, $[21] = t7) : t7 = $[21];
1166
- const handleImageError = t7;
1167
- let t8, t9;
1168
- if ($[22] !== size2) {
1169
- let t102;
1170
- $[24] === Symbol.for("react.memo_cache_sentinel") ? (t102 = (s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0, $[24] = t102) : t102 = $[24], t9 = size2.map(t102), $[22] = size2, $[23] = t9;
1171
- } else
1172
- t9 = $[23];
1173
- t8 = t9;
1174
- const initialsSize = t8, t10 = typeof as == "string" ? as : void 0;
1175
- let t11;
1176
- $[25] !== color ? (t11 = /* @__PURE__ */ jsx(Arrow$1, { children: /* @__PURE__ */ jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[25] = color, $[26] = t11) : t11 = $[26];
1177
- let t12;
1178
- $[27] !== __unstable_hideInnerStroke || $[28] !== _radius || $[29] !== _sizeRem || $[30] !== handleImageError || $[31] !== imageFailed || $[32] !== imageId || $[33] !== src ? (t12 = !imageFailed && src && /* @__PURE__ */ jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1179
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsx("image", { href: src, width: "1", height: "1", onError: handleImageError }) }) }),
1180
- /* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1181
- !__unstable_hideInnerStroke && /* @__PURE__ */ jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
1182
- /* @__PURE__ */ jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
1183
- ] }), $[27] = __unstable_hideInnerStroke, $[28] = _radius, $[29] = _sizeRem, $[30] = handleImageError, $[31] = imageFailed, $[32] = imageId, $[33] = src, $[34] = t12) : t12 = $[34];
1184
- let t13;
1185
- $[35] !== imageFailed || $[36] !== initials || $[37] !== initialsSize || $[38] !== src ? (t13 = (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Initials, { children: /* @__PURE__ */ jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) }), $[35] = imageFailed, $[36] = initials, $[37] = initialsSize, $[38] = src, $[39] = t13) : t13 = $[39];
1186
- let t14;
1187
- return $[40] !== arrowPosition || $[41] !== as || $[42] !== color || $[43] !== ref || $[44] !== restProps || $[45] !== size2 || $[46] !== status || $[47] !== t10 || $[48] !== t11 || $[49] !== t12 || $[50] !== t13 || $[51] !== title ? (t14 = /* @__PURE__ */ jsxs(Root$B, { as, "data-as": t10, "data-ui": "Avatar", ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
1188
- t11,
1189
- t12,
1190
- t13
1191
- ] }), $[40] = arrowPosition, $[41] = as, $[42] = color, $[43] = ref, $[44] = restProps, $[45] = size2, $[46] = status, $[47] = t10, $[48] = t11, $[49] = t12, $[50] = t13, $[51] = title, $[52] = t14) : t14 = $[52], t14;
1192
- });
1193
- Avatar.displayName = "ForwardRef(Avatar)";
1194
- function _responsiveAvatarCounterSizeStyle(props) {
990
+ function responsiveGridAutoRowsStyle(props) {
1195
991
  const {
1196
- avatar,
1197
992
  media
1198
993
  } = getTheme_v2(props.theme);
1199
- return _responsive(media, props.$size, (size2) => {
1200
- const avatarSize = avatar.sizes[size2];
1201
- return avatarSize ? {
1202
- borderRadius: rem(avatarSize.size / 2),
1203
- minWidth: rem(avatarSize.size),
1204
- height: rem(avatarSize.size)
1205
- } : EMPTY_RECORD;
1206
- });
994
+ return _responsive(media, props.$autoRows, (autoRows) => ({
995
+ gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows]
996
+ }));
1207
997
  }
1208
- function _avatarCounterBaseStyle(props) {
998
+ function responsiveGridAutoColsStyle(props) {
1209
999
  const {
1210
- space
1000
+ media
1211
1001
  } = getTheme_v2(props.theme);
1212
- return css`
1213
- align-items: center;
1214
- justify-content: center;
1215
- box-sizing: border-box;
1216
- user-select: none;
1217
- color: inherit;
1218
- color: var(--card-fg-color);
1219
- background: var(--card-bg-color);
1220
- box-shadow:
1221
- 0 0 0 1px var(--card-bg-color),
1222
- inset 0 0 0 1px var(--card-hairline-hard-color);
1223
- padding: 0 ${rem(space[2])};
1224
-
1225
- &:not([hidden]) {
1226
- display: flex;
1227
- }
1228
- `;
1002
+ return _responsive(media, props.$autoCols, (autoCols) => ({
1003
+ gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols]
1004
+ }));
1229
1005
  }
1230
- const Root$A = styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = forwardRef(function(props, ref) {
1231
- const $ = c(10), {
1232
- count,
1233
- size: t0
1234
- } = props, size2 = useArrayProp$1(t0 === void 0 ? 1 : t0);
1235
- let t1, t2;
1236
- if ($[0] !== size2) {
1237
- let t32;
1238
- $[2] === Symbol.for("react.memo_cache_sentinel") ? (t32 = (s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0, $[2] = t32) : t32 = $[2], t2 = size2.map(t32), $[0] = size2, $[1] = t2;
1239
- } else
1240
- t2 = $[1];
1241
- t1 = t2;
1242
- const fontSize2 = t1;
1243
- let t3;
1244
- $[3] !== count || $[4] !== fontSize2 ? (t3 = /* @__PURE__ */ jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }), $[3] = count, $[4] = fontSize2, $[5] = t3) : t3 = $[5];
1245
- let t4;
1246
- return $[6] !== ref || $[7] !== size2 || $[8] !== t3 ? (t4 = /* @__PURE__ */ jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: t3 }), $[6] = ref, $[7] = size2, $[8] = t3, $[9] = t4) : t4 = $[9], t4;
1247
- });
1248
- AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
1249
- const BASE_STYLES = css`
1250
- white-space: nowrap;
1251
-
1252
- & > div {
1253
- vertical-align: top;
1254
-
1255
- &:not([hidden]) {
1256
- display: inline-block;
1257
- }
1258
- }
1259
- `;
1260
- function avatarStackStyle() {
1261
- return BASE_STYLES;
1006
+ function responsiveGridColumnsStyle(props) {
1007
+ const {
1008
+ media
1009
+ } = getTheme_v2(props.theme);
1010
+ return _responsive(media, props.$columns, (columns) => ({
1011
+ gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));`
1012
+ }));
1262
1013
  }
1263
- function responsiveAvatarStackSizeStyle(props) {
1014
+ function responsiveGridRowsStyle(props) {
1264
1015
  const {
1265
- avatar,
1266
1016
  media
1267
1017
  } = getTheme_v2(props.theme);
1268
- return _responsive(media, props.$size, (size2) => {
1269
- const avatarSize = avatar.sizes[size2];
1270
- return avatarSize ? {
1271
- "& > div + div": {
1272
- marginLeft: rem(avatarSize.distance)
1273
- }
1274
- } : EMPTY_RECORD;
1275
- });
1018
+ return _responsive(media, props.$rows, (rows) => ({
1019
+ gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));`
1020
+ }));
1276
1021
  }
1277
- const Root$z = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = forwardRef(function(props, ref) {
1278
- const $ = c(15);
1279
- let childrenProp, restProps, t0, t1;
1280
- $[0] !== props ? ({
1281
- children: childrenProp,
1282
- maxLength: t0,
1283
- size: t1,
1284
- ...restProps
1285
- } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps, $[3] = t0, $[4] = t1) : (childrenProp = $[1], restProps = $[2], t0 = $[3], t1 = $[4]);
1286
- const maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1, children = Children.toArray(childrenProp).filter(isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp$1(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children, T0 = Root$z, t2 = "AvatarStack", t3 = len === 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }) }), t4 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }) });
1287
- let t5;
1288
- $[5] !== size2 ? (t5 = (child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, {
1289
- size: size2
1290
- }) }, String(childIndex)), $[5] = size2, $[6] = t5) : t5 = $[6];
1291
- const t6 = visibleChildren.map(t5);
1292
- let t7;
1293
- return $[7] !== T0 || $[8] !== ref || $[9] !== restProps || $[10] !== size2 || $[11] !== t3 || $[12] !== t4 || $[13] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T0, { "data-ui": t2, ...restProps, ref, $size: size2, children: [
1294
- t3,
1295
- t4,
1296
- t6
1297
- ] }), $[7] = T0, $[8] = ref, $[9] = restProps, $[10] = size2, $[11] = t3, $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14], t7;
1298
- });
1299
- AvatarStack.displayName = "ForwardRef(AvatarStack)";
1300
- const Root$y = styled.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle), Box = forwardRef(function(props, ref) {
1301
- const $ = c(59);
1302
- let column, columnEnd, columnStart, flex, height, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, overflow, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, restProps, row, rowEnd, rowStart, sizing, t0, t1, t2, t3;
1303
- $[0] !== props ? ({
1304
- as: t0,
1305
- column,
1306
- columnStart,
1307
- columnEnd,
1308
- display: t1,
1309
- flex,
1310
- height,
1311
- margin: t2,
1312
- marginX,
1313
- marginY,
1314
- marginTop,
1315
- marginRight,
1316
- marginBottom,
1317
- marginLeft,
1318
- overflow,
1319
- padding: t3,
1320
- paddingX,
1321
- paddingY,
1322
- paddingTop,
1323
- paddingRight,
1324
- paddingBottom,
1325
- paddingLeft,
1326
- row,
1327
- rowStart,
1328
- rowEnd,
1329
- sizing,
1330
- ...restProps
1331
- } = props, $[0] = props, $[1] = column, $[2] = columnEnd, $[3] = columnStart, $[4] = flex, $[5] = height, $[6] = marginBottom, $[7] = marginLeft, $[8] = marginRight, $[9] = marginTop, $[10] = marginX, $[11] = marginY, $[12] = overflow, $[13] = paddingBottom, $[14] = paddingLeft, $[15] = paddingRight, $[16] = paddingTop, $[17] = paddingX, $[18] = paddingY, $[19] = restProps, $[20] = row, $[21] = rowEnd, $[22] = rowStart, $[23] = sizing, $[24] = t0, $[25] = t1, $[26] = t2, $[27] = t3) : (column = $[1], columnEnd = $[2], columnStart = $[3], flex = $[4], height = $[5], marginBottom = $[6], marginLeft = $[7], marginRight = $[8], marginTop = $[9], marginX = $[10], marginY = $[11], overflow = $[12], paddingBottom = $[13], paddingLeft = $[14], paddingRight = $[15], paddingTop = $[16], paddingX = $[17], paddingY = $[18], restProps = $[19], row = $[20], rowEnd = $[21], rowStart = $[22], sizing = $[23], t0 = $[24], t1 = $[25], t2 = $[26], t3 = $[27]);
1332
- const asProp = t0 === void 0 ? "div" : t0, display = t1 === void 0 ? "block" : t1, margin = t2 === void 0 ? 0 : t2, padding = t3 === void 0 ? 0 : t3, t4 = typeof asProp == "string" ? asProp : void 0, t5 = useArrayProp$1(column), t6 = useArrayProp$1(columnStart), t7 = useArrayProp$1(columnEnd), t8 = useArrayProp$1(display), t9 = useArrayProp$1(flex), t10 = useArrayProp$1(height), t11 = useArrayProp$1(margin), t12 = useArrayProp$1(marginX), t13 = useArrayProp$1(marginY), t14 = useArrayProp$1(marginTop), t15 = useArrayProp$1(marginRight), t16 = useArrayProp$1(marginBottom), t17 = useArrayProp$1(marginLeft), t18 = useArrayProp$1(overflow), t19 = useArrayProp$1(padding), t20 = useArrayProp$1(paddingX), t21 = useArrayProp$1(paddingY), t22 = useArrayProp$1(paddingTop), t23 = useArrayProp$1(paddingRight), t24 = useArrayProp$1(paddingBottom), t25 = useArrayProp$1(paddingLeft), t26 = useArrayProp$1(row), t27 = useArrayProp$1(rowStart), t28 = useArrayProp$1(rowEnd), t29 = useArrayProp$1(sizing);
1333
- let t30;
1334
- return $[28] !== asProp || $[29] !== props.children || $[30] !== ref || $[31] !== restProps || $[32] !== t10 || $[33] !== t11 || $[34] !== t12 || $[35] !== t13 || $[36] !== t14 || $[37] !== t15 || $[38] !== t16 || $[39] !== t17 || $[40] !== t18 || $[41] !== t19 || $[42] !== t20 || $[43] !== t21 || $[44] !== t22 || $[45] !== t23 || $[46] !== t24 || $[47] !== t25 || $[48] !== t26 || $[49] !== t27 || $[50] !== t28 || $[51] !== t29 || $[52] !== t4 || $[53] !== t5 || $[54] !== t6 || $[55] !== t7 || $[56] !== t8 || $[57] !== t9 ? (t30 = /* @__PURE__ */ jsx(Root$y, { "data-as": t4, "data-ui": "Box", ...restProps, $column: t5, $columnStart: t6, $columnEnd: t7, $display: t8, $flex: t9, $height: t10, $margin: t11, $marginX: t12, $marginY: t13, $marginTop: t14, $marginRight: t15, $marginBottom: t16, $marginLeft: t17, $overflow: t18, $padding: t19, $paddingX: t20, $paddingY: t21, $paddingTop: t22, $paddingRight: t23, $paddingBottom: t24, $paddingLeft: t25, $row: t26, $rowStart: t27, $rowEnd: t28, $sizing: t29, as: asProp, ref, children: props.children }), $[28] = asProp, $[29] = props.children, $[30] = ref, $[31] = restProps, $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13, $[36] = t14, $[37] = t15, $[38] = t16, $[39] = t17, $[40] = t18, $[41] = t19, $[42] = t20, $[43] = t21, $[44] = t22, $[45] = t23, $[46] = t24, $[47] = t25, $[48] = t26, $[49] = t27, $[50] = t28, $[51] = t29, $[52] = t4, $[53] = t5, $[54] = t6, $[55] = t7, $[56] = t8, $[57] = t9, $[58] = t30) : t30 = $[58], t30;
1335
- });
1336
- Box.displayName = "ForwardRef(Box)";
1337
- function textBaseStyle(props) {
1022
+ function responsiveGridGapStyle(props) {
1023
+ const {
1024
+ media,
1025
+ space
1026
+ } = getTheme_v2(props.theme);
1027
+ return _responsive(media, props.$gap, (gap) => ({
1028
+ gridGap: gap ? rem(space[gap]) : void 0
1029
+ }));
1030
+ }
1031
+ function responsiveGridGapXStyle(props) {
1338
1032
  const {
1339
- $accent,
1340
- $muted
1341
- } = props, {
1342
- font
1033
+ media,
1034
+ space
1343
1035
  } = getTheme_v2(props.theme);
1344
- return css`
1345
- color: var(--card-fg-color);
1346
-
1347
- ${$accent && css`
1348
- color: var(--card-accent-fg-color);
1349
- `}
1350
-
1351
- ${$muted && css`
1352
- color: var(--card-muted-fg-color);
1353
- `}
1354
-
1355
- & code {
1356
- font-family: ${font.code.family};
1357
- border-radius: 1px;
1358
- background-color: var(--card-code-bg-color);
1359
- color: var(--card-code-fg-color);
1360
- }
1361
-
1362
- & a {
1363
- text-decoration: none;
1364
- border-radius: 1px;
1365
- color: var(--card-link-color);
1366
- outline: none;
1367
-
1368
- @media (hover: hover) {
1369
- &:hover {
1370
- text-decoration: underline;
1371
- }
1372
- }
1373
-
1374
- &:focus {
1375
- box-shadow:
1376
- 0 0 0 1px var(--card-bg-color),
1377
- 0 0 0 3px var(--card-focus-ring-color);
1378
- }
1379
-
1380
- &:focus:not(:focus-visible) {
1381
- box-shadow: none;
1382
- }
1383
- }
1384
-
1385
- & strong {
1386
- font-weight: ${font.text.weights.bold};
1387
- }
1388
-
1389
- & svg {
1390
- /* Certain popular CSS libraries changes the defaults for SVG display */
1391
- /* Make sure SVGs are rendered as inline elements */
1392
- display: inline;
1393
- }
1394
-
1395
- & [data-sanity-icon] {
1396
- vertical-align: baseline;
1397
- color: var(--card-icon-color);
1398
-
1399
- & path {
1400
- vector-effect: non-scaling-stroke !important;
1401
- }
1402
- }
1403
- `;
1036
+ return _responsive(media, props.$gapX, (gapX) => ({
1037
+ columnGap: gapX ? rem(space[gapX]) : void 0
1038
+ }));
1404
1039
  }
1405
- const Root$x = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle), SpanWithTextOverflow$1 = styled.span`
1406
- display: block;
1407
- white-space: nowrap;
1408
- text-overflow: ellipsis;
1409
- overflow: hidden;
1410
- overflow: clip;
1411
- `, Text = forwardRef(function(props, ref) {
1412
- const $ = c(22);
1413
- let align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
1414
- $[0] !== props ? ({
1415
- accent: t0,
1416
- align,
1417
- children: childrenProp,
1418
- muted: t1,
1419
- size: t2,
1420
- textOverflow,
1421
- weight,
1422
- ...restProps
1423
- } = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight) : (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]);
1424
- const accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 2 : t2;
1425
- let children = childrenProp;
1426
- if (textOverflow === "ellipsis") {
1427
- let t32;
1428
- $[9] !== children ? (t32 = /* @__PURE__ */ jsx(SpanWithTextOverflow$1, { children }), $[9] = children, $[10] = t32) : t32 = $[10], children = t32;
1429
- }
1430
- const t3 = useArrayProp$1(align), t4 = useArrayProp$1(size2);
1431
- let t5;
1432
- $[11] !== children ? (t5 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t5) : t5 = $[12];
1433
- let t6;
1434
- return $[13] !== accent || $[14] !== muted || $[15] !== ref || $[16] !== restProps || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== weight ? (t6 = /* @__PURE__ */ jsx(Root$x, { "data-ui": "Text", ...restProps, $accent: accent, $align: t3, $muted: muted, ref, $size: t4, $weight: weight, children: t5 }), $[13] = accent, $[14] = muted, $[15] = ref, $[16] = restProps, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = weight, $[21] = t6) : t6 = $[21], t6;
1435
- });
1436
- Text.displayName = "ForwardRef(Text)";
1437
- function badgeStyle(props) {
1040
+ function responsiveGridGapYStyle(props) {
1438
1041
  const {
1439
- $tone
1440
- } = props;
1441
- return {
1442
- "--card-bg-color": `var(--card-badge-${$tone}-bg-color)`,
1443
- "--card-fg-color": `var(--card-badge-${$tone}-fg-color)`,
1444
- backgroundColor: "var(--card-bg-color)",
1445
- cursor: "default",
1446
- "&:not([hidden])": {
1447
- display: "inline-block",
1448
- verticalAlign: "top"
1449
- }
1450
- };
1042
+ media,
1043
+ space
1044
+ } = getTheme_v2(props.theme);
1045
+ return _responsive(media, props.$gapY, (gapY) => ({
1046
+ rowGap: gapY ? rem(space[gapY]) : void 0
1047
+ }));
1451
1048
  }
1452
- const Root$w = styled(Box)(responsiveRadiusStyle, badgeStyle), Badge = forwardRef(function(props, ref) {
1453
- const $ = c(17);
1454
- let children, restProps, t0, t1, t2, t3;
1455
- if ($[0] !== props) {
1456
- const {
1457
- children: t42,
1458
- fontSize: t52,
1459
- mode: _deprecated_mode,
1460
- padding: t62,
1461
- radius: t72,
1462
- tone: t8,
1463
- ...t9
1464
- } = props;
1465
- children = t42, t0 = t52, t1 = t62, t2 = t72, t3 = t8, restProps = t9, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2, $[6] = t3;
1466
- } else
1467
- children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5], t3 = $[6];
1468
- const fontSize2 = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? "full" : t2, tone = t3 === void 0 ? "default" : t3, t4 = useArrayProp$1(radius), t5 = useArrayProp$1(padding);
1469
- let t6;
1470
- $[7] !== children || $[8] !== fontSize2 ? (t6 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children }), $[7] = children, $[8] = fontSize2, $[9] = t6) : t6 = $[9];
1471
- let t7;
1472
- return $[10] !== ref || $[11] !== restProps || $[12] !== t4 || $[13] !== t5 || $[14] !== t6 || $[15] !== tone ? (t7 = /* @__PURE__ */ jsx(Root$w, { "data-ui": "Badge", ...restProps, $tone: tone, $radius: t4, padding: t5, ref, children: t6 }), $[10] = ref, $[11] = restProps, $[12] = t4, $[13] = t5, $[14] = t6, $[15] = tone, $[16] = t7) : t7 = $[16], t7;
1473
- });
1474
- Badge.displayName = "ForwardRef(Badge)";
1475
- const Root$v = styled(Box)(flexItemStyle, responsiveFlexStyle), Flex = forwardRef(function(props, ref) {
1476
- const $ = c(17);
1477
- let align, as, gap, justify, restProps, t0, wrap;
1478
- $[0] !== props ? ({
1479
- align,
1480
- as,
1481
- direction: t0,
1482
- gap,
1483
- justify,
1484
- wrap,
1485
- ...restProps
1486
- } = props, $[0] = props, $[1] = align, $[2] = as, $[3] = gap, $[4] = justify, $[5] = restProps, $[6] = t0, $[7] = wrap) : (align = $[1], as = $[2], gap = $[3], justify = $[4], restProps = $[5], t0 = $[6], wrap = $[7]);
1487
- const direction = t0 === void 0 ? "row" : t0, t1 = useArrayProp$1(align), t2 = useArrayProp$1(direction), t3 = useArrayProp$1(gap), t4 = useArrayProp$1(justify), t5 = useArrayProp$1(wrap);
1488
- let t6;
1489
- return $[8] !== as || $[9] !== ref || $[10] !== restProps || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Root$v, { "data-ui": "Flex", ...restProps, $align: t1, $direction: t2, $gap: t3, $justify: t4, $wrap: t5, forwardedAs: as, ref }), $[8] = as, $[9] = ref, $[10] = restProps, $[11] = t1, $[12] = t2, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
1490
- });
1491
- Flex.displayName = "ForwardRef(Flex)";
1492
- const rotate$1 = keyframes`
1493
- from {
1494
- transform: rotate(0deg);
1495
- }
1496
-
1497
- to {
1498
- transform: rotate(360deg);
1499
- }
1500
- `, Root$u = styled(Text)`
1501
- & > span > svg {
1502
- animation: ${rotate$1} 500ms linear infinite;
1503
- }
1504
- `, Spinner = forwardRef(function(props, ref) {
1505
- const $ = c(4);
1506
- let t0;
1507
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsx(SpinnerIcon, {}), $[0] = t0) : t0 = $[0];
1508
- let t1;
1509
- return $[1] !== props || $[2] !== ref ? (t1 = /* @__PURE__ */ jsx(Root$u, { "data-ui": "Spinner", ...props, ref, children: t0 }), $[1] = props, $[2] = ref, $[3] = t1) : t1 = $[3], t1;
1510
- });
1511
- Spinner.displayName = "ForwardRef(Spinner)";
1512
- function _cardColorStyle(base, color, checkered = !1) {
1513
- return {
1514
- // from base
1515
- "--card-backdrop-color": base.backdrop,
1516
- "--card-focus-ring-color": base.focusRing,
1517
- "--card-shadow-outline-color": base.shadow.outline,
1518
- "--card-shadow-umbra-color": base.shadow.umbra,
1519
- "--card-shadow-penumbra-color": base.shadow.penumbra,
1520
- "--card-shadow-ambient-color": base.shadow.ambient,
1521
- // from state
1522
- "--card-accent-fg-color": color.accent.fg,
1523
- "--card-avatar-gray-bg-color": color.avatar.gray.bg,
1524
- "--card-avatar-gray-fg-color": color.avatar.gray.fg,
1525
- "--card-avatar-blue-bg-color": color.avatar.blue.bg,
1526
- "--card-avatar-blue-fg-color": color.avatar.blue.fg,
1527
- "--card-avatar-purple-bg-color": color.avatar.purple.bg,
1528
- "--card-avatar-purple-fg-color": color.avatar.purple.fg,
1529
- "--card-avatar-magenta-bg-color": color.avatar.magenta.bg,
1530
- "--card-avatar-magenta-fg-color": color.avatar.magenta.fg,
1531
- "--card-avatar-red-bg-color": color.avatar.red.bg,
1532
- "--card-avatar-red-fg-color": color.avatar.red.fg,
1533
- "--card-avatar-orange-bg-color": color.avatar.orange.bg,
1534
- "--card-avatar-orange-fg-color": color.avatar.orange.fg,
1535
- "--card-avatar-yellow-bg-color": color.avatar.yellow.bg,
1536
- "--card-avatar-yellow-fg-color": color.avatar.yellow.fg,
1537
- "--card-avatar-green-bg-color": color.avatar.green.bg,
1538
- "--card-avatar-green-fg-color": color.avatar.green.fg,
1539
- "--card-avatar-cyan-bg-color": color.avatar.cyan.bg,
1540
- "--card-avatar-cyan-fg-color": color.avatar.cyan.fg,
1541
- "--card-bg-color": color.bg,
1542
- "--card-bg-image": checkered ? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)` : void 0,
1543
- "--card-border-color": color.border,
1544
- "--card-badge-default-bg-color": color.badge.default.bg,
1545
- "--card-badge-default-dot-color": color.badge.default.dot,
1546
- "--card-badge-default-fg-color": color.badge.default.fg,
1547
- "--card-badge-default-icon-color": color.badge.default.icon,
1548
- "--card-badge-primary-bg-color": color.badge.primary.bg,
1549
- "--card-badge-primary-dot-color": color.badge.primary.dot,
1550
- "--card-badge-primary-fg-color": color.badge.primary.fg,
1551
- "--card-badge-primary-icon-color": color.badge.primary.icon,
1552
- "--card-badge-positive-bg-color": color.badge.positive.bg,
1553
- "--card-badge-positive-dot-color": color.badge.positive.dot,
1554
- "--card-badge-positive-fg-color": color.badge.positive.fg,
1555
- "--card-badge-positive-icon-color": color.badge.positive.icon,
1556
- "--card-badge-caution-bg-color": color.badge.caution.bg,
1557
- "--card-badge-caution-dot-color": color.badge.caution.dot,
1558
- "--card-badge-caution-fg-color": color.badge.caution.fg,
1559
- "--card-badge-caution-icon-color": color.badge.caution.icon,
1560
- "--card-badge-critical-bg-color": color.badge.critical.bg,
1561
- "--card-badge-critical-dot-color": color.badge.critical.dot,
1562
- "--card-badge-critical-fg-color": color.badge.critical.fg,
1563
- "--card-badge-critical-icon-color": color.badge.critical.icon,
1564
- "--card-code-bg-color": color.code.bg,
1565
- "--card-code-fg-color": color.code.fg,
1566
- "--card-fg-color": color.fg,
1567
- "--card-icon-color": color.icon,
1568
- "--card-kbd-bg-color": color.kbd.bg,
1569
- "--card-kbd-border-color": color.kbd.border,
1570
- "--card-kbd-fg-color": color.kbd.fg,
1571
- "--card-link-fg-color": color.link.fg,
1572
- "--card-muted-bg-color": color.muted.bg,
1573
- "--card-muted-fg-color": color.muted.fg,
1574
- "--card-skeleton-color-from": color.skeleton.from,
1575
- "--card-skeleton-color-to": color.skeleton.to,
1576
- // deprecated variables (kept for legacy)
1577
- "--card-bg2-color": color.muted.bg,
1578
- "--card-link-color": color.link.fg,
1579
- "--card-hairline-soft-color": color.border,
1580
- "--card-hairline-hard-color": color.border
1581
- };
1049
+ function responsiveGridItemStyle() {
1050
+ return [responsiveGridItemRowStyle, responsiveGridItemRowStartStyle, responsiveGridItemRowEndStyle, responsiveGridItemColumnStyle, responsiveGridItemColumnStartStyle, responsiveGridItemColumnEndStyle];
1051
+ }
1052
+ const GRID_ITEM_ROW = {
1053
+ auto: "auto",
1054
+ full: "1 / -1"
1055
+ }, GRID_ITEM_COLUMN = {
1056
+ auto: "auto",
1057
+ full: "1 / -1"
1058
+ };
1059
+ function responsiveGridItemRowStyle(props) {
1060
+ const {
1061
+ media
1062
+ } = getTheme_v2(props.theme);
1063
+ return _responsive(media, props.$row, (row) => typeof row == "number" ? {
1064
+ gridRow: `span ${row} / span ${row}`
1065
+ } : {
1066
+ gridRow: GRID_ITEM_ROW[row]
1067
+ });
1582
1068
  }
1583
- function buttonBaseStyles(props) {
1069
+ function responsiveGridItemRowStartStyle(props) {
1584
1070
  const {
1585
- $width
1586
- } = props, {
1587
- style
1071
+ media
1588
1072
  } = getTheme_v2(props.theme);
1589
- return css`
1590
- ${style?.button};
1591
-
1592
- -webkit-font-smoothing: inherit;
1593
- appearance: none;
1594
- display: inline-flex;
1595
- align-items: center;
1596
- font: inherit;
1597
- border: 0;
1598
- outline: none;
1599
- user-select: none;
1600
- text-decoration: none;
1601
- border: 0;
1602
- box-sizing: border-box;
1603
- padding: 0;
1604
- margin: 0;
1605
- white-space: nowrap;
1606
- text-align: left;
1607
- position: relative;
1608
- vertical-align: top;
1609
-
1610
- ${$width === "fill" && css`
1611
- width: -moz-available;
1612
- width: -webkit-fill-available;
1613
- width: stretch;
1614
- `}
1615
-
1616
- & > span {
1617
- display: block;
1618
- flex: 1;
1619
- min-width: 0;
1620
- border-radius: inherit;
1621
- }
1622
-
1623
- &::-moz-focus-inner {
1624
- border: 0;
1625
- padding: 0;
1626
- }
1627
- `;
1073
+ return _responsive(media, props.$rowStart, (rowStart) => ({
1074
+ gridRowStart: rowStart
1075
+ }));
1628
1076
  }
1629
- function combineBoxShadow(...boxShadows) {
1630
- return boxShadows.filter(Boolean).join(",");
1077
+ function responsiveGridItemRowEndStyle(props) {
1078
+ const {
1079
+ media
1080
+ } = getTheme_v2(props.theme);
1081
+ return _responsive(media, props.$rowEnd, (rowEnd) => ({
1082
+ gridRowEnd: rowEnd
1083
+ }));
1631
1084
  }
1632
- function buttonColorStyles(props) {
1085
+ function responsiveGridItemColumnStyle(props) {
1633
1086
  const {
1634
- $mode
1087
+ media
1088
+ } = getTheme_v2(props.theme);
1089
+ return _responsive(media, props.$column, (column) => typeof column == "number" ? {
1090
+ gridColumn: `span ${column} / span ${column}`
1091
+ } : {
1092
+ gridColumn: GRID_ITEM_COLUMN[column]
1093
+ });
1094
+ }
1095
+ function responsiveGridItemColumnStartStyle(props) {
1096
+ const {
1097
+ media
1098
+ } = getTheme_v2(props.theme);
1099
+ return _responsive(media, props.$columnStart, (columnStart) => ({
1100
+ gridColumnStart: columnStart
1101
+ }));
1102
+ }
1103
+ function responsiveGridItemColumnEndStyle(props) {
1104
+ const {
1105
+ media
1106
+ } = getTheme_v2(props.theme);
1107
+ return _responsive(media, props.$columnEnd, (columnEnd) => ({
1108
+ gridColumnEnd: columnEnd
1109
+ }));
1110
+ }
1111
+ function responsiveInputPaddingStyle(props) {
1112
+ const {
1113
+ $fontSize,
1114
+ $iconLeft,
1115
+ $iconRight,
1116
+ $padding,
1117
+ $space
1635
1118
  } = props, {
1636
- button,
1637
- color: baseColor,
1638
- style
1639
- } = getTheme_v2(props.theme), shadow = props.$mode === "ghost", mode = baseColor.button[$mode] || baseColor.button.default, color = mode[props.$tone] || mode.default, border2 = {
1640
- width: button.border.width,
1641
- color: "var(--card-border-color)"
1642
- }, defaultBoxShadow = void 0;
1643
- return [_cardColorStyle(baseColor, color.enabled), {
1644
- backgroundColor: "var(--card-bg-color)",
1645
- color: "var(--card-fg-color)",
1646
- boxShadow: focusRingBorderStyle(border2),
1647
- '&:disabled, &[data-disabled="true"]': _cardColorStyle(baseColor, color.disabled),
1648
- "&:not([data-disabled='true'])": {
1649
- boxShadow: combineBoxShadow(focusRingBorderStyle(border2), shadow ? defaultBoxShadow : void 0),
1650
- "&:focus": {
1651
- boxShadow: focusRingStyle({
1652
- base: baseColor,
1653
- border: {
1654
- width: 2,
1655
- color: baseColor.bg
1656
- },
1657
- focusRing: button.focusRing
1658
- })
1659
- },
1660
- "&:focus:not(:focus-visible)": {
1661
- boxShadow: combineBoxShadow(focusRingBorderStyle(border2), shadow ? defaultBoxShadow : void 0)
1662
- },
1663
- "@media (hover: hover)": {
1664
- "&:hover": _cardColorStyle(baseColor, color.hovered),
1665
- "&:active": _cardColorStyle(baseColor, color.pressed),
1666
- "&[data-hovered]": _cardColorStyle(baseColor, color.hovered)
1667
- },
1668
- "&[data-selected]": _cardColorStyle(baseColor, color.pressed)
1669
- }
1670
- }, style?.button?.root].filter(Boolean);
1119
+ font,
1120
+ media,
1121
+ space
1122
+ } = getTheme_v2(props.theme), len = Math.max($padding.length, $space.length, $fontSize.length), _padding = [], _space = [], _fontSize = [];
1123
+ for (let i = 0; i < len; i += 1)
1124
+ _fontSize[i] = $fontSize[i] === void 0 ? _fontSize[i - 1] : $fontSize[i], _padding[i] = $padding[i] === void 0 ? _padding[i - 1] : $padding[i], _space[i] = $space[i] === void 0 ? _space[i - 1] : $space[i];
1125
+ return _responsive(media, _padding, (_, i) => {
1126
+ const size2 = font.text.sizes[_fontSize[i]] || font.text.sizes[2], emSize = size2.lineHeight - size2.ascenderHeight - size2.descenderHeight, p = space[_padding[i]], s = space[_space[i]], styles = {
1127
+ paddingTop: rem(p - size2.ascenderHeight),
1128
+ paddingRight: rem(p),
1129
+ paddingBottom: rem(p - size2.descenderHeight),
1130
+ paddingLeft: rem(p)
1131
+ };
1132
+ return $iconRight && (styles.paddingRight = rem(p + emSize + s)), $iconLeft && (styles.paddingLeft = rem(p + emSize + s)), styles;
1133
+ });
1671
1134
  }
1672
- const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles), LoadingBox = styled.div`
1673
- position: absolute;
1674
- top: 0;
1675
- left: 0;
1676
- right: 0;
1677
- bottom: 0;
1678
- display: flex;
1135
+ function responsiveInputPaddingIconRightStyle(props) {
1136
+ return responsiveInputPaddingStyle({
1137
+ ...props,
1138
+ $iconRight: !0
1139
+ });
1140
+ }
1141
+ const ROOT_STYLE = css`
1142
+ &:not([hidden]) {
1143
+ display: flex;
1144
+ }
1145
+
1679
1146
  align-items: center;
1680
- justify-content: center;
1681
- background-color: var(--card-bg-color);
1682
- border-radius: inherit;
1683
- z-index: 1;
1684
- box-shadow: inherit;
1685
- `, Button = forwardRef(function(props, ref) {
1686
- const $ = c(64);
1687
- let IconComponent, IconRightComponent, children, disabled, loading, paddingBottomProp, paddingLeftProp, paddingRightProp, paddingTopProp, paddingXProp, paddingYProp, restProps, selected, t0, t1, t2, t3, t4, t5, t6, t7, t8, text, textAlign, width;
1688
- $[0] !== props ? ({
1689
- children,
1690
- disabled,
1691
- fontSize: t0,
1692
- icon: IconComponent,
1693
- iconRight: IconRightComponent,
1694
- justify: t1,
1695
- loading,
1696
- mode: t2,
1697
- padding: t3,
1698
- paddingX: paddingXProp,
1699
- paddingY: paddingYProp,
1700
- paddingTop: paddingTopProp,
1701
- paddingBottom: paddingBottomProp,
1702
- paddingLeft: paddingLeftProp,
1703
- paddingRight: paddingRightProp,
1704
- radius: t4,
1705
- selected,
1706
- space: t5,
1707
- text,
1708
- textAlign,
1709
- tone: t6,
1710
- type: t7,
1711
- muted: t8,
1712
- width,
1713
- ...restProps
1714
- } = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = loading, $[6] = paddingBottomProp, $[7] = paddingLeftProp, $[8] = paddingRightProp, $[9] = paddingTopProp, $[10] = paddingXProp, $[11] = paddingYProp, $[12] = restProps, $[13] = selected, $[14] = t0, $[15] = t1, $[16] = t2, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = t6, $[21] = t7, $[22] = t8, $[23] = text, $[24] = textAlign, $[25] = width) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], loading = $[5], paddingBottomProp = $[6], paddingLeftProp = $[7], paddingRightProp = $[8], paddingTopProp = $[9], paddingXProp = $[10], paddingYProp = $[11], restProps = $[12], selected = $[13], t0 = $[14], t1 = $[15], t2 = $[16], t3 = $[17], t4 = $[18], t5 = $[19], t6 = $[20], t7 = $[21], t8 = $[22], text = $[23], textAlign = $[24], width = $[25]);
1715
- const fontSize2 = t0 === void 0 ? 1 : t0, justifyProp = t1 === void 0 ? "center" : t1, mode = t2 === void 0 ? "default" : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, tone = t6 === void 0 ? "default" : t6, type = t7 === void 0 ? "button" : t7, muted = t8 === void 0 ? !1 : t8, {
1716
- button
1717
- } = useTheme_v2(), justify = useArrayProp$1(justifyProp), padding = useArrayProp$1(paddingProp), paddingX = useArrayProp$1(paddingXProp), paddingY = useArrayProp$1(paddingYProp), paddingTop = useArrayProp$1(paddingTopProp), paddingBottom = useArrayProp$1(paddingBottomProp), paddingLeft = useArrayProp$1(paddingLeftProp), paddingRight = useArrayProp$1(paddingRightProp), radius = useArrayProp$1(radiusProp), space = useArrayProp$1(spaceProp);
1718
- let t9, t10;
1719
- $[26] !== padding || $[27] !== paddingBottom || $[28] !== paddingLeft || $[29] !== paddingRight || $[30] !== paddingTop || $[31] !== paddingX || $[32] !== paddingY ? (t10 = {
1720
- padding,
1721
- paddingX,
1722
- paddingY,
1723
- paddingTop,
1724
- paddingBottom,
1725
- paddingLeft,
1726
- paddingRight
1727
- }, $[26] = padding, $[27] = paddingBottom, $[28] = paddingLeft, $[29] = paddingRight, $[30] = paddingTop, $[31] = paddingX, $[32] = paddingY, $[33] = t10) : t10 = $[33], t9 = t10;
1728
- const boxProps = t9, t11 = !!(loading || disabled), t12 = selected ? "" : void 0, t13 = !!(loading || disabled);
1729
- let t14;
1730
- $[34] !== loading ? (t14 = !!loading && /* @__PURE__ */ jsx(LoadingBox, { children: /* @__PURE__ */ jsx(Spinner, {}) }), $[34] = loading, $[35] = t14) : t14 = $[35];
1731
- let t15;
1732
- $[36] !== IconComponent || $[37] !== IconRightComponent || $[38] !== boxProps || $[39] !== button || $[40] !== fontSize2 || $[41] !== justify || $[42] !== muted || $[43] !== space || $[44] !== text || $[45] !== textAlign ? (t15 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children: /* @__PURE__ */ jsxs(Flex, { as: "span", justify, gap: space, children: [
1733
- IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
1734
- isValidElement(IconComponent) && IconComponent,
1735
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
1736
- ] }),
1737
- text && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { muted, align: textAlign, size: fontSize2, textOverflow: "ellipsis", weight: button.textWeight, children: text }) }),
1738
- IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
1739
- isValidElement(IconRightComponent) && IconRightComponent,
1740
- isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
1741
- ] })
1742
- ] }) }), $[36] = IconComponent, $[37] = IconRightComponent, $[38] = boxProps, $[39] = button, $[40] = fontSize2, $[41] = justify, $[42] = muted, $[43] = space, $[44] = text, $[45] = textAlign, $[46] = t15) : t15 = $[46];
1743
- let t16;
1744
- $[47] !== boxProps || $[48] !== children ? (t16 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children }), $[47] = boxProps, $[48] = children, $[49] = t16) : t16 = $[49];
1745
- let t17;
1746
- return $[50] !== mode || $[51] !== radius || $[52] !== ref || $[53] !== restProps || $[54] !== t11 || $[55] !== t12 || $[56] !== t13 || $[57] !== t14 || $[58] !== t15 || $[59] !== t16 || $[60] !== tone || $[61] !== type || $[62] !== width ? (t17 = /* @__PURE__ */ jsxs(Root$t, { "data-ui": "Button", ...restProps, $mode: mode, $radius: radius, $tone: tone, "data-disabled": t11, "data-selected": t12, disabled: t13, ref, type, $width: width, children: [
1747
- t14,
1748
- t15,
1749
- t16
1750
- ] }), $[50] = mode, $[51] = radius, $[52] = ref, $[53] = restProps, $[54] = t11, $[55] = t12, $[56] = t13, $[57] = t14, $[58] = t15, $[59] = t16, $[60] = tone, $[61] = type, $[62] = width, $[63] = t17) : t17 = $[63], t17;
1751
- });
1752
- Button.displayName = "ForwardRef(Button)";
1753
- function cardStyle(props) {
1754
- return [cardBaseStyle(props), cardColorStyle(props)];
1147
+ `;
1148
+ function textInputRootStyle() {
1149
+ return ROOT_STYLE;
1755
1150
  }
1756
- function cardBaseStyle(props) {
1151
+ function textInputBaseStyle(props) {
1757
1152
  const {
1758
- $checkered
1153
+ $scheme,
1154
+ $tone,
1155
+ $weight
1759
1156
  } = props, {
1760
- space
1157
+ color,
1158
+ font
1761
1159
  } = getTheme_v2(props.theme);
1762
1160
  return css`
1763
- ${$checkered && css`
1764
- background-size: ${space[3]}px ${space[3]}px;
1765
- background-position: 50% 50%;
1766
- background-image: var(--card-bg-image);
1767
- `}
1161
+ appearance: none;
1162
+ background: none;
1163
+ border: 0;
1164
+ border-radius: 0;
1165
+ outline: none;
1166
+ width: 100%;
1167
+ box-sizing: border-box;
1168
+ font-family: ${font.text.family};
1169
+ font-weight: ${$weight && font.text.weights[$weight] || font.text.weights.regular};
1170
+ margin: 0;
1171
+ position: relative;
1172
+ z-index: 1;
1173
+ display: block;
1768
1174
 
1769
- &[data-as='button'] {
1770
- -webkit-font-smoothing: inherit;
1771
- appearance: none;
1772
- outline: none;
1773
- font: inherit;
1774
- text-align: inherit;
1775
- border: 0;
1776
- width: -moz-available;
1777
- width: -webkit-fill-available;
1778
- width: stretch;
1175
+ /* NOTE: This is a hack to disable Chrome’s autofill styles */
1176
+ &:-webkit-autofill,
1177
+ &:-webkit-autofill:hover,
1178
+ &:-webkit-autofill:focus,
1179
+ &:-webkit-autofill:active {
1180
+ -webkit-text-fill-color: var(--input-fg-color) !important;
1181
+ transition: background-color 5000s;
1182
+ transition-delay: 86400s /* 24h */;
1779
1183
  }
1780
1184
 
1781
- /* &:is(a) */
1782
- &[data-as='a'] {
1783
- outline: none;
1784
- text-decoration: none;
1185
+ /* &:is(textarea) */
1186
+ &[data-as='textarea'] {
1187
+ resize: none;
1785
1188
  }
1786
1189
 
1787
- /* &:is(pre) */
1788
- &[data-as='pre'] {
1789
- font: inherit;
1190
+ color: var(--input-fg-color);
1191
+
1192
+ &::placeholder {
1193
+ color: var(--input-placeholder-color);
1194
+ }
1195
+
1196
+ &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
1197
+ --input-fg-color: ${color.input.default.enabled.fg};
1198
+ --input-placeholder-color: ${color.input.default.enabled.placeholder};
1199
+
1200
+ /* enabled */
1201
+ &:not(:invalid):not(:disabled):not(:read-only) {
1202
+ --input-fg-color: ${color.input.default.enabled.fg};
1203
+ --input-placeholder-color: ${color.input.default.enabled.placeholder};
1204
+ }
1205
+
1206
+ /* disabled */
1207
+ &:not(:invalid):disabled {
1208
+ --input-fg-color: ${color.input.default.disabled.fg};
1209
+ --input-placeholder-color: ${color.input.default.disabled.placeholder};
1210
+ }
1211
+
1212
+ /* invalid */
1213
+ &:invalid {
1214
+ --input-fg-color: ${color.input.invalid.enabled.fg};
1215
+ --input-placeholder-color: ${color.input.invalid.enabled.placeholder};
1216
+ }
1217
+
1218
+ /* readOnly */
1219
+ &:read-only {
1220
+ --input-fg-color: ${color.input.default.readOnly.fg};
1221
+ --input-placeholder-color: ${color.input.default.readOnly.placeholder};
1222
+ }
1790
1223
  }
1791
1224
  `;
1792
1225
  }
1793
- function cardColorStyle(props) {
1226
+ function textInputFontSizeStyle(props) {
1794
1227
  const {
1795
- $checkered,
1796
- $focusRing,
1797
- $muted
1228
+ font,
1229
+ media
1230
+ } = getTheme_v2(props.theme);
1231
+ return _responsive(media, props.$fontSize, (sizeIndex) => {
1232
+ const size2 = font.text.sizes[sizeIndex] || font.text.sizes[2];
1233
+ return {
1234
+ fontSize: rem(size2.fontSize),
1235
+ lineHeight: size2.lineHeight / size2.fontSize
1236
+ };
1237
+ });
1238
+ }
1239
+ function textInputRepresentationStyle(props) {
1240
+ const {
1241
+ $hasPrefix,
1242
+ $hasSuffix,
1243
+ $scheme,
1244
+ $tone,
1245
+ $unstableDisableFocusRing
1798
1246
  } = props, {
1799
- card,
1800
1247
  color,
1801
- style
1802
- } = getTheme_v2(props.theme), border2 = {
1803
- width: card.border.width,
1804
- color: "var(--card-border-color)"
1805
- };
1248
+ input
1249
+ } = getTheme_v2(props.theme);
1806
1250
  return css`
1807
- color-scheme: ${color._dark ? "dark" : "light"};
1251
+ --input-box-shadow: none;
1808
1252
 
1809
- ${_cardColorStyle(color, color, $checkered)}
1253
+ position: absolute;
1254
+ top: 0;
1255
+ left: 0;
1256
+ right: 0;
1257
+ bottom: 0;
1258
+ display: block;
1259
+ pointer-events: none;
1260
+ z-index: 0;
1810
1261
 
1811
- background-color: ${$muted ? "var(--card-muted-bg-color)" : "var(--card-bg-color)"};
1812
- color: var(--card-fg-color);
1262
+ background-color: var(--card-bg-color);
1263
+ box-shadow: var(--input-box-shadow);
1813
1264
 
1814
- /* &:is(button) */
1815
- &[data-as='button'] {
1816
- --card-focus-ring-box-shadow: none;
1265
+ border-top-left-radius: ${$hasPrefix ? 0 : void 0};
1266
+ border-bottom-left-radius: ${$hasPrefix ? 0 : void 0};
1267
+ border-top-right-radius: ${$hasSuffix ? 0 : void 0};
1268
+ border-bottom-right-radius: ${$hasSuffix ? 0 : void 0};
1817
1269
 
1818
- cursor: default;
1819
- box-shadow: var(--card-focus-ring-box-shadow);
1270
+ &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
1271
+ --card-bg-color: ${color.input.default.enabled.bg};
1272
+ --card-fg-color: ${color.input.default.enabled.fg};
1820
1273
 
1821
- &:disabled {
1822
- ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
1274
+ /* enabled */
1275
+ *:not(:disabled) + &[data-border] {
1276
+ --input-box-shadow: ${focusRingBorderStyle({
1277
+ color: color.input.default.enabled.border,
1278
+ width: input.border.width
1279
+ })};
1823
1280
  }
1824
1281
 
1825
- &:not(:disabled) {
1826
- &[data-pressed] {
1827
- ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
1282
+ /* invalid */
1283
+ *:not(:disabled):invalid + & {
1284
+ --card-bg-color: ${color.input.invalid.enabled.bg};
1285
+ --card-fg-color: ${color.input.invalid.enabled.fg};
1286
+
1287
+ &[data-border] {
1288
+ --input-box-shadow: ${focusRingBorderStyle({
1289
+ color: color.input.invalid.enabled.border,
1290
+ width: input.border.width
1291
+ })};
1828
1292
  }
1293
+ }
1829
1294
 
1830
- &[data-selected] {
1831
- ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
1295
+ /* focused */
1296
+ *:not(:disabled):focus + & {
1297
+ &[data-border] {
1298
+ --input-box-shadow: ${$unstableDisableFocusRing ? void 0 : focusRingStyle({
1299
+ border: {
1300
+ color: color.input.default.enabled.border,
1301
+ width: input.border.width
1302
+ },
1303
+ focusRing: input.text.focusRing
1304
+ })};
1832
1305
  }
1833
1306
 
1834
- @media (hover: hover) {
1835
- &:not([data-pressed]):not([data-selected]) {
1836
- &[data-hovered],
1837
- &:hover {
1838
- ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
1839
- }
1307
+ &:not([data-border]) {
1308
+ --input-box-shadow: ${$unstableDisableFocusRing ? void 0 : focusRingStyle({
1309
+ focusRing: input.text.focusRing
1310
+ })};
1311
+ }
1312
+ }
1840
1313
 
1841
- &:active {
1842
- ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
1843
- }
1844
- }
1314
+ /* disabled */
1315
+ *:not(:invalid):disabled + & {
1316
+ --card-bg-color: ${color.input.default.disabled.bg} !important;
1317
+ --card-fg-color: ${color.input.default.disabled.fg} !important;
1318
+ --card-icon-color: ${color.input.default.disabled.fg} !important;
1319
+
1320
+ &[data-border] {
1321
+ --input-box-shadow: ${focusRingBorderStyle({
1322
+ color: color.input.default.disabled.border,
1323
+ width: input.border.width
1324
+ })};
1845
1325
  }
1326
+ }
1846
1327
 
1847
- &:focus-visible {
1848
- --card-focus-ring-box-shadow: ${$focusRing ? focusRingStyle({
1849
- base: color,
1850
- border: border2,
1851
- focusRing: card.focusRing
1852
- }) : void 0};
1328
+ *:invalid:disabled + & {
1329
+ --card-bg-color: ${color.input.invalid.disabled.bg} !important;
1330
+ --card-fg-color: ${color.input.invalid.disabled.fg} !important;
1331
+ --card-icon-color: ${color.input.invalid.disabled.fg} !important;
1332
+
1333
+ &[data-border] {
1334
+ --input-box-shadow: ${focusRingBorderStyle({
1335
+ color: color.input.invalid.disabled.border,
1336
+ width: input.border.width
1337
+ })};
1338
+ }
1339
+ }
1340
+
1341
+ /* readOnly */
1342
+ *:not(:invalid):read-only + & {
1343
+ --card-bg-color: ${color.input.default.readOnly.bg} !important;
1344
+ --card-fg-color: ${color.input.default.readOnly.fg} !important;
1345
+ }
1346
+
1347
+ *:invalid:read-only + & {
1348
+ --card-bg-color: ${color.input.invalid.readOnly.bg} !important;
1349
+ --card-fg-color: ${color.input.invalid.readOnly.fg} !important;
1350
+ }
1351
+
1352
+ /* hovered */
1353
+ @media (hover: hover) {
1354
+ *:not(:disabled):not(:read-only):not(:invalid):hover + & {
1355
+ --card-bg-color: ${color.input.default.hovered.bg};
1356
+ --card-fg-color: ${color.input.default.hovered.fg};
1357
+ }
1358
+
1359
+ *:invalid:not(:disabled):not(:read-only):hover + & {
1360
+ --card-bg-color: ${color.input.invalid.hovered.bg};
1361
+ --card-fg-color: ${color.input.invalid.hovered.fg};
1362
+ }
1363
+
1364
+ *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {
1365
+ --input-box-shadow: ${focusRingBorderStyle({
1366
+ color: color.input.default.hovered.border,
1367
+ width: input.border.width
1368
+ })};
1369
+ }
1370
+
1371
+ *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {
1372
+ --input-box-shadow: ${focusRingBorderStyle({
1373
+ color: color.input.invalid.hovered.border,
1374
+ width: input.border.width
1375
+ })};
1853
1376
  }
1854
1377
  }
1855
1378
  }
1379
+ `;
1380
+ }
1381
+ function responsiveMarginStyle(props) {
1382
+ const {
1383
+ theme
1384
+ } = props;
1385
+ return [_getResponsiveSpace(theme, ["margin"], props.$margin), _getResponsiveSpace(theme, ["marginLeft", "marginRight"], props.$marginX), _getResponsiveSpace(theme, ["marginTop", "marginBottom"], props.$marginY), _getResponsiveSpace(theme, ["marginTop"], props.$marginTop), _getResponsiveSpace(theme, ["marginRight"], props.$marginRight), _getResponsiveSpace(theme, ["marginBottom"], props.$marginBottom), _getResponsiveSpace(theme, ["marginLeft"], props.$marginLeft)].filter(Boolean);
1386
+ }
1387
+ function responsivePaddingStyle(props) {
1388
+ const {
1389
+ theme
1390
+ } = props;
1391
+ return [_getResponsiveSpace(theme, ["padding"], props.$padding), _getResponsiveSpace(theme, ["paddingLeft", "paddingRight"], props.$paddingX), _getResponsiveSpace(theme, ["paddingTop", "paddingBottom"], props.$paddingY), _getResponsiveSpace(theme, ["paddingTop"], props.$paddingTop), _getResponsiveSpace(theme, ["paddingRight"], props.$paddingRight), _getResponsiveSpace(theme, ["paddingBottom"], props.$paddingBottom), _getResponsiveSpace(theme, ["paddingLeft"], props.$paddingLeft)].filter(Boolean);
1392
+ }
1393
+ function responsiveRadiusStyle(props) {
1394
+ const {
1395
+ media,
1396
+ radius
1397
+ } = getTheme_v2(props.theme);
1398
+ return _responsive(media, props.$radius, (value) => {
1399
+ let borderRadius = 0;
1400
+ return typeof value == "number" && (borderRadius = rem(radius[value])), value === "full" && (borderRadius = "9999px"), {
1401
+ borderRadius
1402
+ };
1403
+ });
1404
+ }
1405
+ function toBoxShadow(shadow, color) {
1406
+ return `${shadow.map(rem).join(" ")} ${color}`;
1407
+ }
1408
+ function shadowStyle(shadow, outlineWidth = 1) {
1409
+ if (!shadow) return EMPTY_RECORD;
1410
+ const outline = `0 0 0 ${rem(outlineWidth)} var(--card-shadow-outline-color)`, umbra = toBoxShadow(shadow.umbra, "var(--card-shadow-umbra-color)"), penumbra = toBoxShadow(shadow.penumbra, "var(--card-shadow-penumbra-color)"), ambient = toBoxShadow(shadow.ambient, "var(--card-shadow-ambient-color)");
1411
+ return {
1412
+ boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}`
1413
+ };
1414
+ }
1415
+ function responsiveShadowStyle(props) {
1416
+ const {
1417
+ card,
1418
+ media,
1419
+ shadow
1420
+ } = getTheme_v2(props.theme);
1421
+ return _responsive(media, props.$shadow, (index) => shadowStyle(shadow[index], card.shadow.outline));
1422
+ }
1423
+ function labelBaseStyle(props) {
1424
+ const {
1425
+ $accent,
1426
+ $muted
1427
+ } = props, {
1428
+ font
1429
+ } = getTheme_v2(props.theme);
1430
+ return css`
1431
+ text-transform: uppercase;
1856
1432
 
1857
- /* &:is(a) */
1858
- &[data-as='a'] {
1859
- cursor: pointer;
1860
- box-shadow: var(--card-focus-ring-box-shadow);
1861
-
1862
- &[data-disabled] {
1863
- ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
1864
- }
1865
-
1866
- &:not([data-disabled]) {
1867
- &[data-pressed] {
1868
- ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
1869
- }
1433
+ ${$accent && css`
1434
+ color: var(--card-accent-fg-color);
1435
+ `}
1870
1436
 
1871
- &[data-selected] {
1872
- ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
1873
- }
1437
+ ${$muted && css`
1438
+ color: var(--card-muted-fg-color);
1439
+ `}
1874
1440
 
1875
- @media (hover: hover) {
1876
- &:not([data-pressed]):not([data-selected]) {
1877
- &[data-hovered],
1878
- &:hover {
1879
- ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
1880
- }
1441
+ & code {
1442
+ font-family: ${font.code.family};
1443
+ border-radius: 1px;
1444
+ }
1881
1445
 
1882
- &:active {
1883
- ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
1884
- }
1885
- }
1886
- }
1446
+ & a {
1447
+ text-decoration: none;
1448
+ border-radius: 1px;
1449
+ }
1887
1450
 
1888
- &:focus-visible {
1889
- --card-focus-ring-box-shadow: ${$focusRing ? focusRingStyle({
1890
- base: color,
1891
- border: border2,
1892
- focusRing: card.focusRing
1893
- }) : void 0};
1894
- }
1895
- }
1451
+ & svg {
1452
+ /* Certain popular CSS libraries changes the defaults for SVG display */
1453
+ /* Make sure SVGs are rendered as inline elements */
1454
+ display: inline;
1896
1455
  }
1897
1456
 
1898
- ${style?.card?.root}
1457
+ & [data-sanity-icon] {
1458
+ vertical-align: baseline;
1459
+ }
1899
1460
  `;
1900
1461
  }
1901
- const Root$s = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), Card = forwardRef(function(props, ref) {
1902
- const $ = c(42);
1903
- let asProp, border2, borderBottom2, borderLeft2, borderRight2, borderTop2, muted, pressed, restProps, scheme, selected, shadow, t0, t1, t2, t3;
1462
+ const Root$C = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle), SpanWithTextOverflow$2 = styled.span`
1463
+ display: block;
1464
+ white-space: nowrap;
1465
+ text-overflow: ellipsis;
1466
+ overflow: hidden;
1467
+ overflow: clip;
1468
+ `, Label = forwardRef(function(props, ref) {
1469
+ const $ = c(22);
1470
+ let accent, align, childrenProp, restProps, t0, t1, textOverflow, weight;
1904
1471
  $[0] !== props ? ({
1905
- __unstable_checkered: t0,
1906
- __unstable_focusRing: t1,
1907
- as: asProp,
1908
- border: border2,
1909
- borderTop: borderTop2,
1910
- borderRight: borderRight2,
1911
- borderBottom: borderBottom2,
1912
- borderLeft: borderLeft2,
1913
- muted,
1914
- pressed,
1915
- radius: t2,
1916
- scheme,
1917
- selected,
1918
- shadow,
1919
- tone: t3,
1472
+ accent,
1473
+ align,
1474
+ children: childrenProp,
1475
+ muted: t0,
1476
+ size: t1,
1477
+ textOverflow,
1478
+ weight,
1920
1479
  ...restProps
1921
- } = props, $[0] = props, $[1] = asProp, $[2] = border2, $[3] = borderBottom2, $[4] = borderLeft2, $[5] = borderRight2, $[6] = borderTop2, $[7] = muted, $[8] = pressed, $[9] = restProps, $[10] = scheme, $[11] = selected, $[12] = shadow, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3) : (asProp = $[1], border2 = $[2], borderBottom2 = $[3], borderLeft2 = $[4], borderRight2 = $[5], borderTop2 = $[6], muted = $[7], pressed = $[8], restProps = $[9], scheme = $[10], selected = $[11], shadow = $[12], t0 = $[13], t1 = $[14], t2 = $[15], t3 = $[16]);
1922
- const checkered = t0 === void 0 ? !1 : t0, focusRing = t1 === void 0 ? !1 : t1, radius = t2 === void 0 ? 0 : t2, toneProp = t3 === void 0 ? "default" : t3, as = isValidElementType(asProp) ? asProp : "div", rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp, t4 = typeof as == "string" ? as : void 0, t5 = rootTheme.scheme, t6 = useArrayProp$1(border2), t7 = useArrayProp$1(borderTop2), t8 = useArrayProp$1(borderRight2), t9 = useArrayProp$1(borderBottom2), t10 = useArrayProp$1(borderLeft2), t11 = useArrayProp$1(radius), t12 = useArrayProp$1(shadow), t13 = checkered ? "" : void 0, t14 = pressed ? "" : void 0, t15 = selected ? "" : void 0;
1923
- let t16;
1924
- $[17] !== as || $[18] !== checkered || $[19] !== focusRing || $[20] !== muted || $[21] !== ref || $[22] !== restProps || $[23] !== rootTheme.scheme || $[24] !== selected || $[25] !== t10 || $[26] !== t11 || $[27] !== t12 || $[28] !== t13 || $[29] !== t14 || $[30] !== t15 || $[31] !== t4 || $[32] !== t6 || $[33] !== t7 || $[34] !== t8 || $[35] !== t9 || $[36] !== tone ? (t16 = /* @__PURE__ */ jsx(Root$s, { "data-as": t4, "data-scheme": t5, "data-ui": "Card", "data-tone": tone, ...restProps, $border: t6, $borderTop: t7, $borderRight: t8, $borderBottom: t9, $borderLeft: t10, $checkered: checkered, $focusRing: focusRing, $muted: muted, $radius: t11, $shadow: t12, $tone: tone, "data-checkered": t13, "data-pressed": t14, "data-selected": t15, forwardedAs: as, ref, selected }), $[17] = as, $[18] = checkered, $[19] = focusRing, $[20] = muted, $[21] = ref, $[22] = restProps, $[23] = rootTheme.scheme, $[24] = selected, $[25] = t10, $[26] = t11, $[27] = t12, $[28] = t13, $[29] = t14, $[30] = t15, $[31] = t4, $[32] = t6, $[33] = t7, $[34] = t8, $[35] = t9, $[36] = tone, $[37] = t16) : t16 = $[37];
1925
- let t17;
1926
- return $[38] !== scheme || $[39] !== t16 || $[40] !== tone ? (t17 = /* @__PURE__ */ jsx(ThemeColorProvider, { scheme, tone, children: t16 }), $[38] = scheme, $[39] = t16, $[40] = tone, $[41] = t17) : t17 = $[41], t17;
1480
+ } = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = childrenProp, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = textOverflow, $[8] = weight) : (accent = $[1], align = $[2], childrenProp = $[3], restProps = $[4], t0 = $[5], t1 = $[6], textOverflow = $[7], weight = $[8]);
1481
+ const muted = t0 === void 0 ? !1 : t0, size2 = t1 === void 0 ? 2 : t1;
1482
+ let children = childrenProp;
1483
+ if (textOverflow === "ellipsis") {
1484
+ let t22;
1485
+ $[9] !== children ? (t22 = /* @__PURE__ */ jsx(SpanWithTextOverflow$2, { children }), $[9] = children, $[10] = t22) : t22 = $[10], children = t22;
1486
+ } else {
1487
+ let t22;
1488
+ $[11] !== children ? (t22 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t22) : t22 = $[12], children = t22;
1489
+ }
1490
+ const t2 = useArrayProp(align), t3 = useArrayProp(size2);
1491
+ let t4;
1492
+ return $[13] !== accent || $[14] !== children || $[15] !== muted || $[16] !== ref || $[17] !== restProps || $[18] !== t2 || $[19] !== t3 || $[20] !== weight ? (t4 = /* @__PURE__ */ jsx(Root$C, { "data-ui": "Label", ...restProps, $accent: accent, $align: t2, $muted: muted, $size: t3, $weight: weight, ref, children }), $[13] = accent, $[14] = children, $[15] = muted, $[16] = ref, $[17] = restProps, $[18] = t2, $[19] = t3, $[20] = weight, $[21] = t4) : t4 = $[21], t4;
1927
1493
  });
1928
- Card.displayName = "ForwardRef(Card)";
1929
- function useArrayProp(val, defaultVal) {
1930
- return useArrayProp$1(val ?? defaultVal);
1931
- }
1932
- function _getElements(element, elementsArg) {
1933
- const ret = [element];
1934
- for (const el of elementsArg)
1935
- Array.isArray(el) ? ret.push(...el) : ret.push(el);
1936
- return ret.filter(Boolean);
1937
- }
1938
- function useClickOutside(listener, t0, boundaryElement) {
1939
- const $ = c(12), elementsArg = t0 === void 0 ? EMPTY_ARRAY : t0, [element, setElement] = useState(null);
1940
- let t1;
1941
- $[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
1942
- const [elements, setElements] = useState(t1), elementsRef = useRef(elements);
1943
- let t2, t3;
1944
- $[3] !== element || $[4] !== elementsArg ? (t2 = () => {
1945
- const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
1946
- if (prevElements.length !== nextElements.length) {
1947
- setElements(nextElements), elementsRef.current = nextElements;
1948
- return;
1494
+ Label.displayName = "ForwardRef(Label)";
1495
+ const avatarStyle = {
1496
+ root: avatarRootStyle,
1497
+ arrow: avatarArrowStyle,
1498
+ bgStroke: avatarBgStrokeStyle,
1499
+ stroke: avatarStrokeStyle,
1500
+ initials: avatarInitialsStyle,
1501
+ image: avatarImageStyle
1502
+ };
1503
+ function avatarArrowStyle() {
1504
+ return {
1505
+ position: "absolute",
1506
+ boxSizing: "border-box",
1507
+ zIndex: 0,
1508
+ opacity: 0,
1509
+ transition: "all 0.2s linear",
1510
+ transform: "rotate(-90deg) translate3d(0, 6px, 0)",
1511
+ left: 0,
1512
+ right: 0,
1513
+ top: 0,
1514
+ bottom: 0,
1515
+ "& > svg": {
1516
+ width: "11px",
1517
+ height: "7px",
1518
+ position: "absolute",
1519
+ top: "-5px",
1520
+ left: "50%",
1521
+ transform: "translateX(-6px)",
1522
+ "&:not([hidden])": {
1523
+ display: "block"
1524
+ }
1525
+ },
1526
+ "[data-arrow-position='inside'] > &": {
1527
+ transform: "rotate(-90deg) translate3d(0, 6px, 0)",
1528
+ opacity: 0
1529
+ },
1530
+ "[data-arrow-position='top'] > &": {
1531
+ opacity: 1,
1532
+ transform: "rotate(0deg)"
1533
+ },
1534
+ "[data-arrow-position='bottom'] > &": {
1535
+ opacity: 1,
1536
+ transform: "rotate(-180deg)"
1949
1537
  }
1950
- for (const el of prevElements)
1951
- if (!nextElements.includes(el)) {
1952
- setElements(nextElements), elementsRef.current = nextElements;
1953
- return;
1538
+ };
1539
+ }
1540
+ function avatarRootStyle(props) {
1541
+ const {
1542
+ $color
1543
+ } = props, {
1544
+ avatar
1545
+ } = getTheme_v2(props.theme);
1546
+ return {
1547
+ "--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
1548
+ "--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
1549
+ backgroundColor: "var(--avatar-bg-color)",
1550
+ position: "relative",
1551
+ boxSizing: "border-box",
1552
+ userSelect: "none",
1553
+ boxShadow: "0 0 0 1px var(--card-bg-color)",
1554
+ '&[data-status="inactive"]': {
1555
+ opacity: 0.5
1556
+ },
1557
+ "&>svg": {
1558
+ "&:not([hidden])": {
1559
+ display: "block"
1954
1560
  }
1955
- for (const el_0 of nextElements)
1956
- if (!prevElements.includes(el_0)) {
1957
- setElements(nextElements), elementsRef.current = nextElements;
1958
- return;
1561
+ },
1562
+ /* &:is(button) */
1563
+ '&[data-as="button"]': {
1564
+ WebkitFontSmoothing: "inherit",
1565
+ appearance: "none",
1566
+ margin: 0,
1567
+ padding: 0,
1568
+ border: 0,
1569
+ font: "inherit",
1570
+ color: "inherit",
1571
+ outline: "none",
1572
+ "&:focus": {
1573
+ boxShadow: focusRingStyle({
1574
+ focusRing: avatar.focusRing
1575
+ })
1576
+ },
1577
+ "&:focus:not(:focus-visible)": {
1578
+ boxShadow: "none"
1959
1579
  }
1960
- }, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
1961
- let t4, t5;
1962
- return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
1963
- if (!listener)
1964
- return;
1965
- const handleWindowMouseDown = (evt) => {
1966
- const target = evt.target;
1967
- if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
1968
- for (const el_1 of elements)
1969
- if (target === el_1 || el_1.contains(target))
1970
- return;
1971
- listener(evt);
1580
+ }
1581
+ };
1582
+ }
1583
+ function responsiveAvatarSizeStyle(props) {
1584
+ const {
1585
+ avatar,
1586
+ media
1587
+ } = getTheme_v2(props.theme);
1588
+ return _responsive(media, props.$size, (size2) => {
1589
+ const avatarSize = avatar.sizes[size2] || avatar.sizes[0];
1590
+ return {
1591
+ width: rem(avatarSize.size),
1592
+ height: rem(avatarSize.size),
1593
+ borderRadius: rem(avatarSize.size / 2),
1594
+ "&>svg": {
1595
+ width: rem(avatarSize.size),
1596
+ height: rem(avatarSize.size),
1597
+ borderRadius: rem(avatarSize.size / 2)
1972
1598
  }
1973
1599
  };
1974
- return window.addEventListener("mousedown", handleWindowMouseDown), () => {
1975
- window.removeEventListener("mousedown", handleWindowMouseDown);
1976
- };
1977
- }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
1600
+ });
1978
1601
  }
1979
- function useClickOutsideEvent(listener, t0, boundaryElement) {
1980
- const $ = c(8), elementsArg = t0 === void 0 ? _temp$6 : t0;
1981
- let t1;
1982
- $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
1983
- if (!listener)
1984
- return;
1985
- const target = evt.target;
1986
- if (!(target instanceof Node))
1987
- return;
1988
- const resolvedBoundaryElement = boundaryElement?.();
1989
- if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target))
1990
- return;
1991
- const elements = elementsArg().flat();
1992
- for (const el of elements)
1993
- if (el && (target === el || el.contains(target)))
1994
- return;
1995
- listener(evt);
1996
- }, $[0] = boundaryElement, $[1] = elementsArg, $[2] = listener, $[3] = t1) : t1 = $[3];
1997
- const onEvent = useEffectEvent(t1), hasListener = !!listener;
1998
- let t2, t3;
1999
- $[4] !== hasListener || $[5] !== onEvent ? (t2 = () => {
2000
- if (!hasListener)
2001
- return;
2002
- const handleEvent = (evt_0) => onEvent(evt_0);
2003
- return document.addEventListener("mousedown", handleEvent), () => {
2004
- document.removeEventListener("mousedown", handleEvent);
2005
- };
2006
- }, t3 = [hasListener, onEvent], $[4] = hasListener, $[5] = onEvent, $[6] = t2, $[7] = t3) : (t2 = $[6], t3 = $[7]), useEffect(t2, t3), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
1602
+ function avatarImageStyle() {
1603
+ return {
1604
+ position: "relative"
1605
+ };
2007
1606
  }
2008
- function _temp$6() {
2009
- return EMPTY_ARRAY;
1607
+ function avatarInitialsStyle() {
1608
+ return {
1609
+ width: "100%",
1610
+ height: "100%",
1611
+ color: "var(--avatar-fg-color)",
1612
+ alignItems: "center",
1613
+ justifyContent: "center",
1614
+ textTransform: "uppercase",
1615
+ textAlign: "center",
1616
+ borderRadius: "50%",
1617
+ "&:not([hidden])": {
1618
+ display: "flex"
1619
+ }
1620
+ };
2010
1621
  }
2011
- function useCustomValidity(ref, customValidity) {
2012
- const $ = c(6);
2013
- let t0;
2014
- $[0] !== customValidity || $[1] !== ref.current ? (t0 = () => {
2015
- ref.current?.setCustomValidity(customValidity || "");
2016
- }, $[0] = customValidity, $[1] = ref.current, $[2] = t0) : t0 = $[2];
2017
- let t1;
2018
- $[3] !== customValidity || $[4] !== ref ? (t1 = [customValidity, ref], $[3] = customValidity, $[4] = ref, $[5] = t1) : t1 = $[5], useEffect(t0, t1);
1622
+ function avatarBgStrokeStyle() {
1623
+ return {
1624
+ strokeWidth: "4px",
1625
+ stroke: "var(--card-bg-color)"
1626
+ };
2019
1627
  }
2020
- var resizeObservers = [], hasActiveObservations = function() {
2021
- return resizeObservers.some(function(ro) {
2022
- return ro.activeTargets.length > 0;
2023
- });
2024
- }, hasSkippedObservations = function() {
2025
- return resizeObservers.some(function(ro) {
2026
- return ro.skippedTargets.length > 0;
2027
- });
2028
- }, msg = "ResizeObserver loop completed with undelivered notifications.", deliverResizeLoopError = function() {
2029
- var event;
2030
- typeof ErrorEvent == "function" ? event = new ErrorEvent("error", {
2031
- message: msg
2032
- }) : (event = document.createEvent("Event"), event.initEvent("error", !1, !1), event.message = msg), window.dispatchEvent(event);
2033
- }, ResizeObserverBoxOptions;
2034
- (function(ResizeObserverBoxOptions2) {
2035
- ResizeObserverBoxOptions2.BORDER_BOX = "border-box", ResizeObserverBoxOptions2.CONTENT_BOX = "content-box", ResizeObserverBoxOptions2.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
2036
- })(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {}));
2037
- var freeze = function(obj) {
2038
- return Object.freeze(obj);
2039
- }, ResizeObserverSize = /* @__PURE__ */ function() {
2040
- function ResizeObserverSize2(inlineSize, blockSize) {
2041
- this.inlineSize = inlineSize, this.blockSize = blockSize, freeze(this);
2042
- }
2043
- return ResizeObserverSize2;
2044
- }(), DOMRectReadOnly = function() {
2045
- function DOMRectReadOnly2(x, y, width, height) {
2046
- return this.x = x, this.y = y, this.width = width, this.height = height, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, freeze(this);
2047
- }
2048
- return DOMRectReadOnly2.prototype.toJSON = function() {
2049
- var _a = this, x = _a.x, y = _a.y, top = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left, width = _a.width, height = _a.height;
2050
- return {
2051
- x,
2052
- y,
2053
- top,
2054
- right,
2055
- bottom,
2056
- left,
2057
- width,
2058
- height
2059
- };
2060
- }, DOMRectReadOnly2.fromRect = function(rectangle) {
2061
- return new DOMRectReadOnly2(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
2062
- }, DOMRectReadOnly2;
2063
- }(), isSVG = function(target) {
2064
- return target instanceof SVGElement && "getBBox" in target;
2065
- }, isHidden = function(target) {
2066
- if (isSVG(target)) {
2067
- var _a = target.getBBox(), width = _a.width, height = _a.height;
2068
- return !width && !height;
2069
- }
2070
- var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight;
2071
- return !(offsetWidth || offsetHeight || target.getClientRects().length);
2072
- }, isElement = function(obj) {
2073
- var _a;
2074
- if (obj instanceof Element)
2075
- return !0;
2076
- var scope = (_a = obj?.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
2077
- return !!(scope && obj instanceof scope.Element);
2078
- }, isReplacedElement = function(target) {
2079
- switch (target.tagName) {
2080
- case "INPUT":
2081
- if (target.type !== "image")
2082
- break;
2083
- case "VIDEO":
2084
- case "AUDIO":
2085
- case "EMBED":
2086
- case "OBJECT":
2087
- case "CANVAS":
2088
- case "IFRAME":
2089
- case "IMG":
2090
- return !0;
2091
- }
2092
- return !1;
2093
- }, global$1 = typeof window < "u" ? window : {}, cache = /* @__PURE__ */ new WeakMap(), scrollRegexp = /auto|scroll/, verticalRegexp = /^tb|vertical/, IE = /msie|trident/i.test(global$1.navigator && global$1.navigator.userAgent), parseDimension = function(pixel) {
2094
- return parseFloat(pixel || "0");
2095
- }, size$1 = function(inlineSize, blockSize, switchSizes) {
2096
- return inlineSize === void 0 && (inlineSize = 0), blockSize === void 0 && (blockSize = 0), switchSizes === void 0 && (switchSizes = !1), new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
2097
- }, zeroBoxes = freeze({
2098
- devicePixelContentBoxSize: size$1(),
2099
- borderBoxSize: size$1(),
2100
- contentBoxSize: size$1(),
2101
- contentRect: new DOMRectReadOnly(0, 0, 0, 0)
2102
- }), calculateBoxSizes = function(target, forceRecalculation) {
2103
- if (forceRecalculation === void 0 && (forceRecalculation = !1), cache.has(target) && !forceRecalculation)
2104
- return cache.get(target);
2105
- if (isHidden(target))
2106
- return cache.set(target, zeroBoxes), zeroBoxes;
2107
- var cs = getComputedStyle(target), svg = isSVG(target) && target.ownerSVGElement && target.getBBox(), removePadding = !IE && cs.boxSizing === "border-box", switchSizes = verticalRegexp.test(cs.writingMode || ""), canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || ""), canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || ""), paddingTop = svg ? 0 : parseDimension(cs.paddingTop), paddingRight = svg ? 0 : parseDimension(cs.paddingRight), paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom), paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft), borderTop2 = svg ? 0 : parseDimension(cs.borderTopWidth), borderRight2 = svg ? 0 : parseDimension(cs.borderRightWidth), borderBottom2 = svg ? 0 : parseDimension(cs.borderBottomWidth), borderLeft2 = svg ? 0 : parseDimension(cs.borderLeftWidth), horizontalPadding = paddingLeft + paddingRight, verticalPadding = paddingTop + paddingBottom, horizontalBorderArea = borderLeft2 + borderRight2, verticalBorderArea = borderTop2 + borderBottom2, horizontalScrollbarThickness = canScrollHorizontally ? target.offsetHeight - verticalBorderArea - target.clientHeight : 0, verticalScrollbarThickness = canScrollVertically ? target.offsetWidth - horizontalBorderArea - target.clientWidth : 0, widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0, heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0, contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness, contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness, borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea, borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea, boxes = freeze({
2108
- devicePixelContentBoxSize: size$1(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),
2109
- borderBoxSize: size$1(borderBoxWidth, borderBoxHeight, switchSizes),
2110
- contentBoxSize: size$1(contentWidth, contentHeight, switchSizes),
2111
- contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight)
1628
+ function avatarStrokeStyle() {
1629
+ return {
1630
+ strokeWidth: "2px",
1631
+ stroke: "var(--avatar-bg-color)",
1632
+ '[data-status="editing"] &': {
1633
+ strokeDasharray: "2 4",
1634
+ strokeLinecap: "round"
1635
+ }
1636
+ };
1637
+ }
1638
+ const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1 = styled.div(avatarStyle.arrow), BgStroke = styled.ellipse(avatarStyle.bgStroke), Stroke = styled.ellipse(avatarStyle.stroke), Initials = styled.div(avatarStyle.initials), InitialsLabel = styled(Label)({
1639
+ color: "inherit"
1640
+ }), Image = styled.svg(avatarStyle.image), Avatar = forwardRef(function(props, ref) {
1641
+ const $ = c(52);
1642
+ let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
1643
+ $[0] !== props ? ({
1644
+ __unstable_hideInnerStroke,
1645
+ as: asProp,
1646
+ color: t0,
1647
+ src,
1648
+ title,
1649
+ initials,
1650
+ onImageLoadError,
1651
+ arrowPosition: arrowPositionProp,
1652
+ animateArrowFrom,
1653
+ status: t1,
1654
+ size: t2,
1655
+ ...restProps
1656
+ } = props, $[0] = props, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = asProp, $[5] = initials, $[6] = onImageLoadError, $[7] = restProps, $[8] = src, $[9] = t0, $[10] = t1, $[11] = t2, $[12] = title) : (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], asProp = $[4], initials = $[5], onImageLoadError = $[6], restProps = $[7], src = $[8], t0 = $[9], t1 = $[10], t2 = $[11], title = $[12]);
1657
+ const color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, {
1658
+ avatar
1659
+ } = useTheme_v2(), as = ReactIs.isValidElementType(asProp) ? asProp : "div", size2 = useArrayProp(sizeProp), _sizeRem = (avatar.sizes[size2[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = useId(), [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = useState(!1), imageId = `avatar-image-${elementId}`;
1660
+ let t3, t4;
1661
+ $[13] !== arrowPosition || $[14] !== arrowPositionProp ? (t3 = () => {
1662
+ if (arrowPosition === arrowPositionProp)
1663
+ return;
1664
+ const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
1665
+ return () => cancelAnimationFrame(raf);
1666
+ }, t4 = [arrowPosition, arrowPositionProp], $[13] = arrowPosition, $[14] = arrowPositionProp, $[15] = t3, $[16] = t4) : (t3 = $[15], t4 = $[16]), useEffect(t3, t4);
1667
+ let t5, t6;
1668
+ $[17] !== src ? (t5 = () => {
1669
+ src && setImageFailed(!1);
1670
+ }, t6 = [src], $[17] = src, $[18] = t5, $[19] = t6) : (t5 = $[18], t6 = $[19]), useEffect(t5, t6);
1671
+ let t7;
1672
+ $[20] !== onImageLoadError ? (t7 = () => {
1673
+ setImageFailed(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
1674
+ }, $[20] = onImageLoadError, $[21] = t7) : t7 = $[21];
1675
+ const handleImageError = t7;
1676
+ let t8, t9;
1677
+ $[22] !== size2 ? (t9 = size2.map(_temp$8), $[22] = size2, $[23] = t9) : t9 = $[23], t8 = t9;
1678
+ const initialsSize = t8, t10 = typeof as == "string" ? as : void 0;
1679
+ let t11;
1680
+ $[24] !== color ? (t11 = /* @__PURE__ */ jsx(Arrow$1, { children: /* @__PURE__ */ jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[24] = color, $[25] = t11) : t11 = $[25];
1681
+ let t12;
1682
+ $[26] !== __unstable_hideInnerStroke || $[27] !== _radius || $[28] !== _sizeRem || $[29] !== handleImageError || $[30] !== imageFailed || $[31] !== imageId || $[32] !== src ? (t12 = !imageFailed && src && /* @__PURE__ */ jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1683
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsx("image", { href: src, width: "1", height: "1", onError: handleImageError }) }) }),
1684
+ /* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1685
+ !__unstable_hideInnerStroke && /* @__PURE__ */ jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
1686
+ /* @__PURE__ */ jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
1687
+ ] }), $[26] = __unstable_hideInnerStroke, $[27] = _radius, $[28] = _sizeRem, $[29] = handleImageError, $[30] = imageFailed, $[31] = imageId, $[32] = src, $[33] = t12) : t12 = $[33];
1688
+ let t13;
1689
+ $[34] !== imageFailed || $[35] !== initials || $[36] !== initialsSize || $[37] !== src ? (t13 = (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Initials, { children: /* @__PURE__ */ jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) }), $[34] = imageFailed, $[35] = initials, $[36] = initialsSize, $[37] = src, $[38] = t13) : t13 = $[38];
1690
+ let t14;
1691
+ return $[39] !== arrowPosition || $[40] !== as || $[41] !== color || $[42] !== ref || $[43] !== restProps || $[44] !== size2 || $[45] !== status || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t13 || $[50] !== title ? (t14 = /* @__PURE__ */ jsxs(Root$B, { as, "data-as": t10, "data-ui": "Avatar", ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
1692
+ t11,
1693
+ t12,
1694
+ t13
1695
+ ] }), $[39] = arrowPosition, $[40] = as, $[41] = color, $[42] = ref, $[43] = restProps, $[44] = size2, $[45] = status, $[46] = t10, $[47] = t11, $[48] = t12, $[49] = t13, $[50] = title, $[51] = t14) : t14 = $[51], t14;
1696
+ });
1697
+ Avatar.displayName = "ForwardRef(Avatar)";
1698
+ function _temp$8(s) {
1699
+ return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1700
+ }
1701
+ function _responsiveAvatarCounterSizeStyle(props) {
1702
+ const {
1703
+ avatar,
1704
+ media
1705
+ } = getTheme_v2(props.theme);
1706
+ return _responsive(media, props.$size, (size2) => {
1707
+ const avatarSize = avatar.sizes[size2];
1708
+ return avatarSize ? {
1709
+ borderRadius: rem(avatarSize.size / 2),
1710
+ minWidth: rem(avatarSize.size),
1711
+ height: rem(avatarSize.size)
1712
+ } : EMPTY_RECORD;
2112
1713
  });
2113
- return cache.set(target, boxes), boxes;
2114
- }, calculateBoxSize = function(target, observedBox, forceRecalculation) {
2115
- var _a = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a.borderBoxSize, contentBoxSize = _a.contentBoxSize, devicePixelContentBoxSize = _a.devicePixelContentBoxSize;
2116
- switch (observedBox) {
2117
- case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:
2118
- return devicePixelContentBoxSize;
2119
- case ResizeObserverBoxOptions.BORDER_BOX:
2120
- return borderBoxSize;
2121
- default:
2122
- return contentBoxSize;
2123
- }
2124
- }, ResizeObserverEntry = /* @__PURE__ */ function() {
2125
- function ResizeObserverEntry2(target) {
2126
- var boxes = calculateBoxSizes(target);
2127
- this.target = target, this.contentRect = boxes.contentRect, this.borderBoxSize = freeze([boxes.borderBoxSize]), this.contentBoxSize = freeze([boxes.contentBoxSize]), this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);
2128
- }
2129
- return ResizeObserverEntry2;
2130
- }(), calculateDepthForNode = function(node) {
2131
- if (isHidden(node))
2132
- return 1 / 0;
2133
- for (var depth = 0, parent = node.parentNode; parent; )
2134
- depth += 1, parent = parent.parentNode;
2135
- return depth;
2136
- }, broadcastActiveObservations = function() {
2137
- var shallowestDepth = 1 / 0, callbacks2 = [];
2138
- resizeObservers.forEach(function(ro) {
2139
- if (ro.activeTargets.length !== 0) {
2140
- var entries = [];
2141
- ro.activeTargets.forEach(function(ot) {
2142
- var entry = new ResizeObserverEntry(ot.target), targetDepth = calculateDepthForNode(ot.target);
2143
- entries.push(entry), ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox), targetDepth < shallowestDepth && (shallowestDepth = targetDepth);
2144
- }), callbacks2.push(function() {
2145
- ro.callback.call(ro.observer, entries, ro.observer);
2146
- }), ro.activeTargets.splice(0, ro.activeTargets.length);
1714
+ }
1715
+ function _avatarCounterBaseStyle(props) {
1716
+ const {
1717
+ space
1718
+ } = getTheme_v2(props.theme);
1719
+ return css`
1720
+ align-items: center;
1721
+ justify-content: center;
1722
+ box-sizing: border-box;
1723
+ user-select: none;
1724
+ color: inherit;
1725
+ color: var(--card-fg-color);
1726
+ background: var(--card-bg-color);
1727
+ box-shadow:
1728
+ 0 0 0 1px var(--card-bg-color),
1729
+ inset 0 0 0 1px var(--card-hairline-hard-color);
1730
+ padding: 0 ${rem(space[2])};
1731
+
1732
+ &:not([hidden]) {
1733
+ display: flex;
1734
+ }
1735
+ `;
1736
+ }
1737
+ const Root$A = styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = forwardRef(function(props, ref) {
1738
+ const $ = c(9), {
1739
+ count,
1740
+ size: t0
1741
+ } = props, size2 = useArrayProp(t0 === void 0 ? 1 : t0);
1742
+ let t1, t2;
1743
+ $[0] !== size2 ? (t2 = size2.map(_temp$7), $[0] = size2, $[1] = t2) : t2 = $[1], t1 = t2;
1744
+ const fontSize2 = t1;
1745
+ let t3;
1746
+ $[2] !== count || $[3] !== fontSize2 ? (t3 = /* @__PURE__ */ jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }), $[2] = count, $[3] = fontSize2, $[4] = t3) : t3 = $[4];
1747
+ let t4;
1748
+ return $[5] !== ref || $[6] !== size2 || $[7] !== t3 ? (t4 = /* @__PURE__ */ jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: t3 }), $[5] = ref, $[6] = size2, $[7] = t3, $[8] = t4) : t4 = $[8], t4;
1749
+ });
1750
+ AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
1751
+ function _temp$7(s) {
1752
+ return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1753
+ }
1754
+ const BASE_STYLES = css`
1755
+ white-space: nowrap;
1756
+
1757
+ & > div {
1758
+ vertical-align: top;
1759
+
1760
+ &:not([hidden]) {
1761
+ display: inline-block;
2147
1762
  }
2148
- });
2149
- for (var _i = 0, callbacks_1 = callbacks2; _i < callbacks_1.length; _i++) {
2150
- var callback = callbacks_1[_i];
2151
- callback();
2152
- }
2153
- return shallowestDepth;
2154
- }, gatherActiveObservationsAtDepth = function(depth) {
2155
- resizeObservers.forEach(function(ro) {
2156
- ro.activeTargets.splice(0, ro.activeTargets.length), ro.skippedTargets.splice(0, ro.skippedTargets.length), ro.observationTargets.forEach(function(ot) {
2157
- ot.isActive() && (calculateDepthForNode(ot.target) > depth ? ro.activeTargets.push(ot) : ro.skippedTargets.push(ot));
2158
- });
2159
- });
2160
- }, process = function() {
2161
- var depth = 0;
2162
- for (gatherActiveObservationsAtDepth(depth); hasActiveObservations(); )
2163
- depth = broadcastActiveObservations(), gatherActiveObservationsAtDepth(depth);
2164
- return hasSkippedObservations() && deliverResizeLoopError(), depth > 0;
2165
- }, trigger, callbacks = [], notify = function() {
2166
- return callbacks.splice(0).forEach(function(cb) {
2167
- return cb();
2168
- });
2169
- }, queueMicroTask = function(callback) {
2170
- if (!trigger) {
2171
- var toggle_1 = 0, el_1 = document.createTextNode(""), config = {
2172
- characterData: !0
2173
- };
2174
- new MutationObserver(function() {
2175
- return notify();
2176
- }).observe(el_1, config), trigger = function() {
2177
- el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++);
2178
- };
2179
1763
  }
2180
- callbacks.push(callback), trigger();
2181
- }, queueResizeObserver = function(cb) {
2182
- queueMicroTask(function() {
2183
- requestAnimationFrame(cb);
1764
+ `;
1765
+ function avatarStackStyle() {
1766
+ return BASE_STYLES;
1767
+ }
1768
+ function responsiveAvatarStackSizeStyle(props) {
1769
+ const {
1770
+ avatar,
1771
+ media
1772
+ } = getTheme_v2(props.theme);
1773
+ return _responsive(media, props.$size, (size2) => {
1774
+ const avatarSize = avatar.sizes[size2];
1775
+ return avatarSize ? {
1776
+ "& > div + div": {
1777
+ marginLeft: rem(avatarSize.distance)
1778
+ }
1779
+ } : EMPTY_RECORD;
2184
1780
  });
2185
- }, watching = 0, isWatching = function() {
2186
- return !!watching;
2187
- }, CATCH_PERIOD = 250, observerConfig = {
2188
- attributes: !0,
2189
- characterData: !0,
2190
- childList: !0,
2191
- subtree: !0
2192
- }, events = ["resize", "load", "transitionend", "animationend", "animationstart", "animationiteration", "keyup", "keydown", "mouseup", "mousedown", "mouseover", "mouseout", "blur", "focus"], time = function(timeout) {
2193
- return timeout === void 0 && (timeout = 0), Date.now() + timeout;
2194
- }, scheduled = !1, Scheduler = function() {
2195
- function Scheduler2() {
2196
- var _this = this;
2197
- this.stopped = !0, this.listener = function() {
2198
- return _this.schedule();
2199
- };
2200
- }
2201
- return Scheduler2.prototype.run = function(timeout) {
2202
- var _this = this;
2203
- if (timeout === void 0 && (timeout = CATCH_PERIOD), !scheduled) {
2204
- scheduled = !0;
2205
- var until = time(timeout);
2206
- queueResizeObserver(function() {
2207
- var elementsHaveResized = !1;
2208
- try {
2209
- elementsHaveResized = process();
2210
- } finally {
2211
- if (scheduled = !1, timeout = until - time(), !isWatching())
2212
- return;
2213
- elementsHaveResized ? _this.run(1e3) : timeout > 0 ? _this.run(timeout) : _this.start();
1781
+ }
1782
+ const Root$z = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = forwardRef(function(props, ref) {
1783
+ const $ = c(15);
1784
+ let childrenProp, restProps, t0, t1;
1785
+ $[0] !== props ? ({
1786
+ children: childrenProp,
1787
+ maxLength: t0,
1788
+ size: t1,
1789
+ ...restProps
1790
+ } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps, $[3] = t0, $[4] = t1) : (childrenProp = $[1], restProps = $[2], t0 = $[3], t1 = $[4]);
1791
+ const maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1, children = Children.toArray(childrenProp).filter(isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children, T0 = Root$z, t2 = "AvatarStack", t3 = len === 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }) }), t4 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }) });
1792
+ let t5;
1793
+ $[5] !== size2 ? (t5 = (child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, {
1794
+ size: size2
1795
+ }) }, String(childIndex)), $[5] = size2, $[6] = t5) : t5 = $[6];
1796
+ const t6 = visibleChildren.map(t5);
1797
+ let t7;
1798
+ return $[7] !== T0 || $[8] !== ref || $[9] !== restProps || $[10] !== size2 || $[11] !== t3 || $[12] !== t4 || $[13] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T0, { "data-ui": t2, ...restProps, ref, $size: size2, children: [
1799
+ t3,
1800
+ t4,
1801
+ t6
1802
+ ] }), $[7] = T0, $[8] = ref, $[9] = restProps, $[10] = size2, $[11] = t3, $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14], t7;
1803
+ });
1804
+ AvatarStack.displayName = "ForwardRef(AvatarStack)";
1805
+ const Root$y = styled.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle), Box = forwardRef(function(props, ref) {
1806
+ const $ = c(59);
1807
+ let column, columnEnd, columnStart, flex, height, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, overflow, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, restProps, row, rowEnd, rowStart, sizing, t0, t1, t2, t3;
1808
+ $[0] !== props ? ({
1809
+ as: t0,
1810
+ column,
1811
+ columnStart,
1812
+ columnEnd,
1813
+ display: t1,
1814
+ flex,
1815
+ height,
1816
+ margin: t2,
1817
+ marginX,
1818
+ marginY,
1819
+ marginTop,
1820
+ marginRight,
1821
+ marginBottom,
1822
+ marginLeft,
1823
+ overflow,
1824
+ padding: t3,
1825
+ paddingX,
1826
+ paddingY,
1827
+ paddingTop,
1828
+ paddingRight,
1829
+ paddingBottom,
1830
+ paddingLeft,
1831
+ row,
1832
+ rowStart,
1833
+ rowEnd,
1834
+ sizing,
1835
+ ...restProps
1836
+ } = props, $[0] = props, $[1] = column, $[2] = columnEnd, $[3] = columnStart, $[4] = flex, $[5] = height, $[6] = marginBottom, $[7] = marginLeft, $[8] = marginRight, $[9] = marginTop, $[10] = marginX, $[11] = marginY, $[12] = overflow, $[13] = paddingBottom, $[14] = paddingLeft, $[15] = paddingRight, $[16] = paddingTop, $[17] = paddingX, $[18] = paddingY, $[19] = restProps, $[20] = row, $[21] = rowEnd, $[22] = rowStart, $[23] = sizing, $[24] = t0, $[25] = t1, $[26] = t2, $[27] = t3) : (column = $[1], columnEnd = $[2], columnStart = $[3], flex = $[4], height = $[5], marginBottom = $[6], marginLeft = $[7], marginRight = $[8], marginTop = $[9], marginX = $[10], marginY = $[11], overflow = $[12], paddingBottom = $[13], paddingLeft = $[14], paddingRight = $[15], paddingTop = $[16], paddingX = $[17], paddingY = $[18], restProps = $[19], row = $[20], rowEnd = $[21], rowStart = $[22], sizing = $[23], t0 = $[24], t1 = $[25], t2 = $[26], t3 = $[27]);
1837
+ const asProp = t0 === void 0 ? "div" : t0, display = t1 === void 0 ? "block" : t1, margin = t2 === void 0 ? 0 : t2, padding = t3 === void 0 ? 0 : t3, t4 = typeof asProp == "string" ? asProp : void 0, t5 = useArrayProp(column), t6 = useArrayProp(columnStart), t7 = useArrayProp(columnEnd), t8 = useArrayProp(display), t9 = useArrayProp(flex), t10 = useArrayProp(height), t11 = useArrayProp(margin), t12 = useArrayProp(marginX), t13 = useArrayProp(marginY), t14 = useArrayProp(marginTop), t15 = useArrayProp(marginRight), t16 = useArrayProp(marginBottom), t17 = useArrayProp(marginLeft), t18 = useArrayProp(overflow), t19 = useArrayProp(padding), t20 = useArrayProp(paddingX), t21 = useArrayProp(paddingY), t22 = useArrayProp(paddingTop), t23 = useArrayProp(paddingRight), t24 = useArrayProp(paddingBottom), t25 = useArrayProp(paddingLeft), t26 = useArrayProp(row), t27 = useArrayProp(rowStart), t28 = useArrayProp(rowEnd), t29 = useArrayProp(sizing);
1838
+ let t30;
1839
+ return $[28] !== asProp || $[29] !== props.children || $[30] !== ref || $[31] !== restProps || $[32] !== t10 || $[33] !== t11 || $[34] !== t12 || $[35] !== t13 || $[36] !== t14 || $[37] !== t15 || $[38] !== t16 || $[39] !== t17 || $[40] !== t18 || $[41] !== t19 || $[42] !== t20 || $[43] !== t21 || $[44] !== t22 || $[45] !== t23 || $[46] !== t24 || $[47] !== t25 || $[48] !== t26 || $[49] !== t27 || $[50] !== t28 || $[51] !== t29 || $[52] !== t4 || $[53] !== t5 || $[54] !== t6 || $[55] !== t7 || $[56] !== t8 || $[57] !== t9 ? (t30 = /* @__PURE__ */ jsx(Root$y, { "data-as": t4, "data-ui": "Box", ...restProps, $column: t5, $columnStart: t6, $columnEnd: t7, $display: t8, $flex: t9, $height: t10, $margin: t11, $marginX: t12, $marginY: t13, $marginTop: t14, $marginRight: t15, $marginBottom: t16, $marginLeft: t17, $overflow: t18, $padding: t19, $paddingX: t20, $paddingY: t21, $paddingTop: t22, $paddingRight: t23, $paddingBottom: t24, $paddingLeft: t25, $row: t26, $rowStart: t27, $rowEnd: t28, $sizing: t29, as: asProp, ref, children: props.children }), $[28] = asProp, $[29] = props.children, $[30] = ref, $[31] = restProps, $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13, $[36] = t14, $[37] = t15, $[38] = t16, $[39] = t17, $[40] = t18, $[41] = t19, $[42] = t20, $[43] = t21, $[44] = t22, $[45] = t23, $[46] = t24, $[47] = t25, $[48] = t26, $[49] = t27, $[50] = t28, $[51] = t29, $[52] = t4, $[53] = t5, $[54] = t6, $[55] = t7, $[56] = t8, $[57] = t9, $[58] = t30) : t30 = $[58], t30;
1840
+ });
1841
+ Box.displayName = "ForwardRef(Box)";
1842
+ function textBaseStyle(props) {
1843
+ const {
1844
+ $accent,
1845
+ $muted
1846
+ } = props, {
1847
+ font
1848
+ } = getTheme_v2(props.theme);
1849
+ return css`
1850
+ color: var(--card-fg-color);
1851
+
1852
+ ${$accent && css`
1853
+ color: var(--card-accent-fg-color);
1854
+ `}
1855
+
1856
+ ${$muted && css`
1857
+ color: var(--card-muted-fg-color);
1858
+ `}
1859
+
1860
+ & code {
1861
+ font-family: ${font.code.family};
1862
+ border-radius: 1px;
1863
+ background-color: var(--card-code-bg-color);
1864
+ color: var(--card-code-fg-color);
1865
+ }
1866
+
1867
+ & a {
1868
+ text-decoration: none;
1869
+ border-radius: 1px;
1870
+ color: var(--card-link-color);
1871
+ outline: none;
1872
+
1873
+ @media (hover: hover) {
1874
+ &:hover {
1875
+ text-decoration: underline;
2214
1876
  }
2215
- });
1877
+ }
1878
+
1879
+ &:focus {
1880
+ box-shadow:
1881
+ 0 0 0 1px var(--card-bg-color),
1882
+ 0 0 0 3px var(--card-focus-ring-color);
1883
+ }
1884
+
1885
+ &:focus:not(:focus-visible) {
1886
+ box-shadow: none;
1887
+ }
2216
1888
  }
2217
- }, Scheduler2.prototype.schedule = function() {
2218
- this.stop(), this.run();
2219
- }, Scheduler2.prototype.observe = function() {
2220
- var _this = this, cb = function() {
2221
- return _this.observer && _this.observer.observe(document.body, observerConfig);
2222
- };
2223
- document.body ? cb() : global$1.addEventListener("DOMContentLoaded", cb);
2224
- }, Scheduler2.prototype.start = function() {
2225
- var _this = this;
2226
- this.stopped && (this.stopped = !1, this.observer = new MutationObserver(this.listener), this.observe(), events.forEach(function(name) {
2227
- return global$1.addEventListener(name, _this.listener, !0);
2228
- }));
2229
- }, Scheduler2.prototype.stop = function() {
2230
- var _this = this;
2231
- this.stopped || (this.observer && this.observer.disconnect(), events.forEach(function(name) {
2232
- return global$1.removeEventListener(name, _this.listener, !0);
2233
- }), this.stopped = !0);
2234
- }, Scheduler2;
2235
- }(), scheduler = new Scheduler(), updateCount = function(n) {
2236
- !watching && n > 0 && scheduler.start(), watching += n, !watching && scheduler.stop();
2237
- }, skipNotifyOnElement = function(target) {
2238
- return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === "inline";
2239
- }, ResizeObservation = function() {
2240
- function ResizeObservation2(target, observedBox) {
2241
- this.target = target, this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX, this.lastReportedSize = {
2242
- inlineSize: 0,
2243
- blockSize: 0
2244
- };
1889
+
1890
+ & strong {
1891
+ font-weight: ${font.text.weights.bold};
1892
+ }
1893
+
1894
+ & svg {
1895
+ /* Certain popular CSS libraries changes the defaults for SVG display */
1896
+ /* Make sure SVGs are rendered as inline elements */
1897
+ display: inline;
1898
+ }
1899
+
1900
+ & [data-sanity-icon] {
1901
+ vertical-align: baseline;
1902
+ color: var(--card-icon-color);
1903
+
1904
+ & path {
1905
+ vector-effect: non-scaling-stroke !important;
1906
+ }
1907
+ }
1908
+ `;
1909
+ }
1910
+ const Root$x = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle), SpanWithTextOverflow$1 = styled.span`
1911
+ display: block;
1912
+ white-space: nowrap;
1913
+ text-overflow: ellipsis;
1914
+ overflow: hidden;
1915
+ overflow: clip;
1916
+ `, Text = forwardRef(function(props, ref) {
1917
+ const $ = c(22);
1918
+ let align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
1919
+ $[0] !== props ? ({
1920
+ accent: t0,
1921
+ align,
1922
+ children: childrenProp,
1923
+ muted: t1,
1924
+ size: t2,
1925
+ textOverflow,
1926
+ weight,
1927
+ ...restProps
1928
+ } = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight) : (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]);
1929
+ const accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 2 : t2;
1930
+ let children = childrenProp;
1931
+ if (textOverflow === "ellipsis") {
1932
+ let t32;
1933
+ $[9] !== children ? (t32 = /* @__PURE__ */ jsx(SpanWithTextOverflow$1, { children }), $[9] = children, $[10] = t32) : t32 = $[10], children = t32;
2245
1934
  }
2246
- return ResizeObservation2.prototype.isActive = function() {
2247
- var size2 = calculateBoxSize(this.target, this.observedBox, !0);
2248
- return skipNotifyOnElement(this.target) && (this.lastReportedSize = size2), this.lastReportedSize.inlineSize !== size2.inlineSize || this.lastReportedSize.blockSize !== size2.blockSize;
2249
- }, ResizeObservation2;
2250
- }(), ResizeObserverDetail = /* @__PURE__ */ function() {
2251
- function ResizeObserverDetail2(resizeObserver, callback) {
2252
- this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = resizeObserver, this.callback = callback;
1935
+ const t3 = useArrayProp(align), t4 = useArrayProp(size2);
1936
+ let t5;
1937
+ $[11] !== children ? (t5 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t5) : t5 = $[12];
1938
+ let t6;
1939
+ return $[13] !== accent || $[14] !== muted || $[15] !== ref || $[16] !== restProps || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== weight ? (t6 = /* @__PURE__ */ jsx(Root$x, { "data-ui": "Text", ...restProps, $accent: accent, $align: t3, $muted: muted, ref, $size: t4, $weight: weight, children: t5 }), $[13] = accent, $[14] = muted, $[15] = ref, $[16] = restProps, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = weight, $[21] = t6) : t6 = $[21], t6;
1940
+ });
1941
+ Text.displayName = "ForwardRef(Text)";
1942
+ function badgeStyle(props) {
1943
+ const {
1944
+ $tone
1945
+ } = props;
1946
+ return {
1947
+ "--card-bg-color": `var(--card-badge-${$tone}-bg-color)`,
1948
+ "--card-fg-color": `var(--card-badge-${$tone}-fg-color)`,
1949
+ backgroundColor: "var(--card-bg-color)",
1950
+ cursor: "default",
1951
+ "&:not([hidden])": {
1952
+ display: "inline-block",
1953
+ verticalAlign: "top"
1954
+ }
1955
+ };
1956
+ }
1957
+ const Root$w = styled(Box)(responsiveRadiusStyle, badgeStyle), Badge = forwardRef(function(props, ref) {
1958
+ const $ = c(17);
1959
+ let children, restProps, t0, t1, t2, t3;
1960
+ if ($[0] !== props) {
1961
+ const {
1962
+ children: t42,
1963
+ fontSize: t52,
1964
+ mode: _deprecated_mode,
1965
+ padding: t62,
1966
+ radius: t72,
1967
+ tone: t8,
1968
+ ...t9
1969
+ } = props;
1970
+ children = t42, t0 = t52, t1 = t62, t2 = t72, t3 = t8, restProps = t9, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2, $[6] = t3;
1971
+ } else
1972
+ children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5], t3 = $[6];
1973
+ const fontSize2 = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? "full" : t2, tone = t3 === void 0 ? "default" : t3, t4 = useArrayProp(radius), t5 = useArrayProp(padding);
1974
+ let t6;
1975
+ $[7] !== children || $[8] !== fontSize2 ? (t6 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children }), $[7] = children, $[8] = fontSize2, $[9] = t6) : t6 = $[9];
1976
+ let t7;
1977
+ return $[10] !== ref || $[11] !== restProps || $[12] !== t4 || $[13] !== t5 || $[14] !== t6 || $[15] !== tone ? (t7 = /* @__PURE__ */ jsx(Root$w, { "data-ui": "Badge", ...restProps, $tone: tone, $radius: t4, padding: t5, ref, children: t6 }), $[10] = ref, $[11] = restProps, $[12] = t4, $[13] = t5, $[14] = t6, $[15] = tone, $[16] = t7) : t7 = $[16], t7;
1978
+ });
1979
+ Badge.displayName = "ForwardRef(Badge)";
1980
+ const Root$v = styled(Box)(flexItemStyle, responsiveFlexStyle), Flex = forwardRef(function(props, ref) {
1981
+ const $ = c(17);
1982
+ let align, as, gap, justify, restProps, t0, wrap;
1983
+ $[0] !== props ? ({
1984
+ align,
1985
+ as,
1986
+ direction: t0,
1987
+ gap,
1988
+ justify,
1989
+ wrap,
1990
+ ...restProps
1991
+ } = props, $[0] = props, $[1] = align, $[2] = as, $[3] = gap, $[4] = justify, $[5] = restProps, $[6] = t0, $[7] = wrap) : (align = $[1], as = $[2], gap = $[3], justify = $[4], restProps = $[5], t0 = $[6], wrap = $[7]);
1992
+ const direction = t0 === void 0 ? "row" : t0, t1 = useArrayProp(align), t2 = useArrayProp(direction), t3 = useArrayProp(gap), t4 = useArrayProp(justify), t5 = useArrayProp(wrap);
1993
+ let t6;
1994
+ return $[8] !== as || $[9] !== ref || $[10] !== restProps || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Root$v, { "data-ui": "Flex", ...restProps, $align: t1, $direction: t2, $gap: t3, $justify: t4, $wrap: t5, forwardedAs: as, ref }), $[8] = as, $[9] = ref, $[10] = restProps, $[11] = t1, $[12] = t2, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
1995
+ });
1996
+ Flex.displayName = "ForwardRef(Flex)";
1997
+ const rotate$1 = keyframes`
1998
+ from {
1999
+ transform: rotate(0deg);
2253
2000
  }
2254
- return ResizeObserverDetail2;
2255
- }(), observerMap = /* @__PURE__ */ new WeakMap(), getObservationIndex = function(observationTargets, target) {
2256
- for (var i = 0; i < observationTargets.length; i += 1)
2257
- if (observationTargets[i].target === target)
2258
- return i;
2259
- return -1;
2260
- }, ResizeObserverController = function() {
2261
- function ResizeObserverController2() {
2001
+
2002
+ to {
2003
+ transform: rotate(360deg);
2262
2004
  }
2263
- return ResizeObserverController2.connect = function(resizeObserver, callback) {
2264
- var detail = new ResizeObserverDetail(resizeObserver, callback);
2265
- observerMap.set(resizeObserver, detail);
2266
- }, ResizeObserverController2.observe = function(resizeObserver, target, options) {
2267
- var detail = observerMap.get(resizeObserver), firstObservation = detail.observationTargets.length === 0;
2268
- getObservationIndex(detail.observationTargets, target) < 0 && (firstObservation && resizeObservers.push(detail), detail.observationTargets.push(new ResizeObservation(target, options && options.box)), updateCount(1), scheduler.schedule());
2269
- }, ResizeObserverController2.unobserve = function(resizeObserver, target) {
2270
- var detail = observerMap.get(resizeObserver), index = getObservationIndex(detail.observationTargets, target), lastObservation = detail.observationTargets.length === 1;
2271
- index >= 0 && (lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1), detail.observationTargets.splice(index, 1), updateCount(-1));
2272
- }, ResizeObserverController2.disconnect = function(resizeObserver) {
2273
- var _this = this, detail = observerMap.get(resizeObserver);
2274
- detail.observationTargets.slice().forEach(function(ot) {
2275
- return _this.unobserve(resizeObserver, ot.target);
2276
- }), detail.activeTargets.splice(0, detail.activeTargets.length);
2277
- }, ResizeObserverController2;
2278
- }(), ResizeObserver = function() {
2279
- function ResizeObserver2(callback) {
2280
- if (arguments.length === 0)
2281
- throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
2282
- if (typeof callback != "function")
2283
- throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
2284
- ResizeObserverController.connect(this, callback);
2005
+ `, Root$u = styled(Text)`
2006
+ & > span > svg {
2007
+ animation: ${rotate$1} 500ms linear infinite;
2285
2008
  }
2286
- return ResizeObserver2.prototype.observe = function(target, options) {
2287
- if (arguments.length === 0)
2288
- throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
2289
- if (!isElement(target))
2290
- throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
2291
- ResizeObserverController.observe(this, target, options);
2292
- }, ResizeObserver2.prototype.unobserve = function(target) {
2293
- if (arguments.length === 0)
2294
- throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
2295
- if (!isElement(target))
2296
- throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
2297
- ResizeObserverController.unobserve(this, target);
2298
- }, ResizeObserver2.prototype.disconnect = function() {
2299
- ResizeObserverController.disconnect(this);
2300
- }, ResizeObserver2.toString = function() {
2301
- return "function ResizeObserver () { [polyfill code] }";
2302
- }, ResizeObserver2;
2303
- }();
2304
- const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
2305
- function _createElementRectValueListener() {
2009
+ `, Spinner = forwardRef(function(props, ref) {
2010
+ const $ = c(4);
2011
+ let t0;
2012
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsx(SpinnerIcon, {}), $[0] = t0) : t0 = $[0];
2013
+ let t1;
2014
+ return $[1] !== props || $[2] !== ref ? (t1 = /* @__PURE__ */ jsx(Root$u, { "data-ui": "Spinner", ...props, ref, children: t0 }), $[1] = props, $[2] = ref, $[3] = t1) : t1 = $[3], t1;
2015
+ });
2016
+ Spinner.displayName = "ForwardRef(Spinner)";
2017
+ function _cardColorStyle(base, color, checkered = !1) {
2306
2018
  return {
2307
- subscribe(element, subscriber) {
2308
- const resizeObserver = new _ResizeObserver(([entry]) => {
2309
- subscriber({
2310
- _contentRect: entry.contentRect,
2311
- border: {
2312
- width: entry.borderBoxSize[0].inlineSize,
2313
- height: entry.borderBoxSize[0].blockSize
2314
- },
2315
- content: {
2316
- width: entry.contentRect.width,
2317
- height: entry.contentRect.height
2318
- }
2319
- });
2320
- });
2321
- return resizeObserver.observe(element), () => {
2322
- resizeObserver.unobserve(element), resizeObserver.disconnect();
2323
- };
2324
- }
2019
+ // from base
2020
+ "--card-backdrop-color": base.backdrop,
2021
+ "--card-focus-ring-color": base.focusRing,
2022
+ "--card-shadow-outline-color": base.shadow.outline,
2023
+ "--card-shadow-umbra-color": base.shadow.umbra,
2024
+ "--card-shadow-penumbra-color": base.shadow.penumbra,
2025
+ "--card-shadow-ambient-color": base.shadow.ambient,
2026
+ // from state
2027
+ "--card-accent-fg-color": color.accent.fg,
2028
+ "--card-avatar-gray-bg-color": color.avatar.gray.bg,
2029
+ "--card-avatar-gray-fg-color": color.avatar.gray.fg,
2030
+ "--card-avatar-blue-bg-color": color.avatar.blue.bg,
2031
+ "--card-avatar-blue-fg-color": color.avatar.blue.fg,
2032
+ "--card-avatar-purple-bg-color": color.avatar.purple.bg,
2033
+ "--card-avatar-purple-fg-color": color.avatar.purple.fg,
2034
+ "--card-avatar-magenta-bg-color": color.avatar.magenta.bg,
2035
+ "--card-avatar-magenta-fg-color": color.avatar.magenta.fg,
2036
+ "--card-avatar-red-bg-color": color.avatar.red.bg,
2037
+ "--card-avatar-red-fg-color": color.avatar.red.fg,
2038
+ "--card-avatar-orange-bg-color": color.avatar.orange.bg,
2039
+ "--card-avatar-orange-fg-color": color.avatar.orange.fg,
2040
+ "--card-avatar-yellow-bg-color": color.avatar.yellow.bg,
2041
+ "--card-avatar-yellow-fg-color": color.avatar.yellow.fg,
2042
+ "--card-avatar-green-bg-color": color.avatar.green.bg,
2043
+ "--card-avatar-green-fg-color": color.avatar.green.fg,
2044
+ "--card-avatar-cyan-bg-color": color.avatar.cyan.bg,
2045
+ "--card-avatar-cyan-fg-color": color.avatar.cyan.fg,
2046
+ "--card-bg-color": color.bg,
2047
+ "--card-bg-image": checkered ? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)` : void 0,
2048
+ "--card-border-color": color.border,
2049
+ "--card-badge-default-bg-color": color.badge.default.bg,
2050
+ "--card-badge-default-dot-color": color.badge.default.dot,
2051
+ "--card-badge-default-fg-color": color.badge.default.fg,
2052
+ "--card-badge-default-icon-color": color.badge.default.icon,
2053
+ "--card-badge-primary-bg-color": color.badge.primary.bg,
2054
+ "--card-badge-primary-dot-color": color.badge.primary.dot,
2055
+ "--card-badge-primary-fg-color": color.badge.primary.fg,
2056
+ "--card-badge-primary-icon-color": color.badge.primary.icon,
2057
+ "--card-badge-positive-bg-color": color.badge.positive.bg,
2058
+ "--card-badge-positive-dot-color": color.badge.positive.dot,
2059
+ "--card-badge-positive-fg-color": color.badge.positive.fg,
2060
+ "--card-badge-positive-icon-color": color.badge.positive.icon,
2061
+ "--card-badge-caution-bg-color": color.badge.caution.bg,
2062
+ "--card-badge-caution-dot-color": color.badge.caution.dot,
2063
+ "--card-badge-caution-fg-color": color.badge.caution.fg,
2064
+ "--card-badge-caution-icon-color": color.badge.caution.icon,
2065
+ "--card-badge-critical-bg-color": color.badge.critical.bg,
2066
+ "--card-badge-critical-dot-color": color.badge.critical.dot,
2067
+ "--card-badge-critical-fg-color": color.badge.critical.fg,
2068
+ "--card-badge-critical-icon-color": color.badge.critical.icon,
2069
+ "--card-code-bg-color": color.code.bg,
2070
+ "--card-code-fg-color": color.code.fg,
2071
+ "--card-fg-color": color.fg,
2072
+ "--card-icon-color": color.icon,
2073
+ "--card-kbd-bg-color": color.kbd.bg,
2074
+ "--card-kbd-border-color": color.kbd.border,
2075
+ "--card-kbd-fg-color": color.kbd.fg,
2076
+ "--card-link-fg-color": color.link.fg,
2077
+ "--card-muted-bg-color": color.muted.bg,
2078
+ "--card-muted-fg-color": color.muted.fg,
2079
+ "--card-skeleton-color-from": color.skeleton.from,
2080
+ "--card-skeleton-color-to": color.skeleton.to,
2081
+ // deprecated variables (kept for legacy)
2082
+ "--card-bg2-color": color.muted.bg,
2083
+ "--card-link-color": color.link.fg,
2084
+ "--card-hairline-soft-color": color.border,
2085
+ "--card-hairline-hard-color": color.border
2325
2086
  };
2326
2087
  }
2327
- function _createElementSizeObserver() {
2328
- const disposeCache = /* @__PURE__ */ new WeakMap(), subscribersCache = /* @__PURE__ */ new WeakMap();
2329
- return {
2330
- subscribe(element, subscriber) {
2331
- const subscribers = subscribersCache.get(element) || [];
2332
- let dispose = disposeCache.get(element);
2333
- return subscribersCache.has(element) || (subscribersCache.set(element, subscribers), dispose = _createElementRectValueListener().subscribe(element, (elementRect) => {
2334
- for (const sub of subscribers)
2335
- sub(elementRect);
2336
- })), subscribers.push(subscriber), () => {
2337
- const idx = subscribers.indexOf(subscriber);
2338
- idx > -1 && subscribers.splice(idx, 1), subscribers.length === 0 && dispose && dispose();
2339
- };
2088
+ function buttonBaseStyles(props) {
2089
+ const {
2090
+ $width
2091
+ } = props, {
2092
+ style
2093
+ } = getTheme_v2(props.theme);
2094
+ return css`
2095
+ ${style?.button};
2096
+
2097
+ -webkit-font-smoothing: inherit;
2098
+ appearance: none;
2099
+ display: inline-flex;
2100
+ align-items: center;
2101
+ font: inherit;
2102
+ border: 0;
2103
+ outline: none;
2104
+ user-select: none;
2105
+ text-decoration: none;
2106
+ border: 0;
2107
+ box-sizing: border-box;
2108
+ padding: 0;
2109
+ margin: 0;
2110
+ white-space: nowrap;
2111
+ text-align: left;
2112
+ position: relative;
2113
+ vertical-align: top;
2114
+
2115
+ ${$width === "fill" && css`
2116
+ width: -moz-available;
2117
+ width: -webkit-fill-available;
2118
+ width: stretch;
2119
+ `}
2120
+
2121
+ & > span {
2122
+ display: block;
2123
+ flex: 1;
2124
+ min-width: 0;
2125
+ border-radius: inherit;
2340
2126
  }
2341
- };
2342
- }
2343
- function useElementSize(element) {
2344
- const $ = c(3), [size2, setSize] = useState(null);
2345
- let t0, t1;
2346
- return $[0] !== element ? (t0 = () => {
2347
- if (element)
2348
- return _elementSizeObserver.subscribe(element, setSize);
2349
- }, t1 = [element], $[0] = element, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), useEffect(t0, t1), size2;
2127
+
2128
+ &::-moz-focus-inner {
2129
+ border: 0;
2130
+ padding: 0;
2131
+ }
2132
+ `;
2350
2133
  }
2351
- function useElementRect(element) {
2352
- return useElementSize(element)?._contentRect || null;
2134
+ function combineBoxShadow(...boxShadows) {
2135
+ return boxShadows.filter(Boolean).join(",");
2353
2136
  }
2354
- function useForwardedRef(ref) {
2355
- const $ = c(1), innerRef = useRef(null);
2356
- let t0;
2357
- return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], useImperativeHandle(ref, t0), innerRef;
2137
+ function buttonColorStyles(props) {
2138
+ const {
2139
+ $mode
2140
+ } = props, {
2141
+ button,
2142
+ color: baseColor,
2143
+ style
2144
+ } = getTheme_v2(props.theme), shadow = props.$mode === "ghost", mode = baseColor.button[$mode] || baseColor.button.default, color = mode[props.$tone] || mode.default, border2 = {
2145
+ width: button.border.width,
2146
+ color: "var(--card-border-color)"
2147
+ }, defaultBoxShadow = void 0;
2148
+ return [_cardColorStyle(baseColor, color.enabled), {
2149
+ backgroundColor: "var(--card-bg-color)",
2150
+ color: "var(--card-fg-color)",
2151
+ boxShadow: focusRingBorderStyle(border2),
2152
+ '&:disabled, &[data-disabled="true"]': _cardColorStyle(baseColor, color.disabled),
2153
+ "&:not([data-disabled='true'])": {
2154
+ boxShadow: combineBoxShadow(focusRingBorderStyle(border2), shadow ? defaultBoxShadow : void 0),
2155
+ "&:focus": {
2156
+ boxShadow: focusRingStyle({
2157
+ base: baseColor,
2158
+ border: {
2159
+ width: 2,
2160
+ color: baseColor.bg
2161
+ },
2162
+ focusRing: button.focusRing
2163
+ })
2164
+ },
2165
+ "&:focus:not(:focus-visible)": {
2166
+ boxShadow: combineBoxShadow(focusRingBorderStyle(border2), shadow ? defaultBoxShadow : void 0)
2167
+ },
2168
+ "@media (hover: hover)": {
2169
+ "&:hover": _cardColorStyle(baseColor, color.hovered),
2170
+ "&:active": _cardColorStyle(baseColor, color.pressed),
2171
+ "&[data-hovered]": _cardColorStyle(baseColor, color.hovered)
2172
+ },
2173
+ "&[data-selected]": _cardColorStyle(baseColor, color.pressed)
2174
+ }
2175
+ }, style?.button?.root].filter(Boolean);
2358
2176
  }
2359
- function useGlobalKeyDown(onKeyDown) {
2360
- const $ = c(3);
2361
- let t0, t1;
2362
- return $[0] !== onKeyDown ? (t0 = () => (addEventListener("keydown", onKeyDown), () => removeEventListener("keydown", onKeyDown)), t1 = [onKeyDown], $[0] = onKeyDown, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), useEffect(t0, t1);
2177
+ const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles), LoadingBox = styled.div`
2178
+ position: absolute;
2179
+ top: 0;
2180
+ left: 0;
2181
+ right: 0;
2182
+ bottom: 0;
2183
+ display: flex;
2184
+ align-items: center;
2185
+ justify-content: center;
2186
+ background-color: var(--card-bg-color);
2187
+ border-radius: inherit;
2188
+ z-index: 1;
2189
+ box-shadow: inherit;
2190
+ `, Button = forwardRef(function(props, ref) {
2191
+ const $ = c(64);
2192
+ let IconComponent, IconRightComponent, children, disabled, loading, paddingBottomProp, paddingLeftProp, paddingRightProp, paddingTopProp, paddingXProp, paddingYProp, restProps, selected, t0, t1, t2, t3, t4, t5, t6, t7, t8, text, textAlign, width;
2193
+ $[0] !== props ? ({
2194
+ children,
2195
+ disabled,
2196
+ fontSize: t0,
2197
+ icon: IconComponent,
2198
+ iconRight: IconRightComponent,
2199
+ justify: t1,
2200
+ loading,
2201
+ mode: t2,
2202
+ padding: t3,
2203
+ paddingX: paddingXProp,
2204
+ paddingY: paddingYProp,
2205
+ paddingTop: paddingTopProp,
2206
+ paddingBottom: paddingBottomProp,
2207
+ paddingLeft: paddingLeftProp,
2208
+ paddingRight: paddingRightProp,
2209
+ radius: t4,
2210
+ selected,
2211
+ space: t5,
2212
+ text,
2213
+ textAlign,
2214
+ tone: t6,
2215
+ type: t7,
2216
+ muted: t8,
2217
+ width,
2218
+ ...restProps
2219
+ } = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = loading, $[6] = paddingBottomProp, $[7] = paddingLeftProp, $[8] = paddingRightProp, $[9] = paddingTopProp, $[10] = paddingXProp, $[11] = paddingYProp, $[12] = restProps, $[13] = selected, $[14] = t0, $[15] = t1, $[16] = t2, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = t6, $[21] = t7, $[22] = t8, $[23] = text, $[24] = textAlign, $[25] = width) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], loading = $[5], paddingBottomProp = $[6], paddingLeftProp = $[7], paddingRightProp = $[8], paddingTopProp = $[9], paddingXProp = $[10], paddingYProp = $[11], restProps = $[12], selected = $[13], t0 = $[14], t1 = $[15], t2 = $[16], t3 = $[17], t4 = $[18], t5 = $[19], t6 = $[20], t7 = $[21], t8 = $[22], text = $[23], textAlign = $[24], width = $[25]);
2220
+ const fontSize2 = t0 === void 0 ? 1 : t0, justifyProp = t1 === void 0 ? "center" : t1, mode = t2 === void 0 ? "default" : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, tone = t6 === void 0 ? "default" : t6, type = t7 === void 0 ? "button" : t7, muted = t8 === void 0 ? !1 : t8, {
2221
+ button
2222
+ } = useTheme_v2(), justify = useArrayProp(justifyProp), padding = useArrayProp(paddingProp), paddingX = useArrayProp(paddingXProp), paddingY = useArrayProp(paddingYProp), paddingTop = useArrayProp(paddingTopProp), paddingBottom = useArrayProp(paddingBottomProp), paddingLeft = useArrayProp(paddingLeftProp), paddingRight = useArrayProp(paddingRightProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp);
2223
+ let t9, t10;
2224
+ $[26] !== padding || $[27] !== paddingBottom || $[28] !== paddingLeft || $[29] !== paddingRight || $[30] !== paddingTop || $[31] !== paddingX || $[32] !== paddingY ? (t10 = {
2225
+ padding,
2226
+ paddingX,
2227
+ paddingY,
2228
+ paddingTop,
2229
+ paddingBottom,
2230
+ paddingLeft,
2231
+ paddingRight
2232
+ }, $[26] = padding, $[27] = paddingBottom, $[28] = paddingLeft, $[29] = paddingRight, $[30] = paddingTop, $[31] = paddingX, $[32] = paddingY, $[33] = t10) : t10 = $[33], t9 = t10;
2233
+ const boxProps = t9, t11 = !!(loading || disabled), t12 = selected ? "" : void 0, t13 = !!(loading || disabled);
2234
+ let t14;
2235
+ $[34] !== loading ? (t14 = !!loading && /* @__PURE__ */ jsx(LoadingBox, { children: /* @__PURE__ */ jsx(Spinner, {}) }), $[34] = loading, $[35] = t14) : t14 = $[35];
2236
+ let t15;
2237
+ $[36] !== IconComponent || $[37] !== IconRightComponent || $[38] !== boxProps || $[39] !== button || $[40] !== fontSize2 || $[41] !== justify || $[42] !== muted || $[43] !== space || $[44] !== text || $[45] !== textAlign ? (t15 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children: /* @__PURE__ */ jsxs(Flex, { as: "span", justify, gap: space, children: [
2238
+ IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
2239
+ isValidElement(IconComponent) && IconComponent,
2240
+ isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
2241
+ ] }),
2242
+ text && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { muted, align: textAlign, size: fontSize2, textOverflow: "ellipsis", weight: button.textWeight, children: text }) }),
2243
+ IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
2244
+ isValidElement(IconRightComponent) && IconRightComponent,
2245
+ isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
2246
+ ] })
2247
+ ] }) }), $[36] = IconComponent, $[37] = IconRightComponent, $[38] = boxProps, $[39] = button, $[40] = fontSize2, $[41] = justify, $[42] = muted, $[43] = space, $[44] = text, $[45] = textAlign, $[46] = t15) : t15 = $[46];
2248
+ let t16;
2249
+ $[47] !== boxProps || $[48] !== children ? (t16 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children }), $[47] = boxProps, $[48] = children, $[49] = t16) : t16 = $[49];
2250
+ let t17;
2251
+ return $[50] !== mode || $[51] !== radius || $[52] !== ref || $[53] !== restProps || $[54] !== t11 || $[55] !== t12 || $[56] !== t13 || $[57] !== t14 || $[58] !== t15 || $[59] !== t16 || $[60] !== tone || $[61] !== type || $[62] !== width ? (t17 = /* @__PURE__ */ jsxs(Root$t, { "data-ui": "Button", ...restProps, $mode: mode, $radius: radius, $tone: tone, "data-disabled": t11, "data-selected": t12, disabled: t13, ref, type, $width: width, children: [
2252
+ t14,
2253
+ t15,
2254
+ t16
2255
+ ] }), $[50] = mode, $[51] = radius, $[52] = ref, $[53] = restProps, $[54] = t11, $[55] = t12, $[56] = t13, $[57] = t14, $[58] = t15, $[59] = t16, $[60] = tone, $[61] = type, $[62] = width, $[63] = t17) : t17 = $[63], t17;
2256
+ });
2257
+ Button.displayName = "ForwardRef(Button)";
2258
+ function cardStyle(props) {
2259
+ return [cardBaseStyle(props), cardColorStyle(props)];
2363
2260
  }
2364
- function useMatchMedia(mediaQueryString, getServerSnapshot2) {
2261
+ function cardBaseStyle(props) {
2365
2262
  const {
2366
- subscribe: subscribe2,
2367
- getSnapshot
2368
- } = useMemo(() => {
2369
- let MEDIA_QUERY_CACHE;
2370
- const getMatchMedia = () => (MEDIA_QUERY_CACHE || (MEDIA_QUERY_CACHE = window.matchMedia(mediaQueryString)), MEDIA_QUERY_CACHE);
2371
- return {
2372
- subscribe: (onStoreChange) => {
2373
- const matchMedia = getMatchMedia();
2374
- return matchMedia.addEventListener("change", onStoreChange), () => matchMedia.removeEventListener("change", onStoreChange);
2375
- },
2376
- getSnapshot: () => getMatchMedia().matches
2377
- };
2378
- }, [mediaQueryString]);
2379
- return useDebugValue(mediaQueryString), useSyncExternalStore(subscribe2, getSnapshot, getServerSnapshot2);
2380
- }
2381
- function _getMediaQuery(media, index) {
2382
- return index === 0 ? `screen and (max-width: ${media[index] - 1}px)` : index === media.length ? `screen and (min-width: ${media[index - 1]}px)` : `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`;
2263
+ $checkered
2264
+ } = props, {
2265
+ space
2266
+ } = getTheme_v2(props.theme);
2267
+ return css`
2268
+ ${$checkered && css`
2269
+ background-size: ${space[3]}px ${space[3]}px;
2270
+ background-position: 50% 50%;
2271
+ background-image: var(--card-bg-image);
2272
+ `}
2273
+
2274
+ &[data-as='button'] {
2275
+ -webkit-font-smoothing: inherit;
2276
+ appearance: none;
2277
+ outline: none;
2278
+ font: inherit;
2279
+ text-align: inherit;
2280
+ border: 0;
2281
+ width: -moz-available;
2282
+ width: -webkit-fill-available;
2283
+ width: stretch;
2284
+ }
2285
+
2286
+ /* &:is(a) */
2287
+ &[data-as='a'] {
2288
+ outline: none;
2289
+ text-decoration: none;
2290
+ }
2291
+
2292
+ /* &:is(pre) */
2293
+ &[data-as='pre'] {
2294
+ font: inherit;
2295
+ }
2296
+ `;
2383
2297
  }
2384
- function _createMediaStore(media) {
2385
- const mediaLen = media.length;
2386
- let sizes;
2387
- const getSizes = () => {
2388
- if (!sizes) {
2389
- sizes = [];
2390
- for (let index = mediaLen; index > -1; index -= 1) {
2391
- const mediaQuery = _getMediaQuery(media, index);
2392
- sizes.push({
2393
- index,
2394
- mq: window.matchMedia(mediaQuery)
2395
- });
2298
+ function cardColorStyle(props) {
2299
+ const {
2300
+ $checkered,
2301
+ $focusRing,
2302
+ $muted
2303
+ } = props, {
2304
+ card,
2305
+ color,
2306
+ style
2307
+ } = getTheme_v2(props.theme), border2 = {
2308
+ width: card.border.width,
2309
+ color: "var(--card-border-color)"
2310
+ };
2311
+ return css`
2312
+ color-scheme: ${color._dark ? "dark" : "light"};
2313
+
2314
+ ${_cardColorStyle(color, color, $checkered)}
2315
+
2316
+ background-color: ${$muted ? "var(--card-muted-bg-color)" : "var(--card-bg-color)"};
2317
+ color: var(--card-fg-color);
2318
+
2319
+ /* &:is(button) */
2320
+ &[data-as='button'] {
2321
+ --card-focus-ring-box-shadow: none;
2322
+
2323
+ cursor: default;
2324
+ box-shadow: var(--card-focus-ring-box-shadow);
2325
+
2326
+ &:disabled {
2327
+ ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
2328
+ }
2329
+
2330
+ &:not(:disabled) {
2331
+ &[data-pressed] {
2332
+ ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
2333
+ }
2334
+
2335
+ &[data-selected] {
2336
+ ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
2337
+ }
2338
+
2339
+ @media (hover: hover) {
2340
+ &:not([data-pressed]):not([data-selected]) {
2341
+ &[data-hovered],
2342
+ &:hover {
2343
+ ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
2344
+ }
2345
+
2346
+ &:active {
2347
+ ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
2348
+ }
2349
+ }
2350
+ }
2351
+
2352
+ &:focus-visible {
2353
+ --card-focus-ring-box-shadow: ${$focusRing ? focusRingStyle({
2354
+ base: color,
2355
+ border: border2,
2356
+ focusRing: card.focusRing
2357
+ }) : void 0};
2358
+ }
2396
2359
  }
2397
2360
  }
2398
- return sizes;
2399
- };
2400
- return {
2401
- getSnapshot: () => {
2402
- for (const {
2403
- index,
2404
- mq
2405
- } of getSizes())
2406
- if (mq.matches) return index;
2407
- return 0;
2408
- },
2409
- subscribe: (onStoreChange) => {
2410
- const disposeFns = [];
2411
- for (const {
2412
- mq
2413
- } of getSizes()) {
2414
- const handleChange = () => {
2415
- mq.matches && onStoreChange();
2416
- };
2417
- mq.addEventListener("change", handleChange), disposeFns.push(() => mq.removeEventListener("change", handleChange));
2361
+
2362
+ /* &:is(a) */
2363
+ &[data-as='a'] {
2364
+ cursor: pointer;
2365
+ box-shadow: var(--card-focus-ring-box-shadow);
2366
+
2367
+ &[data-disabled] {
2368
+ ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
2369
+ }
2370
+
2371
+ &:not([data-disabled]) {
2372
+ &[data-pressed] {
2373
+ ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
2374
+ }
2375
+
2376
+ &[data-selected] {
2377
+ ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
2378
+ }
2379
+
2380
+ @media (hover: hover) {
2381
+ &:not([data-pressed]):not([data-selected]) {
2382
+ &[data-hovered],
2383
+ &:hover {
2384
+ ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
2385
+ }
2386
+
2387
+ &:active {
2388
+ ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
2389
+ }
2390
+ }
2391
+ }
2392
+
2393
+ &:focus-visible {
2394
+ --card-focus-ring-box-shadow: ${$focusRing ? focusRingStyle({
2395
+ base: color,
2396
+ border: border2,
2397
+ focusRing: card.focusRing
2398
+ }) : void 0};
2399
+ }
2418
2400
  }
2419
- return () => {
2420
- for (const disposeFn of disposeFns)
2421
- disposeFn();
2422
- };
2423
2401
  }
2424
- };
2425
- }
2426
- function getServerSnapshot() {
2427
- return 0;
2428
- }
2429
- function useMediaIndex() {
2430
- const $ = c(2), {
2431
- media
2432
- } = useTheme_v2();
2433
- let t0, t1;
2434
- $[0] !== media ? (t1 = _createMediaStore(media), $[0] = media, $[1] = t1) : t1 = $[1], t0 = t1;
2435
- const store = t0;
2436
- return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
2437
- }
2438
- function usePrefersDark(t0) {
2439
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$5 : t0);
2440
- }
2441
- function _temp$5() {
2442
- return !1;
2443
- }
2444
- function usePrefersReducedMotion(t0) {
2445
- return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$4 : t0);
2446
- }
2447
- function _temp$4() {
2448
- return !1;
2402
+
2403
+ ${style?.card?.root}
2404
+ `;
2449
2405
  }
2406
+ const Root$s = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), Card = forwardRef(function(props, ref) {
2407
+ const $ = c(42);
2408
+ let asProp, border2, borderBottom2, borderLeft2, borderRight2, borderTop2, muted, pressed, restProps, scheme, selected, shadow, t0, t1, t2, t3;
2409
+ $[0] !== props ? ({
2410
+ __unstable_checkered: t0,
2411
+ __unstable_focusRing: t1,
2412
+ as: asProp,
2413
+ border: border2,
2414
+ borderTop: borderTop2,
2415
+ borderRight: borderRight2,
2416
+ borderBottom: borderBottom2,
2417
+ borderLeft: borderLeft2,
2418
+ muted,
2419
+ pressed,
2420
+ radius: t2,
2421
+ scheme,
2422
+ selected,
2423
+ shadow,
2424
+ tone: t3,
2425
+ ...restProps
2426
+ } = props, $[0] = props, $[1] = asProp, $[2] = border2, $[3] = borderBottom2, $[4] = borderLeft2, $[5] = borderRight2, $[6] = borderTop2, $[7] = muted, $[8] = pressed, $[9] = restProps, $[10] = scheme, $[11] = selected, $[12] = shadow, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3) : (asProp = $[1], border2 = $[2], borderBottom2 = $[3], borderLeft2 = $[4], borderRight2 = $[5], borderTop2 = $[6], muted = $[7], pressed = $[8], restProps = $[9], scheme = $[10], selected = $[11], shadow = $[12], t0 = $[13], t1 = $[14], t2 = $[15], t3 = $[16]);
2427
+ const checkered = t0 === void 0 ? !1 : t0, focusRing = t1 === void 0 ? !1 : t1, radius = t2 === void 0 ? 0 : t2, toneProp = t3 === void 0 ? "default" : t3, as = isValidElementType(asProp) ? asProp : "div", rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp, t4 = typeof as == "string" ? as : void 0, t5 = rootTheme.scheme, t6 = useArrayProp(border2), t7 = useArrayProp(borderTop2), t8 = useArrayProp(borderRight2), t9 = useArrayProp(borderBottom2), t10 = useArrayProp(borderLeft2), t11 = useArrayProp(radius), t12 = useArrayProp(shadow), t13 = checkered ? "" : void 0, t14 = pressed ? "" : void 0, t15 = selected ? "" : void 0;
2428
+ let t16;
2429
+ $[17] !== as || $[18] !== checkered || $[19] !== focusRing || $[20] !== muted || $[21] !== ref || $[22] !== restProps || $[23] !== rootTheme.scheme || $[24] !== selected || $[25] !== t10 || $[26] !== t11 || $[27] !== t12 || $[28] !== t13 || $[29] !== t14 || $[30] !== t15 || $[31] !== t4 || $[32] !== t6 || $[33] !== t7 || $[34] !== t8 || $[35] !== t9 || $[36] !== tone ? (t16 = /* @__PURE__ */ jsx(Root$s, { "data-as": t4, "data-scheme": t5, "data-ui": "Card", "data-tone": tone, ...restProps, $border: t6, $borderTop: t7, $borderRight: t8, $borderBottom: t9, $borderLeft: t10, $checkered: checkered, $focusRing: focusRing, $muted: muted, $radius: t11, $shadow: t12, $tone: tone, "data-checkered": t13, "data-pressed": t14, "data-selected": t15, forwardedAs: as, ref, selected }), $[17] = as, $[18] = checkered, $[19] = focusRing, $[20] = muted, $[21] = ref, $[22] = restProps, $[23] = rootTheme.scheme, $[24] = selected, $[25] = t10, $[26] = t11, $[27] = t12, $[28] = t13, $[29] = t14, $[30] = t15, $[31] = t4, $[32] = t6, $[33] = t7, $[34] = t8, $[35] = t9, $[36] = tone, $[37] = t16) : t16 = $[37];
2430
+ let t17;
2431
+ return $[38] !== scheme || $[39] !== t16 || $[40] !== tone ? (t17 = /* @__PURE__ */ jsx(ThemeColorProvider, { scheme, tone, children: t16 }), $[38] = scheme, $[39] = t16, $[40] = tone, $[41] = t17) : t17 = $[41], t17;
2432
+ });
2433
+ Card.displayName = "ForwardRef(Card)";
2450
2434
  function checkboxBaseStyles() {
2451
2435
  return css`
2452
2436
  position: relative;
@@ -2781,7 +2765,7 @@ const Root$q = styled.pre(codeBaseStyle, responsiveCodeFontStyle), Code = forwar
2781
2765
  const size2 = t0 === void 0 ? 2 : t0, language = typeof languageProp == "string" ? languageProp : void 0;
2782
2766
  let t1;
2783
2767
  $[6] !== language ? (t1 = language ? Refractor.hasLanguage(language) : !1, $[6] = language, $[7] = t1) : t1 = $[7];
2784
- const registered = t1, t2 = useArrayProp$1(size2);
2768
+ const registered = t1, t2 = useArrayProp(size2);
2785
2769
  let t3;
2786
2770
  $[8] !== children || $[9] !== language || $[10] !== registered ? (t3 = !(language && registered) && /* @__PURE__ */ jsx("code", { children }), $[8] = children, $[9] = language, $[10] = registered, $[11] = t3) : t3 = $[11];
2787
2771
  let t4;
@@ -2817,7 +2801,7 @@ const Root$p = styled(Box)(containerBaseStyle, responsiveContainerWidthStyle), C
2817
2801
  width: t0,
2818
2802
  ...restProps
2819
2803
  } = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = t0) : (as = $[1], restProps = $[2], t0 = $[3]);
2820
- const t1 = useArrayProp$1(t0 === void 0 ? 2 : t0);
2804
+ const t1 = useArrayProp(t0 === void 0 ? 2 : t0);
2821
2805
  let t2;
2822
2806
  return $[4] !== as || $[5] !== ref || $[6] !== restProps || $[7] !== t1 ? (t2 = /* @__PURE__ */ jsx(Root$p, { "data-ui": "Container", ...restProps, $width: t1, forwardedAs: as, ref }), $[4] = as, $[5] = ref, $[6] = restProps, $[7] = t1, $[8] = t2) : t2 = $[8], t2;
2823
2807
  });
@@ -2838,7 +2822,7 @@ const Root$o = styled(Box)(responsiveGridStyle), Grid = forwardRef(function(prop
2838
2822
  children,
2839
2823
  ...restProps
2840
2824
  } = props, $[0] = props, $[1] = as, $[2] = autoCols, $[3] = autoFlow, $[4] = autoRows, $[5] = children, $[6] = columns, $[7] = gap, $[8] = gapX, $[9] = gapY, $[10] = restProps, $[11] = rows) : (as = $[1], autoCols = $[2], autoFlow = $[3], autoRows = $[4], children = $[5], columns = $[6], gap = $[7], gapX = $[8], gapY = $[9], restProps = $[10], rows = $[11]);
2841
- const t0 = typeof as == "string" ? as : void 0, t1 = useArrayProp$1(autoRows), t2 = useArrayProp$1(autoCols), t3 = useArrayProp$1(autoFlow), t4 = useArrayProp$1(columns), t5 = useArrayProp$1(gap), t6 = useArrayProp$1(gapX), t7 = useArrayProp$1(gapY), t8 = useArrayProp$1(rows);
2825
+ const t0 = typeof as == "string" ? as : void 0, t1 = useArrayProp(autoRows), t2 = useArrayProp(autoCols), t3 = useArrayProp(autoFlow), t4 = useArrayProp(columns), t5 = useArrayProp(gap), t6 = useArrayProp(gapX), t7 = useArrayProp(gapY), t8 = useArrayProp(rows);
2842
2826
  let t9;
2843
2827
  return $[12] !== as || $[13] !== children || $[14] !== ref || $[15] !== restProps || $[16] !== t0 || $[17] !== t1 || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsx(Root$o, { "data-as": t0, "data-ui": "Grid", ...restProps, $autoRows: t1, $autoCols: t2, $autoFlow: t3, $columns: t4, $gap: t5, $gapX: t6, $gapY: t7, $rows: t8, forwardedAs: as, ref, children }), $[12] = as, $[13] = children, $[14] = ref, $[15] = restProps, $[16] = t0, $[17] = t1, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
2844
2828
  });
@@ -2927,7 +2911,7 @@ const Root$n = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsive
2927
2911
  let t32;
2928
2912
  $[9] !== children ? (t32 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t32) : t32 = $[10], children = t32;
2929
2913
  }
2930
- const t3 = useArrayProp$1(align), t4 = useArrayProp$1(size2);
2914
+ const t3 = useArrayProp(align), t4 = useArrayProp(size2);
2931
2915
  let t5;
2932
2916
  $[11] !== children ? (t5 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t5) : t5 = $[12];
2933
2917
  let t6;
@@ -2962,7 +2946,7 @@ function inlineSpaceStyle(props) {
2962
2946
  });
2963
2947
  }
2964
2948
  const Root$m = styled(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = forwardRef(function(props, ref) {
2965
- const $ = c(13);
2949
+ const $ = c(12);
2966
2950
  let as, childrenProp, restProps, space;
2967
2951
  $[0] !== props ? ({
2968
2952
  as,
@@ -2971,17 +2955,15 @@ const Root$m = styled(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = forwardR
2971
2955
  ...restProps
2972
2956
  } = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = restProps, $[4] = space) : (as = $[1], childrenProp = $[2], restProps = $[3], space = $[4]);
2973
2957
  let t0, t1;
2974
- if ($[5] !== childrenProp) {
2975
- let t22;
2976
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t22 = (child) => child && /* @__PURE__ */ jsx("div", { children: child }), $[7] = t22) : t22 = $[7], t1 = Children.map(childrenProp, t22), $[5] = childrenProp, $[6] = t1;
2977
- } else
2978
- t1 = $[6];
2979
- t0 = t1;
2980
- const children = t0, t2 = useArrayProp$1(space);
2958
+ $[5] !== childrenProp ? (t1 = Children.map(childrenProp, _temp$6), $[5] = childrenProp, $[6] = t1) : t1 = $[6], t0 = t1;
2959
+ const children = t0, t2 = useArrayProp(space);
2981
2960
  let t3;
2982
- return $[8] !== as || $[9] !== children || $[10] !== restProps || $[11] !== t2 ? (t3 = /* @__PURE__ */ jsx(Root$m, { "data-ui": "Inline", ...restProps, $space: t2, forwardedAs: as, ref, children }), $[8] = as, $[9] = children, $[10] = restProps, $[11] = t2, $[12] = t3) : t3 = $[12], t3;
2961
+ return $[7] !== as || $[8] !== children || $[9] !== restProps || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(Root$m, { "data-ui": "Inline", ...restProps, $space: t2, forwardedAs: as, ref, children }), $[7] = as, $[8] = children, $[9] = restProps, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
2983
2962
  });
2984
2963
  Inline.displayName = "ForwardRef(Inline)";
2964
+ function _temp$6(child) {
2965
+ return child && /* @__PURE__ */ jsx("div", { children: child });
2966
+ }
2985
2967
  function kbdStyle() {
2986
2968
  return css`
2987
2969
  --card-bg-color: var(--card-kbd-bg-color);
@@ -3009,7 +2991,7 @@ const Root$l = styled.kbd(responsiveRadiusStyle, kbdStyle), KBD = forwardRef(fun
3009
2991
  radius: t2,
3010
2992
  ...restProps
3011
2993
  } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2) : (children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5]);
3012
- const fontSize2 = t0 === void 0 ? 0 : t0, padding = t1 === void 0 ? 1 : t1, t3 = useArrayProp$1(t2 === void 0 ? 2 : t2);
2994
+ const fontSize2 = t0 === void 0 ? 0 : t0, padding = t1 === void 0 ? 1 : t1, t3 = useArrayProp(t2 === void 0 ? 2 : t2);
3013
2995
  let t4;
3014
2996
  $[6] !== children || $[7] !== fontSize2 ? (t4 = /* @__PURE__ */ jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children }), $[6] = children, $[7] = fontSize2, $[8] = t4) : t4 = $[8];
3015
2997
  let t5;
@@ -3397,7 +3379,7 @@ function LayerProvider(props) {
3397
3379
  } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = useContext(LayerContext);
3398
3380
  let t1;
3399
3381
  $[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
3400
- const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = useArrayProp$1(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex];
3382
+ const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = useArrayProp(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex];
3401
3383
  let t2;
3402
3384
  $[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[2] = t2) : t2 = $[2];
3403
3385
  const [, setChildLayers] = useState(t2), [size2, setSize] = useState(0), isTopLayer = size2 === 0;
@@ -3410,13 +3392,13 @@ function LayerProvider(props) {
3410
3392
  [childLevel]: prevLen + 1
3411
3393
  };
3412
3394
  return setSize(Object.keys(nextState).length), nextState;
3413
- }) : setSize((v) => v + 1), () => {
3395
+ }) : setSize(_temp$5), () => {
3414
3396
  childLevel !== void 0 ? setChildLayers((state_0) => {
3415
3397
  const nextState_0 = {
3416
3398
  ...state_0
3417
3399
  };
3418
3400
  return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
3419
- }) : setSize((v_0) => v_0 - 1), parentDispose?.();
3401
+ }) : setSize(_temp2$3), parentDispose?.();
3420
3402
  };
3421
3403
  }, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
3422
3404
  const registerChild = t3;
@@ -3435,6 +3417,12 @@ function LayerProvider(props) {
3435
3417
  let t8;
3436
3418
  return $[16] !== children || $[17] !== value ? (t8 = /* @__PURE__ */ jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t8) : t8 = $[18], t8;
3437
3419
  }
3420
+ function _temp2$3(v_0) {
3421
+ return v_0 - 1;
3422
+ }
3423
+ function _temp$5(v) {
3424
+ return v + 1;
3425
+ }
3438
3426
  LayerProvider.displayName = "LayerProvider";
3439
3427
  const Root$j = styled.div({
3440
3428
  position: "relative"
@@ -3521,8 +3509,9 @@ function PortalProvider(props) {
3521
3509
  const $ = c(7), {
3522
3510
  boundaryElement,
3523
3511
  children,
3524
- element
3525
- } = props, elements = useUnique(props.__unstable_elements), fallbackElement = useSyncExternalStore(emptySubscribe, _temp$3, _temp2$1);
3512
+ element,
3513
+ __unstable_elements: elementsProp
3514
+ } = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(emptySubscribe, _temp$4, _temp2$2);
3526
3515
  let t0;
3527
3516
  const t1 = boundaryElement || null, t2 = element || fallbackElement;
3528
3517
  let t3;
@@ -3536,21 +3525,20 @@ function PortalProvider(props) {
3536
3525
  let t4;
3537
3526
  return $[4] !== children || $[5] !== value ? (t4 = /* @__PURE__ */ jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t4) : t4 = $[6], t4;
3538
3527
  }
3539
- function _temp2$1() {
3528
+ function _temp2$2() {
3540
3529
  return null;
3541
3530
  }
3542
- function _temp$3() {
3531
+ function _temp$4() {
3543
3532
  return document.body;
3544
3533
  }
3545
3534
  PortalProvider.displayName = "PortalProvider";
3546
3535
  const emptySubscribe = () => () => {
3547
3536
  };
3548
3537
  function useUnique(value) {
3549
- const [cachedValue, setCachedValue] = useState(value);
3550
- let result = cachedValue;
3551
- return isEqual(cachedValue, value) || (setCachedValue(value), result = value), result;
3538
+ const valueRef = useRef(value);
3539
+ return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
3552
3540
  }
3553
- function isEqual(objA, objB) {
3541
+ function _isEqual(objA, objB) {
3554
3542
  if (!objA || !objB)
3555
3543
  return objA === objB;
3556
3544
  const keysA = Object.keys(objA), keysB = Object.keys(objB);
@@ -3882,7 +3870,7 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
3882
3870
  zOffset: zOffsetProp = layer.popover.zOffset,
3883
3871
  updateRef,
3884
3872
  ...restProps
3885
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = useArrayProp$1(paddingProp), radius = useArrayProp$1(radiusProp), shadow = useArrayProp$1(shadowProp), widthArrayProp = useArrayProp$1(widthProp), zOffset = useArrayProp$1(zOffsetProp), ref = useRef(null), arrowRef = useRef(null), rootBoundary = "viewport";
3873
+ } = props, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = useRef(null), arrowRef = useRef(null), rootBoundary = "viewport";
3886
3874
  useImperativeHandle(forwardedRef, () => ref.current);
3887
3875
  const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
3888
3876
  container,
@@ -4282,7 +4270,7 @@ const selectStyle = {
4282
4270
  const fontSize2 = t0 === void 0 ? 2 : t0, padding = t1 === void 0 ? 3 : t1, radius = t2 === void 0 ? 2 : t2, space = t3 === void 0 ? 3 : t3, ref = useRef(null);
4283
4271
  let t4;
4284
4272
  $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], useImperativeHandle(forwardedRef, t4), useCustomValidity(ref, customValidity);
4285
- const t5 = !disabled && readOnly ? "" : void 0, t6 = useArrayProp$1(fontSize2), t7 = useArrayProp$1(padding), t8 = useArrayProp$1(radius), t9 = useArrayProp$1(space), t10 = disabled || readOnly;
4273
+ const t5 = !disabled && readOnly ? "" : void 0, t6 = useArrayProp(fontSize2), t7 = useArrayProp(padding), t8 = useArrayProp(radius), t9 = useArrayProp(space), t10 = disabled || readOnly;
4286
4274
  let t11;
4287
4275
  $[11] !== children || $[12] !== restProps || $[13] !== t10 || $[14] !== t5 || $[15] !== t6 || $[16] !== t7 || $[17] !== t8 || $[18] !== t9 ? (t11 = /* @__PURE__ */ jsx(Input$3, { "data-read-only": t5, "data-ui": "Select", ...restProps, $fontSize: t6, $padding: t7, $radius: t8, $space: t9, disabled: t10, ref, children }), $[11] = children, $[12] = restProps, $[13] = t10, $[14] = t5, $[15] = t6, $[16] = t7, $[17] = t8, $[18] = t9, $[19] = t11) : t11 = $[19];
4288
4276
  let t12;
@@ -4328,7 +4316,7 @@ const Root$e = styled(Box)(stackBaseStyle, responsiveStackSpaceStyle), Stack = f
4328
4316
  space,
4329
4317
  ...restProps
4330
4318
  } = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = space) : (as = $[1], restProps = $[2], space = $[3]);
4331
- const t0 = typeof as == "string" ? as : void 0, t1 = useArrayProp$1(space);
4319
+ const t0 = typeof as == "string" ? as : void 0, t1 = useArrayProp(space);
4332
4320
  let t2;
4333
4321
  return $[4] !== as || $[5] !== ref || $[6] !== restProps || $[7] !== t0 || $[8] !== t1 ? (t2 = /* @__PURE__ */ jsx(Root$e, { "data-as": t0, "data-ui": "Stack", ...restProps, $space: t1, forwardedAs: as, ref }), $[4] = as, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2) : t2 = $[9], t2;
4334
4322
  });
@@ -4544,10 +4532,10 @@ const Root$c = styled.span(textInputRootStyle), InputRoot$1 = styled.span`
4544
4532
  const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSize2 = t2 === void 0 ? 2 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, ref = useRef(null), rootTheme = useRootTheme();
4545
4533
  let t5;
4546
4534
  $[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[10] = t5) : t5 = $[10], useImperativeHandle(forwardedRef, t5), useCustomValidity(ref, customValidity);
4547
- const t6 = rootTheme.scheme, t7 = rootTheme.tone, t8 = useArrayProp$1(fontSize2), t9 = useArrayProp$1(padding), t10 = rootTheme.scheme, t11 = useArrayProp$1(0);
4535
+ const t6 = rootTheme.scheme, t7 = rootTheme.tone, t8 = useArrayProp(fontSize2), t9 = useArrayProp(padding), t10 = rootTheme.scheme, t11 = useArrayProp(0);
4548
4536
  let t12;
4549
4537
  $[11] !== disabled || $[12] !== restProps || $[13] !== rootTheme.scheme || $[14] !== rootTheme.tone || $[15] !== t11 || $[16] !== t8 || $[17] !== t9 || $[18] !== weight ? (t12 = /* @__PURE__ */ jsx(Input$1, { "data-as": "textarea", "data-scheme": t6, "data-tone": t7, ...restProps, $fontSize: t8, $padding: t9, $scheme: t10, $space: t11, $tone: rootTheme.tone, $weight: weight, disabled, ref }), $[11] = disabled, $[12] = restProps, $[13] = rootTheme.scheme, $[14] = rootTheme.tone, $[15] = t11, $[16] = t8, $[17] = t9, $[18] = weight, $[19] = t12) : t12 = $[19];
4550
- const t13 = useArrayProp$1(radius), t14 = border2 ? "" : void 0;
4538
+ const t13 = useArrayProp(radius), t14 = border2 ? "" : void 0;
4551
4539
  let t15;
4552
4540
  $[20] !== __unstable_disableFocusRing || $[21] !== rootTheme.scheme || $[22] !== rootTheme.tone || $[23] !== t13 || $[24] !== t14 ? (t15 = /* @__PURE__ */ jsx(Presentation$1, { $radius: t13, $unstableDisableFocusRing: __unstable_disableFocusRing, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": t14, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone }), $[20] = __unstable_disableFocusRing, $[21] = rootTheme.scheme, $[22] = rootTheme.tone, $[23] = t13, $[24] = t14, $[25] = t15) : t15 = $[25];
4553
4541
  let t16;
@@ -4604,7 +4592,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
4604
4592
  display: "block"
4605
4593
  }
4606
4594
  }), TextInput = forwardRef(function(props, forwardedRef) {
4607
- const $ = c(86);
4595
+ const $ = c(84);
4608
4596
  let IconComponent, IconRightComponent, __unstable_disableFocusRing, clearButton, customValidity, onClear, prefix, readOnly, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, weight;
4609
4597
  $[0] !== props ? ({
4610
4598
  __unstable_disableFocusRing,
@@ -4626,10 +4614,10 @@ const CLEAR_BUTTON_BOX_STYLE = {
4626
4614
  weight,
4627
4615
  ...restProps
4628
4616
  } = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = clearButton, $[5] = customValidity, $[6] = onClear, $[7] = prefix, $[8] = readOnly, $[9] = restProps, $[10] = suffix, $[11] = t0, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5, $[17] = t6, $[18] = weight) : (IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], clearButton = $[4], customValidity = $[5], onClear = $[6], prefix = $[7], readOnly = $[8], restProps = $[9], suffix = $[10], t0 = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16], t6 = $[17], weight = $[18]);
4629
- const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = useRef(null), rootTheme = useRootTheme(), fontSize2 = useArrayProp$1(fontSizeProp), padding = useArrayProp$1(paddingProp), radius = useArrayProp$1(radiusProp), space = useArrayProp$1(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
4617
+ const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = useRef(null), rootTheme = useRootTheme(), fontSize2 = useArrayProp(fontSizeProp), padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
4630
4618
  let t7;
4631
4619
  $[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
4632
- const handleClearMouseDown = _temp$2;
4620
+ const handleClearMouseDown = _temp$3;
4633
4621
  let t8;
4634
4622
  $[20] !== onClear ? (t8 = (event_0) => {
4635
4623
  event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
@@ -4657,49 +4645,45 @@ const CLEAR_BUTTON_BOX_STYLE = {
4657
4645
  ] }), $[34] = $hasPrefix, $[35] = $hasSuffix, $[36] = __unstable_disableFocusRing, $[37] = radius, $[38] = rootTheme.scheme, $[39] = rootTheme.tone, $[40] = t12, $[41] = t13, $[42] = t14, $[43] = t15) : t15 = $[43], t11 = t15;
4658
4646
  const presentationNode = t11;
4659
4647
  let t16, t17;
4660
- if ($[44] !== padding) {
4661
- let t182;
4662
- $[46] === Symbol.for("react.memo_cache_sentinel") ? (t182 = (v) => v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2, $[46] = t182) : t182 = $[46], t17 = padding.map(t182), $[44] = padding, $[45] = t17;
4663
- } else
4664
- t17 = $[45];
4665
- t16 = t17;
4648
+ $[44] !== padding ? (t17 = padding.map(_temp2$1), $[44] = padding, $[45] = t17) : t17 = $[45], t16 = t17;
4666
4649
  const clearButtonBoxPadding = t16;
4667
4650
  let t18, t19;
4668
- if ($[47] !== padding) {
4669
- let t202;
4670
- $[49] === Symbol.for("react.memo_cache_sentinel") ? (t202 = (v_0) => v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1, $[49] = t202) : t202 = $[49], t19 = padding.map(t202), $[47] = padding, $[48] = t19;
4671
- } else
4672
- t19 = $[48];
4673
- t18 = t19;
4651
+ $[46] !== padding ? (t19 = padding.map(_temp3), $[46] = padding, $[47] = t19) : t19 = $[47], t18 = t19;
4674
4652
  const clearButtonPadding = t18;
4675
4653
  let t20;
4676
4654
  t20 = typeof clearButton == "object" ? clearButton : EMPTY_RECORD;
4677
4655
  const clearButtonProps = t20;
4678
4656
  let t21, t22;
4679
- $[50] !== clearButton || $[51] !== clearButtonBoxPadding || $[52] !== clearButtonPadding || $[53] !== clearButtonProps || $[54] !== customValidity || $[55] !== disabled || $[56] !== fontSize2 || $[57] !== handleClearClick || $[58] !== radius || $[59] !== readOnly ? (t22 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(RightCard, { forwardedAs: "span", padding: clearButtonBoxPadding, style: CLEAR_BUTTON_BOX_STYLE, tone: customValidity ? "critical" : "inherit", children: /* @__PURE__ */ jsx(TextInputClearButton, { "aria-label": "Clear", "data-qa": "clear-button", fontSize: fontSize2, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[50] = clearButton, $[51] = clearButtonBoxPadding, $[52] = clearButtonPadding, $[53] = clearButtonProps, $[54] = customValidity, $[55] = disabled, $[56] = fontSize2, $[57] = handleClearClick, $[58] = radius, $[59] = readOnly, $[60] = t22) : t22 = $[60], t21 = t22;
4657
+ $[48] !== clearButton || $[49] !== clearButtonBoxPadding || $[50] !== clearButtonPadding || $[51] !== clearButtonProps || $[52] !== customValidity || $[53] !== disabled || $[54] !== fontSize2 || $[55] !== handleClearClick || $[56] !== radius || $[57] !== readOnly ? (t22 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(RightCard, { forwardedAs: "span", padding: clearButtonBoxPadding, style: CLEAR_BUTTON_BOX_STYLE, tone: customValidity ? "critical" : "inherit", children: /* @__PURE__ */ jsx(TextInputClearButton, { "aria-label": "Clear", "data-qa": "clear-button", fontSize: fontSize2, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[48] = clearButton, $[49] = clearButtonBoxPadding, $[50] = clearButtonPadding, $[51] = clearButtonProps, $[52] = customValidity, $[53] = disabled, $[54] = fontSize2, $[55] = handleClearClick, $[56] = radius, $[57] = readOnly, $[58] = t22) : t22 = $[58], t21 = t22;
4680
4658
  const clearButtonNode = t21;
4681
4659
  let t23, t24;
4682
- $[61] !== radius || $[62] !== suffix ? (t24 = suffix && /* @__PURE__ */ jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[61] = radius, $[62] = suffix, $[63] = t24) : t24 = $[63], t23 = t24;
4660
+ $[59] !== radius || $[60] !== suffix ? (t24 = suffix && /* @__PURE__ */ jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[59] = radius, $[60] = suffix, $[61] = t24) : t24 = $[61], t23 = t24;
4683
4661
  const suffixNode = t23, t25 = $hasIconRight || $hasClearButton;
4684
4662
  let t26;
4685
- $[64] !== $hasIcon || $[65] !== disabled || $[66] !== fontSize2 || $[67] !== padding || $[68] !== readOnly || $[69] !== restProps || $[70] !== rootTheme.scheme || $[71] !== rootTheme.tone || $[72] !== space || $[73] !== t25 || $[74] !== type || $[75] !== weight ? (t26 = /* @__PURE__ */ jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: t25, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }), $[64] = $hasIcon, $[65] = disabled, $[66] = fontSize2, $[67] = padding, $[68] = readOnly, $[69] = restProps, $[70] = rootTheme.scheme, $[71] = rootTheme.tone, $[72] = space, $[73] = t25, $[74] = type, $[75] = weight, $[76] = t26) : t26 = $[76];
4663
+ $[62] !== $hasIcon || $[63] !== disabled || $[64] !== fontSize2 || $[65] !== padding || $[66] !== readOnly || $[67] !== restProps || $[68] !== rootTheme.scheme || $[69] !== rootTheme.tone || $[70] !== space || $[71] !== t25 || $[72] !== type || $[73] !== weight ? (t26 = /* @__PURE__ */ jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: t25, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }), $[62] = $hasIcon, $[63] = disabled, $[64] = fontSize2, $[65] = padding, $[66] = readOnly, $[67] = restProps, $[68] = rootTheme.scheme, $[69] = rootTheme.tone, $[70] = space, $[71] = t25, $[72] = type, $[73] = weight, $[74] = t26) : t26 = $[74];
4686
4664
  let t27;
4687
- $[77] !== clearButtonNode || $[78] !== presentationNode || $[79] !== t26 ? (t27 = /* @__PURE__ */ jsxs(InputRoot, { children: [
4665
+ $[75] !== clearButtonNode || $[76] !== presentationNode || $[77] !== t26 ? (t27 = /* @__PURE__ */ jsxs(InputRoot, { children: [
4688
4666
  t26,
4689
4667
  presentationNode,
4690
4668
  clearButtonNode
4691
- ] }), $[77] = clearButtonNode, $[78] = presentationNode, $[79] = t26, $[80] = t27) : t27 = $[80];
4669
+ ] }), $[75] = clearButtonNode, $[76] = presentationNode, $[77] = t26, $[78] = t27) : t27 = $[78];
4692
4670
  let t28;
4693
- return $[81] !== prefixNode || $[82] !== rootTheme.tone || $[83] !== suffixNode || $[84] !== t27 ? (t28 = /* @__PURE__ */ jsxs(Root$b, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
4671
+ return $[79] !== prefixNode || $[80] !== rootTheme.tone || $[81] !== suffixNode || $[82] !== t27 ? (t28 = /* @__PURE__ */ jsxs(Root$b, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
4694
4672
  prefixNode,
4695
4673
  t27,
4696
4674
  suffixNode
4697
- ] }), $[81] = prefixNode, $[82] = rootTheme.tone, $[83] = suffixNode, $[84] = t27, $[85] = t28) : t28 = $[85], t28;
4675
+ ] }), $[79] = prefixNode, $[80] = rootTheme.tone, $[81] = suffixNode, $[82] = t27, $[83] = t28) : t28 = $[83], t28;
4698
4676
  });
4699
4677
  TextInput.displayName = "ForwardRef(TextInput)";
4700
- function _temp$2(event) {
4678
+ function _temp$3(event) {
4701
4679
  event.preventDefault(), event.stopPropagation();
4702
4680
  }
4681
+ function _temp2$1(v) {
4682
+ return v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2;
4683
+ }
4684
+ function _temp3(v_0) {
4685
+ return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1;
4686
+ }
4703
4687
  function useDelayedState(initialState) {
4704
4688
  const $ = c(3), [state, setState] = useState(initialState), delayedAction = useRef();
4705
4689
  let t0;
@@ -4831,7 +4815,7 @@ const Root$a = styled(Layer)`
4831
4815
  zOffset = layer.tooltip.zOffset,
4832
4816
  delay,
4833
4817
  ...restProps
4834
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp$1(fallbackPlacementsProp), ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
4818
+ } = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
4835
4819
  useImperativeHandle(forwardedRef, () => ref.current);
4836
4820
  const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, middleware = useMemo(() => {
4837
4821
  const ret = [];
@@ -5083,7 +5067,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
5083
5067
  value: value_0
5084
5068
  }) => /* @__PURE__ */ jsx(Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", children: value_0 }) }), [fontSize2, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
5085
5069
  useImperativeHandle(forwardedRef, () => inputElementRef.current);
5086
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp$1(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = useCallback((event) => {
5070
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = useCallback((event) => {
5087
5071
  setTimeout(() => {
5088
5072
  if (popoverMouseWithinRef.current)
5089
5073
  return;
@@ -5249,7 +5233,7 @@ const Autocomplete = InnerAutocomplete, Root$8 = styled.ol`
5249
5233
  separator,
5250
5234
  space: spaceRaw = 2,
5251
5235
  ...restProps
5252
- } = props, space = useArrayProp$1(spaceRaw), [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
5236
+ } = props, space = useArrayProp(spaceRaw), [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
5253
5237
  useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
5254
5238
  const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
5255
5239
  const len = rawItems.length;
@@ -5381,7 +5365,7 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
5381
5365
  scheme,
5382
5366
  shadow: shadowProp,
5383
5367
  width: widthProp
5384
- } = props, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, radius = useArrayProp$1(radiusProp), shadow = useArrayProp$1(shadowProp), width = useArrayProp$1(widthProp), ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
5368
+ } = props, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), width = useArrayProp(widthProp), ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
5385
5369
  isTopLayer
5386
5370
  } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
5387
5371
  let t0;
@@ -5455,7 +5439,7 @@ const Dialog = forwardRef(function(props, ref) {
5455
5439
  animate: t6,
5456
5440
  ...restProps
5457
5441
  } = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = contentRef, $[5] = footer, $[6] = header, $[7] = id, $[8] = onActivate, $[9] = onClickOutside, $[10] = onClose, $[11] = onFocus, $[12] = portalProp, $[13] = restProps, $[14] = scheme, $[15] = t0, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], contentRef = $[4], footer = $[5], header = $[6], id = $[7], onActivate = $[8], onClickOutside = $[9], onClose = $[10], onFocus = $[11], portalProp = $[12], restProps = $[13], scheme = $[14], t0 = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21]);
5458
- const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 === void 0 ? !1 : t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp$1(cardRadiusProp), padding = useArrayProp$1(paddingProp), position = useArrayProp$1(positionProp), width = useArrayProp$1(widthProp), zOffset = useArrayProp$1(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
5442
+ const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 === void 0 ? !1 : t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), padding = useArrayProp(paddingProp), position = useArrayProp(positionProp), width = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
5459
5443
  let t7;
5460
5444
  $[22] !== onFocus ? (t7 = (event) => {
5461
5445
  onFocus?.(event);
@@ -5542,7 +5526,7 @@ const Root$6 = styled.kbd`
5542
5526
  space: t0,
5543
5527
  ...restProps
5544
5528
  } = props, $[0] = props, $[1] = fontSize2, $[2] = keys, $[3] = padding, $[4] = radius, $[5] = restProps, $[6] = t0) : (fontSize2 = $[1], keys = $[2], padding = $[3], radius = $[4], restProps = $[5], t0 = $[6]);
5545
- const space = useArrayProp$1(t0 === void 0 ? 0.5 : t0);
5529
+ const space = useArrayProp(t0 === void 0 ? 0.5 : t0);
5546
5530
  if (!keys || keys.length === 0) {
5547
5531
  let t12;
5548
5532
  return $[7] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx(Fragment, {}), $[7] = t12) : t12 = $[7], t12;
@@ -5816,7 +5800,7 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
5816
5800
  }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
5817
5801
  let t9;
5818
5802
  $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
5819
- setOpen((v) => !v), setShouldFocus(null);
5803
+ setOpen(_temp$2), setShouldFocus(null);
5820
5804
  }, $[12] = t9) : t9 = $[12];
5821
5805
  const handleButtonClick = t9;
5822
5806
  let t10;
@@ -5918,6 +5902,9 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
5918
5902
  return $[57] !== menu || $[58] !== open || $[59] !== popoverProps || $[60] !== t25 ? (t26 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t25 }), $[57] = menu, $[58] = open, $[59] = popoverProps, $[60] = t25, $[61] = t26) : t26 = $[61], t26;
5919
5903
  });
5920
5904
  MenuButton.displayName = "ForwardRef(MenuButton)";
5905
+ function _temp$2(v) {
5906
+ return !v;
5907
+ }
5921
5908
  const MenuDivider = styled.hr`
5922
5909
  height: 1px;
5923
5910
  border: 0;
@@ -6116,7 +6103,7 @@ function MenuGroup(props) {
6116
6103
  return;
6117
6104
  }
6118
6105
  }, $[43] = t20) : t20 = $[43];
6119
- const handleKeyDown = t20, t21 = as === "button" ? withinMenu : void 0, t22 = as !== "button" ? withinMenu : void 0, t23 = !withinMenu && active ? "" : void 0, t24 = useArrayProp$1(radius), t25 = as === "button" ? "button" : void 0;
6106
+ const handleKeyDown = t20, t21 = as === "button" ? withinMenu : void 0, t22 = as !== "button" ? withinMenu : void 0, t23 = !withinMenu && active ? "" : void 0, t24 = useArrayProp(radius), t25 = as === "button" ? "button" : void 0;
6120
6107
  let t26;
6121
6108
  $[44] !== IconComponent || $[45] !== fontSize2 ? (t26 = IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6122
6109
  isValidElement(IconComponent) && IconComponent,
@@ -6195,7 +6182,7 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
6195
6182
  paddingBottom,
6196
6183
  paddingLeft
6197
6184
  }, $[33] = padding, $[34] = paddingBottom, $[35] = paddingLeft, $[36] = paddingRight, $[37] = paddingTop, $[38] = paddingX, $[39] = paddingY, $[40] = t11) : t11 = $[40], t10 = t11;
6198
- const paddingProps = t10, t12 = useArrayProp$1(fontSize2);
6185
+ const paddingProps = t10, t12 = useArrayProp(fontSize2);
6199
6186
  let t13;
6200
6187
  $[41] !== t12 ? (t13 = t12.map(_temp$1), $[41] = t12, $[42] = t13) : t13 = $[42];
6201
6188
  const hotkeysFontSize = t13;
@@ -6203,7 +6190,7 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
6203
6190
  $[43] === Symbol.for("react.memo_cache_sentinel") ? (t14 = (el) => {
6204
6191
  ref.current = el, setRootElement(el);
6205
6192
  }, $[43] = t14) : t14 = $[43];
6206
- const setRef = t14, t15 = as === "button" && pressed, t16 = as !== "button" && pressed ? "" : void 0, t17 = active ? "" : void 0, t18 = disabled ? "" : void 0, t19 = useArrayProp$1(radius), t20 = useArrayProp$1(0), t21 = disabled ? "default" : tone, t22 = as === "button" ? "button" : void 0;
6193
+ const setRef = t14, t15 = as === "button" && pressed, t16 = as !== "button" && pressed ? "" : void 0, t17 = active ? "" : void 0, t18 = disabled ? "" : void 0, t19 = useArrayProp(radius), t20 = useArrayProp(0), t21 = disabled ? "default" : tone, t22 = as === "button" ? "button" : void 0;
6207
6194
  let t23;
6208
6195
  $[44] !== IconComponent || $[45] !== IconRightComponent || $[46] !== fontSize2 || $[47] !== hotkeys || $[48] !== hotkeysFontSize || $[49] !== paddingProps || $[50] !== space || $[51] !== text ? (t23 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
6209
6196
  IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
@@ -6293,7 +6280,7 @@ const keyframe = keyframes`
6293
6280
  clearTimeout(timeout);
6294
6281
  };
6295
6282
  }, t2 = [delay], $[5] = delay, $[6] = t1, $[7] = t2) : (t1 = $[6], t2 = $[7]), useEffect(t1, t2);
6296
- const t3 = useArrayProp$1(radius);
6283
+ const t3 = useArrayProp(radius);
6297
6284
  let t4;
6298
6285
  return $[8] !== animated || $[9] !== ref || $[10] !== restProps || $[11] !== t3 || $[12] !== visible ? (t4 = /* @__PURE__ */ jsx(Root$4, { ...restProps, $animated: animated, $radius: t3, $visible: visible, ref }), $[8] = animated, $[9] = ref, $[10] = restProps, $[11] = t3, $[12] = visible, $[13] = t4) : t4 = $[13], t4;
6299
6286
  });
@@ -6319,7 +6306,7 @@ const Root$3 = styled(Skeleton)((props) => {
6319
6306
  size: t0,
6320
6307
  ...restProps
6321
6308
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
6322
- const $size = useArrayProp$1(t0 === void 0 ? 2 : t0);
6309
+ const $size = useArrayProp(t0 === void 0 ? 2 : t0);
6323
6310
  let t1;
6324
6311
  return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "text" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
6325
6312
  });
@@ -6331,7 +6318,7 @@ const LabelSkeleton = forwardRef(function(props, ref) {
6331
6318
  size: t0,
6332
6319
  ...restProps
6333
6320
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
6334
- const $size = useArrayProp$1(t0 === void 0 ? 2 : t0);
6321
+ const $size = useArrayProp(t0 === void 0 ? 2 : t0);
6335
6322
  let t1;
6336
6323
  return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "label" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
6337
6324
  });
@@ -6343,7 +6330,7 @@ const HeadingSkeleton = forwardRef(function(props, ref) {
6343
6330
  size: t0,
6344
6331
  ...restProps
6345
6332
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
6346
- const $size = useArrayProp$1(t0 === void 0 ? 2 : t0);
6333
+ const $size = useArrayProp(t0 === void 0 ? 2 : t0);
6347
6334
  let t1;
6348
6335
  return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "heading" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
6349
6336
  });
@@ -6355,7 +6342,7 @@ const CodeSkeleton = forwardRef(function(props, ref) {
6355
6342
  size: t0,
6356
6343
  ...restProps
6357
6344
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
6358
- const $size = useArrayProp$1(t0 === void 0 ? 2 : t0);
6345
+ const $size = useArrayProp(t0 === void 0 ? 2 : t0);
6359
6346
  let t1;
6360
6347
  return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "code" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
6361
6348
  });