@sanity/ui 2.8.17 → 2.8.18

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.mjs CHANGED
@@ -210,7 +210,7 @@ function useClickOutside(listener, t0, boundaryElement) {
210
210
  }, t5 = [boundaryElement, listener, elements], $[7] = listener, $[8] = boundaryElement, $[9] = elements, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
211
211
  }
212
212
  function useClickOutsideEvent(listener, t0, boundaryElement) {
213
- const $ = c(8), elementsArg = t0 === void 0 ? _temp$5 : t0;
213
+ const $ = c(8), elementsArg = t0 === void 0 ? _temp$6 : t0;
214
214
  let t1;
215
215
  $[0] !== listener || $[1] !== boundaryElement || $[2] !== elementsArg ? (t1 = (evt) => {
216
216
  if (!listener)
@@ -238,7 +238,7 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
238
238
  };
239
239
  }, t3 = [hasListener, onEvent], $[4] = hasListener, $[5] = onEvent, $[6] = t2, $[7] = t3) : (t2 = $[6], t3 = $[7]), useEffect(t2, t3), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
240
240
  }
241
- function _temp$5() {
241
+ function _temp$6() {
242
242
  return EMPTY_ARRAY;
243
243
  }
244
244
  function useCustomValidity(ref, customValidity) {
@@ -625,18 +625,42 @@ function createGlobalScopedContext(key2, defaultValue) {
625
625
  }
626
626
  const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
627
627
  function ThemeProvider(props) {
628
- const parentTheme = useContext(ThemeContext), {
629
- children,
630
- scheme = parentTheme?.scheme || "light",
631
- theme: rootTheme = parentTheme?.theme || null,
632
- tone = parentTheme?.tone || "default"
633
- } = props, themeContext = useMemo(() => rootTheme ? {
634
- version: 0,
635
- theme: rootTheme,
636
- scheme,
637
- tone
638
- } : null, [rootTheme, scheme, tone]), theme = useMemo(() => rootTheme ? getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
639
- return theme ? /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }) }) : /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
628
+ const $ = c(15), parentTheme = useContext(ThemeContext), {
629
+ children
630
+ } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
631
+ let t0;
632
+ bb0: {
633
+ if (!rootTheme) {
634
+ t0 = null;
635
+ break bb0;
636
+ }
637
+ let t12;
638
+ $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
639
+ version: 0,
640
+ theme: rootTheme,
641
+ scheme,
642
+ tone
643
+ }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
644
+ }
645
+ const themeContext = t0;
646
+ let t1;
647
+ bb1: {
648
+ if (!rootTheme) {
649
+ t1 = null;
650
+ break bb1;
651
+ }
652
+ let t22;
653
+ $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
654
+ }
655
+ const theme = t1;
656
+ if (!theme) {
657
+ let t22;
658
+ return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
659
+ }
660
+ let t2;
661
+ $[9] !== theme || $[10] !== children ? (t2 = /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }), $[9] = theme, $[10] = children, $[11] = t2) : t2 = $[11];
662
+ let t3;
663
+ return $[12] !== themeContext || $[13] !== t2 ? (t3 = /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = themeContext, $[13] = t2, $[14] = t3) : t3 = $[14], t3;
640
664
  }
641
665
  ThemeProvider.displayName = "ThemeProvider";
642
666
  function useRootTheme() {
@@ -721,15 +745,15 @@ function useMediaIndex() {
721
745
  return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
722
746
  }
723
747
  function usePrefersDark(t0) {
724
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$4 : t0);
748
+ return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$5 : t0);
725
749
  }
726
- function _temp$4() {
750
+ function _temp$5() {
727
751
  return !1;
728
752
  }
729
753
  function usePrefersReducedMotion(t0) {
730
- return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$3 : t0);
754
+ return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$4 : t0);
731
755
  }
