import React from 'react'; import '../../styles/base.module.css'; import { AllElementPropsWithRef } from '../../utils/elementTypings'; import { Link } from '../link/Link'; export type NotificationType = 'info' | 'error' | 'alert' | 'success'; export declare enum NotificationSize { Small = "small", Medium = "medium", Large = "large" } export type NotificationPosition = 'inline' | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; type CommonProps = React.PropsWithChildren, 'ref'> & { /** * The `ref` is forwarded to the inner content div element. */ ref?: React.Ref; /** * Whether the notification should be closed automatically after a certain time * @default false */ autoClose?: boolean; /** * The duration before the notification is automatically closed in milliseconds. Used together with the `autoClose` prop. * If `autoClose` is `true` and `autoCloseDuration` is not set, the duration is calculated based on the content length with a minimum of 4000ms. */ autoCloseDuration?: number; /** * Boolean indication whether notification has box shadow or not. */ boxShadow?: boolean; /** * Additional class names to apply to the notification */ className?: string; /** * Duration of the close fade-out animation * @default 85 */ closeAnimationDuration?: number; /** * Displays a progress bar on top of the notification when `true` * @default true */ displayAutoCloseProgress?: boolean; /** * Determines whether the notification should be visually hidden. Useful when notification should only be "seen" by screen readers. * @default false */ invisible?: boolean; /** * The label of the notification. * Note: Labels are not displayed visually for small notifications, but they are still accessible to assistive technology. This could be used to help screen reader users to better understand the context of the notification. */ label?: string | React.ReactNode; /** * Link element to be displayed in the notification. If not provided, the link will not be displayed. */ link?: typeof Link | React.ReactNode; /** * The aria-label of the notification region * @default "Notification" */ notificationAriaLabel?: string; /** * Callback fired when the notification is closed */ onClose?: () => void; /** * Override or extend the styles applied to the component */ style?: React.CSSProperties; /** * The type of the notification * @default 'info' */ type?: NotificationType; /** * The aria-level of the heading element * @default 2 */ headingLevel?: number; /** * Automatically focus the label of the notification after it is rendered. * Useful when using Notification as an error summary: move focus to the error list after form submission. * @default false */ autofocus?: boolean; }>; type PositionAndSize = { position?: 'inline'; size?: NotificationSize; } | { /** * The position of the notification */ position?: NotificationPosition; /** * The size of the notification */ size?: Exclude; }; type Dismissible = { dismissible?: false; closeButtonLabelText?: string; } | { /** * Whether the notification can be closed * @default false */ dismissible?: boolean; /** * The aria-label and title for the close button */ closeButtonLabelText: string; }; export type NotificationProps = CommonProps & PositionAndSize & Dismissible; export declare const Notification: ({ autoClose, autoCloseDuration, autofocus, boxShadow, children, className, closeAnimationDuration, closeButtonLabelText, dismissible, displayAutoCloseProgress, invisible, label, notificationAriaLabel, position, onClose, size, style, type, headingLevel, link, ref, ...rest }: NotificationProps) => React.JSX.Element; export {};