@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":"Popover.native.js","names":[],"sources":["jsx/Popover.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Popover_exports = {};\n__export(Popover_exports, {\n\tPopover: () => Popover,\n\tPopoverAnchor: () => PopoverAnchor,\n\tPopoverArrow: () => PopoverArrow,\n\tPopoverClose: () => PopoverClose,\n\tPopoverContent: () => PopoverContent,\n\tPopoverContext: () => PopoverContext,\n\tPopoverContextProvider: () => PopoverContextProvider,\n\tPopoverTrigger: () => PopoverTrigger,\n\tPopoverTriggerContext: () => PopoverTriggerContext,\n\tPopoverZIndexContext: () => PopoverZIndexContext,\n\tcloseLastOpenedPopover: () => closeLastOpenedPopover,\n\tcloseOpenPopovers: () => closeOpenPopovers,\n\thasOpenPopovers: () => hasOpenPopovers,\n\tusePopoverContext: () => usePopoverContext,\n\tusePopoverOpen: () => usePopoverOpen,\n\tusePopoverTriggerContext: () => usePopoverTriggerContext,\n\tusePopoverTriggerSetup: () => usePopoverTriggerSetup\n});\nmodule.exports = __toCommonJS(Popover_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nrequire(\"@tamagui/polyfill-dev\");\nvar import_adapt = require(\"@tamagui/adapt\");\nvar import_animate = require(\"@tamagui/animate\");\nvar import_animate_presence = require(\"@tamagui/animate-presence\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_dismissable = require(\"@tamagui/dismissable\");\nvar import_floating = require(\"@tamagui/floating\");\nvar import_focus_scope = require(\"@tamagui/focus-scope\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_popper = require(\"@tamagui/popper\");\nvar import_portal = require(\"@tamagui/portal\");\nrequire(\"@tamagui/remove-scroll\");\nvar import_scroll_view = require(\"@tamagui/scroll-view\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_useFloatingContext = require(\"./useFloatingContext\");\nvar needsRepropagation = (0, import_portal.needsPortalRepropagation)();\nvar openPopovers = /* @__PURE__ */ new Set();\nvar hasOpenPopovers = function() {\n\treturn openPopovers.size > 0;\n};\nvar closeOpenPopovers = function() {\n\tif (openPopovers.size === 0) return false;\n\topenPopovers.forEach(function(setOpen) {\n\t\treturn setOpen(false);\n\t});\n\treturn true;\n};\nvar closeLastOpenedPopover = function() {\n\tif (openPopovers.size === 0) return false;\n\tvar last = Array.from(openPopovers).pop();\n\tif (last) {\n\t\tlast(false);\n\t\treturn true;\n\t}\n\treturn false;\n};\nvar PopoverContext = (0, import_core.createStyledContext)(\n\t// since we always provide this we can avoid setting here\n\t{},\n\t\"Popover__\"\n);\nvar PopoverZIndexContext = /* @__PURE__ */ React.createContext(void 0);\nvar PopoverTriggerContext = (0, import_core.createStyledContext)({}, \"PopoverTrigger__\");\nvar usePopoverContext = PopoverContext.useStyledContext;\nvar usePopoverTriggerContext = PopoverTriggerContext.useStyledContext;\nfunction usePopoverOpen(scope) {\n\treturn usePopoverContext(scope).open;\n}\nfunction usePopoverTriggerSetup(open) {\n\tvar triggerStateSettersRef = React.useRef(/* @__PURE__ */ new Map());\n\tvar activeTriggerIdRef = React.useRef(null);\n\tvar setActiveTrigger = (0, import_core.useEvent)(function(id) {\n\t\tvar prevId = activeTriggerIdRef.current;\n\t\tif (prevId === id) return;\n\t\tif (prevId) {\n\t\t\tvar _triggerStateSettersRef_current_get;\n\t\t\t(_triggerStateSettersRef_current_get = triggerStateSettersRef.current.get(prevId)) === null || _triggerStateSettersRef_current_get === void 0 || _triggerStateSettersRef_current_get(false);\n\t\t}\n\t\tactiveTriggerIdRef.current = id;\n\t\tif (id && open) {\n\t\t\tvar _triggerStateSettersRef_current_get1;\n\t\t\t(_triggerStateSettersRef_current_get1 = triggerStateSettersRef.current.get(id)) === null || _triggerStateSettersRef_current_get1 === void 0 || _triggerStateSettersRef_current_get1(true);\n\t\t}\n\t});\n\tvar registerTrigger = (0, import_core.useEvent)(function(id, setOpenState) {\n\t\ttriggerStateSettersRef.current.set(id, setOpenState);\n\t\tsetOpenState(activeTriggerIdRef.current === id && open);\n\t});\n\tvar unregisterTrigger = (0, import_core.useEvent)(function(id) {\n\t\ttriggerStateSettersRef.current.delete(id);\n\t\tif (activeTriggerIdRef.current === id) activeTriggerIdRef.current = null;\n\t});\n\tReact.useEffect(function() {\n\t\tif (!open) {\n\t\t\tsetActiveTrigger(null);\n\t\t\treturn;\n\t\t}\n\t\tvar activeId = activeTriggerIdRef.current;\n\t\tif (activeId) {\n\t\t\tvar _triggerStateSettersRef_current_get;\n\t\t\t(_triggerStateSettersRef_current_get = triggerStateSettersRef.current.get(activeId)) === null || _triggerStateSettersRef_current_get === void 0 || _triggerStateSettersRef_current_get(true);\n\t\t}\n\t}, [open, setActiveTrigger]);\n\treturn {\n\t\tsetActiveTrigger,\n\t\tregisterTrigger,\n\t\tunregisterTrigger\n\t};\n}\nvar PopoverContextProvider = /* @__PURE__ */ React.memo(function(param) {\n\tvar { scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = \"\", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable } = param;\n\tvar [branches] = React.useState(function() {\n\t\treturn /* @__PURE__ */ new Set();\n\t});\n\tvar { setActiveTrigger, registerTrigger, unregisterTrigger } = usePopoverTriggerSetup(open);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.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});\nvar voidFn = function() {};\nvar PopoverAnchor = /* @__PURE__ */ React.memo((0, import_core.createRefComponent)(function PopoverAnchor2(props, forwardedRef) {\n\tvar { scope, ...rest } = props;\n\tvar { onCustomAnchorAdd, onCustomAnchorRemove } = usePopoverContext(scope) || {};\n\tReact.useEffect(function() {\n\t\tonCustomAnchorAdd();\n\t\treturn function() {\n\t\t\treturn onCustomAnchorRemove();\n\t\t};\n\t}, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperAnchor, {\n\t\tscope,\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n}));\nvar PopoverTrigger = /* @__PURE__ */ React.memo((0, import_core.createRefComponent)(function PopoverTrigger2(props, forwardedRef) {\n\tvar { scope, disablePressTrigger, ...rest } = props;\n\tvar triggerContext = usePopoverTriggerContext(scope);\n\tvar triggerId = React.useId();\n\tvar [open, setOpen] = React.useState(false);\n\tvar anchorTo = triggerContext.anchorTo;\n\tvar triggerElRef = React.useRef(null);\n\tvar composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, triggerElRef);\n\tvar { registerTrigger, unregisterTrigger } = triggerContext;\n\tReact.useEffect(function() {\n\t\tregisterTrigger(triggerId, setOpen);\n\t\treturn function() {\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\tvar activateSelf = function() {\n\t\ttriggerContext.setActiveTrigger(triggerId);\n\t\tvar el = triggerElRef.current;\n\t\tif (el) triggerContext.triggerRef.current = el;\n\t};\n\tvar trigger = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.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: (0, import_helpers.composeEventHandlers)(rest.onPress, function() {\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: (0, import_helpers.composeEventHandlers)(rest.onMouseEnter, activateSelf),\n\t\tonPressIn: (0, import_helpers.composeEventHandlers)(rest.onPressIn, activateSelf),\n\t\tonFocus: (0, import_helpers.composeEventHandlers)(rest.onFocus, activateSelf)\n\t});\n\tvar virtualRef = React.useMemo(function() {\n\t\tif (!anchorTo) return null;\n\t\treturn { current: {\n\t\t\tgetBoundingClientRect: function() {\n\t\t\t\treturn import_constants.isWeb ? DOMRect.fromRect(anchorTo) : anchorTo;\n\t\t\t},\n\t\t\t...!import_constants.isWeb && {\n\t\t\t\tmeasure: function(c) {\n\t\t\t\t\treturn c(anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height);\n\t\t\t\t},\n\t\t\t\tmeasureInWindow: function(c) {\n\t\t\t\t\treturn c(anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height);\n\t\t\t\t}\n\t\t\t}\n\t\t} };\n\t}, [\n\t\ttriggerContext.anchorTo,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width\n\t]);\n\tvar wrappedTrigger = import_constants.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dismissable.DismissableBranch, {\n\t\tbranches: triggerContext.branches,\n\t\tchildren: trigger\n\t}) : trigger;\n\treturn triggerContext.hasCustomAnchor ? wrappedTrigger : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperAnchor, {\n\t\t...virtualRef && { virtualRef },\n\t\tscope,\n\t\tasChild: true,\n\t\tchildren: wrappedTrigger\n\t});\n}));\nvar PopoverContent = (0, import_core.createStyledHOC)(import_popper.PopperContentFrame, function PopoverContent2(props, forwardedRef) {\n\tvar { trapFocus, enableRemoveScroll = false, zIndex: zIndexProp, scope, forceMount, ...contentImplProps } = props;\n\tvar context = usePopoverContext(scope);\n\tvar adaptContext = (0, import_adapt.useAdaptContext)(context.adaptScope);\n\tvar zIndexFromContext = React.useContext(PopoverZIndexContext);\n\tvar zIndex = zIndexProp !== null && zIndexProp !== void 0 ? zIndexProp : zIndexFromContext;\n\tvar open = usePopoverOpen(scope);\n\tvar contentRef = React.useRef(null);\n\tvar composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);\n\tvar isRightClickOutsideRef = React.useRef(false);\n\tvar [isFullyHidden, setIsFullyHidden] = React.useState(!open);\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\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\tvar _contentImplProps_pointerEvents;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)(import_core.View, {\n\t\t\tpassThrough: context.breakpointActive,\n\t\t\tpointerEvents: open ? (_contentImplProps_pointerEvents = contentImplProps.pointerEvents) !== null && _contentImplProps_pointerEvents !== void 0 ? _contentImplProps_pointerEvents : \"auto\" : \"none\",\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.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 !== null && trapFocus !== void 0 ? trapFocus : open,\n\t\t\t\tdisableOutsidePointerEvents: true,\n\t\t\t\tonCloseAutoFocus: props.onCloseAutoFocus === false ? void 0 : (0, import_helpers.composeEventHandlers)(props.onCloseAutoFocus, function(event) {\n\t\t\t\t\tvar _context_triggerRef_current;\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 = context.triggerRef.current) === null || _context_triggerRef_current === void 0 || _context_triggerRef_current.focus();\n\t\t\t\t}),\n\t\t\t\tonPointerDownOutside: (0, import_helpers.composeEventHandlers)(props.onPointerDownOutside, function(event) {\n\t\t\t\t\tvar originalEvent = event.event;\n\t\t\t\t\tif (!originalEvent) return;\n\t\t\t\t\tvar 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: (0, import_helpers.composeEventHandlers)(props.onFocusOutside, function(event) {\n\t\t\t\t\tif (trapFocus !== null && trapFocus !== void 0 ? 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...import_popper.PopperContentFrame.staticConfig.inlineProps || [],\n\t\"zIndex\",\n\t\"opacity\",\n\t\"y\"\n]) } });\nvar useParentContexts = function(scope) {\n\tvar context = usePopoverContext(scope);\n\tvar triggerContext = usePopoverTriggerContext(scope);\n\treturn {\n\t\tpopperContext: (0, import_popper.usePopperContext)(scope),\n\t\tadaptContext: (0, import_adapt.useAdaptContext)(context.adaptScope),\n\t\tcontext,\n\t\ttriggerContext\n\t};\n};\nfunction RepropagateParentContexts(param) {\n\tvar { adaptContext, children, context, triggerContext, popperContext } = param;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperProvider, {\n\t\tscope: context.popoverScope,\n\t\t...popperContext,\n\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContext.Provider, {\n\t\t\tscope: context.popoverScope,\n\t\t\t...context,\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverTriggerContext.Provider, {\n\t\t\t\tscope: context.popoverScope,\n\t\t\t\t...triggerContext,\n\t\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.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}\nvar PortalAdaptSafe = function(param) {\n\t\"use no memo\";\n\tvar { children, context } = param;\n\tif (needsRepropagation) {\n\t\tvar parentContexts = useParentContexts(context.popoverScope);\n\t\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {\n\t\t\tscope: context.adaptScope,\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {\n\t\tscope: context.adaptScope,\n\t\tchildren\n\t});\n};\nfunction PopoverPortal(param) {\n\t\"use no memo\";\n\tvar { context, open, visuallyActive, zIndex, passThrough, children, onPress } = param;\n\tvar content = children;\n\tif (needsRepropagation) {\n\t\tvar parentContexts = useParentContexts(context.popoverScope);\n\t\tcontent = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RepropagateParentContexts, {\n\t\t\t...parentContexts,\n\t\t\tchildren: content\n\t\t});\n\t}\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_portal.Portal, {\n\t\tpassThrough,\n\t\tstackZIndex: true,\n\t\tzIndex,\n\t\thidden: !visuallyActive,\n\t\tchildren: [!!open && !context.breakpointActive && !context.hoverable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {\n\t\t\tposition: \"absolute\",\n\t\t\tinset: 0,\n\t\t\tonPress: (0, import_helpers.composeEventHandlers)(onPress, context.onOpenToggle)\n\t\t}), content]\n\t});\n}\nvar PopoverContentImpl = (0, import_core.createRefComponent)(function PopoverContentImpl2(props, forwardedRef) {\n\tvar { trapFocus, scope, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, disableFocusScope, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, children, enableRemoveScroll, freezeContentsWhenHidden, setIsFullyHidden, lazyMount, forceUnmount, forceMount, context, open, alwaysDisable, ...contentProps } = props;\n\tvar { disableDismissable } = context;\n\tvar keepChildrenMounted = context.keepChildrenMounted || forceMount;\n\tvar handleExitComplete = React.useCallback(function() {\n\t\tsetIsFullyHidden === null || setIsFullyHidden === void 0 || setIsFullyHidden(true);\n\t}, [setIsFullyHidden]);\n\tvar contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, {\n\t\tdisable: context.breakpointActive,\n\t\tchildren\n\t});\n\tReact.useCallback(function() {\n\t\tcontext.onOpenChange(false, \"press\");\n\t}, [context]);\n\tif (!context.breakpointActive) {}\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate.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__ */ (0, import_jsx_runtime.jsx)(import_popper.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__ */ (0, import_jsx_runtime.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});\nvar PopoverClose = (0, import_core.createRefComponent)(function PopoverClose2(props, forwardedRef) {\n\tvar { scope, className, ...rest } = props;\n\tvar context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {\n\t\t...rest,\n\t\tref: forwardedRef,\n\t\tclassName: `is_PopoverClose ${className || \"\"}`.trim(),\n\t\tonPress: (0, import_helpers.composeEventHandlers)(props.onPress, function() {\n\t\t\tvar _context_onOpenChange;\n\t\t\treturn context === null || context === void 0 ? void 0 : (_context_onOpenChange = context.onOpenChange) === null || _context_onOpenChange === void 0 ? void 0 : _context_onOpenChange.call(context, false, \"press\");\n\t\t})\n\t});\n});\nvar PopoverArrow = (0, import_core.createStyledHOC)(import_popper.PopperArrowFrame, function PopoverArrow2(props, forwardedRef) {\n\tvar { scope, className, ...rest } = props;\n\tvar context = usePopoverContext(scope);\n\tif ((0, import_adapt.useAdaptIsActive)(context.adaptScope)) return null;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperArrow, {\n\t\tscope,\n\t\tclassName: `is_PopoverArrow ${className || \"\"}`.trim(),\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n});\nvar PopoverScrollView = (0, import_core.createRefComponent)(function(param, ref) {\n\tvar { scope, ...props } = param;\n\tvar context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_view.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});\nvar DEFAULT_SCOPE = \"\";\nvar Popover = (0, import_helpers.withStaticProperties)((0, import_core.createRefComponent)(function Popover2(param, ref) {\n\tvar { scope = DEFAULT_SCOPE, ...props } = param;\n\tvar id = React.useId();\n\tvar adaptScope = `PopoverAdapt${scope}`;\n\tvar { open: openProp, defaultOpen, onOpenChange } = props;\n\tvar viaRef = React.useRef(void 0);\n\tvar [open, setOpen] = (0, import_use_controllable_state.useControllableState)({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen || false,\n\t\tonChange: function(val) {\n\t\t\tonOpenChange === null || onOpenChange === void 0 || onOpenChange(val, viaRef.current);\n\t\t}\n\t});\n\tvar handleOpenChange = (0, import_core.useEvent)(function(val, via) {\n\t\tviaRef.current = via;\n\t\tsetOpen(val);\n\t});\n\tReact.useEffect(function() {\n\t\tif (!open) return;\n\t\topenPopovers.add(setOpen);\n\t\treturn function() {\n\t\t\topenPopovers.delete(setOpen);\n\t\t};\n\t}, [open, setOpen]);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptParent, {\n\t\tscope: adaptScope,\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.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: import_adapt.Adapt,\n\tScrollView: PopoverScrollView,\n\tFocusScope: import_focus_scope.FocusScopeController\n});\nvar PopoverInner = (0, import_core.createRefComponent)(function PopoverInner2(props, forwardedRef) {\n\tvar { children, open: _openProp, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, scope = DEFAULT_SCOPE, keepChildrenMounted: keepChildrenMountedProp, hoverable, disableFocus, disableDismissable, zIndex, id, adaptScope, open, setOpen, handleOpenChange, ...restProps } = props;\n\tvar triggerRef = React.useRef(null);\n\tvar [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n\tvar [keepChildrenMounted] = (0, import_use_controllable_state.useControllableState)({\n\t\tprop: keepChildrenMountedProp,\n\t\tdefaultProp: false,\n\t\ttransition: keepChildrenMountedProp === \"lazy\"\n\t});\n\tvar isAdapted = (0, import_adapt.useAdaptIsActive)(adaptScope);\n\tvar floatingContext = (0, import_useFloatingContext.useFloatingContext)({\n\t\topen,\n\t\tsetOpen: handleOpenChange,\n\t\tdisable: isAdapted,\n\t\thoverable,\n\t\tdisableFocus\n\t});\n\tvar [anchorTo, setAnchorToRaw] = React.useState();\n\tvar setAnchorTo = (0, import_core.useCreateShallowSetState)(setAnchorToRaw);\n\tReact.useImperativeHandle(forwardedRef, function() {\n\t\treturn {\n\t\t\tanchorTo: setAnchorTo,\n\t\t\ttoggle: function() {\n\t\t\t\treturn setOpen(function(prev) {\n\t\t\t\t\treturn !prev;\n\t\t\t\t});\n\t\t\t},\n\t\t\topen: function() {\n\t\t\t\treturn setOpen(true);\n\t\t\t},\n\t\t\tclose: function() {\n\t\t\t\treturn setOpen(false);\n\t\t\t},\n\t\t\tsetOpen\n\t\t};\n\t});\n\tvar contentId = React.useId();\n\tvar onOpenToggle = (0, import_core.useEvent)(function() {\n\t\tif (open && isAdapted) return;\n\t\tsetOpen(!open);\n\t});\n\tvar onCustomAnchorAdd = React.useCallback(function() {\n\t\treturn setHasCustomAnchor(true);\n\t}, []);\n\tvar onCustomAnchorRemove = React.useCallback(function() {\n\t\treturn setHasCustomAnchor(false);\n\t}, []);\n\tvar contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.Popper, {\n\t\topen,\n\t\tpassThrough: isAdapted,\n\t\tscope,\n\t\tstayInFrame: true,\n\t\t...restProps,\n\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.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\tvar result = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: import_constants.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_floating.FloatingOverrideContext.Provider, {\n\t\tvalue: floatingContext,\n\t\tchildren: contents\n\t}) : contents });\n\tif (zIndex !== void 0) return /* @__PURE__ */ (0, import_jsx_runtime.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//# sourceMappingURL=Popover.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,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AC;CACD,IAAI,SAAyB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,mBAAmB,UAAU,EAAE,UAAU,iBAAiB,QAAwB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,gBAAgB,wBAAwB,UAAU;EACxN,OAAO;EACP,UAAU;CACX,CAAC,IAAI,SAAS,CAAC;CACf,IAAI,WAAW,KAAK,GAAG,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,qBAAqB,UAAU;EACxG,OAAO;EACP,UAAU;CACX,CAAC;CACD,OAAO;AACR,CAAC;AACD,SAAS,SAAS,MAAM;CACvB,OAAO,OAAO,SAAS;AACxB"}
1
+ {"version":3,"file":"Popover.native.js","names":[],"sources":["jsx/Popover.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Popover_exports = {};\n__export(Popover_exports, {\n\tPopover: () => Popover,\n\tPopoverAnchor: () => PopoverAnchor,\n\tPopoverArrow: () => PopoverArrow,\n\tPopoverClose: () => PopoverClose,\n\tPopoverContent: () => PopoverContent,\n\tPopoverContext: () => PopoverContext,\n\tPopoverContextProvider: () => PopoverContextProvider,\n\tPopoverTrigger: () => PopoverTrigger,\n\tPopoverTriggerContext: () => PopoverTriggerContext,\n\tPopoverZIndexContext: () => PopoverZIndexContext,\n\tcloseLastOpenedPopover: () => closeLastOpenedPopover,\n\tcloseOpenPopovers: () => closeOpenPopovers,\n\thasOpenPopovers: () => hasOpenPopovers,\n\tusePopoverContext: () => usePopoverContext,\n\tusePopoverOpen: () => usePopoverOpen,\n\tusePopoverTriggerContext: () => usePopoverTriggerContext,\n\tusePopoverTriggerSetup: () => usePopoverTriggerSetup\n});\nmodule.exports = __toCommonJS(Popover_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nrequire(\"@tamagui/polyfill-dev\");\nvar import_adapt = require(\"@tamagui/adapt\");\nvar import_animate = require(\"@tamagui/animate\");\nvar import_animate_presence = require(\"@tamagui/animate-presence\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_dismissable = require(\"@tamagui/dismissable\");\nvar import_floating = require(\"@tamagui/floating\");\nvar import_focus_scope = require(\"@tamagui/focus-scope\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_popper = require(\"@tamagui/popper\");\nvar import_portal = require(\"@tamagui/portal\");\nrequire(\"@tamagui/remove-scroll\");\nvar import_scroll_view = require(\"@tamagui/scroll-view\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_useFloatingContext = require(\"./useFloatingContext\");\nvar needsRepropagation = (0, import_portal.needsPortalRepropagation)();\nvar openPopovers = /* @__PURE__ */ new Set();\nvar hasOpenPopovers = function() {\n\treturn openPopovers.size > 0;\n};\nvar closeOpenPopovers = function() {\n\tif (openPopovers.size === 0) return false;\n\topenPopovers.forEach(function(setOpen) {\n\t\treturn setOpen(false);\n\t});\n\treturn true;\n};\nvar closeLastOpenedPopover = function() {\n\tif (openPopovers.size === 0) return false;\n\tvar last = Array.from(openPopovers).pop();\n\tif (last) {\n\t\tlast(false);\n\t\treturn true;\n\t}\n\treturn false;\n};\nvar PopoverContext = (0, import_core.createStyledContext)(\n\t// since we always provide this we can avoid setting here\n\t{},\n\t\"Popover__\"\n);\nvar PopoverZIndexContext = /* @__PURE__ */ React.createContext(void 0);\nvar PopoverTriggerContext = (0, import_core.createStyledContext)({}, \"PopoverTrigger__\");\nvar usePopoverContext = PopoverContext.useStyledContext;\nvar usePopoverTriggerContext = PopoverTriggerContext.useStyledContext;\nfunction usePopoverOpen(scope) {\n\treturn usePopoverContext(scope).open;\n}\nfunction usePopoverTriggerSetup(open) {\n\tvar triggerStateSettersRef = React.useRef(/* @__PURE__ */ new Map());\n\tvar activeTriggerIdRef = React.useRef(null);\n\tvar setActiveTrigger = (0, import_core.useEvent)(function(id) {\n\t\tvar prevId = activeTriggerIdRef.current;\n\t\tif (prevId === id) return;\n\t\tif (prevId) {\n\t\t\tvar _triggerStateSettersRef_current_get;\n\t\t\t(_triggerStateSettersRef_current_get = triggerStateSettersRef.current.get(prevId)) === null || _triggerStateSettersRef_current_get === void 0 || _triggerStateSettersRef_current_get(false);\n\t\t}\n\t\tactiveTriggerIdRef.current = id;\n\t\tif (id && open) {\n\t\t\tvar _triggerStateSettersRef_current_get1;\n\t\t\t(_triggerStateSettersRef_current_get1 = triggerStateSettersRef.current.get(id)) === null || _triggerStateSettersRef_current_get1 === void 0 || _triggerStateSettersRef_current_get1(true);\n\t\t}\n\t});\n\tvar registerTrigger = (0, import_core.useEvent)(function(id, setOpenState) {\n\t\ttriggerStateSettersRef.current.set(id, setOpenState);\n\t\tsetOpenState(activeTriggerIdRef.current === id && open);\n\t});\n\tvar unregisterTrigger = (0, import_core.useEvent)(function(id) {\n\t\ttriggerStateSettersRef.current.delete(id);\n\t\tif (activeTriggerIdRef.current === id) activeTriggerIdRef.current = null;\n\t});\n\tReact.useEffect(function() {\n\t\tif (!open) {\n\t\t\tsetActiveTrigger(null);\n\t\t\treturn;\n\t\t}\n\t\tvar activeId = activeTriggerIdRef.current;\n\t\tif (activeId) {\n\t\t\tvar _triggerStateSettersRef_current_get;\n\t\t\t(_triggerStateSettersRef_current_get = triggerStateSettersRef.current.get(activeId)) === null || _triggerStateSettersRef_current_get === void 0 || _triggerStateSettersRef_current_get(true);\n\t\t}\n\t}, [open, setActiveTrigger]);\n\treturn {\n\t\tsetActiveTrigger,\n\t\tregisterTrigger,\n\t\tunregisterTrigger\n\t};\n}\nvar PopoverContextProvider = /* @__PURE__ */ React.memo(function(param) {\n\tvar { scope, children, open, onOpenChange, onOpenToggle, triggerRef, id = \"\", contentId, hasCustomAnchor = false, onCustomAnchorAdd = voidFn, onCustomAnchorRemove = voidFn, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable, closeReasonRef } = param;\n\tvar [branches] = React.useState(function() {\n\t\treturn /* @__PURE__ */ new Set();\n\t});\n\tvar { setActiveTrigger, registerTrigger, unregisterTrigger } = usePopoverTriggerSetup(open);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.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});\nvar voidFn = function() {};\nvar PopoverAnchor = /* @__PURE__ */ React.memo((0, import_core.createRefComponent)(function PopoverAnchor2(props, forwardedRef) {\n\tvar { scope, ...rest } = props;\n\tvar { onCustomAnchorAdd, onCustomAnchorRemove } = usePopoverContext(scope) || {};\n\tReact.useEffect(function() {\n\t\tonCustomAnchorAdd();\n\t\treturn function() {\n\t\t\treturn onCustomAnchorRemove();\n\t\t};\n\t}, [onCustomAnchorAdd, onCustomAnchorRemove]);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperAnchor, {\n\t\tscope,\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n}));\nvar PopoverTrigger = /* @__PURE__ */ React.memo((0, import_core.createRefComponent)(function PopoverTrigger2(props, forwardedRef) {\n\tvar { scope, disablePressTrigger, ...rest } = props;\n\tvar triggerContext = usePopoverTriggerContext(scope);\n\tvar popperContext = (0, import_popper.usePopperContextSlow)(scope);\n\tvar triggerId = React.useId();\n\tvar [open, setOpen] = React.useState(false);\n\tvar anchorTo = triggerContext.anchorTo;\n\tvar triggerElRef = React.useRef(null);\n\tvar composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, triggerElRef);\n\tvar { registerTrigger, unregisterTrigger } = triggerContext;\n\tReact.useEffect(function() {\n\t\tregisterTrigger(triggerId, setOpen);\n\t\treturn function() {\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\tvar activateSelf = function() {\n\t\ttriggerContext.setActiveTrigger(triggerId);\n\t\tvar el = triggerElRef.current;\n\t\tif (el) triggerContext.triggerRef.current = el;\n\t};\n\tvar trigger = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.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: (0, import_helpers.composeEventHandlers)(rest.onPress, function() {\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: (0, import_helpers.composeEventHandlers)(rest.onMouseEnter, activateSelf),\n\t\tonPressIn: (0, import_helpers.composeEventHandlers)(rest.onPressIn, activateSelf),\n\t\tonFocus: (0, import_helpers.composeEventHandlers)(rest.onFocus, function(event) {\n\t\t\tvar _popperContext_getReferenceProps_onFocus, _popperContext_getReferenceProps, _popperContext_getReferenceProps_call;\n\t\t\tactivateSelf();\n\t\t\t(_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);\n\t\t}),\n\t\tonBlur: (0, import_helpers.composeEventHandlers)(rest.onBlur, function(event) {\n\t\t\tvar _popperContext_getReferenceProps_onBlur, _popperContext_getReferenceProps, _popperContext_getReferenceProps_call;\n\t\t\t(_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);\n\t\t})\n\t});\n\tvar virtualRef = React.useMemo(function() {\n\t\tif (!anchorTo) return null;\n\t\treturn { current: {\n\t\t\tgetBoundingClientRect: function() {\n\t\t\t\treturn import_constants.isWeb ? DOMRect.fromRect(anchorTo) : anchorTo;\n\t\t\t},\n\t\t\t...!import_constants.isWeb && {\n\t\t\t\tmeasure: function(c) {\n\t\t\t\t\treturn c(anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height);\n\t\t\t\t},\n\t\t\t\tmeasureInWindow: function(c) {\n\t\t\t\t\treturn c(anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width, anchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height);\n\t\t\t\t}\n\t\t\t}\n\t\t} };\n\t}, [\n\t\ttriggerContext.anchorTo,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.x,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.y,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.height,\n\t\tanchorTo === null || anchorTo === void 0 ? void 0 : anchorTo.width\n\t]);\n\tvar wrappedTrigger = import_constants.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dismissable.DismissableBranch, {\n\t\tbranches: triggerContext.branches,\n\t\tchildren: trigger\n\t}) : trigger;\n\treturn triggerContext.hasCustomAnchor ? wrappedTrigger : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperAnchor, {\n\t\t...virtualRef && { virtualRef },\n\t\tscope,\n\t\tasChild: true,\n\t\tchildren: wrappedTrigger\n\t});\n}));\nvar PopoverContent = (0, import_core.createStyledHOC)(import_popper.PopperContentFrame, function PopoverContent2(props, forwardedRef) {\n\tvar { trapFocus, enableRemoveScroll = false, zIndex: zIndexProp, scope, forceMount, ...contentImplProps } = props;\n\tvar context = usePopoverContext(scope);\n\tvar adaptContext = (0, import_adapt.useAdaptContext)(context.adaptScope);\n\tvar zIndexFromContext = React.useContext(PopoverZIndexContext);\n\tvar zIndex = zIndexProp !== null && zIndexProp !== void 0 ? zIndexProp : zIndexFromContext;\n\tvar open = usePopoverOpen(scope);\n\tvar contentRef = React.useRef(null);\n\tvar composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);\n\tvar isRightClickOutsideRef = React.useRef(false);\n\tvar [isFullyHidden, setIsFullyHidden] = React.useState(!open);\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\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\tvar _contentImplProps_pointerEvents;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)(import_core.View, {\n\t\t\tpassThrough: context.breakpointActive,\n\t\t\tpointerEvents: open ? (_contentImplProps_pointerEvents = contentImplProps.pointerEvents) !== null && _contentImplProps_pointerEvents !== void 0 ? _contentImplProps_pointerEvents : \"auto\" : \"none\",\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.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 !== null && trapFocus !== void 0 ? trapFocus : open,\n\t\t\t\tdisableOutsidePointerEvents: true,\n\t\t\t\tonCloseAutoFocus: props.onCloseAutoFocus === false ? void 0 : (0, import_helpers.composeEventHandlers)(props.onCloseAutoFocus, function(event) {\n\t\t\t\t\tvar _context_triggerRef_current;\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 = context.triggerRef.current) === null || _context_triggerRef_current === void 0 || _context_triggerRef_current.focus();\n\t\t\t\t}),\n\t\t\t\tonPointerDownOutside: (0, import_helpers.composeEventHandlers)(props.onPointerDownOutside, function(event) {\n\t\t\t\t\tvar originalEvent = event.event;\n\t\t\t\t\tif (!originalEvent) return;\n\t\t\t\t\tvar 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: (0, import_helpers.composeEventHandlers)(props.onFocusOutside, function(event) {\n\t\t\t\t\tif (trapFocus !== null && trapFocus !== void 0 ? 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...import_popper.PopperContentFrame.staticConfig.inlineProps || [],\n\t\"zIndex\",\n\t\"opacity\",\n\t\"y\"\n]) } });\nvar useParentContexts = function(scope) {\n\tvar context = usePopoverContext(scope);\n\tvar triggerContext = usePopoverTriggerContext(scope);\n\treturn {\n\t\tpopperContext: (0, import_popper.usePopperContext)(scope),\n\t\tadaptContext: (0, import_adapt.useAdaptContext)(context.adaptScope),\n\t\tcontext,\n\t\ttriggerContext\n\t};\n};\nfunction RepropagateParentContexts(param) {\n\tvar { adaptContext, children, context, triggerContext, popperContext } = param;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperProvider, {\n\t\tscope: context.popoverScope,\n\t\t...popperContext,\n\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContext.Provider, {\n\t\t\tscope: context.popoverScope,\n\t\t\t...context,\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverTriggerContext.Provider, {\n\t\t\t\tscope: context.popoverScope,\n\t\t\t\t...triggerContext,\n\t\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.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}\nvar PortalAdaptSafe = function(param) {\n\t\"use no memo\";\n\tvar { children, context } = param;\n\tif (needsRepropagation) {\n\t\tvar parentContexts = useParentContexts(context.popoverScope);\n\t\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {\n\t\t\tscope: context.adaptScope,\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.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__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {\n\t\tscope: context.adaptScope,\n\t\tchildren\n\t});\n};\nfunction PopoverPortal(param) {\n\t\"use no memo\";\n\tvar { context, open, visuallyActive, zIndex, passThrough, children, onPress } = param;\n\tvar content = children;\n\tif (needsRepropagation) {\n\t\tvar parentContexts = useParentContexts(context.popoverScope);\n\t\tcontent = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RepropagateParentContexts, {\n\t\t\t...parentContexts,\n\t\t\tchildren: content\n\t\t});\n\t}\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_portal.Portal, {\n\t\tpassThrough,\n\t\tstackZIndex: true,\n\t\tzIndex,\n\t\thidden: !visuallyActive,\n\t\tchildren: [!!open && !context.breakpointActive && !context.hoverable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {\n\t\t\tposition: \"absolute\",\n\t\t\tinset: 0,\n\t\t\tonPress: (0, import_helpers.composeEventHandlers)(onPress, context.onOpenToggle)\n\t\t}), content]\n\t});\n}\nvar PopoverContentImpl = (0, import_core.createRefComponent)(function PopoverContentImpl2(props, forwardedRef) {\n\tvar { trapFocus, scope, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, disableFocusScope, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, children, enableRemoveScroll, freezeContentsWhenHidden, setIsFullyHidden, lazyMount, forceUnmount, forceMount, context, open, alwaysDisable, ...contentProps } = props;\n\tvar { disableDismissable } = context;\n\tvar keepChildrenMounted = context.keepChildrenMounted || forceMount;\n\tvar handleExitComplete = React.useCallback(function() {\n\t\tsetIsFullyHidden === null || setIsFullyHidden === void 0 || setIsFullyHidden(true);\n\t}, [setIsFullyHidden]);\n\tvar contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, {\n\t\tdisable: context.breakpointActive,\n\t\tchildren\n\t});\n\tReact.useCallback(function(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\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate.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__ */ (0, import_jsx_runtime.jsx)(import_popper.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__ */ (0, import_jsx_runtime.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});\nvar PopoverClose = (0, import_core.createRefComponent)(function PopoverClose2(props, forwardedRef) {\n\tvar { scope, className, ...rest } = props;\n\tvar context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {\n\t\t...rest,\n\t\tref: forwardedRef,\n\t\tclassName: `is_PopoverClose ${className || \"\"}`.trim(),\n\t\tonPress: (0, import_helpers.composeEventHandlers)(props.onPress, function() {\n\t\t\tvar _context_onOpenChange;\n\t\t\treturn context === null || context === void 0 ? void 0 : (_context_onOpenChange = context.onOpenChange) === null || _context_onOpenChange === void 0 ? void 0 : _context_onOpenChange.call(context, false, \"press\");\n\t\t})\n\t});\n});\nvar PopoverArrow = (0, import_core.createStyledHOC)(import_popper.PopperArrowFrame, function PopoverArrow2(props, forwardedRef) {\n\tvar { scope, className, ...rest } = props;\n\tvar context = usePopoverContext(scope);\n\tif ((0, import_adapt.useAdaptIsActive)(context.adaptScope)) return null;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperArrow, {\n\t\tscope,\n\t\tclassName: `is_PopoverArrow ${className || \"\"}`.trim(),\n\t\t...rest,\n\t\tref: forwardedRef\n\t});\n});\nvar PopoverScrollView = (0, import_core.createRefComponent)(function(param, ref) {\n\tvar { scope, ...props } = param;\n\tvar context = usePopoverContext(scope);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_view.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});\nvar DEFAULT_SCOPE = \"\";\nvar Popover = (0, import_helpers.withStaticProperties)((0, import_core.createRefComponent)(function Popover2(param, ref) {\n\tvar { scope = DEFAULT_SCOPE, ...props } = param;\n\tvar id = React.useId();\n\tvar adaptScope = `PopoverAdapt${scope}`;\n\tvar { open: openProp, defaultOpen, onOpenChange } = props;\n\tvar viaRef = React.useRef(void 0);\n\tvar closeReasonRef = React.useRef(void 0);\n\tvar [open, setOpen] = (0, import_use_controllable_state.useControllableState)({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen || false,\n\t\tonChange: function(val) {\n\t\t\tonOpenChange === null || onOpenChange === void 0 || onOpenChange(val, viaRef.current);\n\t\t}\n\t});\n\tvar handleOpenChange = (0, import_core.useEvent)(function(val, via) {\n\t\tviaRef.current = via;\n\t\tsetOpen(val);\n\t});\n\tReact.useEffect(function() {\n\t\tif (!open) return;\n\t\topenPopovers.add(setOpen);\n\t\treturn function() {\n\t\t\topenPopovers.delete(setOpen);\n\t\t};\n\t}, [open, setOpen]);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptParent, {\n\t\tscope: adaptScope,\n\t\tadaptChildren: props.children,\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.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: import_adapt.Adapt,\n\tScrollView: PopoverScrollView,\n\tFocusScope: import_focus_scope.FocusScopeController\n});\nvar PopoverInner = (0, import_core.createRefComponent)(function PopoverInner2(props, forwardedRef) {\n\tvar { 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\tvar triggerRef = React.useRef(null);\n\tvar [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n\tvar [keepChildrenMounted] = (0, import_use_controllable_state.useControllableState)({\n\t\tprop: keepChildrenMountedProp,\n\t\tdefaultProp: false,\n\t\ttransition: keepChildrenMountedProp === \"lazy\"\n\t});\n\tvar isAdapted = (0, import_adapt.useAdaptIsActive)(adaptScope);\n\tvar floatingContext = (0, import_useFloatingContext.useFloatingContext)({\n\t\topen,\n\t\tsetOpen: handleOpenChange,\n\t\tcloseReasonRef,\n\t\tdisable: isAdapted,\n\t\thoverable,\n\t\tdisableFocus\n\t});\n\tvar [anchorTo, setAnchorToRaw] = React.useState();\n\tvar setAnchorTo = (0, import_core.useCreateShallowSetState)(setAnchorToRaw);\n\tReact.useImperativeHandle(forwardedRef, function() {\n\t\treturn {\n\t\t\tanchorTo: setAnchorTo,\n\t\t\ttoggle: function() {\n\t\t\t\treturn setOpen(function(prev) {\n\t\t\t\t\treturn !prev;\n\t\t\t\t});\n\t\t\t},\n\t\t\topen: function() {\n\t\t\t\treturn setOpen(true);\n\t\t\t},\n\t\t\tclose: function() {\n\t\t\t\treturn setOpen(false);\n\t\t\t},\n\t\t\tsetOpen\n\t\t};\n\t});\n\tvar contentId = React.useId();\n\tvar onOpenToggle = (0, import_core.useEvent)(function() {\n\t\tif (open && isAdapted) return;\n\t\tcloseReasonRef.current = open ? \"reference-press\" : void 0;\n\t\tsetOpen(!open);\n\t});\n\tvar onCustomAnchorAdd = React.useCallback(function() {\n\t\treturn setHasCustomAnchor(true);\n\t}, []);\n\tvar onCustomAnchorRemove = React.useCallback(function() {\n\t\treturn setHasCustomAnchor(false);\n\t}, []);\n\tvar contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.Popper, {\n\t\topen,\n\t\tpassThrough: isAdapted,\n\t\tscope,\n\t\tstayInFrame: true,\n\t\t...restProps,\n\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.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\tvar result = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: import_constants.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_floating.FloatingOverrideContext.Provider, {\n\t\tvalue: floatingContext,\n\t\tchildren: contents\n\t}) : contents });\n\tif (zIndex !== void 0) return /* @__PURE__ */ (0, import_jsx_runtime.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//# sourceMappingURL=Popover.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ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
2
  import { PopupTriggerMap, createFloatingEvents, safePolygon, useDelayGroup, useFloatingRaw, useFocus, useHover, useInteractions, useRole } from "@tamagui/floating";
3
3
 
4
- const useFloatingContext = ({ open, setOpen, disable, disableFocus, hoverable, role: roleProp = "dialog", focus: focusProp, groupId, delay: delayProp, restMs: restMsProp }) => {
4
+ const useFloatingContext = ({ open, setOpen, disable, disableFocus, hoverable, role: roleProp = "dialog", focus: focusProp, groupId, delay: delayProp, restMs: restMsProp, closeReasonRef }) => {
5
5
  "use no memo";
6
6
  const openRef = React.useRef(open);
7
7
  openRef.current = open;
@@ -24,8 +24,19 @@ const useFloatingContext = ({ open, setOpen, disable, disableFocus, hoverable, r
24
24
  const events = React.useMemo(() => createFloatingEvents(), []);
25
25
  const triggerElements = React.useMemo(() => new PopupTriggerMap(), []);
26
26
  React.useEffect(() => {
27
- events.emit("openchange", { open });
28
- }, [open, events]);
27
+ const reason = closeReasonRef?.current;
28
+ if (closeReasonRef) {
29
+ closeReasonRef.current = void 0;
30
+ }
31
+ events.emit("openchange", {
32
+ open,
33
+ reason: open ? void 0 : reason
34
+ });
35
+ }, [
36
+ open,
37
+ events,
38
+ closeReasonRef
39
+ ]);
29
40
  return React.useCallback((props) => {
30
41
  const onTriggerRef = React.useRef(false);
31
42
  const restTimerRef = React.useRef(void 0);
@@ -39,7 +50,7 @@ const useFloatingContext = ({ open, setOpen, disable, disableFocus, hoverable, r
39
50
  clearTimeout(graceRef.current);
40
51
  };
41
52
  }, []);
42
- const onOpenChange = (val, event) => {
53
+ const onOpenChange = (val, event, reason) => {
43
54
  if (val && event?.type === "mouseenter") {
44
55
  return;
45
56
  }
@@ -48,6 +59,7 @@ const useFloatingContext = ({ open, setOpen, disable, disableFocus, hoverable, r
48
59
  return;
49
60
  }
50
61
  const type = event?.type === "mousemove" || event?.type === "mouseenter" || event?.type === "mouseleave" ? "hover" : "press";
62
+ if (closeReasonRef) closeReasonRef.current = reason;
51
63
  setOpen(val, type);
52
64
  };
53
65
  const floating = useFloatingRaw({
@@ -184,7 +196,7 @@ const useFloatingContext = ({ open, setOpen, disable, disableFocus, hoverable, r
184
196
  }, 40);
185
197
  } : void 0
186
198
  };
187
- }, [setOpen]);
199
+ }, [setOpen, closeReasonRef]);
188
200
  };
189
201
 
190
202
  export { useFloatingContext };
@@ -1 +1 @@
1
- {"version":3,"file":"useFloatingContext.js","names":[],"sources":["jsx/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]\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,iBACJ;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;CACjD,gBAAgB,UAAU;CAC1B,MAAM,UAAU,MAAM,OAAO,QAAQ;CACrC,QAAQ,UAAU;CAClB,MAAM,WAAW,MAAM,OAAO,SAAS;CACvC,SAAS,UAAU;CACnB,MAAM,aAAa,MAAM,OAAO,OAAO;CACvC,WAAW,UAAU;CACrB,MAAM,WAAW,MAAM,OAAO,SAAS;CACvC,SAAS,UAAU;CACnB,MAAM,YAAY,MAAM,OAAO,UAAU;CACzC,UAAU,UAAU;CACpB,MAAM,SAAS,MAAM,cAAc,qBAAqB,GAAG,CAAC,CAAC;CAC7D,MAAM,kBAAkB,MAAM,cAAc,IAAI,gBAAgB,GAAG,CAAC,CAAC;CACrE,MAAM,gBAAgB;EACpB,OAAO,KAAK,cAAc,EAAE,KAAK,CAAC;CACpC,GAAG,CAAC,MAAM,MAAM,CAAC;CACjB,OAAO,MAAM,aACV,UAAU;EACT,MAAM,eAAe,MAAM,OAAO,KAAK;EACvC,MAAM,eAAe,MAAM,OAAO,KAAK,CAAC;EACxC,MAAM,WAAW,MAAM,OAAO,KAAK,CAAC;EACpC,MAAM,kBAAkB,MAAM,OAAO,KAAK;EAC1C,MAAM,oBAAoB,MAAM,OAAO,KAAK;EAC5C,MAAM,uBAAuB,MAAM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B,aAAa,UAAU,iBAAiB;KACtC,QAAQ,MAAM,OAAO;IACvB,GAAG,MAAM;GACX,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":["jsx/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,MA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M,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,SAAS,cAAc,CAC1B;AACF"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@tamagui/popover",
3
- "version": "3.0.0-beta.924.1",
3
+ "version": "3.0.0",
4
+ "license": "MIT",
4
5
  "source": "src/index.ts",
5
6
  "files": [
6
7
  "src",
@@ -34,31 +35,31 @@
34
35
  "clean:build": "tamagui-build clean:build"
35
36
  },
36
37
  "dependencies": {
37
- "@tamagui/adapt": "3.0.0-beta.924.1",
38
- "@tamagui/animate": "3.0.0-beta.924.1",
39
- "@tamagui/animate-presence": "3.0.0-beta.924.1",
40
- "@tamagui/compose-refs": "3.0.0-beta.924.1",
41
- "@tamagui/constants": "3.0.0-beta.924.1",
42
- "@tamagui/core": "3.0.0-beta.924.1",
43
- "@tamagui/dismissable": "3.0.0-beta.924.1",
44
- "@tamagui/floating": "3.0.0-beta.924.1",
45
- "@tamagui/focus-scope": "3.0.0-beta.924.1",
46
- "@tamagui/helpers": "3.0.0-beta.924.1",
47
- "@tamagui/polyfill-dev": "3.0.0-beta.924.1",
48
- "@tamagui/popper": "3.0.0-beta.924.1",
49
- "@tamagui/portal": "3.0.0-beta.924.1",
50
- "@tamagui/remove-scroll": "3.0.0-beta.924.1",
51
- "@tamagui/scroll-view": "3.0.0-beta.924.1",
52
- "@tamagui/sheet": "3.0.0-beta.924.1",
53
- "@tamagui/stacks": "3.0.0-beta.924.1",
54
- "@tamagui/use-controllable-state": "3.0.0-beta.924.1",
55
- "@tamagui/z-index-stack": "3.0.0-beta.924.1",
38
+ "@tamagui/adapt": "3.0.0",
39
+ "@tamagui/animate": "3.0.0",
40
+ "@tamagui/animate-presence": "3.0.0",
41
+ "@tamagui/compose-refs": "3.0.0",
42
+ "@tamagui/constants": "3.0.0",
43
+ "@tamagui/core": "3.0.0",
44
+ "@tamagui/dismissable": "3.0.0",
45
+ "@tamagui/floating": "3.0.0",
46
+ "@tamagui/focus-scope": "3.0.0",
47
+ "@tamagui/helpers": "3.0.0",
48
+ "@tamagui/polyfill-dev": "3.0.0",
49
+ "@tamagui/popper": "3.0.0",
50
+ "@tamagui/portal": "3.0.0",
51
+ "@tamagui/remove-scroll": "3.0.0",
52
+ "@tamagui/scroll-view": "3.0.0",
53
+ "@tamagui/sheet": "3.0.0",
54
+ "@tamagui/stacks": "3.0.0",
55
+ "@tamagui/use-controllable-state": "3.0.0",
56
+ "@tamagui/z-index-stack": "3.0.0",
56
57
  "react-freeze": "^1.0.3"
57
58
  },
58
59
  "devDependencies": {
59
- "@tamagui/build": "3.0.0-beta.924.1",
60
+ "@tamagui/build": "3.0.0",
60
61
  "react": "19.2.3",
61
- "react-native": "0.86.2"
62
+ "react-native": "0.87.1"
62
63
  },
63
64
  "peerDependencies": {
64
65
  "react": ">=19"
@@ -68,5 +69,6 @@
68
69
  "type": "git",
69
70
  "url": "git+https://github.com/tamagui/tamagui.git",
70
71
  "directory": "code/ui/popover"
71
- }
72
+ },
73
+ "releaseSourceCommit": "15fbca480b143f876f6975601e23a17d3f90d2ee"
72
74
  }
package/src/Popover.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import '@tamagui/polyfill-dev'
2
2
 
3
- import type { UseHoverProps } from '@tamagui/floating'
3
+ import type { OpenChangeReason, UseHoverProps } from '@tamagui/floating'
4
4
  import {
5
5
  Adapt,
6
6
  AdaptParent,
@@ -13,7 +13,7 @@ import { Animate } from '@tamagui/animate'
13
13
  import { ResetPresence } from '@tamagui/animate-presence'
14
14
  import { useComposedRefs } from '@tamagui/compose-refs'
15
15
  import { isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'
16
- import type { SizeTokens, GetRef, TamaguiElement, ViewProps } from '@tamagui/core'
16
+ import type { GetRef, TamaguiElement, ViewProps } from '@tamagui/core'
17
17
  import {
18
18
  createStyledHOC,
19
19
  createRefComponent,
@@ -44,6 +44,7 @@ import {
44
44
  type PopperProps,
45
45
  PopperProvider,
46
46
  usePopperContext,
47
+ usePopperContextSlow,
47
48
  } from '@tamagui/popper'
48
49
  import { needsPortalRepropagation, Portal } from '@tamagui/portal'
49
50
  import { RemoveScroll } from '@tamagui/remove-scroll'
@@ -105,7 +106,8 @@ export type PopoverProps = ScopedPopoverProps<PopperProps> & {
105
106
  hoverable?: boolean | UseHoverProps
106
107
 
107
108
  /**
108
- * Disable focusing behavior on open
109
+ * disable opening when the trigger receives keyboard focus.
110
+ * defaults to true unless hoverable is enabled.
109
111
  */
110
112
  disableFocus?: boolean
111
113
 
@@ -143,7 +145,6 @@ type PopoverContextValue = {
143
145
  hasCustomAnchor: boolean
144
146
  onCustomAnchorAdd(): void
145
147
  onCustomAnchorRemove(): void
146
- size?: SizeTokens
147
148
  breakpointActive?: boolean
148
149
  keepChildrenMounted?: boolean | 'lazy'
149
150
  disableDismissable?: boolean
@@ -151,6 +152,8 @@ type PopoverContextValue = {
151
152
  anchorTo?: Rect
152
153
  // scoped branches Set for DismissableBranch/Dismissable to share
153
154
  branches: Set<HTMLElement>
155
+ // carry dismissal intent through focus restoration.
156
+ closeReasonRef?: React.RefObject<OpenChangeReason | undefined>
154
157
  }
155
158
 
156
159
  type PopoverTriggerStateSetter = React.Dispatch<React.SetStateAction<boolean>>
@@ -260,6 +263,7 @@ export type PopoverContextProviderProps = {
260
263
  keepChildrenMounted?: boolean | 'lazy'
261
264
  disableDismissable?: boolean
262
265
  hoverable?: boolean | object
266
+ closeReasonRef?: React.RefObject<OpenChangeReason | undefined>
263
267
  }
264
268
 
265
269
  /**
@@ -285,6 +289,7 @@ export const PopoverContextProvider = React.memo(
285
289
  keepChildrenMounted,
286
290
  disableDismissable,
287
291
  hoverable,
292
+ closeReasonRef,
288
293
  }: PopoverContextProviderProps) => {
289
294
  const [branches] = React.useState(() => new Set<HTMLElement>())
290
295
  const { setActiveTrigger, registerTrigger, unregisterTrigger } =
@@ -310,6 +315,7 @@ export const PopoverContextProvider = React.memo(
310
315
  keepChildrenMounted={keepChildrenMounted}
311
316
  disableDismissable={disableDismissable}
312
317
  hoverable={hoverable}
318
+ closeReasonRef={closeReasonRef}
313
319
  >
314
320
  <PopoverTriggerContext.Provider
315
321
  scope={scope}
@@ -374,6 +380,7 @@ export const PopoverTrigger = React.memo(
374
380
  function PopoverTrigger(props, forwardedRef) {
375
381
  const { scope, disablePressTrigger, ...rest } = props
376
382
  const triggerContext = usePopoverTriggerContext(scope)
383
+ const popperContext = usePopperContextSlow(scope)
377
384
  const triggerId = React.useId()
378
385
  const [open, setOpen] = React.useState(false)
379
386
  const anchorTo = triggerContext.anchorTo
@@ -418,7 +425,13 @@ export const PopoverTrigger = React.memo(
418
425
  })}
419
426
  onMouseEnter={composeEventHandlers(rest.onMouseEnter as any, activateSelf)}
420
427
  onPressIn={composeEventHandlers(rest.onPressIn as any, activateSelf)}
421
- onFocus={composeEventHandlers(rest.onFocus as any, activateSelf)}
428
+ onFocus={composeEventHandlers(rest.onFocus as any, (event) => {
429
+ activateSelf()
430
+ popperContext.getReferenceProps?.({ ref: triggerElRef }).onFocus?.(event)
431
+ })}
432
+ onBlur={composeEventHandlers(rest.onBlur as any, (event) => {
433
+ popperContext.getReferenceProps?.({ ref: triggerElRef }).onBlur?.(event)
434
+ })}
422
435
  />
423
436
  )
424
437
 
@@ -812,9 +825,16 @@ const PopoverContentImpl = createRefComponent<
812
825
  <ResetPresence disable={context.breakpointActive}>{children}</ResetPresence>
813
826
  )
814
827
 
815
- const handleDismiss = React.useCallback(() => {
816
- context.onOpenChange(false, 'press')
817
- }, [context])
828
+ const handleDismiss = React.useCallback<NonNullable<DismissableProps['onDismiss']>>(
829
+ (details) => {
830
+ if (context.closeReasonRef) {
831
+ context.closeReasonRef.current =
832
+ details.reason === 'escape-key' ? 'escape-key' : 'dismiss'
833
+ }
834
+ context.onOpenChange(false, 'press')
835
+ },
836
+ [context]
837
+ )
818
838
 
819
839
  // i want to avoid reparenting but react-remove-scroll makes it hard
820
840
  // TODO its removed now so we can probable do it now
@@ -989,6 +1009,7 @@ export const Popover = withStaticProperties(
989
1009
  const adaptScope = `PopoverAdapt${scope}`
990
1010
  const { open: openProp, defaultOpen, onOpenChange } = props
991
1011
  const viaRef = React.useRef<PopoverVia>(undefined)
1012
+ const closeReasonRef = React.useRef<OpenChangeReason | undefined>(undefined)
992
1013
 
993
1014
  // open state lives here (above AdaptParent) so the Adapt handoff can drive
994
1015
  // the adapted Sheet's open/close and unmount timing directly, mirroring Dialog
@@ -1015,7 +1036,12 @@ export const Popover = withStaticProperties(
1015
1036
  }, [open, setOpen])
1016
1037
 
1017
1038
  return (
1018
- <AdaptParent scope={adaptScope} open={open} onOpenChange={setOpen}>
1039
+ <AdaptParent
1040
+ scope={adaptScope}
1041
+ adaptChildren={props.children}
1042
+ open={open}
1043
+ onOpenChange={setOpen}
1044
+ >
1019
1045
  <PopoverInner
1020
1046
  adaptScope={adaptScope}
1021
1047
  ref={ref}
@@ -1024,6 +1050,7 @@ export const Popover = withStaticProperties(
1024
1050
  open={open}
1025
1051
  setOpen={setOpen}
1026
1052
  handleOpenChange={handleOpenChange}
1053
+ closeReasonRef={closeReasonRef}
1027
1054
  {...props}
1028
1055
  />
1029
1056
  </AdaptParent>
@@ -1049,6 +1076,7 @@ const PopoverInner = createRefComponent<
1049
1076
  open: boolean
1050
1077
  setOpen: React.Dispatch<React.SetStateAction<boolean>>
1051
1078
  handleOpenChange: (open: boolean, via?: PopoverVia) => void
1079
+ closeReasonRef: React.RefObject<OpenChangeReason | undefined>
1052
1080
  }
1053
1081
  >(function PopoverInner(props, forwardedRef) {
1054
1082
  const {
@@ -1059,7 +1087,7 @@ const PopoverInner = createRefComponent<
1059
1087
  scope = DEFAULT_SCOPE,
1060
1088
  keepChildrenMounted: keepChildrenMountedProp,
1061
1089
  hoverable,
1062
- disableFocus,
1090
+ disableFocus = !hoverable,
1063
1091
  disableDismissable,
1064
1092
  zIndex,
1065
1093
  id,
@@ -1067,6 +1095,7 @@ const PopoverInner = createRefComponent<
1067
1095
  open,
1068
1096
  setOpen,
1069
1097
  handleOpenChange,
1098
+ closeReasonRef,
1070
1099
  ...restProps
1071
1100
  } = props
1072
1101
 
@@ -1085,9 +1114,10 @@ const PopoverInner = createRefComponent<
1085
1114
  open,
1086
1115
  // floating passes a string via ('hover'), widen at this boundary
1087
1116
  setOpen: handleOpenChange as (val: boolean, type?: string) => void,
1117
+ closeReasonRef,
1088
1118
  disable: isAdapted,
1089
1119
  hoverable,
1090
- disableFocus: disableFocus,
1120
+ disableFocus,
1091
1121
  })
1092
1122
 
1093
1123
  const [anchorTo, setAnchorToRaw] = React.useState<Rect>()
@@ -1110,6 +1140,7 @@ const PopoverInner = createRefComponent<
1110
1140
  if (open && isAdapted) {
1111
1141
  return
1112
1142
  }
1143
+ closeReasonRef.current = open ? 'reference-press' : undefined
1113
1144
  setOpen(!open)
1114
1145
  })
1115
1146
 
@@ -1135,6 +1166,7 @@ const PopoverInner = createRefComponent<
1135
1166
  keepChildrenMounted={keepChildrenMounted}
1136
1167
  disableDismissable={disableDismissable}
1137
1168
  hoverable={hoverable}
1169
+ closeReasonRef={closeReasonRef}
1138
1170
  >
1139
1171
  {children}
1140
1172
  </PopoverContextProvider>