@hanzogui/popper 8.3.0 → 8.3.2

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.
Files changed (40) hide show
  1. package/dist/cjs/Popper.js +644 -0
  2. package/dist/cjs/Popper.js.map +1 -0
  3. package/dist/cjs/index.js +5 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/package.json +1 -0
  6. package/dist/esm/Popper.js +637 -0
  7. package/dist/esm/Popper.js.map +1 -0
  8. package/dist/esm/index.js +2 -2
  9. package/dist/esm/index.js.map +1 -1
  10. package/package.json +23 -23
  11. package/src/Popper.tsx +16 -18
  12. package/src/index.ts +1 -1
  13. package/types/Popper.d.ts +27 -27
  14. package/types/Popper.d.ts.map +1 -1
  15. package/types/index.d.ts +1 -1
  16. package/types/index.d.ts.map +1 -1
  17. package/dist/cjs/Popper.cjs +0 -627
  18. package/dist/cjs/Popper.native.js +0 -631
  19. package/dist/cjs/Popper.native.js.map +0 -1
  20. package/dist/cjs/index.cjs +0 -20
  21. package/dist/cjs/index.native.js +0 -23
  22. package/dist/cjs/index.native.js.map +0 -1
  23. package/dist/esm/Popper.mjs +0 -566
  24. package/dist/esm/Popper.mjs.map +0 -1
  25. package/dist/esm/Popper.native.js +0 -563
  26. package/dist/esm/Popper.native.js.map +0 -1
  27. package/dist/esm/index.mjs +0 -2
  28. package/dist/esm/index.mjs.map +0 -1
  29. package/dist/esm/index.native.js +0 -2
  30. package/dist/esm/index.native.js.map +0 -1
  31. package/dist/jsx/Popper.mjs +0 -566
  32. package/dist/jsx/Popper.mjs.map +0 -1
  33. package/dist/jsx/Popper.native.js +0 -631
  34. package/dist/jsx/Popper.native.js.map +0 -1
  35. package/dist/jsx/index.js +0 -2
  36. package/dist/jsx/index.js.map +0 -1
  37. package/dist/jsx/index.mjs +0 -2
  38. package/dist/jsx/index.mjs.map +0 -1
  39. package/dist/jsx/index.native.js +0 -23
  40. package/dist/jsx/index.native.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"names":["flushSync","useComposedRefs","isWeb","useIsomorphicLayoutEffect","LayoutMeasurementController","View","createStyledContext","getVariableValue","registerLayoutNode","styled","FloatingOverrideContext","arrow","flip","getOverflowAncestors","offset","platform","shift","size","useFloating","getSpace","YStack","startTransition","React","jsx","PopperContextFast","PopperPositionContext","useStyledContext","usePopperContext","Provider","PopperProviderFast","PopperContextSlow","usePopperContextSlow","PopperProviderSlow","PopperProvider","scope","children","context","fns","useRef","current","slowContext","useState","refs","triggerElements","update","a","getReferenceProps","p","onHoverReference","e","onLeaveReference","checkFloating","setupOptions","setupPopper","options","Object","assign","getSideAndAlignFromPlacement","placement","side","align","split","transformOriginMiddleware","name","fn","data","rects","middlewareData","isArrowHidden","centerOffset","arrowWidth","arrowHeight","placedSide","placedAlign","noArrowAlign","start","center","end","arrowXCenter","x","arrowYCenter","y","floating","height","width","hanzoguiAutoUpdate","reference","rafId","requestAnimationFrame","cleanups","cancelAnimationFrame","HTMLElement","push","ancestors","Element","uniqueAncestors","Set","ancestor","addEventListener","passive","window","removeEventListener","forEach","Popper","props","size$1","strategy","stayInFrame","allowFlip","offset$1","disableRTL","resize","passThrough","open","arrowEl","setArrow","arrowSize","setArrowSize","offsetOptions","floatingStyle","isOpen","middlewareRef","padding","mainAxis","crossAxis","element","apply","availableHeight","availableWidth","maxHeight","maxWidth","floatingChild","firstChild","style","elements","anchorWidth","anchorHeight","contentStyle","setProperty","filter","Boolean","sameScrollView","whileElementsMounted","isRTL","middleware","useMemo","og","getFloatingProps","props2","JSON","stringify","arrowRef","arrowStyle","onArrowSize","hasFloating","transformOrigin","value","PopperAnchor","styleable","PopperAnchor2","forwardedRef","virtualRef","rest","ref","triggerId","useId","useEffect","el","add","delete","setReference","refProps","safeSetReference","useCallback","node","shouldHandleInHover","composedRefs","onMouseEnter","currentTarget","onPointerEnter","nativeEvent","onMouseLeave","PopperContentFrame","variants","unstyled","true","...size","val","tokens","space","borderRadius","radius","PopperContent","forwardRef","PopperContent2","isAnimatePosControlled","animatePosition","enableAnimationForPositionChange","animatePos","isPositioned","updateRef","lastNodeRef","safeSetFloating","isNewNode","setFloating","ourNode","contentRefs","needsMeasure","setNeedsMeasure","hasBeenPositioned","lastGoodPosition","brieflyZero","effectiveX","effectiveY","hide","disableAnimationProp","disableAnimation","setDisableAnimation","frameProps","top","left","position","opacity","transition","animateOnly","animatePresence","floatingProps","transformOriginStyle","disable","direction","PopperArrowFrame","false","borderColor","backgroundColor","defaultVariants","process","env","GUI_HEADLESS","PopperArrowOuterFrame","zIndex","pointerEvents","overflow","alignItems","justifyContent","opposites","right","bottom","PopperArrow","PopperArrow2","propsIn","sizeProp","borderWidth","arrowProps","sizeVal","bounds","Math","max","arrowPositioned","primaryPlacement","innerArrowStyle","isVertical","oppSide","rotate","borderLeftWidth","borderTopWidth","borderBottomWidth","borderRightWidth"],"sources":["Popper.mjs"],"sourcesContent":["import { flushSync } from \"react-dom\";\nimport { useComposedRefs } from \"@hanzogui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@hanzogui/constants\";\nimport { LayoutMeasurementController, View, createStyledContext, getVariableValue, registerLayoutNode, styled } from \"@hanzogui/core\";\nimport { FloatingOverrideContext, arrow, flip, getOverflowAncestors, offset, platform, shift, size, useFloating } from \"@hanzogui/floating\";\nimport { getSpace } from \"@hanzogui/get-token\";\nimport { YStack } from \"@hanzogui/stacks\";\nimport { startTransition } from \"@hanzogui/start-transition\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst PopperContextFast = createStyledContext({}, \"Popper__\");\nconst PopperPositionContext = createStyledContext;\nconst { useStyledContext: usePopperContext, Provider: PopperProviderFast } = PopperContextFast;\nconst PopperContextSlow = createStyledContext({}, \"PopperSlow__\");\nconst { useStyledContext: usePopperContextSlow, Provider: PopperProviderSlow } = PopperContextSlow;\nconst PopperProvider = ({ scope, children, ...context }) => {\n\tconst fns = React.useRef(context);\n\tfns.current = context;\n\tconst [slowContext] = React.useState(() => ({\n\t\trefs: context.refs,\n\t\ttriggerElements: context.triggerElements,\n\t\tupdate(...a) {\n\t\t\tfns.current.update(...a);\n\t\t},\n\t\tgetReferenceProps(p) {\n\t\t\treturn fns.current.getReferenceProps?.(p);\n\t\t},\n\t\tonHoverReference(e) {\n\t\t\tfns.current.onHoverReference?.(e);\n\t\t},\n\t\tonLeaveReference() {\n\t\t\tfns.current.onLeaveReference?.();\n\t\t}\n\t}));\n\treturn /* @__PURE__ */ jsx(PopperProviderFast, {\n\t\tscope,\n\t\t...context,\n\t\tchildren: /* @__PURE__ */ jsx(PopperProviderSlow, {\n\t\t\tscope,\n\t\t\t...slowContext,\n\t\t\tchildren\n\t\t})\n\t});\n};\nconst checkFloating = void 0;\nconst setupOptions = {};\nfunction setupPopper(options) {\n\tObject.assign(setupOptions, options);\n}\nfunction getSideAndAlignFromPlacement(placement) {\n\tconst [side, align = \"center\"] = placement.split(\"-\");\n\treturn [side, align];\n}\nconst transformOriginMiddleware = (options) => ({\n\tname: \"transformOrigin\",\n\toptions,\n\tfn(data) {\n\t\tconst { placement, rects, middlewareData } = data;\n\t\tconst isArrowHidden = middlewareData.arrow?.centerOffset !== 0;\n\t\tconst arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n\t\tconst arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n\t\tconst [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n\t\tconst noArrowAlign = {\n\t\t\tstart: \"0%\",\n\t\t\tcenter: \"50%\",\n\t\t\tend: \"100%\"\n\t\t}[placedAlign];\n\t\tconst arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n\t\tconst arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n\t\tlet x = \"\";\n\t\tlet y = \"\";\n\t\tif (placedSide === \"bottom\") {\n\t\t\tx = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n\t\t\ty = `${-arrowHeight}px`;\n\t\t} else if (placedSide === \"top\") {\n\t\t\tx = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n\t\t\ty = `${rects.floating.height + arrowHeight}px`;\n\t\t} else if (placedSide === \"right\") {\n\t\t\tx = `${-arrowHeight}px`;\n\t\t\ty = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n\t\t} else if (placedSide === \"left\") {\n\t\t\tx = `${rects.floating.width + arrowHeight}px`;\n\t\t\ty = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n\t\t}\n\t\treturn { data: {\n\t\t\tx,\n\t\t\ty\n\t\t} };\n\t}\n});\nfunction hanzoguiAutoUpdate(reference, floating, update) {\n\tupdate();\n\tlet rafId = requestAnimationFrame(() => {\n\t\tupdate();\n\t\trafId = 0;\n\t});\n\tconst cleanups = [() => {\n\t\tif (rafId) cancelAnimationFrame(rafId);\n\t}];\n\tif (reference instanceof HTMLElement) cleanups.push(registerLayoutNode(reference, update));\n\tconst ancestors = [...reference instanceof Element ? getOverflowAncestors(reference) : [], ...getOverflowAncestors(floating)];\n\tconst uniqueAncestors = [...new Set(ancestors)];\n\tfor (const ancestor of uniqueAncestors) ancestor.addEventListener(\"scroll\", update, { passive: true });\n\twindow.addEventListener(\"resize\", update);\n\tcleanups.push(() => {\n\t\tfor (const ancestor of uniqueAncestors) ancestor.removeEventListener(\"scroll\", update);\n\t\twindow.removeEventListener(\"resize\", update);\n\t});\n\treturn () => cleanups.forEach((fn) => fn());\n}\nfunction Popper(props) {\n\tconst { children, size: size$1, strategy = \"absolute\", placement = \"bottom\", stayInFrame, allowFlip, offset: offset$1, disableRTL, resize, passThrough, open, scope } = props;\n\tconst [arrowEl, setArrow] = React.useState(null);\n\tconst [arrowSize, setArrowSize] = React.useState(0);\n\tconst offsetOptions = offset$1 ?? arrowSize;\n\tconst floatingStyle = React.useRef({});\n\tconst isOpen = passThrough ? false : open ?? true;\n\tconst middlewareRef = React.useRef([]);\n\tif (isOpen) middlewareRef.current = [\n\t\ttypeof offsetOptions !== \"undefined\" ? offset(offsetOptions) : null,\n\t\tallowFlip ? flip(typeof allowFlip === \"boolean\" ? {} : allowFlip) : null,\n\t\tstayInFrame ? shift({\n\t\t\tpadding: 10,\n\t\t\tmainAxis: true,\n\t\t\tcrossAxis: false,\n\t\t\t...typeof stayInFrame === \"object\" ? stayInFrame : null\n\t\t}) : null,\n\t\tarrowEl ? arrow({ element: arrowEl }) : null,\n\t\tcheckFloating,\n\t\tresize ? size({\n\t\t\tpadding: typeof stayInFrame === \"object\" ? stayInFrame.padding : 10,\n\t\t\tapply({ availableHeight, availableWidth }) {\n\t\t\t\tif (passThrough) return;\n\t\t\t\tObject.assign(floatingStyle.current, {\n\t\t\t\t\tmaxHeight: `${availableHeight}px`,\n\t\t\t\t\tmaxWidth: `${availableWidth}px`\n\t\t\t\t});\n\t\t\t\tconst floatingChild = floating.refs.floating.current?.firstChild;\n\t\t\t\tif (floatingChild && floatingChild instanceof HTMLElement) Object.assign(floatingChild.style, floatingStyle.current);\n\t\t\t},\n\t\t\t...typeof resize === \"object\" && resize\n\t\t}) : null,\n\t\tsize({ apply({ elements, rects, availableWidth, availableHeight }) {\n\t\t\tconst { width: anchorWidth, height: anchorHeight } = rects.reference;\n\t\t\tconst contentStyle = elements.floating.style;\n\t\t\tcontentStyle.setProperty(\"--hanzogui-popper-available-width\", `${availableWidth}px`);\n\t\t\tcontentStyle.setProperty(\"--hanzogui-popper-available-height\", `${availableHeight}px`);\n\t\t\tcontentStyle.setProperty(\"--hanzogui-popper-anchor-width\", `${anchorWidth}px`);\n\t\t\tcontentStyle.setProperty(\"--hanzogui-popper-anchor-height\", `${anchorHeight}px`);\n\t\t} }),\n\t\ttransformOriginMiddleware({\n\t\t\tarrowHeight: arrowSize,\n\t\t\tarrowWidth: arrowSize\n\t\t})\n\t].filter(Boolean);\n\tlet floating = useFloating({\n\t\topen: isOpen,\n\t\tstrategy,\n\t\tplacement,\n\t\tsameScrollView: false,\n\t\twhileElementsMounted: !isOpen ? void 0 : hanzoguiAutoUpdate,\n\t\tplatform: disableRTL ?? setupOptions.disableRTL ? {\n\t\t\t...platform,\n\t\t\tisRTL(element) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} : platform,\n\t\tmiddleware: middlewareRef.current\n\t});\n\tfloating = React.useMemo(() => {\n\t\tconst og = floating.getFloatingProps;\n\t\tif (resize && og) floating.getFloatingProps = (props2) => {\n\t\t\treturn og({\n\t\t\t\t...props2,\n\t\t\t\tstyle: {\n\t\t\t\t\t...props2.style,\n\t\t\t\t\t...floatingStyle.current\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\treturn floating;\n\t}, [floating, resize ? JSON.stringify(resize) : null]);\n\tconst { middlewareData } = floating;\n\treturn /* @__PURE__ */ jsx(PopperProvider, {\n\t\tscope,\n\t\t...React.useMemo(() => {\n\t\t\treturn {\n\t\t\t\tsize: size$1,\n\t\t\t\tarrowRef: setArrow,\n\t\t\t\tarrowStyle: middlewareData.arrow,\n\t\t\t\tonArrowSize: setArrowSize,\n\t\t\t\thasFloating: middlewareData.checkFloating?.hasFloating,\n\t\t\t\ttransformOrigin: middlewareData.transformOrigin,\n\t\t\t\topen: !!open,\n\t\t\t\t...floating\n\t\t\t};\n\t\t}, [\n\t\t\topen,\n\t\t\tsize$1,\n\t\t\tfloating,\n\t\t\tJSON.stringify(middlewareData.arrow || null),\n\t\t\tJSON.stringify(middlewareData.transformOrigin || null)\n\t\t]),\n\t\tchildren: /* @__PURE__ */ jsx(FloatingOverrideContext.Provider, {\n\t\t\tvalue: null,\n\t\t\tchildren\n\t\t})\n\t});\n}\nconst PopperAnchor = YStack.styleable(function PopperAnchor2(props, forwardedRef) {\n\tconst { virtualRef, scope, ...rest } = props;\n\tconst context = usePopperContextSlow(scope);\n\tconst { getReferenceProps, refs, update } = context;\n\tconst ref = React.useRef(null);\n\tconst triggerId = React.useId();\n\tReact.useEffect(() => {\n\t\tif (!scope || !context.triggerElements || !ref.current) return;\n\t\tif (!(ref.current instanceof Element)) return;\n\t\tconst el = ref.current;\n\t\tcontext.triggerElements.add(triggerId, el);\n\t\treturn () => {\n\t\t\tcontext.triggerElements?.delete(triggerId);\n\t\t};\n\t}, [\n\t\tscope,\n\t\ttriggerId,\n\t\tcontext.triggerElements\n\t]);\n\tReact.useEffect(() => {\n\t\tif (virtualRef) {\n\t\t\trefs.setReference(virtualRef.current);\n\t\t\tupdate();\n\t\t}\n\t}, [virtualRef]);\n\tconst refProps = getReferenceProps?.({\n\t\t...rest,\n\t\tref\n\t}) || null;\n\tconst safeSetReference = React.useCallback((node) => {\n\t\tstartTransition(() => {\n\t\t\trefs.setReference(node);\n\t\t});\n\t}, [refs]);\n\tconst shouldHandleInHover = isWeb && scope;\n\tconst composedRefs = useComposedRefs(forwardedRef, ref, shouldHandleInHover ? void 0 : safeSetReference);\n\treturn /* @__PURE__ */ jsx(View, {\n\t\t...rest,\n\t\t...refProps,\n\t\tref: composedRefs,\n\t\t...shouldHandleInHover && {\n\t\t\tonMouseEnter: (e) => {\n\t\t\t\tconst el = e.currentTarget ?? ref.current;\n\t\t\t\tif (el instanceof HTMLElement) {\n\t\t\t\t\tflushSync(() => refs.setReference(el));\n\t\t\t\t\tupdate();\n\t\t\t\t\tif (!refProps) return;\n\t\t\t\t\trefProps.onPointerEnter?.(e);\n\t\t\t\t\tcontext.onHoverReference?.(e.nativeEvent);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonMouseLeave: (e) => {\n\t\t\t\tcontext.onLeaveReference?.();\n\t\t\t\trefProps?.onMouseLeave?.(e);\n\t\t\t}\n\t\t}\n\t});\n});\nconst PopperContentFrame = styled(YStack, {\n\tname: \"PopperContent\",\n\tvariants: {\n\t\tunstyled: { true: {} },\n\t\tsize: { \"...size\": (val, { tokens }) => {\n\t\t\treturn {\n\t\t\t\tpadding: tokens.space[val],\n\t\t\t\tborderRadius: tokens.radius[val]\n\t\t\t};\n\t\t} }\n\t}\n});\nconst PopperContent = React.forwardRef(function PopperContent2(props, forwardedRef) {\n\tconst isAnimatePosControlled = \"animatePosition\" in props || \"enableAnimationForPositionChange\" in props;\n\tconst { scope, animatePosition, enableAnimationForPositionChange, children, passThrough, unstyled, ...rest } = props;\n\tconst animatePos = animatePosition ?? enableAnimationForPositionChange;\n\tconst context = usePopperContext(scope);\n\tconst { strategy, placement, refs, x, y, getFloatingProps, size, isPositioned, transformOrigin, update } = context;\n\tconst updateRef = React.useRef(update);\n\tupdateRef.current = update;\n\tconst lastNodeRef = React.useRef(null);\n\tconst safeSetFloating = React.useCallback((node) => {\n\t\tconst isNewNode = node !== lastNodeRef.current;\n\t\tif (node) {\n\t\t\tlastNodeRef.current = node;\n\t\t\trefs.setFloating(node);\n\t\t\tif (!isNewNode) updateRef.current?.();\n\t\t}\n\t}, [refs.setFloating]);\n\tReact.useEffect(() => {\n\t\treturn () => {\n\t\t\tconst ourNode = lastNodeRef.current;\n\t\t\tif (ourNode && refs.floating.current === ourNode) refs.setFloating(null);\n\t\t\tlastNodeRef.current = null;\n\t\t};\n\t}, []);\n\tconst contentRefs = useComposedRefs(safeSetFloating, forwardedRef);\n\tconst [needsMeasure, setNeedsMeasure] = React.useState(animatePos);\n\tuseIsomorphicLayoutEffect(() => {\n\t\tif (needsMeasure && x && y) setNeedsMeasure(false);\n\t}, [\n\t\tneedsMeasure,\n\t\tanimatePos,\n\t\tx,\n\t\ty\n\t]);\n\tconst hasBeenPositioned = React.useRef(false);\n\tconst lastGoodPosition = React.useRef({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tif (x !== 0 || y !== 0) {\n\t\tlastGoodPosition.current = {\n\t\t\tx,\n\t\t\ty\n\t\t};\n\t\tif (isPositioned) hasBeenPositioned.current = true;\n\t}\n\tconst brieflyZero = hasBeenPositioned.current && x === 0 && y === 0;\n\tconst effectiveX = brieflyZero ? lastGoodPosition.current.x : x;\n\tconst effectiveY = brieflyZero ? lastGoodPosition.current.y : y;\n\tconst hide = !hasBeenPositioned.current && effectiveX === 0 && effectiveY === 0;\n\tconst disableAnimationProp = animatePos === \"even-when-repositioning\" ? needsMeasure : !hasBeenPositioned.current && !isPositioned || needsMeasure;\n\tconst [disableAnimation, setDisableAnimation] = React.useState(disableAnimationProp);\n\tReact.useEffect(() => {\n\t\tsetDisableAnimation(disableAnimationProp);\n\t}, [disableAnimationProp]);\n\tconst frameProps = {\n\t\tref: contentRefs,\n\t\t...hide ? {} : {\n\t\t\tx: effectiveX || 0,\n\t\t\ty: effectiveY || 0\n\t\t},\n\t\ttop: 0,\n\t\tleft: 0,\n\t\tposition: strategy,\n\t\topacity: hide ? 0 : 1,\n\t\t...isAnimatePosControlled && {\n\t\t\ttransition: animatePos ? rest.transition : void 0,\n\t\t\tanimateOnly: animatePos && !disableAnimation ? rest.animateOnly : [],\n\t\t\tanimatePresence: false\n\t\t}\n\t};\n\tconst { style, ...floatingProps } = getFloatingProps ? getFloatingProps(frameProps) : frameProps;\n\tconst transformOriginStyle = isWeb && transformOrigin ? { transformOrigin: `${transformOrigin.x} ${transformOrigin.y}` } : void 0;\n\treturn /* @__PURE__ */ jsx(LayoutMeasurementController, {\n\t\tdisable: !context.open,\n\t\tchildren: /* @__PURE__ */ jsx(View, {\n\t\t\tpassThrough,\n\t\t\tref: contentRefs,\n\t\t\tdirection: rest.direction,\n\t\t\t...passThrough ? null : floatingProps,\n\t\t\t...!passThrough && animatePos && { \"data-popper-animate-position\": \"true\" },\n\t\t\tchildren: /* @__PURE__ */ jsx(PopperContentFrame, {\n\t\t\t\tpassThrough,\n\t\t\t\tunstyled,\n\t\t\t\t...!passThrough && {\n\t\t\t\t\t\"data-placement\": placement,\n\t\t\t\t\t\"data-strategy\": strategy,\n\t\t\t\t\tsize,\n\t\t\t\t\t...style,\n\t\t\t\t\t...transformOriginStyle,\n\t\t\t\t\t...rest\n\t\t\t\t},\n\t\t\t\tchildren\n\t\t\t}, \"popper-content-frame\")\n\t\t})\n\t});\n});\nconst PopperArrowFrame = styled(YStack, {\n\tname: \"PopperArrow\",\n\tvariants: { unstyled: { false: {\n\t\tborderColor: \"$borderColor\",\n\t\tbackgroundColor: \"$background\",\n\t\tposition: \"relative\"\n\t} } },\n\tdefaultVariants: { unstyled: process.env.GUI_HEADLESS === \"1\" }\n});\nconst PopperArrowOuterFrame = styled(YStack, {\n\tname: \"PopperArrowOuter\",\n\tvariants: { unstyled: { false: {\n\t\tposition: \"absolute\",\n\t\tzIndex: 1e6,\n\t\tpointerEvents: \"none\",\n\t\toverflow: \"hidden\",\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\"\n\t} } },\n\tdefaultVariants: { unstyled: process.env.GUI_HEADLESS === \"1\" }\n});\nconst opposites = {\n\ttop: \"bottom\",\n\tright: \"left\",\n\tbottom: \"top\",\n\tleft: \"right\"\n};\nconst PopperArrow = React.forwardRef(function PopperArrow2(propsIn, forwardedRef) {\n\tconst isAnimatePosControlled = \"animatePosition\" in propsIn;\n\tconst { scope, animatePosition, transition, ...rest } = propsIn;\n\tconst { offset, size: sizeProp, borderWidth = 0, ...arrowProps } = rest;\n\tconst context = usePopperContext(scope);\n\tconst sizeVal = typeof sizeProp === \"number\" ? sizeProp : getVariableValue(getSpace(sizeProp ?? context.size, {\n\t\tshift: -2,\n\t\tbounds: [2]\n\t}));\n\tconst size = Math.max(0, +sizeVal);\n\tconst { placement } = context;\n\tconst refs = useComposedRefs(context.arrowRef, forwardedRef);\n\tconst x = context.arrowStyle?.x || 0;\n\tconst y = context.arrowStyle?.y || 0;\n\tconst arrowPositioned = context.arrowStyle != null;\n\tconst primaryPlacement = placement ? placement.split(\"-\")[0] : \"top\";\n\tconst arrowStyle = {\n\t\tx,\n\t\ty,\n\t\twidth: size,\n\t\theight: size\n\t};\n\tconst innerArrowStyle = {};\n\tconst isVertical = primaryPlacement === \"bottom\" || primaryPlacement === \"top\";\n\tif (primaryPlacement) {\n\t\tarrowStyle[isVertical ? \"width\" : \"height\"] = size * 2;\n\t\tconst oppSide = opposites[primaryPlacement];\n\t\tif (oppSide) {\n\t\t\tarrowStyle[oppSide] = -size;\n\t\t\tinnerArrowStyle[oppSide] = size / 2;\n\t\t}\n\t\tif (oppSide === \"top\" || oppSide === \"bottom\") arrowStyle.left = 0;\n\t\tif (oppSide === \"left\" || oppSide === \"right\") arrowStyle.top = 0;\n\t\tuseIsomorphicLayoutEffect(() => {\n\t\t\tcontext.onArrowSize?.(size);\n\t\t}, [size, context.onArrowSize]);\n\t}\n\treturn /* @__PURE__ */ jsx(PopperArrowOuterFrame, {\n\t\tref: refs,\n\t\t...arrowStyle,\n\t\t...!arrowPositioned && { opacity: 0 },\n\t\t...isAnimatePosControlled && {\n\t\t\ttransition: animatePosition ? transition : void 0,\n\t\t\tanimateOnly: animatePosition ? [\"transform\"] : [],\n\t\t\tanimatePresence: false\n\t\t},\n\t\tchildren: /* @__PURE__ */ jsx(PopperArrowFrame, {\n\t\t\twidth: size,\n\t\t\theight: size,\n\t\t\t...arrowProps,\n\t\t\t...innerArrowStyle,\n\t\t\trotate: \"45deg\",\n\t\t\t...primaryPlacement === \"bottom\" && {\n\t\t\t\tborderLeftWidth: borderWidth,\n\t\t\t\tborderTopWidth: borderWidth\n\t\t\t},\n\t\t\t...primaryPlacement === \"top\" && {\n\t\t\t\tborderBottomWidth: borderWidth,\n\t\t\t\tborderRightWidth: borderWidth\n\t\t\t},\n\t\t\t...primaryPlacement === \"right\" && {\n\t\t\t\tborderLeftWidth: borderWidth,\n\t\t\t\tborderBottomWidth: borderWidth\n\t\t\t},\n\t\t\t...primaryPlacement === \"left\" && {\n\t\t\t\tborderTopWidth: borderWidth,\n\t\t\t\tborderRightWidth: borderWidth\n\t\t\t}\n\t\t})\n\t});\n});\n\nexport { Popper, PopperAnchor, PopperArrow, PopperArrowFrame, PopperContent, PopperContentFrame, PopperContextFast, PopperContextSlow, PopperPositionContext, PopperProvider, PopperProviderFast, PopperProviderSlow, setupPopper, usePopperContext, usePopperContextSlow };"],"mappings":"AAAA,SAASA,SAAS,QAAQ,WAAW;AACrC,SAASC,eAAe,QAAQ,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ComposedRefs } from "@hanzogui/compose-refs";
