{"version":3,"file":"themeContext.cjs","sources":["../../../src/components/themeContext.tsx"],"sourcesContent":["// Theme context module — deliberately import-light (P2-3 bundle decoupling).\n//\n// The context default is `null`, NOT the defaultTheme registry: a value\n// default here would make every component's `useTheme()` import pull all 53\n// component themes into the module graph regardless of which entry point the\n// consumer used. Instead, each component resolves its own theme node with a\n// static per-component fallback (`theme?.badge ?? defaultBadgeTheme`),\n// importing only its own default theme. Mounting a ThemeProvider is the\n// deliberate opt-in to the full registry (it imports defaultTheme to merge).\n//\n// This file must hold ONLY the context, the hook, and TYPE imports — no\n// theme value imports, no ThemeProvider/defaultTheme re-exports (a re-export\n// is a module-graph edge and would defeat the decoupling). Pinned by\n// bundle-decoupling.test.tsx.\n\nimport { createContext, useContext } from 'react';\nimport type { ThemeProps } from './themeTypes';\n\n/**\n * @internal Exported only so ThemeProvider (a separate module, so that this\n * one stays registry-free) can publish into the same context. Not public\n * API — consume the theme via `useTheme()`.\n */\nexport const ThemeContext = createContext<ThemeProps | null>(null);\n\n/**\n * Returns the active theme tree, or `null` when no `ThemeProvider` is\n * mounted above the caller.\n *\n * Components do not require a provider: without one, each component falls\n * back to its own built-in default theme. Consumers reading the theme\n * directly must handle the `null` case (or mount a `ThemeProvider`, which\n * always provides a complete tree).\n */\nexport function useTheme(): ThemeProps | null {\n  return useContext(ThemeContext);\n}\n\nexport type {\n  ThemeProps,\n  PartialTheme,\n  ThemeDefaults,\n  ThemeExtraClasses,\n  ThemeProviderProps,\n  MergeStrategy,\n} from './themeTypes';\n"],"names":["createContext","useContext"],"mappings":";;;;;AAuBO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAeA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAiC,CAAA,CAAA,CAAA,CAAI,CAAA;AAW1D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,QAAA,CAAA,CAAA,CAA8B;AAC5C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAOC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA;AAChC;;;"}