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

/**
 * Custom event-details properties carried on every slider `onValueChange`.
 */

/**
 * State surface projected to `data-*` and visible to `class` / `style` /
 * `render` callbacks across every slider part.
 */

/**
 * Per-thumb metadata carried through the CompositeList. The `inputId` lets
 * `<Slider.Value>` build a space-separated `htmlFor` list.
 */

/**
 * Two-element tuple capturing the pixel-percent position of the first and
 * last thumb relative to the control's `getBoundingClientRect()`. Each slot
 * is `undefined` until the corresponding thumb has been measured. Only used
 * when `thumbAlignment !== 'center'` — center-mode sliders derive positions
 * from value math and skip the ResizeObserver pipeline entirely.
 */

/**
 * Value handed down by `<Slider.Root>` to its compound parts. Reactive reads
 * are `Accessor<T>` so descendants can subscribe precisely.
 *
 * The `inset` / `renderBeforeHydration` / `indicatorPosition` /
 * `setIndicatorPosition` fields match React's edge-alignment context surface.
 * The only piece still deferred is the pre-hydration `<script>` injected by
 * React's `prehydrationScript.min.ts`.
 */

/**
 * Slider root context. `createContext<T | null>(null)` + `== null` sentinel
 * — Solid 2's `useContext` throws `ContextNotFoundError` when
 * the default is `undefined`, which would shadow the intended Base UI error
 * message below.
 */
export const SliderRootContext = createContext(null);
export function useSliderRootContext() {
  const context = useContext(SliderRootContext);
  if (context == null) {
    throw new Error("Base UI: SliderRootContext is missing. Slider parts must be placed within <Slider.Root>.");
  }
  return context;
}
//# sourceMappingURL=slider-root-context.jsx.map
