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

/**
 * Context value provided by `<Meter.Root>` to its compound parts.
 *
 * Reactive values are exposed as `Accessor`s (not plain numbers/strings) so
 * descendants stay reactive to upstream prop changes without having to
 * subscribe through a signal wrapper.
 *
 * `setLabelId` is the registration channel used by `<Meter.Label>` to report
 * its generated id into the root, so the root can wire up `aria-labelledby`.
 */

/**
 * Meter root context. Solid 2's `useContext` throws `ContextNotFoundError`
 * when the resolved value is `undefined`, so the sentinel for "no provider
 * mounted" is `null` — a custom message after `useContext` would never fire
 * against the default `undefined`.
 */
export const MeterRootContext = createContext(null);
export function useMeterRootContext() {
  const context = useContext(MeterRootContext);
  if (context == null) {
    throw new Error("Base UI: <Meter.*> parts must be used within <Meter.Root>.");
  }
  return context;
}
//# sourceMappingURL=meter-root-context.jsx.map
