@purpurds/notification 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +59 -0
- package/dist/notification.cjs.js +26 -0
- package/dist/notification.cjs.js.map +1 -0
- package/dist/notification.d.ts +47 -0
- package/dist/notification.d.ts.map +1 -0
- package/dist/notification.es.js +657 -0
- package/dist/notification.es.js.map +1 -0
- package/dist/notification.system.js +26 -0
- package/dist/notification.system.js.map +1 -0
- package/dist/styles.css +1 -0
- package/package.json +64 -0
- package/readme.mdx +56 -0
- package/src/global.d.ts +4 -0
- package/src/notification.module.scss +70 -0
- package/src/notification.stories.tsx +115 -0
- package/src/notification.test.tsx +150 -0
- package/src/notification.tsx +173 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { HeadingTagType } from "@purpurds/heading";
|
|
3
|
+
export declare const NOTIFICATION_STATUS: {
|
|
4
|
+
readonly SUCCESS: "success";
|
|
5
|
+
readonly WARNING: "warning";
|
|
6
|
+
readonly ERROR: "error";
|
|
7
|
+
readonly INFO: "info";
|
|
8
|
+
};
|
|
9
|
+
export declare const notificationStatuses: ("success" | "warning" | "error" | "info")[];
|
|
10
|
+
export type NotificationStatus = (typeof NOTIFICATION_STATUS)[keyof typeof NOTIFICATION_STATUS];
|
|
11
|
+
export declare const NOTIFICATION_ARIA_LIVE: {
|
|
12
|
+
readonly POLITE: "polite";
|
|
13
|
+
readonly ASSERTIVE: "assertive";
|
|
14
|
+
};
|
|
15
|
+
export declare const notificationAriaLiveValues: ("polite" | "assertive")[];
|
|
16
|
+
export type NotificationAriaLive = (typeof NOTIFICATION_ARIA_LIVE)[keyof typeof NOTIFICATION_ARIA_LIVE];
|
|
17
|
+
export declare const NOTIFICATION_ROLE: {
|
|
18
|
+
readonly ALERT: "alert";
|
|
19
|
+
readonly DIALOG: "dialog";
|
|
20
|
+
readonly ALERTDIALOG: "alertdialog";
|
|
21
|
+
};
|
|
22
|
+
export declare const notificationRoles: ("alert" | "dialog" | "alertdialog")[];
|
|
23
|
+
export type NotificationRole = (typeof NOTIFICATION_ROLE)[keyof typeof NOTIFICATION_ROLE];
|
|
24
|
+
type DefaultProps = {
|
|
25
|
+
["data-testid"]?: string;
|
|
26
|
+
["aria-live"]?: NotificationAriaLive;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
className?: string;
|
|
29
|
+
headingTag?: HeadingTagType;
|
|
30
|
+
status?: NotificationStatus;
|
|
31
|
+
heading?: string;
|
|
32
|
+
role?: NotificationRole;
|
|
33
|
+
hidden?: boolean;
|
|
34
|
+
id?: string;
|
|
35
|
+
};
|
|
36
|
+
type CloseButtonProps = {
|
|
37
|
+
onClose: () => void;
|
|
38
|
+
closeButtonAllyLabel: string;
|
|
39
|
+
};
|
|
40
|
+
type NoCloseButtonProps = {
|
|
41
|
+
onClose?: never;
|
|
42
|
+
closeButtonAllyLabel?: never;
|
|
43
|
+
};
|
|
44
|
+
export type NotificationProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);
|
|
45
|
+
export declare const Notification: React.ForwardRefExoticComponent<NotificationProps & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../src/notification.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA4B,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnE,OAAO,EAAW,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAc5D,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX,eAAO,MAAM,oBAAoB,8CAAqC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEhG,eAAO,MAAM,sBAAsB;;;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