{"version":3,"names":["createContext","useContext","PopoverPositionerContext","usePopoverPositionerContext","context","Error"],"sources":["popover-positioner-context.ts"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\n\nimport { type Accessor, createContext, useContext } from \"solid-js\";\nimport type { MutableRef } from \"../../internals/floating-ui/types\";\n\n/** `side` values reported by floating-ui's `placement.split('-')[0]`. */\nexport type PopoverSide =\n\t| \"top\"\n\t| \"right\"\n\t| \"bottom\"\n\t| \"left\"\n\t| \"inline-start\"\n\t| \"inline-end\";\n\n/** `align` values mapped from floating-ui's placement suffix. */\nexport type PopoverAlign = \"start\" | \"center\" | \"end\";\n\n/**\n * Shared positioning state produced by the positioner and consumed by the\n * arrow + popup for their own reactive `side` / `align` data-attrs and for\n * the arrow's absolute-position styles.\n *\n * Mirrors Base UI React's `PopoverPositionerContext`.\n */\nexport interface PopoverPositionerContextValue {\n\t/** Resolved side (`'top'`, `'bottom'`, ...) from the placement. */\n\tside: Accessor<PopoverSide>;\n\t/** Resolved align (`'start'`, `'center'`, `'end'`) from the placement. */\n\talign: Accessor<PopoverAlign>;\n\t/** Whether the anchor has been scrolled out of view. */\n\tanchorHidden: Accessor<boolean>;\n\t/**\n\t * Arrow element ref slot. `<Popover.Arrow>` writes to this on mount so\n\t * the arrow middleware can read the element dimensions on next update.\n\t */\n\tarrowRef: MutableRef<HTMLElement | null>;\n\t/** Reactive absolute-position styles for the arrow element. */\n\tarrowStyles: Accessor<JSX.CSSProperties>;\n\t/** Whether the arrow is visually off-center (too close to a collision edge). */\n\tarrowUncentered: Accessor<boolean>;\n}\n\nexport const PopoverPositionerContext =\n\tcreateContext<PopoverPositionerContextValue | null>(null);\n\n/**\n * Read the current `<Popover.Positioner>` context. Throws unless the\n * consumer is rendered inside a positioner.\n */\nexport function usePopoverPositionerContext(): PopoverPositionerContextValue {\n\tconst context = useContext(PopoverPositionerContext);\n\tif (context == null) {\n\t\tthrow new Error(\n\t\t\t\"Base UI: PopoverPositionerContext is missing. Popover.Arrow and Popover.Popup must be placed inside <Popover.Positioner>.\",\n\t\t);\n\t}\n\treturn context;\n}\n"],"mappings":"AAEA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;;AAGnE;;AASA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA,OAAO,MAAMC,wBAAwB,GACpCF,aAAa,CAAuC,IAAI,CAAC;;AAE1D;AACA;AACA;AACA;AACA,OAAO,SAASG,2BAA2BA,CAAA,EAAkC;EAC5E,MAAMC,OAAO,GAAGH,UAAU,CAACC,wBAAwB,CAAC;EACpD,IAAIE,OAAO,IAAI,IAAI,EAAE;IACpB,MAAM,IAAIC,KAAK,CACd,2HACD,CAAC;EACF;EACA,OAAOD,OAAO;AACf","ignoreList":[]}