@amsterdam/design-system-react
Version:
All React components from the Amsterdam Design System. Use it to compose pages in your website or application.
62 lines (61 loc) • 2.46 kB
TypeScript
/**
* @license EUPL-1.2+
* Copyright Gemeente Amsterdam
*/
import type { HTMLAttributes, PropsWithChildren } from 'react';
import type { HeadingProps } from '../Heading';
type Severity = 'error' | 'success' | 'warning';
export type AlertProps = {
/** Whether the user can dismiss the Alert. Adds a button to its top right. */
closeable?: boolean;
/** The label for the button that dismisses the Alert. */
closeButtonLabel?: string;
/** The text for the Heading. */
heading: string;
/**
* The id of the Heading element, which is used to label the Alert.
* Can be set to `null` to explicitly remove the label.
* Note: must be unique for the page.
*/
headingId?: string | null;
/**
* The hierarchical level of the Alert’s Heading within the document.
* There is no default value; determine the correct level for each instance.
* The size of the heading is fixed at level 3.
*/
headingLevel: HeadingProps['level'];
/** A function to run when dismissing. */
onClose?: () => void;
/** The significance of the message conveyed. */
severity?: Severity;
} & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
/**
* @see {@link https://designsystem.amsterdam/?path=/docs/components-feedback-alert--docs Alert docs at Amsterdam Design System}
*/
export declare const Alert: import("react").ForwardRefExoticComponent<{
/** Whether the user can dismiss the Alert. Adds a button to its top right. */
closeable?: boolean;
/** The label for the button that dismisses the Alert. */
closeButtonLabel?: string;
/** The text for the Heading. */
heading: string;
/**
* The id of the Heading element, which is used to label the Alert.
* Can be set to `null` to explicitly remove the label.
* Note: must be unique for the page.
*/
headingId?: string | null;
/**
* The hierarchical level of the Alert’s Heading within the document.
* There is no default value; determine the correct level for each instance.
* The size of the heading is fixed at level 3.
*/
headingLevel: HeadingProps["level"];
/** A function to run when dismissing. */
onClose?: () => void;
/** The significance of the message conveyed. */
severity?: Severity;
} & HTMLAttributes<HTMLDivElement> & {
children?: import("react").ReactNode | undefined;
} & import("react").RefAttributes<HTMLDivElement>>;
export {};