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

/**
 * State exposed by `<Toast.Root>` via `data-*` projection. `transitionStatus`
 * maps to `data-starting-style` / `data-ending-style` exactly like the
 * collapsible port.
 */

/**
 * Context consumed by compound parts (Title, Description, Action, Close)
 * to read the current toast + its identifiers. Every reactive slot is an
 * accessor so descendants stay subscribed without a top-level reactive
 * read.
 */

export const ToastRootContext = createContext(undefined);
export function useToastRootContext() {
  const ctx = useContext(ToastRootContext);
  if (!ctx) {
    throw new Error("Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.");
  }
  return ctx;
}
//# sourceMappingURL=toast-root-context.jsx.map
