import { TNode, Value, Renderable } from '@tempots/dom'; import type { ThemeColorName } from '../../tokens'; /** * Configuration options for the {@link AnnouncementBar} component. */ export type AnnouncementBarOptions = { /** * Theme color applied to the announcement bar background. * @default 'primary' */ color?: Value; /** * Optional icon identifier displayed at the start of the announcement bar. * When `undefined` or not provided, no icon is rendered. */ icon?: Value; /** * Whether the announcement bar can be dismissed by the user via a close button. * @default false */ closable?: Value; /** * Callback invoked when the user dismisses the announcement bar. * When provided and `closable` is not explicitly set, the bar is implicitly made dismissible. */ onClose?: () => void; /** * Additional CSS class names to apply to the announcement bar element. */ class?: Value; /** * Controls where the announcement bar is rendered in the DOM. * - `true` (default) - Portals to the document body, fixed at the top of the viewport. * - `false` - Renders inline as a child of the current parent element. * - A CSS selector string - Portals to the element matching the selector. * @default false */ portal?: boolean | string; }; /** * Displays a colored announcement bar, typically at the top of a page or container. * * Supports an optional leading icon, user-dismissible close button, and theme color * customization. When dismissed, the bar is removed from the DOM and the `onClose` * callback is invoked. * * @param options - Configuration options controlling color, icon, closability, and styling * @param children - Text or node content displayed inside the announcement bar * @returns A renderable node that is conditionally visible based on dismiss state * * @example * ```typescript * AnnouncementBar( * { color: 'warning', closable: true, onClose: () => console.log('dismissed') }, * "You're on our launch Free plan with unlimited resumes and redaction!" * ) * ``` * * @example * ```typescript * // With an icon * AnnouncementBar( * { color: 'info', icon: 'info-circle', closable: true }, * 'System maintenance scheduled for tonight at 10 PM.' * ) * ``` */ export declare function AnnouncementBar({ color, icon, closable, onClose, class: cls, portal: portalTarget, }: AnnouncementBarOptions, ...children: TNode[]): Renderable;