/**
 * Context set by `<Drawer.Root>` that carries drawer-specific state on top
 * of the `<Dialog.Root>` context the drawer composes over.
 *
 * Mirrors Base UI React's `DrawerRootContext`
 * (`packages/react/src/drawer/root/DrawerRootContext.ts`). The Solid port
 * switches every field to an `Accessor<T>` so consumers can subscribe
 * without wrapping, and follows the null-sentinel convention for
 * the optional "is this a drawer subtree?" detection path.
 */

import { createContext, useContext } from "solid-js";

/** Swipe-direction union. `'down'` by default. */

/** A single snap point — fraction (0..1), px count, or a CSS length string. */

/**
 * Nested-drawer swipe-progress store. Implemented without Solid's reactive
 * graph so parent drawers can observe progress without re-running effects.
 * Mirrors React's same-named shape.
 */

/** Change-event details for `onSnapPointChange`. Matches React. */

/**
 * Null-sentinel context. `<Drawer.Root>` is optional around
 * a `<Drawer.Trigger>` when a detached handle is supplied.
 */
export const DrawerRootContext = createContext(null);
export function useDrawerRootContext(optional) {
  const context = useContext(DrawerRootContext);
  if (context == null && !optional) {
    throw new Error("Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.");
  }
  return context;
}
//# sourceMappingURL=drawer-root-context.jsx.map