4
- import { isWeb, useIsomorphicLayoutEffect } from "@hanzogui/constants";
5
- import { LayoutMeasurementController, View, createStyledContext, getVariableValue, registerLayoutNode, styled } from "@hanzogui/core";
6
- import { FloatingOverrideContext, arrow, flip, getOverflowAncestors, offset, platform, shift, useFloating } from "@hanzogui/floating";
7
- import { getSpace } from "@hanzogui/get-token";
8
- import { YStack } from "@hanzogui/stacks";
9
- import { startTransition } from "@hanzogui/start-transition";
10
- import * as React from "react";
11
- import { Keyboard, useWindowDimensions } from "react-native";
12
- function _instanceof(left, right) {
13
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);else return left instanceof right;
14
- }
15
- function _type_of(obj) {
16
- "@swc/helpers - typeof";
17
-
18
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
19
- }
20
- var PopperContextFast = createStyledContext({}, "Popper__");
21
- var PopperPositionContext = createStyledContext;
22
- var {
23
- useStyledContext: usePopperContext,
24
- Provider: PopperProviderFast
25
- } = PopperContextFast;
26
- var PopperContextSlow = createStyledContext({}, "PopperSlow__");
27
- var {
28
- useStyledContext: usePopperContextSlow,
29
- Provider: PopperProviderSlow
30
- } = PopperContextSlow;
31
- var PopperProvider = function (param) {
32
- var {
33
- scope,
34
- children,
35
- ...context
36
- } = param;
37
- var fns = React.useRef(context);
38
- fns.current = context;
39
- var [slowContext] = React.useState(function () {
40
- return {
41
- refs: context.refs,
42
- triggerElements: context.triggerElements,
43
- update() {
44
- for (var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++) a[_key] = arguments[_key];
45
- fns.current.update(...a);
46
- },
47
- getReferenceProps(p) {
48
- var _fns_current_getReferenceProps, _fns_current;
49
- return (_fns_current_getReferenceProps = (_fns_current = fns.current).getReferenceProps) === null || _fns_current_getReferenceProps === void 0 ? void 0 : _fns_current_getReferenceProps.call(_fns_current, p);
50
- },
51
- onHoverReference(e) {
52
- var _fns_current_onHoverReference, _fns_current;
53
- (_fns_current_onHoverReference = (_fns_current = fns.current).onHoverReference) === null || _fns_current_onHoverReference === void 0 || _fns_current_onHoverReference.call(_fns_current, e);
54
- },
55
- onLeaveReference() {
56
- var _fns_current_onLeaveReference, _fns_current;
57
- (_fns_current_onLeaveReference = (_fns_current = fns.current).onLeaveReference) === null || _fns_current_onLeaveReference === void 0 || _fns_current_onLeaveReference.call(_fns_current);
58
- }
59
- };
60
- });
61
- return /* @__PURE__ */jsx(PopperProviderFast, {
62
- scope,
63
- ...context,
64
- children: /* @__PURE__ */jsx(PopperProviderSlow, {
65
- scope,
66
- ...slowContext,
67
- children
68
- })
69
- });
70
- };
71
- var checkFloating = {
72
- name: "checkFloating",
73
- fn(data) {
74
- return {
75
- data: {
76
- hasFloating: !!data.rects.floating.width
77
- }
78
- };
79
- }
80
- };
81
- var setupOptions = {};
82
- function setupPopper(options) {
83
- Object.assign(setupOptions, options);
84
- }
85
- function hanzoguiAutoUpdate(reference, floating, update) {
86
- update();
87
- var rafId = requestAnimationFrame(function () {
88
- update();
89
- rafId = 0;
90
- });
91
- var cleanups = [function () {
92
- if (rafId) cancelAnimationFrame(rafId);
93
- }];
94
- if (_instanceof(reference, HTMLElement)) cleanups.push(registerLayoutNode(reference, update));
95
- var ancestors = [...(_instanceof(reference, Element) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)];
96
- var uniqueAncestors = [...new Set(ancestors)];
97
- var _iteratorNormalCompletion = true,
98
- _didIteratorError = false,
99
- _iteratorError = void 0;
100
- try {
101
- for (var _iterator = uniqueAncestors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _step.value.addEventListener("scroll", update, {
102
- passive: true
103
- });
104
- } catch (err) {
105
- _didIteratorError = true;
106
- _iteratorError = err;
107
- } finally {
108
- try {
109
- if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
110
- } finally {
111
- if (_didIteratorError) throw _iteratorError;
112
- }
113
- }
114
- window.addEventListener("resize", update);
115
- cleanups.push(function () {
116
- var _iteratorNormalCompletion2 = true,
117
- _didIteratorError2 = false,
118
- _iteratorError2 = void 0;
119
- try {
120
- for (var _iterator2 = uniqueAncestors[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) _step2.value.removeEventListener("scroll", update);
121
- } catch (err) {
122
- _didIteratorError2 = true;
123
- _iteratorError2 = err;
124
- } finally {
125
- try {
126
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
127
- } finally {
128
- if (_didIteratorError2) throw _iteratorError2;
129
- }
130
- }
131
- window.removeEventListener("resize", update);
132
- });
133
- return function () {
134
- return cleanups.forEach(function (fn) {
135
- return fn();
136
- });
137
- };
138
- }
139
- function Popper(props) {
140
- var {
141
- children,
142
- size,
143
- strategy = "absolute",
144
- placement = "bottom",
145
- stayInFrame,
146
- allowFlip,
147
- offset: offset$1,
148
- disableRTL,
149
- resize,
150
- passThrough,
151
- open,
152
- scope
153
- } = props;
154
- var [arrowEl, setArrow] = React.useState(null);
155
- var [arrowSize, setArrowSize] = React.useState(0);
156
- var offsetOptions = offset$1 !== null && offset$1 !== void 0 ? offset$1 : arrowSize;
157
- React.useRef({});
158
- var isOpen = passThrough ? false : open !== null && open !== void 0 ? open : true;
159
- var middlewareRef = React.useRef([]);
160
- if (isOpen) middlewareRef.current = [typeof offsetOptions !== "undefined" ? offset(offsetOptions) : null, allowFlip ? flip(typeof allowFlip === "boolean" ? {} : allowFlip) : null, stayInFrame ? shift({
161
- padding: 10,
162
- mainAxis: true,
163
- crossAxis: false,
164
- ...((typeof stayInFrame === "undefined" ? "undefined" : _type_of(stayInFrame)) === "object" ? stayInFrame : null)
165
- }) : null, arrowEl ? arrow({
166
- element: arrowEl
167
- }) : null, checkFloating, null, null, null].filter(Boolean);
168
- var floating = useFloating({
169
- open: isOpen,
170
- strategy,
171
- placement,
172
- sameScrollView: false,
173
- whileElementsMounted: !isOpen ? void 0 : hanzoguiAutoUpdate,
174
- platform: (disableRTL !== null && disableRTL !== void 0 ? disableRTL : setupOptions.disableRTL) ? {
175
- ...platform,
176
- isRTL(element) {
177
- return false;
178
- }
179
- } : platform,
180
- middleware: middlewareRef.current
181
- });
182
- var {
183
- middlewareData
184
- } = floating;
185
- var dimensions = useWindowDimensions();
186
- var [keyboardOpen, setKeyboardOpen] = React.useState(false);
187
- React.useEffect(function () {
188
- var showSubscription = Keyboard.addListener("keyboardDidShow", function () {
189
- startTransition(function () {
190
- setKeyboardOpen(true);
191
- });
192
- });
193
- var hideSubscription = Keyboard.addListener("keyboardDidHide", function () {
194
- startTransition(function () {
195
- setKeyboardOpen(false);
196
- });
197
- });
198
- return function () {
199
- showSubscription.remove();
200
- hideSubscription.remove();
201
- };
202
- }, []);
203
- useIsomorphicLayoutEffect(function () {
204
- if (passThrough) return;
205
- floating.update();
206
- }, [passThrough, dimensions, keyboardOpen]);
207
- return /* @__PURE__ */jsx(PopperProvider, {
208
- scope,
209
- ...React.useMemo(function () {
210
- var _middlewareData_checkFloating;
211
- return {
212
- size,
213
- arrowRef: setArrow,
214
- arrowStyle: middlewareData.arrow,
215
- onArrowSize: setArrowSize,
216
- hasFloating: (_middlewareData_checkFloating = middlewareData.checkFloating) === null || _middlewareData_checkFloating === void 0 ? void 0 : _middlewareData_checkFloating.hasFloating,
217
- transformOrigin: middlewareData.transformOrigin,
218
- open: !!open,
219
- ...floating
220
- };
221
- }, [open, size, floating, JSON.stringify(middlewareData.arrow || null), JSON.stringify(middlewareData.transformOrigin || null)]),
222
- children: /* @__PURE__ */jsx(FloatingOverrideContext.Provider, {
223
- value: null,
224
- children
225
- })
226
- });
227
- }
228
- var PopperAnchor = YStack.styleable(function PopperAnchor2(props, forwardedRef) {
229
- var {
230
- virtualRef,
231
- scope,
232
- ...rest
233
- } = props;
234
- var context = usePopperContextSlow(scope);
235
- var {
236
- getReferenceProps,
237
- refs,
238
- update
239
- } = context;
240
- var ref = React.useRef(null);
241
- var triggerId = React.useId();
242
- React.useEffect(function () {
243
- if (!scope || !context.triggerElements || !ref.current) return;
244
- if (!_instanceof(ref.current, Element)) return;
245
- var el = ref.current;
246
- context.triggerElements.add(triggerId, el);
247
- return function () {
248
- var _context_triggerElements;
249
- (_context_triggerElements = context.triggerElements) === null || _context_triggerElements === void 0 || _context_triggerElements.delete(triggerId);
250
- };
251
- }, [scope, triggerId, context.triggerElements]);
252
- React.useEffect(function () {
253
- if (virtualRef) {
254
- refs.setReference(virtualRef.current);
255
- update();
256
- }
257
- }, [virtualRef]);
258
- var refProps = (getReferenceProps === null || getReferenceProps === void 0 ? void 0 : getReferenceProps({
259
- ...rest,
260
- ref
261
- })) || null;
262
- var safeSetReference = React.useCallback(function (node) {
263
- startTransition(function () {
264
- refs.setReference(node);
265
- });
266
- }, [refs]);
267
- var shouldHandleInHover = isWeb && scope;
268
- var composedRefs = useComposedRefs(forwardedRef, ref, shouldHandleInHover ? void 0 : safeSetReference);
269
- return /* @__PURE__ */jsx(View, {
270
- ...rest,
271
- ...refProps,
272
- ref: composedRefs,
273
- ...(shouldHandleInHover && {
274
- onMouseEnter: function (e) {
275
- var _e_currentTarget;
276
- var el = (_e_currentTarget = e.currentTarget) !== null && _e_currentTarget !== void 0 ? _e_currentTarget : ref.current;
277
- if (_instanceof(el, HTMLElement)) {
278
- var _refProps_onPointerEnter, _context_onHoverReference;
279
- flushSync(function () {
280
- return refs.setReference(el);
281
- });
282
- update();
283
- if (!refProps) return;
284
- (_refProps_onPointerEnter = refProps.onPointerEnter) === null || _refProps_onPointerEnter === void 0 || _refProps_onPointerEnter.call(refProps, e);
285
- (_context_onHoverReference = context.onHoverReference) === null || _context_onHoverReference === void 0 || _context_onHoverReference.call(context, e.nativeEvent);
286
- }
287
- },
288
- onMouseLeave: function (e) {
289
- var _context_onLeaveReference, _refProps_onMouseLeave;
290
- (_context_onLeaveReference = context.onLeaveReference) === null || _context_onLeaveReference === void 0 || _context_onLeaveReference.call(context);
291
- refProps === null || refProps === void 0 || (_refProps_onMouseLeave = refProps.onMouseLeave) == null || _refProps_onMouseLeave.call(refProps, e);
292
- }
293
- })
294
- });
295
- });
296
- var PopperContentFrame = styled(YStack, {
297
- name: "PopperContent",
298
- variants: {
299
- unstyled: {
300
- true: {}
301
- },
302
- size: {
303
- "...size": function (val, param) {
304
- var {
305
- tokens
306
- } = param;
307
- return {
308
- padding: tokens.space[val],
309
- borderRadius: tokens.radius[val]
310
- };
311
- }
312
- }
313
- }
314
- });
315
- var PopperContent = /* @__PURE__ */React.forwardRef(function PopperContent2(props, forwardedRef) {
316
- var isAnimatePosControlled = "animatePosition" in props || "enableAnimationForPositionChange" in props;
317
- var {
318
- scope,
319
- animatePosition,
320
- enableAnimationForPositionChange,
321
- children,
322
- passThrough,
323
- unstyled,
324
- ...rest
325
- } = props;
326
- var animatePos = animatePosition !== null && animatePosition !== void 0 ? animatePosition : enableAnimationForPositionChange;
327
- var context = usePopperContext(scope);
328
- var {
329
- strategy,
330
- placement,
331
- refs,
332
- x,
333
- y,
334
- getFloatingProps,
335
- size,
336
- isPositioned,
337
- transformOrigin,
338
- update
339
- } = context;
340
- var updateRef = React.useRef(update);
341
- updateRef.current = update;
342
- var lastNodeRef = React.useRef(null);
343
- var safeSetFloating = React.useCallback(function (node) {
344
- var isNewNode = node !== lastNodeRef.current;
345
- if (node) {
346
- lastNodeRef.current = node;
347
- refs.setFloating(node);
348
- if (!isNewNode) {
349
- var _updateRef_current;
350
- (_updateRef_current = updateRef.current) === null || _updateRef_current === void 0 || _updateRef_current.call(updateRef);
351
- }
352
- }
353
- }, [refs.setFloating]);
354
- React.useEffect(function () {
355
- return function () {
356
- var ourNode = lastNodeRef.current;
357
- if (ourNode && refs.floating.current === ourNode) refs.setFloating(null);
358
- lastNodeRef.current = null;
359
- };
360
- }, []);
361
- var contentRefs = useComposedRefs(safeSetFloating, forwardedRef);
362
- var [needsMeasure, setNeedsMeasure] = React.useState(animatePos);
363
- useIsomorphicLayoutEffect(function () {
364
- if (needsMeasure && x && y) setNeedsMeasure(false);
365
- }, [needsMeasure, animatePos, x, y]);
366
- var hasBeenPositioned = React.useRef(false);
367
- var lastGoodPosition = React.useRef({
368
- x: 0,
369
- y: 0
370
- });
371
- if (x !== 0 || y !== 0) {
372
- lastGoodPosition.current = {
373
- x,
374
- y
375
- };
376
- if (isPositioned) hasBeenPositioned.current = true;
377
- }
378
- var brieflyZero = hasBeenPositioned.current && x === 0 && y === 0;
379
- var effectiveX = brieflyZero ? lastGoodPosition.current.x : x;
380
- var effectiveY = brieflyZero ? lastGoodPosition.current.y : y;
381
- var hide = !hasBeenPositioned.current && effectiveX === 0 && effectiveY === 0;
382
- var disableAnimationProp = animatePos === "even-when-repositioning" ? needsMeasure : !hasBeenPositioned.current && !isPositioned || needsMeasure;
383
- var [disableAnimation, setDisableAnimation] = React.useState(disableAnimationProp);
384
- React.useEffect(function () {
385
- setDisableAnimation(disableAnimationProp);
386
- }, [disableAnimationProp]);
387
- var frameProps = {
388
- ref: contentRefs,
389
- ...(hide ? {} : {
390
- x: effectiveX || 0,
391
- y: effectiveY || 0
392
- }),
393
- top: 0,
394
- left: 0,
395
- position: strategy,
396
- opacity: hide ? 0 : 1,
397
- ...(isAnimatePosControlled && {
398
- transition: animatePos ? rest.transition : void 0,
399
- animateOnly: animatePos && !disableAnimation ? rest.animateOnly : [],
400
- animatePresence: false
401
- })
402
- };
403
- var {
404
- style,
405
- ...floatingProps
406
- } = getFloatingProps ? getFloatingProps(frameProps) : frameProps;
407
- var transformOriginStyle = isWeb && transformOrigin ? {
408
- transformOrigin: `${transformOrigin.x} ${transformOrigin.y}`
409
- } : void 0;
410
- return /* @__PURE__ */jsx(LayoutMeasurementController, {
411
- disable: !context.open,
412
- children: /* @__PURE__ */jsx(View, {
413
- passThrough,
414
- ref: contentRefs,
415
- direction: rest.direction,
416
- ...(passThrough ? null : floatingProps),
417
- ...(!passThrough && animatePos && {
418
- "data-popper-animate-position": "true"
419
- }),
420
- children: /* @__PURE__ */jsx(PopperContentFrame, {
421
- passThrough,
422
- unstyled,
423
- ...(!passThrough && {
424
- "data-placement": placement,
425
- "data-strategy": strategy,
426
- size,
427
- ...style,
428
- ...transformOriginStyle,
429
- ...rest
430
- }),
431
- children
432
- }, "popper-content-frame")
433
- })
434
- });
435
- });
436
- var PopperArrowFrame = styled(YStack, {
437
- name: "PopperArrow",
438
- variants: {
439
- unstyled: {
440
- false: {
441
- borderColor: "$borderColor",
442
- backgroundColor: "$background",
443
- position: "relative"
444
- }
445
- }
446
- },
447
- defaultVariants: {
448
- unstyled: process.env.GUI_HEADLESS === "1"
449
- }
450
- });
451
- var PopperArrowOuterFrame = styled(YStack, {
452
- name: "PopperArrowOuter",
453
- variants: {
454
- unstyled: {
455
- false: {
456
- position: "absolute",
457
- zIndex: 1e6,
458
- pointerEvents: "none",
459
- overflow: "hidden",
460
- alignItems: "center",
461
- justifyContent: "center"
462
- }
463
- }
464
- },
465
- defaultVariants: {
466
- unstyled: process.env.GUI_HEADLESS === "1"
467
- }
468
- });
469
- var opposites = {
470
- top: "bottom",
471
- right: "left",
472
- bottom: "top",
473
- left: "right"
474
- };
475
- var PopperArrow = /* @__PURE__ */React.forwardRef(function PopperArrow2(propsIn, forwardedRef) {
476
- var _context_arrowStyle, _context_arrowStyle1;
477
- var isAnimatePosControlled = "animatePosition" in propsIn;
478
- var {
479
- scope,
480
- animatePosition,
481
- transition,
482
- ...rest
483
- } = propsIn;
484
- var {
485
- offset,
486
- size: sizeProp,
487
- borderWidth = 0,
488
- ...arrowProps
489
- } = rest;
490
- var context = usePopperContext(scope);
491
- var sizeVal = typeof sizeProp === "number" ? sizeProp : getVariableValue(getSpace(sizeProp !== null && sizeProp !== void 0 ? sizeProp : context.size, {
492
- shift: -2,
493
- bounds: [2]
494
- }));
495
- var size = Math.max(0, +sizeVal);
496
- var {
497
- placement
498
- } = context;
499
- var refs = useComposedRefs(context.arrowRef, forwardedRef);
500
- var x = ((_context_arrowStyle = context.arrowStyle) === null || _context_arrowStyle === void 0 ? void 0 : _context_arrowStyle.x) || 0;
501
- var y = ((_context_arrowStyle1 = context.arrowStyle) === null || _context_arrowStyle1 === void 0 ? void 0 : _context_arrowStyle1.y) || 0;
502
- var arrowPositioned = context.arrowStyle != null;
503
- var primaryPlacement = placement ? placement.split("-")[0] : "top";
504
- var arrowStyle = {
505
- x,
506
- y,
507
- width: size,
508
- height: size
509
- };
510
- var innerArrowStyle = {};
511
- var isVertical = primaryPlacement === "bottom" || primaryPlacement === "top";
512
- if (primaryPlacement) {
513
- arrowStyle[isVertical ? "width" : "height"] = size * 2;
514
- var oppSide = opposites[primaryPlacement];
515
- if (oppSide) {
516
- arrowStyle[oppSide] = -size;
517
- innerArrowStyle[oppSide] = size / 2;
518
- }
519
- if (oppSide === "top" || oppSide === "bottom") arrowStyle.left = 0;
520
- if (oppSide === "left" || oppSide === "right") arrowStyle.top = 0;
521
- useIsomorphicLayoutEffect(function () {
522
- var _context_onArrowSize;
523
- (_context_onArrowSize = context.onArrowSize) === null || _context_onArrowSize === void 0 || _context_onArrowSize.call(context, size);
524
- }, [size, context.onArrowSize]);
525
- }
526
- return /* @__PURE__ */jsx(PopperArrowOuterFrame, {
527
- ref: refs,
528
- ...arrowStyle,
529
- ...(!arrowPositioned && {
530
- opacity: 0
531
- }),
532
- ...(isAnimatePosControlled && {
533
- transition: animatePosition ? transition : void 0,
534
- animateOnly: animatePosition ? ["transform"] : [],
535
- animatePresence: false
536
- }),
537
- children: /* @__PURE__ */jsx(PopperArrowFrame, {
538
- width: size,
539
- height: size,
540
- ...arrowProps,
541
- ...innerArrowStyle,
542
- rotate: "45deg",
543
- ...(primaryPlacement === "bottom" && {
544
- borderLeftWidth: borderWidth,
545
- borderTopWidth: borderWidth
546
- }),
547
- ...(primaryPlacement === "top" && {
548
- borderBottomWidth: borderWidth,
549
- borderRightWidth: borderWidth
550
- }),
551
- ...(primaryPlacement === "right" && {
552
- borderLeftWidth: borderWidth,
553
- borderBottomWidth: borderWidth
554
- }),
555
- ...(primaryPlacement === "left" && {
556
- borderTopWidth: borderWidth,
557
- borderRightWidth: borderWidth
558
- })
559
- })
560
- });
561
- });
562
- export { Popper, PopperAnchor, PopperArrow, PopperArrowFrame, PopperContent, PopperContentFrame, PopperContextFast, PopperContextSlow, PopperPositionContext, PopperProvider, PopperProviderFast, PopperProviderSlow, setupPopper, usePopperContext, usePopperContextSlow };
563
- //# sourceMappingURL=Popper.native.js.map