@sanity/ui 2.8.17 → 2.8.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -204,7 +204,7 @@ function useClickOutside(listener, t0, boundaryElement) {
204
204
  }, t5 = [boundaryElement, listener, elements], $[7] = listener, $[8] = boundaryElement, $[9] = elements, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), react.useEffect(t4, t5), setElement;
205
205
  }
206
206
  function useClickOutsideEvent(listener, t0, boundaryElement) {
207
- const $ = reactCompilerRuntime.c(8), elementsArg = t0 === void 0 ? _temp$5 : t0;
207
+ const $ = reactCompilerRuntime.c(8), elementsArg = t0 === void 0 ? _temp$6 : t0;
208
208
  let t1;
209
209
  $[0] !== listener || $[1] !== boundaryElement || $[2] !== elementsArg ? (t1 = (evt) => {
210
210
  if (!listener)
@@ -232,7 +232,7 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
232
232
  };
233
233
  }, 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");
234
234
  }
235
- function _temp$5() {
235
+ function _temp$6() {
236
236
  return EMPTY_ARRAY;
237
237
  }
238
238
  function useCustomValidity(ref, customValidity) {
@@ -619,18 +619,42 @@ function createGlobalScopedContext(key2, defaultValue) {
619
619
  }
620
620
  const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
621
621
  function ThemeProvider(props) {
622
- const parentTheme = react.useContext(ThemeContext), {
623
- children,
624
- scheme = parentTheme?.scheme || "light",
625
- theme: rootTheme = parentTheme?.theme || null,
626
- tone = parentTheme?.tone || "default"
627
- } = props, themeContext = react.useMemo(() => rootTheme ? {
628
- version: 0,
629
- theme: rootTheme,
630
- scheme,
631
- tone
632
- } : null, [rootTheme, scheme, tone]), theme$1 = react.useMemo(() => rootTheme ? theme.getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
633
- return theme$1 ? /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsxRuntime.jsx(styledComponents.ThemeProvider, { theme: theme$1, children }) }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
622
+ const $ = reactCompilerRuntime.c(15), parentTheme = react.useContext(ThemeContext), {
623
+ children
624
+ } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
625
+ let t0;
626
+ bb0: {
627
+ if (!rootTheme) {
628
+ t0 = null;
629
+ break bb0;
630
+ }
631
+ let t12;
632
+ $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
633
+ version: 0,
634
+ theme: rootTheme,
635
+ scheme,
636
+ tone
637
+ }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
638
+ }
639
+ const themeContext = t0;
640
+ let t1;
641
+ bb1: {
642
+ if (!rootTheme) {
643
+ t1 = null;
644
+ break bb1;
645
+ }
646
+ let t22;
647
+ $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = theme.getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
648
+ }
649
+ const theme$1 = t1;
650
+ if (!theme$1) {
651
+ let t22;
652
+ return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
653
+ }
654
+ let t2;
655
+ $[9] !== theme$1 || $[10] !== children ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(styledComponents.ThemeProvider, { theme: theme$1, children }), $[9] = theme$1, $[10] = children, $[11] = t2) : t2 = $[11];
656
+ let t3;
657
+ return $[12] !== themeContext || $[13] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = themeContext, $[13] = t2, $[14] = t3) : t3 = $[14], t3;
634
658
  }
635
659
  ThemeProvider.displayName = "ThemeProvider";
636
660
  function useRootTheme() {
@@ -715,15 +739,15 @@ function useMediaIndex() {
715
739
  return react.useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
716
740
  }
717
741
  function usePrefersDark(t0) {
718
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$4 : t0);
742
+ return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$5 : t0);
719
743
  }
720
- function _temp$4() {
744
+ function _temp$5() {
721
745
  return !1;
722
746
  }
723
747
  function usePrefersReducedMotion(t0) {
724
- return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$3 : t0);
748
+ return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$4 : t0);
725
749
  }
726
- function _temp$3() {
750
+ function _temp$4() {
727
751
  return !1;
728
752
  }
729
753
  function responsiveBorderStyle() {
@@ -3442,7 +3466,7 @@ function PortalProvider(props) {
3442
3466
  children,
3443
3467
  element,
3444
3468
  __unstable_elements: elementsProp
3445
- } = props, elements = useUnique(elementsProp), fallbackElement = react.useSyncExternalStore(emptySubscribe, _temp$2, _temp2$1);
3469
+ } = props, elements = useUnique(elementsProp), fallbackElement = react.useSyncExternalStore(emptySubscribe, _temp$3, _temp2$1);
3446
3470
  let t0;
3447
3471
  const t1 = boundaryElement || null, t2 = element || fallbackElement;
3448
3472
  let t3;
@@ -3459,7 +3483,7 @@ function PortalProvider(props) {
3459
3483
  function _temp2$1() {
3460
3484
  return null;
3461
3485
  }
3462
- function _temp$2() {
3486
+ function _temp$3() {
3463
3487
  return document.body;
3464
3488
  }
3465
3489
  PortalProvider.displayName = "PortalProvider";
@@ -4548,7 +4572,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
4548
4572
  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;
4549
4573
  let t7;
4550
4574
  $[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], react.useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
4551
- const handleClearMouseDown = _temp$1;
4575
+ const handleClearMouseDown = _temp$2;
4552
4576
  let t8;
4553
4577
  $[20] !== onClear ? (t8 = (event_0) => {
4554
4578
  event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
@@ -4616,7 +4640,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
4616
4640
  ] }), $[81] = rootTheme.tone, $[82] = prefixNode, $[83] = t27, $[84] = suffixNode, $[85] = t28) : t28 = $[85], t28;
4617
4641
  });
4618
4642
  TextInput.displayName = "ForwardRef(TextInput)";
