{"version":3,"names":["dynamic","omit","untrack","mergeRootProps","resolveClassStyle","useRegisteredLabelId","useProgressRootContext","ProgressLabel","props","context","idOverride","id","undefined","setLabelId","userClassStyle","status","userProps","internalSlot","role","data-indeterminate","data-progressing","data-complete","merged","Tag","as"],"sources":["progress-label.tsx"],"sourcesContent":["import type { JSX, ValidComponent } from \"@solidjs/web\";\nimport { dynamic } from \"@solidjs/web\";\nimport { omit, untrack } from \"solid-js\";\nimport { mergeRootProps } from \"../../internals/merge-root-props\";\nimport { resolveClassStyle } from \"../../internals/resolve-class-style\";\nimport type { BaseUIComponentProps } from \"../../internals/types\";\nimport { useRegisteredLabelId } from \"../../internals/use-registered-label-id\";\nimport {\n\ttype ProgressRootState,\n\tuseProgressRootContext,\n} from \"../progress-root-context.ts\";\n\nexport interface ProgressLabelState extends ProgressRootState {}\n\nexport interface ProgressLabelProps\n\textends BaseUIComponentProps<\"span\", ProgressLabelState> {\n\t/**\n\t * Tag/component to render. Defaults to `\"span\"`. Replaces the\n\t * pre-spike `render` prop (axis G).\n\t */\n\tas?: ValidComponent;\n}\n\n/**\n * An accessible label for the progress bar. Renders a `<span>` (or `as`\n * override). On mount registers its id with the root so `aria-labelledby`\n * wires up.\n */\nexport function ProgressLabel(props: ProgressLabelProps): JSX.Element {\n\tconst context = useProgressRootContext();\n\n\tconst idOverride = untrack(() =>\n\t\ttypeof props.id === \"string\" ? props.id : undefined,\n\t);\n\tconst id = useRegisteredLabelId(idOverride, context.setLabelId);\n\n\t// Resolve `class`/`style` so function values (stateful styling) are invoked\n\t// with the progress state instead of being spread to the DOM raw.\n\tconst userClassStyle = resolveClassStyle(props, () => ({\n\t\tstatus: context.status(),\n\t}));\n\tconst userProps = omit(props, \"as\", \"id\", \"class\", \"style\", \"attrs\");\n\n\tconst internalSlot = {\n\t\tid,\n\t\trole: \"presentation\" as const,\n\t\tget \"data-indeterminate\"(): \"\" | undefined {\n\t\t\treturn context.status() === \"indeterminate\" ? \"\" : undefined;\n\t\t},\n\t\tget \"data-progressing\"(): \"\" | undefined {\n\t\t\treturn context.status() === \"progressing\" ? \"\" : undefined;\n\t\t},\n\t\tget \"data-complete\"(): \"\" | undefined {\n\t\t\treturn context.status() === \"complete\" ? \"\" : undefined;\n\t\t},\n\t};\n\n\tlet merged: Record<string, unknown> = mergeRootProps(\n\t\tinternalSlot,\n\t\tuserClassStyle,\n\t);\n\tmerged = mergeRootProps(merged, userProps);\n\n\tconst Tag = dynamic(() => props.as ?? \"span\");\n\treturn <Tag {...merged} />;\n}\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,IAAI,EAAEC,OAAO,QAAQ,UAAU;AACxC,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,iBAAiB,QAAQ,qCAAqC;AAEvE,SAASC,oBAAoB,QAAQ,yCAAyC;AAC9E,SAECC,sBAAsB,QAChB,6BAA6B;AAapC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACC,KAAyB,EAAe;EACrE,MAAMC,OAAO,GAAGH,sBAAsB,CAAC,CAAC;EAExC,MAAMI,UAAU,GAAGR,OAAO,CAAC,MAC1B,OAAOM,KAAK,CAACG,EAAE,KAAK,QAAQ,GAAGH,KAAK,CAACG,EAAE,GAAGC,SAC3C,CAAC;EACD,MAAMD,EAAE,GAAGN,oBAAoB,CAACK,UAAU,EAAED,OAAO,CAACI,UAAU,CAAC;;EAE/D;EACA;EACA,MAAMC,cAAc,GAAGV,iBAAiB,CAACI,KAAK,EAAE,OAAO;IACtDO,MAAM,EAAEN,OAAO,CAACM,MAAM,CAAC;EACxB,CAAC,CAAC,CAAC;EACH,MAAMC,SAAS,GAAGf,IAAI,CAACO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC;EAEpE,MAAMS,YAAY,GAAG;IACpBN,EAAE;IACFO,IAAI,EAAE,cAAuB;IAC7B,IAAI,oBAAoBC,CAAA,EAAmB;MAC1C,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