@radix-ui/react-popover 1.0.6-rc.3 → 1.0.6-rc.5

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.
@@ -1 +1 @@
1
- {"mappings":";;;;;;;AA4BA,OAAA,yFAEE,CAAC;AAkBH;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,OAAA,MAAM,SAAS,MAAM,EAAE,CAAC,YAAY,CAoCnC,CAAC;AAWF,yBAAyB,MAAM,wBAAwB,CAAC,OAAO,gBAAgB,MAAM,CAAC,CAAC;AACvF,mCAA6B,SAAQ,iBAAiB;CAAG;AAEzD,OAAA,MAAM,wGAcL,CAAC;AAWF,4BAA4B,MAAM,wBAAwB,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC;AACpF,oCAA8B,SAAQ,oBAAoB;CAAG;AAE7D,OAAA,MAAM,6GA4BL,CAAC;AAeF,mBAAmB,MAAM,wBAAwB,CAAC,eAAsB,CAAC,CAAC;AAC1E,mCAA6B,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC/D,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED,OAAA,MAAM,eAAe,MAAM,EAAE,CAAC,kBAAkB,CAY/C,CAAC;AAUF,oCAA8B,SAAQ,uBAAuB;IAC3D;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED,OAAA,MAAM,0GAeL,CAAC;AAOF,iCACE,SAAQ,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,6BAA6B,CAAC;CAAG;AAiGvF,uBAAuB,MAAM,wBAAwB,CAAC,iBAAiB,CAAC,CAAC;AACzE,6BAA6B,MAAM,wBAAwB,CAAC,uBAAuB,CAAC,CAAC;AACrF,0BAA0B,MAAM,wBAAwB,CAAC,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACzF,iCACE,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,EAC1C,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAEvC;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC;IAEtD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;CAC1D;AAwED,kCAA4B,SAAQ,oBAAoB;CAAG;AAE3D,OAAA,MAAM,yGAaL,CAAC;AAWF,wBAAwB,MAAM,wBAAwB,CAAC,OAAO,gBAAgB,KAAK,CAAC,CAAC;AACrF,kCAA4B,SAAQ,gBAAgB;CAAG;AAEvD,OAAA,MAAM,qGAML,CAAC;AAUF,OAAA,MAAM,4BAAc,CAAC;AACrB,OAAA,MAAM,iGAAsB,CAAC;AAC7B,OAAA,MAAM,sGAAwB,CAAC;AAC/B,OAAA,MAAM,oCAAsB,CAAC;AAC7B,OAAA,MAAM,mGAAwB,CAAC;AAC/B,OAAA,MAAM,kGAAoB,CAAC;AAC3B,OAAA,MAAM,8FAAoB,CAAC","sources":["packages/react/popover/src/packages/react/popover/src/Popover.tsx","packages/react/popover/src/packages/react/popover/src/index.ts","packages/react/popover/src/index.ts"],"sourcesContent":[null,null,"export {\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 P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iBAAiB,CAAC,CAAC;AACzE,6BAA6B,MAAM,wBAAwB,CAAC,uBAAuB,CAAC,CAAC;AACrF,0BAA0B,MAAM,wBAAwB,CAAC,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACzF,iCACE,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,EAC1C,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAEvC;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC;IAEtD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;CAC1D;AAwED,kCAA4B,SAAQ,oBAAoB;CAAG;AAE3D,OAAA,MAAM,yGAaL,CAAC;AAWF,wBAAwB,MAAM,wBAAwB,CAAC,OAAO,gBAAgB,KAAK,CAAC,CAAC;AACrF,kCAA4B,SAAQ,gBAAgB;CAAG;AAEvD,OAAA,MAAM,qGAML,CAAC;AAUF,OAAA,MAAM,4BAAc,CAAC;AACrB,OAAA,MAAM,iGAAsB,CAAC;AAC7B,OAAA,MAAM,sGAAwB,CAAC;AAC/B,OAAA,MAAM,oCAAsB,CAAC;AAC7B,OAAA,MAAM,mGAAwB,CAAC;AAC/B,OAAA,MAAM,kGAAoB,CAAC;AAC3B,OAAA,MAAM,8FAAoB,CAAC","sources":["packages/react/popover/src/packages/react/popover/src/Popover.tsx","packages/react/popover/src/packages/react/popover/src/index.ts","packages/react/popover/src/index.ts"],"sourcesContent":[null,null,"export {\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"],"names":[],"version":3,"file":"index.d.ts.map"}
package/dist/index.js CHANGED
@@ -224,6 +224,7 @@ const $7d632c09314cddaf$export$d7e1f420b25549ff = /*#__PURE__*/ $aJPOC$react.for
224
224
  const $7d632c09314cddaf$var$PopoverContentNonModal = /*#__PURE__*/ $aJPOC$react.forwardRef((props, forwardedRef)=>{
225
225
  const context = $7d632c09314cddaf$var$usePopoverContext($7d632c09314cddaf$var$CONTENT_NAME, props.__scopePopover);
226
226
  const hasInteractedOutsideRef = $aJPOC$react.useRef(false);
227
+ const hasPointerDownOutsideRef = $aJPOC$react.useRef(false);
227
228
  return /*#__PURE__*/ $aJPOC$react.createElement($7d632c09314cddaf$var$PopoverContentImpl, ($parcel$interopDefault($aJPOC$babelruntimehelpersextends))({}, props, {
228
229
  ref: forwardedRef,
229
230
  trapFocus: false,
@@ -237,19 +238,24 @@ const $7d632c09314cddaf$var$PopoverContentNonModal = /*#__PURE__*/ $aJPOC$react.
237
238
  event.preventDefault();
238
239
  }
239
240
  hasInteractedOutsideRef.current = false;
241
+ hasPointerDownOutsideRef.current = false;
240
242
  },
241
243
  onInteractOutside: (event)=>{
242
244
  var _props$onInteractOuts, _context$triggerRef$c3;
243
245
  (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
244
- if (!event.defaultPrevented) hasInteractedOutsideRef.current = true; // Prevent dismissing when clicking the trigger.
246
+ if (!event.defaultPrevented) {
247
+ hasInteractedOutsideRef.current = true;
248
+ if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true;
249
+ } // Prevent dismissing when clicking the trigger.
245
250
  // As the trigger is already setup to close, without doing so would
246
251
  // cause it to close and immediately open.
247
- //
248
- // We use `onInteractOutside` as some browsers also
249
- // focus on pointer down, creating the same issue.
250
252
  const target = event.target;
251
253
  const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
252
- if (targetIsTrigger) event.preventDefault();
254
+ if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked
255
+ // we will get the pointer down outside event on the trigger, but then a subsequent
256
+ // focus outside event on the container, we ignore any focus outside event when we've
257
+ // already had a pointer down outside event.
258
+ if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault();
253
259
  }
254
260
  }));
255
261
  });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;;;;;;;;;;ACqBA;;oGAEA,CAEA,MAAMgC,kCAAY,GAAG,SAArB,AAAA;AAGA,MAAM,CAACC,0CAAD,EAAuBjC,yCAAvB,CAAA,GAA6CkB,6CAAkB,CAACc,kCAAD,EAAe;IAClFR,2CADkF;CAAf,CAArE,AAAA;AAGA,MAAMU,oCAAc,GAAGV,2CAAiB,EAAxC,AAAA;AAcA,MAAM,CAACW,qCAAD,EAAkBC,uCAAlB,CAAA,GACJH,0CAAoB,CAAsBD,kCAAtB,CADtB,AAAA;AAWA,MAAM/B,yCAA+B,GAAIoC,CAAAA,KAAD,GAAsC;IAC5E,MAAM,E,gBACJC,cADI,CAAA,E,UAEJC,QAFI,CAAA,EAGJC,IAAI,EAAEC,QAHF,CAAA,E,aAIJC,WAJI,CAAA,E,cAKJC,YALI,CAAA,SAMJC,KAAK,GAAG,KAARA,GANI,GAOFP,KAPJ,AAAM;IAQN,MAAMQ,WAAW,GAAGX,oCAAc,CAACI,cAAD,CAAlC,AAAA;IACA,MAAMQ,UAAU,GAAG/B,mBAAA,CAAgC,IAAhC,CAAnB,AAAA;IACA,MAAM,CAACiC,eAAD,EAAkBC,kBAAlB,CAAA,GAAwClC,qBAAA,CAAe,KAAf,CAA9C,AAAA;IACA,MAAM,CAACyB,IAAI,G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,MAAM,E,gBAAErB,cAAF,CAAA,EAAkB,GAAG+E,UAAH,EAAlB,GAAoChF,KAA1C,AAAM;IACN,MAAMQ,WAAW,GAAGX,oCAAc,CAACI,cAAD,CAAlC,AAAA;IACA,OAAA,aAAO,CAAA,0BAAA,CAAC,+BAAD,EAAA,2DAAA,CAAA,EAAA,EAA2BO,WAA3B,EAA4CwE,UAA5C,EAAP;QAA+D,GAAG,EAAE1D,YAAL;KAAxD,CAAA,CAAP,CAAO;CAJU,CAArB,AAKG;AAGH,aAAA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAAA,gCAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,SAASW,8BAAT,CAAkB9B,IAAlB,EAAiC;IAC/B,OAAOA,IAAI,GAAG,MAAH,GAAY,QAAvB,CAAA;CACD;AAED,MAAMhC,yCAAI,GAAGP,yCAAb,AAAA;AACA,MAAMQ,yCAAM,GAAGP,yCAAf,AAAA;AACA,MAAMQ,yCAAO,GAAGP,wCAAhB,AAAA;AACA,MAAMQ,yCAAM,GAAGP,yCAAf,AAAA;AACA,MAAMQ,yCAAO,GAAGP,yCAAhB,AAAA;AACA,MAAMQ,yCAAK,GAAGP,yCAAd,AAAA;AACA,MAAMQ,yCAAK,GAAGP,yCAAd,AAAA;;ADneA","sources":["packages/react/popover/src/index.ts","packages/react/popover/src/Popover.tsx"],"sourcesContent":["export {\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 extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode;\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\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 }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) hasInteractedOutsideRef.current = true;\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 //\n // We use `onInteractOutside` as some browsers also\n // focus on pointer down, creating the same issue.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\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"],"names":["createPopoverScope","Popover","PopoverAnchor","PopoverTrigger","PopoverPortal","PopoverContent","PopoverClose","PopoverArrow","Root","Anchor","Trigger","Portal","Content","Close","Arrow","React","composeEventHandlers","useComposedRefs","createContextScope","DismissableLayer","useFocusGuards","FocusScope","useId","PopperPrimitive","createPopperScope","PortalPrimitive","Presence","Primitive","Slot","useControllableState","hideOthers","RemoveScroll","POPOVER_NAME","createPopoverContext","usePopperScope","PopoverProvider","usePopoverContext","props","__scopePopover","children","open","openProp","defaultOpen","onOpenChange","modal","popperScope","triggerRef","useRef","hasCustomAnchor","setHasCustomAnchor","useState","setOpen","prop","defaultProp","onChange","useCallback","prevOpen","ANCHOR_NAME","forwardRef","forwardedRef","anchorProps","context","onCustomAnchorAdd","onCustomAnchorRemove","useEffect","TRIGGER_NAME","triggerProps","composedTriggerRef","trigger","contentId","getState","onClick","onOpenToggle","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","undefined","container","CONTENT_NAME","portalContext","contentProps","PopoverContentModal","contentRef","composedRefs","isRightClickOutsideRef","content","current","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","button","ctrlKey","isRightClick","checkForDefaultPrevented","onFocusOutside","PopoverContentNonModal","hasInteractedOutsideRef","defaultPrevented","onInteractOutside","target","targetIsTrigger","contains","PopoverContentImpl","trapFocus","onOpenAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","style","CLOSE_NAME","closeProps","ARROW_NAME","arrowProps"],"version":3,"file":"index.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;;;;;;;;;;ACqBA;;oGAEA,CAEA,MAAMgC,kCAAY,GAAG,SAArB,AAAA;AAGA,MAAM,CAACC,0CAAD,EAAuBjC,yCAAvB,CAAA,GAA6CkB,6CAAkB,CAACc,kCAAD,EAAe;IAClFR,2CADkF;CAAf,CAArE,AAAA;AAGA,MAAMU,oCAAc,GAAGV,2CAAiB,EAAxC,AAAA;AAcA,MAAM,CAACW,qCAAD,EAAkBC,uCAAlB,CAAA,GACJH,0CAAoB,CAAsBD,kCAAtB,CADtB,AAAA;AAWA,MAAM/B,yCAA+B,GAAIoC,CAAAA,KAAD,GAAsC;IAC5E,MAAM,E,gBACJC,cADI,CAAA,E,UAEJC,QAFI,CAAA,EAGJC,IAAI,EAAEC,QAHF,CAAA,E,aAIJC,WAJI,CAAA,E,cAKJC,YALI,CAAA,SAMJC,KAAK,GAAG,KAARA,GANI,GAOFP,KAPJ,AAAM;IAQN,MAAMQ,WAAW,GAAGX,oCAAc,CAACI,cAAD,CAAlC,AAAA;IACA,MAAMQ,UAAU,GAAG/B,mBAAA,CAAgC,IAAhC,CAAnB,AAAA;IACA,MAAM,CAACiC,eAAD,EAAkBC,kBAAlB,CAAA,GAAwClC,qBAAA,CAAe,KAAf,CAA9C,AAAA;IACA,MAAM,CAACyB,IAAI,GAAG,KAAR,EAAeW,O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/src/index.ts","packages/react/popover/src/Popover.tsx"],"sourcesContent":["export {\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 extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode;\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"],"names":["createPopoverScope","Popover","PopoverAnchor","PopoverTrigger","PopoverPortal","PopoverContent","PopoverClose","PopoverArrow","Root","Anchor","Trigger","Portal","Content","Close","Arrow","React","composeEventHandlers","useComposedRefs","createContextScope","DismissableLayer","useFocusGuards","FocusScope","useId","PopperPrimitive","createPopperScope","PortalPrimitive","Presence","Primitive","Slot","useControllableState","hideOthers","RemoveScroll","POPOVER_NAME","createPopoverContext","usePopperScope","PopoverProvider","usePopoverContext","props","__scopePopover","children","open","openProp","defaultOpen","onOpenChange","modal","popperScope","triggerRef","useRef","hasCustomAnchor","setHasCustomAnchor","useState","setOpen","prop","defaultProp","onChange","useCallback","prevOpen","ANCHOR_NAME","forwardRef","forwardedRef","anchorProps","context","onCustomAnchorAdd","onCustomAnchorRemove","useEffect","TRIGGER_NAME","triggerProps","composedTriggerRef","trigger","contentId","getState","onClick","onOpenToggle","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","undefined","container","CONTENT_NAME","portalContext","contentProps","PopoverContentModal","contentRef","composedRefs","isRightClickOutsideRef","content","current","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","button","ctrlKey","isRightClick","checkForDefaultPrevented","onFocusOutside","PopoverContentNonModal","hasInteractedOutsideRef","hasPointerDownOutsideRef","defaultPrevented","onInteractOutside","type","target","targetIsTrigger","contains","PopoverContentImpl","trapFocus","onOpenAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","style","CLOSE_NAME","closeProps","ARROW_NAME","arrowProps"],"version":3,"file":"index.js.map"}