4619
- function _temp$1(event) {
4643
+ function _temp$2(event) {
4620
4644
  event.preventDefault(), event.stopPropagation();
4621
4645
  }
4622
4646
  function useDelayedState(initialState) {
@@ -5347,13 +5371,15 @@ const Root$7 = styledComponents.styled(Layer)(responsivePaddingStyle, dialogStyl
5347
5371
  });
5348
5372
  DialogCard.displayName = "ForwardRef(DialogCard)";
5349
5373
  const Dialog = react.forwardRef(function(props, ref) {
5350
- const dialog = useDialog(), {
5374
+ const $ = reactCompilerRuntime.c(60), dialog = useDialog(), {
5351
5375
  layer
5352
- } = useTheme_v2(), {
5353
- __unstable_autoFocus: autoFocus = !0,
5354
- __unstable_hideCloseButton: hideCloseButton = !1,
5355
- cardRadius: cardRadiusProp = 4,
5356
- cardShadow = 3,
5376
+ } = useTheme_v2();
5377
+ let t0, t1, t2, t3, t4, t5, t6, _positionProp, _zOffsetProp, portalProp, onFocus, id, contentRef, footer, header, onClickOutside, onClose, scheme, children, restProps, onActivate;
5378
+ $[0] !== props ? ({
5379
+ __unstable_autoFocus: t0,
5380
+ __unstable_hideCloseButton: t1,
5381
+ cardRadius: t2,
5382
+ cardShadow: t3,
5357
5383
  children,
5358
5384
  contentRef,
5359
5385
  footer,
@@ -5363,15 +5389,18 @@ const Dialog = react.forwardRef(function(props, ref) {
5363
5389
  onClickOutside,
5364
5390
  onClose,
5365
5391
  onFocus,
5366
- padding: paddingProp = 3,
5392
+ padding: t4,
5367
5393
  portal: portalProp,
5368
- position: positionProp = dialog.position || "fixed",
5394
+ position: _positionProp,
5369
5395
  scheme,
5370
- width: widthProp = 0,
5371
- zOffset: zOffsetProp = dialog.zOffset || layer.dialog.zOffset,
5372
- animate: _animate = !1,
5396
+ width: t5,
5397
+ zOffset: _zOffsetProp,
5398
+ animate: t6,
5373
5399
  ...restProps
5374
- } = props, 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), handleFocus = react.useCallback((event) => {
5400
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = t6, $[8] = _positionProp, $[9] = _zOffsetProp, $[10] = portalProp, $[11] = onFocus, $[12] = id, $[13] = contentRef, $[14] = footer, $[15] = header, $[16] = onClickOutside, $[17] = onClose, $[18] = scheme, $[19] = children, $[20] = restProps, $[21] = onActivate) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], t6 = $[7], _positionProp = $[8], _zOffsetProp = $[9], portalProp = $[10], onFocus = $[11], id = $[12], contentRef = $[13], footer = $[14], header = $[15], onClickOutside = $[16], onClose = $[17], scheme = $[18], children = $[19], restProps = $[20], onActivate = $[21]);
5401
+ 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);
5402
+ let t7;
5403
+ $[22] !== onFocus ? (t7 = (event) => {
5375
5404
  onFocus?.(event);
5376
5405
  const target = event.target, cardElement = cardRef.current;
5377
5406
  if (cardElement && target === preDivRef.current) {
@@ -5383,7 +5412,10 @@ const Dialog = react.forwardRef(function(props, ref) {
5383
5412
  return;
5384
5413
  }
5385
5414
  isHTMLElement(event.target) && (focusedElementRef.current = event.target);
5386
- }, [onFocus]), labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(), handleRootClick = react.useCallback(() => {
5415
+ }, $[22] = onFocus, $[23] = t7) : t7 = $[23];
5416
+ const handleFocus = t7, labelId = `${id}_label`, rootClickTimeoutRef = react.useRef();
5417
+ let t8;
5418
+ $[24] !== boundaryElement || $[25] !== portalElement ? (t8 = () => {
5387
5419
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
5388
5420
  const activeElement = document.activeElement;
5389
5421
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
@@ -5396,12 +5428,22 @@ const Dialog = react.forwardRef(function(props, ref) {
5396
5428
  target_0.focus();
5397
5429
  }
5398
5430
  }, 0);
5399
- }, [boundaryElement, portalElement]);
5400
- return /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: portalProp, children: /* @__PURE__ */ jsxRuntime.jsxs(Root$7, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
5401
- /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }),
5402
- /* @__PURE__ */ jsxRuntime.jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, width, children }),
5403
- /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 })
5404
- ] }) });
5431
+ }, $[24] = boundaryElement, $[25] = portalElement, $[26] = t8) : t8 = $[26];
5432
+ const handleRootClick = t8;
5433
+ let t9;
5434
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }), $[27] = t9) : t9 = $[27];
5435
+ let t10;
5436
+ $[28] !== autoFocus || $[29] !== hideCloseButton || $[30] !== contentRef || $[31] !== footer || $[32] !== header || $[33] !== id || $[34] !== onClickOutside || $[35] !== onClose || $[36] !== portalProp || $[37] !== cardRadius || $[38] !== scheme || $[39] !== cardShadow || $[40] !== width || $[41] !== children ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, width, children }), $[28] = autoFocus, $[29] = hideCloseButton, $[30] = contentRef, $[31] = footer, $[32] = header, $[33] = id, $[34] = onClickOutside, $[35] = onClose, $[36] = portalProp, $[37] = cardRadius, $[38] = scheme, $[39] = cardShadow, $[40] = width, $[41] = children, $[42] = t10) : t10 = $[42];
5437
+ let t11;
5438
+ $[43] === Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 }), $[43] = t11) : t11 = $[43];
5439
+ let t12;
5440
+ $[44] !== restProps || $[45] !== animate || $[46] !== padding || $[47] !== position || $[48] !== labelId || $[49] !== id || $[50] !== onActivate || $[51] !== handleRootClick || $[52] !== handleFocus || $[53] !== ref || $[54] !== zOffset || $[55] !== t10 ? (t12 = /* @__PURE__ */ jsxRuntime.jsxs(Root$7, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
5441
+ t9,
5442
+ t10,
5443
+ t11
5444
+ ] }), $[44] = restProps, $[45] = animate, $[46] = padding, $[47] = position, $[48] = labelId, $[49] = id, $[50] = onActivate, $[51] = handleRootClick, $[52] = handleFocus, $[53] = ref, $[54] = zOffset, $[55] = t10, $[56] = t12) : t12 = $[56];
5445
+ let t13;
5446
+ return $[57] !== portalProp || $[58] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: portalProp, children: t12 }), $[57] = portalProp, $[58] = t12, $[59] = t13) : t13 = $[59], t13;
5405
5447
  });
