{"version":3,"names":["createContext","useContext","DEFAULT_DIRECTION","DirectionContext","useDirection"],"sources":["direction-provider-context.ts"],"sourcesContent":["import { type Accessor, createContext, useContext } from \"solid-js\";\n\nexport type TextDirection = \"ltr\" | \"rtl\";\n\n/**\n * Default context value — resolves to `\"ltr\"` when no `<DirectionProvider>`\n * wraps the consumer.\n */\nconst DEFAULT_DIRECTION: Accessor<TextDirection> = () => \"ltr\";\n\n/**\n * Context carrying the current text direction as an `Accessor`. Provided via\n * Solid 2's context-as-provider pattern:\n * `<DirectionContext value={() => direction}>`.\n *\n * @internal\n */\nexport const DirectionContext =\n\tcreateContext<Accessor<TextDirection>>(DEFAULT_DIRECTION);\n\n/**\n * Read the current text direction. Returns an `Accessor<TextDirection>` so\n * consumers stay reactive; call it (e.g. `useDirection()()`) to get the\n * current value. Defaults to `\"ltr\"` when no provider is mounted.\n */\nexport function useDirection(): Accessor<TextDirection> {\n\treturn useContext(DirectionContext);\n}\n"],"mappings":"AAAA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;AAInE;AACA;AACA;AACA;AACA,MAAMC,iBAA0C,GAAGA,CAAA,KAAM,KAAK;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAC5BH,aAAa,CAA0BE,iBAAiB,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,YAAYA,CAAA,EAA4B;EACvD,OAAOH,UAAU,CAACE,gBAAgB,CAAC;AACpC","ignoreList":[]}