@tamagui/popover 3.0.0-beta.924.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"useFloatingContext.js","names":[],"sources":["esm/useFloatingContext.js"],"sourcesContent":["import React from \"react\";\nimport {\n createFloatingEvents,\n safePolygon,\n useDelayGroup,\n useFloatingRaw,\n useFocus,\n useHover,\n useInteractions,\n useRole,\n PopupTriggerMap\n} from \"@tamagui/floating\";\nconst useFloatingContext = ({\n open,\n setOpen,\n disable,\n disableFocus,\n hoverable,\n role: roleProp = \"dialog\",\n focus: focusProp,\n groupId,\n delay: delayProp,\n restMs: restMsProp\n}) => {\n \"use no memo\";\n const openRef = React.useRef(open);\n openRef.current = open;\n const hoverableRef = React.useRef(hoverable);\n hoverableRef.current = hoverable;\n const disableRef = React.useRef(disable);\n disableRef.current = disable;\n const disableFocusRef = React.useRef(disableFocus);\n disableFocusRef.current = disableFocus;\n const roleRef = React.useRef(roleProp);\n roleRef.current = roleProp;\n const focusRef = React.useRef(focusProp);\n focusRef.current = focusProp;\n const groupIdRef = React.useRef(groupId);\n groupIdRef.current = groupId;\n const delayRef = React.useRef(delayProp);\n delayRef.current = delayProp;\n const restMsRef = React.useRef(restMsProp);\n restMsRef.current = restMsProp;\n const events = React.useMemo(() => createFloatingEvents(), []);\n const triggerElements = React.useMemo(() => new PopupTriggerMap(), []);\n React.useEffect(() => {\n events.emit(\"openchange\", { open });\n }, [open, events]);\n return React.useCallback(\n (props) => {\n const onTriggerRef = React.useRef(false);\n const restTimerRef = React.useRef(void 0);\n const graceRef = React.useRef(void 0);\n const pendingCloseRef = React.useRef(false);\n const isOverFloatingRef = React.useRef(false);\n const handleCloseActiveRef = React.useRef(false);\n React.useEffect(() => {\n return () => {\n clearTimeout(restTimerRef.current);\n clearTimeout(graceRef.current);\n };\n }, []);\n const onOpenChange = (val, event) => {\n if (val && event?.type === \"mouseenter\") {\n return;\n }\n if (!val && onTriggerRef.current && (event?.type === \"mousemove\" || event?.type === \"mouseleave\")) {\n pendingCloseRef.current = true;\n return;\n }\n const type = event?.type === \"mousemove\" || event?.type === \"mouseenter\" || event?.type === \"mouseleave\" ? \"hover\" : \"press\";\n setOpen(val, type);\n };\n const floating = useFloatingRaw({ ...props, open: openRef.current });\n const currentHoverable = hoverableRef.current;\n const dataRef = React.useRef({});\n dataRef.current.placement = floating.placement;\n const floatingRefs = floating.refs;\n const nullRef = { current: null };\n const interactionContext = {\n open: openRef.current,\n onOpenChange,\n refs: {\n reference: floatingRefs?.reference || nullRef,\n floating: floatingRefs?.floating || nullRef,\n domReference: floatingRefs?.reference || nullRef\n },\n elements: {\n get reference() {\n return floatingRefs?.reference?.current || null;\n },\n get floating() {\n return floatingRefs?.floating?.current || null;\n },\n get domReference() {\n return floatingRefs?.reference?.current || null;\n }\n },\n dataRef,\n events,\n triggerElements,\n handleCloseActiveRef\n };\n const { delay: groupDelay, currentId: groupCurrentId } = useDelayGroup(\n interactionContext,\n { id: groupIdRef.current }\n );\n const isInActiveGroup = groupIdRef.current && groupCurrentId != null && typeof groupDelay === \"object\";\n let delay;\n let restMs;\n if (isInActiveGroup) {\n delay = groupDelay;\n restMs = 0;\n } else if (delayRef.current !== void 0) {\n delay = delayRef.current;\n restMs = restMsRef.current ?? 0;\n } else {\n delay = currentHoverable && typeof currentHoverable === \"object\" ? currentHoverable.delay ?? 0 : 0;\n restMs = currentHoverable && typeof currentHoverable === \"object\" ? currentHoverable.restMs ?? 0 : 0;\n }\n const currentRole = roleRef.current;\n const currentFocus = focusRef.current;\n const { getReferenceProps, getFloatingProps: getFloatingPropsInner } = useInteractions([\n currentHoverable ? useHover(interactionContext, {\n enabled: !disableRef.current && !!currentHoverable,\n delay,\n restMs,\n handleClose: safePolygon({\n requireIntent: true,\n buffer: 1,\n __debug: typeof window !== \"undefined\" && new URLSearchParams(window.location.search).get(\"debug\") === \"safePolygon\"\n }),\n ...typeof currentHoverable === \"object\" && currentHoverable\n }) : useHover(interactionContext, {\n enabled: false\n }),\n useFocus(interactionContext, {\n enabled: !disableRef.current && !disableFocusRef.current,\n visibleOnly: true,\n ...currentFocus\n }),\n useRole(interactionContext, { role: currentRole })\n ]);\n const getFloatingProps = currentHoverable ? (userProps) => {\n const merged = getFloatingPropsInner(userProps);\n const origEnter = merged.onMouseEnter;\n const origLeave = merged.onMouseLeave;\n return {\n ...merged,\n onMouseEnter: (e) => {\n isOverFloatingRef.current = true;\n origEnter?.(e);\n },\n onMouseLeave: (e) => {\n isOverFloatingRef.current = false;\n origLeave?.(e);\n }\n };\n } : getFloatingPropsInner;\n const openDelay = typeof delay === \"number\" ? delay : delay?.open ?? 0;\n const closeDelay = typeof delay === \"number\" ? delay : delay?.close ?? 0;\n const setOpenWithDelay = () => {\n clearTimeout(restTimerRef.current);\n if (restMs && !openDelay) {\n restTimerRef.current = setTimeout(() => {\n setOpen(true, \"hover\");\n }, restMs);\n } else if (openDelay) {\n restTimerRef.current = setTimeout(() => {\n setOpen(true, \"hover\");\n }, openDelay);\n } else {\n setOpen(true, \"hover\");\n }\n };\n return {\n ...floating,\n open: openRef.current,\n triggerElements,\n getReferenceProps,\n getFloatingProps,\n onHoverReference: currentHoverable ? (_event) => {\n clearTimeout(graceRef.current);\n onTriggerRef.current = true;\n pendingCloseRef.current = false;\n clearTimeout(restTimerRef.current);\n if (openRef.current) return;\n setOpenWithDelay();\n } : void 0,\n onLeaveReference: currentHoverable ? () => {\n clearTimeout(restTimerRef.current);\n clearTimeout(graceRef.current);\n graceRef.current = setTimeout(() => {\n onTriggerRef.current = false;\n if (pendingCloseRef.current) {\n pendingCloseRef.current = false;\n setOpen(false, \"hover\");\n return;\n }\n if (openRef.current) {\n graceRef.current = setTimeout(\n () => {\n if (openRef.current && !isOverFloatingRef.current && !handleCloseActiveRef.current) {\n setOpen(false, \"hover\");\n }\n },\n Math.max(250, closeDelay)\n );\n }\n }, 40);\n } : void 0\n };\n },\n [setOpen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OAAO,IAAI,WAAW;IACpB,aAAa,UAAU,iBAAiB;KACtC,QAAQ,MAAM,OAAO;IACvB,GAAG,SAAS;GACd,OAAO;IACL,QAAQ,MAAM,OAAO;GACvB;EACF;EACA,OAAO;GACL,GAAG;GACH,MAAM,QAAQ;GACd;GACA;GACA;GACA,kBAAkB,oBAAoB,WAAW;IAC/C,aAAa,SAAS,OAAO;IAC7B,aAAa,UAAU;IACvB,gBAAgB,UAAU;IAC1B,aAAa,aAAa,OAAO;IACjC,IAAI,QAAQ,SAAS;IACrB,iBAAiB;GACnB,IAAI,KAAK;GACT,kBAAkB,yBAAyB;IACzC,aAAa,aAAa,OAAO;IACjC,aAAa,SAAS,OAAO;IAC7B,SAAS,UAAU,iBAAiB;KAClC,aAAa,UAAU;KACvB,IAAI,gBAAgB,SAAS;MAC3B,gBAAgB,UAAU;MAC1B,QAAQ,OAAO,OAAO;MACtB;KACF;KACA,IAAI,QAAQ,SAAS;MACnB,SAAS,UAAU,iBACX;OACJ,IAAI,QAAQ,WAAW,CAAC,kBAAkB,WAAW,CAAC,qBAAqB,SAAS;QAClF,QAAQ,OAAO,OAAO;OACxB;MACF,GACA,KAAK,IAAI,KAAK,UAAU,CAC1B;KACF;IACF,GAAG,EAAE;GACP,IAAI,KAAK;EACX;CACF,GACA,CAAC,OAAO,CACV;AACF"}
1
+ {"version":3,"file":"useFloatingContext.js","names":[],"sources":["esm/useFloatingContext.js"],"sourcesContent":["import React from \"react\";\nimport {\n createFloatingEvents,\n safePolygon,\n useDelayGroup,\n useFloatingRaw,\n useFocus,\n useHover,\n useInteractions,\n useRole,\n PopupTriggerMap\n} from \"@tamagui/floating\";\nconst useFloatingContext = ({\n open,\n setOpen,\n disable,\n disableFocus,\n hoverable,\n role: roleProp = \"dialog\",\n focus: focusProp,\n groupId,\n delay: delayProp,\n restMs: restMsProp,\n closeReasonRef\n}) => {\n \"use no memo\";\n const openRef = React.useRef(open);\n openRef.current = open;\n const hoverableRef = React.useRef(hoverable);\n hoverableRef.current = hoverable;\n const disableRef = React.useRef(disable);\n disableRef.current = disable;\n const disableFocusRef = React.useRef(disableFocus);\n disableFocusRef.current = disableFocus;\n const roleRef = React.useRef(roleProp);\n roleRef.current = roleProp;\n const focusRef = React.useRef(focusProp);\n focusRef.current = focusProp;\n const groupIdRef = React.useRef(groupId);\n groupIdRef.current = groupId;\n const delayRef = React.useRef(delayProp);\n delayRef.current = delayProp;\n const restMsRef = React.useRef(restMsProp);\n restMsRef.current = restMsProp;\n const events = React.useMemo(() => createFloatingEvents(), []);\n const triggerElements = React.useMemo(() => new PopupTriggerMap(), []);\n React.useEffect(() => {\n const reason = closeReasonRef?.current;\n if (closeReasonRef) {\n closeReasonRef.current = void 0;\n }\n events.emit(\"openchange\", { open, reason: open ? void 0 : reason });\n }, [open, events, closeReasonRef]);\n return React.useCallback(\n (props) => {\n const onTriggerRef = React.useRef(false);\n const restTimerRef = React.useRef(void 0);\n const graceRef = React.useRef(void 0);\n const pendingCloseRef = React.useRef(false);\n const isOverFloatingRef = React.useRef(false);\n const handleCloseActiveRef = React.useRef(false);\n React.useEffect(() => {\n return () => {\n clearTimeout(restTimerRef.current);\n clearTimeout(graceRef.current);\n };\n }, []);\n const onOpenChange = (val, event, reason) => {\n if (val && event?.type === \"mouseenter\") {\n return;\n }\n if (!val && onTriggerRef.current && (event?.type === \"mousemove\" || event?.type === \"mouseleave\")) {\n pendingCloseRef.current = true;\n return;\n }\n const type = event?.type === \"mousemove\" || event?.type === \"mouseenter\" || event?.type === \"mouseleave\" ? \"hover\" : \"press\";\n if (closeReasonRef) closeReasonRef.current = reason;\n setOpen(val, type);\n };\n const floating = useFloatingRaw({ ...props, open: openRef.current });\n const currentHoverable = hoverableRef.current;\n const dataRef = React.useRef({});\n dataRef.current.placement = floating.placement;\n const floatingRefs = floating.refs;\n const nullRef = { current: null };\n const interactionContext = {\n open: openRef.current,\n onOpenChange,\n refs: {\n reference: floatingRefs?.reference || nullRef,\n floating: floatingRefs?.floating || nullRef,\n domReference: floatingRefs?.reference || nullRef\n },\n elements: {\n get reference() {\n return floatingRefs?.reference?.current || null;\n },\n get floating() {\n return floatingRefs?.floating?.current || null;\n },\n get domReference() {\n return floatingRefs?.reference?.current || null;\n }\n },\n dataRef,\n events,\n triggerElements,\n handleCloseActiveRef\n };\n const { delay: groupDelay, currentId: groupCurrentId } = useDelayGroup(\n interactionContext,\n { id: groupIdRef.current }\n );\n const isInActiveGroup = groupIdRef.current && groupCurrentId != null && typeof groupDelay === \"object\";\n let delay;\n let restMs;\n if (isInActiveGroup) {\n delay = groupDelay;\n restMs = 0;\n } else if (delayRef.current !== void 0) {\n delay = delayRef.current;\n restMs = restMsRef.current ?? 0;\n } else {\n delay = currentHoverable && typeof currentHoverable === \"object\" ? currentHoverable.delay ?? 0 : 0;\n restMs = currentHoverable && typeof currentHoverable === \"object\" ? currentHoverable.restMs ?? 0 : 0;\n }\n const currentRole = roleRef.current;\n const currentFocus = focusRef.current;\n const { getReferenceProps, getFloatingProps: getFloatingPropsInner } = useInteractions([\n currentHoverable ? useHover(interactionContext, {\n enabled: !disableRef.current && !!currentHoverable,\n delay,\n restMs,\n handleClose: safePolygon({\n requireIntent: true,\n buffer: 1,\n __debug: typeof window !== \"undefined\" && new URLSearchParams(window.location.search).get(\"debug\") === \"safePolygon\"\n }),\n ...typeof currentHoverable === \"object\" && currentHoverable\n }) : useHover(interactionContext, {\n enabled: false\n }),\n useFocus(interactionContext, {\n enabled: !disableRef.current && !disableFocusRef.current,\n visibleOnly: true,\n ...currentFocus\n }),\n useRole(interactionContext, { role: currentRole })\n ]);\n const getFloatingProps = currentHoverable ? (userProps) => {\n const merged = getFloatingPropsInner(userProps);\n const origEnter = merged.onMouseEnter;\n const origLeave = merged.onMouseLeave;\n return {\n ...merged,\n onMouseEnter: (e) => {\n isOverFloatingRef.current = true;\n origEnter?.(e);\n },\n onMouseLeave: (e) => {\n isOverFloatingRef.current = false;\n origLeave?.(e);\n }\n };\n } : getFloatingPropsInner;\n const openDelay = typeof delay === \"number\" ? delay : delay?.open ?? 0;\n const closeDelay = typeof delay === \"number\" ? delay : delay?.close ?? 0;\n const setOpenWithDelay = () => {\n clearTimeout(restTimerRef.current);\n if (restMs && !openDelay) {\n restTimerRef.current = setTimeout(() => {\n setOpen(true, \"hover\");\n }, restMs);\n } else if (openDelay) {\n restTimerRef.current = setTimeout(() => {\n setOpen(true, \"hover\");\n }, openDelay);\n } else {\n setOpen(true, \"hover\");\n }\n };\n return {\n ...floating,\n open: openRef.current,\n triggerElements,\n getReferenceProps,\n getFloatingProps,\n onHoverReference: currentHoverable ? (_event) => {\n clearTimeout(graceRef.current);\n onTriggerRef.current = true;\n pendingCloseRef.current = false;\n clearTimeout(restTimerRef.current);\n if (openRef.current) return;\n setOpenWithDelay();\n } : void 0,\n onLeaveReference: currentHoverable ? () => {\n clearTimeout(restTimerRef.current);\n clearTimeout(graceRef.current);\n graceRef.current = setTimeout(() => {\n onTriggerRef.current = false;\n if (pendingCloseRef.current) {\n pendingCloseRef.current = false;\n setOpen(false, \"hover\");\n return;\n }\n if (openRef.current) {\n graceRef.current = setTimeout(\n () => {\n if (openRef.current && !isOverFloatingRef.current && !handleCloseActiveRef.current) {\n setOpen(false, \"hover\");\n }\n },\n Math.max(250, closeDelay)\n );\n }\n }, 40);\n } : void 0\n };\n },\n [setOpen, closeReasonRef]\n );\n};\nexport {\n useFloatingContext\n};\n//# sourceMappingURL=useFloatingContext.js.map\n"],"mappings":";;;;AAYA,MAAM,sBAAsB,EAC1B,MACA,SACA,SACA,cACA,WACA,MAAM,WAAW,UACjB,OAAO,WACP,SACA,OAAO,WACP,QAAQ,YACR,qBACI;CACJ;CACA,MAAM,UAAU,MAAM,OAAO,IAAI;CACjC,QAAQ,UAAU;CAClB,MAAM,eAAe,MAAM,OAAO,SAAS;CAC3C,aAAa,UAAU;CACvB,MAAM,aAAa,MAAM,OAAO,OAAO;CACvC,WAAW,UAAU;CACrB,MAAM,kBAAkB,MAAM,OAAO,YAAY;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AAO;IAC7B,aAAa,UAAU;IACvB,gBAAgB,UAAU;IAC1B,aAAa,aAAa,OAAO;IACjC,IAAI,QAAQ,SAAS;IACrB,iBAAiB;GACnB,IAAI,KAAK;GACT,kBAAkB,yBAAyB;IACzC,aAAa,aAAa,OAAO;IACjC,aAAa,SAAS,OAAO;IAC7B,SAAS,UAAU,iBAAiB;KAClC,aAAa,UAAU;KACvB,IAAI,gBAAgB,SAAS;MAC3B,gBAAgB,UAAU;MAC1B,QAAQ,OAAO,OAAO;MACtB;KACF;KACA,IAAI,QAAQ,SAAS;MACnB,SAAS,UAAU,iBACX;OACJ,IAAI,QAAQ,WAAW,CAAC,kBAAkB,WAAW,CAAC,qBAAqB,SAAS;QAClF,QAAQ,OAAO,OAAO;OACxB;MACF,GACA,KAAK,IAAI,KAAK,UAAU,CAC1B;KACF;IACF,GAAG,EAAE;GACP,IAAI,KAAK;EACX;CACF,GACA,CAAC,SAAS,cAAc,CAC1B;AACF"}
@@ -8,7 +8,7 @@ import { Dismissable, DismissableBranch } from "@tamagui/dismissable";
8
8
  import { FloatingOverrideContext } from "@tamagui/floating";