5406
5448
  Dialog.displayName = "ForwardRef(Dialog)";
5407
5449
  function DialogProvider(props) {
@@ -5602,48 +5644,66 @@ const Root$5 = styledComponents.styled(Box)`
5602
5644
  outline: none;
5603
5645
  overflow: auto;
5604
5646
  `, Menu = react.forwardRef(function(props, forwardedRef) {
5647
+ const $ = reactCompilerRuntime.c(50);
5648
+ let t0, t1, _shouldFocus, onKeyDown, originElement, registerElement, onItemSelect, onClickOutside, onEscape, onItemClick, children, restProps;
5649
+ if ($[0] !== props) {
5650
+ const {
5651
+ children: t22,
5652
+ focusFirst,
5653
+ focusLast,
5654
+ onClickOutside: t32,
5655
+ onEscape: t42,
5656
+ onItemClick: t52,
5657
+ onItemSelect: t62,
5658
+ onKeyDown: t72,
5659
+ originElement: t82,
5660
+ padding: t92,
5661
+ registerElement: t102,
5662
+ shouldFocus: t112,
5663
+ space: t122,
5664
+ ...t132
5665
+ } = props;
5666
+ children = t22, onClickOutside = t32, onEscape = t42, onItemClick = t52, onItemSelect = t62, onKeyDown = t72, originElement = t82, t0 = t92, registerElement = t102, _shouldFocus = t112, t1 = t122, restProps = t132, $[0] = props, $[1] = t0, $[2] = t1, $[3] = _shouldFocus, $[4] = onKeyDown, $[5] = originElement, $[6] = registerElement, $[7] = onItemSelect, $[8] = onClickOutside, $[9] = onEscape, $[10] = onItemClick, $[11] = children, $[12] = restProps;
5667
+ } else
5668
+ t0 = $[1], t1 = $[2], _shouldFocus = $[3], onKeyDown = $[4], originElement = $[5], registerElement = $[6], onItemSelect = $[7], onClickOutside = $[8], onEscape = $[9], onItemClick = $[10], children = $[11], restProps = $[12];
5669
+ const padding = t0 === void 0 ? 1 : t0, space = t1 === void 0 ? 1 : t1, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = react.useRef(null);
5670
+ let t2;
5671
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[13] = t2) : t2 = $[13], react.useImperativeHandle(forwardedRef, t2);
5605
5672
  const {
5606
- children,
5607
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5608
- focusFirst,
5609
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5610
- focusLast,
5611
- onClickOutside,
5612
- onEscape,
5613
- onItemClick,
5614
- onItemSelect,
5673
+ isTopLayer
5674
+ } = useLayer();
5675
+ let t3;
5676
+ $[14] !== onKeyDown || $[15] !== originElement || $[16] !== shouldFocus ? (t3 = {
5615
5677
  onKeyDown,
5616
5678
  originElement,
5617
- padding = 1,
5618
- registerElement,
5619
- shouldFocus = props.focusFirst && "first" || props.focusLast && "last" || null,
5620
- space = 1,
5621
- ...restProps
5622
- } = props, ref = react.useRef(null);
5623
- react.useImperativeHandle(forwardedRef, () => ref.current);
5679
+ shouldFocus,
5680
+ rootElementRef: ref
5681
+ }, $[14] = onKeyDown, $[15] = originElement, $[16] = shouldFocus, $[17] = t3) : t3 = $[17];
5624
5682
  const {
5625
- isTopLayer
5626
- } = useLayer(), {
5627
5683
  activeElement,
5628
5684
  activeIndex,
5629
5685
  handleItemMouseEnter,
5630
5686
  handleItemMouseLeave,
5631
5687
  handleKeyDown,
5632
5688
  mount
5633
- } = useMenuController({
5634
- onKeyDown,
5635
- originElement,
5636
- shouldFocus,
5637
- rootElementRef: ref
5638
- }), unregisterElementRef = react.useRef(null), handleRefChange = react.useCallback((el) => {
5689
+ } = useMenuController(t3), unregisterElementRef = react.useRef(null);
5690
+ let t4;
5691
+ $[18] !== registerElement ? (t4 = (el) => {
5639
5692
  unregisterElementRef.current && (unregisterElementRef.current(), unregisterElementRef.current = null), ref.current = el, ref.current && registerElement && (unregisterElementRef.current = registerElement(ref.current));
5640
- }, [registerElement]);
5641
- react.useEffect(() => {
5693
+ }, $[18] = registerElement, $[19] = t4) : t4 = $[19];
5694
+ const handleRefChange = t4;
5695
+ let t5, t6;
5696
+ $[20] !== onItemSelect || $[21] !== activeIndex ? (t5 = () => {
5642
5697
  onItemSelect && onItemSelect(activeIndex);
5643
- }, [activeIndex, onItemSelect]), useClickOutsideEvent(isTopLayer && onClickOutside, () => [ref.current]), useGlobalKeyDown(react.useCallback((event) => {
5698
+ }, t6 = [activeIndex, onItemSelect], $[20] = onItemSelect, $[21] = activeIndex, $[22] = t5, $[23] = t6) : (t5 = $[22], t6 = $[23]), react.useEffect(t5, t6);
5699
+ let t7;
5700
+ $[24] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[24] = t7) : t7 = $[24], useClickOutsideEvent(isTopLayer && onClickOutside, t7);
5701
+ let t8;
5702
+ $[25] !== isTopLayer || $[26] !== onEscape ? (t8 = (event) => {
5644
5703
  isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
5645
- }, [isTopLayer, onEscape]));
5646
- const value = react.useMemo(() => ({
5704
+ }, $[25] = isTopLayer, $[26] = onEscape, $[27] = t8) : t8 = $[27], useGlobalKeyDown(t8);
5705
+ let t9, t10;
5706
+ $[28] !== activeElement || $[29] !== activeIndex || $[30] !== mount || $[31] !== onClickOutside || $[32] !== onEscape || $[33] !== onItemClick || $[34] !== handleItemMouseEnter || $[35] !== handleItemMouseLeave || $[36] !== registerElement ? (t10 = {
5647
5707
  version: 0,
5648
5708
  activeElement,
5649
5709
  activeIndex,
@@ -5654,11 +5714,16 @@ const Root$5 = styledComponents.styled(Box)`
5654
5714
  onItemMouseEnter: handleItemMouseEnter,
5655
5715
  onItemMouseLeave: handleItemMouseLeave,
5656
5716
  registerElement,
5657
- // deprecated
5658
5717
  onMouseEnter: handleItemMouseEnter,
5659
5718
  onMouseLeave: handleItemMouseLeave
5660
- }), [activeElement, activeIndex, mount, handleItemMouseEnter, handleItemMouseLeave, onClickOutside, onEscape, onItemClick, registerElement]);
5661
- return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(Root$5, { "data-ui": "Menu", ...restProps, onKeyDown: handleKeyDown, padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(Stack, { space, children }) }) });
5719
+ }, $[28] = activeElement, $[29] = activeIndex, $[30] = mount, $[31] = onClickOutside, $[32] = onEscape, $[33] = onItemClick, $[34] = handleItemMouseEnter, $[35] = handleItemMouseLeave, $[36] = registerElement, $[37] = t10) : t10 = $[37], t9 = t10;
5720
+ const value = t9;
5721
+ let t11;
5722
+ $[38] !== space || $[39] !== children ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(Stack, { space, children }), $[38] = space, $[39] = children, $[40] = t11) : t11 = $[40];
5723
+ let t12;
5724
+ $[41] !== restProps || $[42] !== handleKeyDown || $[43] !== padding || $[44] !== handleRefChange || $[45] !== t11 ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(Root$5, { "data-ui": "Menu", ...restProps, onKeyDown: handleKeyDown, padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t11 }), $[41] = restProps, $[42] = handleKeyDown, $[43] = padding, $[44] = handleRefChange, $[45] = t11, $[46] = t12) : t12 = $[46];
5725
+ let t13;
5726
+ return $[47] !== value || $[48] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children: t12 }), $[47] = value, $[48] = t12, $[49] = t13) : t13 = $[49], t13;
5662
5727
  });
5663
5728
  Menu.displayName = "ForwardRef(Menu)";
5664
5729
  const MenuButton = react.forwardRef(function(props, forwardedRef) {
@@ -5872,20 +5937,23 @@ function useMenu() {
5872
5937
  return value;
5873
5938
  }
5874
5939
  function MenuGroup(props) {
5875
- const {
5876
- as = "button",
5940
+ const $ = reactCompilerRuntime.c(77);
5941
+ let t0, t1, t2, t3, t4, t5, onClick, children, IconComponent, text, restProps, popover;
5942
+ $[0] !== props ? ({
5943
+ as: t0,
5877
5944
  children,
5878
- fontSize: fontSize2 = 1,
5945
+ fontSize: t1,
5879
5946
  icon: IconComponent,
5880
5947
  onClick,
5881
- padding = 3,
5948
+ padding: t2,
5882
5949
  popover,
5883
- radius = 2,
5884
- space = 3,
5950
+ radius: t3,
5951
+ space: t4,
5885
5952
  text,
5886
- tone = "default",
5953
+ tone: t5,
5887
5954
  ...restProps
5888
- } = props, menu = useMenu(), {
5955
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = onClick, $[8] = children, $[9] = IconComponent, $[10] = text, $[11] = restProps, $[12] = popover) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], onClick = $[7], children = $[8], IconComponent = $[9], text = $[10], restProps = $[11], popover = $[12]);
5956
+ const as = t0 === void 0 ? "button" : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, menu = useMenu(), {
5889
5957
  scheme
5890
5958
  } = useRootTheme(), {
5891
5959
  activeElement,
@@ -5893,56 +5961,99 @@ function MenuGroup(props) {
5893
5961
  onClickOutside,
5894
5962
  onEscape,
5895
5963
  onItemClick,
5896
- onItemMouseEnter = menu.onMouseEnter,
5964
+ onItemMouseEnter: _onItemMouseEnter,
5897
5965
  registerElement
5898
- } = menu, [rootElement, setRootElement] = react.useState(null), [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = react.useState(!1), handleMouseEnter = react.useCallback((event) => {
5966
+ } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onMouseEnter, [rootElement, setRootElement] = react.useState(null), [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = react.useState(!1);
5967
+ let t6;
5968
+ $[13] !== onItemMouseEnter ? (t6 = (event) => {
5899
5969
  setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
5900
- }, [onItemMouseEnter]), handleMenuKeyDown = react.useCallback((event_0) => {
5970
+ }, $[13] = onItemMouseEnter, $[14] = t6) : t6 = $[14];
5971
+ const handleMouseEnter = t6;
5972
+ let t7;
5973
+ $[15] !== rootElement ? (t7 = (event_0) => {
5901
5974
  event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
5902
5975
  rootElement?.focus();
5903
5976
  }));
5904
- }, [rootElement]), handleClick = react.useCallback((event_1) => {
5977
+ }, $[15] = rootElement, $[16] = t7) : t7 = $[16];
5978
+ const handleMenuKeyDown = t7;
5979
+ let t8;
5980
+ $[17] !== onClick ? (t8 = (event_1) => {
5905
5981
  onClick?.(event_1), setShouldFocus("first"), setOpen(!0);
5906
- }, [onClick]), handleChildItemClick = react.useCallback(() => {
5982
+ }, $[17] = onClick, $[18] = t8) : t8 = $[18];
5983
+ const handleClick = t8;
5984
+ let t9;
5985
+ $[19] !== onItemClick ? (t9 = () => {
5907
5986
  setOpen(!1), onItemClick?.();
5908
- }, [onItemClick]), handleMenuMouseEnter = react.useCallback(() => setWithinMenu(!0), []);
5909
- react.useEffect(() => mount(rootElement), [mount, rootElement]), react.useEffect(() => {
5987
+ }, $[19] = onItemClick, $[20] = t9) : t9 = $[20];
5988
+ const handleChildItemClick = t9;
5989
+ let t10;
5990
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => setWithinMenu(!0), $[21] = t10) : t10 = $[21];
5991
+ const handleMenuMouseEnter = t10;
5992
+ let t11, t12;
5993
+ $[22] !== mount || $[23] !== rootElement ? (t11 = () => mount(rootElement), t12 = [mount, rootElement], $[22] = mount, $[23] = rootElement, $[24] = t11, $[25] = t12) : (t11 = $[24], t12 = $[25]), react.useEffect(t11, t12);
5994
+ let t13, t14;
5995
+ $[26] !== active ? (t13 = () => {
5910
5996
  active || setOpen(!1);
5911
- }, [active]), react.useEffect(() => {
5997
+ }, t14 = [active], $[26] = active, $[27] = t13, $[28] = t14) : (t13 = $[27], t14 = $[28]), react.useEffect(t13, t14);
5998
+ let t15, t16;
5999
+ $[29] !== open ? (t15 = () => {
5912
6000
  open || setWithinMenu(!1);
5913
- }, [open]), react.useEffect(() => {
5914
- if (!shouldFocus) return;
6001
+ }, t16 = [open], $[29] = open, $[30] = t15, $[31] = t16) : (t15 = $[30], t16 = $[31]), react.useEffect(t15, t16);
6002
+ let t17, t18;
6003
+ $[32] !== shouldFocus ? (t17 = () => {
6004
+ if (!shouldFocus)
6005
+ return;
5915
6006
  const rafId = requestAnimationFrame(() => setShouldFocus(null));
5916
6007
  return () => cancelAnimationFrame(rafId);
5917
- }, [shouldFocus]);
5918
- const childMenu = /* @__PURE__ */ jsxRuntime.jsx(Menu, { onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), handleKeyDown = react.useCallback((event_2) => {
6008
+ }, t18 = [shouldFocus], $[32] = shouldFocus, $[33] = t17, $[34] = t18) : (t17 = $[33], t18 = $[34]), react.useEffect(t17, t18);
6009
+ let t19;
6010
+ $[35] !== onClickOutside || $[36] !== onEscape || $[37] !== handleChildItemClick || $[38] !== handleMenuKeyDown || $[39] !== registerElement || $[40] !== shouldFocus || $[41] !== children ? (t19 = /* @__PURE__ */ jsxRuntime.jsx(Menu, { onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), $[35] = onClickOutside, $[36] = onEscape, $[37] = handleChildItemClick, $[38] = handleMenuKeyDown, $[39] = registerElement, $[40] = shouldFocus, $[41] = children, $[42] = t19) : t19 = $[42];
6011
+ const childMenu = t19;
6012
+ let t20;
6013
+ $[43] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_2) => {
5919
6014
  const target = event_2.currentTarget;
5920
6015
  if (document.activeElement === target && event_2.key === "ArrowRight") {
5921
6016
  setShouldFocus("first"), setOpen(!0), setWithinMenu(!0);
5922
6017
  return;
5923
6018
  }
5924
- }, []);
5925
- return /* @__PURE__ */ jsxRuntime.jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: /* @__PURE__ */ jsxRuntime.jsx(Selectable, { "data-as": as, "data-ui": "MenuGroup", forwardedAs: as, ...restProps, "aria-pressed": as === "button" ? withinMenu : void 0, "data-pressed": as !== "button" ? withinMenu : void 0, "data-selected": !withinMenu && active ? "" : void 0, $radius: useArrayProp(radius), $tone: tone, $scheme: scheme, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, ref: setRootElement, tabIndex: -1, type: as === "button" ? "button" : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: space, padding, children: [
5926
- IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
5927
- react.isValidElement(IconComponent) && IconComponent,
5928
- ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
5929
- ] }),
5930
- /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
5931
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRightIcon, {}) })
5932
- ] }) }) });
6019
+ }, $[43] = t20) : t20 = $[43];
6020
+ 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;
6021
+ let t26;
6022
+ $[44] !== IconComponent || $[45] !== fontSize2 ? (t26 = IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
6023
+ react.isValidElement(IconComponent) && IconComponent,
6024
+ ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
6025
+ ] }), $[44] = IconComponent, $[45] = fontSize2, $[46] = t26) : t26 = $[46];
6026
+ let t27;
6027
+ $[47] !== fontSize2 || $[48] !== text ? (t27 = /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }), $[47] = fontSize2, $[48] = text, $[49] = t27) : t27 = $[49];
6028
+ let t28;
6029
+ $[50] === Symbol.for("react.memo_cache_sentinel") ? (t28 = /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRightIcon, {}), $[50] = t28) : t28 = $[50];
6030
+ let t29;
6031
+ $[51] !== fontSize2 ? (t29 = /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, children: t28 }), $[51] = fontSize2, $[52] = t29) : t29 = $[52];
6032
+ let t30;
6033
+ $[53] !== space || $[54] !== padding || $[55] !== t26 || $[56] !== t27 || $[57] !== t29 ? (t30 = /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: space, padding, children: [
6034
+ t26,
6035
+ t27,
6036
+ t29
6037
+ ] }), $[53] = space, $[54] = padding, $[55] = t26, $[56] = t27, $[57] = t29, $[58] = t30) : t30 = $[58];
6038
+ let t31;
6039
+ $[59] !== as || $[60] !== restProps || $[61] !== t21 || $[62] !== t22 || $[63] !== t23 || $[64] !== t24 || $[65] !== tone || $[66] !== scheme || $[67] !== handleClick || $[68] !== handleMouseEnter || $[69] !== t25 || $[70] !== t30 ? (t31 = /* @__PURE__ */ jsxRuntime.jsx(Selectable, { "data-as": as, "data-ui": "MenuGroup", forwardedAs: as, ...restProps, "aria-pressed": t21, "data-pressed": t22, "data-selected": t23, $radius: t24, $tone: tone, $scheme: scheme, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, ref: setRootElement, tabIndex: -1, type: t25, children: t30 }), $[59] = as, $[60] = restProps, $[61] = t21, $[62] = t22, $[63] = t23, $[64] = t24, $[65] = tone, $[66] = scheme, $[67] = handleClick, $[68] = handleMouseEnter, $[69] = t25, $[70] = t30, $[71] = t31) : t31 = $[71];
6040
+ let t32;
6041
+ return $[72] !== popover || $[73] !== childMenu || $[74] !== open || $[75] !== t31 ? (t32 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t31 }), $[72] = popover, $[73] = childMenu, $[74] = open, $[75] = t31, $[76] = t32) : t32 = $[76], t32;
5933
6042
  }
5934
6043
  MenuGroup.displayName = "MenuGroup";
5935
6044
  const MenuItem = react.forwardRef(function(props, forwardedRef) {
5936
- const {
5937
- as = "button",
6045
+ const $ = reactCompilerRuntime.c(74);
6046
+ let t0, t1, t2, t3, t4, t5, selectedProp, disabled, onClick, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft, pressed, IconComponent, text, IconRightComponent, hotkeys, children, restProps;
6047
+ $[0] !== props ? ({
6048
+ as: t0,
5938
6049
  children,
5939
6050
  disabled,
5940
- fontSize: fontSize2 = 1,
6051
+ fontSize: t1,
5941
6052
  hotkeys,
5942
6053
  icon: IconComponent,
5943
6054
  iconRight: IconRightComponent,
5944
6055
  onClick,
5945
- padding = 3,
6056
+ padding: t2,
5946
6057
  paddingX,
5947
6058
  paddingY,
5948
6059
  paddingTop,
@@ -5950,25 +6061,33 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5950
6061
  paddingBottom,
5951
6062
  paddingLeft,
5952
6063
  pressed,
5953
- radius = 2,
6064
+ radius: t3,
5954
6065
  selected: selectedProp,
5955
- space = 3,
6066
+ space: t4,
5956
6067
  text,
5957
- tone = "default",
6068
+ tone: t5,
5958
6069
  ...restProps
5959
- } = props, {
6070
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = selectedProp, $[8] = disabled, $[9] = onClick, $[10] = paddingX, $[11] = paddingY, $[12] = paddingTop, $[13] = paddingRight, $[14] = paddingBottom, $[15] = paddingLeft, $[16] = pressed, $[17] = IconComponent, $[18] = text, $[19] = IconRightComponent, $[20] = hotkeys, $[21] = children, $[22] = restProps) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], selectedProp = $[7], disabled = $[8], onClick = $[9], paddingX = $[10], paddingY = $[11], paddingTop = $[12], paddingRight = $[13], paddingBottom = $[14], paddingLeft = $[15], pressed = $[16], IconComponent = $[17], text = $[18], IconRightComponent = $[19], hotkeys = $[20], children = $[21], restProps = $[22]);
6071
+ const as = t0 === void 0 ? "button" : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, {
5960
6072
  scheme
5961
6073
  } = useRootTheme(), menu = useMenu(), {
5962
6074
  activeElement,
5963
6075
  mount,
5964
6076
  onItemClick,
5965
- onItemMouseEnter = menu.onMouseEnter,
5966
- onItemMouseLeave = menu.onMouseLeave
5967
- } = menu, [rootElement, setRootElement] = react.useState(null), active = !!activeElement && activeElement === rootElement, ref = react.useRef(null);
5968
- react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => mount(rootElement, selectedProp), [mount, rootElement, selectedProp]);
5969
- const handleClick = react.useCallback((event) => {
6077
+ onItemMouseEnter: _onItemMouseEnter,
6078
+ onItemMouseLeave: _onItemMouseLeave
6079
+ } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onMouseEnter, onItemMouseLeave = _onItemMouseLeave ?? menu.onMouseLeave, [rootElement, setRootElement] = react.useState(null), active = !!activeElement && activeElement === rootElement, ref = react.useRef(null);
6080
+ let t6;
6081
+ $[23] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[23] = t6) : t6 = $[23], react.useImperativeHandle(forwardedRef, t6);
6082
+ let t7, t8;
6083
+ $[24] !== mount || $[25] !== rootElement || $[26] !== selectedProp ? (t7 = () => mount(rootElement, selectedProp), t8 = [mount, rootElement, selectedProp], $[24] = mount, $[25] = rootElement, $[26] = selectedProp, $[27] = t7, $[28] = t8) : (t7 = $[27], t8 = $[28]), react.useEffect(t7, t8);
6084
+ let t9;
6085
+ $[29] !== disabled || $[30] !== onClick || $[31] !== onItemClick ? (t9 = (event) => {
5970
6086
  disabled || (onClick && onClick(event), onItemClick && onItemClick());
5971
- }, [disabled, onClick, onItemClick]), paddingProps = react.useMemo(() => ({
6087
+ }, $[29] = disabled, $[30] = onClick, $[31] = onItemClick, $[32] = t9) : t9 = $[32];
6088
+ const handleClick = t9;
6089
+ let t10, t11;
6090
+ $[33] !== padding || $[34] !== paddingX || $[35] !== paddingY || $[36] !== paddingTop || $[37] !== paddingRight || $[38] !== paddingBottom || $[39] !== paddingLeft ? (t11 = {
5972
6091
  padding,
5973
6092
  paddingX,
5974
6093
  paddingY,
@@ -5976,29 +6095,44 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5976
6095
  paddingRight,
5977
6096
  paddingBottom,
5978
6097
  paddingLeft
5979
- }), [padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft]), hotkeysFontSize = useArrayProp(fontSize2).map((s) => s - 1), setRef = react.useCallback((el) => {
6098
+ }, $[33] = padding, $[34] = paddingX, $[35] = paddingY, $[36] = paddingTop, $[37] = paddingRight, $[38] = paddingBottom, $[39] = paddingLeft, $[40] = t11) : t11 = $[40], t10 = t11;
6099
+ const paddingProps = t10, t12 = useArrayProp(fontSize2);
6100
+ let t13;
6101
+ $[41] !== t12 ? (t13 = t12.map(_temp$1), $[41] = t12, $[42] = t13) : t13 = $[42];
6102
+ const hotkeysFontSize = t13;
6103
+ let t14;
6104
+ $[43] === Symbol.for("react.memo_cache_sentinel") ? (t14 = (el) => {
5980
6105
  ref.current = el, setRootElement(el);
5981
- }, []);
5982
- return /* @__PURE__ */ jsxRuntime.jsxs(Selectable, { "data-ui": "MenuItem", ...restProps, "aria-pressed": as === "button" && pressed, "data-pressed": as !== "button" && pressed ? "" : void 0, "data-selected": active ? "" : void 0, "data-disabled": disabled ? "" : void 0, forwardedAs: as, $radius: useArrayProp(radius), $padding: useArrayProp(0), $tone: disabled ? "default" : tone, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role: "menuitem", tabIndex: -1, type: as === "button" ? "button" : void 0, children: [
5983
- (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
5984
- IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
5985
- react.isValidElement(IconComponent) && IconComponent,
5986
- ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
5987
- ] }),
5988
- text && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
5989
- hotkeys && /* @__PURE__ */ jsxRuntime.jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
5990
- marginTop: -4,
5991
- marginBottom: -4
5992
- } }),
5993
- IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
5994
- react.isValidElement(IconRightComponent) && IconRightComponent,
5995
- ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
5996
- ] })
6106
+ }, $[43] = t14) : t14 = $[43];
6107
+ 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;
6108
+ let t23;
6109
+ $[44] !== IconComponent || $[45] !== text || $[46] !== IconRightComponent || $[47] !== fontSize2 || $[48] !== hotkeys || $[49] !== hotkeysFontSize || $[50] !== space || $[51] !== paddingProps ? (t23 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
6110
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
6111
+ react.isValidElement(IconComponent) && IconComponent,
6112
+ ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
5997
6113
  ] }),
5998
- children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children })
5999
- ] });
6114
+ text && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
6115
+ hotkeys && /* @__PURE__ */ jsxRuntime.jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
6116
+ marginTop: -4,
6117
+ marginBottom: -4
6118
+ } }),
6119
+ IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
6120
+ react.isValidElement(IconRightComponent) && IconRightComponent,
6121
+ ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
6122
+ ] })
6123
+ ] }), $[44] = IconComponent, $[45] = text, $[46] = IconRightComponent, $[47] = fontSize2, $[48] = hotkeys, $[49] = hotkeysFontSize, $[50] = space, $[51] = paddingProps, $[52] = t23) : t23 = $[52];
6124
+ let t24;
6125
+ $[53] !== children || $[54] !== paddingProps ? (t24 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children }), $[53] = children, $[54] = paddingProps, $[55] = t24) : t24 = $[55];
6126
+ let t25;
6127
+ return $[56] !== restProps || $[57] !== t15 || $[58] !== t16 || $[59] !== t17 || $[60] !== t18 || $[61] !== as || $[62] !== t19 || $[63] !== t20 || $[64] !== t21 || $[65] !== scheme || $[66] !== disabled || $[67] !== handleClick || $[68] !== onItemMouseEnter || $[69] !== onItemMouseLeave || $[70] !== t22 || $[71] !== t23 || $[72] !== t24 ? (t25 = /* @__PURE__ */ jsxRuntime.jsxs(Selectable, { "data-ui": "MenuItem", ...restProps, "aria-pressed": t15, "data-pressed": t16, "data-selected": t17, "data-disabled": t18, forwardedAs: as, $radius: t19, $padding: t20, $tone: t21, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role: "menuitem", tabIndex: -1, type: t22, children: [
6128
+ t23,
6129
+ t24
6130
+ ] }), $[56] = restProps, $[57] = t15, $[58] = t16, $[59] = t17, $[60] = t18, $[61] = as, $[62] = t19, $[63] = t20, $[64] = t21, $[65] = scheme, $[66] = disabled, $[67] = handleClick, $[68] = onItemMouseEnter, $[69] = onItemMouseLeave, $[70] = t22, $[71] = t23, $[72] = t24, $[73] = t25) : t25 = $[73], t25;
6000
6131
  });
6001
6132
  MenuItem.displayName = "ForwardRef(MenuItem)";
6133
+ function _temp$1(s) {
6134
+ return s - 1;
6135
+ }
6002
6136
  const keyframe = styledComponents.keyframes`
6003
6137
  0% {
6004
6138
  background-position: 100%;
@@ -6166,9 +6300,6 @@ const CustomButton = styledComponents.styled(Button)`
6166
6300
  return $[18] !== restProps || $[19] !== t7 || $[20] !== fontSize2 || $[21] !== icon || $[22] !== id || $[23] !== onClick || $[24] !== handleFocus || $[25] !== padding || $[26] !== selected || $[27] !== t8 || $[28] !== label ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(CustomButton, { "data-ui": "Tab", ...restProps, "aria-selected": t7, fontSize: fontSize2, icon, id, mode: "bleed", onClick, onBlur: handleBlur, onFocus: handleFocus, padding, ref, role: "tab", selected, tabIndex: t8, text: label, type: "button" }), $[18] = restProps, $[19] = t7, $[20] = fontSize2, $[21] = icon, $[22] = id, $[23] = onClick, $[24] = handleFocus, $[25] = padding, $[26] = selected, $[27] = t8, $[28] = label, $[29] = t9) : t9 = $[29], t9;
6167
6301
  });
6168
6302
  Tab.displayName = "ForwardRef(Tab)";
6169
- function _isReactElement(node) {
6170
- return !!node;
6171
- }
6172
6303
  const CustomInline = styledComponents.styled(Inline)`
6173
6304
  & > div {
6174
6305
  display: inline-block;
@@ -6177,19 +6308,32 @@ const CustomInline = styledComponents.styled(Inline)`
6177
6308
  box-sizing: border-box;
6178
6309
  }
6179
6310
  `, TabList = react.forwardRef(function(props, ref) {
6180
- const {
6311
+ const $ = reactCompilerRuntime.c(15);
6312
+ let childrenProp, restProps;
6313
+ $[0] !== props ? ({
6181
6314
  children: childrenProp,
6182
6315
  ...restProps
6183
- } = props, [focusedIndex, setFocusedIndex] = react.useState(-1), tabs = react.useMemo(() => childrenProp.filter(_isReactElement), [childrenProp]).map((child, childIndex) => react.cloneElement(child, {
6184
- focused: focusedIndex === childIndex,
6185
- key: childIndex,
6186
- onFocus: () => handleTabFocus(childIndex)
6187
- })), numTabs = tabs.length, handleTabFocus = react.useCallback((tabIdx) => {
6188
- setFocusedIndex(tabIdx);
6189
- }, []), handleKeyDown = react.useCallback((event) => {
6316
+ } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps) : (childrenProp = $[1], restProps = $[2]);
6317
+ const [focusedIndex, setFocusedIndex] = react.useState(-1);
6318
+ let t0;
6319
+ if ($[3] !== childrenProp || $[4] !== focusedIndex) {
6320
+ const children = react.Children.toArray(childrenProp).filter(react.isValidElement);
6321
+ let t12;
6322
+ $[6] !== focusedIndex ? (t12 = (child, childIndex) => react.cloneElement(child, {
6323
+ focused: focusedIndex === childIndex,
6324
+ key: childIndex,
6325
+ onFocus: () => setFocusedIndex(childIndex)
6326
+ }), $[6] = focusedIndex, $[7] = t12) : t12 = $[7], t0 = children.map(t12), $[3] = childrenProp, $[4] = focusedIndex, $[5] = t0;
6327
+ } else
6328
+ t0 = $[5];
6329
+ const tabs = t0, numTabs = tabs.length;
6330
+ let t1;
6331
+ $[8] !== numTabs ? (t1 = (event) => {
6190
6332
  event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
6191
- }, [numTabs]);
6192
- return /* @__PURE__ */ jsxRuntime.jsx(CustomInline, { "data-ui": "TabList", ...restProps, onKeyDown: handleKeyDown, ref, role: "tablist", children: tabs });
6333
+ }, $[8] = numTabs, $[9] = t1) : t1 = $[9];
6334
+ const handleKeyDown = t1;
6335
+ let t2;
6336
+ return $[10] !== restProps || $[11] !== handleKeyDown || $[12] !== ref || $[13] !== tabs ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(CustomInline, { "data-ui": "TabList", ...restProps, onKeyDown: handleKeyDown, ref, role: "tablist", children: tabs }), $[10] = restProps, $[11] = handleKeyDown, $[12] = ref, $[13] = tabs, $[14] = t2) : t2 = $[14], t2;
6193
6337
  });
6194
6338
  TabList.displayName = "ForwardRef(TabList)";
6195
6339
  const TabPanel = react.forwardRef(function(props, ref) {