@tamagui/popover 1.0.1-beta.151 → 1.0.1-beta.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Popover.js +254 -209
- package/dist/cjs/Popover.js.map +2 -2
- package/dist/esm/Popover.js +250 -208
- package/dist/esm/Popover.js.map +2 -2
- package/dist/esm/floating.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/jsx/Popover.js +156 -130
- package/dist/jsx/Popover.js.map +2 -2
- package/dist/jsx/floating.js.map +1 -1
- package/dist/jsx/index.js.map +1 -1
- package/package.json +15 -15
package/dist/cjs/Popover.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var Popover_exports = {};
|
|
23
26
|
__export(Popover_exports, {
|
|
@@ -33,6 +36,7 @@ __export(Popover_exports, {
|
|
|
33
36
|
usePopoverScope: () => usePopoverScope
|
|
34
37
|
});
|
|
35
38
|
module.exports = __toCommonJS(Popover_exports);
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
40
|
var import_polyfill_dev = require("@tamagui/polyfill-dev");
|
|
37
41
|
var import_animate_presence = require("@tamagui/animate-presence");
|
|
38
42
|
var import_aria_hidden = require("@tamagui/aria-hidden");
|
|
@@ -57,229 +61,269 @@ const createPopoverScope = createPopoverScopeInternal;
|
|
|
57
61
|
const [PopoverProviderInternal, usePopoverInternalContext] = createPopoverContext(POPOVER_NAME);
|
|
58
62
|
const __PopoverProviderInternal = PopoverProviderInternal;
|
|
59
63
|
const ANCHOR_NAME = "PopoverAnchor";
|
|
60
|
-
const PopoverAnchor = React.forwardRef(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
});
|
|
64
|
+
const PopoverAnchor = React.forwardRef(
|
|
65
|
+
(props, forwardedRef) => {
|
|
66
|
+
const { __scopePopover, ...anchorProps } = props;
|
|
67
|
+
const context = usePopoverInternalContext(ANCHOR_NAME, __scopePopover);
|
|
68
|
+
const popperScope = usePopoverScope(__scopePopover);
|
|
69
|
+
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
70
|
+
React.useEffect(() => {
|
|
71
|
+
onCustomAnchorAdd();
|
|
72
|
+
return () => onCustomAnchorRemove();
|
|
73
|
+
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperAnchor, {
|
|
75
|
+
...popperScope,
|
|
76
|
+
...anchorProps,
|
|
77
|
+
ref: forwardedRef
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
);
|
|
75
81
|
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
76
82
|
const TRIGGER_NAME = "PopoverTrigger";
|
|
77
|
-
const PopoverTrigger = React.forwardRef(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
83
|
+
const PopoverTrigger = React.forwardRef(
|
|
84
|
+
(props, forwardedRef) => {
|
|
85
|
+
const { __scopePopover, ...triggerProps } = props;
|
|
86
|
+
const context = usePopoverInternalContext(TRIGGER_NAME, __scopePopover);
|
|
87
|
+
const popperScope = usePopoverScope(__scopePopover);
|
|
88
|
+
const composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
|
|
89
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {
|
|
90
|
+
"aria-haspopup": "dialog",
|
|
91
|
+
"aria-expanded": context.open,
|
|
92
|
+
"data-state": getState(context.open),
|
|
93
|
+
...triggerProps,
|
|
94
|
+
ref: composedTriggerRef,
|
|
95
|
+
onPress: (0, import_core.composeEventHandlers)(props.onPress, context.onOpenToggle)
|
|
96
|
+
});
|
|
97
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperAnchor, {
|
|
98
|
+
asChild: true,
|
|
99
|
+
...popperScope,
|
|
100
|
+
children: trigger
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
);
|
|
95
104
|
PopoverTrigger.displayName = TRIGGER_NAME;
|
|
96
105
|
const CONTENT_NAME = "PopoverContent";
|
|
97
|
-
const PopoverContent = React.forwardRef(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
children,
|
|
146
|
-
disableRemoveScroll,
|
|
147
|
-
...contentProps
|
|
148
|
-
} = props;
|
|
149
|
-
const popperScope = usePopoverScope(__scopePopover);
|
|
150
|
-
const context = usePopoverInternalContext(CONTENT_NAME, popperScope.__scopePopover);
|
|
151
|
-
const showSheet = useShowPopoverSheet(context);
|
|
152
|
-
if (showSheet) {
|
|
153
|
-
return /* @__PURE__ */ React.createElement(import_portal.PortalItem, {
|
|
154
|
-
hostName: `${context.scopeKey}SheetContents`
|
|
155
|
-
}, children);
|
|
106
|
+
const PopoverContent = React.forwardRef(
|
|
107
|
+
(props, forwardedRef) => {
|
|
108
|
+
const { allowPinchZoom, trapFocus, disableRemoveScroll, ...contentModalProps } = props;
|
|
109
|
+
const context = usePopoverInternalContext(CONTENT_NAME, props.__scopePopover);
|
|
110
|
+
const contentRef = React.useRef(null);
|
|
111
|
+
const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);
|
|
112
|
+
const isRightClickOutsideRef = React.useRef(false);
|
|
113
|
+
const themeName = (0, import_core.useThemeName)();
|
|
114
|
+
React.useEffect(() => {
|
|
115
|
+
if (!context.open)
|
|
116
|
+
return;
|
|
117
|
+
const content = contentRef.current;
|
|
118
|
+
if (content)
|
|
119
|
+
return (0, import_aria_hidden.hideOthers)(content);
|
|
120
|
+
}, [context.open]);
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.Portal, {
|
|
122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, {
|
|
123
|
+
name: themeName,
|
|
124
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContentImpl, {
|
|
125
|
+
...contentModalProps,
|
|
126
|
+
disableRemoveScroll,
|
|
127
|
+
ref: composedRefs,
|
|
128
|
+
trapFocus: trapFocus ?? context.open,
|
|
129
|
+
disableOutsidePointerEvents: true,
|
|
130
|
+
onCloseAutoFocus: (0, import_core.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
|
|
131
|
+
var _a;
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
if (!isRightClickOutsideRef.current)
|
|
134
|
+
(_a = context.triggerRef.current) == null ? void 0 : _a.focus();
|
|
135
|
+
}),
|
|
136
|
+
onPointerDownOutside: (0, import_core.composeEventHandlers)(
|
|
137
|
+
props.onPointerDownOutside,
|
|
138
|
+
(event) => {
|
|
139
|
+
const originalEvent = event.detail.originalEvent;
|
|
140
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
141
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
142
|
+
isRightClickOutsideRef.current = isRightClick;
|
|
143
|
+
},
|
|
144
|
+
{ checkDefaultPrevented: false }
|
|
145
|
+
),
|
|
146
|
+
onFocusOutside: (0, import_core.composeEventHandlers)(
|
|
147
|
+
props.onFocusOutside,
|
|
148
|
+
(event) => event.preventDefault(),
|
|
149
|
+
{ checkDefaultPrevented: false }
|
|
150
|
+
)
|
|
151
|
+
})
|
|
152
|
+
})
|
|
153
|
+
});
|
|
156
154
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
155
|
+
);
|
|
156
|
+
const PopoverContentImpl = React.forwardRef(
|
|
157
|
+
(props, forwardedRef) => {
|
|
158
|
+
const {
|
|
159
|
+
__scopePopover,
|
|
160
|
+
trapFocus,
|
|
161
|
+
onOpenAutoFocus,
|
|
162
|
+
onCloseAutoFocus,
|
|
163
|
+
disableOutsidePointerEvents,
|
|
164
|
+
onEscapeKeyDown,
|
|
165
|
+
onPointerDownOutside,
|
|
166
|
+
onFocusOutside,
|
|
167
|
+
onInteractOutside,
|
|
168
|
+
children,
|
|
169
|
+
disableRemoveScroll,
|
|
170
|
+
...contentProps
|
|
171
|
+
} = props;
|
|
172
|
+
const popperScope = usePopoverScope(__scopePopover);
|
|
173
|
+
const context = usePopoverInternalContext(CONTENT_NAME, popperScope.__scopePopover);
|
|
174
|
+
const showSheet = useShowPopoverSheet(context);
|
|
175
|
+
if (showSheet) {
|
|
176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.PortalItem, {
|
|
177
|
+
hostName: `${context.scopeKey}SheetContents`,
|
|
178
|
+
children
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
|
|
182
|
+
children: !!context.open && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperContent, {
|
|
183
|
+
"data-state": getState(context.open),
|
|
184
|
+
id: context.contentId,
|
|
185
|
+
pointerEvents: "auto",
|
|
186
|
+
...popperScope,
|
|
187
|
+
...contentProps,
|
|
188
|
+
ref: forwardedRef,
|
|
189
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_remove_scroll.RemoveScroll, {
|
|
190
|
+
enabled: disableRemoveScroll ? false : context.open,
|
|
191
|
+
allowPinchZoom: true,
|
|
192
|
+
removeScrollBar: false,
|
|
193
|
+
children: trapFocus === false ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_focus_scope.FocusScope, {
|
|
194
|
+
loop: true,
|
|
195
|
+
trapped: trapFocus ?? context.open,
|
|
196
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
197
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
199
|
+
style: { display: "contents" },
|
|
200
|
+
children
|
|
201
|
+
})
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
}, "popper-content")
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
);
|
|
178
208
|
const CLOSE_NAME = "PopoverClose";
|
|
179
|
-
const PopoverClose = React.forwardRef(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
});
|
|
209
|
+
const PopoverClose = React.forwardRef(
|
|
210
|
+
(props, forwardedRef) => {
|
|
211
|
+
const { __scopePopover, ...closeProps } = props;
|
|
212
|
+
const context = usePopoverInternalContext(CLOSE_NAME, __scopePopover);
|
|
213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {
|
|
214
|
+
...closeProps,
|
|
215
|
+
ref: forwardedRef,
|
|
216
|
+
onPress: (0, import_core.composeEventHandlers)(props.onPress, () => context.onOpenChange(false))
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
);
|
|
188
220
|
PopoverClose.displayName = CLOSE_NAME;
|
|
189
221
|
const ARROW_NAME = "PopoverArrow";
|
|
190
|
-
const PopoverArrow = React.forwardRef(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
});
|
|
222
|
+
const PopoverArrow = React.forwardRef(
|
|
223
|
+
(props, forwardedRef) => {
|
|
224
|
+
const { __scopePopover, ...arrowProps } = props;
|
|
225
|
+
const popperScope = usePopoverScope(__scopePopover);
|
|
226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperArrow, {
|
|
227
|
+
...popperScope,
|
|
228
|
+
...arrowProps,
|
|
229
|
+
ref: forwardedRef
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
);
|
|
199
233
|
PopoverArrow.displayName = ARROW_NAME;
|
|
200
234
|
const SHEET_CONTENTS_NAME = "PopoverSheetContents";
|
|
201
235
|
const PopoverSheetContents = ({ __scopePopover }) => {
|
|
202
236
|
const context = usePopoverInternalContext(SHEET_CONTENTS_NAME, __scopePopover);
|
|
203
|
-
return /* @__PURE__ */
|
|
237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.PortalHost, {
|
|
204
238
|
name: `${context.scopeKey}SheetContents`
|
|
205
239
|
});
|
|
206
240
|
};
|
|
207
241
|
PopoverSheetContents.displayName = SHEET_CONTENTS_NAME;
|
|
208
|
-
const Popover = (0, import_core.withStaticProperties)(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
const breakpointActive = useSheetBreakpointActive(sheetBreakpoint);
|
|
227
|
-
const useFloatingContext = React.useCallback((props2) => {
|
|
228
|
-
const floating = (0, import_floating.useFloating)({
|
|
229
|
-
...props2,
|
|
230
|
-
open,
|
|
231
|
-
onOpenChange: setOpen
|
|
242
|
+
const Popover = (0, import_core.withStaticProperties)(
|
|
243
|
+
(props) => {
|
|
244
|
+
const {
|
|
245
|
+
__scopePopover,
|
|
246
|
+
children,
|
|
247
|
+
open: openProp,
|
|
248
|
+
defaultOpen,
|
|
249
|
+
onOpenChange,
|
|
250
|
+
sheetBreakpoint = false,
|
|
251
|
+
...restProps
|
|
252
|
+
} = props;
|
|
253
|
+
const popperScope = usePopoverScope(__scopePopover);
|
|
254
|
+
const triggerRef = React.useRef(null);
|
|
255
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
256
|
+
const [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
257
|
+
prop: openProp,
|
|
258
|
+
defaultProp: defaultOpen || false,
|
|
259
|
+
onChange: onOpenChange
|
|
232
260
|
});
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
261
|
+
const breakpointActive = useSheetBreakpointActive(sheetBreakpoint);
|
|
262
|
+
const useFloatingContext = React.useCallback(
|
|
263
|
+
(props2) => {
|
|
264
|
+
const floating = (0, import_floating.useFloating)({
|
|
265
|
+
...props2,
|
|
266
|
+
open,
|
|
267
|
+
onOpenChange: setOpen
|
|
268
|
+
});
|
|
269
|
+
const { getReferenceProps, getFloatingProps } = (0, import_floating.useInteractions)([
|
|
270
|
+
(0, import_floating.useFocus)(floating.context, {
|
|
271
|
+
enabled: !breakpointActive
|
|
272
|
+
}),
|
|
273
|
+
(0, import_floating.useRole)(floating.context, { role: "dialog" }),
|
|
274
|
+
(0, import_floating.useDismiss)(floating.context, {
|
|
275
|
+
enabled: !breakpointActive
|
|
276
|
+
})
|
|
277
|
+
]);
|
|
278
|
+
return {
|
|
279
|
+
...floating,
|
|
280
|
+
getReferenceProps,
|
|
281
|
+
getFloatingProps
|
|
282
|
+
};
|
|
283
|
+
},
|
|
284
|
+
[breakpointActive, open, setOpen]
|
|
285
|
+
);
|
|
286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.FloatingOverrideContext.Provider, {
|
|
287
|
+
value: useFloatingContext,
|
|
288
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.Popper, {
|
|
289
|
+
...popperScope,
|
|
290
|
+
...restProps,
|
|
291
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverProviderInternal, {
|
|
292
|
+
scope: __scopePopover,
|
|
293
|
+
scopeKey: __scopePopover ? Object.keys(__scopePopover)[0] : "",
|
|
294
|
+
sheetBreakpoint,
|
|
295
|
+
contentId: (0, import_core.useId)(),
|
|
296
|
+
triggerRef,
|
|
297
|
+
open,
|
|
298
|
+
onOpenChange: setOpen,
|
|
299
|
+
onOpenToggle: (0, import_core.useEvent)(() => {
|
|
300
|
+
if (open && breakpointActive) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
setOpen(!open);
|
|
304
|
+
}),
|
|
305
|
+
hasCustomAnchor,
|
|
306
|
+
onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
|
|
307
|
+
onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),
|
|
308
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverSheetController, {
|
|
309
|
+
onChangeOpen: setOpen,
|
|
310
|
+
__scopePopover,
|
|
311
|
+
children
|
|
312
|
+
})
|
|
313
|
+
})
|
|
240
314
|
})
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}, /* @__PURE__ */ React.createElement(PopoverProviderInternal, {
|
|
254
|
-
scope: __scopePopover,
|
|
255
|
-
scopeKey: __scopePopover ? Object.keys(__scopePopover)[0] : "",
|
|
256
|
-
sheetBreakpoint,
|
|
257
|
-
contentId: (0, import_core.useId)(),
|
|
258
|
-
triggerRef,
|
|
259
|
-
open,
|
|
260
|
-
onOpenChange: setOpen,
|
|
261
|
-
onOpenToggle: (0, import_core.useEvent)(() => {
|
|
262
|
-
if (open && breakpointActive) {
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
setOpen(!open);
|
|
266
|
-
}),
|
|
267
|
-
hasCustomAnchor,
|
|
268
|
-
onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
|
|
269
|
-
onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), [])
|
|
270
|
-
}, /* @__PURE__ */ React.createElement(PopoverSheetController, {
|
|
271
|
-
onChangeOpen: setOpen,
|
|
272
|
-
__scopePopover
|
|
273
|
-
}, children))));
|
|
274
|
-
}, {
|
|
275
|
-
Anchor: PopoverAnchor,
|
|
276
|
-
Arrow: PopoverArrow,
|
|
277
|
-
Trigger: PopoverTrigger,
|
|
278
|
-
Content: PopoverContent,
|
|
279
|
-
Close: PopoverClose,
|
|
280
|
-
SheetContents: PopoverSheetContents,
|
|
281
|
-
Sheet: import_sheet.Sheet
|
|
282
|
-
});
|
|
315
|
+
});
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
Anchor: PopoverAnchor,
|
|
319
|
+
Arrow: PopoverArrow,
|
|
320
|
+
Trigger: PopoverTrigger,
|
|
321
|
+
Content: PopoverContent,
|
|
322
|
+
Close: PopoverClose,
|
|
323
|
+
SheetContents: PopoverSheetContents,
|
|
324
|
+
Sheet: import_sheet.Sheet
|
|
325
|
+
}
|
|
326
|
+
);
|
|
283
327
|
Popover.displayName = POPOVER_NAME;
|
|
284
328
|
function getState(open) {
|
|
285
329
|
return open ? "open" : "closed";
|
|
@@ -289,15 +333,16 @@ const PopoverSheetController = (props) => {
|
|
|
289
333
|
const showSheet = useShowPopoverSheet(context);
|
|
290
334
|
const breakpointActive = useSheetBreakpointActive(context.sheetBreakpoint);
|
|
291
335
|
const getShowSheet = (0, import_core.useGet)(showSheet);
|
|
292
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sheet.SheetController, {
|
|
293
337
|
onChangeOpen: (val) => {
|
|
294
338
|
if (getShowSheet()) {
|
|
295
339
|
props.onChangeOpen(val);
|
|
296
340
|
}
|
|
297
341
|
},
|
|
298
342
|
open: context.open,
|
|
299
|
-
hidden: breakpointActive === false
|
|
300
|
-
|
|
343
|
+
hidden: breakpointActive === false,
|
|
344
|
+
children: props.children
|
|
345
|
+
});
|
|
301
346
|
};
|
|
302
347
|
const useSheetBreakpointActive = (breakpoint) => {
|
|
303
348
|
const media = (0, import_core.useMedia)();
|
package/dist/cjs/Popover.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Popover.tsx"],
|
|
4
4
|
"sourcesContent": ["// adapted from radix-ui popover\n\nimport '@tamagui/polyfill-dev'\n\nimport { AnimatePresence } from '@tamagui/animate-presence'\nimport { hideOthers } from '@tamagui/aria-hidden'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport {\n MediaQueryKey,\n SizeTokens,\n Theme,\n composeEventHandlers,\n isWeb,\n useEvent,\n useGet,\n useId,\n useIsSSR,\n useMedia,\n useThemeName,\n withStaticProperties,\n} from '@tamagui/core'\nimport type { Scope } from '@tamagui/create-context'\nimport { createContextScope } from '@tamagui/create-context'\nimport { DismissableProps } from '@tamagui/dismissable'\nimport { FocusScope, FocusScopeProps } from '@tamagui/focus-scope'\nimport {\n FloatingOverrideContext,\n Popper,\n PopperAnchor,\n PopperArrow,\n PopperArrowProps,\n PopperContent,\n PopperContentProps,\n PopperProps,\n createPopperScope,\n} from '@tamagui/popper'\nimport { Portal, PortalHost, PortalItem } from '@tamagui/portal'\nimport { RemoveScroll, RemoveScrollProps } from '@tamagui/remove-scroll'\nimport { Sheet, SheetController } from '@tamagui/sheet'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\nimport { View } from 'react-native'\n\nimport type { UseFloatingProps } from './floating'\nimport { useDismiss, useFloating, useFocus, useInteractions, useRole } from './floating'\n\nconst POPOVER_NAME = 'Popover'\n\ntype ScopedProps<P> = P & { __scopePopover?: Scope }\ntype NonNull<A> = Exclude<A, void | null>\n\nexport type PopoverProps = PopperProps & {\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n sheetBreakpoint?: MediaQueryKey | false\n}\n\ntype PopoverContextValue = {\n triggerRef: React.RefObject<HTMLButtonElement>\n contentId?: string\n open: boolean\n onOpenChange(open: boolean): void\n onOpenToggle(): void\n hasCustomAnchor: boolean\n onCustomAnchorAdd(): void\n onCustomAnchorRemove(): void\n size?: SizeTokens\n sheetBreakpoint: NonNull<PopoverProps['sheetBreakpoint']>\n scopeKey: string\n}\n\nconst [createPopoverContext, createPopoverScopeInternal] = createContextScope(POPOVER_NAME, [\n createPopperScope,\n])\nexport const usePopoverScope = createPopperScope()\nexport const createPopoverScope = createPopoverScopeInternal\n\nconst [PopoverProviderInternal, usePopoverInternalContext] =\n createPopoverContext<PopoverContextValue>(POPOVER_NAME)\n\nexport const __PopoverProviderInternal = PopoverProviderInternal\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopoverAnchor'\n\ntype PopoverAnchorElement = HTMLElement | View\nexport type PopoverAnchorProps = YStackProps\n\nexport const PopoverAnchor = React.forwardRef<PopoverAnchorElement, PopoverAnchorProps>(\n (props: ScopedProps<PopoverAnchorProps>, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props\n const context = usePopoverInternalContext(ANCHOR_NAME, __scopePopover)\n const popperScope = usePopoverScope(__scopePopover)\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context\n\n React.useEffect(() => {\n onCustomAnchorAdd()\n return () => onCustomAnchorRemove()\n }, [onCustomAnchorAdd, onCustomAnchorRemove])\n\n return <PopperAnchor {...popperScope} {...anchorProps} ref={forwardedRef} />\n }\n)\n\nPopoverAnchor.displayName = ANCHOR_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'PopoverTrigger'\n\ntype PopoverTriggerElement = HTMLElement | View\nexport type PopoverTriggerProps = YStackProps\n\nexport const PopoverTrigger = React.forwardRef<PopoverTriggerElement, PopoverTriggerProps>(\n (props: ScopedProps<PopoverTriggerProps>, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props\n const context = usePopoverInternalContext(TRIGGER_NAME, __scopePopover)\n const popperScope = usePopoverScope(__scopePopover)\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef)\n\n const trigger = (\n <YStack\n aria-haspopup=\"dialog\"\n aria-expanded={context.open}\n // TODO not matching\n // aria-controls={context.contentId}\n data-state={getState(context.open)}\n {...triggerProps}\n ref={composedTriggerRef}\n onPress={composeEventHandlers(props.onPress, context.onOpenToggle)}\n />\n )\n\n return context.hasCustomAnchor ? (\n trigger\n ) : (\n <PopperAnchor asChild {...popperScope}>\n {trigger}\n </PopperAnchor>\n )\n }\n)\n\nPopoverTrigger.displayName = TRIGGER_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopoverContent'\n\nexport type PopoverContentProps = PopoverContentTypeProps\n\ntype PopoverContentTypeElement = PopoverContentImplElement\n\nexport interface PopoverContentTypeProps\n extends Omit<PopoverContentImplProps, 'disableOutsidePointerEvents'> {\n /**\n * @see https://github.com/theKashey/react-remove-scroll#usage\n */\n allowPinchZoom?: RemoveScrollProps['allowPinchZoom']\n}\n\nexport const PopoverContent = React.forwardRef<PopoverContentTypeElement, PopoverContentTypeProps>(\n (props: ScopedProps<PopoverContentTypeProps>, forwardedRef) => {\n const { allowPinchZoom, trapFocus, disableRemoveScroll, ...contentModalProps } = props\n const context = usePopoverInternalContext(CONTENT_NAME, props.__scopePopover)\n const contentRef = React.useRef<HTMLDivElement>(null)\n const composedRefs = useComposedRefs(forwardedRef, contentRef)\n const isRightClickOutsideRef = React.useRef(false)\n const themeName = useThemeName()\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n if (!context.open) return\n const content = contentRef.current\n if (content) return hideOthers(content)\n }, [context.open])\n\n return (\n <Portal>\n <Theme name={themeName}>\n <PopoverContentImpl\n {...contentModalProps}\n disableRemoveScroll={disableRemoveScroll}\n ref={composedRefs}\n // we make sure we're not trapping once it's been closed\n // (closed !== unmounted when animating out)\n trapFocus={trapFocus ?? context.open}\n disableOutsidePointerEvents\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault()\n if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus()\n })}\n onPointerDownOutside={composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const originalEvent = event.detail.originalEvent\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick\n isRightClickOutsideRef.current = isRightClick\n },\n { checkDefaultPrevented: false }\n )}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkDefaultPrevented: false }\n )}\n />\n </Theme>\n </Portal>\n )\n }\n)\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PopoverContentImplElement = React.ElementRef<typeof PopperContent>\n\nexport interface PopoverContentImplProps\n extends PopperContentProps,\n Omit<DismissableProps, 'onDismiss' | 'children'> {\n /**\n * Whether focus should be trapped within the `Popover`\n * (default: false)\n */\n trapFocus?: FocusScopeProps['trapped']\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']\n\n disableRemoveScroll?: boolean\n}\n\nconst PopoverContentImpl = React.forwardRef<PopoverContentImplElement, PopoverContentImplProps>(\n (props: ScopedProps<PopoverContentImplProps>, forwardedRef) => {\n const {\n __scopePopover,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n children,\n disableRemoveScroll,\n ...contentProps\n } = props\n const popperScope = usePopoverScope(__scopePopover)\n const context = usePopoverInternalContext(CONTENT_NAME, popperScope.__scopePopover)\n const showSheet = useShowPopoverSheet(context)\n // const popperContext = usePopperContext(CONTENT_NAME, popperScope.__scopePopper)\n\n if (showSheet) {\n // doesn't show as popover yet on native, must use as sheet\n return <PortalItem hostName={`${context.scopeKey}SheetContents`}>{children}</PortalItem>\n }\n\n // const handleDismiss = React.useCallback(() => context.onOpenChange(false), [])\n // <Dismissable\n // disableOutsidePointerEvents={disableOutsidePointerEvents}\n // // onInteractOutside={onInteractOutside}\n // onEscapeKeyDown={onEscapeKeyDown}\n // // onPointerDownOutside={onPointerDownOutside}\n // // onFocusOutside={onFocusOutside}\n // onDismiss={handleDismiss}\n // >\n\n return (\n <AnimatePresence>\n {!!context.open && (\n <PopperContent\n key=\"popper-content\"\n data-state={getState(context.open)}\n id={context.contentId}\n pointerEvents=\"auto\"\n {...popperScope}\n {...contentProps}\n ref={forwardedRef}\n >\n <RemoveScroll\n enabled={disableRemoveScroll ? false : context.open}\n allowPinchZoom\n // causes lots of bugs on touch web on site\n removeScrollBar={false}\n >\n {trapFocus === false ? (\n children\n ) : (\n <FocusScope\n loop\n trapped={trapFocus ?? context.open}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <div style={{ display: 'contents' }}>{children}</div>\n </FocusScope>\n )}\n </RemoveScroll>\n </PopperContent>\n )}\n </AnimatePresence>\n )\n }\n)\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'PopoverClose'\n\ntype PopoverCloseElement = HTMLElement | View\nexport type PopoverCloseProps = YStackProps\n\nexport const PopoverClose = React.forwardRef<PopoverCloseElement, PopoverCloseProps>(\n (props: ScopedProps<PopoverCloseProps>, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props\n const context = usePopoverInternalContext(CLOSE_NAME, __scopePopover)\n return (\n <YStack\n {...closeProps}\n ref={forwardedRef}\n onPress={composeEventHandlers(props.onPress, () => context.onOpenChange(false))}\n />\n )\n }\n)\n\nPopoverClose.displayName = CLOSE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'PopoverArrow'\n\ntype PopoverArrowElement = HTMLElement | View\nexport type PopoverArrowProps = PopperArrowProps\n\nexport const PopoverArrow = React.forwardRef<PopoverArrowElement, PopoverArrowProps>(\n (props: ScopedProps<PopoverArrowProps>, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props\n const popperScope = usePopoverScope(__scopePopover)\n return <PopperArrow {...popperScope} {...arrowProps} ref={forwardedRef} />\n }\n)\n\nPopoverArrow.displayName = ARROW_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverSheetContents\n * -----------------------------------------------------------------------------------------------*/\n\nconst SHEET_CONTENTS_NAME = 'PopoverSheetContents'\n\nexport const PopoverSheetContents = ({ __scopePopover }: ScopedProps<{}>) => {\n const context = usePopoverInternalContext(SHEET_CONTENTS_NAME, __scopePopover)\n return <PortalHost name={`${context.scopeKey}SheetContents`}></PortalHost>\n}\n\nPopoverSheetContents.displayName = SHEET_CONTENTS_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * Popover\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Popover = withStaticProperties(\n ((props: ScopedProps<PopoverProps>) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n sheetBreakpoint = false,\n ...restProps\n } = props\n const popperScope = usePopoverScope(__scopePopover)\n const triggerRef = React.useRef<HTMLButtonElement>(null)\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false)\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen || false,\n onChange: onOpenChange,\n })\n\n const breakpointActive = useSheetBreakpointActive(sheetBreakpoint)\n\n const useFloatingContext = React.useCallback(\n (props: UseFloatingProps) => {\n const floating = useFloating({\n ...props,\n open,\n onOpenChange: setOpen,\n })\n const { getReferenceProps, getFloatingProps } = useInteractions([\n useFocus(floating.context, {\n enabled: !breakpointActive,\n }),\n useRole(floating.context, { role: 'dialog' }),\n useDismiss(floating.context, {\n enabled: !breakpointActive,\n }),\n ])\n return {\n ...floating,\n getReferenceProps,\n getFloatingProps,\n }\n },\n [breakpointActive, open, setOpen]\n )\n\n return (\n <FloatingOverrideContext.Provider value={useFloatingContext as any}>\n <Popper {...popperScope} {...restProps}>\n <PopoverProviderInternal\n scope={__scopePopover}\n scopeKey={__scopePopover ? Object.keys(__scopePopover)[0] : ''}\n sheetBreakpoint={sheetBreakpoint}\n contentId={useId()}\n triggerRef={triggerRef}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={useEvent(() => {\n if (open && breakpointActive) {\n return\n }\n setOpen(!open)\n })}\n hasCustomAnchor={hasCustomAnchor}\n onCustomAnchorAdd={React.useCallback(() => setHasCustomAnchor(true), [])}\n onCustomAnchorRemove={React.useCallback(() => setHasCustomAnchor(false), [])}\n >\n <PopoverSheetController onChangeOpen={setOpen} __scopePopover={__scopePopover}>\n {children}\n </PopoverSheetController>\n </PopoverProviderInternal>\n </Popper>\n </FloatingOverrideContext.Provider>\n )\n }) as React.FC<PopoverProps>,\n {\n Anchor: PopoverAnchor,\n Arrow: PopoverArrow,\n Trigger: PopoverTrigger,\n Content: PopoverContent,\n Close: PopoverClose,\n SheetContents: PopoverSheetContents,\n Sheet,\n }\n)\n\nPopover.displayName = POPOVER_NAME\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed'\n}\n\nconst PopoverSheetController = (\n props: ScopedProps<{\n children: React.ReactNode\n onChangeOpen: React.Dispatch<React.SetStateAction<boolean>>\n }>\n) => {\n const context = usePopoverInternalContext('PopoverSheetController', props.__scopePopover)\n const showSheet = useShowPopoverSheet(context)\n const breakpointActive = useSheetBreakpointActive(context.sheetBreakpoint)\n const getShowSheet = useGet(showSheet)\n return (\n <SheetController\n onChangeOpen={(val) => {\n if (getShowSheet()) {\n props.onChangeOpen(val)\n }\n }}\n open={context.open}\n hidden={breakpointActive === false}\n >\n {props.children}\n </SheetController>\n )\n}\n\nconst useSheetBreakpointActive = (breakpoint?: MediaQueryKey | false) => {\n const media = useMedia()\n return breakpoint ? media[breakpoint] : false\n}\n\nconst useShowPopoverSheet = (context: PopoverContextValue) => {\n // for now always show as sheet on native\n if (!isWeb) return true\n const breakpointActive = useSheetBreakpointActive(context.sheetBreakpoint)\n return context.open === false ? false : breakpointActive\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyGW;AAvGX,0BAAO;AAEP,8BAAgC;AAChC,yBAA2B;AAC3B,0BAAgC;AAChC,kBAaO;AAEP,4BAAmC;AAEnC,yBAA4C;AAC5C,oBAUO;AACP,oBAA+C;AAC/C,2BAAgD;AAChD,mBAAuC;AACvC,oBAAoC;AACpC,oCAAqC;AACrC,YAAuB;AAIvB,sBAA4E;AAE5E,MAAM,eAAe;AA0BrB,MAAM,CAAC,sBAAsB,0BAA0B,QAAI,0CAAmB,cAAc;AAAA,EAC1F;AACF,CAAC;AACM,MAAM,sBAAkB,iCAAkB;AAC1C,MAAM,qBAAqB;AAElC,MAAM,CAAC,yBAAyB,yBAAyB,IACvD,qBAA0C,YAAY;AAEjD,MAAM,4BAA4B;AAMzC,MAAM,cAAc;AAKb,MAAM,gBAAgB,MAAM;AAAA,EACjC,CAAC,OAAwC,iBAAiB;AACxD,UAAM,EAAE,mBAAmB,YAAY,IAAI;AAC3C,UAAM,UAAU,0BAA0B,aAAa,cAAc;AACrE,UAAM,cAAc,gBAAgB,cAAc;AAClD,UAAM,EAAE,mBAAmB,qBAAqB,IAAI;AAEpD,UAAM,UAAU,MAAM;AACpB,wBAAkB;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