@radix-ui/react-popover 1.1.0-rc.1 → 1.1.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,331 +1,350 @@
1
1
  "use strict";
2
- (() => {
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
- }) : x)(function(x) {
12
- if (typeof require !== "undefined") return require.apply(this, arguments);
13
- throw Error('Dynamic require of "' + x + '" is not supported');
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // packages/react/popover/src/index.ts
32
+ var src_exports = {};
33
+ __export(src_exports, {
34
+ Anchor: () => Anchor2,
35
+ Arrow: () => Arrow2,
36
+ Close: () => Close,
37
+ Content: () => Content2,
38
+ Popover: () => Popover,
39
+ PopoverAnchor: () => PopoverAnchor,
40
+ PopoverArrow: () => PopoverArrow,
41
+ PopoverClose: () => PopoverClose,
42
+ PopoverContent: () => PopoverContent,
43
+ PopoverPortal: () => PopoverPortal,
44
+ PopoverTrigger: () => PopoverTrigger,
45
+ Portal: () => Portal,
46
+ Root: () => Root2,
47
+ Trigger: () => Trigger,
48
+ createPopoverScope: () => createPopoverScope
49
+ });
50
+ module.exports = __toCommonJS(src_exports);
51
+
52
+ // packages/react/popover/src/Popover.tsx
53
+ var React = __toESM(require("react"));
54
+ var import_primitive = require("@radix-ui/primitive");
55
+ var import_react_compose_refs = require("@radix-ui/react-compose-refs");
56
+ var import_react_context = require("@radix-ui/react-context");
57
+ var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer");
58
+ var import_react_focus_guards = require("@radix-ui/react-focus-guards");
59
+ var import_react_focus_scope = require("@radix-ui/react-focus-scope");
60
+ var import_react_id = require("@radix-ui/react-id");
61
+ var PopperPrimitive = __toESM(require("@radix-ui/react-popper"));
62
+ var import_react_popper = require("@radix-ui/react-popper");
63
+ var import_react_portal = require("@radix-ui/react-portal");
64
+ var import_react_presence = require("@radix-ui/react-presence");
65
+ var import_react_primitive = require("@radix-ui/react-primitive");
66
+ var import_react_slot = require("@radix-ui/react-slot");
67
+ var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
68
+ var import_aria_hidden = require("aria-hidden");
69
+ var import_react_remove_scroll = require("react-remove-scroll");
70
+ var import_jsx_runtime = require("react/jsx-runtime");
71
+ var POPOVER_NAME = "Popover";
72
+ var [createPopoverContext, createPopoverScope] = (0, import_react_context.createContextScope)(POPOVER_NAME, [
73
+ import_react_popper.createPopperScope
74
+ ]);
75
+ var usePopperScope = (0, import_react_popper.createPopperScope)();
76
+ var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
77
+ var Popover = (props) => {
78
+ const {
79
+ __scopePopover,
80
+ children,
81
+ open: openProp,
82
+ defaultOpen,
83
+ onOpenChange,
84
+ modal = false
85
+ } = props;
86
+ const popperScope = usePopperScope(__scopePopover);
87
+ const triggerRef = React.useRef(null);
88
+ const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
89
+ const [open = false, setOpen] = (0, import_react_use_controllable_state.useControllableState)({
90
+ prop: openProp,
91
+ defaultProp: defaultOpen,
92
+ onChange: onOpenChange
14
93
  });
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
94
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
+ PopoverProvider,
96
+ {
97
+ scope: __scopePopover,
98
+ contentId: (0, import_react_id.useId)(),
99
+ triggerRef,
100
+ open,
101
+ onOpenChange: setOpen,
102
+ onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
103
+ hasCustomAnchor,
104
+ onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
105
+ onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),
106
+ modal,
107
+ children
20
108
  }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
31
-
32
- // packages/react/popover/src/Popover.tsx
33
- var React = __toESM(__require("react"));
34
- var import_primitive = __require("@radix-ui/primitive");
35
- var import_react_compose_refs = __require("@radix-ui/react-compose-refs");
36
- var import_react_context = __require("@radix-ui/react-context");
37
- var import_react_dismissable_layer = __require("@radix-ui/react-dismissable-layer");
38
- var import_react_focus_guards = __require("@radix-ui/react-focus-guards");
39
- var import_react_focus_scope = __require("@radix-ui/react-focus-scope");
40
- var import_react_id = __require("@radix-ui/react-id");
41
- var PopperPrimitive = __toESM(__require("@radix-ui/react-popper"));
42
- var import_react_popper = __require("@radix-ui/react-popper");
43
- var import_react_portal = __require("@radix-ui/react-portal");
44
- var import_react_presence = __require("@radix-ui/react-presence");
45
- var import_react_primitive = __require("@radix-ui/react-primitive");
46
- var import_react_slot = __require("@radix-ui/react-slot");
47
- var import_react_use_controllable_state = __require("@radix-ui/react-use-controllable-state");
48
- var import_aria_hidden = __require("aria-hidden");
49
- var import_react_remove_scroll = __require("react-remove-scroll");
50
- var import_jsx_runtime = __require("react/jsx-runtime");
51
- var POPOVER_NAME = "Popover";
52
- var [createPopoverContext, createPopoverScope] = (0, import_react_context.createContextScope)(POPOVER_NAME, [
53
- import_react_popper.createPopperScope
54
- ]);
55
- var usePopperScope = (0, import_react_popper.createPopperScope)();
56
- var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
57
- var Popover = (props) => {
58
- const {
59
- __scopePopover,
60
- children,
61
- open: openProp,
62
- defaultOpen,
63
- onOpenChange,
64
- modal = false
65
- } = props;
109
+ ) });
110
+ };
111
+ Popover.displayName = POPOVER_NAME;
112
+ var ANCHOR_NAME = "PopoverAnchor";
113
+ var PopoverAnchor = React.forwardRef(
114
+ (props, forwardedRef) => {
115
+ const { __scopePopover, ...anchorProps } = props;
116
+ const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
66
117
  const popperScope = usePopperScope(__scopePopover);
67
- const triggerRef = React.useRef(null);
68
- const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
69
- const [open = false, setOpen] = (0, import_react_use_controllable_state.useControllableState)({
70
- prop: openProp,
71
- defaultProp: defaultOpen,
72
- onChange: onOpenChange
73
- });
74
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
- PopoverProvider,
118
+ const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
119
+ React.useEffect(() => {
120
+ onCustomAnchorAdd();
121
+ return () => onCustomAnchorRemove();
122
+ }, [onCustomAnchorAdd, onCustomAnchorRemove]);
123
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
124
+ }
125
+ );
126
+ PopoverAnchor.displayName = ANCHOR_NAME;
127
+ var TRIGGER_NAME = "PopoverTrigger";
128
+ var PopoverTrigger = React.forwardRef(
129
+ (props, forwardedRef) => {
130
+ const { __scopePopover, ...triggerProps } = props;
131
+ const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
132
+ const popperScope = usePopperScope(__scopePopover);
133
+ const composedTriggerRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
134
+ const trigger = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
135
+ import_react_primitive.Primitive.button,
136
+ {
137
+ type: "button",
138
+ "aria-haspopup": "dialog",
139
+ "aria-expanded": context.open,
140
+ "aria-controls": context.contentId,
141
+ "data-state": getState(context.open),
142
+ ...triggerProps,
143
+ ref: composedTriggerRef,
144
+ onClick: (0, import_primitive.composeEventHandlers)(props.onClick, context.onOpenToggle)
145
+ }
146
+ );
147
+ return context.hasCustomAnchor ? trigger : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger });
148
+ }
149
+ );
150
+ PopoverTrigger.displayName = TRIGGER_NAME;
151
+ var PORTAL_NAME = "PopoverPortal";
152
+ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
153
+ forceMount: void 0
154
+ });
155
+ var PopoverPortal = (props) => {
156
+ const { __scopePopover, forceMount, children, container } = props;
157
+ const context = usePopoverContext(PORTAL_NAME, __scopePopover);
158
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, container, children }) }) });
159
+ };
160
+ PopoverPortal.displayName = PORTAL_NAME;
161
+ var CONTENT_NAME = "PopoverContent";
162
+ var PopoverContent = React.forwardRef(
163
+ (props, forwardedRef) => {
164
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);
165
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
166
+ const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
167
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
168
+ }
169
+ );
170
+ PopoverContent.displayName = CONTENT_NAME;
171
+ var PopoverContentModal = React.forwardRef(
172
+ (props, forwardedRef) => {
173
+ const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
174
+ const contentRef = React.useRef(null);
175
+ const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, contentRef);
176
+ const isRightClickOutsideRef = React.useRef(false);
177
+ React.useEffect(() => {
178
+ const content = contentRef.current;
179
+ if (content) return (0, import_aria_hidden.hideOthers)(content);
180
+ }, []);
181
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_remove_scroll.RemoveScroll, { as: import_react_slot.Slot, allowPinchZoom: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
182
+ PopoverContentImpl,
76
183
  {
77
- scope: __scopePopover,
78
- contentId: (0, import_react_id.useId)(),
79
- triggerRef,
80
- open,
81
- onOpenChange: setOpen,
82
- onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
83
- hasCustomAnchor,
84
- onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
85
- onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),
86
- modal,
87
- children
184
+ ...props,
185
+ ref: composedRefs,
186
+ trapFocus: context.open,
187
+ disableOutsidePointerEvents: true,
188
+ onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
189
+ event.preventDefault();
190
+ if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
191
+ }),
192
+ onPointerDownOutside: (0, import_primitive.composeEventHandlers)(
193
+ props.onPointerDownOutside,
194
+ (event) => {
195
+ const originalEvent = event.detail.originalEvent;
196
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
197
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
198
+ isRightClickOutsideRef.current = isRightClick;
199
+ },
200
+ { checkForDefaultPrevented: false }
201
+ ),
202
+ onFocusOutside: (0, import_primitive.composeEventHandlers)(
203
+ props.onFocusOutside,
204
+ (event) => event.preventDefault(),
205
+ { checkForDefaultPrevented: false }
206
+ )
88
207
  }
