{"version":3,"names":["createContext","useContext","DrawerViewportContext","useDrawerViewportContext","optional","context","Error"],"sources":["drawer-viewport-context.ts"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\n/**\n * Context set by `<Drawer.Viewport>` — carries the swipe state consumed\n * by `<Drawer.Popup>` (e.g. `swiping` flag, per-release strength scalar).\n *\n * 1:1 port of Base UI React's `DrawerViewportContext` with accessor-shaped\n * values for Solid's reactive graph.\n */\n\nimport { type Accessor, createContext, useContext } from \"solid-js\";\n\nexport interface DrawerViewportContextValue {\n\t/** Whether an active drag is in progress. */\n\tswiping: Accessor<boolean>;\n\t/** Computed drag transform styles to apply on the popup. */\n\tgetDragStyles: () => JSX.CSSProperties;\n\t/** Swipe-release transition strength scalar (0.1 - 1), or `null`. */\n\tswipeStrength: Accessor<number | null>;\n\t/** Imperative setter for the `data-swipe-dismiss` attribute. */\n\tsetSwipeDismissed: (dismissed: boolean) => void;\n}\n\n/**\n * Null-sentinel context. `<Drawer.Popup>` consults this\n * optionally — omitting the viewport disables swipe handling but the\n * popup still renders.\n */\nexport const DrawerViewportContext =\n\tcreateContext<DrawerViewportContextValue | null>(null);\n\nexport function useDrawerViewportContext(): DrawerViewportContextValue;\nexport function useDrawerViewportContext(\n\toptional: true,\n): DrawerViewportContextValue | null;\nexport function useDrawerViewportContext(\n\toptional?: boolean,\n): DrawerViewportContextValue | null {\n\tconst context = useContext(DrawerViewportContext);\n\tif (context == null && !optional) {\n\t\tthrow new Error(\n\t\t\t\"Base UI: DrawerViewportContext is missing. Drawer parts must be placed within <Drawer.Viewport>.\",\n\t\t);\n\t}\n\treturn context;\n}\n"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;AAanE;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GACjCF,aAAa,CAAoC,IAAI,CAAC;AAMvD,OAAO,SAASG,wBAAwBA,CACvCC,QAAkB,EACkB;EACpC,MAAMC,OAAO,GAAGJ,UAAU,CAACC,qBAAqB,CAAC;EACjD,IAAIG,OAAO,IAAI,IAAI,IAAI,CAACD,QAAQ,EAAE;IACjC,MAAM,IAAIE,KAAK,CACd,kGACD,CAAC;EACF;EACA,OAAOD,OAAO;AACf","ignoreList":[]}