@sanity/ui 2.8.24-canary.2 → 2.8.25

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