@avenue-ticketing/ui 0.12.0-beta.1 → 0.12.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/react/badge-groups.js +2 -2
  2. package/dist/react/badge-groups.js.map +1 -1
  3. package/dist/react/badge.js +49 -18
  4. package/dist/react/badge.js.map +1 -1
  5. package/dist/react/button.js +2 -2
  6. package/dist/react/button.js.map +1 -1
  7. package/dist/react/checkbox.js +10 -7
  8. package/dist/react/checkbox.js.map +1 -1
  9. package/dist/react/combobox.d.ts +3 -2
  10. package/dist/react/combobox.js +284 -32
  11. package/dist/react/combobox.js.map +1 -1
  12. package/dist/react/dropdown-account-breadcrumb.js +176 -14
  13. package/dist/react/dropdown-account-breadcrumb.js.map +1 -1
  14. package/dist/react/dropdown-account-button.js +190 -25
  15. package/dist/react/dropdown-account-button.js.map +1 -1
  16. package/dist/react/dropdown-account-card-md.js +189 -24
  17. package/dist/react/dropdown-account-card-md.js.map +1 -1
  18. package/dist/react/dropdown-account-card-sm.js +189 -24
  19. package/dist/react/dropdown-account-card-sm.js.map +1 -1
  20. package/dist/react/dropdown-account-card-xs.js +189 -24
  21. package/dist/react/dropdown-account-card-xs.js.map +1 -1
  22. package/dist/react/dropdown-avatar.js +190 -25
  23. package/dist/react/dropdown-avatar.js.map +1 -1
  24. package/dist/react/dropdown-button-advanced.js +190 -25
  25. package/dist/react/dropdown-button-advanced.js.map +1 -1
  26. package/dist/react/dropdown-button-link.js +189 -24
  27. package/dist/react/dropdown-button-link.js.map +1 -1
  28. package/dist/react/dropdown-button-simple.js +190 -25
  29. package/dist/react/dropdown-button-simple.js.map +1 -1
  30. package/dist/react/dropdown-icon-advanced.js +189 -24
  31. package/dist/react/dropdown-icon-advanced.js.map +1 -1
  32. package/dist/react/dropdown-icon-simple.js +189 -24
  33. package/dist/react/dropdown-icon-simple.js.map +1 -1
  34. package/dist/react/dropdown-integration.js +190 -25
  35. package/dist/react/dropdown-integration.js.map +1 -1
  36. package/dist/react/dropdown-search-advanced.js +191 -26
  37. package/dist/react/dropdown-search-advanced.js.map +1 -1
  38. package/dist/react/dropdown-search-simple.js +191 -26
  39. package/dist/react/dropdown-search-simple.js.map +1 -1
  40. package/dist/react/dropdown.d.ts +4 -1
  41. package/dist/react/dropdown.js +189 -24
  42. package/dist/react/dropdown.js.map +1 -1
  43. package/dist/react/input-date.js.map +1 -1
  44. package/dist/react/input-file.js +3 -3
  45. package/dist/react/input-file.js.map +1 -1
  46. package/dist/react/input-group.js.map +1 -1
  47. package/dist/react/input-number.js +2 -2
  48. package/dist/react/input-number.js.map +1 -1
  49. package/dist/react/input-payment.js +1 -1
  50. package/dist/react/input-payment.js.map +1 -1
  51. package/dist/react/input-tags-outer.js +9 -9
  52. package/dist/react/input-tags-outer.js.map +1 -1
  53. package/dist/react/input-tags.js +8 -8
  54. package/dist/react/input-tags.js.map +1 -1
  55. package/dist/react/input.js +1 -1
  56. package/dist/react/input.js.map +1 -1
  57. package/dist/react/multi-select.d.ts +3 -2
  58. package/dist/react/multi-select.js +230 -29
  59. package/dist/react/multi-select.js.map +1 -1
  60. package/dist/react/popover.d.ts +10 -1
  61. package/dist/react/popover.js +195 -18
  62. package/dist/react/popover.js.map +1 -1
  63. package/dist/react/radio-buttons.js +2 -1
  64. package/dist/react/radio-buttons.js.map +1 -1
  65. package/dist/react/select-item.d.ts +2 -1
  66. package/dist/react/select-item.js +11 -7
  67. package/dist/react/select-item.js.map +1 -1
  68. package/dist/react/select.d.ts +4 -3
  69. package/dist/react/select.js +298 -42
  70. package/dist/react/select.js.map +1 -1
  71. package/dist/react/switch.js +1 -1
  72. package/dist/react/switch.js.map +1 -1
  73. package/dist/react/tag-select.d.ts +5 -2
  74. package/dist/react/tag-select.js +215 -25
  75. package/dist/react/tag-select.js.map +1 -1
  76. package/dist/react/tags.js +8 -8
  77. package/dist/react/tags.js.map +1 -1
  78. package/dist/react/textarea.js.map +1 -1
  79. package/dist/select-mobile-sheet-CB2ptDTJ.d.ts +12 -0
  80. package/dist/{select-shared-B3Y5SMXU.d.ts → select-shared-oJEeJxeB.d.ts} +6 -0
  81. package/package.json +1 -1
  82. package/theme.css +3 -1
