{"version":3,"names":["createContext","useContext","PreviewCardPositionerContext","usePreviewCardPositionerContext","context","Error"],"sources":["preview-card-positioner-context.ts"],"sourcesContent":["import { type Accessor, createContext, useContext } from \"solid-js\";\nimport type { MutableRef } from \"../internals/floating-ui/types\";\n\nexport type PreviewCardSide =\n\t| \"top\"\n\t| \"bottom\"\n\t| \"left\"\n\t| \"right\"\n\t| \"inline-end\"\n\t| \"inline-start\";\n\nexport type PreviewCardAlign = \"start\" | \"center\" | \"end\";\n\n/**\n * Context shape published by `<PreviewCard.Positioner>` so descendants\n * (`Popup`, `Arrow`) can read the resolved placement / arrow ref / arrow\n * styles. Mirrors `PreviewCardPositionerContext` from the React source\n * with the Solid convention that reactive fields are `Accessor<T>`.\n */\nexport interface PreviewCardPositionerContextValue {\n\t/** The resolved side (post-flip / post-shift). */\n\tside: Accessor<PreviewCardSide>;\n\t/** The resolved alignment (post-flip / post-shift). */\n\talign: Accessor<PreviewCardAlign>;\n\t/** Whether the arrow has been pushed outside the centered axis. */\n\tarrowUncentered: Accessor<boolean>;\n\t/** Inline styles to apply to the arrow element (`left`/`top`/etc.). */\n\tarrowStyles: Accessor<Record<string, string | number | undefined>>;\n\t/** Mutable ref for the arrow element — consumed by the `arrow` middleware. */\n\tarrowRef: MutableRef<HTMLDivElement | null>;\n\t/** Whether the anchor element is outside the viewport (after `hide`). */\n\tanchorHidden: Accessor<boolean>;\n}\n\nexport const PreviewCardPositionerContext =\n\tcreateContext<PreviewCardPositionerContextValue | null>(null);\n\nexport function usePreviewCardPositionerContext(): PreviewCardPositionerContextValue {\n\tconst context = useContext(PreviewCardPositionerContext);\n\tif (context === null) {\n\t\tthrow new Error(\n\t\t\t\"Base UI: PreviewCardPositionerContext is missing. <PreviewCard.Popup> and <PreviewCard.Arrow> must be placed within <PreviewCard.Positioner>.\",\n\t\t);\n\t}\n\treturn context;\n}\n"],"mappings":"AAAA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;;AAanE;AACA;AACA;AACA;AACA;AACA;;AAgBA,OAAO,MAAMC,4BAA4B,GACxCF,aAAa,CAA2C,IAAI,CAAC;AAE9D,OAAO,SAASG,+BAA+BA,CAAA,EAAsC;EACpF,MAAMC,OAAO,GAAGH,UAAU,CAACC,4BAA4B,CAAC;EACxD,IAAIE,OAAO,KAAK,IAAI,EAAE;IACrB,MAAM,IAAIC,KAAK,CACd,+IACD,CAAC;EACF;EACA,OAAOD,OAAO;AACf","ignoreList":[]}