732
- function _temp$3() {
756
+ function _temp$4() {
733
757
  return !1;
734
758
  }
735
759
  function responsiveBorderStyle() {
@@ -3448,7 +3472,7 @@ function PortalProvider(props) {
3448
3472
  children,
3449
3473
  element,
3450
3474
  __unstable_elements: elementsProp
3451
- } = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(emptySubscribe, _temp$2, _temp2$1);
3475
+ } = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(emptySubscribe, _temp$3, _temp2$1);
3452
3476
  let t0;
3453
3477
  const t1 = boundaryElement || null, t2 = element || fallbackElement;
3454
3478
  let t3;
@@ -3465,7 +3489,7 @@ function PortalProvider(props) {
3465
3489
  function _temp2$1() {
3466
3490
  return null;
3467
3491
  }
3468
- function _temp$2() {
3492
+ function _temp$3() {
3469
3493
  return document.body;
3470
3494
  }
3471
3495
  PortalProvider.displayName = "PortalProvider";
@@ -4554,7 +4578,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
4554
4578
  const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = useRef(null), rootTheme = useRootTheme(), fontSize2 = useArrayProp(fontSizeProp), padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
4555
4579
  let t7;
4556
4580
  $[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
4557
- const handleClearMouseDown = _temp$1;
4581
+ const handleClearMouseDown = _temp$2;
4558
4582
  let t8;
4559
4583
  $[20] !== onClear ? (t8 = (event_0) => {
4560
4584
  event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
@@ -4622,7 +4646,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
4622
4646
  ] }), $[81] = rootTheme.tone, $[82] = prefixNode, $[83] = t27, $[84] = suffixNode, $[85] = t28) : t28 = $[85], t28;
4623
4647
  });
4624
4648
  TextInput.displayName = "ForwardRef(TextInput)";
4625
- function _temp$1(event) {
4649
+ function _temp$2(event) {
4626
4650
  event.preventDefault(), event.stopPropagation();
4627
4651
  }
4628
4652
  function useDelayedState(initialState) {
@@ -5353,13 +5377,15 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
5353
5377
  });
5354
5378
  DialogCard.displayName = "ForwardRef(DialogCard)";
5355
5379
  const Dialog = forwardRef(function(props, ref) {
5356
- const dialog = useDialog(), {
5380
+ const $ = c(60), dialog = useDialog(), {
5357
5381
  layer
5358
- } = useTheme_v2(), {
5359
- __unstable_autoFocus: autoFocus = !0,
5360
- __unstable_hideCloseButton: hideCloseButton = !1,
5361
- cardRadius: cardRadiusProp = 4,
5362
- cardShadow = 3,
5382
+ } = useTheme_v2();
5383
+ let t0, t1, t2, t3, t4, t5, t6, _positionProp, _zOffsetProp, portalProp, onFocus, id, contentRef, footer, header, onClickOutside, onClose, scheme, children, restProps, onActivate;
5384
+ $[0] !== props ? ({
5385
+ __unstable_autoFocus: t0,
5386
+ __unstable_hideCloseButton: t1,
5387
+ cardRadius: t2,
5388
+ cardShadow: t3,
5363
5389
  children,
5364
5390
  contentRef,
5365
5391
  footer,
@@ -5369,15 +5395,18 @@ const Dialog = forwardRef(function(props, ref) {
5369
5395
  onClickOutside,
5370
5396
  onClose,
5371
5397
  onFocus,
5372
- padding: paddingProp = 3,
5398
+ padding: t4,
5373
5399
  portal: portalProp,
5374
- position: positionProp = dialog.position || "fixed",
5400
+ position: _positionProp,
5375
5401
  scheme,
5376
- width: widthProp = 0,
5377
- zOffset: zOffsetProp = dialog.zOffset || layer.dialog.zOffset,
5378
- animate: _animate = !1,
5402
+ width: t5,
5403
+ zOffset: _zOffsetProp,
5404
+ animate: t6,
5379
5405
  ...restProps
5380
- } = 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 = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null), handleFocus = useCallback((event) => {
5406
+ } = 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]);
5407
+ const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 === void 0 ? !1 : t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), padding = useArrayProp(paddingProp), position = useArrayProp(positionProp), width = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
5408
+ let t7;
5409
+ $[22] !== onFocus ? (t7 = (event) => {
5381
5410
  onFocus?.(event);
5382
5411
  const target = event.target, cardElement = cardRef.current;
5383
5412
  if (cardElement && target === preDivRef.current) {
@@ -5389,7 +5418,10 @@ const Dialog = forwardRef(function(props, ref) {
5389
5418
  return;
5390
5419
  }
5391
5420
  isHTMLElement(event.target) && (focusedElementRef.current = event.target);
5392
- }, [onFocus]), labelId = `${id}_label`, rootClickTimeoutRef = useRef(), handleRootClick = useCallback(() => {
5421
+ }, $[22] = onFocus, $[23] = t7) : t7 = $[23];
5422
+ const handleFocus = t7, labelId = `${id}_label`, rootClickTimeoutRef = useRef();
5423
+ let t8;
5424
+ $[24] !== boundaryElement || $[25] !== portalElement ? (t8 = () => {
5393
5425
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
5394
5426
  const activeElement = document.activeElement;
5395
5427
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
@@ -5402,12 +5434,22 @@ const Dialog = forwardRef(function(props, ref) {
5402
5434
  target_0.focus();
5403
5435
  }
5404
5436
  }, 0);
5405
- }, [boundaryElement, portalElement]);
5406
- return /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: /* @__PURE__ */ 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: [
5407
- /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }),
5408
- /* @__PURE__ */ 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 }),
5409
- /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 })
5410
- ] }) });
5437
+ }, $[24] = boundaryElement, $[25] = portalElement, $[26] = t8) : t8 = $[26];
5438
+ const handleRootClick = t8;
5439
+ let t9;
5440
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[27] = t9) : t9 = $[27];
5441
+ let t10;
5442
+ $[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__ */ 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];
5443
+ let t11;
5444
+ $[43] === Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[43] = t11) : t11 = $[43];
5445
+ let t12;
5446
+ $[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__ */ 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: [
5447
+ t9,
5448
+ t10,
5449
+ t11
5450
+ ] }), $[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];
5451
+ let t13;
5452
+ return $[57] !== portalProp || $[58] !== t12 ? (t13 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t12 }), $[57] = portalProp, $[58] = t12, $[59] = t13) : t13 = $[59], t13;
5411
5453
  });
