@brizy/ui
Version:
React elements in Brizy style
22 lines (21 loc) • 767 B
TypeScript
import { ReactElement } from "react";
export type NotificationData<T extends string | number> = {
id: T;
text: string;
type: "success" | "info" | "error";
duration?: number;
closable?: boolean;
};
export interface Props<T extends string | number> {
notifications: NotificationData<T>[];
position?: "topLeft" | "topRight" | "topCenter" | "bottomLeft" | "bottomRight" | "bottomCenter";
onClose: (id: T) => void;
offsetX?: string;
offsetY?: string;
}
export interface OffsetProperties {
"--offset-x": string | undefined;
"--offset-y": string | undefined;
}
declare const Notification: <T extends string | number>({ notifications, position, offsetX, offsetY, onClose, }: Props<T>) => ReactElement;
export { Notification };