{"version":3,"names":["createContext","useContext","MenuPositionerContext","useMenuPositionerContext","optional","ctx","Error"],"sources":["menu-positioner-context.ts"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\n/**\n * Context exposed by `<Menu.Positioner>` to `<Menu.Popup>` / `<Menu.Arrow>`.\n * Mirrors `packages/react/src/menu/positioner/MenuPositionerContext.ts`.\n */\nimport { type Accessor, createContext, useContext } from \"solid-js\";\nimport type { MutableRef } from \"../../internals/floating-ui/types\";\n\nexport type MenuSide =\n\t| \"top\"\n\t| \"right\"\n\t| \"bottom\"\n\t| \"left\"\n\t| \"inline-start\"\n\t| \"inline-end\"\n\t| \"none\";\nexport type MenuAlign = \"start\" | \"center\" | \"end\";\n\nexport interface MenuPositionerContextValue {\n\tside: Accessor<MenuSide>;\n\talign: Accessor<MenuAlign>;\n\tanchorHidden: Accessor<boolean>;\n\tarrowRef: MutableRef<HTMLElement | null>;\n\tarrowStyles: Accessor<JSX.CSSProperties>;\n\tarrowUncentered: Accessor<boolean>;\n\t/** Floating-tree node id assigned to this positioner. */\n\tnodeId: Accessor<string | undefined>;\n}\n\nexport const MenuPositionerContext =\n\tcreateContext<MenuPositionerContextValue | null>(null);\n\nexport function useMenuPositionerContext(): MenuPositionerContextValue;\nexport function useMenuPositionerContext(\n\toptional: true,\n): MenuPositionerContextValue | null;\nexport function useMenuPositionerContext(\n\toptional?: boolean,\n): MenuPositionerContextValue | null {\n\tconst ctx = useContext(MenuPositionerContext);\n\tif (ctx == null && !optional) {\n\t\tthrow new Error(\n\t\t\t\"Base UI: MenuPositionerContext is missing. Positioner children must be placed within <Menu.Positioner>.\",\n\t\t);\n\t}\n\treturn ctx;\n}\n"],"mappings":"AACA;AACA;AACA;AACA;AACA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;AAwBnE,OAAO,MAAMC,qBAAqB,GACjCF,aAAa,CAAoC,IAAI,CAAC;AAMvD,OAAO,SAASG,wBAAwBA,CACvCC,QAAkB,EACkB;EACpC,MAAMC,GAAG,GAAGJ,UAAU,CAACC,qBAAqB,CAAC;EAC7C,IAAIG,GAAG,IAAI,IAAI,IAAI,CAACD,QAAQ,EAAE;IAC7B,MAAM,IAAIE,KAAK,CACd,yGACD,CAAC;EACF;EACA,OAAOD,GAAG;AACX","ignoreList":[]}