import type { SlotClass } from './tv'; import type * as b24ui from '#build/b24ui'; import type * as ComponentTypes from './index'; type ThemeSlotOverrides = T extends { slots: infer S extends Record; } ? { [K in keyof S]?: SlotClass; } : { [K in keyof T]?: T[K] extends any[] ? SlotClass : T[K] extends Record ? ThemeSlotOverrides : SlotClass; }; /** * 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; inputRating?: Partial; inputTags?: Partial; inputTime?: Partial; kbd?: Partial; listbox?: 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; progressGroup?: Partial; /** * Prose components that expose overridable props, under a `prose` namespace * (mirrors `app.config.b24ui.prose` and `useComponentProps('prose.', …)`). * Set prop defaults per element to scope behavior for a subtree, e.g. * `{ prose: { h2: { anchor: true }, pre: { copy: false } } }`. Class-only * elements (`p`, `li`, `table`, `em`, …) are omitted — restyle them via `:b24ui`. */ prose?: { a?: Partial; accordion?: Partial; callout?: Partial; card?: Partial; code?: Partial; codeCollapse?: Partial; codeGroup?: Partial; collapsible?: Partial; field?: Partial; fieldGroup?: Partial; h1?: Partial; h2?: Partial; h3?: Partial; h4?: Partial; img?: Partial; pre?: Partial; prompt?: Partial; steps?: Partial; tabs?: Partial; td?: Partial; th?: Partial; }; radioGroup?: Partial; range?: Partial; scrollArea?: Partial; select?: Partial; selectMenu?: Partial; separator?: Partial; sidebar?: Partial; skeleton?: Partial; slideover?: Partial; splitter?: 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 {};