@stevederico/skateboard-ui 3.0.2 → 3.6.0
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/App.jsx +13 -13
- package/CHANGELOG.md +64 -0
- package/README.md +59 -65
- package/components/AuthOverlay.jsx +4 -4
- package/components/ProtectedRoute.jsx +1 -1
- package/components/ThemeToggle.jsx +1 -1
- package/components/UpgradeSheet.jsx +2 -2
- package/{core → components/core}/DynamicIcon.jsx +1 -1
- package/{layout → components/layout}/Header.jsx +4 -4
- package/{layout → components/layout}/Layout.jsx +1 -1
- package/{layout → components/layout}/Sidebar.jsx +2 -2
- package/{layout → components/layout}/TabBar.jsx +1 -1
- package/{views → components/views}/LandingView.jsx +5 -5
- package/{views → components/views}/NotFound.jsx +2 -2
- package/{views → components/views}/PaymentView.jsx +1 -1
- package/{views → components/views}/SettingsView.jsx +6 -6
- package/{views → components/views}/SignInView.jsx +6 -6
- package/{views → components/views}/SignOutView.jsx +1 -1
- package/{views → components/views}/SignUpView.jsx +6 -6
- package/{views → components/views}/TextView.jsx +3 -3
- package/hooks/useAuthGate.js +1 -1
- package/index.js +1 -1
- package/package.json +32 -50
- package/shadcn/lib/base-ui/LICENSE +21 -0
- package/shadcn/lib/base-ui/_chunk-01rqe37g.js +70 -0
- package/shadcn/lib/base-ui/_chunk-0h5sskyw.js +347 -0
- package/shadcn/lib/base-ui/_chunk-0xhx4g7r.js +57 -0
- package/shadcn/lib/base-ui/_chunk-1e6khrvm.js +218 -0
- package/shadcn/lib/base-ui/_chunk-1s41sngz.js +302 -0
- package/shadcn/lib/base-ui/_chunk-20rtfsz9.js +23 -0
- package/shadcn/lib/base-ui/_chunk-2tyt8f8r.js +6034 -0
- package/shadcn/lib/base-ui/_chunk-3f31ka8n.js +11 -0
- package/shadcn/lib/base-ui/_chunk-3h6zpchb.js +89 -0
- package/shadcn/lib/base-ui/_chunk-4s0k3h7t.js +114 -0
- package/shadcn/lib/base-ui/_chunk-502wngfc.js +598 -0
- package/shadcn/lib/base-ui/_chunk-536jvgeq.js +68 -0
- package/shadcn/lib/base-ui/_chunk-611pz5sm.js +10 -0
- package/shadcn/lib/base-ui/_chunk-65zw5gs2.js +15 -0
- package/shadcn/lib/base-ui/_chunk-6b17g8t7.js +34 -0
- package/shadcn/lib/base-ui/_chunk-6xevjepc.js +15 -0
- package/shadcn/lib/base-ui/_chunk-71zm6zgv.js +16 -0
- package/shadcn/lib/base-ui/_chunk-7fmjymvh.js +32 -0
- package/shadcn/lib/base-ui/_chunk-7jjzay8b.js +176 -0
- package/shadcn/lib/base-ui/_chunk-7v1t86x1.js +43 -0
- package/shadcn/lib/base-ui/_chunk-85vrgzwr.js +227 -0
- package/shadcn/lib/base-ui/_chunk-8jz3hb7q.js +9 -0
- package/shadcn/lib/base-ui/_chunk-8kh3xk78.js +35 -0
- package/shadcn/lib/base-ui/_chunk-97tas84n.js +67 -0
- package/shadcn/lib/base-ui/_chunk-9nyxkvte.js +13 -0
- package/shadcn/lib/base-ui/_chunk-a8fwg9d0.js +52 -0
- package/shadcn/lib/base-ui/_chunk-agc6ew3g.js +29 -0
- package/shadcn/lib/base-ui/_chunk-aqwsk46c.js +64 -0
- package/shadcn/lib/base-ui/_chunk-atd5kq5q.js +803 -0
- package/shadcn/lib/base-ui/_chunk-atnkefgd.js +104 -0
- package/shadcn/lib/base-ui/_chunk-b40erthe.js +7 -0
- package/shadcn/lib/base-ui/_chunk-b5jsqt97.js +50 -0
- package/shadcn/lib/base-ui/_chunk-bk7n9s9e.js +15 -0
- package/shadcn/lib/base-ui/_chunk-c3572b5x.js +19 -0
- package/shadcn/lib/base-ui/_chunk-cwr896nf.js +25 -0
- package/shadcn/lib/base-ui/_chunk-drfb9kp2.js +27 -0
- package/shadcn/lib/base-ui/_chunk-ds8fnpjj.js +0 -0
- package/shadcn/lib/base-ui/_chunk-ek863ta9.js +82 -0
- package/shadcn/lib/base-ui/_chunk-f09cp81f.js +12 -0
- package/shadcn/lib/base-ui/_chunk-f5d01bp9.js +0 -0
- package/shadcn/lib/base-ui/_chunk-f9tgee1q.js +21 -0
- package/shadcn/lib/base-ui/_chunk-fch5cba8.js +84 -0
- package/shadcn/lib/base-ui/_chunk-gfce3j3z.js +18 -0
- package/shadcn/lib/base-ui/_chunk-ha06w2pp.js +2391 -0
- package/shadcn/lib/base-ui/_chunk-hzgetm70.js +23 -0
- package/shadcn/lib/base-ui/_chunk-j0eqdjta.js +39 -0
- package/shadcn/lib/base-ui/_chunk-k1e5fvcj.js +48 -0
- package/shadcn/lib/base-ui/_chunk-k4mc2kan.js +81 -0
- package/shadcn/lib/base-ui/_chunk-kfz96xv1.js +128 -0
- package/shadcn/lib/base-ui/_chunk-m45547cc.js +15 -0
- package/shadcn/lib/base-ui/_chunk-mbn76q14.js +184 -0
- package/shadcn/lib/base-ui/_chunk-mvv30fkv.js +9 -0
- package/shadcn/lib/base-ui/_chunk-mznt6ktj.js +33 -0
- package/shadcn/lib/base-ui/_chunk-n7dnqnbw.js +7 -0
- package/shadcn/lib/base-ui/_chunk-nya71ccw.js +546 -0
- package/shadcn/lib/base-ui/_chunk-p6qynd6r.js +146 -0
- package/shadcn/lib/base-ui/_chunk-q3nee19r.js +323 -0
- package/shadcn/lib/base-ui/_chunk-q7yw9mz4.js +385 -0
- package/shadcn/lib/base-ui/_chunk-qce0xt57.js +107 -0
- package/shadcn/lib/base-ui/_chunk-qgzhcjsj.js +14 -0
- package/shadcn/lib/base-ui/_chunk-qt6r015s.js +38 -0
- package/shadcn/lib/base-ui/_chunk-r0vsdknk.js +4 -0
- package/shadcn/lib/base-ui/_chunk-sx6vkz01.js +150 -0
- package/shadcn/lib/base-ui/_chunk-szcr6mhk.js +6 -0
- package/shadcn/lib/base-ui/_chunk-t7j3rbpv.js +67 -0
- package/shadcn/lib/base-ui/_chunk-tmfmrzwe.js +39 -0
- package/shadcn/lib/base-ui/_chunk-v92ycsfj.js +9 -0
- package/shadcn/lib/base-ui/_chunk-vdc01ss3.js +6 -0
- package/shadcn/lib/base-ui/_chunk-vjbnhhg1.js +26 -0
- package/shadcn/lib/base-ui/_chunk-w68yxg9d.js +21 -0
- package/shadcn/lib/base-ui/_chunk-wana68v3.js +477 -0
- package/shadcn/lib/base-ui/_chunk-wtw745qd.js +12 -0
- package/shadcn/lib/base-ui/_chunk-xb7ph1ka.js +6 -0
- package/shadcn/lib/base-ui/_chunk-xfagb0fq.js +28 -0
- package/shadcn/lib/base-ui/_chunk-xxhqanfd.js +16 -0
- package/shadcn/lib/base-ui/_chunk-y887e46p.js +15 -0
- package/shadcn/lib/base-ui/_chunk-ymj1dpqg.js +14 -0
- package/shadcn/lib/base-ui/accordion.js +650 -0
- package/shadcn/lib/base-ui/alert-dialog.js +138 -0
- package/shadcn/lib/base-ui/avatar.js +235 -0
- package/shadcn/lib/base-ui/button.js +52 -0
- package/shadcn/lib/base-ui/checkbox.js +454 -0
- package/shadcn/lib/base-ui/collapsible.js +283 -0
- package/shadcn/lib/base-ui/context-menu.js +324 -0
- package/shadcn/lib/base-ui/dialog.js +71 -0
- package/shadcn/lib/base-ui/input.js +1028 -0
- package/shadcn/lib/base-ui/menu.js +61 -0
- package/shadcn/lib/base-ui/menubar.js +157 -0
- package/shadcn/lib/base-ui/merge-props.js +15 -0
- package/shadcn/lib/base-ui/navigation-menu.js +1854 -0
- package/shadcn/lib/base-ui/popover.js +1090 -0
- package/shadcn/lib/base-ui/preview-card.js +709 -0
- package/shadcn/lib/base-ui/progress.js +278 -0
- package/shadcn/lib/base-ui/radio-group.js +247 -0
- package/shadcn/lib/base-ui/radio.js +382 -0
- package/shadcn/lib/base-ui/scroll-area.js +1061 -0
- package/shadcn/lib/base-ui/select.js +2438 -0
- package/shadcn/lib/base-ui/separator.js +11 -0
- package/shadcn/lib/base-ui/slider.js +1595 -0
- package/shadcn/lib/base-ui/switch.js +333 -0
- package/shadcn/lib/base-ui/tabs.js +892 -0
- package/shadcn/lib/base-ui/toggle-group.js +152 -0
- package/shadcn/lib/base-ui/toggle.js +133 -0
- package/shadcn/lib/base-ui/tooltip.js +791 -0
- package/shadcn/lib/base-ui/use-render.js +15 -0
- package/shadcn/lib/tailwind-merge.js +3312 -0
- package/shadcn/lib/utils.js +1 -1
- package/shadcn/ui/accordion.jsx +1 -1
- package/shadcn/ui/alert-dialog.jsx +1 -1
- package/shadcn/ui/avatar.jsx +1 -1
- package/shadcn/ui/badge.jsx +2 -2
- package/shadcn/ui/breadcrumb.jsx +2 -2
- package/shadcn/ui/button-group.jsx +2 -2
- package/shadcn/ui/button.jsx +1 -1
- package/shadcn/ui/calendar.jsx +1 -1
- package/shadcn/ui/checkbox.jsx +1 -1
- package/shadcn/ui/collapsible.jsx +1 -1
- package/shadcn/ui/command.jsx +1 -1
- package/shadcn/ui/context-menu.jsx +1 -1
- package/shadcn/ui/dialog.jsx +1 -1
- package/shadcn/ui/drawer.jsx +176 -74
- package/shadcn/ui/dropdown-menu.jsx +1 -1
- package/shadcn/ui/hover-card.jsx +1 -1
- package/shadcn/ui/input.jsx +1 -1
- package/shadcn/ui/item.jsx +2 -2
- package/shadcn/ui/menubar.jsx +2 -2
- package/shadcn/ui/navigation-menu.jsx +1 -1
- package/shadcn/ui/popover.jsx +1 -1
- package/shadcn/ui/progress.jsx +1 -1
- package/shadcn/ui/radio-group.jsx +2 -2
- package/shadcn/ui/scroll-area.jsx +1 -1
- package/shadcn/ui/select.jsx +1 -1
- package/shadcn/ui/separator.jsx +1 -1
- package/shadcn/ui/sheet.jsx +1 -1
- package/shadcn/ui/sidebar.jsx +3 -3
- package/shadcn/ui/slider.jsx +1 -1
- package/shadcn/ui/switch.jsx +1 -1
- package/shadcn/ui/tabs.jsx +1 -1
- package/shadcn/ui/toggle-group.jsx +2 -2
- package/shadcn/ui/toggle.jsx +1 -1
- package/shadcn/ui/tooltip.jsx +1 -1
- package/styles.css +31 -0
- package/MIGRATION.md +0 -230
- package/shadcn/ui/carousel.jsx +0 -195
- package/shadcn/ui/chart.jsx +0 -312
- package/shadcn/ui/resizable.jsx +0 -47
- /package/{core → components/core}/Calendar.jsx +0 -0
- /package/{core → components/core}/Command.jsx +0 -0
- /package/{core → components/core}/Context.jsx +0 -0
- /package/{core → components/core}/ThemeProvider.jsx +0 -0
- /package/{core → components/core}/Utilities.js +0 -0
|
@@ -0,0 +1,1090 @@
|
|
|
1
|
+
/* @base-ui/react 1.4.1 — vendored (MIT — MUI Inc).
|
|
2
|
+
* Refresh: scripts/vendor-base-ui.js (see header for instructions).
|
|
3
|
+
* Do not edit by hand. */
|
|
4
|
+
import {
|
|
5
|
+
useTriggerFocusGuards
|
|
6
|
+
} from "./_chunk-0xhx4g7r.js";
|
|
7
|
+
import {
|
|
8
|
+
useAnchoredPopupScrollLock
|
|
9
|
+
} from "./_chunk-agc6ew3g.js";
|
|
10
|
+
import {
|
|
11
|
+
useToolbarRootContext
|
|
12
|
+
} from "./_chunk-y887e46p.js";
|
|
13
|
+
import {
|
|
14
|
+
usePopupViewport
|
|
15
|
+
} from "./_chunk-q7yw9mz4.js";
|
|
16
|
+
import"./_chunk-gfce3j3z.js";
|
|
17
|
+
import {
|
|
18
|
+
adaptiveOrigin,
|
|
19
|
+
getDisabledMountTransitionStyles,
|
|
20
|
+
useAnchorPositioning,
|
|
21
|
+
usePositioner
|
|
22
|
+
} from "./_chunk-502wngfc.js";
|
|
23
|
+
import"./_chunk-xfagb0fq.js";
|
|
24
|
+
import"./_chunk-wtw745qd.js";
|
|
25
|
+
import {
|
|
26
|
+
InternalBackdrop,
|
|
27
|
+
useOpenInteractionType
|
|
28
|
+
} from "./_chunk-q3nee19r.js";
|
|
29
|
+
import {
|
|
30
|
+
createInitialPopupStoreState,
|
|
31
|
+
popupStoreSelectors,
|
|
32
|
+
useImplicitActiveTrigger,
|
|
33
|
+
useOpenStateTransitions,
|
|
34
|
+
useTriggerDataForwarding
|
|
35
|
+
} from "./_chunk-7jjzay8b.js";
|
|
36
|
+
import {
|
|
37
|
+
useOnFirstRender
|
|
38
|
+
} from "./_chunk-f09cp81f.js";
|
|
39
|
+
import"./_chunk-f9tgee1q.js";
|
|
40
|
+
import {
|
|
41
|
+
popupStateMapping,
|
|
42
|
+
pressableTriggerOpenStateMapping,
|
|
43
|
+
triggerOpenStateMapping
|
|
44
|
+
} from "./_chunk-536jvgeq.js";
|
|
45
|
+
import {
|
|
46
|
+
inertValue
|
|
47
|
+
} from "./_chunk-9nyxkvte.js";
|
|
48
|
+
import {
|
|
49
|
+
CLICK_TRIGGER_IDENTIFIER,
|
|
50
|
+
FloatingFocusManager,
|
|
51
|
+
FloatingNode,
|
|
52
|
+
FloatingPortal,
|
|
53
|
+
FloatingTree,
|
|
54
|
+
FocusGuard,
|
|
55
|
+
PATIENT_CLICK_THRESHOLD,
|
|
56
|
+
POPUP_COLLISION_AVOIDANCE,
|
|
57
|
+
PopupTriggerMap,
|
|
58
|
+
ReactStore,
|
|
59
|
+
createSelector,
|
|
60
|
+
safePolygon,
|
|
61
|
+
useClick,
|
|
62
|
+
useDismiss,
|
|
63
|
+
useFloatingNodeId,
|
|
64
|
+
useFloatingParentNodeId,
|
|
65
|
+
useHoverFloatingInteraction,
|
|
66
|
+
useHoverReferenceInteraction,
|
|
67
|
+
useInteractions,
|
|
68
|
+
useRole,
|
|
69
|
+
useSyncedFloatingRootContext
|
|
70
|
+
} from "./_chunk-2tyt8f8r.js";
|
|
71
|
+
import"./_chunk-aqwsk46c.js";
|
|
72
|
+
import"./_chunk-xb7ph1ka.js";
|
|
73
|
+
import"./_chunk-atnkefgd.js";
|
|
74
|
+
import"./_chunk-drfb9kp2.js";
|
|
75
|
+
import {
|
|
76
|
+
COMPOSITE_KEYS
|
|
77
|
+
} from "./_chunk-qce0xt57.js";
|
|
78
|
+
import"./_chunk-nya71ccw.js";
|
|
79
|
+
import"./_chunk-t7j3rbpv.js";
|
|
80
|
+
import {
|
|
81
|
+
Timeout
|
|
82
|
+
} from "./_chunk-7v1t86x1.js";
|
|
83
|
+
import"./_chunk-cwr896nf.js";
|
|
84
|
+
import"./_chunk-hzgetm70.js";
|
|
85
|
+
import"./_chunk-f5d01bp9.js";
|
|
86
|
+
import"./_chunk-mvv30fkv.js";
|
|
87
|
+
import {
|
|
88
|
+
createChangeEventDetails,
|
|
89
|
+
exports_reason_parts
|
|
90
|
+
} from "./_chunk-4s0k3h7t.js";
|
|
91
|
+
import {
|
|
92
|
+
useBaseUiId
|
|
93
|
+
} from "./_chunk-8kh3xk78.js";
|
|
94
|
+
import {
|
|
95
|
+
transitionStatusMapping,
|
|
96
|
+
useAnimationsFinished,
|
|
97
|
+
useOpenChangeComplete
|
|
98
|
+
} from "./_chunk-mbn76q14.js";
|
|
99
|
+
import"./_chunk-v92ycsfj.js";
|
|
100
|
+
import"./_chunk-3h6zpchb.js";
|
|
101
|
+
import {
|
|
102
|
+
useOnMount
|
|
103
|
+
} from "./_chunk-8jz3hb7q.js";
|
|
104
|
+
import {
|
|
105
|
+
useButton
|
|
106
|
+
} from "./_chunk-85vrgzwr.js";
|
|
107
|
+
import"./_chunk-71zm6zgv.js";
|
|
108
|
+
import"./_chunk-6xevjepc.js";
|
|
109
|
+
import {
|
|
110
|
+
isHTMLElement
|
|
111
|
+
} from "./_chunk-sx6vkz01.js";
|
|
112
|
+
import"./_chunk-n7dnqnbw.js";
|
|
113
|
+
import {
|
|
114
|
+
useStableCallback
|
|
115
|
+
} from "./_chunk-mznt6ktj.js";
|
|
116
|
+
import {
|
|
117
|
+
useIsoLayoutEffect
|
|
118
|
+
} from "./_chunk-b40erthe.js";
|
|
119
|
+
import {
|
|
120
|
+
useRefWithInit,
|
|
121
|
+
useRenderElement
|
|
122
|
+
} from "./_chunk-1s41sngz.js";
|
|
123
|
+
import {
|
|
124
|
+
__export
|
|
125
|
+
} from "./_chunk-1e6khrvm.js";
|
|
126
|
+
|
|
127
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/index.parts.js
|
|
128
|
+
var exports_index_parts = {};
|
|
129
|
+
__export(exports_index_parts, {
|
|
130
|
+
createHandle: () => createPopoverHandle,
|
|
131
|
+
Viewport: () => PopoverViewport,
|
|
132
|
+
Trigger: () => PopoverTrigger,
|
|
133
|
+
Title: () => PopoverTitle,
|
|
134
|
+
Root: () => PopoverRoot,
|
|
135
|
+
Positioner: () => PopoverPositioner,
|
|
136
|
+
Portal: () => PopoverPortal,
|
|
137
|
+
Popup: () => PopoverPopup,
|
|
138
|
+
Handle: () => PopoverHandle,
|
|
139
|
+
Description: () => PopoverDescription,
|
|
140
|
+
Close: () => PopoverClose,
|
|
141
|
+
Backdrop: () => PopoverBackdrop,
|
|
142
|
+
Arrow: () => PopoverArrow
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/root/PopoverRoot.js
|
|
146
|
+
import * as React3 from "react";
|
|
147
|
+
|
|
148
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/root/PopoverRootContext.js
|
|
149
|
+
import * as React from "react";
|
|
150
|
+
"use client";
|
|
151
|
+
var PopoverRootContext = /* @__PURE__ */ React.createContext(undefined);
|
|
152
|
+
if (true)
|
|
153
|
+
PopoverRootContext.displayName = "PopoverRootContext";
|
|
154
|
+
function usePopoverRootContext(optional) {
|
|
155
|
+
const context = React.useContext(PopoverRootContext);
|
|
156
|
+
if (context === undefined && !optional) {
|
|
157
|
+
throw new Error("Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.");
|
|
158
|
+
}
|
|
159
|
+
return context;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/store/PopoverStore.js
|
|
163
|
+
import * as React2 from "react";
|
|
164
|
+
import * as ReactDOM from "react-dom";
|
|
165
|
+
function createInitialState() {
|
|
166
|
+
return {
|
|
167
|
+
...createInitialPopupStoreState(),
|
|
168
|
+
disabled: false,
|
|
169
|
+
modal: false,
|
|
170
|
+
focusManagerModal: false,
|
|
171
|
+
instantType: undefined,
|
|
172
|
+
openMethod: null,
|
|
173
|
+
openChangeReason: null,
|
|
174
|
+
titleElementId: undefined,
|
|
175
|
+
descriptionElementId: undefined,
|
|
176
|
+
stickIfOpen: true,
|
|
177
|
+
nested: false,
|
|
178
|
+
openOnHover: false,
|
|
179
|
+
closeDelay: 0,
|
|
180
|
+
hasViewport: false
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
var selectors = {
|
|
184
|
+
...popupStoreSelectors,
|
|
185
|
+
disabled: createSelector((state) => state.disabled),
|
|
186
|
+
instantType: createSelector((state) => state.instantType),
|
|
187
|
+
openMethod: createSelector((state) => state.openMethod),
|
|
188
|
+
openChangeReason: createSelector((state) => state.openChangeReason),
|
|
189
|
+
modal: createSelector((state) => state.modal),
|
|
190
|
+
focusManagerModal: createSelector((state) => state.focusManagerModal),
|
|
191
|
+
stickIfOpen: createSelector((state) => state.stickIfOpen),
|
|
192
|
+
titleElementId: createSelector((state) => state.titleElementId),
|
|
193
|
+
descriptionElementId: createSelector((state) => state.descriptionElementId),
|
|
194
|
+
openOnHover: createSelector((state) => state.openOnHover),
|
|
195
|
+
closeDelay: createSelector((state) => state.closeDelay),
|
|
196
|
+
hasViewport: createSelector((state) => state.hasViewport)
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
class PopoverStore extends ReactStore {
|
|
200
|
+
constructor(initialState) {
|
|
201
|
+
const initial = {
|
|
202
|
+
...createInitialState(),
|
|
203
|
+
...initialState
|
|
204
|
+
};
|
|
205
|
+
if (initial.open && initialState?.mounted === undefined) {
|
|
206
|
+
initial.mounted = true;
|
|
207
|
+
}
|
|
208
|
+
super(initial, {
|
|
209
|
+
popupRef: /* @__PURE__ */ React2.createRef(),
|
|
210
|
+
backdropRef: /* @__PURE__ */ React2.createRef(),
|
|
211
|
+
internalBackdropRef: /* @__PURE__ */ React2.createRef(),
|
|
212
|
+
onOpenChange: undefined,
|
|
213
|
+
onOpenChangeComplete: undefined,
|
|
214
|
+
triggerFocusTargetRef: /* @__PURE__ */ React2.createRef(),
|
|
215
|
+
beforeContentFocusGuardRef: /* @__PURE__ */ React2.createRef(),
|
|
216
|
+
stickIfOpenTimeout: new Timeout,
|
|
217
|
+
triggerElements: new PopupTriggerMap
|
|
218
|
+
}, selectors);
|
|
219
|
+
}
|
|
220
|
+
setOpen = (nextOpen, eventDetails) => {
|
|
221
|
+
const isHover = eventDetails.reason === exports_reason_parts.triggerHover;
|
|
222
|
+
const isKeyboardClick = eventDetails.reason === exports_reason_parts.triggerPress && eventDetails.event.detail === 0;
|
|
223
|
+
const isDismissClose = !nextOpen && (eventDetails.reason === exports_reason_parts.escapeKey || eventDetails.reason == null);
|
|
224
|
+
eventDetails.preventUnmountOnClose = () => {
|
|
225
|
+
this.set("preventUnmountingOnClose", true);
|
|
226
|
+
};
|
|
227
|
+
this.context.onOpenChange?.(nextOpen, eventDetails);
|
|
228
|
+
if (eventDetails.isCanceled) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
|
|
232
|
+
const changeState = () => {
|
|
233
|
+
const updatedState = {
|
|
234
|
+
open: nextOpen,
|
|
235
|
+
openChangeReason: eventDetails.reason
|
|
236
|
+
};
|
|
237
|
+
const newTriggerId = eventDetails.trigger?.id ?? null;
|
|
238
|
+
if (newTriggerId || nextOpen) {
|
|
239
|
+
updatedState.activeTriggerId = newTriggerId;
|
|
240
|
+
updatedState.activeTriggerElement = eventDetails.trigger ?? null;
|
|
241
|
+
}
|
|
242
|
+
this.update(updatedState);
|
|
243
|
+
};
|
|
244
|
+
if (isHover) {
|
|
245
|
+
this.set("stickIfOpen", true);
|
|
246
|
+
this.context.stickIfOpenTimeout.start(PATIENT_CLICK_THRESHOLD, () => {
|
|
247
|
+
this.set("stickIfOpen", false);
|
|
248
|
+
});
|
|
249
|
+
ReactDOM.flushSync(changeState);
|
|
250
|
+
} else {
|
|
251
|
+
changeState();
|
|
252
|
+
}
|
|
253
|
+
if (isKeyboardClick || isDismissClose) {
|
|
254
|
+
this.set("instantType", isKeyboardClick ? "click" : "dismiss");
|
|
255
|
+
} else if (eventDetails.reason === exports_reason_parts.focusOut) {
|
|
256
|
+
this.set("instantType", "focus");
|
|
257
|
+
} else {
|
|
258
|
+
this.set("instantType", undefined);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
static useStore(externalStore, initialState) {
|
|
262
|
+
const internalStore = useRefWithInit(() => {
|
|
263
|
+
return new PopoverStore(initialState);
|
|
264
|
+
}).current;
|
|
265
|
+
const store = externalStore ?? internalStore;
|
|
266
|
+
useOnMount(internalStore.disposeEffect);
|
|
267
|
+
return store;
|
|
268
|
+
}
|
|
269
|
+
disposeEffect = () => {
|
|
270
|
+
return this.context.stickIfOpenTimeout.disposeEffect();
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/root/PopoverRoot.js
|
|
275
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
276
|
+
"use client";
|
|
277
|
+
function PopoverRootComponent({
|
|
278
|
+
props
|
|
279
|
+
}) {
|
|
280
|
+
const {
|
|
281
|
+
children,
|
|
282
|
+
open: openProp,
|
|
283
|
+
defaultOpen = false,
|
|
284
|
+
onOpenChange,
|
|
285
|
+
onOpenChangeComplete,
|
|
286
|
+
modal = false,
|
|
287
|
+
handle,
|
|
288
|
+
triggerId: triggerIdProp,
|
|
289
|
+
defaultTriggerId: defaultTriggerIdProp = null
|
|
290
|
+
} = props;
|
|
291
|
+
const store = PopoverStore.useStore(handle?.store, {
|
|
292
|
+
modal,
|
|
293
|
+
open: defaultOpen,
|
|
294
|
+
openProp,
|
|
295
|
+
activeTriggerId: defaultTriggerIdProp,
|
|
296
|
+
triggerIdProp
|
|
297
|
+
});
|
|
298
|
+
useOnFirstRender(() => {
|
|
299
|
+
if (openProp === undefined && store.state.open === false && defaultOpen === true) {
|
|
300
|
+
store.update({
|
|
301
|
+
open: true,
|
|
302
|
+
activeTriggerId: defaultTriggerIdProp
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
store.useControlledProp("openProp", openProp);
|
|
307
|
+
store.useControlledProp("triggerIdProp", triggerIdProp);
|
|
308
|
+
const open = store.useState("open");
|
|
309
|
+
const payload = store.useState("payload");
|
|
310
|
+
store.useContextCallback("onOpenChange", onOpenChange);
|
|
311
|
+
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
|
312
|
+
const {
|
|
313
|
+
openMethod,
|
|
314
|
+
triggerProps: interactionTypeTriggerProps
|
|
315
|
+
} = useOpenInteractionType(open);
|
|
316
|
+
useImplicitActiveTrigger(store);
|
|
317
|
+
const {
|
|
318
|
+
forceUnmount
|
|
319
|
+
} = useOpenStateTransitions(open, store, () => {
|
|
320
|
+
store.update({
|
|
321
|
+
stickIfOpen: true,
|
|
322
|
+
openChangeReason: null
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
React3.useEffect(() => {
|
|
326
|
+
if (!open) {
|
|
327
|
+
store.context.stickIfOpenTimeout.clear();
|
|
328
|
+
}
|
|
329
|
+
}, [store, open]);
|
|
330
|
+
const handleImperativeClose = React3.useCallback(() => {
|
|
331
|
+
store.setOpen(false, createChangeEventDetails(exports_reason_parts.imperativeAction));
|
|
332
|
+
}, [store]);
|
|
333
|
+
React3.useImperativeHandle(props.actionsRef, () => ({
|
|
334
|
+
unmount: forceUnmount,
|
|
335
|
+
close: handleImperativeClose
|
|
336
|
+
}), [forceUnmount, handleImperativeClose]);
|
|
337
|
+
const floatingRootContext = useSyncedFloatingRootContext({
|
|
338
|
+
popupStore: store,
|
|
339
|
+
onOpenChange: store.setOpen
|
|
340
|
+
});
|
|
341
|
+
const dismiss = useDismiss(floatingRootContext, {
|
|
342
|
+
outsidePressEvent: {
|
|
343
|
+
mouse: modal === "trap-focus" ? "sloppy" : "intentional",
|
|
344
|
+
touch: "sloppy"
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
const role = useRole(floatingRootContext);
|
|
348
|
+
const {
|
|
349
|
+
getReferenceProps,
|
|
350
|
+
getFloatingProps,
|
|
351
|
+
getTriggerProps
|
|
352
|
+
} = useInteractions([dismiss, role]);
|
|
353
|
+
const activeTriggerProps = React3.useMemo(() => {
|
|
354
|
+
return getReferenceProps(interactionTypeTriggerProps);
|
|
355
|
+
}, [getReferenceProps, interactionTypeTriggerProps]);
|
|
356
|
+
const inactiveTriggerProps = React3.useMemo(() => {
|
|
357
|
+
return getTriggerProps(interactionTypeTriggerProps);
|
|
358
|
+
}, [getTriggerProps, interactionTypeTriggerProps]);
|
|
359
|
+
const popupProps = React3.useMemo(() => {
|
|
360
|
+
return getFloatingProps();
|
|
361
|
+
}, [getFloatingProps]);
|
|
362
|
+
store.useSyncedValues({
|
|
363
|
+
modal,
|
|
364
|
+
openMethod,
|
|
365
|
+
activeTriggerProps,
|
|
366
|
+
inactiveTriggerProps,
|
|
367
|
+
popupProps,
|
|
368
|
+
floatingRootContext,
|
|
369
|
+
nested: useFloatingParentNodeId() != null
|
|
370
|
+
});
|
|
371
|
+
const popoverContext = React3.useMemo(() => ({
|
|
372
|
+
store
|
|
373
|
+
}), [store]);
|
|
374
|
+
return /* @__PURE__ */ _jsx(PopoverRootContext.Provider, {
|
|
375
|
+
value: popoverContext,
|
|
376
|
+
children: typeof children === "function" ? children({
|
|
377
|
+
payload
|
|
378
|
+
}) : children
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
function PopoverRoot(props) {
|
|
382
|
+
if (usePopoverRootContext(true)) {
|
|
383
|
+
return /* @__PURE__ */ _jsx(PopoverRootComponent, {
|
|
384
|
+
props
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
return /* @__PURE__ */ _jsx(FloatingTree, {
|
|
388
|
+
children: /* @__PURE__ */ _jsx(PopoverRootComponent, {
|
|
389
|
+
props
|
|
390
|
+
})
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/trigger/PopoverTrigger.js
|
|
394
|
+
import * as React4 from "react";
|
|
395
|
+
|
|
396
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/utils/constants.js
|
|
397
|
+
var OPEN_DELAY = 300;
|
|
398
|
+
|
|
399
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/trigger/PopoverTrigger.js
|
|
400
|
+
import { jsx as _jsx2, jsxs as _jsxs } from "react/jsx-runtime";
|
|
401
|
+
"use client";
|
|
402
|
+
var PopoverTrigger = /* @__PURE__ */ React4.forwardRef(function PopoverTrigger2(componentProps, forwardedRef) {
|
|
403
|
+
const {
|
|
404
|
+
render,
|
|
405
|
+
className,
|
|
406
|
+
disabled = false,
|
|
407
|
+
nativeButton = true,
|
|
408
|
+
handle,
|
|
409
|
+
payload,
|
|
410
|
+
openOnHover = false,
|
|
411
|
+
delay = OPEN_DELAY,
|
|
412
|
+
closeDelay = 0,
|
|
413
|
+
id: idProp,
|
|
414
|
+
style,
|
|
415
|
+
...elementProps
|
|
416
|
+
} = componentProps;
|
|
417
|
+
const rootContext = usePopoverRootContext(true);
|
|
418
|
+
const store = handle?.store ?? rootContext?.store;
|
|
419
|
+
if (!store) {
|
|
420
|
+
throw new Error("Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.");
|
|
421
|
+
}
|
|
422
|
+
const thisTriggerId = useBaseUiId(idProp);
|
|
423
|
+
const isTriggerActive = store.useState("isTriggerActive", thisTriggerId);
|
|
424
|
+
const floatingContext = store.useState("floatingRootContext");
|
|
425
|
+
const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
|
|
426
|
+
const triggerElementRef = React4.useRef(null);
|
|
427
|
+
const {
|
|
428
|
+
registerTrigger,
|
|
429
|
+
isMountedByThisTrigger
|
|
430
|
+
} = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
|
|
431
|
+
payload,
|
|
432
|
+
disabled,
|
|
433
|
+
openOnHover,
|
|
434
|
+
closeDelay
|
|
435
|
+
});
|
|
436
|
+
const openReason = store.useState("openChangeReason");
|
|
437
|
+
const stickIfOpen = store.useState("stickIfOpen");
|
|
438
|
+
const openMethod = store.useState("openMethod");
|
|
439
|
+
const focusManagerModal = store.useState("focusManagerModal");
|
|
440
|
+
const hoverProps = useHoverReferenceInteraction(floatingContext, {
|
|
441
|
+
enabled: floatingContext != null && openOnHover && (openMethod !== "touch" || openReason !== exports_reason_parts.triggerPress),
|
|
442
|
+
mouseOnly: true,
|
|
443
|
+
move: false,
|
|
444
|
+
handleClose: safePolygon(),
|
|
445
|
+
restMs: delay,
|
|
446
|
+
delay: {
|
|
447
|
+
close: closeDelay
|
|
448
|
+
},
|
|
449
|
+
triggerElementRef,
|
|
450
|
+
isActiveTrigger: isTriggerActive,
|
|
451
|
+
isClosing: () => store.select("transitionStatus") === "ending"
|
|
452
|
+
});
|
|
453
|
+
const click = useClick(floatingContext, {
|
|
454
|
+
enabled: floatingContext != null,
|
|
455
|
+
stickIfOpen
|
|
456
|
+
});
|
|
457
|
+
const localProps = useInteractions([click]);
|
|
458
|
+
const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger);
|
|
459
|
+
const state = {
|
|
460
|
+
disabled,
|
|
461
|
+
open: isOpenedByThisTrigger
|
|
462
|
+
};
|
|
463
|
+
const {
|
|
464
|
+
getButtonProps,
|
|
465
|
+
buttonRef
|
|
466
|
+
} = useButton({
|
|
467
|
+
disabled,
|
|
468
|
+
native: nativeButton
|
|
469
|
+
});
|
|
470
|
+
const stateAttributesMapping = React4.useMemo(() => ({
|
|
471
|
+
open(value) {
|
|
472
|
+
if (value && openReason === exports_reason_parts.triggerPress) {
|
|
473
|
+
return pressableTriggerOpenStateMapping.open(value);
|
|
474
|
+
}
|
|
475
|
+
return triggerOpenStateMapping.open(value);
|
|
476
|
+
}
|
|
477
|
+
}), [openReason]);
|
|
478
|
+
const element = useRenderElement("button", componentProps, {
|
|
479
|
+
state,
|
|
480
|
+
ref: [buttonRef, forwardedRef, registerTrigger, triggerElementRef],
|
|
481
|
+
props: [localProps.getReferenceProps(), hoverProps, rootTriggerProps, {
|
|
482
|
+
[CLICK_TRIGGER_IDENTIFIER]: "",
|
|
483
|
+
id: thisTriggerId
|
|
484
|
+
}, elementProps, getButtonProps],
|
|
485
|
+
stateAttributesMapping
|
|
486
|
+
});
|
|
487
|
+
const {
|
|
488
|
+
preFocusGuardRef,
|
|
489
|
+
handlePreFocusGuardFocus,
|
|
490
|
+
handleFocusTargetFocus
|
|
491
|
+
} = useTriggerFocusGuards(store, triggerElementRef);
|
|
492
|
+
if (isTriggerActive && !focusManagerModal) {
|
|
493
|
+
return /* @__PURE__ */ _jsxs(React4.Fragment, {
|
|
494
|
+
children: [/* @__PURE__ */ _jsx2(FocusGuard, {
|
|
495
|
+
ref: preFocusGuardRef,
|
|
496
|
+
onFocus: handlePreFocusGuardFocus
|
|
497
|
+
}), /* @__PURE__ */ _jsx2(React4.Fragment, {
|
|
498
|
+
children: element
|
|
499
|
+
}, thisTriggerId), /* @__PURE__ */ _jsx2(FocusGuard, {
|
|
500
|
+
ref: store.context.triggerFocusTargetRef,
|
|
501
|
+
onFocus: handleFocusTargetFocus
|
|
502
|
+
})]
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
return /* @__PURE__ */ _jsx2(React4.Fragment, {
|
|
506
|
+
children: element
|
|
507
|
+
}, thisTriggerId);
|
|
508
|
+
});
|
|
509
|
+
if (true)
|
|
510
|
+
PopoverTrigger.displayName = "PopoverTrigger";
|
|
511
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/portal/PopoverPortal.js
|
|
512
|
+
import * as React6 from "react";
|
|
513
|
+
|
|
514
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/portal/PopoverPortalContext.js
|
|
515
|
+
import * as React5 from "react";
|
|
516
|
+
"use client";
|
|
517
|
+
var PopoverPortalContext = /* @__PURE__ */ React5.createContext(undefined);
|
|
518
|
+
if (true)
|
|
519
|
+
PopoverPortalContext.displayName = "PopoverPortalContext";
|
|
520
|
+
function usePopoverPortalContext() {
|
|
521
|
+
const value = React5.useContext(PopoverPortalContext);
|
|
522
|
+
if (value === undefined) {
|
|
523
|
+
throw new Error("Base UI: <Popover.Portal> is missing.");
|
|
524
|
+
}
|
|
525
|
+
return value;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/portal/PopoverPortal.js
|
|
529
|
+
import { jsx as _jsx3 } from "react/jsx-runtime";
|
|
530
|
+
"use client";
|
|
531
|
+
var PopoverPortal = /* @__PURE__ */ React6.forwardRef(function PopoverPortal2(props, forwardedRef) {
|
|
532
|
+
const {
|
|
533
|
+
keepMounted = false,
|
|
534
|
+
...portalProps
|
|
535
|
+
} = props;
|
|
536
|
+
const {
|
|
537
|
+
store
|
|
538
|
+
} = usePopoverRootContext();
|
|
539
|
+
const mounted = store.useState("mounted");
|
|
540
|
+
const shouldRender = mounted || keepMounted;
|
|
541
|
+
if (!shouldRender) {
|
|
542
|
+
return null;
|
|
543
|
+
}
|
|
544
|
+
return /* @__PURE__ */ _jsx3(PopoverPortalContext.Provider, {
|
|
545
|
+
value: keepMounted,
|
|
546
|
+
children: /* @__PURE__ */ _jsx3(FloatingPortal, {
|
|
547
|
+
ref: forwardedRef,
|
|
548
|
+
...portalProps
|
|
549
|
+
})
|
|
550
|
+
});
|
|
551
|
+
});
|
|
552
|
+
if (true)
|
|
553
|
+
PopoverPortal.displayName = "PopoverPortal";
|
|
554
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/positioner/PopoverPositioner.js
|
|
555
|
+
import * as React8 from "react";
|
|
556
|
+
|
|
557
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/positioner/PopoverPositionerContext.js
|
|
558
|
+
import * as React7 from "react";
|
|
559
|
+
"use client";
|
|
560
|
+
var PopoverPositionerContext = /* @__PURE__ */ React7.createContext(undefined);
|
|
561
|
+
if (true)
|
|
562
|
+
PopoverPositionerContext.displayName = "PopoverPositionerContext";
|
|
563
|
+
function usePopoverPositionerContext() {
|
|
564
|
+
const context = React7.useContext(PopoverPositionerContext);
|
|
565
|
+
if (!context) {
|
|
566
|
+
throw new Error("Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.");
|
|
567
|
+
}
|
|
568
|
+
return context;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/positioner/PopoverPositioner.js
|
|
572
|
+
import { jsx as _jsx4, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
573
|
+
"use client";
|
|
574
|
+
var PopoverPositioner = /* @__PURE__ */ React8.forwardRef(function PopoverPositioner2(componentProps, forwardedRef) {
|
|
575
|
+
const {
|
|
576
|
+
render,
|
|
577
|
+
className,
|
|
578
|
+
anchor,
|
|
579
|
+
positionMethod = "absolute",
|
|
580
|
+
side = "bottom",
|
|
581
|
+
align = "center",
|
|
582
|
+
sideOffset = 0,
|
|
583
|
+
alignOffset = 0,
|
|
584
|
+
collisionBoundary = "clipping-ancestors",
|
|
585
|
+
collisionPadding = 5,
|
|
586
|
+
arrowPadding = 5,
|
|
587
|
+
sticky = false,
|
|
588
|
+
disableAnchorTracking = false,
|
|
589
|
+
collisionAvoidance = POPUP_COLLISION_AVOIDANCE,
|
|
590
|
+
style,
|
|
591
|
+
...elementProps
|
|
592
|
+
} = componentProps;
|
|
593
|
+
const {
|
|
594
|
+
store
|
|
595
|
+
} = usePopoverRootContext();
|
|
596
|
+
const keepMounted = usePopoverPortalContext();
|
|
597
|
+
const nodeId = useFloatingNodeId();
|
|
598
|
+
const floatingRootContext = store.useState("floatingRootContext");
|
|
599
|
+
const mounted = store.useState("mounted");
|
|
600
|
+
const open = store.useState("open");
|
|
601
|
+
const openReason = store.useState("openChangeReason");
|
|
602
|
+
const triggerElement = store.useState("activeTriggerElement");
|
|
603
|
+
const modal = store.useState("modal");
|
|
604
|
+
const openMethod = store.useState("openMethod");
|
|
605
|
+
const positionerElement = store.useState("positionerElement");
|
|
606
|
+
const instantType = store.useState("instantType");
|
|
607
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
608
|
+
const hasViewport = store.useState("hasViewport");
|
|
609
|
+
const prevTriggerElementRef = React8.useRef(null);
|
|
610
|
+
const runOnceAnimationsFinish = useAnimationsFinished(positionerElement, false, false);
|
|
611
|
+
const positioning = useAnchorPositioning({
|
|
612
|
+
anchor,
|
|
613
|
+
floatingRootContext,
|
|
614
|
+
positionMethod,
|
|
615
|
+
mounted,
|
|
616
|
+
side,
|
|
617
|
+
sideOffset,
|
|
618
|
+
align,
|
|
619
|
+
alignOffset,
|
|
620
|
+
arrowPadding,
|
|
621
|
+
collisionBoundary,
|
|
622
|
+
collisionPadding,
|
|
623
|
+
sticky,
|
|
624
|
+
disableAnchorTracking,
|
|
625
|
+
keepMounted,
|
|
626
|
+
nodeId,
|
|
627
|
+
collisionAvoidance,
|
|
628
|
+
adaptiveOrigin: hasViewport ? adaptiveOrigin : undefined
|
|
629
|
+
});
|
|
630
|
+
const domReference = floatingRootContext.useState("domReferenceElement");
|
|
631
|
+
useIsoLayoutEffect(() => {
|
|
632
|
+
const currentTriggerElement = domReference;
|
|
633
|
+
const prevTriggerElement = prevTriggerElementRef.current;
|
|
634
|
+
if (currentTriggerElement) {
|
|
635
|
+
prevTriggerElementRef.current = currentTriggerElement;
|
|
636
|
+
}
|
|
637
|
+
if (prevTriggerElement && currentTriggerElement && currentTriggerElement !== prevTriggerElement) {
|
|
638
|
+
store.set("instantType", undefined);
|
|
639
|
+
const ac = new AbortController;
|
|
640
|
+
runOnceAnimationsFinish(() => {
|
|
641
|
+
store.set("instantType", "trigger-change");
|
|
642
|
+
}, ac.signal);
|
|
643
|
+
return () => {
|
|
644
|
+
ac.abort();
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
return;
|
|
648
|
+
}, [domReference, runOnceAnimationsFinish, store]);
|
|
649
|
+
const state = {
|
|
650
|
+
open,
|
|
651
|
+
side: positioning.side,
|
|
652
|
+
align: positioning.align,
|
|
653
|
+
anchorHidden: positioning.anchorHidden,
|
|
654
|
+
instant: instantType
|
|
655
|
+
};
|
|
656
|
+
useAnchoredPopupScrollLock(open && modal === true && openReason !== exports_reason_parts.triggerHover, openMethod === "touch", positionerElement, triggerElement);
|
|
657
|
+
const setPositionerElement = React8.useCallback((element2) => {
|
|
658
|
+
store.set("positionerElement", element2);
|
|
659
|
+
}, [store]);
|
|
660
|
+
const element = usePositioner(componentProps, state, {
|
|
661
|
+
styles: positioning.positionerStyles,
|
|
662
|
+
transitionStatus,
|
|
663
|
+
props: elementProps,
|
|
664
|
+
refs: [forwardedRef, setPositionerElement],
|
|
665
|
+
hidden: !mounted,
|
|
666
|
+
inert: !open
|
|
667
|
+
});
|
|
668
|
+
return /* @__PURE__ */ _jsxs2(PopoverPositionerContext.Provider, {
|
|
669
|
+
value: positioning,
|
|
670
|
+
children: [mounted && modal === true && openReason !== exports_reason_parts.triggerHover && /* @__PURE__ */ _jsx4(InternalBackdrop, {
|
|
671
|
+
ref: store.context.internalBackdropRef,
|
|
672
|
+
inert: inertValue(!open),
|
|
673
|
+
cutout: triggerElement
|
|
674
|
+
}), /* @__PURE__ */ _jsx4(FloatingNode, {
|
|
675
|
+
id: nodeId,
|
|
676
|
+
children: element
|
|
677
|
+
})]
|
|
678
|
+
});
|
|
679
|
+
});
|
|
680
|
+
if (true)
|
|
681
|
+
PopoverPositioner.displayName = "PopoverPositioner";
|
|
682
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/popup/PopoverPopup.js
|
|
683
|
+
import * as React10 from "react";
|
|
684
|
+
|
|
685
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/utils/closePart.js
|
|
686
|
+
import * as React9 from "react";
|
|
687
|
+
import { jsx as _jsx5 } from "react/jsx-runtime";
|
|
688
|
+
"use client";
|
|
689
|
+
var ClosePartContext = /* @__PURE__ */ React9.createContext(undefined);
|
|
690
|
+
if (true)
|
|
691
|
+
ClosePartContext.displayName = "ClosePartContext";
|
|
692
|
+
function useClosePartCount() {
|
|
693
|
+
const [closePartCount, setClosePartCount] = React9.useState(0);
|
|
694
|
+
const register = useStableCallback(() => {
|
|
695
|
+
setClosePartCount((count) => count + 1);
|
|
696
|
+
return () => {
|
|
697
|
+
setClosePartCount((count) => Math.max(0, count - 1));
|
|
698
|
+
};
|
|
699
|
+
});
|
|
700
|
+
const context = React9.useMemo(() => ({
|
|
701
|
+
register
|
|
702
|
+
}), [register]);
|
|
703
|
+
return {
|
|
704
|
+
context,
|
|
705
|
+
hasClosePart: closePartCount > 0
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
function ClosePartProvider(props) {
|
|
709
|
+
const {
|
|
710
|
+
value,
|
|
711
|
+
children
|
|
712
|
+
} = props;
|
|
713
|
+
return /* @__PURE__ */ _jsx5(ClosePartContext.Provider, {
|
|
714
|
+
value,
|
|
715
|
+
children
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
function useClosePartRegistration() {
|
|
719
|
+
const context = React9.useContext(ClosePartContext);
|
|
720
|
+
useIsoLayoutEffect(() => {
|
|
721
|
+
return context?.register();
|
|
722
|
+
}, [context]);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/popup/PopoverPopup.js
|
|
726
|
+
import { jsx as _jsx6 } from "react/jsx-runtime";
|
|
727
|
+
"use client";
|
|
728
|
+
var stateAttributesMapping = {
|
|
729
|
+
...popupStateMapping,
|
|
730
|
+
...transitionStatusMapping
|
|
731
|
+
};
|
|
732
|
+
var PopoverPopup = /* @__PURE__ */ React10.forwardRef(function PopoverPopup2(componentProps, forwardedRef) {
|
|
733
|
+
const {
|
|
734
|
+
className,
|
|
735
|
+
render,
|
|
736
|
+
initialFocus,
|
|
737
|
+
finalFocus,
|
|
738
|
+
style,
|
|
739
|
+
...elementProps
|
|
740
|
+
} = componentProps;
|
|
741
|
+
const {
|
|
742
|
+
store
|
|
743
|
+
} = usePopoverRootContext();
|
|
744
|
+
const positioner = usePopoverPositionerContext();
|
|
745
|
+
const insideToolbar = useToolbarRootContext(true) != null;
|
|
746
|
+
const {
|
|
747
|
+
context: closePartContext,
|
|
748
|
+
hasClosePart
|
|
749
|
+
} = useClosePartCount();
|
|
750
|
+
const open = store.useState("open");
|
|
751
|
+
const openMethod = store.useState("openMethod");
|
|
752
|
+
const instantType = store.useState("instantType");
|
|
753
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
754
|
+
const popupProps = store.useState("popupProps");
|
|
755
|
+
const titleId = store.useState("titleElementId");
|
|
756
|
+
const descriptionId = store.useState("descriptionElementId");
|
|
757
|
+
const modal = store.useState("modal");
|
|
758
|
+
const mounted = store.useState("mounted");
|
|
759
|
+
const openReason = store.useState("openChangeReason");
|
|
760
|
+
const activeTriggerElement = store.useState("activeTriggerElement");
|
|
761
|
+
const floatingContext = store.useState("floatingRootContext");
|
|
762
|
+
useOpenChangeComplete({
|
|
763
|
+
open,
|
|
764
|
+
ref: store.context.popupRef,
|
|
765
|
+
onComplete() {
|
|
766
|
+
if (open) {
|
|
767
|
+
store.context.onOpenChangeComplete?.(true);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
const disabled = store.useState("disabled");
|
|
772
|
+
const openOnHover = store.useState("openOnHover");
|
|
773
|
+
const closeDelay = store.useState("closeDelay");
|
|
774
|
+
useHoverFloatingInteraction(floatingContext, {
|
|
775
|
+
enabled: openOnHover && !disabled,
|
|
776
|
+
closeDelay
|
|
777
|
+
});
|
|
778
|
+
function defaultInitialFocus(interactionType) {
|
|
779
|
+
if (interactionType === "touch") {
|
|
780
|
+
return store.context.popupRef.current;
|
|
781
|
+
}
|
|
782
|
+
return true;
|
|
783
|
+
}
|
|
784
|
+
const resolvedInitialFocus = initialFocus === undefined ? defaultInitialFocus : initialFocus;
|
|
785
|
+
const state = {
|
|
786
|
+
open,
|
|
787
|
+
side: positioner.side,
|
|
788
|
+
align: positioner.align,
|
|
789
|
+
instant: instantType,
|
|
790
|
+
transitionStatus
|
|
791
|
+
};
|
|
792
|
+
const focusManagerModal = modal !== false && hasClosePart;
|
|
793
|
+
store.useSyncedValue("focusManagerModal", focusManagerModal);
|
|
794
|
+
const setPopupElement = React10.useCallback((element2) => {
|
|
795
|
+
store.set("popupElement", element2);
|
|
796
|
+
}, [store]);
|
|
797
|
+
const element = useRenderElement("div", componentProps, {
|
|
798
|
+
state,
|
|
799
|
+
ref: [forwardedRef, store.context.popupRef, setPopupElement],
|
|
800
|
+
props: [popupProps, {
|
|
801
|
+
"aria-labelledby": titleId,
|
|
802
|
+
"aria-describedby": descriptionId,
|
|
803
|
+
onKeyDown(event) {
|
|
804
|
+
if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {
|
|
805
|
+
event.stopPropagation();
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}, getDisabledMountTransitionStyles(transitionStatus), elementProps],
|
|
809
|
+
stateAttributesMapping
|
|
810
|
+
});
|
|
811
|
+
return /* @__PURE__ */ _jsx6(FloatingFocusManager, {
|
|
812
|
+
context: floatingContext,
|
|
813
|
+
openInteractionType: openMethod,
|
|
814
|
+
modal: focusManagerModal,
|
|
815
|
+
disabled: !mounted || openReason === exports_reason_parts.triggerHover,
|
|
816
|
+
initialFocus: resolvedInitialFocus,
|
|
817
|
+
returnFocus: finalFocus,
|
|
818
|
+
restoreFocus: "popup",
|
|
819
|
+
previousFocusableElement: isHTMLElement(activeTriggerElement) ? activeTriggerElement : undefined,
|
|
820
|
+
nextFocusableElement: store.context.triggerFocusTargetRef,
|
|
821
|
+
beforeContentFocusGuardRef: store.context.beforeContentFocusGuardRef,
|
|
822
|
+
children: /* @__PURE__ */ _jsx6(ClosePartProvider, {
|
|
823
|
+
value: closePartContext,
|
|
824
|
+
children: element
|
|
825
|
+
})
|
|
826
|
+
});
|
|
827
|
+
});
|
|
828
|
+
if (true)
|
|
829
|
+
PopoverPopup.displayName = "PopoverPopup";
|
|
830
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/arrow/PopoverArrow.js
|
|
831
|
+
import * as React11 from "react";
|
|
832
|
+
"use client";
|
|
833
|
+
var PopoverArrow = /* @__PURE__ */ React11.forwardRef(function PopoverArrow2(componentProps, forwardedRef) {
|
|
834
|
+
const {
|
|
835
|
+
className,
|
|
836
|
+
render,
|
|
837
|
+
style,
|
|
838
|
+
...elementProps
|
|
839
|
+
} = componentProps;
|
|
840
|
+
const {
|
|
841
|
+
store
|
|
842
|
+
} = usePopoverRootContext();
|
|
843
|
+
const open = store.useState("open");
|
|
844
|
+
const {
|
|
845
|
+
arrowRef,
|
|
846
|
+
side,
|
|
847
|
+
align,
|
|
848
|
+
arrowUncentered,
|
|
849
|
+
arrowStyles
|
|
850
|
+
} = usePopoverPositionerContext();
|
|
851
|
+
const state = {
|
|
852
|
+
open,
|
|
853
|
+
side,
|
|
854
|
+
align,
|
|
855
|
+
uncentered: arrowUncentered
|
|
856
|
+
};
|
|
857
|
+
const element = useRenderElement("div", componentProps, {
|
|
858
|
+
state,
|
|
859
|
+
ref: [forwardedRef, arrowRef],
|
|
860
|
+
props: [{
|
|
861
|
+
style: arrowStyles,
|
|
862
|
+
"aria-hidden": true
|
|
863
|
+
}, elementProps],
|
|
864
|
+
stateAttributesMapping: popupStateMapping
|
|
865
|
+
});
|
|
866
|
+
return element;
|
|
867
|
+
});
|
|
868
|
+
if (true)
|
|
869
|
+
PopoverArrow.displayName = "PopoverArrow";
|
|
870
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/backdrop/PopoverBackdrop.js
|
|
871
|
+
import * as React12 from "react";
|
|
872
|
+
"use client";
|
|
873
|
+
var stateAttributesMapping2 = {
|
|
874
|
+
...popupStateMapping,
|
|
875
|
+
...transitionStatusMapping
|
|
876
|
+
};
|
|
877
|
+
var PopoverBackdrop = /* @__PURE__ */ React12.forwardRef(function PopoverBackdrop2(props, forwardedRef) {
|
|
878
|
+
const {
|
|
879
|
+
className,
|
|
880
|
+
render,
|
|
881
|
+
style,
|
|
882
|
+
...elementProps
|
|
883
|
+
} = props;
|
|
884
|
+
const {
|
|
885
|
+
store
|
|
886
|
+
} = usePopoverRootContext();
|
|
887
|
+
const open = store.useState("open");
|
|
888
|
+
const mounted = store.useState("mounted");
|
|
889
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
890
|
+
const openReason = store.useState("openChangeReason");
|
|
891
|
+
const state = {
|
|
892
|
+
open,
|
|
893
|
+
transitionStatus
|
|
894
|
+
};
|
|
895
|
+
const element = useRenderElement("div", props, {
|
|
896
|
+
state,
|
|
897
|
+
ref: [store.context.backdropRef, forwardedRef],
|
|
898
|
+
props: [{
|
|
899
|
+
role: "presentation",
|
|
900
|
+
hidden: !mounted,
|
|
901
|
+
style: {
|
|
902
|
+
pointerEvents: openReason === exports_reason_parts.triggerHover ? "none" : undefined,
|
|
903
|
+
userSelect: "none",
|
|
904
|
+
WebkitUserSelect: "none"
|
|
905
|
+
}
|
|
906
|
+
}, elementProps],
|
|
907
|
+
stateAttributesMapping: stateAttributesMapping2
|
|
908
|
+
});
|
|
909
|
+
return element;
|
|
910
|
+
});
|
|
911
|
+
if (true)
|
|
912
|
+
PopoverBackdrop.displayName = "PopoverBackdrop";
|
|
913
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/title/PopoverTitle.js
|
|
914
|
+
import * as React13 from "react";
|
|
915
|
+
"use client";
|
|
916
|
+
var PopoverTitle = /* @__PURE__ */ React13.forwardRef(function PopoverTitle2(componentProps, forwardedRef) {
|
|
917
|
+
const {
|
|
918
|
+
render,
|
|
919
|
+
className,
|
|
920
|
+
style,
|
|
921
|
+
...elementProps
|
|
922
|
+
} = componentProps;
|
|
923
|
+
const {
|
|
924
|
+
store
|
|
925
|
+
} = usePopoverRootContext();
|
|
926
|
+
const id = useBaseUiId(elementProps.id);
|
|
927
|
+
useIsoLayoutEffect(() => {
|
|
928
|
+
store.set("titleElementId", id);
|
|
929
|
+
return () => {
|
|
930
|
+
store.set("titleElementId", undefined);
|
|
931
|
+
};
|
|
932
|
+
}, [store, id]);
|
|
933
|
+
const element = useRenderElement("h2", componentProps, {
|
|
934
|
+
ref: forwardedRef,
|
|
935
|
+
props: [{
|
|
936
|
+
id
|
|
937
|
+
}, elementProps]
|
|
938
|
+
});
|
|
939
|
+
return element;
|
|
940
|
+
});
|
|
941
|
+
if (true)
|
|
942
|
+
PopoverTitle.displayName = "PopoverTitle";
|
|
943
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/description/PopoverDescription.js
|
|
944
|
+
import * as React14 from "react";
|
|
945
|
+
"use client";
|
|
946
|
+
var PopoverDescription = /* @__PURE__ */ React14.forwardRef(function PopoverDescription2(componentProps, forwardedRef) {
|
|
947
|
+
const {
|
|
948
|
+
render,
|
|
949
|
+
className,
|
|
950
|
+
style,
|
|
951
|
+
...elementProps
|
|
952
|
+
} = componentProps;
|
|
953
|
+
const {
|
|
954
|
+
store
|
|
955
|
+
} = usePopoverRootContext();
|
|
956
|
+
const id = useBaseUiId(elementProps.id);
|
|
957
|
+
useIsoLayoutEffect(() => {
|
|
958
|
+
store.set("descriptionElementId", id);
|
|
959
|
+
return () => {
|
|
960
|
+
store.set("descriptionElementId", undefined);
|
|
961
|
+
};
|
|
962
|
+
}, [store, id]);
|
|
963
|
+
const element = useRenderElement("p", componentProps, {
|
|
964
|
+
ref: forwardedRef,
|
|
965
|
+
props: [{
|
|
966
|
+
id
|
|
967
|
+
}, elementProps]
|
|
968
|
+
});
|
|
969
|
+
return element;
|
|
970
|
+
});
|
|
971
|
+
if (true)
|
|
972
|
+
PopoverDescription.displayName = "PopoverDescription";
|
|
973
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/close/PopoverClose.js
|
|
974
|
+
import * as React15 from "react";
|
|
975
|
+
"use client";
|
|
976
|
+
var PopoverClose = /* @__PURE__ */ React15.forwardRef(function PopoverClose2(componentProps, forwardedRef) {
|
|
977
|
+
const {
|
|
978
|
+
render,
|
|
979
|
+
className,
|
|
980
|
+
disabled = false,
|
|
981
|
+
nativeButton = true,
|
|
982
|
+
style,
|
|
983
|
+
...elementProps
|
|
984
|
+
} = componentProps;
|
|
985
|
+
const {
|
|
986
|
+
buttonRef,
|
|
987
|
+
getButtonProps
|
|
988
|
+
} = useButton({
|
|
989
|
+
disabled,
|
|
990
|
+
focusableWhenDisabled: false,
|
|
991
|
+
native: nativeButton
|
|
992
|
+
});
|
|
993
|
+
const {
|
|
994
|
+
store
|
|
995
|
+
} = usePopoverRootContext();
|
|
996
|
+
useClosePartRegistration();
|
|
997
|
+
const element = useRenderElement("button", componentProps, {
|
|
998
|
+
ref: [forwardedRef, buttonRef],
|
|
999
|
+
props: [{
|
|
1000
|
+
onClick(event) {
|
|
1001
|
+
store.setOpen(false, createChangeEventDetails(exports_reason_parts.closePress, event.nativeEvent, event.currentTarget));
|
|
1002
|
+
}
|
|
1003
|
+
}, elementProps, getButtonProps]
|
|
1004
|
+
});
|
|
1005
|
+
return element;
|
|
1006
|
+
});
|
|
1007
|
+
if (true)
|
|
1008
|
+
PopoverClose.displayName = "PopoverClose";
|
|
1009
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/viewport/PopoverViewport.js
|
|
1010
|
+
import * as React16 from "react";
|
|
1011
|
+
|
|
1012
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/viewport/PopoverViewportCssVars.js
|
|
1013
|
+
var PopoverViewportCssVars = /* @__PURE__ */ function(PopoverViewportCssVars2) {
|
|
1014
|
+
PopoverViewportCssVars2["popupWidth"] = "--popup-width";
|
|
1015
|
+
PopoverViewportCssVars2["popupHeight"] = "--popup-height";
|
|
1016
|
+
return PopoverViewportCssVars2;
|
|
1017
|
+
}({});
|
|
1018
|
+
|
|
1019
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/viewport/PopoverViewport.js
|
|
1020
|
+
"use client";
|
|
1021
|
+
var stateAttributesMapping3 = {
|
|
1022
|
+
activationDirection: (value) => value ? {
|
|
1023
|
+
"data-activation-direction": value
|
|
1024
|
+
} : null
|
|
1025
|
+
};
|
|
1026
|
+
var PopoverViewport = /* @__PURE__ */ React16.forwardRef(function PopoverViewport2(componentProps, forwardedRef) {
|
|
1027
|
+
const {
|
|
1028
|
+
render,
|
|
1029
|
+
className,
|
|
1030
|
+
style,
|
|
1031
|
+
children,
|
|
1032
|
+
...elementProps
|
|
1033
|
+
} = componentProps;
|
|
1034
|
+
const {
|
|
1035
|
+
store
|
|
1036
|
+
} = usePopoverRootContext();
|
|
1037
|
+
const {
|
|
1038
|
+
side
|
|
1039
|
+
} = usePopoverPositionerContext();
|
|
1040
|
+
const instantType = store.useState("instantType");
|
|
1041
|
+
const {
|
|
1042
|
+
children: childrenToRender,
|
|
1043
|
+
state: viewportState
|
|
1044
|
+
} = usePopupViewport({
|
|
1045
|
+
store,
|
|
1046
|
+
side,
|
|
1047
|
+
cssVars: PopoverViewportCssVars,
|
|
1048
|
+
children
|
|
1049
|
+
});
|
|
1050
|
+
const state = {
|
|
1051
|
+
activationDirection: viewportState.activationDirection,
|
|
1052
|
+
transitioning: viewportState.transitioning,
|
|
1053
|
+
instant: instantType
|
|
1054
|
+
};
|
|
1055
|
+
return useRenderElement("div", componentProps, {
|
|
1056
|
+
state,
|
|
1057
|
+
ref: forwardedRef,
|
|
1058
|
+
props: [elementProps, {
|
|
1059
|
+
children: childrenToRender
|
|
1060
|
+
}],
|
|
1061
|
+
stateAttributesMapping: stateAttributesMapping3
|
|
1062
|
+
});
|
|
1063
|
+
});
|
|
1064
|
+
if (true)
|
|
1065
|
+
PopoverViewport.displayName = "PopoverViewport";
|
|
1066
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/popover/store/PopoverHandle.js
|
|
1067
|
+
class PopoverHandle {
|
|
1068
|
+
constructor() {
|
|
1069
|
+
this.store = new PopoverStore;
|
|
1070
|
+
}
|
|
1071
|
+
open(triggerId) {
|
|
1072
|
+
const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) ?? undefined : undefined;
|
|
1073
|
+
if (triggerId && !triggerElement) {
|
|
1074
|
+
throw new Error(`Base UI: PopoverHandle.open: No trigger found with id "${triggerId}".`);
|
|
1075
|
+
}
|
|
1076
|
+
this.store.setOpen(true, createChangeEventDetails(exports_reason_parts.imperativeAction, undefined, triggerElement));
|
|
1077
|
+
}
|
|
1078
|
+
close() {
|
|
1079
|
+
this.store.setOpen(false, createChangeEventDetails(exports_reason_parts.imperativeAction, undefined, undefined));
|
|
1080
|
+
}
|
|
1081
|
+
get isOpen() {
|
|
1082
|
+
return this.store.state.open;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
function createPopoverHandle() {
|
|
1086
|
+
return new PopoverHandle;
|
|
1087
|
+
}
|
|
1088
|
+
export {
|
|
1089
|
+
exports_index_parts as Popover
|
|
1090
|
+
};
|