quirk-ui 0.0.6 → 0.0.7
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/arrow-right-CnuUc2oD.js +25 -0
- package/dist/assets/index.css +1 -1
- package/dist/assets/index.css.d.ts +1 -7
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index10.css.d.ts +5 -2
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index11.css.d.ts +3 -3
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index13.css.d.ts +4 -4
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index16.css.d.ts +1 -4
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index2.css.d.ts +7 -5
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index20.css.d.ts +2 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index21.css.d.ts +15 -4
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index22.css.d.ts +10 -2
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index23.css.d.ts +9 -3
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index24.css.d.ts +6 -3
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index25.css.d.ts +9 -5
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index26.css.d.ts +8 -17
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index27.css.d.ts +10 -5
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index28.css.d.ts +1 -8
- package/dist/assets/index29.css +1 -0
- package/dist/assets/index29.css.d.ts +12 -0
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index3.css.d.ts +3 -4
- package/dist/assets/index30.css +1 -0
- package/dist/assets/index30.css.d.ts +15 -0
- package/dist/assets/index31.css +1 -0
- package/dist/assets/index31.css.d.ts +12 -0
- package/dist/assets/index32.css +1 -0
- package/dist/assets/index32.css.d.ts +14 -0
- package/dist/assets/index33.css +1 -0
- package/dist/assets/index33.css.d.ts +5 -0
- package/dist/assets/index34.css +1 -0
- package/dist/assets/index34.css.d.ts +8 -0
- package/dist/assets/index35.css +1 -0
- package/dist/assets/index35.css.d.ts +6 -0
- package/dist/assets/index36.css +1 -0
- package/dist/assets/index36.css.d.ts +7 -0
- package/dist/assets/index37.css +1 -0
- package/dist/assets/index37.css.d.ts +7 -0
- package/dist/assets/index38.css +1 -0
- package/dist/assets/index38.css.d.ts +6 -0
- package/dist/assets/index39.css +1 -0
- package/dist/assets/index39.css.d.ts +6 -0
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index4.css.d.ts +5 -4
- package/dist/assets/index40.css +1 -0
- package/dist/assets/index40.css.d.ts +7 -0
- package/dist/assets/index41.css +1 -0
- package/dist/assets/index41.css.d.ts +10 -0
- package/dist/assets/index42.css +1 -0
- package/dist/assets/index42.css.d.ts +9 -0
- package/dist/assets/index43.css +1 -0
- package/dist/assets/index43.css.d.ts +20 -0
- package/dist/assets/index44.css +1 -0
- package/dist/assets/index44.css.d.ts +21 -0
- package/dist/assets/index45.css +1 -0
- package/dist/assets/index45.css.d.ts +9 -0
- package/dist/assets/index46.css +1 -0
- package/dist/assets/index46.css.d.ts +12 -0
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index5.css.d.ts +4 -17
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index6.css.d.ts +4 -7
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index7.css.d.ts +17 -2
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index8.css.d.ts +10 -6
- package/dist/assets/index9.css +1 -1
- package/dist/assets/index9.css.d.ts +7 -3
- package/dist/chevron-down-DSUzBz9F.js +11 -0
- package/dist/components/Accordion/Accordion.test.js +45 -0
- package/dist/components/Accordion/index.js +49 -0
- package/dist/components/Alert/Alert.test.js +52 -0
- package/dist/components/Alert/__mocks__/styles.module.css.js +11 -0
- package/dist/components/Alert/index.js +57 -0
- package/dist/components/Avatar/Avatar.test.js +51 -0
- package/dist/components/Avatar/index.js +51 -0
- package/dist/components/Badge/Badge.test.js +62 -0
- package/dist/components/Badge/__mocks__/styles.module.css.js +10 -0
- package/dist/components/Badge/index.js +41 -0
- package/dist/components/Box/Box.test.js +2 -1
- package/dist/components/Button/Button.test.js +2 -1
- package/dist/components/Button/index.js +14 -14
- package/dist/components/ButtonGroup/ButtonGroup.test.js +2 -1
- package/dist/components/ButtonGroup/index.js +11 -11
- package/dist/components/Calendar/Calendar.test.js +5 -4
- package/dist/components/Calendar/index.js +4 -2
- package/dist/components/Card/Card.test.js +49 -0
- package/dist/components/Card/__mocks__/styles.module.css.js +11 -0
- package/dist/components/Card/index.js +77 -0
- package/dist/components/Carousel/Carousel.test.js +41 -0
- package/dist/components/Carousel/index.js +96 -0
- package/dist/components/Checkbox/Checkbox.test.js +2 -1
- package/dist/components/Checkbox/index.js +10 -9
- package/dist/components/Container/Container.test.js +2 -1
- package/dist/components/DatePicker/DatePicker.test.js +3 -2
- package/dist/components/DatePicker/index.js +16 -15
- package/dist/components/Divider/Divider.test.js +10 -9
- package/dist/components/Drawer/Drawer.test.js +35 -0
- package/dist/components/Drawer/__mocks__/styles.module.css.js +9 -0
- package/dist/components/Drawer/index.js +55 -0
- package/dist/components/Fieldset/Fieldset.test.js +3 -2
- package/dist/components/Fieldset/index.js +1 -1
- package/dist/components/FileUpload/FileUpload.test.js +2 -1
- package/dist/components/FileUpload/index.js +4 -3
- package/dist/components/FloatingActionButton/FloatingActionButton.test.js +11 -20
- package/dist/components/Form/Form.test.js +2 -1
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Grid/Grid.test.js +14 -13
- package/dist/components/Grid/index.js +53 -17
- package/dist/components/Heading/Heading.test.js +2 -1
- package/dist/components/IconButton/IconButton.test.js +10 -9
- package/dist/components/Input/Input.test.js +5 -4
- package/dist/components/Input/index.js +13 -12
- package/dist/components/Label/Label.test.js +2 -1
- package/dist/components/Label/index.js +25 -26
- package/dist/components/Link/Link.test.js +3 -2
- package/dist/components/Link/index.js +1 -1
- package/dist/components/List/List.test.js +78 -0
- package/dist/components/List/index.js +24 -0
- package/dist/components/Modal/Modal.test.js +94 -0
- package/dist/components/Modal/index.js +37 -0
- package/dist/components/MultiSelect/MultiSelect.test.js +2 -1
- package/dist/components/MultiSelect/index.js +4 -3
- package/dist/components/NavBar/NavBar.test.js +54 -0
- package/dist/components/NavBar/index.js +139 -0
- package/dist/components/Notification/Notification.test.js +64 -0
- package/dist/components/Notification/__mocks__/styles.module.css.js +9 -0
- package/dist/components/Notification/index.js +61 -0
- package/dist/components/NotificationContainer/NotificationContainer.test.js +28 -0
- package/dist/components/NotificationContainer/index.js +15 -0
- package/dist/components/ProgressBar/ProgressBar.test.js +24 -0
- package/dist/components/ProgressBar/__mocks__/styles.module.css.js +9 -0
- package/dist/components/ProgressBar/index.js +50 -0
- package/dist/components/Radio/Radio.test.js +8 -7
- package/dist/components/Radio/index.js +10 -10
- package/dist/components/Range/Range.test.js +5 -4
- package/dist/components/Range/index.js +13 -12
- package/dist/components/Select/Select.test.js +6 -5
- package/dist/components/Select/index.js +8 -7
- package/dist/components/Skeleton/Skeleton.test.js +26 -0
- package/dist/components/Skeleton/__mocks__/styles.module.css.js +8 -0
- package/dist/components/Skeleton/index.js +34 -0
- package/dist/components/Spacer/Spacer.test.js +2 -1
- package/dist/components/Spacer/index.js +1 -1
- package/dist/components/Spinner/Spinner.test.js +18 -0
- package/dist/components/Spinner/__mocks__/styles.module.css.js +12 -0
- package/dist/components/Spinner/index.js +39 -0
- package/dist/components/Stack/Stack.test.js +2 -1
- package/dist/components/Stack/index.js +1 -1
- package/dist/components/Switch/Switch.test.js +4 -3
- package/dist/components/Switch/index.js +9 -8
- package/dist/components/Table/Table.test.js +2 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tabs/Context.js +11 -0
- package/dist/components/Tabs/Tabs.test.js +49 -0
- package/dist/components/Tabs/__mocks__/styles.module.css.js +8 -0
- package/dist/components/Tabs/index.js +89 -0
- package/dist/components/Text/Text.test.js +2 -1
- package/dist/components/Text/index.js +1 -1
- package/dist/components/Textarea/Textarea.test.js +2 -1
- package/dist/components/Textarea/index.js +13 -12
- package/dist/components/Tooltip/Tooltip.test.js +43 -0
- package/dist/components/Tooltip/index.js +45 -0
- package/dist/{index-BtY6pil2.js → index-BXkubhGb.js} +1 -1
- package/dist/index-Bgo8MuTU.js +4279 -0
- package/dist/{index-DhqFdMqD.js → index-RF23qrF-.js} +172 -190
- package/dist/lib/components/Accordion/Accordion.test.d.ts +0 -0
- package/dist/lib/components/Accordion/index.d.ts +13 -0
- package/dist/lib/components/Alert/Alert.test.d.ts +0 -0
- package/dist/lib/components/Alert/__mocks__/styles.module.css.d.ts +9 -0
- package/dist/lib/components/Alert/index.d.ts +15 -0
- package/dist/lib/components/Avatar/Avatar.test.d.ts +0 -0
- package/dist/lib/components/Avatar/index.d.ts +25 -0
- package/dist/lib/components/Badge/Badge.test.d.ts +0 -0
- package/dist/lib/components/Badge/__mocks__/styles.module.css.d.ts +8 -0
- package/dist/lib/components/Badge/index.d.ts +18 -0
- package/dist/lib/components/Card/Card.test.d.ts +0 -0
- package/dist/lib/components/Card/__mocks__/styles.module.css.d.ts +9 -0
- package/dist/lib/components/Card/index.d.ts +22 -0
- package/dist/lib/components/Carousel/Carousel.test.d.ts +0 -0
- package/dist/lib/components/Carousel/index.d.ts +9 -0
- package/dist/lib/components/Drawer/Drawer.test.d.ts +0 -0
- package/dist/lib/components/Drawer/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/Drawer/index.d.ts +19 -0
- package/dist/lib/components/Grid/index.d.ts +9 -1
- package/dist/lib/components/Heading/index.d.ts +0 -2
- package/dist/lib/components/List/List.test.d.ts +1 -0
- package/dist/lib/components/List/index.d.ts +15 -0
- package/dist/lib/components/Modal/Modal.test.d.ts +1 -0
- package/dist/lib/components/Modal/index.d.ts +10 -0
- package/dist/lib/components/NavBar/NavBar.test.d.ts +1 -0
- package/dist/lib/components/NavBar/index.d.ts +16 -0
- package/dist/lib/components/Notification/Notification.test.d.ts +1 -0
- package/dist/lib/components/Notification/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/Notification/index.d.ts +17 -0
- package/dist/lib/components/NotificationContainer/NotificationContainer.test.d.ts +1 -0
- package/dist/lib/components/NotificationContainer/index.d.ts +6 -0
- package/dist/lib/components/ProgressBar/ProgressBar.test.d.ts +1 -0
- package/dist/lib/components/ProgressBar/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/ProgressBar/index.d.ts +15 -0
- package/dist/lib/components/Skeleton/Skeleton.test.d.ts +1 -0
- package/dist/lib/components/Skeleton/__mocks__/styles.module.css.d.ts +6 -0
- package/dist/lib/components/Skeleton/index.d.ts +15 -0
- package/dist/lib/components/Spinner/Spinner.test.d.ts +1 -0
- package/dist/lib/components/Spinner/__mocks__/styles.module.css.d.ts +10 -0
- package/dist/lib/components/Spinner/index.d.ts +20 -0
- package/dist/lib/components/Tabs/Context.d.ts +10 -0
- package/dist/lib/components/Tabs/Tabs.test.d.ts +0 -0
- package/dist/lib/components/Tabs/__mocks__/styles.module.css.d.ts +6 -0
- package/dist/lib/components/Tabs/index.d.ts +27 -0
- package/dist/lib/components/Tooltip/Tooltip.test.d.ts +0 -0
- package/dist/lib/components/Tooltip/index.d.ts +16 -0
- package/dist/lib/main.d.ts +19 -0
- package/dist/lib/utils/NotificationManager/NotificationManager.test.d.ts +1 -0
- package/dist/lib/utils/NotificationManager/index.d.ts +10 -0
- package/dist/lib/utils/ThemeProvider/index.d.ts +7 -0
- package/dist/main.js +78 -44
- package/dist/plus-Cs7TaIK9.js +14 -0
- package/dist/utils/NotificationManager/NotificationManager.test.js +34 -0
- package/dist/utils/NotificationManager/index.js +70 -0
- package/dist/utils/RenderAsRichtext.tsx/index.js +5 -0
- package/dist/utils/ThemeProvider/index.js +13 -0
- package/dist/vi.B-PuvDzu-a048kFcX.js +41965 -0
- package/dist/x-CnsEH4Ox.js +14 -0
- package/package.json +3 -2
- package/dist/index-BWTAh3RO.js +0 -57529
- /package/dist/lib/utils/{renderRichText.d.ts → RenderAsRichtext.tsx/index.d.ts} +0 -0
- /package/dist/utils/{renderRichText.js → RenderAsRichtext.js} +0 -0
package/dist/main.js
CHANGED
|
@@ -1,56 +1,90 @@
|
|
|
1
1
|
import { ButtonGroup as t } from "./components/ButtonGroup/index.js";
|
|
2
2
|
import { FloatingActionButton as p } from "./components/FloatingActionButton/index.js";
|
|
3
|
-
import { Button as
|
|
3
|
+
import { Button as f } from "./components/Button/index.js";
|
|
4
4
|
import { IconButton as a } from "./components/IconButton/index.js";
|
|
5
5
|
import { Heading as n } from "./components/Heading/index.js";
|
|
6
|
-
import { Text as
|
|
7
|
-
import { L as
|
|
8
|
-
import { Grid as
|
|
9
|
-
import { Container as
|
|
10
|
-
import { Stack as
|
|
6
|
+
import { Text as c } from "./components/Text/index.js";
|
|
7
|
+
import { L as u } from "./index-BXkubhGb.js";
|
|
8
|
+
import { Grid as B } from "./components/Grid/index.js";
|
|
9
|
+
import { Container as b } from "./components/Container/index.js";
|
|
10
|
+
import { Stack as k } from "./components/Stack/index.js";
|
|
11
11
|
import { Box as T } from "./components/Box/index.js";
|
|
12
|
-
import { Spacer as
|
|
13
|
-
import { Divider as
|
|
14
|
-
import { Table as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
12
|
+
import { Spacer as F } from "./components/Spacer/index.js";
|
|
13
|
+
import { Divider as v } from "./components/Divider/index.js";
|
|
14
|
+
import { Table as N } from "./components/Table/index.js";
|
|
15
|
+
import { List as w } from "./components/List/index.js";
|
|
16
|
+
import { Card as I } from "./components/Card/index.js";
|
|
17
|
+
import { Avatar as P } from "./components/Avatar/index.js";
|
|
18
|
+
import { Badge as H } from "./components/Badge/index.js";
|
|
19
|
+
import { Tooltip as j } from "./components/Tooltip/index.js";
|
|
20
|
+
import { Modal as y } from "./components/Modal/index.js";
|
|
21
|
+
import { Accordion as E } from "./components/Accordion/index.js";
|
|
22
|
+
import { Alert as K } from "./components/Alert/index.js";
|
|
23
|
+
import { Notification as Q } from "./components/Notification/index.js";
|
|
24
|
+
import { NotificationContainer as W } from "./components/NotificationContainer/index.js";
|
|
25
|
+
import { ProgressBar as Y } from "./components/ProgressBar/index.js";
|
|
26
|
+
import { Spinner as _ } from "./components/Spinner/index.js";
|
|
27
|
+
import { Skeleton as oo } from "./components/Skeleton/index.js";
|
|
28
|
+
import { Carousel as to } from "./components/Carousel/index.js";
|
|
29
|
+
import { Navbar as po } from "./components/NavBar/index.js";
|
|
30
|
+
import { Drawer as fo } from "./components/Drawer/index.js";
|
|
31
|
+
import { Tabs as ao } from "./components/Tabs/index.js";
|
|
32
|
+
import { Form as no } from "./components/Form/index.js";
|
|
33
|
+
import { Label as co } from "./components/Label/index.js";
|
|
34
|
+
import { Input as so } from "./components/Input/index.js";
|
|
35
|
+
import { Fieldset as So } from "./components/Fieldset/index.js";
|
|
36
|
+
import { Radio as go } from "./components/Radio/index.js";
|
|
37
|
+
import { Checkbox as Co } from "./components/Checkbox/index.js";
|
|
38
|
+
import { Textarea as Ao } from "./components/Textarea/index.js";
|
|
39
|
+
import { Select as Lo } from "./components/Select/index.js";
|
|
40
|
+
import { Switch as Do } from "./components/Switch/index.js";
|
|
41
|
+
import { MultiSelect as ho } from "./components/MultiSelect/index.js";
|
|
42
|
+
import { DatePicker as Go } from "./components/DatePicker/index.js";
|
|
43
|
+
import { Range as Mo } from "./components/Range/index.js";
|
|
44
|
+
import { FileUpload as Ro } from "./components/FileUpload/index.js";
|
|
28
45
|
export {
|
|
46
|
+
E as Accordion,
|
|
47
|
+
K as Alert,
|
|
48
|
+
P as Avatar,
|
|
49
|
+
H as Badge,
|
|
29
50
|
T as Box,
|
|
30
|
-
|
|
51
|
+
f as Button,
|
|
31
52
|
t as ButtonGroup,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
53
|
+
I as Card,
|
|
54
|
+
to as Carousel,
|
|
55
|
+
Co as Checkbox,
|
|
56
|
+
b as Container,
|
|
57
|
+
Go as DatePicker,
|
|
58
|
+
v as Divider,
|
|
59
|
+
fo as Drawer,
|
|
60
|
+
So as Fieldset,
|
|
61
|
+
Ro as FileUpload,
|
|
38
62
|
p as FloatingActionButton,
|
|
39
|
-
|
|
40
|
-
|
|
63
|
+
no as Form,
|
|
64
|
+
B as Grid,
|
|
41
65
|
n as Heading,
|
|
42
66
|
a as IconButton,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
67
|
+
so as Input,
|
|
68
|
+
co as Label,
|
|
69
|
+
u as Link,
|
|
70
|
+
w as List,
|
|
71
|
+
y as Modal,
|
|
72
|
+
ho as MultiSelect,
|
|
73
|
+
po as Navbar,
|
|
74
|
+
Q as Notification,
|
|
75
|
+
W as NotificationContainer,
|
|
76
|
+
Y as ProgressBar,
|
|
77
|
+
go as Radio,
|
|
78
|
+
Mo as Range,
|
|
79
|
+
Lo as Select,
|
|
80
|
+
oo as Skeleton,
|
|
81
|
+
F as Spacer,
|
|
82
|
+
_ as Spinner,
|
|
83
|
+
k as Stack,
|
|
84
|
+
Do as Switch,
|
|
85
|
+
N as Table,
|
|
86
|
+
ao as Tabs,
|
|
87
|
+
c as Text,
|
|
88
|
+
Ao as Textarea,
|
|
89
|
+
j as Tooltip
|
|
56
90
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { c as e } from "./createLucideIcon-C8GTh_Qx.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.488.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
const o = [
|
|
9
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
10
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
11
|
+
], c = e("plus", o);
|
|
12
|
+
export {
|
|
13
|
+
c as P
|
|
14
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { d as h, i as n, r as a, g as o, s as i, f, v as c, a as T } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { NotificationManager as s, useNotifications as m } from "./index.js";
|
|
4
|
+
const r = () => {
|
|
5
|
+
const { showNotification: e } = m();
|
|
6
|
+
return /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
7
|
+
"button",
|
|
8
|
+
{
|
|
9
|
+
onClick: () => e("Test Notification", "info", 3e3),
|
|
10
|
+
children: "Show Notification"
|
|
11
|
+
}
|
|
12
|
+
) });
|
|
13
|
+
};
|
|
14
|
+
h("NotificationManager", () => {
|
|
15
|
+
n("renders without crashing", () => {
|
|
16
|
+
a(
|
|
17
|
+
/* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(r, {}) })
|
|
18
|
+
), o(i.getByText("Show Notification")).toBeInTheDocument();
|
|
19
|
+
}), n("shows a notification when triggered", () => {
|
|
20
|
+
a(
|
|
21
|
+
/* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(r, {}) })
|
|
22
|
+
);
|
|
23
|
+
const e = i.getByText("Show Notification");
|
|
24
|
+
f.click(e), o(i.getByText("Test Notification")).toBeInTheDocument();
|
|
25
|
+
}), n("automatically removes a notification after the duration", async () => {
|
|
26
|
+
c.useFakeTimers(), a(
|
|
27
|
+
/* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(r, {}) })
|
|
28
|
+
);
|
|
29
|
+
const e = i.getByText("Show Notification");
|
|
30
|
+
f.click(e), o(i.getByText("Test Notification")).toBeInTheDocument(), T(() => {
|
|
31
|
+
c.advanceTimersByTime(3500);
|
|
32
|
+
}), o(i.queryByText("Test Notification")).not.toBeInTheDocument(), c.useRealTimers();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsxs as g, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as x, useState as h, useCallback as U, useContext as w } from "react";
|
|
3
|
+
import { NotificationContainer as b } from "../../components/NotificationContainer/index.js";
|
|
4
|
+
import "../../components/Tabs/index.js";
|
|
5
|
+
const o = [];
|
|
6
|
+
for (let t = 0; t < 256; ++t)
|
|
7
|
+
o.push((t + 256).toString(16).slice(1));
|
|
8
|
+
function N(t, n = 0) {
|
|
9
|
+
return (o[t[n + 0]] + o[t[n + 1]] + o[t[n + 2]] + o[t[n + 3]] + "-" + o[t[n + 4]] + o[t[n + 5]] + "-" + o[t[n + 6]] + o[t[n + 7]] + "-" + o[t[n + 8]] + o[t[n + 9]] + "-" + o[t[n + 10]] + o[t[n + 11]] + o[t[n + 12]] + o[t[n + 13]] + o[t[n + 14]] + o[t[n + 15]]).toLowerCase();
|
|
10
|
+
}
|
|
11
|
+
let a;
|
|
12
|
+
const v = new Uint8Array(16);
|
|
13
|
+
function C() {
|
|
14
|
+
if (!a) {
|
|
15
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
16
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
17
|
+
a = crypto.getRandomValues.bind(crypto);
|
|
18
|
+
}
|
|
19
|
+
return a(v);
|
|
20
|
+
}
|
|
21
|
+
const f = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), m = { randomUUID: f };
|
|
22
|
+
function D(t, n, c) {
|
|
23
|
+
var e;
|
|
24
|
+
if (m.randomUUID && !t)
|
|
25
|
+
return m.randomUUID();
|
|
26
|
+
t = t || {};
|
|
27
|
+
const i = t.random ?? ((e = t.rng) == null ? void 0 : e.call(t)) ?? C();
|
|
28
|
+
if (i.length < 16)
|
|
29
|
+
throw new Error("Random bytes length must be >= 16");
|
|
30
|
+
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, N(i);
|
|
31
|
+
}
|
|
32
|
+
const l = x(
|
|
33
|
+
void 0
|
|
34
|
+
), j = ({
|
|
35
|
+
children: t
|
|
36
|
+
}) => {
|
|
37
|
+
const [n, c] = h([]), i = U(
|
|
38
|
+
(r, u = "info", d = 3e3) => {
|
|
39
|
+
const s = D();
|
|
40
|
+
c((y) => [
|
|
41
|
+
...y,
|
|
42
|
+
{
|
|
43
|
+
id: s,
|
|
44
|
+
message: r,
|
|
45
|
+
variant: u,
|
|
46
|
+
duration: d,
|
|
47
|
+
onClose: () => e(s)
|
|
48
|
+
}
|
|
49
|
+
]);
|
|
50
|
+
},
|
|
51
|
+
[]
|
|
52
|
+
), e = (r) => {
|
|
53
|
+
c((u) => u.filter((d) => d.id !== r));
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ g(l.Provider, { value: { showNotification: i }, children: [
|
|
56
|
+
t,
|
|
57
|
+
/* @__PURE__ */ p(b, { notifications: n })
|
|
58
|
+
] });
|
|
59
|
+
}, E = () => {
|
|
60
|
+
const t = w(l);
|
|
61
|
+
if (!t)
|
|
62
|
+
throw new Error(
|
|
63
|
+
"useNotifications must be used within a NotificationManager"
|
|
64
|
+
);
|
|
65
|
+
return t;
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
j as NotificationManager,
|
|
69
|
+
E as useNotifications
|
|
70
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as c, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as f } from "react";
|
|
3
|
+
import '../../assets/index.css';function u({ children: o, theme: r = {} }) {
|
|
4
|
+
return f(() => {
|
|
5
|
+
const t = document.documentElement;
|
|
6
|
+
Object.entries(r).forEach(([n, e]) => {
|
|
7
|
+
e && t.style.setProperty(`--user-color-${n}`, e);
|
|
8
|
+
});
|
|
9
|
+
}, [r]), /* @__PURE__ */ c(m, { children: o });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
u as ThemeProvider
|
|
13
|
+
};
|