@awsui/components-react
Version:
On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en
86 lines • 2.85 kB
TypeScript
import React from 'react';
import { BaseComponentProps } from '../internal/base-component';
import { NonCancelableEventHandler } from '../internal/events';
export declare namespace AlertProps {
type Type = 'success' | 'error' | 'warning' | 'info';
interface Ref {
/**
* Sets focus on the alert content.
*/
focus(): void;
}
interface I18nStrings {
successIconAriaLabel?: string;
errorIconAriaLabel?: string;
warningIconAriaLabel?: string;
infoIconAriaLabel?: string;
dismissAriaLabel?: string;
}
}
export interface AlertProps extends BaseComponentProps {
/**
* Specifies the type of message you want to display.
*/
type?: AlertProps.Type;
/**
* Provides a text alternative for the icon.
*
* @deprecated Use the label properties inside `i18nStrings` instead.
* If the label is assigned via the `i18nStrings` property, this label will be ignored.
*/
statusIconAriaLabel?: string;
/**
* Determines whether the alert is displayed.
* @deprecated Use conditional rendering in your code instead of this prop.
*/
visible?: boolean;
/**
* Adds a close button to the alert when set to `true`.
* An `onDismiss` event is fired when a user clicks the button.
*/
dismissible?: boolean;
/**
* Adds an aria-label to the dismiss button.
* @i18n
*
* @deprecated Use `i18nStrings.dismissAriaLabel` instead.
* If the label is assigned via the `i18nStrings` property, this label will be ignored.
*/
dismissAriaLabel?: string;
/**
* Primary text displayed in the element.
*/
children?: React.ReactNode;
/**
* Heading text.
*/
header?: React.ReactNode;
/**
* Displays an action button next to the message area when set.
* An `onButtonClick` event is fired when the user clicks it.
* @deprecated Replaced by `action`.
*/
buttonText?: React.ReactNode;
/**
* Specifies an action for the alert message.
* Although it is technically possible to insert any content, our UX guidelines only allow you to add a button.
*/
action?: React.ReactNode;
/**
* Fired when the user clicks the close icon that is displayed
* when the `dismissible` property is set to `true`.
*/
onDismiss?: NonCancelableEventHandler;
/**
* Fired when the user clicks the action button.
* **Deprecated** Replaced by `action`.
*/
onButtonClick?: NonCancelableEventHandler;
/**
* An object containing all the necessary localized strings required by the component.
* @property {AlertProps.I18nStrings} [i18nStrings] - optional
* @i18n
*/
i18nStrings?: AlertProps.I18nStrings;
}
//# sourceMappingURL=interfaces.d.ts.map