import type { ComputedRef } from 'vue'; import type { ClassValue } from 'tailwind-variants'; import type * as ComponentTypes from '../types'; import type * as b24ui from '#build/b24ui'; type ThemeSlotOverrides = T extends { slots: infer S extends Record; } ? { [K in keyof S]?: ClassValue; } : { [K in keyof T]?: T[K] extends any[] ? ClassValue : T[K] extends Record ? ThemeSlotOverrides : ClassValue; }; /** * Flat slot-class override shape: `{ button: { base: '...' }, modal: {...} }`. * Powers the `:b24ui` prop on ``, which remains the recommended way to * scope class overrides without touching component prop defaults. */ export type ThemeUI = { [K in keyof typeof b24ui]?: ThemeSlotOverrides<(typeof b24ui)[K]>; }; /** * Strict per-component defaults shape used by ``. Authored as * a flat interface with literal keys (rather than a mapped type) so editors — * Volar in particular — surface key completions inside template inline * objects (`:props="{ button: { … } }"`). Volar reliably iterates interface * members but not mapped-type members in this position. * * Keys mirror the theme registry exposed by `#build/ui` (see * `src/templates.ts`): every themable component gets one camelCase entry * whose value is a `Partial` of that component's `Props`. */ export interface ThemeDefaults { accordion?: Partial; alert?: Partial; avatar?: Partial; avatarGroup?: Partial; badge?: Partial; banner?: Partial; breadcrumb?: Partial; button?: Partial; calendar?: Partial; card?: Partial; chatMessage?: Partial; chatMessages?: Partial; chatPalette?: Partial; chatPrompt?: Partial; chatPromptSubmit?: Partial; chatReasoning?: Partial; chatShimmer?: Partial; chatTool?: Partial; checkbox?: Partial; checkboxGroup?: Partial; chip?: Partial; collapsible?: Partial; colorPicker?: Partial; commandPalette?: Partial; container?: Partial; contentSearch?: Partial; contentSearchButton?: Partial; contentSurround?: Partial; contentToc?: Partial; contextMenu?: Partial; dashboardGroup?: Partial; dashboardNavbar?: Partial; dashboardPanel?: Partial; dashboardResizeHandle?: Partial; dashboardSearch?: Partial; dashboardSearchButton?: Partial; dashboardSidebar?: Partial; dashboardSidebarCollapse?: Partial; dashboardSidebarToggle?: Partial; dashboardToolbar?: Partial; drawer?: Partial; dropdownMenu?: Partial; editor?: Partial; editorDragHandle?: Partial; editorToolbar?: Partial; empty?: Partial; error?: Partial; fieldGroup?: Partial; fileUpload?: Partial; footer?: Partial; footerColumns?: Partial; form?: Partial>; formField?: Partial; header?: Partial; input?: Partial; inputDate?: Partial; inputMenu?: Partial; inputNumber?: Partial; inputTags?: Partial; inputTime?: Partial; kbd?: Partial; main?: Partial; modal?: Partial; navigationMenu?: Partial; page?: Partial; pageAside?: Partial; pageBody?: Partial; pageCard?: Partial; pageCardGroup?: Partial; pageColumns?: Partial; pageFeature?: Partial; pageGrid?: Partial; pageHeader?: Partial; pageLinks?: Partial; pageList?: Partial; pageSection?: Partial; pagination?: Partial; pinInput?: Partial; popover?: Partial; progress?: Partial; radioGroup?: Partial; range?: Partial; scrollArea?: Partial; select?: Partial; selectMenu?: Partial; separator?: Partial; sidebar?: Partial; skeleton?: Partial; slideover?: Partial; stepper?: Partial; switch?: Partial; table?: Partial; tabs?: Partial; textarea?: Partial; timeline?: Partial; toast?: Partial; toaster?: Partial; tooltip?: Partial; user?: Partial; advice?: Partial; countdown?: Partial; descriptionList?: Partial; tableWrapper?: Partial; navbar?: Partial; navbarDivider?: Partial; navbarSection?: Partial; navbarSpacer?: Partial; sidebarBody?: Partial; sidebarFooter?: Partial; sidebarHeader?: Partial; sidebarHeading?: Partial; sidebarLayout?: Partial; sidebarSection?: Partial; sidebarSpacer?: Partial; } /** * Loose internal shape stored on the injected `ThemeContext`. Allows the * `prose` namespace (lifted by `normalizeUi`) and any unknown keys to flow * through without polluting the user-facing `ThemeDefaults` type. */ export type ThemeContextDefaults = ThemeDefaults & { [name: string]: Record | undefined; }; export type ThemeContext = { defaults: ComputedRef; }; declare const provideThemeContext: (contextValue: ThemeContext) => ThemeContext; /** * Module-level fallback so components can call `useComponentProps` outside any * `` wrapper without crashing. */ export declare const defaultThemeContext: ThemeContext; export declare function injectThemeContext(fallback?: ThemeContext): ThemeContext; export { provideThemeContext }; /** * Resolve a component's props with the priority chain: * explicit prop > nearest B24Theme > withDefaults * > app.config.b24ui..defaultVariants * * The returned proxy transparently reads from `props`, falling through to the * injected `ThemeContext` and `app.config.b24ui..defaultVariants` for * defaults. The component's tv() `defaultVariants` are intentionally left out * of the proxy fallback — they continue to drive `tv()`-internal class * resolution (the original semantics) without leaking into prop reads. The * `b24ui` prop is deep-merged (explicit slot classes override theme slot classes) * instead of being replaced. */ export declare function useComponentProps(name: string, props: T): T;