{"version":3,"names":["createContext","useContext","NOOP_FIELDSET_CONTEXT","disabled","present","FieldsetContext","useFieldsetContext"],"sources":["fieldset-context.ts"],"sourcesContent":["import { type Accessor, createContext, useContext } from \"solid-js\";\n\n/**\n * Context value published by `<Fieldset.Root>`.\n *\n * `<Fieldset.Root>` exposes:\n *\n *   - `disabled` — reactive bit that descendant control parts merge with\n *     their own `disabled` prop (matches React Base UI).\n *   - `legendId` / `setLegendId` — the `<Fieldset.Legend>` id registration\n *     pair, so the root can wire `aria-labelledby`. These mirror the\n *     `useRegisteredLabelId` pattern used across other tier-1 roots\n *     (progress / meter) and are `undefined` on the NOOP context value.\n *\n * Mirrors Base UI React's\n * `packages/react/src/fieldset/root/FieldsetRootContext.ts`.\n */\nexport interface FieldsetContextValue {\n\tdisabled: Accessor<boolean>;\n\t/** Marker — `true` when this context was provided by a real `<Fieldset.Root>`. */\n\treadonly present: boolean;\n\t/**\n\t * Current registered legend id (if any). Only meaningful when `present`\n\t * is `true`; the NOOP context leaves this unset.\n\t */\n\tlegendId?: Accessor<string | undefined>;\n\t/**\n\t * Register the legend id so the root can wire `aria-labelledby`. Called\n\t * by `<Fieldset.Legend>` on mount (with the id) and on cleanup (with\n\t * `undefined`). Safe to invoke from within owned scope — the underlying\n\t * signal in the root opts into `ownedWrite` (pure internal plumbing).\n\t * Only provided when `present` is `true`.\n\t */\n\tsetLegendId?: (id: string | undefined) => void;\n}\n\nexport const NOOP_FIELDSET_CONTEXT: FieldsetContextValue = {\n\tdisabled: () => false,\n\tpresent: false,\n};\n\n/**\n * Context carrying `<Fieldset.Root>` state. Provided via\n * `<FieldsetContext value={...}>` (Solid 2's context-as-provider pattern).\n */\nexport const FieldsetContext = createContext<FieldsetContextValue>(\n\tNOOP_FIELDSET_CONTEXT,\n);\n\n/**\n * Read the current `<Fieldset.Root>` context. Returns {@link NOOP_FIELDSET_CONTEXT}\n * when no fieldset is present — callers can branch on `.present` if they\n * need to know whether a real fieldset wraps them.\n */\nexport function useFieldsetContext(): FieldsetContextValue {\n\treturn useContext(FieldsetContext);\n}\n"],"mappings":"AAAA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA,OAAO,MAAMC,qBAA2C,GAAG;EAC1DC,QAAQ,EAAEA,CAAA,KAAM,KAAK;EACrBC,OAAO,EAAE;AACV,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGL,aAAa,CAC3CE,qBACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,kBAAkBA,CAAA,EAAyB;EAC1D,OAAOL,UAAU,CAACI,eAAe,CAAC;AACnC","ignoreList":[]}