@sanity/ui 2.8.24-canary.0 → 2.8.24-canary.2

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