@avenue-ticketing/ui 0.11.0 → 0.12.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/dist/badge-types-B67wcd4m.d.ts +22 -0
- package/dist/react/app-store-buttons-outline.d.ts +17 -0
- package/dist/react/app-store-buttons-outline.js +582 -0
- package/dist/react/app-store-buttons-outline.js.map +1 -0
- package/dist/react/app-store-buttons.d.ts +20 -0
- package/dist/react/app-store-buttons.js +817 -0
- package/dist/react/app-store-buttons.js.map +1 -0
- package/dist/react/avatar-label-group.d.ts +14 -0
- package/dist/react/avatar-label-group.js +183 -0
- package/dist/react/avatar-label-group.js.map +1 -0
- package/dist/react/avatar-profile-photo.d.ts +9 -0
- package/dist/react/avatar-profile-photo.js +202 -0
- package/dist/react/avatar-profile-photo.js.map +1 -0
- package/dist/react/avatar.d.ts +66 -40
- package/dist/react/avatar.js +159 -149
- package/dist/react/avatar.js.map +1 -1
- package/dist/react/badge-groups.d.ts +25 -0
- package/dist/react/badge-groups.js +162 -0
- package/dist/react/badge-groups.js.map +1 -0
- package/dist/react/badge.d.ts +123 -59
- package/dist/react/badge.js +314 -86
- package/dist/react/badge.js.map +1 -1
- package/dist/react/button-group.d.ts +43 -0
- package/dist/react/button-group.js +108 -0
- package/dist/react/button-group.js.map +1 -0
- package/dist/react/button-utility.d.ts +47 -0
- package/dist/react/button-utility.js +158 -0
- package/dist/react/button-utility.js.map +1 -0
- package/dist/react/button.d.ts +112 -37
- package/dist/react/button.js +270 -55
- package/dist/react/button.js.map +1 -1
- package/dist/react/checkbox.d.ts +25 -8
- package/dist/react/checkbox.js +115 -110
- package/dist/react/checkbox.js.map +1 -1
- package/dist/react/close-button.d.ts +25 -0
- package/dist/react/close-button.js +54 -0
- package/dist/react/close-button.js.map +1 -0
- package/dist/react/combobox.d.ts +18 -0
- package/dist/react/combobox.js +574 -0
- package/dist/react/combobox.js.map +1 -0
- package/dist/react/dialog.d.ts +15 -15
- package/dist/react/dialog.js +43 -108
- package/dist/react/dialog.js.map +1 -1
- package/dist/react/dropdown-account-breadcrumb.d.ts +5 -0
- package/dist/react/dropdown-account-breadcrumb.js +481 -0
- package/dist/react/dropdown-account-breadcrumb.js.map +1 -0
- package/dist/react/dropdown-account-button.d.ts +5 -0
- package/dist/react/dropdown-account-button.js +938 -0
- package/dist/react/dropdown-account-button.js.map +1 -0
- package/dist/react/dropdown-account-card-md.d.ts +5 -0
- package/dist/react/dropdown-account-card-md.js +714 -0
- package/dist/react/dropdown-account-card-md.js.map +1 -0
- package/dist/react/dropdown-account-card-sm.d.ts +5 -0
- package/dist/react/dropdown-account-card-sm.js +692 -0
- package/dist/react/dropdown-account-card-sm.js.map +1 -0
- package/dist/react/dropdown-account-card-xs.d.ts +5 -0
- package/dist/react/dropdown-account-card-xs.js +672 -0
- package/dist/react/dropdown-account-card-xs.js.map +1 -0
- package/dist/react/dropdown-avatar.d.ts +5 -0
- package/dist/react/dropdown-avatar.js +955 -0
- package/dist/react/dropdown-avatar.js.map +1 -0
- package/dist/react/dropdown-button-advanced.d.ts +5 -0
- package/dist/react/dropdown-button-advanced.js +964 -0
- package/dist/react/dropdown-button-advanced.js.map +1 -0
- package/dist/react/dropdown-button-link.d.ts +5 -0
- package/dist/react/dropdown-button-link.js +666 -0
- package/dist/react/dropdown-button-link.js.map +1 -0
- package/dist/react/dropdown-button-simple.d.ts +5 -0
- package/dist/react/dropdown-button-simple.js +919 -0
- package/dist/react/dropdown-button-simple.js.map +1 -0
- package/dist/react/dropdown-icon-advanced.d.ts +5 -0
- package/dist/react/dropdown-icon-advanced.js +708 -0
- package/dist/react/dropdown-icon-advanced.js.map +1 -0
- package/dist/react/dropdown-icon-simple.d.ts +5 -0
- package/dist/react/dropdown-icon-simple.js +670 -0
- package/dist/react/dropdown-icon-simple.js.map +1 -0
- package/dist/react/dropdown-integration.d.ts +5 -0
- package/dist/react/dropdown-integration.js +1490 -0
- package/dist/react/dropdown-integration.js.map +1 -0
- package/dist/react/dropdown-search-advanced.d.ts +5 -0
- package/dist/react/dropdown-search-advanced.js +1163 -0
- package/dist/react/dropdown-search-advanced.js.map +1 -0
- package/dist/react/dropdown-search-simple.d.ts +5 -0
- package/dist/react/dropdown-search-simple.js +1125 -0
- package/dist/react/dropdown-search-simple.js.map +1 -0
- package/dist/react/dropdown.d.ts +35 -133
- package/dist/react/dropdown.js +536 -1318
- package/dist/react/dropdown.js.map +1 -1
- package/dist/react/file-upload-trigger.d.ts +34 -0
- package/dist/react/file-upload-trigger.js +39 -0
- package/dist/react/file-upload-trigger.js.map +1 -0
- package/dist/react/form.d.ts +10 -0
- package/dist/react/form.js +11 -0
- package/dist/react/form.js.map +1 -0
- package/dist/react/hint-text.d.ts +17 -0
- package/dist/react/hint-text.js +36 -0
- package/dist/react/hint-text.js.map +1 -0
- package/dist/react/hook-form.d.ts +35 -0
- package/dist/react/hook-form.js +50 -0
- package/dist/react/hook-form.js.map +1 -0
- package/dist/react/input-date.d.ts +43 -0
- package/dist/react/input-date.js +306 -0
- package/dist/react/input-date.js.map +1 -0
- package/dist/react/input-file.d.ts +45 -0
- package/dist/react/input-file.js +748 -0
- package/dist/react/input-file.js.map +1 -0
- package/dist/react/input-group.d.ts +37 -0
- package/dist/react/input-group.js +251 -0
- package/dist/react/input-group.js.map +1 -0
- package/dist/react/input-number.d.ts +32 -0
- package/dist/react/input-number.js +553 -0
- package/dist/react/input-number.js.map +1 -0
- package/dist/react/input-payment.d.ts +16 -0
- package/dist/react/input-payment.js +593 -0
- package/dist/react/input-payment.js.map +1 -0
- package/dist/react/input-tags-outer.d.ts +53 -0
- package/dist/react/input-tags-outer.js +607 -0
- package/dist/react/input-tags-outer.js.map +1 -0
- package/dist/react/input-tags.d.ts +53 -0
- package/dist/react/input-tags.js +565 -0
- package/dist/react/input-tags.js.map +1 -0
- package/dist/react/input.d.ts +71 -22
- package/dist/react/input.js +332 -45
- package/dist/react/input.js.map +1 -1
- package/dist/react/label.d.ts +18 -0
- package/dist/react/label.js +112 -0
- package/dist/react/label.js.map +1 -0
- package/dist/react/multi-select.d.ts +90 -0
- package/dist/react/multi-select.js +1237 -0
- package/dist/react/multi-select.js.map +1 -0
- package/dist/react/pin-input.d.ts +59 -0
- package/dist/react/pin-input.js +229 -0
- package/dist/react/pin-input.js.map +1 -0
- package/dist/react/popover.d.ts +14 -71
- package/dist/react/popover.js +171 -540
- package/dist/react/popover.js.map +1 -1
- package/dist/react/progress-circle.d.ts +9 -0
- package/dist/react/progress-circle.js +36 -0
- package/dist/react/progress-circle.js.map +1 -0
- package/dist/react/progress-circles.d.ts +14 -0
- package/dist/react/progress-circles.js +160 -0
- package/dist/react/progress-circles.js.map +1 -0
- package/dist/react/progress-indicators.d.ts +52 -0
- package/dist/react/progress-indicators.js +78 -0
- package/dist/react/progress-indicators.js.map +1 -0
- package/dist/react/radio-buttons.d.ts +35 -0
- package/dist/react/radio-buttons.js +117 -0
- package/dist/react/radio-buttons.js.map +1 -0
- package/dist/react/scroll-header.d.ts +6 -0
- package/dist/react/scroll-header.js +42 -61
- package/dist/react/scroll-header.js.map +1 -1
- package/dist/react/scroll-wheel.d.ts +4 -5
- package/dist/react/scroll-wheel.js +19 -15
- package/dist/react/scroll-wheel.js.map +1 -1
- package/dist/react/select-item.d.ts +14 -0
- package/dist/react/select-item.js +340 -0
- package/dist/react/select-item.js.map +1 -0
- package/dist/react/select-native.d.ts +17 -0
- package/dist/react/select-native.js +203 -0
- package/dist/react/select-native.js.map +1 -0
- package/dist/react/select.d.ts +19 -61
- package/dist/react/select.js +866 -908
- package/dist/react/select.js.map +1 -1
- package/dist/react/sheet.d.ts +19 -19
- package/dist/react/sheet.js +97 -219
- package/dist/react/sheet.js.map +1 -1
- package/dist/react/slider.d.ts +15 -0
- package/dist/react/slider.js +66 -0
- package/dist/react/slider.js.map +1 -0
- package/dist/react/social-button.d.ts +55 -0
- package/dist/react/social-button.js +263 -0
- package/dist/react/social-button.js.map +1 -0
- package/dist/react/social-logos.d.ts +20 -0
- package/dist/react/social-logos.js +131 -0
- package/dist/react/social-logos.js.map +1 -0
- package/dist/react/switch.d.ts +21 -36
- package/dist/react/switch.js +121 -109
- package/dist/react/switch.js.map +1 -1
- package/dist/react/tag-select.d.ts +47 -0
- package/dist/react/tag-select.js +1252 -0
- package/dist/react/tag-select.js.map +1 -0
- package/dist/react/tags.d.ts +30 -0
- package/dist/react/tags.js +228 -0
- package/dist/react/tags.js.map +1 -0
- package/dist/react/textarea.d.ts +40 -4
- package/dist/react/textarea.js +193 -27
- package/dist/react/textarea.js.map +1 -1
- package/dist/react/tooltip.d.ts +30 -43
- package/dist/react/tooltip.js +65 -521
- package/dist/react/tooltip.js.map +1 -1
- package/dist/select-mobile-sheet-CB2ptDTJ.d.ts +12 -0
- package/dist/select-shared-oJEeJxeB.d.ts +68 -0
- package/package.json +28 -21
- package/source.css +2 -13
- package/theme.css +883 -79
- package/dist/react/calendar.d.ts +0 -13
- package/dist/react/calendar.js +0 -4639
- package/dist/react/calendar.js.map +0 -1
- package/dist/react/card.d.ts +0 -11
- package/dist/react/card.js +0 -113
- package/dist/react/card.js.map +0 -1
- package/dist/react/datetime-picker.d.ts +0 -21
- package/dist/react/datetime-picker.js +0 -6142
- package/dist/react/datetime-picker.js.map +0 -1
- package/dist/react/pagination.d.ts +0 -28
- package/dist/react/pagination.js +0 -262
- package/dist/react/pagination.js.map +0 -1
- package/dist/react/table-pagination.d.ts +0 -15
- package/dist/react/table-pagination.js +0 -1247
- package/dist/react/table-pagination.js.map +0 -1
- package/dist/react/table-view/column-menu.d.ts +0 -15
- package/dist/react/table-view/column-menu.js +0 -1049
- package/dist/react/table-view/column-menu.js.map +0 -1
- package/dist/react/table-view/index.d.ts +0 -70
- package/dist/react/table-view/index.js +0 -2284
- package/dist/react/table-view/index.js.map +0 -1
- package/dist/react/table.d.ts +0 -86
- package/dist/react/table.js +0 -414
- package/dist/react/table.js.map +0 -1
- package/dist/react/tabs.d.ts +0 -34
- package/dist/react/tabs.js +0 -423
- package/dist/react/tabs.js.map +0 -1
- package/dist/react/time-picker.d.ts +0 -22
- package/dist/react/time-picker.js +0 -856
- package/dist/react/time-picker.js.map +0 -1
package/dist/react/popover.js
CHANGED
|
@@ -1,355 +1,59 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useMemo, useContext, useEffect, useState, useLayoutEffect } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { jsxs,
|
|
3
|
+
import { XIcon } from '@phosphor-icons/react/dist/csr/X';
|
|
4
|
+
import { OverlayTriggerStateContext, Popover as Popover$1 } from 'react-aria-components';
|
|
5
|
+
import { extendTailwindMerge } from 'tailwind-merge';
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var POPOVER_MOBILE_SHEET_EXIT_EASING = "cubic-bezier(0.85, 0, 1, 0.15)";
|
|
15
|
-
var POPOVER_MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_DEFAULT_PX = 120;
|
|
16
|
-
var POPOVER_FLIP_MIN_SPACE_PX = 100;
|
|
17
|
-
function preventPopoverWheelChain(panel, e) {
|
|
18
|
-
let el = e.target;
|
|
19
|
-
while (el && panel.contains(el)) {
|
|
20
|
-
const oy = getComputedStyle(el).overflowY;
|
|
21
|
-
if ((oy === "auto" || oy === "scroll") && el.scrollHeight > el.clientHeight) {
|
|
22
|
-
const atTop = el.scrollTop <= 0;
|
|
23
|
-
const atBottom = el.scrollTop + el.clientHeight >= el.scrollHeight;
|
|
24
|
-
if (e.deltaY < 0 && !atTop || e.deltaY > 0 && !atBottom) return;
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
el = el.parentElement;
|
|
28
|
-
}
|
|
29
|
-
e.preventDefault();
|
|
30
|
-
}
|
|
31
|
-
function usePopoverIsMobile(breakpoint = 1025) {
|
|
32
|
-
const [isMobile, setIsMobile] = useState(false);
|
|
8
|
+
var MOBILE_SHEET_MAX_PX = 1024;
|
|
9
|
+
function useIsMobile(breakpoint = MOBILE_SHEET_MAX_PX + 1) {
|
|
10
|
+
const [isMobile, setIsMobile] = useState(() => {
|
|
11
|
+
if (typeof window === "undefined") return false;
|
|
12
|
+
return window.matchMedia(`(max-width: ${breakpoint - 1}px)`).matches;
|
|
13
|
+
});
|
|
33
14
|
useEffect(() => {
|
|
34
15
|
const mq = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
|
|
35
|
-
setIsMobile(mq.matches);
|
|
36
16
|
const handler = (e) => setIsMobile(e.matches);
|
|
37
17
|
mq.addEventListener("change", handler);
|
|
38
18
|
return () => mq.removeEventListener("change", handler);
|
|
39
19
|
}, [breakpoint]);
|
|
40
20
|
return isMobile;
|
|
41
21
|
}
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (!context) {
|
|
48
|
-
throw new Error("Popover components must be used within a <Popover />");
|
|
49
|
-
}
|
|
50
|
-
return context;
|
|
51
|
-
}
|
|
52
|
-
var Popover = ({ children, open: controlledOpen, onOpenChange }) => {
|
|
53
|
-
const [internalOpen, setInternalOpen] = useState(false);
|
|
54
|
-
const isControlled = controlledOpen !== void 0;
|
|
55
|
-
const open = isControlled ? controlledOpen : internalOpen;
|
|
56
|
-
const triggerRef = useRef(null);
|
|
57
|
-
const setOpen = useCallback(
|
|
58
|
-
(value) => {
|
|
59
|
-
if (!isControlled) setInternalOpen(value);
|
|
60
|
-
onOpenChange?.(value);
|
|
61
|
-
},
|
|
62
|
-
[isControlled, onOpenChange]
|
|
63
|
-
);
|
|
64
|
-
return /* @__PURE__ */ jsx(PopoverContext.Provider, { value: { open, setOpen, triggerRef }, children });
|
|
65
|
-
};
|
|
66
|
-
var PopoverTrigger = ({ children, asChild }) => {
|
|
67
|
-
const { open, setOpen, triggerRef } = usePopover();
|
|
68
|
-
const handleClick = (e) => {
|
|
69
|
-
e.stopPropagation();
|
|
70
|
-
setOpen(!open);
|
|
71
|
-
};
|
|
72
|
-
if (asChild && React.isValidElement(children)) {
|
|
73
|
-
const child = children;
|
|
74
|
-
return React.cloneElement(child, {
|
|
75
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
-
ref: (el) => {
|
|
77
|
-
triggerRef.current = el;
|
|
78
|
-
},
|
|
79
|
-
onClick: (e) => {
|
|
80
|
-
child.props.onClick?.(e);
|
|
81
|
-
handleClick(e);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
return /* @__PURE__ */ jsx(
|
|
86
|
-
"button",
|
|
87
|
-
{
|
|
88
|
-
type: "button",
|
|
89
|
-
ref: (el) => {
|
|
90
|
-
triggerRef.current = el;
|
|
91
|
-
},
|
|
92
|
-
onClick: handleClick,
|
|
93
|
-
children
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
var PopoverClose = ({ children, asChild }) => {
|
|
98
|
-
const { setOpen } = usePopover();
|
|
99
|
-
const handleClick = () => setOpen(false);
|
|
100
|
-
if (asChild && React.isValidElement(children)) {
|
|
101
|
-
const child = children;
|
|
102
|
-
return React.cloneElement(child, {
|
|
103
|
-
onClick: (e) => {
|
|
104
|
-
child.props.onClick?.(e);
|
|
105
|
-
handleClick();
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
return /* @__PURE__ */ jsx("button", { type: "button", onClick: handleClick, children });
|
|
110
|
-
};
|
|
111
|
-
function resolvePopoverMobileSheet(mobileOptions) {
|
|
22
|
+
var MOBILE_SHEET_MOTION_MS = 175;
|
|
23
|
+
var MOBILE_SHEET_ENTRY_EASING = "cubic-bezier(0.85, 0, 0.15, 1)";
|
|
24
|
+
var MOBILE_SHEET_EXIT_EASING = "cubic-bezier(0.85, 0, 1, 0.15)";
|
|
25
|
+
var MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_PX = 120;
|
|
26
|
+
function resolveSelectMobileOptions(mobileOptions) {
|
|
112
27
|
return {
|
|
113
|
-
sheet: mobileOptions?.sheet ??
|
|
28
|
+
sheet: mobileOptions?.sheet ?? true,
|
|
114
29
|
title: mobileOptions?.title,
|
|
115
|
-
|
|
30
|
+
sheetClassName: mobileOptions?.className,
|
|
116
31
|
contentClassName: mobileOptions?.contentClassName
|
|
117
32
|
};
|
|
118
33
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
"button",
|
|
122
|
-
{
|
|
123
|
-
ref,
|
|
124
|
-
type,
|
|
125
|
-
className: cn(
|
|
126
|
-
"z-100 flex size-12 shrink-0 cursor-pointer items-center justify-center rounded-full transition-all hover:bg-secondary-background active:scale-[0.96]",
|
|
127
|
-
className
|
|
128
|
-
),
|
|
129
|
-
...props,
|
|
130
|
-
children: [
|
|
131
|
-
/* @__PURE__ */ jsx(X, { className: "size-5.5" }),
|
|
132
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
});
|
|
137
|
-
PopoverMobileClose.displayName = "PopoverMobileClose";
|
|
138
|
-
function PopoverMobileBottomSheetPortal({
|
|
139
|
-
open,
|
|
140
|
-
isAnimating,
|
|
141
|
-
slideEntrance,
|
|
142
|
-
slideOffsetPx,
|
|
143
|
-
sheetTitle,
|
|
144
|
-
sheetExtraClassName,
|
|
145
|
-
contentClassName,
|
|
146
|
-
onRequestClose,
|
|
147
|
-
menuRef,
|
|
148
|
-
dismissOnBackdropPress = true,
|
|
149
|
-
children,
|
|
150
|
-
className,
|
|
151
|
-
style,
|
|
152
|
-
...panelProps
|
|
153
|
-
}) {
|
|
154
|
-
const sheetMotion = open ? POPOVER_MOBILE_SHEET_ENTRY_EASING : POPOVER_MOBILE_SHEET_EXIT_EASING;
|
|
155
|
-
const sheetHiddenTransform = slideEntrance ? `translateY(${slideOffsetPx}px)` : "translateY(100%)";
|
|
156
|
-
return createPortal(
|
|
157
|
-
/* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 flex items-end justify-center p-0", children: [
|
|
158
|
-
/* @__PURE__ */ jsx(
|
|
159
|
-
"div",
|
|
160
|
-
{
|
|
161
|
-
className: cn(
|
|
162
|
-
"fixed inset-0 bg-black/40 dark:bg-primary/4",
|
|
163
|
-
isAnimating ? "opacity-100" : "opacity-0"
|
|
164
|
-
),
|
|
165
|
-
style: {
|
|
166
|
-
transitionProperty: "opacity",
|
|
167
|
-
transitionDuration: `${POPOVER_MOBILE_SHEET_MOTION_MS}ms`,
|
|
168
|
-
transitionTimingFunction: sheetMotion
|
|
169
|
-
},
|
|
170
|
-
onClick: dismissOnBackdropPress ? onRequestClose : void 0,
|
|
171
|
-
"aria-hidden": true
|
|
172
|
-
}
|
|
173
|
-
),
|
|
174
|
-
/* @__PURE__ */ jsxs(
|
|
175
|
-
"div",
|
|
176
|
-
{
|
|
177
|
-
...panelProps,
|
|
178
|
-
ref: menuRef,
|
|
179
|
-
className: cn(
|
|
180
|
-
// Panel chrome + padding rhythm matches `DropdownMobileBottomSheetPortal`.
|
|
181
|
-
"bg-background border-primary/10 relative z-10 flex w-full max-h-[min(90dvh,calc(100dvh-env(safe-area-inset-bottom,0px)))] flex-col overflow-hidden shadow-2xl outline-none",
|
|
182
|
-
"rounded-t-2xl rounded-b-none border-x-0 border-b-0 border-t",
|
|
183
|
-
sheetExtraClassName,
|
|
184
|
-
className
|
|
185
|
-
),
|
|
186
|
-
style: {
|
|
187
|
-
transform: isAnimating ? "translateY(0)" : sheetHiddenTransform,
|
|
188
|
-
opacity: isAnimating ? 1 : 0,
|
|
189
|
-
transitionProperty: "transform, opacity",
|
|
190
|
-
transitionDuration: `${POPOVER_MOBILE_SHEET_MOTION_MS}ms`,
|
|
191
|
-
transitionTimingFunction: sheetMotion,
|
|
192
|
-
...style
|
|
193
|
-
},
|
|
194
|
-
children: [
|
|
195
|
-
/* @__PURE__ */ jsxs(
|
|
196
|
-
"div",
|
|
197
|
-
{
|
|
198
|
-
className: cn(
|
|
199
|
-
"flex w-full shrink-0 items-center py-2 pl-4 pr-2",
|
|
200
|
-
sheetTitle ? "justify-between gap-3" : "justify-end"
|
|
201
|
-
),
|
|
202
|
-
children: [
|
|
203
|
-
sheetTitle ? /* @__PURE__ */ jsx("p", { className: "text-foreground min-w-0 flex-1 truncate text-base font-semibold", children: sheetTitle }) : null,
|
|
204
|
-
/* @__PURE__ */ jsx(
|
|
205
|
-
PopoverMobileClose,
|
|
206
|
-
{
|
|
207
|
-
onClick: (e) => {
|
|
208
|
-
e.stopPropagation();
|
|
209
|
-
onRequestClose();
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
)
|
|
213
|
-
]
|
|
214
|
-
}
|
|
215
|
-
),
|
|
216
|
-
/* @__PURE__ */ jsx(
|
|
217
|
-
"div",
|
|
218
|
-
{
|
|
219
|
-
className: cn(
|
|
220
|
-
"min-h-0 flex-1 overflow-y-auto px-4 pt-3",
|
|
221
|
-
contentClassName,
|
|
222
|
-
"pb-[calc(5rem+env(safe-area-inset-bottom,0px))]"
|
|
223
|
-
),
|
|
224
|
-
children
|
|
225
|
-
}
|
|
226
|
-
)
|
|
227
|
-
]
|
|
228
|
-
}
|
|
229
|
-
)
|
|
230
|
-
] }),
|
|
231
|
-
document.body
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
function computePosition(trigger, popover, side, align, offset, viewportPadding) {
|
|
235
|
-
const triggerRect = trigger.getBoundingClientRect();
|
|
236
|
-
const pw = popover.offsetWidth;
|
|
237
|
-
const ph = popover.offsetHeight;
|
|
238
|
-
const contentHeight = popover.scrollHeight;
|
|
239
|
-
const vw = window.innerWidth;
|
|
240
|
-
const vh = window.innerHeight;
|
|
241
|
-
const pad = viewportPadding;
|
|
242
|
-
let top = 0;
|
|
243
|
-
let left = 0;
|
|
244
|
-
let effectiveSide = side;
|
|
245
|
-
let maxHeight;
|
|
246
|
-
const placeVertical = (s, height) => {
|
|
247
|
-
if (s === "bottom") top = triggerRect.bottom + offset;
|
|
248
|
-
else top = triggerRect.top - height - offset;
|
|
249
|
-
if (align === "start") left = triggerRect.left;
|
|
250
|
-
else if (align === "end") left = triggerRect.right - pw;
|
|
251
|
-
else left = triggerRect.left + triggerRect.width / 2 - pw / 2;
|
|
252
|
-
};
|
|
253
|
-
const place = (s, height = contentHeight) => {
|
|
254
|
-
switch (s) {
|
|
255
|
-
case "bottom":
|
|
256
|
-
case "top":
|
|
257
|
-
placeVertical(s, height);
|
|
258
|
-
break;
|
|
259
|
-
case "right":
|
|
260
|
-
left = triggerRect.right + offset;
|
|
261
|
-
top = align === "start" ? triggerRect.top : align === "end" ? triggerRect.bottom - ph : triggerRect.top + triggerRect.height / 2 - ph / 2;
|
|
262
|
-
break;
|
|
263
|
-
case "left":
|
|
264
|
-
left = triggerRect.left - pw - offset;
|
|
265
|
-
top = align === "start" ? triggerRect.top : align === "end" ? triggerRect.bottom - ph : triggerRect.top + triggerRect.height / 2 - ph / 2;
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
place(side);
|
|
270
|
-
const spaceBelow = Math.max(0, vh - pad - triggerRect.bottom - offset);
|
|
271
|
-
const spaceAbove = Math.max(0, triggerRect.top - offset - pad);
|
|
272
|
-
if (side === "bottom" || side === "top") {
|
|
273
|
-
const primarySpace = side === "bottom" ? spaceBelow : spaceAbove;
|
|
274
|
-
const alternateSpace = side === "bottom" ? spaceAbove : spaceBelow;
|
|
275
|
-
const alternateSide = side === "bottom" ? "top" : "bottom";
|
|
276
|
-
if (contentHeight > primarySpace) {
|
|
277
|
-
maxHeight = Math.min(contentHeight, primarySpace);
|
|
278
|
-
place(side, maxHeight);
|
|
279
|
-
}
|
|
280
|
-
if (contentHeight > primarySpace && primarySpace < POPOVER_FLIP_MIN_SPACE_PX && alternateSpace > primarySpace) {
|
|
281
|
-
effectiveSide = alternateSide;
|
|
282
|
-
maxHeight = Math.min(contentHeight, alternateSpace);
|
|
283
|
-
place(alternateSide, maxHeight);
|
|
284
|
-
}
|
|
285
|
-
} else if (side === "right" && left + pw > vw - pad) {
|
|
286
|
-
const flippedLeft = triggerRect.left - pw - offset;
|
|
287
|
-
if (flippedLeft >= pad) {
|
|
288
|
-
effectiveSide = "left";
|
|
289
|
-
left = flippedLeft;
|
|
290
|
-
}
|
|
291
|
-
} else if (side === "left" && left < pad) {
|
|
292
|
-
const flippedLeft = triggerRect.right + offset;
|
|
293
|
-
if (flippedLeft + pw <= vw - pad) {
|
|
294
|
-
effectiveSide = "right";
|
|
295
|
-
left = flippedLeft;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
return { top, left, side: effectiveSide, maxHeight };
|
|
299
|
-
}
|
|
300
|
-
var ARROW_SIZE = 6;
|
|
301
|
-
var PopoverContent = ({
|
|
302
|
-
children,
|
|
303
|
-
side = "bottom",
|
|
304
|
-
align = "center",
|
|
305
|
-
offset = 10,
|
|
306
|
-
showArrow = false,
|
|
307
|
-
closeOnClickOutside = true,
|
|
308
|
-
closeOnEscape = true,
|
|
309
|
-
duration = 80,
|
|
310
|
-
viewportPadding = 8,
|
|
311
|
-
container,
|
|
312
|
-
width = "auto",
|
|
313
|
-
mobileOptions,
|
|
314
|
-
slideEntrance = true,
|
|
315
|
-
slideEntranceOffsetPx: slideEntranceOffsetPxProp,
|
|
316
|
-
className,
|
|
317
|
-
style,
|
|
318
|
-
...props
|
|
319
|
-
}) => {
|
|
320
|
-
const { open, setOpen, triggerRef } = usePopover();
|
|
321
|
-
const isMobile = usePopoverIsMobile(POPOVER_MOBILE_SHEET_MAX_PX + 1);
|
|
322
|
-
const resolvedMobile = useMemo(
|
|
323
|
-
() => resolvePopoverMobileSheet(mobileOptions),
|
|
324
|
-
[mobileOptions]
|
|
325
|
-
);
|
|
326
|
-
const sheetMode = isMobile && resolvedMobile.sheet;
|
|
327
|
-
const slideOffsetPx = useMemo(
|
|
328
|
-
() => slideEntranceOffsetPxProp ?? POPOVER_MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_DEFAULT_PX,
|
|
329
|
-
[slideEntranceOffsetPxProp]
|
|
330
|
-
);
|
|
331
|
-
const closeDuration = sheetMode ? POPOVER_MOBILE_SHEET_MOTION_MS : duration;
|
|
332
|
-
const [shouldRender, setShouldRender] = useState(false);
|
|
34
|
+
function useMobileSheetAnimation(open, enabled, slideEntrance = true, slideOffsetPx = MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_PX) {
|
|
35
|
+
const [shouldRender, setShouldRender] = useState(open);
|
|
333
36
|
const [isAnimating, setIsAnimating] = useState(false);
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
const [triggerWidth, setTriggerWidth] = useState(0);
|
|
340
|
-
const popoverRef = useRef(null);
|
|
341
|
-
const closePopover = useCallback(() => setOpen(false), [setOpen]);
|
|
342
|
-
useEffect(() => {
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
if (!enabled) {
|
|
39
|
+
setShouldRender(open);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
343
42
|
if (open) {
|
|
344
43
|
setShouldRender(true);
|
|
345
|
-
} else {
|
|
346
|
-
setIsAnimating(false);
|
|
347
|
-
const timer = setTimeout(() => setShouldRender(false), closeDuration);
|
|
348
|
-
return () => clearTimeout(timer);
|
|
349
44
|
}
|
|
350
|
-
}, [open,
|
|
45
|
+
}, [open, enabled]);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!enabled || open) return;
|
|
48
|
+
const timer = setTimeout(() => setShouldRender(false), MOBILE_SHEET_MOTION_MS);
|
|
49
|
+
return () => clearTimeout(timer);
|
|
50
|
+
}, [open, enabled]);
|
|
51
|
+
useLayoutEffect(() => {
|
|
52
|
+
if (!enabled || open || !shouldRender) return;
|
|
53
|
+
setIsAnimating(false);
|
|
54
|
+
}, [enabled, open, shouldRender]);
|
|
351
55
|
useEffect(() => {
|
|
352
|
-
if (!shouldRender || !open) return;
|
|
56
|
+
if (!enabled || !shouldRender || !open) return;
|
|
353
57
|
let raf2 = 0;
|
|
354
58
|
const raf1 = requestAnimationFrame(() => {
|
|
355
59
|
raf2 = requestAnimationFrame(() => setIsAnimating(true));
|
|
@@ -358,225 +62,152 @@ var PopoverContent = ({
|
|
|
358
62
|
cancelAnimationFrame(raf1);
|
|
359
63
|
if (raf2) cancelAnimationFrame(raf2);
|
|
360
64
|
};
|
|
361
|
-
}, [shouldRender, open]);
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
window.removeEventListener("scroll", update, true);
|
|
384
|
-
};
|
|
385
|
-
}, [shouldRender, open, sheetMode, side, align, offset, viewportPadding]);
|
|
386
|
-
useEffect(() => {
|
|
387
|
-
if (!shouldRender || !open || sheetMode || position.maxHeight == null) return;
|
|
388
|
-
const panel = popoverRef.current;
|
|
389
|
-
if (!panel) return;
|
|
390
|
-
const onWheel = (e) => preventPopoverWheelChain(panel, e);
|
|
391
|
-
panel.addEventListener("wheel", onWheel, { passive: false });
|
|
392
|
-
return () => panel.removeEventListener("wheel", onWheel);
|
|
393
|
-
}, [shouldRender, open, sheetMode, position.maxHeight]);
|
|
394
|
-
useEffect(() => {
|
|
395
|
-
if (open && sheetMode) {
|
|
396
|
-
document.body.style.overflow = "hidden";
|
|
65
|
+
}, [shouldRender, open, enabled]);
|
|
66
|
+
const motionEasing = open ? MOBILE_SHEET_ENTRY_EASING : MOBILE_SHEET_EXIT_EASING;
|
|
67
|
+
const hiddenTransform = slideEntrance ? `translateY(${slideOffsetPx}px)` : "translateY(100%)";
|
|
68
|
+
const panelStyle = enabled ? {
|
|
69
|
+
transform: isAnimating ? "translateY(0)" : hiddenTransform,
|
|
70
|
+
opacity: isAnimating ? 1 : 0,
|
|
71
|
+
transitionProperty: "transform, opacity",
|
|
72
|
+
transitionDuration: `${MOBILE_SHEET_MOTION_MS}ms`,
|
|
73
|
+
transitionTimingFunction: motionEasing
|
|
74
|
+
} : void 0;
|
|
75
|
+
const backdropStyle = enabled ? {
|
|
76
|
+
opacity: isAnimating ? 1 : 0,
|
|
77
|
+
transitionProperty: "opacity",
|
|
78
|
+
transitionDuration: `${MOBILE_SHEET_MOTION_MS}ms`,
|
|
79
|
+
transitionTimingFunction: motionEasing
|
|
80
|
+
} : void 0;
|
|
81
|
+
return { shouldRender, isAnimating, panelStyle, backdropStyle };
|
|
82
|
+
}
|
|
83
|
+
var twMerge = extendTailwindMerge({
|
|
84
|
+
extend: {
|
|
85
|
+
theme: {
|
|
86
|
+
text: ["display-xs", "display-sm", "display-md", "display-lg", "display-xl", "display-2xl"]
|
|
397
87
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
var cx = twMerge;
|
|
91
|
+
function MobileSheetCloseButton({ onClose }) {
|
|
92
|
+
return /* @__PURE__ */ jsxs(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
type: "button",
|
|
96
|
+
onClick: (e) => {
|
|
97
|
+
e.stopPropagation();
|
|
98
|
+
onClose();
|
|
99
|
+
},
|
|
100
|
+
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)]",
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ jsx(XIcon, { className: "size-5", "aria-hidden": "true" }),
|
|
103
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function MobileSheetChrome({
|
|
109
|
+
title,
|
|
110
|
+
contentClassName,
|
|
111
|
+
onClose,
|
|
112
|
+
children
|
|
113
|
+
}) {
|
|
114
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
115
|
+
/* @__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: [
|
|
116
|
+
title ? /* @__PURE__ */ jsx("p", { className: "min-w-0 flex-1 truncate text-base font-semibold text-primary", children: title }) : null,
|
|
117
|
+
/* @__PURE__ */ jsx(MobileSheetCloseButton, { onClose })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
"div",
|
|
425
121
|
{
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
slideOffsetPx,
|
|
431
|
-
sheetTitle: resolvedMobile.title,
|
|
432
|
-
sheetExtraClassName: resolvedMobile.sheetExtraClassName,
|
|
433
|
-
contentClassName: cn(resolvedMobile.contentClassName, className),
|
|
434
|
-
onRequestClose: closePopover,
|
|
435
|
-
dismissOnBackdropPress: closeOnClickOutside,
|
|
436
|
-
menuRef: popoverRef,
|
|
437
|
-
role: "dialog",
|
|
438
|
-
"aria-modal": "true",
|
|
439
|
-
tabIndex: -1,
|
|
440
|
-
className: void 0,
|
|
441
|
-
style,
|
|
442
|
-
"data-slot": "popover-content",
|
|
122
|
+
className: cx(
|
|
123
|
+
"min-h-0 flex-1 overflow-y-auto pb-[calc(5rem+env(safe-area-inset-bottom,0px))]",
|
|
124
|
+
contentClassName
|
|
125
|
+
),
|
|
443
126
|
children
|
|
444
127
|
}
|
|
445
|
-
)
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
const base = {
|
|
462
|
-
position: "absolute",
|
|
463
|
-
width: 0,
|
|
464
|
-
height: 0,
|
|
465
|
-
pointerEvents: "none"
|
|
128
|
+
)
|
|
129
|
+
] });
|
|
130
|
+
}
|
|
131
|
+
var Popover = ({ mobileOptions, children, size, className, style, compoundContent = false, ...props }) => {
|
|
132
|
+
const isMobile = useIsMobile();
|
|
133
|
+
const resolvedMobile = useMemo(() => resolveSelectMobileOptions(mobileOptions), [mobileOptions]);
|
|
134
|
+
const useMobileSheet = isMobile && resolvedMobile.sheet;
|
|
135
|
+
const overlayState = useContext(OverlayTriggerStateContext);
|
|
136
|
+
const open = overlayState?.isOpen ?? false;
|
|
137
|
+
const { shouldRender, panelStyle, backdropStyle } = useMobileSheetAnimation(open, useMobileSheet);
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
if (!useMobileSheet || !open) return;
|
|
140
|
+
const prev = document.body.style.overflow;
|
|
141
|
+
document.body.style.overflow = "hidden";
|
|
142
|
+
return () => {
|
|
143
|
+
document.body.style.overflow = prev;
|
|
466
144
|
};
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
transform: "translateX(-50%)",
|
|
474
|
-
borderLeft: `${ARROW_SIZE}px solid transparent`,
|
|
475
|
-
borderRight: `${ARROW_SIZE}px solid transparent`,
|
|
476
|
-
borderBottom: `${ARROW_SIZE}px solid var(--border)`
|
|
477
|
-
};
|
|
478
|
-
case "top":
|
|
479
|
-
return {
|
|
480
|
-
...base,
|
|
481
|
-
bottom: -ARROW_SIZE,
|
|
482
|
-
left: "50%",
|
|
483
|
-
transform: "translateX(-50%)",
|
|
484
|
-
borderLeft: `${ARROW_SIZE}px solid transparent`,
|
|
485
|
-
borderRight: `${ARROW_SIZE}px solid transparent`,
|
|
486
|
-
borderTop: `${ARROW_SIZE}px solid var(--border)`
|
|
487
|
-
};
|
|
488
|
-
case "right":
|
|
489
|
-
return {
|
|
490
|
-
...base,
|
|
491
|
-
left: -ARROW_SIZE,
|
|
492
|
-
top: "50%",
|
|
493
|
-
transform: "translateY(-50%)",
|
|
494
|
-
borderTop: `${ARROW_SIZE}px solid transparent`,
|
|
495
|
-
borderBottom: `${ARROW_SIZE}px solid transparent`,
|
|
496
|
-
borderRight: `${ARROW_SIZE}px solid var(--border)`
|
|
497
|
-
};
|
|
498
|
-
case "left":
|
|
499
|
-
return {
|
|
500
|
-
...base,
|
|
501
|
-
right: -ARROW_SIZE,
|
|
502
|
-
top: "50%",
|
|
503
|
-
transform: "translateY(-50%)",
|
|
504
|
-
borderTop: `${ARROW_SIZE}px solid transparent`,
|
|
505
|
-
borderBottom: `${ARROW_SIZE}px solid transparent`,
|
|
506
|
-
borderLeft: `${ARROW_SIZE}px solid var(--border)`
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
|
-
};
|
|
510
|
-
const resolvedContainer = container !== void 0 ? container : typeof document !== "undefined" ? document.body : null;
|
|
511
|
-
if (!resolvedContainer) return null;
|
|
512
|
-
return createPortal(
|
|
513
|
-
/* @__PURE__ */ jsxs(
|
|
145
|
+
}, [useMobileSheet, open]);
|
|
146
|
+
const close = () => overlayState?.close();
|
|
147
|
+
const showMobileSheet = useMobileSheet && shouldRender;
|
|
148
|
+
const isMobileSheetExiting = showMobileSheet && !open;
|
|
149
|
+
const mobileScrim = useMobileSheet && shouldRender && typeof document !== "undefined" ? createPortal(
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
514
151
|
"div",
|
|
515
152
|
{
|
|
153
|
+
className: "fixed inset-0 z-50 bg-overlay/70",
|
|
154
|
+
style: backdropStyle,
|
|
155
|
+
onClick: close,
|
|
156
|
+
"aria-hidden": "true"
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
document.body
|
|
160
|
+
) : null;
|
|
161
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
162
|
+
mobileScrim,
|
|
163
|
+
/* @__PURE__ */ jsx(
|
|
164
|
+
Popover$1,
|
|
165
|
+
{
|
|
166
|
+
placement: "bottom",
|
|
167
|
+
containerPadding: 0,
|
|
168
|
+
offset: 4,
|
|
516
169
|
...props,
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
170
|
+
isExiting: isMobileSheetExiting,
|
|
171
|
+
...useMobileSheet ? { "data-select-mobile-sheet": true } : {},
|
|
172
|
+
style: useMobileSheet ? { ...panelStyle, ...style } : style,
|
|
173
|
+
className: (state) => cx(
|
|
174
|
+
"outline-hidden",
|
|
175
|
+
!useMobileSheet && [
|
|
176
|
+
"w-(--trigger-width) origin-(--trigger-anchor-point) rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
|
|
177
|
+
compoundContent ? "overflow-hidden outline-hidden" : "overflow-x-hidden overflow-y-auto py-1 outline-hidden",
|
|
178
|
+
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",
|
|
179
|
+
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",
|
|
180
|
+
!compoundContent && size === "sm" && "max-h-56!",
|
|
181
|
+
!compoundContent && size === "md" && "max-h-64!",
|
|
182
|
+
!compoundContent && size === "lg" && "max-h-80!"
|
|
183
|
+
],
|
|
184
|
+
useMobileSheet && [
|
|
185
|
+
"fixed! inset-x-0! bottom-0! top-auto! left-0! right-0! z-[51] flex 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",
|
|
186
|
+
"max-h-[min(90dvh,calc(100dvh-env(safe-area-inset-bottom,0px)))]",
|
|
187
|
+
resolvedMobile.sheetClassName
|
|
188
|
+
],
|
|
189
|
+
typeof className === "function" ? className(state) : className
|
|
522
190
|
),
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
children
|
|
539
|
-
]
|
|
191
|
+
children: (state) => {
|
|
192
|
+
const content = typeof children === "function" ? children(state) : children;
|
|
193
|
+
if (useMobileSheet) {
|
|
194
|
+
return /* @__PURE__ */ jsx(
|
|
195
|
+
MobileSheetChrome,
|
|
196
|
+
{
|
|
197
|
+
title: resolvedMobile.title,
|
|
198
|
+
contentClassName: resolvedMobile.contentClassName,
|
|
199
|
+
onClose: close,
|
|
200
|
+
children: content
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
return content;
|
|
205
|
+
}
|
|
540
206
|
}
|
|
541
|
-
)
|
|
542
|
-
|
|
543
|
-
);
|
|
207
|
+
)
|
|
208
|
+
] });
|
|
544
209
|
};
|
|
545
|
-
var PopoverHeader = ({
|
|
546
|
-
className,
|
|
547
|
-
...props
|
|
548
|
-
}) => /* @__PURE__ */ jsx(
|
|
549
|
-
"div",
|
|
550
|
-
{
|
|
551
|
-
className: cn(
|
|
552
|
-
"border-primary/10 flex flex-col space-y-1 border-b px-4 py-3",
|
|
553
|
-
className
|
|
554
|
-
),
|
|
555
|
-
...props
|
|
556
|
-
}
|
|
557
|
-
);
|
|
558
|
-
var PopoverFooter = ({
|
|
559
|
-
className,
|
|
560
|
-
...props
|
|
561
|
-
}) => /* @__PURE__ */ jsx(
|
|
562
|
-
"div",
|
|
563
|
-
{
|
|
564
|
-
className: cn(
|
|
565
|
-
"border-primary/10 flex flex-row justify-end gap-2 border-t px-4 py-3",
|
|
566
|
-
className
|
|
567
|
-
),
|
|
568
|
-
...props
|
|
569
|
-
}
|
|
570
|
-
);
|
|
571
|
-
var PopoverTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
572
|
-
"h4",
|
|
573
|
-
{
|
|
574
|
-
className: cn("text-primary text-sm leading-none font-semibold", className),
|
|
575
|
-
...props
|
|
576
|
-
}
|
|
577
|
-
);
|
|
578
|
-
var PopoverDescription = ({ className, ...props }) => /* @__PURE__ */ jsx("p", { className: cn("text-muted-foreground text-xs", className), ...props });
|
|
579
210
|
|
|
580
|
-
export { Popover
|
|
211
|
+
export { Popover };
|
|
581
212
|
//# sourceMappingURL=popover.js.map
|
|
582
213
|
//# sourceMappingURL=popover.js.map
|