import type { JSX } from 'preact'; /** * Internal panel identifier used by both accordion and tab containers. */ type WidgetPanelId = string; /** Light/dark theme modes used for panel-scoped overrides. */ export type WidgetPanelThemeMode = 'light' | 'dark'; /** Public theme override options for widget panels. */ export type WidgetPanelTheme = 'inherit' | 'light' | 'dark' | 'invert'; /** * Describes one entry in an accordion or tabbed container. */ export type WidgetPanel = { /** Stable id used for expansion/selection bookkeeping. */ id: WidgetPanelId; /** Visible heading text for the panel. */ title: string; /** Renderable panel body. */ content: JSX.Element; /** Optional theme override applied to this panel subtree. */ theme?: WidgetPanelTheme; /** * If true, the panel can not be interacted with and will not switch/expand. */ disabled?: boolean; /** * If true, keep the panel mounted when collapsed (for preserving internal state). */ keepMounted?: boolean; }; export type WidgetPanelRecord = Record; export type AccordeonPanelProps = { /** * Map of panel IDs to panel definitions. */ panels: WidgetPanelRecord; /** Optional identifier for the wrapper panel when embedded in another container. */ id?: string; /** Optional heading used by outer overlays when this is rendered as a direct child panel. */ title?: string; /** Optional theme override applied to this panel subtree. */ theme?: WidgetPanelTheme; }; export type TabbedPanelProps = { /** * Map of panel IDs to panel definitions. */ panels: WidgetPanelRecord; /** Optional identifier for the wrapper panel when embedded in another container. */ id?: string; /** Optional heading used by outer overlays when this is rendered as a direct child panel. */ title?: string; /** Controls whether the tab list wraps onto multiple rows or scrolls horizontally. */ tabListLayout?: 'wrap' | 'scroll'; /** Optional theme override applied to this panel subtree. */ theme?: WidgetPanelTheme; }; export type ColumnPanelProps = { /** * Map of panel IDs to panel definitions. */ panels: WidgetPanelRecord; /** Optional identifier for the wrapper panel when embedded in another container. */ id?: string; /** Optional heading used by outer overlays when this is rendered as a direct child panel. */ title?: string; /** Optional theme override applied to this panel subtree. */ theme?: WidgetPanelTheme; }; export type CustomPanelProps = { /** Stable id used for expansion/selection bookkeeping. */ id: string; /** Visible heading text for the panel. */ title: string; /** * Called after the host element mounts. * Return a cleanup callback to dispose any manual DOM work on unmount. */ onRenderHTML: (rootElement: HTMLElement) => void | (() => void); /** * If true, the panel can not be interacted with and will not switch/expand. */ disabled?: boolean; /** * If true, keep the panel mounted when collapsed (for preserving internal state). */ keepMounted?: boolean; /** Optional class name applied to the host element. */ className?: string; /** Optional theme override applied to this panel subtree. */ theme?: WidgetPanelTheme; }; export type MarkdownPanelProps = { /** Stable id used for expansion/selection bookkeeping. */ id: string; /** Visible heading text for the panel. */ title: string; /** Markdown source rendered into a small built-in safe subset. */ markdown: string; /** * If true, the panel can not be interacted with and will not switch/expand. */ disabled?: boolean; /** * If true, keep the panel mounted when collapsed (for preserving internal state). */ keepMounted?: boolean; /** Optional class name applied to the markdown content host. */ className?: string; /** Optional theme override applied to this panel subtree. */ theme?: WidgetPanelTheme; }; /** * A wrapper panel that renders child panels in an accordion layout. */ export declare class AccordeonPanel implements WidgetPanel { id: string; title: string; content: JSX.Element; theme?: WidgetPanelTheme; constructor({ panels, id, title, theme }: AccordeonPanelProps); } /** * A wrapper panel that renders child panels in a tabbed layout. */ export declare class TabbedPanel implements WidgetPanel { id: string; title: string; content: JSX.Element; theme?: WidgetPanelTheme; constructor({ panels, id, title, tabListLayout, theme }: TabbedPanelProps); } /** * A wrapper panel that renders child panels in a vertical column. */ export declare class ColumnPanel implements WidgetPanel { id: string; title: string; content: JSX.Element; theme?: WidgetPanelTheme; constructor({ panels, id, title, theme }: ColumnPanelProps); } /** * A wrapper panel that renders imperative HTML content into a managed host element. */ export declare class CustomPanel implements WidgetPanel { id: string; title: string; content: JSX.Element; theme?: WidgetPanelTheme; disabled?: boolean; keepMounted?: boolean; constructor({ id, title, onRenderHTML, disabled, keepMounted, className, theme }: CustomPanelProps); } /** * A wrapper panel that renders a minimal built-in Markdown subset without external parsers. */ export declare class MarkdownPanel implements WidgetPanel { id: string; title: string; content: JSX.Element; theme?: WidgetPanelTheme; disabled?: boolean; keepMounted?: boolean; constructor({ id, title, markdown, disabled, keepMounted, className, theme }: MarkdownPanelProps); } /** * Shared props for both container implementations. */ export type WidgetContainerPanelBase = { /** Optional class name applied to the outer container. */ className?: string; /** Optional set of panels to render. */ panels: ReadonlyArray; }; /** * Single-panel container props for direct modal/sidebar content rendering. */ export type WidgetPanelContainerProps = { /** Optional class name applied to the outer container. */ className?: string; /** The panel to render as raw content. */ panel: WidgetPanel; }; /** * Accordion container properties. */ export type AccordeonWidgetContainerProps = WidgetContainerPanelBase & { /** Optional uncontrolled default expanded panel ids. */ defaultExpandedPanelIds?: ReadonlyArray; /** * Controlled expanded panel ids. If supplied, callers manage expand/collapse state. */ expandedPanelIds?: ReadonlyArray; /** * Called when user intent changes expanded panel ids. */ onExpandedPanelIdsChange?: (expandedPanelIds: ReadonlyArray) => void; /** * If false, opening one panel closes all others. Defaults to true. */ allowMultipleExpanded?: boolean; }; /** * Tabs container properties. */ export type TabbedWidgetContainerProps = WidgetContainerPanelBase & { /** Optional uncontrolled default active tab id. */ defaultActivePanelId?: WidgetPanelId; /** * Controlled active tab id. If supplied, callers manage active tab state. */ activePanelId?: WidgetPanelId; /** * Called when user intent changes active tab id. */ onActivePanelIdChange?: (activePanelId: WidgetPanelId | undefined) => void; /** Controls whether the tab list wraps onto multiple rows or scrolls horizontally. */ tabListLayout?: 'wrap' | 'scroll'; }; /** * Column container properties. */ export type ColumnWidgetContainerProps = WidgetContainerPanelBase; /** A serialized form describing an accordion widget container. */ export type WidgetAccordeonContainer = { /** Container variant discriminator. */ kind: 'accordeon'; /** Accordion container props. */ props: AccordeonWidgetContainerProps; }; /** A serialized form describing a tabbed widget container. */ export type WidgetTabbedContainer = { /** Container variant discriminator. */ kind: 'tabs'; /** Tabs container props. */ props: TabbedWidgetContainerProps; }; /** A serialized form describing a single panel widget container. */ export type WidgetPanelContainer = { /** Container variant discriminator. */ kind: 'panel'; /** Single-panel props. */ props: WidgetPanelContainerProps; }; /** A serialized widget-container description consumed by modal and sidebar widgets. */ export type WidgetContainer = WidgetAccordeonContainer | WidgetTabbedContainer | WidgetPanelContainer; /** * Builds a direct-content container for modal-style and sidebar panel shorthands. */ export declare function asPanelContainer(panel: WidgetPanel): WidgetPanelContainer; /** * Renders an accordion-style widget panel stack. */ export declare function AccordeonWidgetContainer({ panels, className, defaultExpandedPanelIds, expandedPanelIds, onExpandedPanelIdsChange, allowMultipleExpanded }: AccordeonWidgetContainerProps): JSX.Element; /** * Renders a tabbed widget panel switcher. */ export declare function TabbedWidgetContainer({ panels, className, defaultActivePanelId, activePanelId, onActivePanelIdChange, tabListLayout }: TabbedWidgetContainerProps): JSX.Element; /** * Renders child panels in a simple vertical column. */ export declare function ColumnWidgetContainer({ panels, className }: ColumnWidgetContainerProps): JSX.Element; /** * Renders the requested container based on descriptor kind. */ export declare function WidgetContainerRenderer({ container }: { container: WidgetContainer; }): JSX.Element; /** * Returns the effective light/dark theme mode for the current panel subtree. */ export declare function useEffectiveWidgetPanelThemeMode(): WidgetPanelThemeMode; export {}; //# sourceMappingURL=widget-containers.d.ts.map