import { createContext, useContext } from "solid-js";
/**
 * Default context value — resolves to `"ltr"` when no `<DirectionProvider>`
 * wraps the consumer.
 */
const DEFAULT_DIRECTION = () => "ltr";

/**
 * Context carrying the current text direction as an `Accessor`. Provided via
 * Solid 2's context-as-provider pattern:
 * `<DirectionContext value={() => direction}>`.
 *
 * @internal
 */
export const DirectionContext = createContext(DEFAULT_DIRECTION);

/**
 * Read the current text direction. Returns an `Accessor<TextDirection>` so
 * consumers stay reactive; call it (e.g. `useDirection()()`) to get the
 * current value. Defaults to `"ltr"` when no provider is mounted.
 */
export function useDirection() {
  return useContext(DirectionContext);
}
//# sourceMappingURL=direction-provider-context.jsx.map
