UNPKG

@hashicorp/design-system-components

Version:
56 lines (55 loc) 2.06 kB
/** * Copyright IBM Corp. 2021, 2025 * SPDX-License-Identifier: MPL-2.0 */ import Component from '@glimmer/component'; import type { WithBoundArgs } from '@glint/template'; import type Owner from '@ember/owner'; import HdsAlertTitle from './title'; import HdsAlertDescription from './description'; import HdsButton from '../button/index'; import HdsLinkStandalone from '../link/standalone'; import HdsYield from '../yield/index'; import type { HdsAlertColors, HdsAlertTypes } from './types.ts'; import type { HdsIconSignature } from '../icon/index'; export declare const TYPES: HdsAlertTypes[]; export declare const DEFAULT_COLOR: HdsAlertColors; export declare const COLORS: HdsAlertColors[]; export declare const MAPPING_COLORS_TO_ICONS: { readonly neutral: "info"; readonly highlight: "info"; readonly success: "check-circle"; readonly warning: "alert-triangle"; readonly critical: "alert-diamond"; }; export interface HdsAlertSignature { Args: { type: HdsAlertTypes; color?: HdsAlertColors; icon?: HdsIconSignature['Args']['name'] | false; onDismiss?: (event: MouseEvent, ...args: any[]) => void; }; Blocks: { default: [ { Title?: typeof HdsAlertTitle; Description?: typeof HdsAlertDescription; Generic?: typeof HdsYield; LinkStandalone?: WithBoundArgs<typeof HdsLinkStandalone, 'size'>; Button?: WithBoundArgs<typeof HdsButton, 'size'>; } ]; }; Element: HTMLDivElement; } export default class HdsAlert extends Component<HdsAlertSignature> { private _role?; private _ariaLabelledBy?; constructor(owner: Owner, args: HdsAlertSignature['Args']); get color(): HdsAlertColors; get icon(): HdsIconSignature['Args']['name'] | false; get onDismiss(): ((event: MouseEvent, ...args: any[]) => void) | false; get iconSize(): HdsIconSignature['Args']['size']; get classNames(): string; didInsert: (element: HTMLDivElement) => void; }