import { TemplateResult } from 'lit'; import { OmniElement } from '../core/OmniElement.js'; import { type ShowToastInit, ToastStack } from './ToastStack.js'; import '../icons/Close.icon.js'; /** * Component to visually notify a user of a message. * * @import * ```js * import '@capitec/omni-components/toast'; * ``` * * @example * ```html * * * ``` * * @element omni-toast * * Registry of all properties defined by the component. * * @slot prefix - Content to render before toast message area. * @slot - Content to render inside the component message area. * @slot close - Content to render as the close button when `closeable`. * * @fires close-click - Dispatched when the close button is clicked when `closeable`. * * @cssprop --omni-toast-min-width - Min Width. * @cssprop --omni-toast-max-width - Max Width. * @cssprop --omni-toast-width - Width. * @cssprop --omni-toast-z-index - The z-index. * @cssprop --omni-toast-border-width - Border width. * @cssprop --omni-toast-border-radius - Border radius. * @cssprop --omni-toast-box-shadow - Box shadow. * @cssprop --omni-toast-padding - Container padding. * @cssprop --omni-toast-horizontal-gap - Horizontal spacing between icon from `type` and content. * @cssprop --omni-toast-icon-size - Symmetrical size of icon from `type`. * * @cssprop --omni-toast-header-font-family - Font family for header. * @cssprop --omni-toast-header-font-size - Font size for header. * @cssprop --omni-toast-header-font-weight - Font weight for header. * @cssprop --omni-toast-header-line-height - Line height for header. * * @cssprop --omni-toast-detail-font-family - Font family for detail. * @cssprop --omni-toast-detail-font-size - Font size for detail. * @cssprop --omni-toast-detail-font-weight - Font weight for detail. * @cssprop --omni-toast-detail-line-height - Line height for detail. * @cssprop --omni-toast-vertical-gap - Vertical space between detail and header. * * @cssprop --omni-toast-background - The default background applied when no `type` is set. * @cssprop --omni-toast-default-font-color - The default font color applied when no `type` is set. * @cssprop --omni-toast-border-color - Border color. * * * @cssprop --omni-toast-success-background - The background applied when `type` is set to `success`. * @cssprop --omni-toast-success-font-color - The font color applied when `type` is set to `success`. * @cssprop --omni-toast-success-border-color - The border color applied when `type` is set to `success`. * @cssprop --omni-toast-success-icon-color - The icon color applied when `type` is set to `success`. * * @cssprop --omni-toast-warning-background - The background applied when `type` is set to `warning`. * @cssprop --omni-toast-warning-font-color - The font color applied when `type` is set to `warning`. * @cssprop --omni-toast-warning-border-color - The border color applied when `type` is set to `warning`. * @cssprop --omni-toast-warning-icon-color - The icon color applied when `type` is set to `warning`. * * @cssprop --omni-toast-error-background - The background applied when `type` is set to `error`. * @cssprop --omni-toast-error-font-color - The font color applied when `type` is set to `error`. * @cssprop --omni-toast-error-border-color - The border color applied when `type` is set to `error`. * @cssprop --omni-toast-error-icon-color - The icon color applied when `type` is set to `error`. * * @cssprop --omni-toast-info-background - The background applied when `type` is set to `info`. * @cssprop --omni-toast-info-font-color - The font color applied when `type` is set to `info`. * @cssprop --omni-toast-info-border-color - The border color applied when `type` is set to `info`. * @cssprop --omni-toast-info-icon-color - The icon color applied when `type` is set to `info`. * * @cssprop --omni-toast-close-padding - Padding applied to close button when `closeable`. * @cssprop --omni-toast-close-size - Symmetrical size applied to close button when `closeable`. * */ export declare class Toast extends OmniElement { /** * The type of toast to display. * @attr */ type: 'success' | 'warning' | 'error' | 'info' | 'none'; /** * The toast title. * @attr */ header?: string; /** * The toast detail. * @attr */ detail?: string; /** * If true, will display a close button that fires a `close-click` event when clicked. * @attr */ closeable?: boolean; private static stack?; /** * Global singleton {@link ToastStack} used for showing a toast, either by adding to, or replacing. * Use `Toast.show` function to add or replace toasts to this instance. */ static get current(): ToastStack & { /** * When true, will append toast to the toast stack. Otherwise when false will replace any toast(s). Defaults to true. */ stack?: boolean; /** * If true, will display a close button that fires a `close-click` event when clicked and removes the toast from the stack. */ closeable?: boolean; /** * If provided will be the time in milliseconds the toast is displayed before being automatically removed from the stack. * Defaults to 3000ms when not provided. * When set to 0 will amount to no timeout. */ duration?: number; }; /** * Configure the global singleton {@link ToastStack} used for showing a toast, either by adding to, or replacing. * Use `Toast.show` function to add or replace toasts to this instance. * @returns The global singleton {@link ToastStack} instance. It can also be accessed via `Toast.current` static property. */ static configure(options: { /** * The position to stack toasts */ position?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; /** * Reverse the order of toast with newest toasts showed on top of the stack. By default newest toasts are showed at the bottom of the stack. */ reverse?: boolean; /** * When true, will append toast to the toast stack. Otherwise when false will replace any toast(s). Defaults to true. */ stack?: boolean; /** * If true, will display a close button that fires a `close-click` event when clicked and removes the toast from the stack. */ closeable?: boolean; /** * If provided will be the time in millisecond the toast is displayed before being automatically removed from the stack. * Defaults to 3000ms when not provided. * When set to 0 it will never be auto removed. */ duration?: number; }): ToastStack & { /** * When true, will append toast to the toast stack. Otherwise when false will replace any toast(s). Defaults to true. */ stack?: boolean; /** * If true, will display a close button that fires a `close-click` event when clicked and removes the toast from the stack. */ closeable?: boolean; /** * If provided will be the time in milliseconds the toast is displayed before being automatically removed from the stack. * Defaults to 3000ms when not provided. * When set to 0 will amount to no timeout. */ duration?: number; }; /** * Show a toast message. * @returns The {@link Toast} instance that was created. */ static show(options: ShowToastInit): Toast; private _raiseCloseClick; static get styles(): import("lit").CSSResultGroup[]; render(): TemplateResult; private iconTemplate; } declare global { interface HTMLElementTagNameMap { 'omni-toast': Toast; } } //# sourceMappingURL=Toast.d.ts.map