@@ -1,4 +1,4 @@
1
- import { createContext, useState, isValidElement, useCallback, useRef, useLayoutEffect } from 'react';
1
+ import { createContext, useState, isValidElement, useMemo, useContext, useEffect, useCallback, useLayoutEffect, useRef } from 'react';
2
2
  import { ArrowLeftIcon } from '@phosphor-icons/react/dist/csr/ArrowLeft';
3
3
  import { ArrowRightIcon } from '@phosphor-icons/react/dist/csr/ArrowRight';
4
4
  import { CaretDownIcon } from '@phosphor-icons/react/dist/csr/CaretDown';
@@ -10,12 +10,14 @@ import { PencilLineIcon } from '@phosphor-icons/react/dist/csr/PencilLine';
10
10
  import { ArrowCounterClockwiseIcon } from '@phosphor-icons/react/dist/csr/ArrowCounterClockwise';
11
11
  import { ScissorsIcon } from '@phosphor-icons/react/dist/csr/Scissors';
12
12
  import { StarIcon } from '@phosphor-icons/react/dist/csr/Star';
13
- import { MenuTrigger, MenuSection, SubmenuTrigger, Link, Button as Button$1, Popover, Menu, MenuItem, Separator } from 'react-aria-components';
13
+ import { MenuTrigger, MenuSection, SubmenuTrigger, Link, Button as Button$1, OverlayTriggerStateContext, Popover, Menu, MenuItem, Separator } from 'react-aria-components';
14
14
  import { extendTailwindMerge } from 'tailwind-merge';
15
15
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
16
+ import { createPortal } from 'react-dom';
16
17
  import { CheckIcon } from '@phosphor-icons/react/dist/csr/Check';
17
18
  import { CaretRightIcon } from '@phosphor-icons/react/dist/csr/CaretRight';
18
19
  import '@phosphor-icons/react/dist/csr/DotsThreeVertical';
20
+ import { XIcon } from '@phosphor-icons/react/dist/csr/X';
19
21
  import { UserIcon } from '@phosphor-icons/react/dist/csr/User';
20
22
  import '@phosphor-icons/react/dist/csr/Plus';
21
23
 
@@ -153,7 +155,7 @@ var styles = sortCx({
153
155
  "hover:bg-primary_hover hover:text-secondary_hover",
154
156
  "disabled:opacity-50",
155
157
  "data-loading:bg-primary_hover",
156
- "*:data-icon:text-fg-secondary hover:*:data-icon:text-fg-quaternary_hover"
158
+ "*:data-icon:text-fg-secondary"
157
159
  ].join(" ")
158
160
  },
159
161
  /** Figma Hierarchy=Tertiary */
@@ -163,7 +165,7 @@ var styles = sortCx({
163
165
  focusShadowPlain,
164
166
  "hover:bg-primary_hover hover:text-tertiary_hover",
165
167
  "disabled:opacity-50",
166
- "*:data-icon:text-fg-tertiary hover:*:data-icon:text-fg-quaternary_hover"
168
+ "*:data-icon:text-fg-tertiary"
167
169
  ].join(" ")
168
170
  },
169
171
  /** Figma Hierarchy=Link color — text + icons share brand-secondary; hover underlines with fg-brand-secondary. */
