UNPKG

@als-tp/als-react-ts-ui

Version:

A comprehensive React TypeScript UI component library built with Base UI by ALSInnovation

94 lines 3.65 kB
import React from "react"; import { Toast } from "@base-ui-components/react/toast"; export type ToastType = "success" | "error" | "warning" | "info" | "default"; interface ALSToastProviderProps { /** Maximum number of toasts that can be displayed at once */ limit?: number; /** Default timeout in ms before auto-dismiss (0 = no auto-dismiss) */ timeout?: number; /** Global toast manager for use outside React components */ toastManager?: ReturnType<typeof Toast.createToastManager>; /** Children */ children: React.ReactNode; } interface ALSToastPortalProps { /** Container element to portal into */ container?: HTMLElement | null; /** Children */ children: React.ReactNode; } interface ALSToastViewportProps { /** Additional class name */ className?: string; /** Inline styles */ style?: React.CSSProperties; } interface ALSToastRootProps { /** The toast object to render (required) */ toast: any; /** Direction(s) in which the toast can be swiped to dismiss */ swipeDirection?: "left" | "right" | "up" | "down" | ("left" | "right" | "up" | "down")[]; /** Additional class name */ className?: string; /** Inline styles */ style?: React.CSSProperties; /** Children */ children: React.ReactNode; } interface ALSToastContentProps { /** Additional class name */ className?: string; /** Inline styles */ style?: React.CSSProperties; /** Children */ children: React.ReactNode; } interface ALSToastTitleProps { /** Additional class name */ className?: string; /** Inline styles */ style?: React.CSSProperties; /** Children */ children: React.ReactNode; } interface ALSToastDescriptionProps { /** Additional class name */ className?: string; /** Inline styles */ style?: React.CSSProperties; /** Children */ children: React.ReactNode; } interface ALSToastActionProps { /** Additional class name */ className?: string; /** Inline styles */ style?: React.CSSProperties; /** Children */ children?: React.ReactNode; /** Click handler */ onClick?: React.MouseEventHandler<HTMLButtonElement>; } interface ALSToastCloseProps { /** Additional class name */ className?: string; /** Inline styles */ style?: React.CSSProperties; /** Children (optional, defaults to X icon) */ children?: React.ReactNode; } export declare const ALSToast: { Provider: React.FC<ALSToastProviderProps>; Portal: React.FC<ALSToastPortalProps>; Viewport: React.ForwardRefExoticComponent<ALSToastViewportProps & React.RefAttributes<HTMLDivElement>>; Root: React.ForwardRefExoticComponent<ALSToastRootProps & React.RefAttributes<HTMLDivElement>>; Content: React.ForwardRefExoticComponent<ALSToastContentProps & React.RefAttributes<HTMLDivElement>>; Title: React.ForwardRefExoticComponent<ALSToastTitleProps & React.RefAttributes<HTMLHeadingElement>>; Description: React.ForwardRefExoticComponent<ALSToastDescriptionProps & React.RefAttributes<HTMLParagraphElement>>; Action: React.ForwardRefExoticComponent<ALSToastActionProps & React.RefAttributes<HTMLButtonElement>>; Close: React.ForwardRefExoticComponent<ALSToastCloseProps & React.RefAttributes<HTMLButtonElement>>; useToastManager: typeof Toast.useToastManager; createToastManager: typeof Toast.createToastManager; }; export type { ALSToastProviderProps, ALSToastPortalProps, ALSToastViewportProps, ALSToastRootProps, ALSToastContentProps, ALSToastTitleProps, ALSToastDescriptionProps, ALSToastActionProps, ALSToastCloseProps, }; //# sourceMappingURL=index.d.ts.map