{"version":3,"names":["createContext","useContext","MeterRootContext","useMeterRootContext","context","Error"],"sources":["meter-root-context.ts"],"sourcesContent":["import { type Accessor, createContext, useContext } from \"solid-js\";\n\n/**\n * Context value provided by `<Meter.Root>` to its compound parts.\n *\n * Reactive values are exposed as `Accessor`s (not plain numbers/strings) so\n * descendants stay reactive to upstream prop changes without having to\n * subscribe through a signal wrapper.\n *\n * `setLabelId` is the registration channel used by `<Meter.Label>` to report\n * its generated id into the root, so the root can wire up `aria-labelledby`.\n */\nexport interface MeterRootContextValue {\n\t/** Accessor for the current meter value. */\n\tvalue: Accessor<number>;\n\t/** Accessor for the minimum value of the range. */\n\tmin: Accessor<number>;\n\t/** Accessor for the maximum value of the range. */\n\tmax: Accessor<number>;\n\t/**\n\t * Accessor for the formatted (human-readable) current value — either the\n\t * value formatted via the root's `format` / `locale` props, or the default\n\t * percentage form when no explicit format is provided.\n\t */\n\tformattedValue: Accessor<string>;\n\t/**\n\t * Register/deregister the label id that drives `<Meter.Root>`'s\n\t * `aria-labelledby`. Called by `<Meter.Label>` from its mount/unmount\n\t * lifecycle.\n\t */\n\tsetLabelId: (id: string | undefined) => void;\n}\n\n/**\n * Meter root context. Solid 2's `useContext` throws `ContextNotFoundError`\n * when the resolved value is `undefined`, so the sentinel for \"no provider\n * mounted\" is `null` — a custom message after `useContext` would never fire\n * against the default `undefined`.\n */\nexport const MeterRootContext = createContext<MeterRootContextValue | null>(\n\tnull,\n);\n\nexport function useMeterRootContext(): MeterRootContextValue {\n\tconst context = useContext(MeterRootContext);\n\tif (context == null) {\n\t\tthrow new Error(\n\t\t\t\"Base UI: <Meter.*> parts must be used within <Meter.Root>.\",\n\t\t);\n\t}\n\treturn context;\n}\n"],"mappings":"AAAA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAGF,aAAa,CAC5C,IACD,CAAC;AAED,OAAO,SAASG,mBAAmBA,CAAA,EAA0B;EAC5D,MAAMC,OAAO,GAAGH,UAAU,CAACC,gBAAgB,CAAC;EAC5C,IAAIE,OAAO,IAAI,IAAI,EAAE;IACpB,MAAM,IAAIC,KAAK,CACd,4DACD,CAAC;EACF;EACA,OAAOD,OAAO;AACf","ignoreList":[]}