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