@@ -202,6 +202,7 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ $am6gm$forwardRe
202
202
  const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ $am6gm$forwardRef((props, forwardedRef)=>{
203
203
  const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
204
204
  const hasInteractedOutsideRef = $am6gm$useRef(false);
205
+ const hasPointerDownOutsideRef = $am6gm$useRef(false);
205
206
  return /*#__PURE__*/ $am6gm$createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, $am6gm$babelruntimehelpersesmextends({}, props, {
206
207
  ref: forwardedRef,
207
208
  trapFocus: false,
@@ -215,19 +216,24 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ $am6gm$forwar
215
216
  event.preventDefault();
216
217
  }
217
218
  hasInteractedOutsideRef.current = false;
219
+ hasPointerDownOutsideRef.current = false;
218
220
  },
219
221
  onInteractOutside: (event)=>{
220
222
  var _props$onInteractOuts, _context$triggerRef$c3;
221
223
  (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
222
- if (!event.defaultPrevented) hasInteractedOutsideRef.current = true; // Prevent dismissing when clicking the trigger.
224
+ if (!event.defaultPrevented) {
225
+ hasInteractedOutsideRef.current = true;
226
+ if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true;
227
+ } // Prevent dismissing when clicking the trigger.
223
228
  // As the trigger is already setup to close, without doing so would
224
229
  // cause it to close and immediately open.
225
- //
226
- // We use `onInteractOutside` as some browsers also
227
- // focus on pointer down, creating the same issue.
228
230
  const target = event.target;
229
231
  const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
230
- if (targetIsTrigger) event.preventDefault();
232
+ if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked
233
+ // we will get the pointer down outside event on the trigger, but then a subsequent
234
+ // focus outside event on the container, we ignore any focus outside event when we've
235
+ // already had a pointer down outside event.
236
+ if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault();
231
237
  }
232
238
  }));