89
208
  ) });
90
- };
91
- Popover.displayName = POPOVER_NAME;
92
- var ANCHOR_NAME = "PopoverAnchor";
93
- var PopoverAnchor = React.forwardRef(
94
- (props, forwardedRef) => {
95
- const { __scopePopover, ...anchorProps } = props;
96
- const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
97
- const popperScope = usePopperScope(__scopePopover);
98
- const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
99
- React.useEffect(() => {
100
- onCustomAnchorAdd();
101
- return () => onCustomAnchorRemove();
102
- }, [onCustomAnchorAdd, onCustomAnchorRemove]);
103
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
104
- }
105
- );
106
- PopoverAnchor.displayName = ANCHOR_NAME;
107
- var TRIGGER_NAME = "PopoverTrigger";
108
- var PopoverTrigger = React.forwardRef(
109
- (props, forwardedRef) => {
110
- const { __scopePopover, ...triggerProps } = props;
111
- const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
112
- const popperScope = usePopperScope(__scopePopover);
113
- const composedTriggerRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
114
- const trigger = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
115
- import_react_primitive.Primitive.button,
116
- {
117
- type: "button",
118
- "aria-haspopup": "dialog",
119
- "aria-expanded": context.open,
120
- "aria-controls": context.contentId,
121
- "data-state": getState(context.open),
122
- ...triggerProps,
123
- ref: composedTriggerRef,
124
- onClick: (0, import_primitive.composeEventHandlers)(props.onClick, context.onOpenToggle)
125
- }
126
- );
127
- return context.hasCustomAnchor ? trigger : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger });
128
- }
129
- );
130
- PopoverTrigger.displayName = TRIGGER_NAME;
131
- var PORTAL_NAME = "PopoverPortal";
132
- var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
133
- forceMount: void 0
134
- });
135
- var PopoverPortal = (props) => {
136
- const { __scopePopover, forceMount, children, container } = props;
137
- const context = usePopoverContext(PORTAL_NAME, __scopePopover);
138
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, container, children }) }) });
139
- };
140
- PopoverPortal.displayName = PORTAL_NAME;
141
- var CONTENT_NAME = "PopoverContent";
142
- var PopoverContent = React.forwardRef(
143
- (props, forwardedRef) => {
144
- const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);
145
- const { forceMount = portalContext.forceMount, ...contentProps } = props;
146
- const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
147
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
148
- }
149
- );
150
- PopoverContent.displayName = CONTENT_NAME;
151
- var PopoverContentModal = React.forwardRef(
152
- (props, forwardedRef) => {
153
- const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
154
- const contentRef = React.useRef(null);
155
- const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, contentRef);
156
- const isRightClickOutsideRef = React.useRef(false);
157
- React.useEffect(() => {
158
- const content = contentRef.current;
159
- if (content) return (0, import_aria_hidden.hideOthers)(content);
160
- }, []);
161
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_remove_scroll.RemoveScroll, { as: import_react_slot.Slot, allowPinchZoom: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
162
- PopoverContentImpl,
163
- {
164
- ...props,
165
- ref: composedRefs,
166
- trapFocus: context.open,
167
- disableOutsidePointerEvents: true,
168
- onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
209
+ }
210
+ );
211
+ var PopoverContentNonModal = React.forwardRef(
212
+ (props, forwardedRef) => {
213
+ const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
214
+ const hasInteractedOutsideRef = React.useRef(false);
215
+ const hasPointerDownOutsideRef = React.useRef(false);
216
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
217
+ PopoverContentImpl,
218
+ {
219
+ ...props,
220
+ ref: forwardedRef,
221
+ trapFocus: false,
222
+ disableOutsidePointerEvents: false,
223
+ onCloseAutoFocus: (event) => {
224
+ props.onCloseAutoFocus?.(event);
225
+ if (!event.defaultPrevented) {
226
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
169
227
  event.preventDefault();
170
- if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
171
- }),
172
- onPointerDownOutside: (0, import_primitive.composeEventHandlers)(
173
- props.onPointerDownOutside,
174
- (event) => {
175
- const originalEvent = event.detail.originalEvent;
176
- const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
177
- const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
178
- isRightClickOutsideRef.current = isRightClick;
179
- },
180
- { checkForDefaultPrevented: false }
181
- ),
182
- onFocusOutside: (0, import_primitive.composeEventHandlers)(
183
- props.onFocusOutside,
184
- (event) => event.preventDefault(),
185
- { checkForDefaultPrevented: false }
186
- )
187
- }
188
- ) });
189
- }
190
- );
191
- var PopoverContentNonModal = React.forwardRef(
192
- (props, forwardedRef) => {
193
- const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
194
- const hasInteractedOutsideRef = React.useRef(false);
195
- const hasPointerDownOutsideRef = React.useRef(false);
196
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
197
- PopoverContentImpl,
198
- {
199
- ...props,
200
- ref: forwardedRef,
201
- trapFocus: false,
202
- disableOutsidePointerEvents: false,
203
- onCloseAutoFocus: (event) => {
204
- props.onCloseAutoFocus?.(event);
205
- if (!event.defaultPrevented) {
206
- if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
207
- event.preventDefault();
208
- }
209
- hasInteractedOutsideRef.current = false;
210
- hasPointerDownOutsideRef.current = false;
211
- },
212
- onInteractOutside: (event) => {
213
- props.onInteractOutside?.(event);
214
- if (!event.defaultPrevented) {
215
- hasInteractedOutsideRef.current = true;
216
- if (event.detail.originalEvent.type === "pointerdown") {
217
- hasPointerDownOutsideRef.current = true;
218
- }
219
- }
220
- const target = event.target;
221
- const targetIsTrigger = context.triggerRef.current?.contains(target);
222
- if (targetIsTrigger) event.preventDefault();
223
- if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
224
- event.preventDefault();
228
+ }
229
+ hasInteractedOutsideRef.current = false;
230
+ hasPointerDownOutsideRef.current = false;
231
+ },
232
+ onInteractOutside: (event) => {
233
+ props.onInteractOutside?.(event);
234
+ if (!event.defaultPrevented) {
235
+ hasInteractedOutsideRef.current = true;
236
+ if (event.detail.originalEvent.type === "pointerdown") {
237
+ hasPointerDownOutsideRef.current = true;
225
238
  }
226
239
  }
240
+ const target = event.target;
241
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
242
+ if (targetIsTrigger) event.preventDefault();
243
+ if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
244
+ event.preventDefault();
245
+ }
227
246
  }
228
- );
229
- }
230
- );
231
- var PopoverContentImpl = React.forwardRef(
232
- (props, forwardedRef) => {
233
- const {
234
- __scopePopover,
235
- trapFocus,
236
- onOpenAutoFocus,
237
- onCloseAutoFocus,
238
- disableOutsidePointerEvents,
239
- onEscapeKeyDown,
240
- onPointerDownOutside,
241
- onFocusOutside,
242
- onInteractOutside,
243
- ...contentProps
244
- } = props;
245
- const context = usePopoverContext(CONTENT_NAME, __scopePopover);
246
- const popperScope = usePopperScope(__scopePopover);
247
- (0, import_react_focus_guards.useFocusGuards)();
248
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
249
- import_react_focus_scope.FocusScope,
250
- {
251
- asChild: true,
252
- loop: true,
253
- trapped: trapFocus,
254
- onMountAutoFocus: onOpenAutoFocus,
255
- onUnmountAutoFocus: onCloseAutoFocus,
256
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
257
- import_react_dismissable_layer.DismissableLayer,
258
- {
259
- asChild: true,
260
- disableOutsidePointerEvents,
261
- onInteractOutside,
262
- onEscapeKeyDown,
263
- onPointerDownOutside,
264
- onFocusOutside,
265
- onDismiss: () => context.onOpenChange(false),
266
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
267
- PopperPrimitive.Content,
268
- {
269
- "data-state": getState(context.open),
270
- role: "dialog",
271
- id: context.contentId,
272
- ...popperScope,
273
- ...contentProps,
274
- ref: forwardedRef,
275
- style: {
276
- ...contentProps.style,
277
- // re-namespace exposed content custom properties
278
- ...{
279
- "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
280
- "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
281
- "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
282
- "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
283
- "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
284
- }
247
+ }
248
+ );
249
+ }
250
+ );
251
+ var PopoverContentImpl = React.forwardRef(
252
+ (props, forwardedRef) => {
253
+ const {
254
+ __scopePopover,
255
+ trapFocus,
256
+ onOpenAutoFocus,
257
+ onCloseAutoFocus,
258
+ disableOutsidePointerEvents,
259
+ onEscapeKeyDown,
260
+ onPointerDownOutside,
261
+ onFocusOutside,
262
+ onInteractOutside,
263
+ ...contentProps
264
+ } = props;
265
+ const context = usePopoverContext(CONTENT_NAME, __scopePopover);
266
+ const popperScope = usePopperScope(__scopePopover);
267
+ (0, import_react_focus_guards.useFocusGuards)();
268
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
269
+ import_react_focus_scope.FocusScope,
270
+ {
271
+ asChild: true,
272
+ loop: true,
273
+ trapped: trapFocus,
274
+ onMountAutoFocus: onOpenAutoFocus,
275
+ onUnmountAutoFocus: onCloseAutoFocus,
276
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
277
+ import_react_dismissable_layer.DismissableLayer,
278
+ {
279
+ asChild: true,
280
+ disableOutsidePointerEvents,
281
+ onInteractOutside,
282
+ onEscapeKeyDown,
283
+ onPointerDownOutside,
284
+ onFocusOutside,
285
+ onDismiss: () => context.onOpenChange(false),
286
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
287
+ PopperPrimitive.Content,
288
+ {
289
+ "data-state": getState(context.open),
290
+ role: "dialog",
291
+ id: context.contentId,
292
+ ...popperScope,
293
+ ...contentProps,
294
+ ref: forwardedRef,
295
+ style: {
296
+ ...contentProps.style,
297
+ // re-namespace exposed content custom properties
298
+ ...{
299
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
300
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
301
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
302
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
303
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
285
304
  }
286
305
  }
287
- )
288
- }
289
- )
290
- }
291
- );
292
- }
293
- );
294
- var CLOSE_NAME = "PopoverClose";
295
- var PopoverClose = React.forwardRef(
296
- (props, forwardedRef) => {
297
- const { __scopePopover, ...closeProps } = props;
298
- const context = usePopoverContext(CLOSE_NAME, __scopePopover);
299
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
300
- import_react_primitive.Primitive.button,
301
- {
302
- type: "button",
303
- ...closeProps,
304
- ref: forwardedRef,
305
- onClick: (0, import_primitive.composeEventHandlers)(props.onClick, () => context.onOpenChange(false))
306
- }
307
- );
308
- }
309
- );
310
- PopoverClose.displayName = CLOSE_NAME;
311
- var ARROW_NAME = "PopoverArrow";
312
- var PopoverArrow = React.forwardRef(
313
- (props, forwardedRef) => {
314
- const { __scopePopover, ...arrowProps } = props;
315
- const popperScope = usePopperScope(__scopePopover);
316
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
317
- }
318
- );
319
- PopoverArrow.displayName = ARROW_NAME;
320
- function getState(open) {
321
- return open ? "open" : "closed";
306
+ }
307
+ )
308
+ }
309
+ )
310
+ }
311
+ );
312
+ }
313
+ );
314
+ var CLOSE_NAME = "PopoverClose";
315
+ var PopoverClose = React.forwardRef(
316
+ (props, forwardedRef) => {
317
+ const { __scopePopover, ...closeProps } = props;
318
+ const context = usePopoverContext(CLOSE_NAME, __scopePopover);
319
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
320
+ import_react_primitive.Primitive.button,
321
+ {
322
+ type: "button",
323
+ ...closeProps,
324
+ ref: forwardedRef,
325
+ onClick: (0, import_primitive.composeEventHandlers)(props.onClick, () => context.onOpenChange(false))
326
+ }
327
+ );
328
+ }
329
+ );
330
+ PopoverClose.displayName = CLOSE_NAME;
331
+ var ARROW_NAME = "PopoverArrow";
332
+ var PopoverArrow = React.forwardRef(
333
+ (props, forwardedRef) => {
334
+ const { __scopePopover, ...arrowProps } = props;
335
+ const popperScope = usePopperScope(__scopePopover);
336
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
322
337
  }
323
- var Root2 = Popover;
324
- var Anchor2 = PopoverAnchor;
325
- var Trigger = PopoverTrigger;
326
- var Portal = PopoverPortal;
327
- var Content2 = PopoverContent;
328
- var Close = PopoverClose;
329
- var Arrow2 = PopoverArrow;
330
- })();
338
+ );
339
+ PopoverArrow.displayName = ARROW_NAME;
340
+ function getState(open) {
341
+ return open ? "open" : "closed";
342
+ }
343
+ var Root2 = Popover;
344
+ var Anchor2 = PopoverAnchor;
345
+ var Trigger = PopoverTrigger;
346
+ var Portal = PopoverPortal;
347
+ var Content2 = PopoverContent;
348
+ var Close = PopoverClose;
349
+ var Arrow2 = PopoverArrow;
331
350
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/Popover.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Popover\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPOVER_NAME = 'Popover';\n\ntype ScopedProps<P> = P & { __scopePopover?: Scope };\nconst [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\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 modal: boolean;\n};\n\nconst [PopoverProvider, usePopoverContext] =\n createPopoverContext<PopoverContextValue>(POPOVER_NAME);\n\ninterface PopoverProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n modal?: boolean;\n}\n\nconst Popover: React.FC<PopoverProps> = (props: ScopedProps<PopoverProps>) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false,\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <PopoverProvider\n scope={__scopePopover}\n contentId={useId()}\n triggerRef={triggerRef}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n hasCustomAnchor={hasCustomAnchor}\n onCustomAnchorAdd={React.useCallback(() => setHasCustomAnchor(true), [])}\n onCustomAnchorRemove={React.useCallback(() => setHasCustomAnchor(false), [])}\n modal={modal}\n >\n {children}\n </PopoverProvider>\n </PopperPrimitive.Root>\n );\n};\n\nPopover.displayName = POPOVER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopoverAnchor';\n\ntype PopoverAnchorElement = React.ElementRef<typeof PopperPrimitive.Anchor>;\ntype PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;\ninterface PopoverAnchorProps extends PopperAnchorProps {}\n\nconst PopoverAnchor = React.forwardRef<PopoverAnchorElement, PopoverAnchorProps>(\n (props: ScopedProps<PopoverAnchorProps>, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\n return <PopperPrimitive.Anchor {...popperScope} {...anchorProps} ref={forwardedRef} />;\n }\n);\n\nPopoverAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'PopoverTrigger';\n\ntype PopoverTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface PopoverTriggerProps extends PrimitiveButtonProps {}\n\nconst PopoverTrigger = React.forwardRef<PopoverTriggerElement, PopoverTriggerProps>(\n (props: ScopedProps<PopoverTriggerProps>, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n\n const trigger = (\n <Primitive.button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={context.open}\n aria-controls={context.contentId}\n data-state={getState(context.open)}\n {...triggerProps}\n ref={composedTriggerRef}\n onClick={composeEventHandlers(props.onClick, context.onOpenToggle)}\n />\n );\n\n return context.hasCustomAnchor ? (\n trigger\n ) : (\n <PopperPrimitive.Anchor asChild {...popperScope}>\n {trigger}\n </PopperPrimitive.Anchor>\n );\n }\n);\n\nPopoverTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'PopoverPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createPopoverContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface PopoverPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst PopoverPortal: React.FC<PopoverPortalProps> = (props: ScopedProps<PopoverPortalProps>) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return (\n <PortalProvider scope={__scopePopover} forceMount={forceMount}>\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {children}\n </PortalPrimitive>\n </Presence>\n </PortalProvider>\n );\n};\n\nPopoverPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopoverContent';\n\ninterface PopoverContentProps extends PopoverContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst PopoverContent = React.forwardRef<PopoverContentTypeElement, PopoverContentProps>(\n (props: ScopedProps<PopoverContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return (\n <Presence present={forceMount || context.open}>\n {context.modal ? (\n <PopoverContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <PopoverContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n }\n);\n\nPopoverContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PopoverContentTypeElement = PopoverContentImplElement;\ninterface PopoverContentTypeProps\n extends Omit<PopoverContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {}\n\nconst PopoverContentModal = React.forwardRef<PopoverContentTypeElement, PopoverContentTypeProps>(\n (props: ScopedProps<PopoverContentTypeProps>, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n <RemoveScroll as={Slot} allowPinchZoom>\n <PopoverContentImpl\n {...props}\n ref={composedRefs}\n // we make sure we're not trapping once it's been closed\n // (closed !== unmounted when animating out)\n 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\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: 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 { checkForDefaultPrevented: false }\n )}\n />\n </RemoveScroll>\n );\n }\n);\n\nconst PopoverContentNonModal = React.forwardRef<PopoverContentTypeElement, PopoverContentTypeProps>(\n (props: ScopedProps<PopoverContentTypeProps>, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n <PopoverContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PopoverContentImplElement = React.ElementRef<typeof PopperPrimitive.Content>;\ntype FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ninterface PopoverContentImplProps\n extends Omit<PopperContentProps, 'onPlaced'>,\n Omit<DismissableLayerProps, 'onDismiss'> {\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\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 ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n\n // Make sure the whole tree has focus guards as our `Popover` may be\n // the last element in the DOM (beacuse of the `Portal`)\n useFocusGuards();\n\n return (\n <FocusScope\n asChild\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\n asChild\n disableOutsidePointerEvents={disableOutsidePointerEvents}\n onInteractOutside={onInteractOutside}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={onFocusOutside}\n onDismiss={() => context.onOpenChange(false)}\n >\n <PopperPrimitive.Content\n data-state={getState(context.open)}\n role=\"dialog\"\n id={context.contentId}\n {...popperScope}\n {...contentProps}\n ref={forwardedRef}\n style={{\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-popover-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-popover-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-popover-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-popover-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-popover-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n </DismissableLayer>\n </FocusScope>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'PopoverClose';\n\ntype PopoverCloseElement = React.ElementRef<typeof Primitive.button>;\ninterface PopoverCloseProps extends PrimitiveButtonProps {}\n\nconst PopoverClose = React.forwardRef<PopoverCloseElement, PopoverCloseProps>(\n (props: ScopedProps<PopoverCloseProps>, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return (\n <Primitive.button\n type=\"button\"\n {...closeProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => 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 = React.ElementRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface PopoverArrowProps extends PopperArrowProps {}\n\nconst PopoverArrow = React.forwardRef<PopoverArrowElement, PopoverArrowProps>(\n (props: ScopedProps<PopoverArrowProps>, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nPopoverArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst Root = Popover;\nconst Anchor = PopoverAnchor;\nconst Trigger = PopoverTrigger;\nconst Portal = PopoverPortal;\nconst Content = PopoverContent;\nconst Close = PopoverClose;\nconst Arrow = PopoverArrow;\n\nexport {\n createPopoverScope,\n //\n Popover,\n PopoverAnchor,\n PopoverTrigger,\n PopoverPortal,\n PopoverContent,\n PopoverClose,\n PopoverArrow,\n //\n Root,\n Anchor,\n Trigger,\n Portal,\n Content,\n Close,\n Arrow,\n};\nexport type {\n PopoverProps,\n PopoverAnchorProps,\n PopoverTriggerProps,\n PopoverPortalProps,\n PopoverContentProps,\n PopoverCloseProps,\n PopoverArrowProps,\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAuB;AACvB,yBAAqC;AACrC,kCAAgC;AAChC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AAA,UACF;AAAA;AAAA,MACF;AAAA,IAEJ;AAAA,EACF;AAMA,MAAM,aAAa;AAKnB,MAAM,eAAqB;AAAA,IACzB,CAAC,OAAuC,iBAAiB;AACvD,YAAM,EAAE,gBAAgB,GAAG,WAAW,IAAI;AAC1C,YAAM,UAAU,kBAAkB,YAAY,cAAc;AAC5D,aACE;AAAA,QAAC,iCAAU;AAAA,QAAV;AAAA,UACC,MAAK;AAAA,UACJ,GAAG;AAAA,UACJ,KAAK;AAAA,UACL,aAAS,uCAAqB,MAAM,SAAS,MAAM,QAAQ,aAAa,KAAK,CAAC;AAAA;AAAA,MAChF;AAAA,IAEJ;AAAA,EACF;AAEA,eAAa,cAAc;AAM3B,MAAM,aAAa;AAMnB,MAAM,eAAqB;AAAA,IACzB,CAAC,OAAuC,iBAAiB;AACvD,YAAM,EAAE,gBAAgB,GAAG,WAAW,IAAI;AAC1C,YAAM,cAAc,eAAe,cAAc;AACjD,aAAO,4CAAiB,uBAAhB,EAAuB,GAAG,aAAc,GAAG,YAAY,KAAK,cAAc;AAAA,IACpF;AAAA,EACF;AAEA,eAAa,cAAc;AAI3B,WAAS,SAAS,MAAe;AAC/B,WAAO,OAAO,SAAS;AAAA,EACzB;AAEA,MAAMC,QAAO;AACb,MAAMC,UAAS;AACf,MAAM,UAAU;AAChB,MAAM,SAAS;AACf,MAAMC,WAAU;AAChB,MAAM,QAAQ;AACd,MAAMC,SAAQ;",
6
- "names": ["PortalPrimitive", "Root", "Anchor", "Content", "Arrow"]
3
+ "sources": ["../src/index.ts", "../src/Popover.tsx"],
4
+ "sourcesContent": ["'use client';\nexport {\n createPopoverScope,\n //\n Popover,\n PopoverAnchor,\n PopoverTrigger,\n PopoverPortal,\n PopoverContent,\n PopoverClose,\n PopoverArrow,\n //\n Root,\n Anchor,\n Trigger,\n Portal,\n Content,\n Close,\n Arrow,\n} from './Popover';\nexport type {\n PopoverProps,\n PopoverAnchorProps,\n PopoverTriggerProps,\n PopoverPortalProps,\n PopoverContentProps,\n PopoverCloseProps,\n PopoverArrowProps,\n} from './Popover';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Popover\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPOVER_NAME = 'Popover';\n\ntype ScopedProps<P> = P & { __scopePopover?: Scope };\nconst [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\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 modal: boolean;\n};\n\nconst [PopoverProvider, usePopoverContext] =\n createPopoverContext<PopoverContextValue>(POPOVER_NAME);\n\ninterface PopoverProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n modal?: boolean;\n}\n\nconst Popover: React.FC<PopoverProps> = (props: ScopedProps<PopoverProps>) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false,\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <PopoverProvider\n scope={__scopePopover}\n contentId={useId()}\n triggerRef={triggerRef}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n hasCustomAnchor={hasCustomAnchor}\n onCustomAnchorAdd={React.useCallback(() => setHasCustomAnchor(true), [])}\n onCustomAnchorRemove={React.useCallback(() => setHasCustomAnchor(false), [])}\n modal={modal}\n >\n {children}\n </PopoverProvider>\n </PopperPrimitive.Root>\n );\n};\n\nPopover.displayName = POPOVER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopoverAnchor';\n\ntype PopoverAnchorElement = React.ElementRef<typeof PopperPrimitive.Anchor>;\ntype PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;\ninterface PopoverAnchorProps extends PopperAnchorProps {}\n\nconst PopoverAnchor = React.forwardRef<PopoverAnchorElement, PopoverAnchorProps>(\n (props: ScopedProps<PopoverAnchorProps>, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\n return <PopperPrimitive.Anchor {...popperScope} {...anchorProps} ref={forwardedRef} />;\n }\n);\n\nPopoverAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'PopoverTrigger';\n\ntype PopoverTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface PopoverTriggerProps extends PrimitiveButtonProps {}\n\nconst PopoverTrigger = React.forwardRef<PopoverTriggerElement, PopoverTriggerProps>(\n (props: ScopedProps<PopoverTriggerProps>, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n\n const trigger = (\n <Primitive.button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={context.open}\n aria-controls={context.contentId}\n data-state={getState(context.open)}\n {...triggerProps}\n ref={composedTriggerRef}\n onClick={composeEventHandlers(props.onClick, context.onOpenToggle)}\n />\n );\n\n return context.hasCustomAnchor ? (\n trigger\n ) : (\n <PopperPrimitive.Anchor asChild {...popperScope}>\n {trigger}\n </PopperPrimitive.Anchor>\n );\n }\n);\n\nPopoverTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'PopoverPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createPopoverContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface PopoverPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst PopoverPortal: React.FC<PopoverPortalProps> = (props: ScopedProps<PopoverPortalProps>) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return (\n <PortalProvider scope={__scopePopover} forceMount={forceMount}>\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {children}\n </PortalPrimitive>\n </Presence>\n </PortalProvider>\n );\n};\n\nPopoverPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopoverContent';\n\ninterface PopoverContentProps extends PopoverContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst PopoverContent = React.forwardRef<PopoverContentTypeElement, PopoverContentProps>(\n (props: ScopedProps<PopoverContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return (\n <Presence present={forceMount || context.open}>\n {context.modal ? (\n <PopoverContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <PopoverContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n }\n);\n\nPopoverContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PopoverContentTypeElement = PopoverContentImplElement;\ninterface PopoverContentTypeProps\n extends Omit<PopoverContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {}\n\nconst PopoverContentModal = React.forwardRef<PopoverContentTypeElement, PopoverContentTypeProps>(\n (props: ScopedProps<PopoverContentTypeProps>, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n <RemoveScroll as={Slot} allowPinchZoom>\n <PopoverContentImpl\n {...props}\n ref={composedRefs}\n // we make sure we're not trapping once it's been closed\n // (closed !== unmounted when animating out)\n 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\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: 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 { checkForDefaultPrevented: false }\n )}\n />\n </RemoveScroll>\n );\n }\n);\n\nconst PopoverContentNonModal = React.forwardRef<PopoverContentTypeElement, PopoverContentTypeProps>(\n (props: ScopedProps<PopoverContentTypeProps>, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n <PopoverContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PopoverContentImplElement = React.ElementRef<typeof PopperPrimitive.Content>;\ntype FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ninterface PopoverContentImplProps\n extends Omit<PopperContentProps, 'onPlaced'>,\n Omit<DismissableLayerProps, 'onDismiss'> {\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\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 ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n\n // Make sure the whole tree has focus guards as our `Popover` may be\n // the last element in the DOM (beacuse of the `Portal`)\n useFocusGuards();\n\n return (\n <FocusScope\n asChild\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\n asChild\n disableOutsidePointerEvents={disableOutsidePointerEvents}\n onInteractOutside={onInteractOutside}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={onFocusOutside}\n onDismiss={() => context.onOpenChange(false)}\n >\n <PopperPrimitive.Content\n data-state={getState(context.open)}\n role=\"dialog\"\n id={context.contentId}\n {...popperScope}\n {...contentProps}\n ref={forwardedRef}\n style={{\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-popover-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-popover-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-popover-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-popover-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-popover-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n </DismissableLayer>\n </FocusScope>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'PopoverClose';\n\ntype PopoverCloseElement = React.ElementRef<typeof Primitive.button>;\ninterface PopoverCloseProps extends PrimitiveButtonProps {}\n\nconst PopoverClose = React.forwardRef<PopoverCloseElement, PopoverCloseProps>(\n (props: ScopedProps<PopoverCloseProps>, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return (\n <Primitive.button\n type=\"button\"\n {...closeProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => 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 = React.ElementRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface PopoverArrowProps extends PopperArrowProps {}\n\nconst PopoverArrow = React.forwardRef<PopoverArrowElement, PopoverArrowProps>(\n (props: ScopedProps<PopoverArrowProps>, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nPopoverArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst Root = Popover;\nconst Anchor = PopoverAnchor;\nconst Trigger = PopoverTrigger;\nconst Portal = PopoverPortal;\nconst Content = PopoverContent;\nconst Close = PopoverClose;\nconst Arrow = PopoverArrow;\n\nexport {\n createPopoverScope,\n //\n Popover,\n PopoverAnchor,\n PopoverTrigger,\n PopoverPortal,\n PopoverContent,\n PopoverClose,\n PopoverArrow,\n //\n Root,\n Anchor,\n Trigger,\n Portal,\n Content,\n Close,\n Arrow,\n};\nexport type {\n PopoverProps,\n PopoverAnchorProps,\n PopoverTriggerProps,\n PopoverPortalProps,\n PopoverContentProps,\n PopoverCloseProps,\n PopoverArrowProps,\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA,aAAAC;AAAA,EAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;A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AA,QACF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAMA,IAAM,aAAa;AAKnB,IAAM,eAAqB;AAAA,EACzB,CAAC,OAAuC,iBAAiB;AACvD,UAAM,EAAE,gBAAgB,GAAG,WAAW,IAAI;AAC1C,UAAM,UAAU,kBAAkB,YAAY,cAAc;AAC5D,WACE;AAAA,MAAC,iCAAU;AAAA,MAAV;AAAA,QACC,MAAK;AAAA,QACJ,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,aAAS,uCAAqB,MAAM,SAAS,MAAM,QAAQ,aAAa,KAAK,CAAC;AAAA;AAAA,IAChF;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAM3B,IAAM,aAAa;AAMnB,IAAM,eAAqB;AAAA,EACzB,CAAC,OAAuC,iBAAiB;AACvD,UAAM,EAAE,gBAAgB,GAAG,WAAW,IAAI;AAC1C,UAAM,cAAc,eAAe,cAAc;AACjD,WAAO,4CAAiB,uBAAhB,EAAuB,GAAG,aAAc,GAAG,YAAY,KAAK,cAAc;AAAA,EACpF;AACF;AAEA,aAAa,cAAc;AAI3B,SAAS,SAAS,MAAe;AAC/B,SAAO,OAAO,SAAS;AACzB;AAEA,IAAMC,QAAO;AACb,IAAMC,UAAS;AACf,IAAM,UAAU;AAChB,IAAM,SAAS;AACf,IAAMC,WAAU;AAChB,IAAM,QAAQ;AACd,IAAMC,SAAQ;",
6
+ "names": ["Anchor", "Arrow", "Content", "Root", "PortalPrimitive", "Root", "Anchor", "Content", "Arrow"]
7
7
  }