9
9
  import { FocusScope, FocusScopeController } from "@tamagui/focus-scope";
10
10
  import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
11
- import { Popper, PopperAnchor, PopperArrow, PopperArrowFrame, PopperContent, PopperContentFrame, PopperProvider, usePopperContext } from "@tamagui/popper";
11
+ import { Popper, PopperAnchor, PopperArrow, PopperArrowFrame, PopperContent, PopperContentFrame, PopperProvider, usePopperContext, usePopperContextSlow } from "@tamagui/popper";
12
12
  import { Portal, needsPortalRepropagation } from "@tamagui/portal";
13
13
  import { RemoveScroll } from "@tamagui/remove-scroll";
14
14
  import { ScrollView } from "@tamagui/scroll-view";
@@ -77,7 +77,7 @@ function usePopoverTriggerSetup(open) {
77
77
  unregisterTrigger
78
78
  };
79
79
  }
80
- const PopoverContextProvider = React.memo(({ scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = "", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable }) => {
80
+ const PopoverContextProvider = React.memo(({ scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = "", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable, closeReasonRef }) => {
81
81
  const [branches] = React.useState(() => /* @__PURE__ */ new Set());
82
82
  const { setActiveTrigger, registerTrigger, unregisterTrigger } = usePopoverTriggerSetup(open);
83
83
  return /* @__PURE__ */ jsx(PopoverContext.Provider, {
@@ -99,6 +99,7 @@ const PopoverContextProvider = React.memo(({ scope, children, open, onOpenChange
99
99
  keepChildrenMounted,
100
100
  disableDismissable,
101
101
  hoverable,
102
+ closeReasonRef,
102
103
  children: /* @__PURE__ */ jsx(PopoverTriggerContext.Provider, {
103
104
  scope,
104
105
  triggerRef,
@@ -130,6 +131,7 @@ const PopoverAnchor = React.memo(createRefComponent(function PopoverAnchor2(prop
130
131
  const PopoverTrigger = React.memo(createRefComponent(function PopoverTrigger2(props, forwardedRef) {
131
132
  const { scope, disablePressTrigger, ...rest } = props;
132
133
  const triggerContext = usePopoverTriggerContext(scope);
134
+ const popperContext = usePopperContextSlow(scope);
133
135
  const triggerId = React.useId();
134
136
  const [open, setOpen] = React.useState(false);
135
137
  const anchorTo = triggerContext.anchorTo;
@@ -164,7 +166,13 @@ const PopoverTrigger = React.memo(createRefComponent(function PopoverTrigger2(pr
164
166
  }),
165
167
  onMouseEnter: composeEventHandlers(rest.onMouseEnter, activateSelf),
166
168
  onPressIn: composeEventHandlers(rest.onPressIn, activateSelf),
167
- onFocus: composeEventHandlers(rest.onFocus, activateSelf)
169
+ onFocus: composeEventHandlers(rest.onFocus, (event) => {
170
+ activateSelf();
171
+ popperContext.getReferenceProps?.({ ref: triggerElRef }).onFocus?.(event);
172
+ }),
173
+ onBlur: composeEventHandlers(rest.onBlur, (event) => {
174
+ popperContext.getReferenceProps?.({ ref: triggerElRef }).onBlur?.(event);
175
+ })
168
176
  });
169
177
  const virtualRef = React.useMemo(() => {
170
178
  if (!anchorTo) return null;
@@ -329,7 +337,8 @@ const PopoverContentImpl = createRefComponent(function PopoverContentImpl2(props
329
337
  disable: context.breakpointActive,
330
338
  children
331
339
  });
332
- const handleDismiss = React.useCallback(() => {
340
+ const handleDismiss = React.useCallback((details) => {
341
+ if (context.closeReasonRef) context.closeReasonRef.current = details.reason === "escape-key" ? "escape-key" : "dismiss";
333
342
  context.onOpenChange(false, "press");
334
343
  }, [context]);
335
344
  if (!context.breakpointActive) {
@@ -413,6 +422,7 @@ const Popover = withStaticProperties(createRefComponent(function Popover2({ scop
413
422
  const adaptScope = `PopoverAdapt${scope}`;
414
423
  const { open: openProp, defaultOpen, onOpenChange } = props;
415
424
  const viaRef = React.useRef(void 0);
425
+ const closeReasonRef = React.useRef(void 0);
416
426
  const [open, setOpen] = useControllableState({
417
427
  prop: openProp,
418
428
  defaultProp: defaultOpen || false,
@@ -433,6 +443,7 @@ const Popover = withStaticProperties(createRefComponent(function Popover2({ scop
433
443
  }, [open, setOpen]);
434
444
  return /* @__PURE__ */ jsx(AdaptParent, {
435
445
  scope: adaptScope,
446
+ adaptChildren: props.children,
436
447
  open,
437
448
  onOpenChange: setOpen,
438
449
  children: /* @__PURE__ */ jsx(PopoverInner, {
@@ -443,6 +454,7 @@ const Popover = withStaticProperties(createRefComponent(function Popover2({ scop
443
454
  open,
444
455
  setOpen,
445
456
  handleOpenChange,
457
+ closeReasonRef,
446
458
  ...props
447
459
  })
448
460
  });
@@ -457,7 +469,7 @@ const Popover = withStaticProperties(createRefComponent(function Popover2({ scop
457
469
  FocusScope: FocusScopeController
458
470
  });
459
471
  const PopoverInner = createRefComponent(function PopoverInner2(props, forwardedRef) {
460
- const { children, open: _openProp, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus, disableDismissable, zIndex, id, adaptScope, open, setOpen, handleOpenChange, ...restProps } = props;
472
+ const { children, open: _openProp, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus = !hoverable, disableDismissable, zIndex, id, adaptScope, open, setOpen, handleOpenChange, closeReasonRef, ...restProps } = props;
461
473
  const triggerRef = React.useRef(null);
462
474
  const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
463
475
  const [keepChildrenMounted] = useControllableState({
@@ -469,6 +481,7 @@ const PopoverInner = createRefComponent(function PopoverInner2(props, forwardedR
469
481
  const floatingContext = useFloatingContext({
470
482
  open,
471
483
  setOpen: handleOpenChange,
484
+ closeReasonRef,
472
485
  disable: isAdapted,
473
486
  hoverable,
474
487
  disableFocus
@@ -485,6 +498,7 @@ const PopoverInner = createRefComponent(function PopoverInner2(props, forwardedR
485
498
  const contentId = React.useId();
486
499
  const onOpenToggle = useEvent(() => {
487
500
  if (open && isAdapted) return;
501
+ closeReasonRef.current = open ? "reference-press" : void 0;
488
502
  setOpen(!open);
489
503
  });
490
504
  const onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(true), []);
@@ -512,6 +526,7 @@ const PopoverInner = createRefComponent(function PopoverInner2(props, forwardedR
512
526
  keepChildrenMounted,
513
527
  disableDismissable,
514
528
  hoverable,
529
+ closeReasonRef,
515
530
  children
516
531
  })
517
532
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","names":[],"sources":["jsx/Popover.js"],"sourcesContent":["\nimport { Adapt, AdaptParent, AdaptPortalContents, ProvideAdaptContext, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { Animate } from \"@tamagui/animate\";\nimport { ResetPresence } from \"@tamagui/animate-presence\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { View, createRefComponent, createStyledContext, createStyledHOC, useCreateShallowSetState, useEvent } from \"@tamagui/core\";\nimport { Dismissable, DismissableBranch } from \"@tamagui/dismissable\";\nimport { FloatingOverrideContext } from \"@tamagui/floating\";\nimport { FocusScope, FocusScopeController } from \"@tamagui/focus-scope\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { Popper, PopperAnchor, PopperArrow, PopperArrowFrame, PopperContent, PopperContentFrame, PopperProvider, usePopperContext } from \"@tamagui/popper\";\nimport { Portal, needsPortalRepropagation } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { ScrollView } from \"@tamagui/scroll-view\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { useFloatingContext } from \"./useFloatingContext\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nconst needsRepropagation = needsPortalRepropagation();\nconst openPopovers = /* @__PURE__ */ new Set();\nconst hasOpenPopovers = () => {\n\treturn openPopovers.size > 0;\n};\nconst closeOpenPopovers = () => {\n\tif (openPopovers.size === 0) return false;\n\topenPopovers.forEach((setOpen) => setOpen(false));\n\treturn true;\n};\nconst closeLastOpenedPopover = () => {\n\tif (openPopovers.size === 0) return false;\n\tconst last = Array.from(openPopovers).pop();\n\tif (last) {\n\t\tlast(false);\n\t\treturn true;\n\t}\n\treturn false;\n};\nconst PopoverContext = createStyledContext({}, \"Popover__\");\nconst PopoverZIndexContext = React.createContext(void 0);\nconst PopoverTriggerContext = createStyledContext({}, \"PopoverTrigger__\");\nconst usePopoverContext = PopoverContext.useStyledContext;\nconst usePopoverTriggerContext = PopoverTriggerContext.useStyledContext;\nfunction usePopoverOpen(scope) {\n\treturn usePopoverContext(scope).open;\n}\nfunction usePopoverTriggerSetup(open) {\n\tconst triggerStateSettersRef = React.useRef(/* @__PURE__ */ new Map());\n\tconst activeTriggerIdRef = React.useRef(null);\n\tconst setActiveTrigger = useEvent((id) => {\n\t\tconst prevId = activeTriggerIdRef.current;\n\t\tif (prevId === id) return;\n\t\tif (prevId) triggerStateSettersRef.current.get(prevId)?.(false);\n\t\tactiveTriggerIdRef.current = id;\n\t\tif (id && open) triggerStateSettersRef.current.get(id)?.(true);\n\t});\n\tconst registerTrigger = useEvent((id, setOpenState) => {\n\t\ttriggerStateSettersRef.current.set(id, setOpenState);\n\t\tsetOpenState(activeTriggerIdRef.current === id && open);\n\t});\n\tconst unregisterTrigger = useEvent((id) => {\n\t\ttriggerStateSettersRef.current.delete(id);\n\t\tif (activeTriggerIdRef.current === id) activeTriggerIdRef.current = null;\n\t});\n\tReact.useEffect(() => {\n\t\tif (!open) {\n\t\t\tsetActiveTrigger(null);\n\t\t\treturn;\n\t\t}\n\t\tconst activeId = activeTriggerIdRef.current;\n\t\tif (activeId) triggerStateSettersRef.current.get(activeId)?.(true);\n\t}, [open, setActiveTrigger]);\n\treturn {\n\t\tsetActiveTrigger,\n\t\tregisterTrigger,\n\t\tunregisterTrigger\n\t};\n}\nconst PopoverContextProvider = React.memo(({ scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = \"\", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable }) => {\n\tconst [branches] = React.useState(() => /* @__PURE__ */ new Set());\n\tconst { setActiveTrigger, registerTrigger, unregisterTrigger } = usePopoverTriggerSetup(open);\n\treturn /* @__PURE__ */ jsx(PopoverContext.Provider, {\n\t\tscope,\n\t\tpopoverScope: scope,\n\t\tadaptScope,\n\t\tid,\n\t\tcontentId,\n\t\ttriggerRef,\n\t\topen,\n\t\tonOpenChange,\n\t\tonOpenToggle,\n\t\thasCustomAnchor,\n\t\tonCustomAnchorAdd,\n\t\tonCustomAnchorRemove,\n\t\tanchorTo,\n\t\tbranches,\n\t\tbreakpointActive,\n\t\tkeepChildrenMounted,\n\t\tdisableDismissable,\n\t\thoverable,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverTriggerContext.Provider, {\n\t\t\tscope,\n\t\t\ttriggerRef,\n\t\t\thasCustomAnchor,\n\t\t\tanchorTo,\n\t\t\tbranches,\n\t\t\tonOpenToggle,\n\t\t\tsetActiveTrigger,\n\t\t\tregisterTrigger,\n\t\t\tunregisterTrigger,\n\t\t\tchildren\n\t\t})\n\t});\n});\nconst voidFn = () => {};\nconst PopoverAnchor = React.memo(createRefComponent(function PopoverAnchor2(props, forwardedRef) {\n\tconst { scope, ...rest } = props;\n\tconst { onCustomAnchorAdd, onCustomAnchorRemove } = usePopoverContext(scope) || {};\n\tReact.useEffect(() => {\n\t\tonCustomAnchorAdd();\n\t\treturn () => onCustomAnchorRemove();\n\t}, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\treturn /* @__PURE__ */ jsx(PopperAnchor, {\n\t\tscope,\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n}));\nconst PopoverTrigger = React.memo(createRefComponent(function PopoverTrigger2(props, forwardedRef) {\n\tconst { scope, disablePressTrigger, ...rest } = props;\n\tconst triggerContext = usePopoverTriggerContext(scope);\n\tconst triggerId = React.useId();\n\tconst [open, setOpen] = React.useState(false);\n\tconst anchorTo = triggerContext.anchorTo;\n\tconst triggerElRef = React.useRef(null);\n\tconst composedTriggerRef = useComposedRefs(forwardedRef, triggerElRef);\n\tconst { registerTrigger, unregisterTrigger } = triggerContext;\n\tReact.useEffect(() => {\n\t\tregisterTrigger(triggerId, setOpen);\n\t\treturn () => {\n\t\t\tunregisterTrigger(triggerId);\n\t\t};\n\t}, [\n\t\tregisterTrigger,\n\t\tunregisterTrigger,\n\t\ttriggerId\n\t]);\n\tif (!rest.children) return null;\n\tconst activateSelf = () => {\n\t\ttriggerContext.setActiveTrigger(triggerId);\n\t\tconst el = triggerElRef.current;\n\t\tif (el) triggerContext.triggerRef.current = el;\n\t};\n\tconst trigger = /* @__PURE__ */ jsx(View, {\n\t\t\"aria-expanded\": open,\n\t\t\"data-state\": getState(open),\n\t\t...rest,\n\t\tref: composedTriggerRef,\n\t\tonPress: composeEventHandlers(rest.onPress, () => {\n\t\t\tif (disablePressTrigger) return;\n\t\t\ttriggerContext.setActiveTrigger(open ? null : triggerId);\n\t\t\ttriggerContext.onOpenToggle();\n\t\t}),\n\t\tonMouseEnter: composeEventHandlers(rest.onMouseEnter, activateSelf),\n\t\tonPressIn: composeEventHandlers(rest.onPressIn, activateSelf),\n\t\tonFocus: composeEventHandlers(rest.onFocus, activateSelf)\n\t});\n\tconst virtualRef = React.useMemo(() => {\n\t\tif (!anchorTo) return null;\n\t\treturn { current: {\n\t\t\tgetBoundingClientRect: () => isWeb ? DOMRect.fromRect(anchorTo) : anchorTo,\n\t\t\t...!isWeb && {\n\t\t\t\tmeasure: (c) => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height),\n\t\t\t\tmeasureInWindow: (c) => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height)\n\t\t\t}\n\t\t} };\n\t}, [\n\t\ttriggerContext.anchorTo,\n\t\tanchorTo?.x,\n\t\tanchorTo?.y,\n\t\tanchorTo?.height,\n\t\tanchorTo?.width\n\t]);\n\tconst wrappedTrigger = isWeb ? /* @__PURE__ */ jsx(DismissableBranch, {\n\t\tbranches: triggerContext.branches,\n\t\tchildren: trigger\n\t}) : trigger;\n\treturn triggerContext.hasCustomAnchor ? wrappedTrigger : /* @__PURE__ */ jsx(PopperAnchor, {\n\t\t...virtualRef && { virtualRef },\n\t\tscope,\n\t\tasChild: true,\n\t\tchildren: wrappedTrigger\n\t});\n}));\nconst PopoverContent = createStyledHOC(PopperContentFrame, function PopoverContent2(props, forwardedRef) {\n\tconst { trapFocus, enableRemoveScroll = false, zIndex: zIndexProp, scope, forceMount, ...contentImplProps } = props;\n\tconst context = usePopoverContext(scope);\n\tconst adaptContext = useAdaptContext(context.adaptScope);\n\tconst zIndexFromContext = React.useContext(PopoverZIndexContext);\n\tconst zIndex = zIndexProp ?? zIndexFromContext;\n\tconst open = usePopoverOpen(scope);\n\tconst composedRefs = useComposedRefs(forwardedRef, React.useRef(null));\n\tconst isRightClickOutsideRef = React.useRef(false);\n\tconst [isFullyHidden, setIsFullyHidden] = React.useState(!open);\n\tuseIsomorphicLayoutEffect(() => {\n\t\tif (open && isFullyHidden) setIsFullyHidden(false);\n\t}, [open, isFullyHidden]);\n\tif (!forceMount && !context.keepChildrenMounted) {\n\t\tif (context.breakpointActive) {\n\t\t\tif (!open && adaptContext.targetFullyHidden) return null;\n\t\t} else if (isFullyHidden && !open) return null;\n\t}\n\treturn /* @__PURE__ */ jsx(PopoverPortal, {\n\t\tpassThrough: context.breakpointActive,\n\t\tcontext,\n\t\topen,\n\t\tvisuallyActive: open || !isFullyHidden,\n\t\tzIndex,\n\t\tchildren: /* @__PURE__ */ jsx(View, {\n\t\t\tpassThrough: context.breakpointActive,\n\t\t\tpointerEvents: open ? contentImplProps.pointerEvents ?? \"auto\" : \"none\",\n\t\t\tchildren: /* @__PURE__ */ jsx(PopoverContentImpl, {\n\t\t\t\t...contentImplProps,\n\t\t\t\tcontext,\n\t\t\t\topen,\n\t\t\t\tforceMount,\n\t\t\t\tenableRemoveScroll,\n\t\t\t\tref: composedRefs,\n\t\t\t\tsetIsFullyHidden,\n\t\t\t\tscope,\n\t\t\t\ttrapFocus: trapFocus ?? open,\n\t\t\t\tdisableOutsidePointerEvents: true,\n\t\t\t\tonCloseAutoFocus: props.onCloseAutoFocus === false ? void 0 : composeEventHandlers(props.onCloseAutoFocus, (event) => {\n\t\t\t\t\tif (event.isCanceled) return;\n\t\t\t\t\tevent.cancel();\n\t\t\t\t\tif (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();\n\t\t\t\t}),\n\t\t\t\tonPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n\t\t\t\t\tconst originalEvent = event.event;\n\t\t\t\t\tif (!originalEvent) return;\n\t\t\t\t\tconst ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n\t\t\t\t\tisRightClickOutsideRef.current = originalEvent.button === 2 || ctrlLeftClick;\n\t\t\t\t}, { checkDefaultPrevented: false }),\n\t\t\t\tonFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {\n\t\t\t\t\tif (trapFocus ?? open) event.cancel();\n\t\t\t\t}, { checkDefaultPrevented: false })\n\t\t\t})\n\t\t})\n\t});\n}, { staticConfig: { inlineProps: /* @__PURE__ */ new Set([\n\t...PopperContentFrame.staticConfig.inlineProps || [],\n\t\"zIndex\",\n\t\"opacity\",\n\t\"y\"\n]) } });\nconst useParentContexts = (scope) => {\n\tconst context = usePopoverContext(scope);\n\tconst triggerContext = usePopoverTriggerContext(scope);\n\treturn {\n\t\tpopperContext: usePopperContext(scope),\n\t\tadaptContext: useAdaptContext(context.adaptScope),\n\t\tcontext,\n\t\ttriggerContext\n\t};\n};\nfunction RepropagateParentContexts({ adaptContext, children, context, triggerContext, popperContext }) {\n\treturn /* @__PURE__ */ jsx(PopperProvider, {\n\t\tscope: context.popoverScope,\n\t\t...popperContext,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverContext.Provider, {\n\t\t\tscope: context.popoverScope,\n\t\t\t...context,\n\t\t\tchildren: /* @__PURE__ */ jsx(PopoverTriggerContext.Provider, {\n\t\t\t\tscope: context.popoverScope,\n\t\t\t\t...triggerContext,\n\t\t\t\tchildren: /* @__PURE__ */ jsx(ProvideAdaptContext, {\n\t\t\t\t\t...adaptContext,\n\t\t\t\t\tchildren\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t});\n}\nconst PortalAdaptSafe = ({ children, context }) => {\n\t\"use no memo\";\n\tif (needsRepropagation) {\n\t\tconst parentContexts = useParentContexts(context.popoverScope);\n\t\treturn /* @__PURE__ */ jsx(AdaptPortalContents, {\n\t\t\tscope: context.adaptScope,\n\t\t\tchildren: /* @__PURE__ */ jsx(RepropagateParentContexts, {\n\t\t\t\t...parentContexts,\n\t\t\t\tchildren\n\t\t\t})\n\t\t});\n\t}\n\treturn /* @__PURE__ */ jsx(AdaptPortalContents, {\n\t\tscope: context.adaptScope,\n\t\tchildren\n\t});\n};\nfunction PopoverPortal({ context, open, visuallyActive, zIndex, passThrough, children, onPress }) {\n\t\"use no memo\";\n\tlet content = children;\n\tif (needsRepropagation) content = /* @__PURE__ */ jsx(RepropagateParentContexts, {\n\t\t...useParentContexts(context.popoverScope),\n\t\tchildren: content\n\t});\n\treturn /* @__PURE__ */ jsxs(Portal, {\n\t\tpassThrough,\n\t\tstackZIndex: true,\n\t\tzIndex,\n\t\thidden: !visuallyActive,\n\t\tchildren: [!!open && !context.breakpointActive && !context.hoverable && /* @__PURE__ */ jsx(YStack, {\n\t\t\tposition: \"absolute\",\n\t\t\tinset: 0,\n\t\t\tonPress: composeEventHandlers(onPress, context.onOpenToggle)\n\t\t}), content]\n\t});\n}\nconst PopoverContentImpl = createRefComponent(function PopoverContentImpl2(props, forwardedRef) {\n\tconst { trapFocus, scope, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, disableFocusScope, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, children, enableRemoveScroll, freezeContentsWhenHidden, setIsFullyHidden, lazyMount, forceUnmount, forceMount, context, open, alwaysDisable, ...contentProps } = props;\n\tconst { disableDismissable } = context;\n\tconst keepChildrenMounted = context.keepChildrenMounted || forceMount;\n\tconst handleExitComplete = React.useCallback(() => {\n\t\tsetIsFullyHidden?.(true);\n\t}, [setIsFullyHidden]);\n\tlet contents = /* @__PURE__ */ jsx(ResetPresence, {\n\t\tdisable: context.breakpointActive,\n\t\tchildren\n\t});\n\tconst handleDismiss = React.useCallback(() => {\n\t\tcontext.onOpenChange(false, \"press\");\n\t}, [context]);\n\tif (!context.breakpointActive) {\n\t\tif (!alwaysDisable || !alwaysDisable.focus) contents = /* @__PURE__ */ jsx(FocusScope, {\n\t\t\tloop: trapFocus !== false,\n\t\t\tenabled: context.breakpointActive ? false : disableFocusScope ? false : open,\n\t\t\ttrapped: context.breakpointActive ? false : trapFocus,\n\t\t\tonMountAutoFocus: onOpenAutoFocus,\n\t\t\tonUnmountAutoFocus: onCloseAutoFocus === false ? void 0 : onCloseAutoFocus,\n\t\t\tchildren: contents\n\t\t});\n\t\tif (!alwaysDisable || !alwaysDisable[\"remove-scroll\"]) contents = /* @__PURE__ */ jsx(RemoveScroll, {\n\t\t\tenabled: context.breakpointActive ? false : enableRemoveScroll ? open : false,\n\t\t\tchildren: contents\n\t\t});\n\t\tif (!alwaysDisable || !alwaysDisable.dismiss) contents = /* @__PURE__ */ jsx(Dismissable, {\n\t\t\tbranches: context.branches,\n\t\t\tforceUnmount: disableDismissable || (forceUnmount ?? !open),\n\t\t\tonEscapeKeyDown,\n\t\t\tonPointerDownOutside,\n\t\t\tonFocusOutside,\n\t\t\tonInteractOutside,\n\t\t\tonDismiss: handleDismiss,\n\t\t\tchildren: contents\n\t\t});\n\t}\n\treturn /* @__PURE__ */ jsx(Animate, {\n\t\ttype: \"presence\",\n\t\tpresent: Boolean(open),\n\t\tkeepChildrenMounted: Boolean(keepChildrenMounted),\n\t\tonExitComplete: handleExitComplete,\n\t\tlazyMount,\n\t\tpassThrough: context.breakpointActive,\n\t\tchildren: /* @__PURE__ */ jsx(PopperContent, {\n\t\t\tscope,\n\t\t\t\"data-state\": getState(open),\n\t\t\tid: context.contentId,\n\t\t\tref: forwardedRef,\n\t\t\tpassThrough: context.breakpointActive,\n\t\t\t...contentProps,\n\t\t\tchildren: /* @__PURE__ */ jsx(PortalAdaptSafe, {\n\t\t\t\tcontext,\n\t\t\t\tchildren: contents\n\t\t\t})\n\t\t}, context.contentId)\n\t});\n});\nconst PopoverClose = createRefComponent(function PopoverClose2(props, forwardedRef) {\n\tconst { scope, className, ...rest } = props;\n\tconst context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ jsx(YStack, {\n\t\t...rest,\n\t\tref: forwardedRef,\n\t\tclassName: `is_PopoverClose ${className || \"\"}`.trim(),\n\t\tonPress: composeEventHandlers(props.onPress, () => context?.onOpenChange?.(false, \"press\"))\n\t});\n});\nconst PopoverArrow = createStyledHOC(PopperArrowFrame, function PopoverArrow2(props, forwardedRef) {\n\tconst { scope, className, ...rest } = props;\n\tif (useAdaptIsActive(usePopoverContext(scope).adaptScope)) return null;\n\treturn /* @__PURE__ */ jsx(PopperArrow, {\n\t\tscope,\n\t\tclassName: `is_PopoverArrow ${className || \"\"}`.trim(),\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n});\nconst PopoverScrollView = createRefComponent(({ scope, ...props }, ref) => {\n\tconst context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ jsx(ScrollView, {\n\t\tref,\n\t\tpointerEvents: context.breakpointActive ? \"none\" : void 0,\n\t\tscrollEnabled: !context.breakpointActive,\n\t\tpassThrough: context.breakpointActive,\n\t\t...props\n\t});\n});\nconst DEFAULT_SCOPE = \"\";\nconst Popover = withStaticProperties(createRefComponent(function Popover2({ scope = DEFAULT_SCOPE, ...props }, ref) {\n\tconst id = React.useId();\n\tconst adaptScope = `PopoverAdapt${scope}`;\n\tconst { open: openProp, defaultOpen, onOpenChange } = props;\n\tconst viaRef = React.useRef(void 0);\n\tconst [open, setOpen] = useControllableState({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen || false,\n\t\tonChange: (val) => {\n\t\t\tonOpenChange?.(val, viaRef.current);\n\t\t}\n\t});\n\tconst handleOpenChange = useEvent((val, via) => {\n\t\tviaRef.current = via;\n\t\tsetOpen(val);\n\t});\n\tReact.useEffect(() => {\n\t\tif (!open) return;\n\t\topenPopovers.add(setOpen);\n\t\treturn () => {\n\t\t\topenPopovers.delete(setOpen);\n\t\t};\n\t}, [open, setOpen]);\n\treturn /* @__PURE__ */ jsx(AdaptParent, {\n\t\tscope: adaptScope,\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverInner, {\n\t\t\tadaptScope,\n\t\t\tref,\n\t\t\tid,\n\t\t\tscope,\n\t\t\topen,\n\t\t\tsetOpen,\n\t\t\thandleOpenChange,\n\t\t\t...props\n\t\t})\n\t});\n}), {\n\tAnchor: PopoverAnchor,\n\tArrow: PopoverArrow,\n\tTrigger: PopoverTrigger,\n\tContent: PopoverContent,\n\tClose: PopoverClose,\n\tAdapt,\n\tScrollView: PopoverScrollView,\n\tFocusScope: FocusScopeController\n});\nconst PopoverInner = createRefComponent(function PopoverInner2(props, forwardedRef) {\n\tconst { children, open: _openProp, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus, disableDismissable, zIndex, id, adaptScope, open, setOpen, handleOpenChange, ...restProps } = props;\n\tconst triggerRef = React.useRef(null);\n\tconst [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n\tconst [keepChildrenMounted] = useControllableState({\n\t\tprop: keepChildrenMountedProp,\n\t\tdefaultProp: false,\n\t\ttransition: keepChildrenMountedProp === \"lazy\"\n\t});\n\tconst isAdapted = useAdaptIsActive(adaptScope);\n\tconst floatingContext = useFloatingContext({\n\t\topen,\n\t\tsetOpen: handleOpenChange,\n\t\tdisable: isAdapted,\n\t\thoverable,\n\t\tdisableFocus\n\t});\n\tconst [anchorTo, setAnchorToRaw] = React.useState();\n\tconst setAnchorTo = useCreateShallowSetState(setAnchorToRaw);\n\tReact.useImperativeHandle(forwardedRef, () => ({\n\t\tanchorTo: setAnchorTo,\n\t\ttoggle: () => setOpen((prev) => !prev),\n\t\topen: () => setOpen(true),\n\t\tclose: () => setOpen(false),\n\t\tsetOpen\n\t}));\n\tconst contentId = React.useId();\n\tconst onOpenToggle = useEvent(() => {\n\t\tif (open && isAdapted) return;\n\t\tsetOpen(!open);\n\t});\n\tconst onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(true), []);\n\tconst onCustomAnchorRemove = React.useCallback(() => setHasCustomAnchor(false), []);\n\tconst contents = /* @__PURE__ */ jsx(Popper, {\n\t\topen,\n\t\tpassThrough: isAdapted,\n\t\tscope,\n\t\tstayInFrame: true,\n\t\t...restProps,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverContextProvider, {\n\t\t\tscope,\n\t\t\topen,\n\t\t\tonOpenChange: handleOpenChange,\n\t\t\tonOpenToggle,\n\t\t\ttriggerRef,\n\t\t\tid,\n\t\t\tcontentId,\n\t\t\thasCustomAnchor,\n\t\t\tonCustomAnchorAdd,\n\t\t\tonCustomAnchorRemove,\n\t\t\tanchorTo,\n\t\t\tadaptScope,\n\t\t\tbreakpointActive: isAdapted,\n\t\t\tkeepChildrenMounted,\n\t\t\tdisableDismissable,\n\t\t\thoverable,\n\t\t\tchildren\n\t\t})\n\t});\n\tlet result = /* @__PURE__ */ jsx(Fragment, { children: isWeb ? /* @__PURE__ */ jsx(FloatingOverrideContext.Provider, {\n\t\tvalue: floatingContext,\n\t\tchildren: contents\n\t}) : contents });\n\tif (zIndex !== void 0) return /* @__PURE__ */ jsx(PopoverZIndexContext.Provider, {\n\t\tvalue: zIndex,\n\t\tchildren: result\n\t});\n\treturn result;\n});\nfunction getState(open) {\n\treturn open ? \"open\" : \"closed\";\n}\n\nexport { Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverContext, PopoverContextProvider, PopoverTrigger, PopoverTriggerContext, PopoverZIndexContext, closeLastOpenedPopover, closeOpenPopovers, hasOpenPopovers, usePopoverContext, usePopoverOpen, usePopoverTriggerContext, usePopoverTriggerSetup };"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,qBAAqB,yBAAyB;AACpD,MAAM,+BAA+B,IAAI,IAAI;AAC7C,MAAM,wBAAwB;CAC7B,OAAO,aAAa,OAAO;AAC5B;AACA,MAAM,0BAA0B;CAC/B,IAAI,aAAa,SAAS,GAAG,OAAO;CACpC,aAAa,SAAS,YAAY,QAAQ,KAAK,CAAC;CAChD,OAAO;A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ACA,cAAc;GACd;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,kBAAkB;GAClB;GACA;GACA;GACA;EACD,CAAC;CACF,CAAC;CACD,IAAI,SAAyB,oBAAI,UAAU,EAAE,UAAU,QAAwB,oBAAI,wBAAwB,UAAU;EACpH,OAAO;EACP,UAAU;CACX,CAAC,IAAI,SAAS,CAAC;CACf,IAAI,WAAW,KAAK,GAAG,OAAuB,oBAAI,qBAAqB,UAAU;EAChF,OAAO;EACP,UAAU;CACX,CAAC;CACD,OAAO;AACR,CAAC;AACD,SAAS,SAAS,MAAM;CACvB,OAAO,OAAO,SAAS;AACxB"}
1
+ {"version":3,"file":"Popover.js","names":[],"sources":["jsx/Popover.js"],"sourcesContent":["\nimport { Adapt, AdaptParent, AdaptPortalContents, ProvideAdaptContext, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { Animate } from \"@tamagui/animate\";\nimport { ResetPresence } from \"@tamagui/animate-presence\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { View, createRefComponent, createStyledContext, createStyledHOC, useCreateShallowSetState, useEvent } from \"@tamagui/core\";\nimport { Dismissable, DismissableBranch } from \"@tamagui/dismissable\";\nimport { FloatingOverrideContext } from \"@tamagui/floating\";\nimport { FocusScope, FocusScopeController } from \"@tamagui/focus-scope\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { Popper, PopperAnchor, PopperArrow, PopperArrowFrame, PopperContent, PopperContentFrame, PopperProvider, usePopperContext, usePopperContextSlow } from \"@tamagui/popper\";\nimport { Portal, needsPortalRepropagation } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { ScrollView } from \"@tamagui/scroll-view\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { useFloatingContext } from \"./useFloatingContext\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nconst needsRepropagation = needsPortalRepropagation();\nconst openPopovers = /* @__PURE__ */ new Set();\nconst hasOpenPopovers = () => {\n\treturn openPopovers.size > 0;\n};\nconst closeOpenPopovers = () => {\n\tif (openPopovers.size === 0) return false;\n\topenPopovers.forEach((setOpen) => setOpen(false));\n\treturn true;\n};\nconst closeLastOpenedPopover = () => {\n\tif (openPopovers.size === 0) return false;\n\tconst last = Array.from(openPopovers).pop();\n\tif (last) {\n\t\tlast(false);\n\t\treturn true;\n\t}\n\treturn false;\n};\nconst PopoverContext = createStyledContext({}, \"Popover__\");\nconst PopoverZIndexContext = React.createContext(void 0);\nconst PopoverTriggerContext = createStyledContext({}, \"PopoverTrigger__\");\nconst usePopoverContext = PopoverContext.useStyledContext;\nconst usePopoverTriggerContext = PopoverTriggerContext.useStyledContext;\nfunction usePopoverOpen(scope) {\n\treturn usePopoverContext(scope).open;\n}\nfunction usePopoverTriggerSetup(open) {\n\tconst triggerStateSettersRef = React.useRef(/* @__PURE__ */ new Map());\n\tconst activeTriggerIdRef = React.useRef(null);\n\tconst setActiveTrigger = useEvent((id) => {\n\t\tconst prevId = activeTriggerIdRef.current;\n\t\tif (prevId === id) return;\n\t\tif (prevId) triggerStateSettersRef.current.get(prevId)?.(false);\n\t\tactiveTriggerIdRef.current = id;\n\t\tif (id && open) triggerStateSettersRef.current.get(id)?.(true);\n\t});\n\tconst registerTrigger = useEvent((id, setOpenState) => {\n\t\ttriggerStateSettersRef.current.set(id, setOpenState);\n\t\tsetOpenState(activeTriggerIdRef.current === id && open);\n\t});\n\tconst unregisterTrigger = useEvent((id) => {\n\t\ttriggerStateSettersRef.current.delete(id);\n\t\tif (activeTriggerIdRef.current === id) activeTriggerIdRef.current = null;\n\t});\n\tReact.useEffect(() => {\n\t\tif (!open) {\n\t\t\tsetActiveTrigger(null);\n\t\t\treturn;\n\t\t}\n\t\tconst activeId = activeTriggerIdRef.current;\n\t\tif (activeId) triggerStateSettersRef.current.get(activeId)?.(true);\n\t}, [open, setActiveTrigger]);\n\treturn {\n\t\tsetActiveTrigger,\n\t\tregisterTrigger,\n\t\tunregisterTrigger\n\t};\n}\nconst PopoverContextProvider = React.memo(({ scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = \"\", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable, closeReasonRef }) => {\n\tconst [branches] = React.useState(() => /* @__PURE__ */ new Set());\n\tconst { setActiveTrigger, registerTrigger, unregisterTrigger } = usePopoverTriggerSetup(open);\n\treturn /* @__PURE__ */ jsx(PopoverContext.Provider, {\n\t\tscope,\n\t\tpopoverScope: scope,\n\t\tadaptScope,\n\t\tid,\n\t\tcontentId,\n\t\ttriggerRef,\n\t\topen,\n\t\tonOpenChange,\n\t\tonOpenToggle,\n\t\thasCustomAnchor,\n\t\tonCustomAnchorAdd,\n\t\tonCustomAnchorRemove,\n\t\tanchorTo,\n\t\tbranches,\n\t\tbreakpointActive,\n\t\tkeepChildrenMounted,\n\t\tdisableDismissable,\n\t\thoverable,\n\t\tcloseReasonRef,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverTriggerContext.Provider, {\n\t\t\tscope,\n\t\t\ttriggerRef,\n\t\t\thasCustomAnchor,\n\t\t\tanchorTo,\n\t\t\tbranches,\n\t\t\tonOpenToggle,\n\t\t\tsetActiveTrigger,\n\t\t\tregisterTrigger,\n\t\t\tunregisterTrigger,\n\t\t\tchildren\n\t\t})\n\t});\n});\nconst voidFn = () => {};\nconst PopoverAnchor = React.memo(createRefComponent(function PopoverAnchor2(props, forwardedRef) {\n\tconst { scope, ...rest } = props;\n\tconst { onCustomAnchorAdd, onCustomAnchorRemove } = usePopoverContext(scope) || {};\n\tReact.useEffect(() => {\n\t\tonCustomAnchorAdd();\n\t\treturn () => onCustomAnchorRemove();\n\t}, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\treturn /* @__PURE__ */ jsx(PopperAnchor, {\n\t\tscope,\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n}));\nconst PopoverTrigger = React.memo(createRefComponent(function PopoverTrigger2(props, forwardedRef) {\n\tconst { scope, disablePressTrigger, ...rest } = props;\n\tconst triggerContext = usePopoverTriggerContext(scope);\n\tconst popperContext = usePopperContextSlow(scope);\n\tconst triggerId = React.useId();\n\tconst [open, setOpen] = React.useState(false);\n\tconst anchorTo = triggerContext.anchorTo;\n\tconst triggerElRef = React.useRef(null);\n\tconst composedTriggerRef = useComposedRefs(forwardedRef, triggerElRef);\n\tconst { registerTrigger, unregisterTrigger } = triggerContext;\n\tReact.useEffect(() => {\n\t\tregisterTrigger(triggerId, setOpen);\n\t\treturn () => {\n\t\t\tunregisterTrigger(triggerId);\n\t\t};\n\t}, [\n\t\tregisterTrigger,\n\t\tunregisterTrigger,\n\t\ttriggerId\n\t]);\n\tif (!rest.children) return null;\n\tconst activateSelf = () => {\n\t\ttriggerContext.setActiveTrigger(triggerId);\n\t\tconst el = triggerElRef.current;\n\t\tif (el) triggerContext.triggerRef.current = el;\n\t};\n\tconst trigger = /* @__PURE__ */ jsx(View, {\n\t\t\"aria-expanded\": open,\n\t\t\"data-state\": getState(open),\n\t\t...rest,\n\t\tref: composedTriggerRef,\n\t\tonPress: composeEventHandlers(rest.onPress, () => {\n\t\t\tif (disablePressTrigger) return;\n\t\t\ttriggerContext.setActiveTrigger(open ? null : triggerId);\n\t\t\ttriggerContext.onOpenToggle();\n\t\t}),\n\t\tonMouseEnter: composeEventHandlers(rest.onMouseEnter, activateSelf),\n\t\tonPressIn: composeEventHandlers(rest.onPressIn, activateSelf),\n\t\tonFocus: composeEventHandlers(rest.onFocus, (event) => {\n\t\t\tactivateSelf();\n\t\t\tpopperContext.getReferenceProps?.({ ref: triggerElRef }).onFocus?.(event);\n\t\t}),\n\t\tonBlur: composeEventHandlers(rest.onBlur, (event) => {\n\t\t\tpopperContext.getReferenceProps?.({ ref: triggerElRef }).onBlur?.(event);\n\t\t})\n\t});\n\tconst virtualRef = React.useMemo(() => {\n\t\tif (!anchorTo) return null;\n\t\treturn { current: {\n\t\t\tgetBoundingClientRect: () => isWeb ? DOMRect.fromRect(anchorTo) : anchorTo,\n\t\t\t...!isWeb && {\n\t\t\t\tmeasure: (c) => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height),\n\t\t\t\tmeasureInWindow: (c) => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height)\n\t\t\t}\n\t\t} };\n\t}, [\n\t\ttriggerContext.anchorTo,\n\t\tanchorTo?.x,\n\t\tanchorTo?.y,\n\t\tanchorTo?.height,\n\t\tanchorTo?.width\n\t]);\n\tconst wrappedTrigger = isWeb ? /* @__PURE__ */ jsx(DismissableBranch, {\n\t\tbranches: triggerContext.branches,\n\t\tchildren: trigger\n\t}) : trigger;\n\treturn triggerContext.hasCustomAnchor ? wrappedTrigger : /* @__PURE__ */ jsx(PopperAnchor, {\n\t\t...virtualRef && { virtualRef },\n\t\tscope,\n\t\tasChild: true,\n\t\tchildren: wrappedTrigger\n\t});\n}));\nconst PopoverContent = createStyledHOC(PopperContentFrame, function PopoverContent2(props, forwardedRef) {\n\tconst { trapFocus, enableRemoveScroll = false, zIndex: zIndexProp, scope, forceMount, ...contentImplProps } = props;\n\tconst context = usePopoverContext(scope);\n\tconst adaptContext = useAdaptContext(context.adaptScope);\n\tconst zIndexFromContext = React.useContext(PopoverZIndexContext);\n\tconst zIndex = zIndexProp ?? zIndexFromContext;\n\tconst open = usePopoverOpen(scope);\n\tconst composedRefs = useComposedRefs(forwardedRef, React.useRef(null));\n\tconst isRightClickOutsideRef = React.useRef(false);\n\tconst [isFullyHidden, setIsFullyHidden] = React.useState(!open);\n\tuseIsomorphicLayoutEffect(() => {\n\t\tif (open && isFullyHidden) setIsFullyHidden(false);\n\t}, [open, isFullyHidden]);\n\tif (!forceMount && !context.keepChildrenMounted) {\n\t\tif (context.breakpointActive) {\n\t\t\tif (!open && adaptContext.targetFullyHidden) return null;\n\t\t} else if (isFullyHidden && !open) return null;\n\t}\n\treturn /* @__PURE__ */ jsx(PopoverPortal, {\n\t\tpassThrough: context.breakpointActive,\n\t\tcontext,\n\t\topen,\n\t\tvisuallyActive: open || !isFullyHidden,\n\t\tzIndex,\n\t\tchildren: /* @__PURE__ */ jsx(View, {\n\t\t\tpassThrough: context.breakpointActive,\n\t\t\tpointerEvents: open ? contentImplProps.pointerEvents ?? \"auto\" : \"none\",\n\t\t\tchildren: /* @__PURE__ */ jsx(PopoverContentImpl, {\n\t\t\t\t...contentImplProps,\n\t\t\t\tcontext,\n\t\t\t\topen,\n\t\t\t\tforceMount,\n\t\t\t\tenableRemoveScroll,\n\t\t\t\tref: composedRefs,\n\t\t\t\tsetIsFullyHidden,\n\t\t\t\tscope,\n\t\t\t\ttrapFocus: trapFocus ?? open,\n\t\t\t\tdisableOutsidePointerEvents: true,\n\t\t\t\tonCloseAutoFocus: props.onCloseAutoFocus === false ? void 0 : composeEventHandlers(props.onCloseAutoFocus, (event) => {\n\t\t\t\t\tif (event.isCanceled) return;\n\t\t\t\t\tevent.cancel();\n\t\t\t\t\tif (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();\n\t\t\t\t}),\n\t\t\t\tonPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n\t\t\t\t\tconst originalEvent = event.event;\n\t\t\t\t\tif (!originalEvent) return;\n\t\t\t\t\tconst ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n\t\t\t\t\tisRightClickOutsideRef.current = originalEvent.button === 2 || ctrlLeftClick;\n\t\t\t\t}, { checkDefaultPrevented: false }),\n\t\t\t\tonFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {\n\t\t\t\t\tif (trapFocus ?? open) event.cancel();\n\t\t\t\t}, { checkDefaultPrevented: false })\n\t\t\t})\n\t\t})\n\t});\n}, { staticConfig: { inlineProps: /* @__PURE__ */ new Set([\n\t...PopperContentFrame.staticConfig.inlineProps || [],\n\t\"zIndex\",\n\t\"opacity\",\n\t\"y\"\n]) } });\nconst useParentContexts = (scope) => {\n\tconst context = usePopoverContext(scope);\n\tconst triggerContext = usePopoverTriggerContext(scope);\n\treturn {\n\t\tpopperContext: usePopperContext(scope),\n\t\tadaptContext: useAdaptContext(context.adaptScope),\n\t\tcontext,\n\t\ttriggerContext\n\t};\n};\nfunction RepropagateParentContexts({ adaptContext, children, context, triggerContext, popperContext }) {\n\treturn /* @__PURE__ */ jsx(PopperProvider, {\n\t\tscope: context.popoverScope,\n\t\t...popperContext,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverContext.Provider, {\n\t\t\tscope: context.popoverScope,\n\t\t\t...context,\n\t\t\tchildren: /* @__PURE__ */ jsx(PopoverTriggerContext.Provider, {\n\t\t\t\tscope: context.popoverScope,\n\t\t\t\t...triggerContext,\n\t\t\t\tchildren: /* @__PURE__ */ jsx(ProvideAdaptContext, {\n\t\t\t\t\t...adaptContext,\n\t\t\t\t\tchildren\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t});\n}\nconst PortalAdaptSafe = ({ children, context }) => {\n\t\"use no memo\";\n\tif (needsRepropagation) {\n\t\tconst parentContexts = useParentContexts(context.popoverScope);\n\t\treturn /* @__PURE__ */ jsx(AdaptPortalContents, {\n\t\t\tscope: context.adaptScope,\n\t\t\tchildren: /* @__PURE__ */ jsx(RepropagateParentContexts, {\n\t\t\t\t...parentContexts,\n\t\t\t\tchildren\n\t\t\t})\n\t\t});\n\t}\n\treturn /* @__PURE__ */ jsx(AdaptPortalContents, {\n\t\tscope: context.adaptScope,\n\t\tchildren\n\t});\n};\nfunction PopoverPortal({ context, open, visuallyActive, zIndex, passThrough, children, onPress }) {\n\t\"use no memo\";\n\tlet content = children;\n\tif (needsRepropagation) content = /* @__PURE__ */ jsx(RepropagateParentContexts, {\n\t\t...useParentContexts(context.popoverScope),\n\t\tchildren: content\n\t});\n\treturn /* @__PURE__ */ jsxs(Portal, {\n\t\tpassThrough,\n\t\tstackZIndex: true,\n\t\tzIndex,\n\t\thidden: !visuallyActive,\n\t\tchildren: [!!open && !context.breakpointActive && !context.hoverable && /* @__PURE__ */ jsx(YStack, {\n\t\t\tposition: \"absolute\",\n\t\t\tinset: 0,\n\t\t\tonPress: composeEventHandlers(onPress, context.onOpenToggle)\n\t\t}), content]\n\t});\n}\nconst PopoverContentImpl = createRefComponent(function PopoverContentImpl2(props, forwardedRef) {\n\tconst { trapFocus, scope, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, disableFocusScope, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, children, enableRemoveScroll, freezeContentsWhenHidden, setIsFullyHidden, lazyMount, forceUnmount, forceMount, context, open, alwaysDisable, ...contentProps } = props;\n\tconst { disableDismissable } = context;\n\tconst keepChildrenMounted = context.keepChildrenMounted || forceMount;\n\tconst handleExitComplete = React.useCallback(() => {\n\t\tsetIsFullyHidden?.(true);\n\t}, [setIsFullyHidden]);\n\tlet contents = /* @__PURE__ */ jsx(ResetPresence, {\n\t\tdisable: context.breakpointActive,\n\t\tchildren\n\t});\n\tconst handleDismiss = React.useCallback((details) => {\n\t\tif (context.closeReasonRef) context.closeReasonRef.current = details.reason === \"escape-key\" ? \"escape-key\" : \"dismiss\";\n\t\tcontext.onOpenChange(false, \"press\");\n\t}, [context]);\n\tif (!context.breakpointActive) {\n\t\tif (!alwaysDisable || !alwaysDisable.focus) contents = /* @__PURE__ */ jsx(FocusScope, {\n\t\t\tloop: trapFocus !== false,\n\t\t\tenabled: context.breakpointActive ? false : disableFocusScope ? false : open,\n\t\t\ttrapped: context.breakpointActive ? false : trapFocus,\n\t\t\tonMountAutoFocus: onOpenAutoFocus,\n\t\t\tonUnmountAutoFocus: onCloseAutoFocus === false ? void 0 : onCloseAutoFocus,\n\t\t\tchildren: contents\n\t\t});\n\t\tif (!alwaysDisable || !alwaysDisable[\"remove-scroll\"]) contents = /* @__PURE__ */ jsx(RemoveScroll, {\n\t\t\tenabled: context.breakpointActive ? false : enableRemoveScroll ? open : false,\n\t\t\tchildren: contents\n\t\t});\n\t\tif (!alwaysDisable || !alwaysDisable.dismiss) contents = /* @__PURE__ */ jsx(Dismissable, {\n\t\t\tbranches: context.branches,\n\t\t\tforceUnmount: disableDismissable || (forceUnmount ?? !open),\n\t\t\tonEscapeKeyDown,\n\t\t\tonPointerDownOutside,\n\t\t\tonFocusOutside,\n\t\t\tonInteractOutside,\n\t\t\tonDismiss: handleDismiss,\n\t\t\tchildren: contents\n\t\t});\n\t}\n\treturn /* @__PURE__ */ jsx(Animate, {\n\t\ttype: \"presence\",\n\t\tpresent: Boolean(open),\n\t\tkeepChildrenMounted: Boolean(keepChildrenMounted),\n\t\tonExitComplete: handleExitComplete,\n\t\tlazyMount,\n\t\tpassThrough: context.breakpointActive,\n\t\tchildren: /* @__PURE__ */ jsx(PopperContent, {\n\t\t\tscope,\n\t\t\t\"data-state\": getState(open),\n\t\t\tid: context.contentId,\n\t\t\tref: forwardedRef,\n\t\t\tpassThrough: context.breakpointActive,\n\t\t\t...contentProps,\n\t\t\tchildren: /* @__PURE__ */ jsx(PortalAdaptSafe, {\n\t\t\t\tcontext,\n\t\t\t\tchildren: contents\n\t\t\t})\n\t\t}, context.contentId)\n\t});\n});\nconst PopoverClose = createRefComponent(function PopoverClose2(props, forwardedRef) {\n\tconst { scope, className, ...rest } = props;\n\tconst context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ jsx(YStack, {\n\t\t...rest,\n\t\tref: forwardedRef,\n\t\tclassName: `is_PopoverClose ${className || \"\"}`.trim(),\n\t\tonPress: composeEventHandlers(props.onPress, () => context?.onOpenChange?.(false, \"press\"))\n\t});\n});\nconst PopoverArrow = createStyledHOC(PopperArrowFrame, function PopoverArrow2(props, forwardedRef) {\n\tconst { scope, className, ...rest } = props;\n\tif (useAdaptIsActive(usePopoverContext(scope).adaptScope)) return null;\n\treturn /* @__PURE__ */ jsx(PopperArrow, {\n\t\tscope,\n\t\tclassName: `is_PopoverArrow ${className || \"\"}`.trim(),\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n});\nconst PopoverScrollView = createRefComponent(({ scope, ...props }, ref) => {\n\tconst context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ jsx(ScrollView, {\n\t\tref,\n\t\tpointerEvents: context.breakpointActive ? \"none\" : void 0,\n\t\tscrollEnabled: !context.breakpointActive,\n\t\tpassThrough: context.breakpointActive,\n\t\t...props\n\t});\n});\nconst DEFAULT_SCOPE = \"\";\nconst Popover = withStaticProperties(createRefComponent(function Popover2({ scope = DEFAULT_SCOPE, ...props }, ref) {\n\tconst id = React.useId();\n\tconst adaptScope = `PopoverAdapt${scope}`;\n\tconst { open: openProp, defaultOpen, onOpenChange } = props;\n\tconst viaRef = React.useRef(void 0);\n\tconst closeReasonRef = React.useRef(void 0);\n\tconst [open, setOpen] = useControllableState({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen || false,\n\t\tonChange: (val) => {\n\t\t\tonOpenChange?.(val, viaRef.current);\n\t\t}\n\t});\n\tconst handleOpenChange = useEvent((val, via) => {\n\t\tviaRef.current = via;\n\t\tsetOpen(val);\n\t});\n\tReact.useEffect(() => {\n\t\tif (!open) return;\n\t\topenPopovers.add(setOpen);\n\t\treturn () => {\n\t\t\topenPopovers.delete(setOpen);\n\t\t};\n\t}, [open, setOpen]);\n\treturn /* @__PURE__ */ jsx(AdaptParent, {\n\t\tscope: adaptScope,\n\t\tadaptChildren: props.children,\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverInner, {\n\t\t\tadaptScope,\n\t\t\tref,\n\t\t\tid,\n\t\t\tscope,\n\t\t\topen,\n\t\t\tsetOpen,\n\t\t\thandleOpenChange,\n\t\t\tcloseReasonRef,\n\t\t\t...props\n\t\t})\n\t});\n}), {\n\tAnchor: PopoverAnchor,\n\tArrow: PopoverArrow,\n\tTrigger: PopoverTrigger,\n\tContent: PopoverContent,\n\tClose: PopoverClose,\n\tAdapt,\n\tScrollView: PopoverScrollView,\n\tFocusScope: FocusScopeController\n});\nconst PopoverInner = createRefComponent(function PopoverInner2(props, forwardedRef) {\n\tconst { children, open: _openProp, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus = !hoverable, disableDismissable, zIndex, id, adaptScope, open, setOpen, handleOpenChange, closeReasonRef, ...restProps } = props;\n\tconst triggerRef = React.useRef(null);\n\tconst [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n\tconst [keepChildrenMounted] = useControllableState({\n\t\tprop: keepChildrenMountedProp,\n\t\tdefaultProp: false,\n\t\ttransition: keepChildrenMountedProp === \"lazy\"\n\t});\n\tconst isAdapted = useAdaptIsActive(adaptScope);\n\tconst floatingContext = useFloatingContext({\n\t\topen,\n\t\tsetOpen: handleOpenChange,\n\t\tcloseReasonRef,\n\t\tdisable: isAdapted,\n\t\thoverable,\n\t\tdisableFocus\n\t});\n\tconst [anchorTo, setAnchorToRaw] = React.useState();\n\tconst setAnchorTo = useCreateShallowSetState(setAnchorToRaw);\n\tReact.useImperativeHandle(forwardedRef, () => ({\n\t\tanchorTo: setAnchorTo,\n\t\ttoggle: () => setOpen((prev) => !prev),\n\t\topen: () => setOpen(true),\n\t\tclose: () => setOpen(false),\n\t\tsetOpen\n\t}));\n\tconst contentId = React.useId();\n\tconst onOpenToggle = useEvent(() => {\n\t\tif (open && isAdapted) return;\n\t\tcloseReasonRef.current = open ? \"reference-press\" : void 0;\n\t\tsetOpen(!open);\n\t});\n\tconst onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(true), []);\n\tconst onCustomAnchorRemove = React.useCallback(() => setHasCustomAnchor(false), []);\n\tconst contents = /* @__PURE__ */ jsx(Popper, {\n\t\topen,\n\t\tpassThrough: isAdapted,\n\t\tscope,\n\t\tstayInFrame: true,\n\t\t...restProps,\n\t\tchildren: /* @__PURE__ */ jsx(PopoverContextProvider, {\n\t\t\tscope,\n\t\t\topen,\n\t\t\tonOpenChange: handleOpenChange,\n\t\t\tonOpenToggle,\n\t\t\ttriggerRef,\n\t\t\tid,\n\t\t\tcontentId,\n\t\t\thasCustomAnchor,\n\t\t\tonCustomAnchorAdd,\n\t\t\tonCustomAnchorRemove,\n\t\t\tanchorTo,\n\t\t\tadaptScope,\n\t\t\tbreakpointActive: isAdapted,\n\t\t\tkeepChildrenMounted,\n\t\t\tdisableDismissable,\n\t\t\thoverable,\n\t\t\tcloseReasonRef,\n\t\t\tchildren\n\t\t})\n\t});\n\tlet result = /* @__PURE__ */ jsx(Fragment, { children: isWeb ? /* @__PURE__ */ jsx(FloatingOverrideContext.Provider, {\n\t\tvalue: floatingContext,\n\t\tchildren: contents\n\t}) : contents });\n\tif (zIndex !== void 0) return /* @__PURE__ */ jsx(PopoverZIndexContext.Provider, {\n\t\tvalue: zIndex,\n\t\tchildren: result\n\t});\n\treturn result;\n});\nfunction getState(open) {\n\treturn open ? \"open\" : \"closed\";\n}\n\nexport { Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverContext, PopoverContextProvider, PopoverTrigger, PopoverTriggerContext, PopoverZIndexContext, closeLastOpenedPopover, closeOpenPopovers, hasOpenPopovers, usePopoverContext, usePopoverOpen, usePopoverTriggerContext, usePopoverTriggerSetup };"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,qBAAqB,yBAAyB;AACpD,MAAM,+BAA+B,IAAI,IAAI;AAC7C,MAAM,wBAAwB;CAC7B,OAAO,aAAa,OAAO;AAC5B;AACA,MAAM,0BAA0B;CAC/B,IAAI,aAAa,SAAS,GAAG,OAAO;CACpC,aAAa,SAAS,YAAY,QAAQ,KAAK,CAAC;CAChD,OAAO;AACR;AACA,MAAM,+BAA+B;CACpC,IAAI,aAAa,SAAS,GAAG,OAAO;CACpC,MAAM,OAAO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AM,MAAM;CAC9B,MAAM,eAAe,eAAe;EACnC,IAAI,QAAQ,WAAW;EACvB,eAAe,UAAU,OAAO,oBAAoB,KAAK;EACzD,QAAQ,CAAC,IAAI;CACd,CAAC;CACD,MAAM,oBAAoB,MAAM,kBAAkB,mBAAmB,IAAI,GAAG,CAAC,CAAC;CAC9E,MAAM,uBAAuB,MAAM,kBAAkB,mBAAmB,KAAK,GAAG,CAAC,CAAC;CAClF,MAAM,WAA2B,oBAAI,QAAQ;EAC5C;EACA,aAAa;EACb;EACA,aAAa;EACb,GAAG;EACH,UAA0B,oBAAI,wBAAwB;GACrD;GACA;GACA,cAAc;GACd;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,kBAAkB;GAClB;GACA;GACA;GACA;GACA;EACD,CAAC;CACF,CAAC;CACD,IAAI,SAAyB,oBAAI,UAAU,EAAE,UAAU,QAAwB,oBAAI,wBAAwB,UAAU;EACpH,OAAO;EACP,UAAU;CACX,CAAC,IAAI,SAAS,CAAC;CACf,IAAI,WAAW,KAAK,GAAG,OAAuB,oBAAI,qBAAqB,UAAU;EAChF,OAAO;EACP,UAAU;CACX,CAAC;CACD,OAAO;AACR,CAAC;AACD,SAAS,SAAS,MAAM;CACvB,OAAO,OAAO,SAAS;AACxB"}
@@ -138,7 +138,7 @@ function usePopoverTriggerSetup(open) {
138
138
  };
139
139
  }
140
140
  var PopoverContextProvider = /* @__PURE__ */ React.memo(function(param) {
141
- var { scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = "", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable } = param;
141
+ var { scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = "", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable, closeReasonRef } = param;
142
142
  var [branches] = React.useState(function() {
143
143
  return /* @__PURE__ */ new Set();
144
144
  });
@@ -162,6 +162,7 @@ var PopoverContextProvider = /* @__PURE__ */ React.memo(function(param) {
162
162
  keepChildrenMounted,
163
163
  disableDismissable,
164
164
  hoverable,
165
+ closeReasonRef,
165
166
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverTriggerContext.Provider, {
166
167
  scope,
167
168
  triggerRef,
@@ -195,6 +196,7 @@ var PopoverAnchor = /* @__PURE__ */ React.memo((0, import_core.createRefComponen
195
196
  var PopoverTrigger = /* @__PURE__ */ React.memo((0, import_core.createRefComponent)(function PopoverTrigger2(props, forwardedRef) {
196
197
  var { scope, disablePressTrigger, ...rest } = props;
197
198
  var triggerContext = usePopoverTriggerContext(scope);
199
+ var popperContext = (0, import_popper.usePopperContextSlow)(scope);
198
200
  var triggerId = React.useId();
199
201
  var [open, setOpen] = React.useState(false);
200
202
  var anchorTo = triggerContext.anchorTo;
@@ -229,7 +231,15 @@ var PopoverTrigger = /* @__PURE__ */ React.memo((0, import_core.createRefCompone
229
231
  }),
230
232
  onMouseEnter: (0, import_helpers.composeEventHandlers)(rest.onMouseEnter, activateSelf),
231
233
  onPressIn: (0, import_helpers.composeEventHandlers)(rest.onPressIn, activateSelf),
232
- onFocus: (0, import_helpers.composeEventHandlers)(rest.onFocus, activateSelf)
234
+ onFocus: (0, import_helpers.composeEventHandlers)(rest.onFocus, function(event) {
235
+ var _popperContext_getReferenceProps_onFocus, _popperContext_getReferenceProps, _popperContext_getReferenceProps_call;
236
+ activateSelf();
237
+ (_popperContext_getReferenceProps = popperContext.getReferenceProps) === null || _popperContext_getReferenceProps === void 0 || (_popperContext_getReferenceProps_onFocus = (_popperContext_getReferenceProps_call = _popperContext_getReferenceProps.call(popperContext, { ref: triggerElRef })).onFocus) == null || _popperContext_getReferenceProps_onFocus.call(_popperContext_getReferenceProps_call, event);
238
+ }),
239
+ onBlur: (0, import_helpers.composeEventHandlers)(rest.onBlur, function(event) {
240
+ var _popperContext_getReferenceProps_onBlur, _popperContext_getReferenceProps, _popperContext_getReferenceProps_call;
241
+ (_popperContext_getReferenceProps = popperContext.getReferenceProps) === null || _popperContext_getReferenceProps === void 0 || (_popperContext_getReferenceProps_onBlur = (_popperContext_getReferenceProps_call = _popperContext_getReferenceProps.call(popperContext, { ref: triggerElRef })).onBlur) == null || _popperContext_getReferenceProps_onBlur.call(_popperContext_getReferenceProps_call, event);
242
+ })
233
243
  });
234
244
  var virtualRef = React.useMemo(function() {
235
245
  if (!anchorTo) return null;
@@ -409,7 +419,8 @@ var PopoverContentImpl = (0, import_core.createRefComponent)(function PopoverCon
409
419
  disable: context.breakpointActive,
410
420
  children
411
421
  });
412
- React.useCallback(function() {
422
+ React.useCallback(function(details) {
423
+ if (context.closeReasonRef) context.closeReasonRef.current = details.reason === "escape-key" ? "escape-key" : "dismiss";
413
424
  context.onOpenChange(false, "press");
414
425
  }, [context]);
415
426
  if (!context.breakpointActive) {}
@@ -476,6 +487,7 @@ var Popover = (0, import_helpers.withStaticProperties)((0, import_core.createRef
476
487
  var adaptScope = `PopoverAdapt${scope}`;
477
488
  var { open: openProp, defaultOpen, onOpenChange } = props;
478
489
  var viaRef = React.useRef(void 0);
490
+ var closeReasonRef = React.useRef(void 0);
479
491
  var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
480
492
  prop: openProp,
481
493
  defaultProp: defaultOpen || false,
@@ -496,6 +508,7 @@ var Popover = (0, import_helpers.withStaticProperties)((0, import_core.createRef
496
508
  }, [open, setOpen]);
497
509
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptParent, {
498
510
  scope: adaptScope,
511
+ adaptChildren: props.children,
499
512
  open,
500
513
  onOpenChange: setOpen,
501
514
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverInner, {
@@ -506,6 +519,7 @@ var Popover = (0, import_helpers.withStaticProperties)((0, import_core.createRef
506
519
  open,
507
520
  setOpen,
508
521
  handleOpenChange,
522
+ closeReasonRef,
509
523
  ...props
510
524
  })
511
525
  });
@@ -520,7 +534,7 @@ var Popover = (0, import_helpers.withStaticProperties)((0, import_core.createRef
520
534
  FocusScope: import_focus_scope.FocusScopeController
521
535
  });
522
536
  var PopoverInner = (0, import_core.createRefComponent)(function PopoverInner2(props, forwardedRef) {
523
- var { children, open: _openProp, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus, disableDismissable, zIndex, id, adaptScope, open, setOpen, handleOpenChange, ...restProps } = props;
537
+ var { children, open: _openProp, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus = !hoverable, disableDismissable, zIndex, id, adaptScope, open, setOpen, handleOpenChange, closeReasonRef, ...restProps } = props;
524
538
  var triggerRef = React.useRef(null);
525
539
  var [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
526
540
  var [keepChildrenMounted] = (0, import_use_controllable_state.useControllableState)({
@@ -532,6 +546,7 @@ var PopoverInner = (0, import_core.createRefComponent)(function PopoverInner2(pr
532
546
  var floatingContext = (0, import_useFloatingContext.useFloatingContext)({
533
547
  open,
534
548
  setOpen: handleOpenChange,
549
+ closeReasonRef,
535
550
  disable: isAdapted,
536
551
  hoverable,
537
552
  disableFocus
@@ -558,6 +573,7 @@ var PopoverInner = (0, import_core.createRefComponent)(function PopoverInner2(pr
558
573
  var contentId = React.useId();
559
574
  var onOpenToggle = (0, import_core.useEvent)(function() {
560
575
  if (open && isAdapted) return;
576
+ closeReasonRef.current = open ? "reference-press" : void 0;
561
577
  setOpen(!open);
562
578
  });
563
579
  var onCustomAnchorAdd = React.useCallback(function() {
@@ -589,6 +605,7 @@ var PopoverInner = (0, import_core.createRefComponent)(function PopoverInner2(pr
589
605
  keepChildrenMounted,
590
606
  disableDismissable,
591
607
  hoverable,
608
+ closeReasonRef,
592
609
  children
593
610
  })
594
611
  });
@@ -138,7 +138,7 @@ function usePopoverTriggerSetup(open) {
138
138
  };
139
139
  }
140
140
  var PopoverContextProvider = /* @__PURE__ */ React.memo(function(param) {
141
- var { scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = "", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable } = param;
141
+ var { scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = "", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable, closeReasonRef } = param;
142
142
  var [branches] = React.useState(function() {
143
143
  return /* @__PURE__ */ new Set();
144
144
  });
@@ -162,6 +162,7 @@ var PopoverContextProvider = /* @__PURE__ */ React.memo(function(param) {
162
162
  keepChildrenMounted,
163
163
  disableDismissable,
164
164
  hoverable,
165
+ closeReasonRef,
165
166
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverTriggerContext.Provider, {
166
167
  scope,
167
168
  triggerRef,
@@ -195,6 +196,7 @@ var PopoverAnchor = /* @__PURE__ */ React.memo((0, import_core.createRefComponen
195
196
  var PopoverTrigger = /* @__PURE__ */ React.memo((0, import_core.createRefComponent)(function PopoverTrigger2(props, forwardedRef) {
196
197
  var { scope, disablePressTrigger, ...rest } = props;
197
198
  var triggerContext = usePopoverTriggerContext(scope);
199
+ var popperContext = (0, import_popper.usePopperContextSlow)(scope);
198
200
  var triggerId = React.useId();
199
201
  var [open, setOpen] = React.useState(false);
200
202
  var anchorTo = triggerContext.anchorTo;
@@ -229,7 +231,15 @@ var PopoverTrigger = /* @__PURE__ */ React.memo((0, import_core.createRefCompone
229
231
  }),
230
232
  onMouseEnter: (0, import_helpers.composeEventHandlers)(rest.onMouseEnter, activateSelf),
231
233
  onPressIn: (0, import_helpers.composeEventHandlers)(rest.onPressIn, activateSelf),
232
- onFocus: (0, import_helpers.composeEventHandlers)(rest.onFocus, activateSelf)
234
+ onFocus: (0, import_helpers.composeEventHandlers)(rest.onFocus, function(event) {
235
+ var _popperContext_getReferenceProps_onFocus, _popperContext_getReferenceProps, _popperContext_getReferenceProps_call;
236
+ activateSelf();
237
+ (_popperContext_getReferenceProps = popperContext.getReferenceProps) === null || _popperContext_getReferenceProps === void 0 || (_popperContext_getReferenceProps_onFocus = (_popperContext_getReferenceProps_call = _popperContext_getReferenceProps.call(popperContext, { ref: triggerElRef })).onFocus) == null || _popperContext_getReferenceProps_onFocus.call(_popperContext_getReferenceProps_call, event);
238
+ }),
239
+ onBlur: (0, import_helpers.composeEventHandlers)(rest.onBlur, function(event) {
240
+ var _popperContext_getReferenceProps_onBlur, _popperContext_getReferenceProps, _popperContext_getReferenceProps_call;
241
+ (_popperContext_getReferenceProps = popperContext.getReferenceProps) === null || _popperContext_getReferenceProps === void 0 || (_popperContext_getReferenceProps_onBlur = (_popperContext_getReferenceProps_call = _popperContext_getReferenceProps.call(popperContext, { ref: triggerElRef })).onBlur) == null || _popperContext_getReferenceProps_onBlur.call(_popperContext_getReferenceProps_call, event);
242
+ })
233
243
  });
234
244
  var virtualRef = React.useMemo(function() {
235
245
  if (!anchorTo) return null;
@@ -409,7 +419,8 @@ var PopoverContentImpl = (0, import_core.createRefComponent)(function PopoverCon
409
419
  disable: context.breakpointActive,
410
420
  children
411
421
  });
412
- React.useCallback(function() {
422
+ React.useCallback(function(details) {
423
+ if (context.closeReasonRef) context.closeReasonRef.current = details.reason === "escape-key" ? "escape-key" : "dismiss";
413
424
  context.onOpenChange(false, "press");
414
425
  }, [context]);
415
426
  if (!context.breakpointActive) {}
@@ -476,6 +487,7 @@ var Popover = (0, import_helpers.withStaticProperties)((0, import_core.createRef
476
487
  var adaptScope = `PopoverAdapt${scope}`;
477
488
  var { open: openProp, defaultOpen, onOpenChange } = props;
478
489
  var viaRef = React.useRef(void 0);
490
+ var closeReasonRef = React.useRef(void 0);
479
491
  var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
480
492
  prop: openProp,
481
493
  defaultProp: defaultOpen || false,
@@ -496,6 +508,7 @@ var Popover = (0, import_helpers.withStaticProperties)((0, import_core.createRef
496
508
  }, [open, setOpen]);
497
509
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptParent, {
498
510
  scope: adaptScope,
511
+ adaptChildren: props.children,
499
512
  open,
500
513
  onOpenChange: setOpen,
501
514
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverInner, {
@@ -506,6 +519,7 @@ var Popover = (0, import_helpers.withStaticProperties)((0, import_core.createRef
506
519
  open,
507
520
  setOpen,
508
521
  handleOpenChange,
522
+ closeReasonRef,
509
523
  ...props
510
524
  })
511
525
  });
@@ -520,7 +534,7 @@ var Popover = (0, import_helpers.withStaticProperties)((0, import_core.createRef
520
534
  FocusScope: import_focus_scope.FocusScopeController
521
535
  });
522
536
  var PopoverInner = (0, import_core.createRefComponent)(function PopoverInner2(props, forwardedRef) {
523
- var { children, open: _openProp, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus, disableDismissable, zIndex, id, adaptScope, open, setOpen, handleOpenChange, ...restProps } = props;
537
+ var { children, open: _openProp, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus = !hoverable, disableDismissable, zIndex, id, adaptScope, open, setOpen, handleOpenChange, closeReasonRef, ...restProps } = props;
524
538
  var triggerRef = React.useRef(null);
525
539
  var [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
526
540
  var [keepChildrenMounted] = (0, import_use_controllable_state.useControllableState)({
@@ -532,6 +546,7 @@ var PopoverInner = (0, import_core.createRefComponent)(function PopoverInner2(pr
532
546
  var floatingContext = (0, import_useFloatingContext.useFloatingContext)({
533
547
  open,
534
548
  setOpen: handleOpenChange,
549
+ closeReasonRef,
535
550
  disable: isAdapted,
536
551
  hoverable,
537
552
  disableFocus
@@ -558,6 +573,7 @@ var PopoverInner = (0, import_core.createRefComponent)(function PopoverInner2(pr
558
573
  var contentId = React.useId();
559
574
  var onOpenToggle = (0, import_core.useEvent)(function() {
560
575
  if (open && isAdapted) return;
576
+ closeReasonRef.current = open ? "reference-press" : void 0;
561
577
  setOpen(!open);
562
578
  });
563
579
  var onCustomAnchorAdd = React.useCallback(function() {
@@ -589,6 +605,7 @@ var PopoverInner = (0, import_core.createRefComponent)(function PopoverInner2(pr
589
605
  keepChildrenMounted,
590
606
  disableDismissable,
591
607
  hoverable,
608
+ closeReasonRef,
592
609
  children
593
610
  })
594
611
  });