UNPKG

@coconut-software/ui

Version:

React components for faster and easier web development.

26 lines (25 loc) 1.28 kB
import type { MouseEventHandler, PropsWithChildren } from 'react'; import { AriaLiveRole } from '../utilities/aria'; export interface AlertProps { icon?: JSX.Element | null; role?: AriaLiveRole.Alert | AriaLiveRole.Status; severity?: AlertSeverity; variant?: AlertVariant; } type AlertVariant = 'filled' | 'minimal'; type AlertSeverity = 'info' | 'error' | 'loading' | 'success' | 'warning'; declare function Alert({ children, icon, role, severity, variant, }: PropsWithChildren<AlertProps>): JSX.Element; declare namespace Alert { var Button: typeof AlertButton; var Content: ({ children, }: PropsWithChildren<Record<string, unknown>>) => JSX.Element; var Description: ({ children, }: PropsWithChildren<Record<string, unknown>>) => JSX.Element; var Title: ({ children, }: PropsWithChildren<Record<string, unknown>>) => JSX.Element; var Actions: ({ children, }: PropsWithChildren<Record<string, unknown>>) => JSX.Element; var displayName: string; } interface AlertButtonProps { dataSet?: Record<string, string | undefined>; onClick?: MouseEventHandler<HTMLButtonElement>; } declare function AlertButton({ children, dataSet, onClick, }: PropsWithChildren<AlertButtonProps>): JSX.Element; export default Alert;