package/dist/index.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  // packages/react/popover/src/Popover.tsx
2
4
  import * as React from "react";
3
5
  import { composeEventHandlers } from "@radix-ui/primitive";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/Popover.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Popover\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPOVER_NAME = 'Popover';\n\ntype ScopedProps<P> = P & { __scopePopover?: Scope };\nconst [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\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 modal: boolean;\n};\n\nconst [PopoverProvider, usePopoverContext] =\n createPopoverContext<PopoverContextValue>(POPOVER_NAME);\n\ninterface PopoverProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n modal?: boolean;\n}\n\nconst Popover: React.FC<PopoverProps> = (props: ScopedProps<PopoverProps>) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false,\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <PopoverProvider\n scope={__scopePopover}\n contentId={useId()}\n triggerRef={triggerRef}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n hasCustomAnchor={hasCustomAnchor}\n onCustomAnchorAdd={React.useCallback(() => setHasCustomAnchor(true), [])}\n onCustomAnchorRemove={React.useCallback(() => setHasCustomAnchor(false), [])}\n modal={modal}\n >\n {children}\n </PopoverProvider>\n </PopperPrimitive.Root>\n );\n};\n\nPopover.displayName = POPOVER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopoverAnchor';\n\ntype PopoverAnchorElement = React.ElementRef<typeof PopperPrimitive.Anchor>;\ntype PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;\ninterface PopoverAnchorProps extends PopperAnchorProps {}\n\nconst PopoverAnchor = React.forwardRef<PopoverAnchorElement, PopoverAnchorProps>(\n (props: ScopedProps<PopoverAnchorProps>, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\n return <PopperPrimitive.Anchor {...popperScope} {...anchorProps} ref={forwardedRef} />;\n }\n);\n\nPopoverAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'PopoverTrigger';\n\ntype PopoverTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface PopoverTriggerProps extends PrimitiveButtonProps {}\n\nconst PopoverTrigger = React.forwardRef<PopoverTriggerElement, PopoverTriggerProps>(\n (props: ScopedProps<PopoverTriggerProps>, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n\n const trigger = (\n <Primitive.button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={context.open}\n aria-controls={context.contentId}\n data-state={getState(context.open)}\n {...triggerProps}\n ref={composedTriggerRef}\n onClick={composeEventHandlers(props.onClick, context.onOpenToggle)}\n />\n );\n\n return context.hasCustomAnchor ? (\n trigger\n ) : (\n <PopperPrimitive.Anchor asChild {...popperScope}>\n {trigger}\n </PopperPrimitive.Anchor>\n );\n }\n);\n\nPopoverTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'PopoverPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createPopoverContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface PopoverPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst PopoverPortal: React.FC<PopoverPortalProps> = (props: ScopedProps<PopoverPortalProps>) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return (\n <PortalProvider scope={__scopePopover} forceMount={forceMount}>\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {children}\n </PortalPrimitive>\n </Presence>\n </PortalProvider>\n );\n};\n\nPopoverPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopoverContent';\n\ninterface PopoverContentProps extends PopoverContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst PopoverContent = React.forwardRef<PopoverContentTypeElement, PopoverContentProps>(\n (props: ScopedProps<PopoverContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return (\n <Presence present={forceMount || context.open}>\n {context.modal ? (\n <PopoverContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <PopoverContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n }\n);\n\nPopoverContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PopoverContentTypeElement = PopoverContentImplElement;\ninterface PopoverContentTypeProps\n extends Omit<PopoverContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {}\n\nconst PopoverContentModal = React.forwardRef<PopoverContentTypeElement, PopoverContentTypeProps>(\n (props: ScopedProps<PopoverContentTypeProps>, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n <RemoveScroll as={Slot} allowPinchZoom>\n <PopoverContentImpl\n {...props}\n ref={composedRefs}\n // we make sure we're not trapping once it's been closed\n // (closed !== unmounted when animating out)\n 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\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: 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 { checkForDefaultPrevented: false }\n )}\n />\n </RemoveScroll>\n );\n }\n);\n\nconst PopoverContentNonModal = React.forwardRef<PopoverContentTypeElement, PopoverContentTypeProps>(\n (props: ScopedProps<PopoverContentTypeProps>, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n <PopoverContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PopoverContentImplElement = React.ElementRef<typeof PopperPrimitive.Content>;\ntype FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ninterface PopoverContentImplProps\n extends Omit<PopperContentProps, 'onPlaced'>,\n Omit<DismissableLayerProps, 'onDismiss'> {\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\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 ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n\n // Make sure the whole tree has focus guards as our `Popover` may be\n // the last element in the DOM (beacuse of the `Portal`)\n useFocusGuards();\n\n return (\n <FocusScope\n asChild\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\n asChild\n disableOutsidePointerEvents={disableOutsidePointerEvents}\n onInteractOutside={onInteractOutside}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={onFocusOutside}\n onDismiss={() => context.onOpenChange(false)}\n >\n <PopperPrimitive.Content\n data-state={getState(context.open)}\n role=\"dialog\"\n id={context.contentId}\n {...popperScope}\n {...contentProps}\n ref={forwardedRef}\n style={{\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-popover-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-popover-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-popover-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-popover-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-popover-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n </DismissableLayer>\n </FocusScope>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * PopoverClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'PopoverClose';\n\ntype PopoverCloseElement = React.ElementRef<typeof Primitive.button>;\ninterface PopoverCloseProps extends PrimitiveButtonProps {}\n\nconst PopoverClose = React.forwardRef<PopoverCloseElement, PopoverCloseProps>(\n (props: ScopedProps<PopoverCloseProps>, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return (\n <Primitive.button\n type=\"button\"\n {...closeProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => 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 = React.ElementRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface PopoverArrowProps extends PopperArrowProps {}\n\nconst PopoverArrow = React.forwardRef<PopoverArrowElement, PopoverArrowProps>(\n (props: ScopedProps<PopoverArrowProps>, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nPopoverArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst Root = Popover;\nconst Anchor = PopoverAnchor;\nconst Trigger = PopoverTrigger;\nconst Portal = PopoverPortal;\nconst Content = PopoverContent;\nconst Close = PopoverClose;\nconst Arrow = PopoverArrow;\n\nexport {\n createPopoverScope,\n //\n Popover,\n PopoverAnchor,\n PopoverTrigger,\n PopoverPortal,\n PopoverContent,\n PopoverClose,\n PopoverArrow,\n //\n Root,\n Anchor,\n Trigger,\n Portal,\n Content,\n Close,\n Arrow,\n};\nexport type {\n PopoverProps,\n PopoverAnchorProps,\n PopoverTriggerProps,\n PopoverPortalProps,\n PopoverContentProps,\n PopoverCloseProps,\n PopoverArrowProps,\n};\n"],