5412
5454
  Dialog.displayName = "ForwardRef(Dialog)";
5413
5455
  function DialogProvider(props) {
@@ -5608,48 +5650,66 @@ const Root$5 = styled(Box)`
5608
5650
  outline: none;
5609
5651
  overflow: auto;
5610
5652
  `, Menu = forwardRef(function(props, forwardedRef) {
5653
+ const $ = c(50);
5654
+ let t0, t1, _shouldFocus, onKeyDown, originElement, registerElement, onItemSelect, onClickOutside, onEscape, onItemClick, children, restProps;
5655
+ if ($[0] !== props) {
5656
+ const {
5657
+ children: t22,
5658
+ focusFirst,
5659
+ focusLast,
5660
+ onClickOutside: t32,
5661
+ onEscape: t42,
5662
+ onItemClick: t52,
5663
+ onItemSelect: t62,
5664
+ onKeyDown: t72,
5665
+ originElement: t82,
5666
+ padding: t92,
5667
+ registerElement: t102,
5668
+ shouldFocus: t112,
5669
+ space: t122,
5670
+ ...t132
5671
+ } = props;
5672
+ 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;
5673
+ } else
5674
+ t0 = $[1], t1 = $[2], _shouldFocus = $[3], onKeyDown = $[4], originElement = $[5], registerElement = $[6], onItemSelect = $[7], onClickOutside = $[8], onEscape = $[9], onItemClick = $[10], children = $[11], restProps = $[12];
5675
+ const padding = t0 === void 0 ? 1 : t0, space = t1 === void 0 ? 1 : t1, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = useRef(null);
5676
+ let t2;
5677
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[13] = t2) : t2 = $[13], useImperativeHandle(forwardedRef, t2);
5611
5678
  const {
5612
- children,
5613
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5614
- focusFirst,
5615
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5616
- focusLast,
5617
- onClickOutside,
5618
- onEscape,
5619
- onItemClick,
5620
- onItemSelect,
5679
+ isTopLayer
5680
+ } = useLayer();
5681
+ let t3;
5682
+ $[14] !== onKeyDown || $[15] !== originElement || $[16] !== shouldFocus ? (t3 = {
5621
5683
  onKeyDown,
5622
5684
  originElement,
5623
- padding = 1,
5624
- registerElement,
5625
- shouldFocus = props.focusFirst && "first" || props.focusLast && "last" || null,
5626
- space = 1,
5627
- ...restProps
5628
- } = props, ref = useRef(null);
5629
- useImperativeHandle(forwardedRef, () => ref.current);
5685
+ shouldFocus,
5686
+ rootElementRef: ref
5687
+ }, $[14] = onKeyDown, $[15] = originElement, $[16] = shouldFocus, $[17] = t3) : t3 = $[17];
5630
5688
  const {
5631
- isTopLayer
5632
- } = useLayer(), {
5633
5689
  activeElement,
5634
5690
  activeIndex,
5635
5691
  handleItemMouseEnter,
5636
5692
  handleItemMouseLeave,
5637
5693
  handleKeyDown,
5638
5694
  mount
5639
- } = useMenuController({
5640
- onKeyDown,
5641
- originElement,
5642
- shouldFocus,
5643
- rootElementRef: ref
5644
- }), unregisterElementRef = useRef(null), handleRefChange = useCallback((el) => {
5695
+ } = useMenuController(t3), unregisterElementRef = useRef(null);
5696
+ let t4;
5697
+ $[18] !== registerElement ? (t4 = (el) => {
5645
5698
  unregisterElementRef.current && (unregisterElementRef.current(), unregisterElementRef.current = null), ref.current = el, ref.current && registerElement && (unregisterElementRef.current = registerElement(ref.current));
5646
- }, [registerElement]);
5647
- useEffect(() => {
5699
+ }, $[18] = registerElement, $[19] = t4) : t4 = $[19];
5700
+ const handleRefChange = t4;
5701
+ let t5, t6;
5702
+ $[20] !== onItemSelect || $[21] !== activeIndex ? (t5 = () => {
5648
5703
  onItemSelect && onItemSelect(activeIndex);
5649
- }, [activeIndex, onItemSelect]), useClickOutsideEvent(isTopLayer && onClickOutside, () => [ref.current]), useGlobalKeyDown(useCallback((event) => {
5704
+ }, t6 = [activeIndex, onItemSelect], $[20] = onItemSelect, $[21] = activeIndex, $[22] = t5, $[23] = t6) : (t5 = $[22], t6 = $[23]), useEffect(t5, t6);
5705
+ let t7;
5706
+ $[24] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[24] = t7) : t7 = $[24], useClickOutsideEvent(isTopLayer && onClickOutside, t7);
5707
+ let t8;
5708
+ $[25] !== isTopLayer || $[26] !== onEscape ? (t8 = (event) => {
5650
5709
  isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
5651
- }, [isTopLayer, onEscape]));
5652
- const value = useMemo(() => ({
5710
+ }, $[25] = isTopLayer, $[26] = onEscape, $[27] = t8) : t8 = $[27], useGlobalKeyDown(t8);
5711
+ let t9, t10;
5712
+ $[28] !== activeElement || $[29] !== activeIndex || $[30] !== mount || $[31] !== onClickOutside || $[32] !== onEscape || $[33] !== onItemClick || $[34] !== handleItemMouseEnter || $[35] !== handleItemMouseLeave || $[36] !== registerElement ? (t10 = {
5653
5713
  version: 0,
5654
5714
  activeElement,
5655
5715
  activeIndex,
@@ -5660,11 +5720,16 @@ const Root$5 = styled(Box)`
5660
5720
  onItemMouseEnter: handleItemMouseEnter,
5661
5721
  onItemMouseLeave: handleItemMouseLeave,
5662
5722
  registerElement,
5663
- // deprecated
5664
5723
  onMouseEnter: handleItemMouseEnter,
5665
5724
  onMouseLeave: handleItemMouseLeave
5666
- }), [activeElement, activeIndex, mount, handleItemMouseEnter, handleItemMouseLeave, onClickOutside, onEscape, onItemClick, registerElement]);
5667
- return /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: /* @__PURE__ */ jsx(Root$5, { "data-ui": "Menu", ...restProps, onKeyDown: handleKeyDown, padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { space, children }) }) });
5725
+ }, $[28] = activeElement, $[29] = activeIndex, $[30] = mount, $[31] = onClickOutside, $[32] = onEscape, $[33] = onItemClick, $[34] = handleItemMouseEnter, $[35] = handleItemMouseLeave, $[36] = registerElement, $[37] = t10) : t10 = $[37], t9 = t10;
5726
+ const value = t9;
5727
+ let t11;
5728
+ $[38] !== space || $[39] !== children ? (t11 = /* @__PURE__ */ jsx(Stack, { space, children }), $[38] = space, $[39] = children, $[40] = t11) : t11 = $[40];
5729
+ let t12;
5730
+ $[41] !== restProps || $[42] !== handleKeyDown || $[43] !== padding || $[44] !== handleRefChange || $[45] !== t11 ? (t12 = /* @__PURE__ */ 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];
5731
+ let t13;
5732
+ return $[47] !== value || $[48] !== t12 ? (t13 = /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: t12 }), $[47] = value, $[48] = t12, $[49] = t13) : t13 = $[49], t13;
5668
5733
  });
5669
5734
  Menu.displayName = "ForwardRef(Menu)";
5670
5735
  const MenuButton = forwardRef(function(props, forwardedRef) {
@@ -5878,20 +5943,23 @@ function useMenu() {
5878
5943
  return value;
5879
5944
  }
5880
5945
  function MenuGroup(props) {
5881
- const {
5882
- as = "button",
5946
+ const $ = c(77);
5947
+ let t0, t1, t2, t3, t4, t5, onClick, children, IconComponent, text, restProps, popover;
5948
+ $[0] !== props ? ({
5949
+ as: t0,
5883
5950
  children,
5884
- fontSize: fontSize2 = 1,
5951
+ fontSize: t1,
5885
5952
  icon: IconComponent,
5886
5953
  onClick,
5887
- padding = 3,
5954
+ padding: t2,
5888
5955
  popover,
5889
- radius = 2,
5890
- space = 3,
5956
+ radius: t3,
5957
+ space: t4,
5891
5958
  text,
5892
- tone = "default",
5959
+ tone: t5,
5893
5960
  ...restProps
5894
- } = props, menu = useMenu(), {
5961
+ } = 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]);
5962
+ 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(), {
5895
5963
  scheme
5896
5964
  } = useRootTheme(), {
5897
5965
  activeElement,
@@ -5899,56 +5967,99 @@ function MenuGroup(props) {
5899
5967
  onClickOutside,
5900
5968
  onEscape,
5901
5969
  onItemClick,
5902
- onItemMouseEnter = menu.onMouseEnter,
5970
+ onItemMouseEnter: _onItemMouseEnter,
5903
5971
  registerElement
5904
- } = menu, [rootElement, setRootElement] = useState(null), [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = useState(!1), handleMouseEnter = useCallback((event) => {
5972
+ } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onMouseEnter, [rootElement, setRootElement] = useState(null), [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = useState(!1);
5973
+ let t6;
5974
+ $[13] !== onItemMouseEnter ? (t6 = (event) => {
5905
5975
  setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
5906
- }, [onItemMouseEnter]), handleMenuKeyDown = useCallback((event_0) => {
5976
+ }, $[13] = onItemMouseEnter, $[14] = t6) : t6 = $[14];
5977
+ const handleMouseEnter = t6;
5978
+ let t7;
5979
+ $[15] !== rootElement ? (t7 = (event_0) => {
5907
5980
  event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
5908
5981
  rootElement?.focus();
5909
5982
  }));
5910
- }, [rootElement]), handleClick = useCallback((event_1) => {
5983
+ }, $[15] = rootElement, $[16] = t7) : t7 = $[16];
5984
+ const handleMenuKeyDown = t7;
5985
+ let t8;
5986
+ $[17] !== onClick ? (t8 = (event_1) => {
5911
5987
  onClick?.(event_1), setShouldFocus("first"), setOpen(!0);
5912
- }, [onClick]), handleChildItemClick = useCallback(() => {
5988
+ }, $[17] = onClick, $[18] = t8) : t8 = $[18];
5989
+ const handleClick = t8;
5990
+ let t9;
5991
+ $[19] !== onItemClick ? (t9 = () => {
5913
5992
  setOpen(!1), onItemClick?.();
5914
- }, [onItemClick]), handleMenuMouseEnter = useCallback(() => setWithinMenu(!0), []);
5915
- useEffect(() => mount(rootElement), [mount, rootElement]), useEffect(() => {
5993
+ }, $[19] = onItemClick, $[20] = t9) : t9 = $[20];
5994
+ const handleChildItemClick = t9;
5995
+ let t10;
5996
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => setWithinMenu(!0), $[21] = t10) : t10 = $[21];
5997
+ const handleMenuMouseEnter = t10;
5998
+ let t11, t12;
5999
+ $[22] !== mount || $[23] !== rootElement ? (t11 = () => mount(rootElement), t12 = [mount, rootElement], $[22] = mount, $[23] = rootElement, $[24] = t11, $[25] = t12) : (t11 = $[24], t12 = $[25]), useEffect(t11, t12);
6000
+ let t13, t14;
6001
+ $[26] !== active ? (t13 = () => {
5916
6002
  active || setOpen(!1);
5917
- }, [active]), useEffect(() => {
6003
+ }, t14 = [active], $[26] = active, $[27] = t13, $[28] = t14) : (t13 = $[27], t14 = $[28]), useEffect(t13, t14);
6004
+ let t15, t16;
6005
+ $[29] !== open ? (t15 = () => {
5918
6006
  open || setWithinMenu(!1);
5919
- }, [open]), useEffect(() => {
5920
- if (!shouldFocus) return;
6007
+ }, t16 = [open], $[29] = open, $[30] = t15, $[31] = t16) : (t15 = $[30], t16 = $[31]), useEffect(t15, t16);
6008
+ let t17, t18;
6009
+ $[32] !== shouldFocus ? (t17 = () => {
6010
+ if (!shouldFocus)
6011
+ return;
5921
6012
  const rafId = requestAnimationFrame(() => setShouldFocus(null));
5922
6013
  return () => cancelAnimationFrame(rafId);
5923
- }, [shouldFocus]);
5924
- const childMenu = /* @__PURE__ */ jsx(Menu, { onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), handleKeyDown = useCallback((event_2) => {
6014
+ }, t18 = [shouldFocus], $[32] = shouldFocus, $[33] = t17, $[34] = t18) : (t17 = $[33], t18 = $[34]), useEffect(t17, t18);
6015
+ let t19;
6016
+ $[35] !== onClickOutside || $[36] !== onEscape || $[37] !== handleChildItemClick || $[38] !== handleMenuKeyDown || $[39] !== registerElement || $[40] !== shouldFocus || $[41] !== children ? (t19 = /* @__PURE__ */ 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];
6017
+ const childMenu = t19;
6018
+ let t20;
6019
+ $[43] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_2) => {
5925
6020
  const target = event_2.currentTarget;
5926
6021
  if (document.activeElement === target && event_2.key === "ArrowRight") {
5927
6022
  setShouldFocus("first"), setOpen(!0), setWithinMenu(!0);
5928
6023
  return;
5929
6024
  }
5930
- }, []);
5931
- return /* @__PURE__ */ jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: /* @__PURE__ */ 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__ */ jsxs(Flex, { gap: space, padding, children: [
5932
- IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
5933
- isValidElement(IconComponent) && IconComponent,
5934
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
5935
- ] }),
5936
- /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
5937
- /* @__PURE__ */ jsx(Text, { size: fontSize2, children: /* @__PURE__ */ jsx(ChevronRightIcon, {}) })
5938
- ] }) }) });
6025
+ }, $[43] = t20) : t20 = $[43];
6026
+ 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;
6027
+ let t26;
6028
+ $[44] !== IconComponent || $[45] !== fontSize2 ? (t26 = IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6029
+ isValidElement(IconComponent) && IconComponent,
6030
+ isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
6031
+ ] }), $[44] = IconComponent, $[45] = fontSize2, $[46] = t26) : t26 = $[46];
6032
+ let t27;
6033
+ $[47] !== fontSize2 || $[48] !== text ? (t27 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }), $[47] = fontSize2, $[48] = text, $[49] = t27) : t27 = $[49];
6034
+ let t28;
6035
+ $[50] === Symbol.for("react.memo_cache_sentinel") ? (t28 = /* @__PURE__ */ jsx(ChevronRightIcon, {}), $[50] = t28) : t28 = $[50];
6036
+ let t29;
6037
+ $[51] !== fontSize2 ? (t29 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children: t28 }), $[51] = fontSize2, $[52] = t29) : t29 = $[52];
6038
+ let t30;
6039
+ $[53] !== space || $[54] !== padding || $[55] !== t26 || $[56] !== t27 || $[57] !== t29 ? (t30 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
6040
+ t26,
6041
+ t27,
6042
+ t29
6043
+ ] }), $[53] = space, $[54] = padding, $[55] = t26, $[56] = t27, $[57] = t29, $[58] = t30) : t30 = $[58];
6044
+ let t31;
6045
+ $[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__ */ 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];
6046
+ let t32;
6047
+ return $[72] !== popover || $[73] !== childMenu || $[74] !== open || $[75] !== t31 ? (t32 = /* @__PURE__ */ 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;
5939
6048
  }
5940
6049
  MenuGroup.displayName = "MenuGroup";
5941
6050
  const MenuItem = forwardRef(function(props, forwardedRef) {
5942
- const {
5943
- as = "button",
6051
+ const $ = c(74);
6052
+ let t0, t1, t2, t3, t4, t5, selectedProp, disabled, onClick, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft, pressed, IconComponent, text, IconRightComponent, hotkeys, children, restProps;
6053
+ $[0] !== props ? ({
6054
+ as: t0,
5944
6055
  children,
5945
6056
  disabled,
5946
- fontSize: fontSize2 = 1,
6057
+ fontSize: t1,
5947
6058
  hotkeys,
5948
6059
  icon: IconComponent,
5949
6060
  iconRight: IconRightComponent,
5950
6061
  onClick,
5951
- padding = 3,
6062
+ padding: t2,
5952
6063
  paddingX,
5953
6064
  paddingY,
5954
6065
  paddingTop,
@@ -5956,25 +6067,33 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
5956
6067
  paddingBottom,
5957
6068
  paddingLeft,
5958
6069
  pressed,
5959
- radius = 2,
6070
+ radius: t3,
5960
6071
  selected: selectedProp,
5961
- space = 3,
6072
+ space: t4,
5962
6073
  text,
5963
- tone = "default",
6074
+ tone: t5,
5964
6075
  ...restProps
5965
- } = props, {
6076
+ } = 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]);
6077
+ 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, {
5966
6078
  scheme
5967
6079
  } = useRootTheme(), menu = useMenu(), {
5968
6080
  activeElement,
5969
6081
  mount,
5970
6082
  onItemClick,
5971
- onItemMouseEnter = menu.onMouseEnter,
5972
- onItemMouseLeave = menu.onMouseLeave
5973
- } = menu, [rootElement, setRootElement] = useState(null), active = !!activeElement && activeElement === rootElement, ref = useRef(null);
5974
- useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => mount(rootElement, selectedProp), [mount, rootElement, selectedProp]);
5975
- const handleClick = useCallback((event) => {
6083
+ onItemMouseEnter: _onItemMouseEnter,
6084
+ onItemMouseLeave: _onItemMouseLeave
6085
+ } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onMouseEnter, onItemMouseLeave = _onItemMouseLeave ?? menu.onMouseLeave, [rootElement, setRootElement] = useState(null), active = !!activeElement && activeElement === rootElement, ref = useRef(null);
6086
+ let t6;
6087
+ $[23] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[23] = t6) : t6 = $[23], useImperativeHandle(forwardedRef, t6);
6088
+ let t7, t8;
6089
+ $[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]), useEffect(t7, t8);
6090
+ let t9;
6091
+ $[29] !== disabled || $[30] !== onClick || $[31] !== onItemClick ? (t9 = (event) => {
5976
6092
  disabled || (onClick && onClick(event), onItemClick && onItemClick());
5977
- }, [disabled, onClick, onItemClick]), paddingProps = useMemo(() => ({
6093
+ }, $[29] = disabled, $[30] = onClick, $[31] = onItemClick, $[32] = t9) : t9 = $[32];
6094
+ const handleClick = t9;
6095
+ let t10, t11;
6096
+ $[33] !== padding || $[34] !== paddingX || $[35] !== paddingY || $[36] !== paddingTop || $[37] !== paddingRight || $[38] !== paddingBottom || $[39] !== paddingLeft ? (t11 = {
5978
6097
  padding,
5979
6098
  paddingX,
5980
6099
  paddingY,
@@ -5982,29 +6101,44 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
5982
6101
  paddingRight,
5983
6102
  paddingBottom,
5984
6103
  paddingLeft
5985
- }), [padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft]), hotkeysFontSize = useArrayProp(fontSize2).map((s) => s - 1), setRef = useCallback((el) => {
6104
+ }, $[33] = padding, $[34] = paddingX, $[35] = paddingY, $[36] = paddingTop, $[37] = paddingRight, $[38] = paddingBottom, $[39] = paddingLeft, $[40] = t11) : t11 = $[40], t10 = t11;
6105
+ const paddingProps = t10, t12 = useArrayProp(fontSize2);
6106
+ let t13;
6107
+ $[41] !== t12 ? (t13 = t12.map(_temp$1), $[41] = t12, $[42] = t13) : t13 = $[42];
6108
+ const hotkeysFontSize = t13;
6109
+ let t14;
6110
+ $[43] === Symbol.for("react.memo_cache_sentinel") ? (t14 = (el) => {
5986
6111
  ref.current = el, setRootElement(el);
5987
- }, []);
5988
- return /* @__PURE__ */ 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: [
5989
- (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
5990
- IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
5991
- isValidElement(IconComponent) && IconComponent,
5992
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
5993
- ] }),
5994
- text && /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
5995
- hotkeys && /* @__PURE__ */ jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
5996
- marginTop: -4,
5997
- marginBottom: -4
5998
- } }),
5999
- IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6000
- isValidElement(IconRightComponent) && IconRightComponent,
6001
- isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
6002
- ] })
6112
+ }, $[43] = t14) : t14 = $[43];
6113
+ 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;
6114
+ let t23;
6115
+ $[44] !== IconComponent || $[45] !== text || $[46] !== IconRightComponent || $[47] !== fontSize2 || $[48] !== hotkeys || $[49] !== hotkeysFontSize || $[50] !== space || $[51] !== paddingProps ? (t23 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
6116
+ IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6117
+ isValidElement(IconComponent) && IconComponent,
6118
+ isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
6003
6119
  ] }),
6004
- children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children })
6005
- ] });
6120
+ text && /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
6121
+ hotkeys && /* @__PURE__ */ jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
6122
+ marginTop: -4,
6123
+ marginBottom: -4
6124
+ } }),
6125
+ IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6126
+ isValidElement(IconRightComponent) && IconRightComponent,
6127
+ isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
6128
+ ] })
6129
+ ] }), $[44] = IconComponent, $[45] = text, $[46] = IconRightComponent, $[47] = fontSize2, $[48] = hotkeys, $[49] = hotkeysFontSize, $[50] = space, $[51] = paddingProps, $[52] = t23) : t23 = $[52];
6130
+ let t24;
6131
+ $[53] !== children || $[54] !== paddingProps ? (t24 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[53] = children, $[54] = paddingProps, $[55] = t24) : t24 = $[55];
6132
+ let t25;
6133
+ 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__ */ 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: [
6134
+ t23,
6135
+ t24
6136
+ ] }), $[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;
6006
6137
  });
6007
6138
  MenuItem.displayName = "ForwardRef(MenuItem)";
6139
+ function _temp$1(s) {
6140
+ return s - 1;
6141
+ }
6008
6142
  const keyframe = keyframes`
6009
6143
  0% {
6010
6144
  background-position: 100%;
@@ -6172,9 +6306,6 @@ const CustomButton = styled(Button)`
6172
6306
  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__ */ 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;
6173
6307
  });
6174
6308
  Tab.displayName = "ForwardRef(Tab)";
6175
- function _isReactElement(node) {
6176
- return !!node;
6177
- }
6178
6309
  const CustomInline = styled(Inline)`
6179
6310
  & > div {
6180
6311
  display: inline-block;
@@ -6183,19 +6314,32 @@ const CustomInline = styled(Inline)`
6183
6314
  box-sizing: border-box;
6184
6315
  }
6185
6316
  `, TabList = forwardRef(function(props, ref) {
6186
- const {
6317
+ const $ = c(15);
6318
+ let childrenProp, restProps;
6319
+ $[0] !== props ? ({
6187
6320
  children: childrenProp,
6188
6321
  ...restProps
6189
- } = props, [focusedIndex, setFocusedIndex] = useState(-1), tabs = useMemo(() => childrenProp.filter(_isReactElement), [childrenProp]).map((child, childIndex) => cloneElement(child, {
6190
- focused: focusedIndex === childIndex,
6191
- key: childIndex,
6192
- onFocus: () => handleTabFocus(childIndex)
6193
- })), numTabs = tabs.length, handleTabFocus = useCallback((tabIdx) => {
6194
- setFocusedIndex(tabIdx);
6195
- }, []), handleKeyDown = useCallback((event) => {
6322
+ } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps) : (childrenProp = $[1], restProps = $[2]);
6323
+ const [focusedIndex, setFocusedIndex] = useState(-1);
6324
+ let t0;
6325
+ if ($[3] !== childrenProp || $[4] !== focusedIndex) {
6326
+ const children = Children.toArray(childrenProp).filter(isValidElement);
6327
+ let t12;
6328
+ $[6] !== focusedIndex ? (t12 = (child, childIndex) => cloneElement(child, {
6329
+ focused: focusedIndex === childIndex,
6330
+ key: childIndex,
6331
+ onFocus: () => setFocusedIndex(childIndex)
6332
+ }), $[6] = focusedIndex, $[7] = t12) : t12 = $[7], t0 = children.map(t12), $[3] = childrenProp, $[4] = focusedIndex, $[5] = t0;
6333
+ } else
6334
+ t0 = $[5];
6335
+ const tabs = t0, numTabs = tabs.length;
6336
+ let t1;
6337
+ $[8] !== numTabs ? (t1 = (event) => {
6196
6338
  event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
6197
- }, [numTabs]);
6198
- return /* @__PURE__ */ jsx(CustomInline, { "data-ui": "TabList", ...restProps, onKeyDown: handleKeyDown, ref, role: "tablist", children: tabs });
6339
+ }, $[8] = numTabs, $[9] = t1) : t1 = $[9];
6340
+ const handleKeyDown = t1;
6341
+ let t2;
6342
+ return $[10] !== restProps || $[11] !== handleKeyDown || $[12] !== ref || $[13] !== tabs ? (t2 = /* @__PURE__ */ 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;
6199
6343
  });
6200
6344
  TabList.displayName = "ForwardRef(TabList)";
6201
6345
  const TabPanel = forwardRef(function(props, ref) {