233
239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CAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,SAASW,8BAAT,CAAkB9B,IAAlB,EAAiC;IAC/B,OAAOA,IAAI,GAAG,MAAH,GAAY,QAAvB,CAAA;CACD;AAED,MAAMhC,yCAAI,GAAGP,yCAAb,AAAA;AACA,MAAMQ,yCAAM,GAAGP,yCAAf,AAAA;AACA,MAAMQ,yCAAO,GAAGP,wCAAhB,AAAA;AACA,MAAMQ,yCAAM,GAAGP,yCAAf,AAAA;AACA,MAAMQ,yCAAO,GAAGP,yCAAhB,AAAA;AACA,MAAMQ,yCAAK,GAAGP,yCAAd,AAAA;AACA,MAAMQ,yCAAK,GAAGP,yCAAd,AAAA;;ADneA","sources":["packages/react/popover/src/index.ts","packages/react/popover/src/Popover.tsx"],"sourcesContent":["export {\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 extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode;\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\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 }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) hasInteractedOutsideRef.current = true;\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 //\n // We use `onInteractOutside` as some browsers also\n // focus on pointer down, creating the same issue.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\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"],"names":["createPopoverScope","Popover","PopoverAnchor","PopoverTrigger","PopoverPortal","PopoverContent","PopoverClose","PopoverArrow","Root","Anchor","Trigger","Portal","Content","Close","Arrow","React","composeEventHandlers","useComposedRefs","createContextScope","DismissableLayer","useFocusGuards","FocusScope","useId","PopperPrimitive","createPopperScope","PortalPrimitive","Presence","Primitive","Slot","useControllableState","hideOthers","RemoveScroll","POPOVER_NAME","createPopoverContext","usePopperScope","PopoverProvider","usePopoverContext","props","__scopePopover","children","open","openProp","defaultOpen","onOpenChange","modal","popperScope","triggerRef","useRef","hasCustomAnchor","setHasCustomAnchor","useState","setOpen","prop","defaultProp","onChange","useCallback","prevOpen","ANCHOR_NAME","forwardRef","forwardedRef","anchorProps","context","onCustomAnchorAdd","onCustomAnchorRemove","useEffect","TRIGGER_NAME","triggerProps","composedTriggerRef","trigger","contentId","getState","onClick","onOpenToggle","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","undefined","container","CONTENT_NAME","portalContext","contentProps","PopoverContentModal","contentRef","composedRefs","isRightClickOutsideRef","content","current","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","button","ctrlKey","isRightClick","checkForDefaultPrevented","onFocusOutside","PopoverContentNonModal","hasInteractedOutsideRef","defaultPrevented","onInteractOutside","target","targetIsTrigger","contains","PopoverContentImpl","trapFocus","onOpenAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","style","CLOSE_NAME","closeProps","ARROW_NAME","arrowProps"],"version":3,"file":"index.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;A;;;;;;;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iF,UAAH,EAAlB,GAAoClF,KAA1C,AAAM;IACN,MAAMQ,WAAW,GAAGX,oCAAc,CAACI,cAAD,CAAlC,AAAA;IACA,OAAA,aAAO,CAAA,oBAAA,CAAC,YAAD,EAAA,oCAAA,CAAA,EAAA,EAA2BO,WAA3B,EAA4C0E,UAA5C,EAAP;QAA+D,GAAG,EAAE5D,YAAL;KAAxD,CAAA,CAAP,CAAO;CAJU,CAArB,AAKG;AAGH,aAAA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAAA,gCAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,SAASW,8BAAT,CAAkB9B,IAAlB,EAAiC;IAC/B,OAAOA,IAAI,GAAG,MAAH,GAAY,QAAvB,CAAA;CACD;AAED,MAAMhC,yCAAI,GAAGP,yCAAb,AAAA;AACA,MAAMQ,yCAAM,GAAGP,yCAAf,AAAA;AACA,MAAMQ,yCAAO,GAAGP,wCAAhB,AAAA;AACA,MAAMQ,yCAAM,GAAGP,yCAAf,AAAA;AACA,MAAMQ,yCAAO,GAAGP,yCAAhB,AAAA;AACA,MAAMQ,yCAAK,GAAGP,yCAAd,AAAA;AACA,MAAMQ,yCAAK,GAAGP,yCAAd,AAAA;;AD/eA","sources":["packages/react/popover/src/index.ts","packages/react/popover/src/Popover.tsx"],"sourcesContent":["export {\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 extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode;\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"],"names":["createPopoverScope","Popover","PopoverAnchor","PopoverTrigger","PopoverPortal","PopoverContent","PopoverClose","PopoverArrow","Root","Anchor","Trigger","Portal","Content","Close","Arrow","React","composeEventHandlers","useComposedRefs","createContextScope","DismissableLayer","useFocusGuards","FocusScope","useId","PopperPrimitive","createPopperScope","PortalPrimitive","Presence","Primitive","Slot","useControllableState","hideOthers","RemoveScroll","POPOVER_NAME","createPopoverContext","usePopperScope","PopoverProvider","usePopoverContext","props","__scopePopover","children","open","openProp","defaultOpen","onOpenChange","modal","popperScope","triggerRef","useRef","hasCustomAnchor","setHasCustomAnchor","useState","setOpen","prop","defaultProp","onChange","useCallback","prevOpen","ANCHOR_NAME","forwardRef","forwardedRef","anchorProps","context","onCustomAnchorAdd","onCustomAnchorRemove","useEffect","TRIGGER_NAME","triggerProps","composedTriggerRef","trigger","contentId","getState","onClick","onOpenToggle","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","undefined","container","CONTENT_NAME","portalContext","contentProps","PopoverContentModal","contentRef","composedRefs","isRightClickOutsideRef","content","current","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","button","ctrlKey","isRightClick","checkForDefaultPrevented","onFocusOutside","PopoverContentNonModal","hasInteractedOutsideRef","hasPointerDownOutsideRef","defaultPrevented","onInteractOutside","type","target","targetIsTrigger","contains","PopoverContentImpl","trapFocus","onOpenAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","style","CLOSE_NAME","closeProps","ARROW_NAME","arrowProps"],"version":3,"file":"index.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-popover",
3
- "version": "1.0.6-rc.3",
3
+ "version": "1.0.6-rc.5",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "@radix-ui/react-focus-guards": "1.0.0",
25
25
  "@radix-ui/react-focus-scope": "1.0.2",
26
26
  "@radix-ui/react-id": "1.0.0",
27
- "@radix-ui/react-popper": "1.1.2-rc.3",
27
+ "@radix-ui/react-popper": "1.1.2-rc.5",
28
28
  "@radix-ui/react-portal": "1.0.2",
29
29
  "@radix-ui/react-presence": "1.0.0",
30
30
  "@radix-ui/react-primitive": "1.0.2",