import { EventEmitter } from "../../stencil-public-runtime"; import { DuetIconName, DuetMargin, DuetPadding, DuetStatus, DuetTheme } from "../../common-types"; import { ThemeableComponent } from "../../common/themeable-component"; import { DuetLangObject } from "../../utils/language-utils"; export type DuetAlertEvent = { component: "duet-alert"; originalEvent: MouseEvent; }; /** * @slot default - Alert content. * @slot show-more - Additional content that is initially hidden and shown when user expands it. */ export declare class DuetAlert implements ThemeableComponent { private descriptiveId; private alertContainer; private hasShowMoreSlot; element: HTMLElement; /** * Theme of the card. */ theme: DuetTheme; /** * State() variables * Inlined decorator, alphabetical order. */ isDismissed: boolean; isExpanded: boolean; /** * Timeout Id for auto dismiss setTimeout */ timeoutID: ReturnType; /** * Property to change languageDefaults on the component. * normally you would handle these strings on an application level and override accessibleLabel when needed * @default {fi: "Painike viestin sulkemiseen", sv: "Knapp för att stänga meddelandet", en: "Button to close the message"} */ accessibleLabelDefaults: DuetLangObject | string; /** * Adds accessible label for the dismissible alert close button. * @default {fi: "Painike viestin sulkemiseen", sv: "Knapp för att stänga meddelandet", en: "Button to close the message"} */ accessibleLabel: string; /** * Enable or disabled announcements by assistive technologies. If the alert is present already on page load, this usually * should be set to false, so that it is not read out first. */ announcements: boolean; /** * Icon to display to the left of the content, overriding the default status icon. As the alert now uses default status icons, * use of this property is discouraged, and it is being considered for deprication. */ icon: DuetIconName; /** * Time in milliseconds which is waited before auto dismiss. */ autoDismiss: number; /** * Controls the margin of the component. */ margin: DuetMargin; /** * Controls the padding of the component. */ padding: DuetPadding; /** * Status variation of the alert. "danger" and "warning" will render the alert with role "alert" (unless announcements * has been set to false). Other variations will have role "status". Use "danger" only when something serious has happened * or the user must take immediate action. Use "warning" for unexpected situations that are potentially harmful, but * don't require immediate action. */ variation: DuetStatus; /** * Allows for styling of the alert based on its position in the layout. * "below-nav" is used when the alert is below the navigation bar. It also overrides the icon to be the same as the variation. */ position: "below-nav" | "content"; /** * Show a button to dismiss the alert. Note that this has no effect when expandingTitle is used. */ dismissible: boolean; /** * @deprecated - if you need to set focus, use a focusable element inside * Make alert focusable. */ focusable: boolean; /** * When given, the expanding title is initially shown and the content of the alert is hidden. The title acts as a * toggle button for showing/hiding the content. Note that you can't make an expanding alert dismissible. */ expandingTitle: string; /** * Emitted when the dismiss button is clicked */ duetDismiss: EventEmitter; /** * Emitted when the alert closing transition is complete. */ duetCloseComplete: EventEmitter; /** * Component lifecycle events. */ componentWillLoad(): void; componentDidLoad(): void; connectedCallback(): void; disconnectedCallback(): void; /** * Show. */ show(): Promise; /** * Hide. */ hide(): Promise; /** * @deprecated - if you need to set focus, use a focusable element inside */ setFocus(options?: FocusOptions): Promise; private handleDismiss; private handleShow; private handleHide; private handleExpandToggle; private getRole; /** * There is bug in NVDA screen reader * that is causing multiple alert readings * when alert contains other components (link, button etc.). */ /** * render() function * Always the last one in the class. */ render(): any; }