5
- "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AACtB,YAAY,qBAAqB;AACjC,SAAS,yBAAyB;AAClC,SAAS,UAAU,uBAAuB;AAC1C,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AACrB,SAAS,4BAA4B;AAC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AM,cAAc,eAAe,cAAc;AACjD,WAAO,oBAAiB,uBAAhB,EAAuB,GAAG,aAAc,GAAG,YAAY,KAAK,cAAc;AAAA,EACpF;AACF;AAEA,aAAa,cAAc;AAI3B,SAAS,SAAS,MAAe;AAC/B,SAAO,OAAO,SAAS;AACzB;AAEA,IAAMA,QAAO;AACb,IAAMC,UAAS;AACf,IAAM,UAAU;AAChB,IAAM,SAAS;AACf,IAAMC,WAAU;AAChB,IAAM,QAAQ;AACd,IAAMC,SAAQ;",
6
6
  "names": ["Root", "Anchor", "Content", "Arrow"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-popover",
3
- "version": "1.1.0-rc.1",
3
+ "version": "1.1.0-rc.3",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -28,19 +28,19 @@
28
28
  "version": "yarn version"
29
29
  },
30
30
  "dependencies": {
31
- "@radix-ui/primitive": "1.1.0-rc.1",
32
- "@radix-ui/react-compose-refs": "1.1.0-rc.1",
33
- "@radix-ui/react-context": "1.1.0-rc.1",
34
- "@radix-ui/react-dismissable-layer": "1.1.0-rc.1",
35
- "@radix-ui/react-focus-guards": "1.1.0-rc.1",
36
- "@radix-ui/react-focus-scope": "1.1.0-rc.1",
37
- "@radix-ui/react-id": "1.1.0-rc.1",
38
- "@radix-ui/react-popper": "1.2.0-rc.1",
39
- "@radix-ui/react-portal": "1.1.0-rc.1",
40
- "@radix-ui/react-presence": "1.1.0-rc.1",
41
- "@radix-ui/react-primitive": "1.1.0-rc.1",
42
- "@radix-ui/react-slot": "1.1.0-rc.1",
43
- "@radix-ui/react-use-controllable-state": "1.1.0-rc.1",
31
+ "@radix-ui/primitive": "1.1.0-rc.3",
32
+ "@radix-ui/react-compose-refs": "1.1.0-rc.3",
33
+ "@radix-ui/react-context": "1.1.0-rc.3",
34
+ "@radix-ui/react-dismissable-layer": "1.1.0-rc.3",
35
+ "@radix-ui/react-focus-guards": "1.1.0-rc.3",
36
+ "@radix-ui/react-focus-scope": "1.1.0-rc.3",
37
+ "@radix-ui/react-id": "1.1.0-rc.3",
38
+ "@radix-ui/react-popper": "1.2.0-rc.3",
39
+ "@radix-ui/react-portal": "1.1.0-rc.3",
40
+ "@radix-ui/react-presence": "1.1.0-rc.3",
41
+ "@radix-ui/react-primitive": "1.1.0-rc.3",
42
+ "@radix-ui/react-slot": "1.1.0-rc.3",
43
+ "@radix-ui/react-use-controllable-state": "1.1.0-rc.3",
44
44
  "aria-hidden": "^1.1.1",
45
45
  "react-remove-scroll": "2.5.7"
46
46
  },