@@ -294,6 +296,81 @@ var Button = ({
294
296
  }
295
297
  return /* @__PURE__ */ jsx(Button$1, { ...commonProps, type: commonProps.type || "button", isPending: loading });
296
298
  };
299
+ var MOBILE_SHEET_MOTION_MS = 175;
300
+ var MOBILE_SHEET_ENTRY_EASING = "cubic-bezier(0.85, 0, 0.15, 1)";
301
+ var MOBILE_SHEET_EXIT_EASING = "cubic-bezier(0.85, 0, 1, 0.15)";
302
+ var MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_PX = 120;
303
+ function resolveSelectMobileOptions(mobileOptions) {
304
+ return {
305
+ sheet: mobileOptions?.sheet ?? true,
306
+ title: mobileOptions?.title,
307
+ sheetClassName: mobileOptions?.className,
308
+ contentClassName: mobileOptions?.contentClassName
309
+ };
310
+ }
311
+ function useMobileSheetAnimation(open, enabled, slideEntrance = true, slideOffsetPx = MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_PX) {
312
+ const [shouldRender, setShouldRender] = useState(open);
313
+ const [isAnimating, setIsAnimating] = useState(false);
314
+ useLayoutEffect(() => {
315
+ if (!enabled) {
316
+ setShouldRender(open);
317
+ return;
318
+ }
319
+ if (open) {
320
+ setShouldRender(true);
321
+ }
322
+ }, [open, enabled]);
323
+ useEffect(() => {
324
+ if (!enabled || open) return;
325
+ const timer = setTimeout(() => setShouldRender(false), MOBILE_SHEET_MOTION_MS);
326
+ return () => clearTimeout(timer);
327
+ }, [open, enabled]);
328
+ useLayoutEffect(() => {
329
+ if (!enabled || open || !shouldRender) return;
330
+ setIsAnimating(false);
331
+ }, [enabled, open, shouldRender]);
332
+ useEffect(() => {
333
+ if (!enabled || !shouldRender || !open) return;
334
+ let raf2 = 0;
335
+ const raf1 = requestAnimationFrame(() => {
336
+ raf2 = requestAnimationFrame(() => setIsAnimating(true));
337
+ });
338
+ return () => {
339
+ cancelAnimationFrame(raf1);
340
+ if (raf2) cancelAnimationFrame(raf2);
341
+ };
342
+ }, [shouldRender, open, enabled]);
343
+ const motionEasing = open ? MOBILE_SHEET_ENTRY_EASING : MOBILE_SHEET_EXIT_EASING;
344
+ const hiddenTransform = slideEntrance ? `translateY(${slideOffsetPx}px)` : "translateY(100%)";
345
+ const panelStyle = enabled ? {
346
+ transform: isAnimating ? "translateY(0)" : hiddenTransform,
347
+ opacity: isAnimating ? 1 : 0,
348
+ transitionProperty: "transform, opacity",
349
+ transitionDuration: `${MOBILE_SHEET_MOTION_MS}ms`,
350
+ transitionTimingFunction: motionEasing
351
+ } : void 0;
352
+ const backdropStyle = enabled ? {
353
+ opacity: isAnimating ? 1 : 0,
354
+ transitionProperty: "opacity",
355
+ transitionDuration: `${MOBILE_SHEET_MOTION_MS}ms`,
356
+ transitionTimingFunction: motionEasing
357
+ } : void 0;
358
+ return { shouldRender, isAnimating, panelStyle, backdropStyle };
359
+ }
360
+ var MOBILE_SHEET_MAX_PX = 1024;
361
+ function useIsMobile(breakpoint = MOBILE_SHEET_MAX_PX + 1) {
362
+ const [isMobile, setIsMobile] = useState(() => {
363
+ if (typeof window === "undefined") return false;
364
+ return window.matchMedia(`(max-width: ${breakpoint - 1}px)`).matches;
365
+ });
366
+ useEffect(() => {
367
+ const mq = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
368
+ const handler = (e) => setIsMobile(e.matches);
369
+ mq.addEventListener("change", handler);
370
+ return () => mq.removeEventListener("change", handler);
371
+ }, [breakpoint]);
372
+ return isMobile;
373
+ }
297
374
  var sizes = {
298
375
  xs: "size-1.5",
299
376
  sm: "size-2",
@@ -446,7 +523,7 @@ var Avatar = ({
446
523
  };
447
524
  var CHECKBOX_TICK_DELAY_MS = 60;
448
525
  var CHECKBOX_TICK_DRAW_MS = 100;
449
- function CheckboxAnimatedCheckMark({ className }) {
526
+ function CheckboxAnimatedCheckMark({ pixelSize, className }) {
450
527
  const pathRef = useRef(null);
451
528
  useLayoutEffect(() => {
452
529
  const path = pathRef.current;
@@ -467,7 +544,7 @@ function CheckboxAnimatedCheckMark({ className }) {
467
544
  });
468
545
  return () => anim.cancel();
469
546
  }, []);
470
- return /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", viewBox: "0 0 14 14", fill: "none", className: cx("block shrink-0", className), children: /* @__PURE__ */ jsx(
547
+ return /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", width: pixelSize, height: pixelSize, viewBox: "0 0 14 14", fill: "none", className: cx("block", className), children: /* @__PURE__ */ jsx(
471
548
  "path",
472
549
  {
473
550
  ref: pathRef,
@@ -482,14 +559,15 @@ function CheckboxAnimatedCheckMark({ className }) {
482
559
  var focusRingShadow = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
483
560
  var CheckboxBase = ({ className, isSelected, isDisabled, isIndeterminate, size = "sm", isFocusVisible = false }) => {
484
561
  const isChecked = isSelected || isIndeterminate;
485
- const iconClassName = size === "sm" ? "size-2.5" : "size-3.5";
562
+ const iconPixelSize = size === "sm" ? 10 : 14;
486
563
  return /* @__PURE__ */ jsxs(
487
564
  "div",
488
565
  {
489
566
  className: cx(
490
- "relative flex shrink-0 cursor-pointer appearance-none items-center justify-center border border-solid border-primary",
567
+ "relative flex shrink-0 cursor-pointer appearance-none items-center justify-center overflow-clip border border-solid border-primary",
491
568
  size === "sm" ? "size-4 rounded-xs" : "size-5 rounded-sm",
492
569
  isChecked ? "border-transparent bg-brand-solid" : "bg-primary",
570
+ !isChecked && !isDisabled && "group-hover:bg-primary_hover",
493
571
  isDisabled && "cursor-not-allowed opacity-50",
494
572
  isDisabled && !isChecked && "bg-tertiary",
495
573
  isFocusVisible && !isDisabled && focusRingShadow,
@@ -500,13 +578,15 @@ var CheckboxBase = ({ className, isSelected, isDisabled, isIndeterminate, size =
500
578
  "svg",
501
579
  {
502
580
  "aria-hidden": "true",
581
+ width: iconPixelSize,
582
+ height: iconPixelSize,
503
583
  viewBox: "0 0 14 14",
504
584
  fill: "none",
505
- className: cx("pointer-events-none block shrink-0 text-fg-white", iconClassName),
585
+ className: "pointer-events-none block text-fg-white",
506
586
  children: /* @__PURE__ */ jsx("path", { d: "M2.91675 7H11.0834", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
507
587
  }
508
588
  ),
509
- isSelected && !isIndeterminate && /* @__PURE__ */ jsx(CheckboxAnimatedCheckMark, { className: cx("pointer-events-none text-fg-white", iconClassName) })
589
+ isSelected && !isIndeterminate && /* @__PURE__ */ jsx(CheckboxAnimatedCheckMark, { pixelSize: iconPixelSize, className: "pointer-events-none text-fg-white" })
510
590
  ]
511
591
  }
512
592
  );
@@ -551,6 +631,7 @@ var RadioButtonBase = ({ className, isFocusVisible, isSelected, isDisabled, size
551
631
  "relative flex shrink-0 cursor-pointer appearance-none items-center justify-center overflow-clip rounded-full border border-solid border-primary bg-primary",
552
632
  size === "sm" ? "size-4" : "size-5",
553
633
  isSelected && "border-transparent bg-brand-solid",
634
+ !isSelected && !isDisabled && "group-hover:bg-primary_hover",
554
635
  isDisabled && "cursor-not-allowed opacity-50",
555
636
  isDisabled && !isSelected && "bg-tertiary",
556
637
  isFocusVisible && !isDisabled && focusRingShadow2,
@@ -592,7 +673,7 @@ var ToggleBase = ({ className, isHovered, isDisabled, isFocusVisible, isSelected
592
673
  const classes = slim ? styles3.slim[size] : styles3.default[size];
593
674
  const offTrackBackground = (() => {
594
675
  if (isDisabled) return "bg-tertiary";
595
- if (isHovered) return slim ? "bg-tertiary" : "bg-brand-primary";
676
+ if (isHovered) return "bg-toggle-track_hover";
596
677
  return "bg-quaternary";
597
678
  })();
598
679
  return /* @__PURE__ */ jsx(
@@ -687,11 +768,11 @@ var DropdownItem = ({ label, children, addon, icon: Icon, avatarUrl, unstyled, s
687
768
  children: [
688
769
  state.selectionMode !== "none" && !avatarUrl && !Icon && /* @__PURE__ */ jsx(SelectionIndicator, { ...state, className: "mr-2" }),
689
770
  avatarUrl && /* @__PURE__ */ jsx("div", { className: "mr-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx(Avatar, { "aria-hidden": "true", size: "xs", src: avatarUrl, alt: label, className: "size-5" }) }),
690
- Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", className: "mr-2 size-4 shrink-0 stroke-[2.25px] text-fg-quaternary" }),
771
+ Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", className: "mr-2 size-4 shrink-0 stroke-[2.25px] text-fg-secondary" }),
691
772
  /* @__PURE__ */ jsx("span", { className: cx("grow truncate text-sm font-semibold text-secondary", state.isFocused && "text-secondary_hover"), children: label || (typeof children === "function" ? children(state) : children) }),
692
773
  addon && /* @__PURE__ */ jsx("span", { className: "ml-1 shrink-0 pr-1 text-xs font-medium text-quaternary", children: addon }),
693
774
  state.selectionMode !== "none" && (avatarUrl || Icon) && /* @__PURE__ */ jsx(SelectionIndicator, { ...state, className: "ml-1" }),
694
- state.hasSubmenu && /* @__PURE__ */ jsx(CaretRightIcon, { "aria-hidden": "true", className: "ml-auto size-4 shrink-0 stroke-[2.25px] text-fg-quaternary" })
775
+ state.hasSubmenu && /* @__PURE__ */ jsx(CaretRightIcon, { "aria-hidden": "true", className: "ml-auto size-4 shrink-0 stroke-[2.25px] text-fg-secondary" })
695
776
  ]
696
777
  }
697
778
  )
@@ -707,21 +788,105 @@ var DropdownMenu = (props) => {
707
788
  }
708
789
  );
709
790
  };
710
- var DropdownPopover = (props) => {
711
- return /* @__PURE__ */ jsx(
712
- Popover,
791
+ var DropdownSheetDepthContext = createContext(0);
792
+ function DropdownSheetCloseButton({ onClose }) {
793
+ return /* @__PURE__ */ jsxs(
794
+ "button",
713
795
  {
714
- placement: "bottom right",
715
- ...props,
716
- className: (state) => cx(
717
- "w-62 origin-(--trigger-anchor-point) overflow-auto rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
718
- state.isEntering && "duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5",
719
- state.isExiting && "duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5",
720
- typeof props.className === "function" ? props.className(state) : props.className
721
- ),
722
- children: props.children
796
+ type: "button",
797
+ onClick: (e) => {
798
+ e.stopPropagation();
799
+ onClose();
800
+ },
801
+ className: "flex size-12 shrink-0 cursor-pointer items-center justify-center rounded-full text-fg-primary transition duration-100 ease-linear hover:bg-primary_hover active:scale-[0.96] focus-visible:outline-none focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]",
802
+ children: [
803
+ /* @__PURE__ */ jsx(XIcon, { className: "size-5", "aria-hidden": "true" }),
804
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
805
+ ]
723
806
  }
724
807
  );
808
+ }
809
+ function DropdownSheetChrome({ title, onClose, children }) {
810
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
811
+ /* @__PURE__ */ jsxs("div", { className: cx("flex w-full shrink-0 items-center py-2 pl-4 pr-2", title ? "justify-between gap-3" : "justify-end"), children: [
812
+ title ? /* @__PURE__ */ jsx("p", { className: "min-w-0 flex-1 truncate text-base font-semibold text-primary", children: title }) : null,
813
+ /* @__PURE__ */ jsx(DropdownSheetCloseButton, { onClose })
814
+ ] }),
815
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto pb-[max(2.5rem,calc(env(safe-area-inset-bottom)+2rem))]", children })
816
+ ] });
817
+ }
818
+ var DropdownPopover = ({ mobileOptions, children, className, style, ...props }) => {
819
+ const isMobile = useIsMobile();
820
+ const resolvedMobile = useMemo(() => resolveSelectMobileOptions(mobileOptions), [mobileOptions]);
821
+ const useMobileSheet = isMobile && resolvedMobile.sheet;
822
+ const overlayState = useContext(OverlayTriggerStateContext);
823
+ const open = overlayState?.isOpen ?? false;
824
+ const parentDepth = useContext(DropdownSheetDepthContext);
825
+ const depth = parentDepth + 1;
826
+ const { shouldRender, panelStyle, backdropStyle } = useMobileSheetAnimation(open, useMobileSheet);
827
+ useEffect(() => {
828
+ if (!useMobileSheet || !open) return;
829
+ const prev = document.body.style.overflow;
830
+ document.body.style.overflow = "hidden";
831
+ return () => {
832
+ document.body.style.overflow = prev;
833
+ };
834
+ }, [useMobileSheet, open]);
835
+ if (!useMobileSheet) {
836
+ return /* @__PURE__ */ jsx(
837
+ Popover,
838
+ {
839
+ placement: "bottom right",
840
+ ...props,
841
+ style,
842
+ className: (state) => cx(
843
+ "w-62 origin-(--trigger-anchor-point) overflow-auto rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
844
+ state.isEntering && "duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5",
845
+ state.isExiting && "duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5",
846
+ typeof className === "function" ? className(state) : className
847
+ ),
848
+ children
849
+ }
850
+ );
851
+ }
852
+ const close = () => overlayState?.close();
853
+ const showMobileSheet = shouldRender;
854
+ const isMobileSheetExiting = showMobileSheet && !open;
855
+ const scrimZIndex = 50 + (depth - 1) * 10;
856
+ const sheetZIndex = scrimZIndex + 1;
857
+ const mobileScrim = shouldRender && typeof document !== "undefined" ? createPortal(
858
+ /* @__PURE__ */ jsx(
859
+ "div",
860
+ {
861
+ className: "fixed inset-0 bg-overlay/70",
862
+ style: { ...backdropStyle, zIndex: scrimZIndex },
863
+ onClick: close,
864
+ "aria-hidden": "true"
865
+ }
866
+ ),
867
+ document.body
868
+ ) : null;
869
+ return /* @__PURE__ */ jsxs(DropdownSheetDepthContext.Provider, { value: depth, children: [
870
+ mobileScrim,
871
+ /* @__PURE__ */ jsx(
872
+ Popover,
873
+ {
874
+ placement: "bottom",
875
+ containerPadding: 0,
876
+ offset: 0,
877
+ ...props,
878
+ isExiting: isMobileSheetExiting,
879
+ "data-dropdown-mobile-sheet": true,
880
+ style: { ...panelStyle, zIndex: sheetZIndex, ...style },
881
+ className: (state) => cx(
882
+ "fixed! inset-x-0! bottom-0! top-auto! right-0! left-0! flex max-h-[min(90dvh,calc(100dvh-env(safe-area-inset-bottom,0px)))] w-full! max-w-none! flex-col overflow-hidden rounded-t-2xl rounded-b-none border-x-0 border-t border-secondary bg-primary shadow-xl outline-hidden",
883
+ resolvedMobile.sheetClassName,
884
+ typeof className === "function" ? className(state) : className
885
+ ),
886
+ children: /* @__PURE__ */ jsx(DropdownSheetChrome, { title: resolvedMobile.title, onClose: close, children: typeof children === "function" ? null : children })
887
+ }
888
+ )
889
+ ] });
725
890
  };
726
891
  var DropdownSeparator = (props) => {
727
892
  return /* @__PURE__ */ jsx(Separator, { ...props, className: cx("my-1 h-px w-full bg-border-secondary", props.className) });