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
|
@@ -1,46 +1,45 @@
|
|
|
1
1
|
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { c as a } from "../../createLucideIcon-C8GTh_Qx.js";
|
|
3
|
-
import '../../assets/
|
|
4
|
-
label: b,
|
|
5
|
-
text: h,
|
|
6
|
-
sm: N,
|
|
7
|
-
md: k,
|
|
8
|
-
lg: I,
|
|
9
|
-
default: "_default_15ngo_26",
|
|
10
|
-
muted: $,
|
|
11
|
-
accent: O,
|
|
12
|
-
disabled: q,
|
|
13
|
-
error: C,
|
|
14
|
-
required: T,
|
|
15
|
-
optional: W,
|
|
16
|
-
srOnly: z,
|
|
17
|
-
icon: j,
|
|
18
|
-
tooltipWrapper: v,
|
|
19
|
-
tooltipIcon: L,
|
|
20
|
-
tooltipText: M
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
3
|
+
import '../../assets/index44.css';/**
|
|
23
4
|
* @license lucide-react v0.488.0 - ISC
|
|
24
5
|
*
|
|
25
6
|
* This source code is licensed under the ISC license.
|
|
26
7
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
8
|
*/
|
|
28
|
-
const
|
|
9
|
+
const b = [
|
|
29
10
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
30
11
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
31
12
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
32
|
-
],
|
|
13
|
+
], h = a("circle-alert", b);
|
|
33
14
|
/**
|
|
34
15
|
* @license lucide-react v0.488.0 - ISC
|
|
35
16
|
*
|
|
36
17
|
* This source code is licensed under the ISC license.
|
|
37
18
|
* See the LICENSE file in the root directory of this source tree.
|
|
38
19
|
*/
|
|
39
|
-
const
|
|
20
|
+
const N = [
|
|
40
21
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
41
22
|
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
42
23
|
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
43
|
-
],
|
|
24
|
+
], k = a("info", N), I = "_label_15ngo_1", $ = "_text_15ngo_6", O = "_sm_15ngo_13", q = "_md_15ngo_17", C = "_lg_15ngo_21", T = "_muted_15ngo_30", W = "_accent_15ngo_34", z = "_disabled_15ngo_38", j = "_error_15ngo_42", v = "_required_15ngo_47", L = "_optional_15ngo_52", M = "_srOnly_15ngo_58", A = "_icon_15ngo_71", E = "_tooltipWrapper_15ngo_77", H = "_tooltipIcon_15ngo_83", w = "_tooltipText_15ngo_91", o = {
|
|
25
|
+
label: I,
|
|
26
|
+
text: $,
|
|
27
|
+
sm: O,
|
|
28
|
+
md: q,
|
|
29
|
+
lg: C,
|
|
30
|
+
default: "_default_15ngo_26",
|
|
31
|
+
muted: T,
|
|
32
|
+
accent: W,
|
|
33
|
+
disabled: z,
|
|
34
|
+
error: j,
|
|
35
|
+
required: v,
|
|
36
|
+
optional: L,
|
|
37
|
+
srOnly: M,
|
|
38
|
+
icon: A,
|
|
39
|
+
tooltipWrapper: E,
|
|
40
|
+
tooltipIcon: H,
|
|
41
|
+
tooltipText: w
|
|
42
|
+
};
|
|
44
43
|
function F({
|
|
45
44
|
htmlFor: r,
|
|
46
45
|
size: i = "md",
|
|
@@ -68,7 +67,7 @@ function F({
|
|
|
68
67
|
n && /* @__PURE__ */ e("span", { className: o.required, children: " *" }),
|
|
69
68
|
!n && _ && /* @__PURE__ */ e("span", { className: o.optional, children: "(optional)" }),
|
|
70
69
|
t === "error" && d && /* @__PURE__ */ e(
|
|
71
|
-
|
|
70
|
+
h,
|
|
72
71
|
{
|
|
73
72
|
size: 16,
|
|
74
73
|
className: o.icon,
|
|
@@ -78,7 +77,7 @@ function F({
|
|
|
78
77
|
),
|
|
79
78
|
s && /* @__PURE__ */ c("span", { className: o.tooltipWrapper, children: [
|
|
80
79
|
/* @__PURE__ */ e(
|
|
81
|
-
|
|
80
|
+
k,
|
|
82
81
|
{
|
|
83
82
|
size: 16,
|
|
84
83
|
className: o.tooltipIcon,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { d as c, i as r, r as i, s as o, g as n } from "../../
|
|
3
|
-
import { L as a, M as l } from "../../index-
|
|
2
|
+
import { d as c, i as r, r as i, s as o, g as n } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { L as a, M as l } from "../../index-BXkubhGb.js";
|
|
4
|
+
import "../../index-Bgo8MuTU.js";
|
|
4
5
|
c("Link", () => {
|
|
5
6
|
r("renders a normal anchor tag by default", () => {
|
|
6
7
|
i(/* @__PURE__ */ t(a, { href: "/about", children: "About us" }));
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { v as I, d as k, i, r as n, g as t, s as o, f as s } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { List as l } from "./index.js";
|
|
4
|
+
import { IconButton as h } from "../IconButton/index.js";
|
|
5
|
+
import { c as y } from "../../createLucideIcon-C8GTh_Qx.js";
|
|
6
|
+
/**
|
|
7
|
+
* @license lucide-react v0.488.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
const v = [
|
|
13
|
+
["path", { d: "M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5", key: "laymnq" }],
|
|
14
|
+
["path", { d: "M8.5 8.5v.01", key: "ue8clq" }],
|
|
15
|
+
["path", { d: "M16 15.5v.01", key: "14dtrp" }],
|
|
16
|
+
["path", { d: "M12 12v.01", key: "u5ubse" }],
|
|
17
|
+
["path", { d: "M11 17v.01", key: "1hyl5a" }],
|
|
18
|
+
["path", { d: "M7 14v.01", key: "uct60s" }]
|
|
19
|
+
], p = y("cookie", v), m = [
|
|
20
|
+
{
|
|
21
|
+
id: "1",
|
|
22
|
+
content: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("h3", { children: "Item 1" }) })
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "2",
|
|
26
|
+
content: /* @__PURE__ */ a("div", { children: [
|
|
27
|
+
"Item 2",
|
|
28
|
+
/* @__PURE__ */ e(
|
|
29
|
+
h,
|
|
30
|
+
{
|
|
31
|
+
size: "sm",
|
|
32
|
+
icon: /* @__PURE__ */ e(p, {}),
|
|
33
|
+
srOnlyLabel: "Cookie button",
|
|
34
|
+
onClick: () => console.log("more cookie")
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] })
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "3",
|
|
41
|
+
content: "Item 3",
|
|
42
|
+
renderItem: (c) => /* @__PURE__ */ e("strong", { children: c })
|
|
43
|
+
}
|
|
44
|
+
], B = [
|
|
45
|
+
{
|
|
46
|
+
id: "1",
|
|
47
|
+
content: "Clickable Item 1"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "2",
|
|
51
|
+
content: /* @__PURE__ */ e("div", { children: "Clickable Item 2" })
|
|
52
|
+
}
|
|
53
|
+
], r = I.fn();
|
|
54
|
+
k("List", () => {
|
|
55
|
+
i("renders list items correctly", () => {
|
|
56
|
+
n(/* @__PURE__ */ e(l, { items: m })), t(o.getByText("Item 1")).toBeInTheDocument(), t(o.getByText("Item 2")).toBeInTheDocument(), t(o.getByText("Item 3")).toBeInTheDocument();
|
|
57
|
+
}), i("renders list items as JSX elements correctly", () => {
|
|
58
|
+
n(/* @__PURE__ */ e(l, { items: m })), t(o.getByText("Item 2")).toBeInTheDocument();
|
|
59
|
+
}), i("calls onItemClick when a clickable item is clicked", () => {
|
|
60
|
+
n(/* @__PURE__ */ e(l, { items: B, onItemClick: r }));
|
|
61
|
+
const c = o.getByText("Clickable Item 1");
|
|
62
|
+
s.click(c), t(r).toHaveBeenCalledWith({
|
|
63
|
+
id: "1",
|
|
64
|
+
content: "Clickable Item 1"
|
|
65
|
+
});
|
|
66
|
+
const d = o.getByText("Clickable Item 2");
|
|
67
|
+
s.click(d), t(r).toHaveBeenCalledWith({
|
|
68
|
+
id: "2",
|
|
69
|
+
content: /* @__PURE__ */ e("div", { children: "Clickable Item 2" })
|
|
70
|
+
});
|
|
71
|
+
}), i("does not throw an error if onItemClick is not provided", () => {
|
|
72
|
+
n(/* @__PURE__ */ e(l, { items: m }));
|
|
73
|
+
const c = o.getByText("Item 1");
|
|
74
|
+
t(() => {
|
|
75
|
+
s.click(c);
|
|
76
|
+
}).not.toThrow();
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index20.css';const c = "_list_4w9h5_1", i = "_listItem_4w9h5_13", n = {
|
|
3
|
+
list: c,
|
|
4
|
+
listItem: i
|
|
5
|
+
};
|
|
6
|
+
function d({
|
|
7
|
+
items: e,
|
|
8
|
+
ordered: r = !1,
|
|
9
|
+
className: a,
|
|
10
|
+
onItemClick: t
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ l(r ? "ol" : "ul", { className: `${n.list} ${a ?? ""}`, children: e.map((s) => /* @__PURE__ */ l(
|
|
13
|
+
"li",
|
|
14
|
+
{
|
|
15
|
+
className: `${n.listItem} ${s.className ?? ""}`,
|
|
16
|
+
onClick: () => t == null ? void 0 : t(s),
|
|
17
|
+
children: s.renderItem ? s.renderItem(s.content) : s.content
|
|
18
|
+
},
|
|
19
|
+
s.id
|
|
20
|
+
)) });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
d as List
|
|
24
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as a } from "react/jsx-runtime";
|
|
2
|
+
import { d as u, i as d, r, g as n, s as t, f as i } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { Modal as l } from "./index.js";
|
|
4
|
+
u("Modal", () => {
|
|
5
|
+
d("renders the trigger button", () => {
|
|
6
|
+
r(
|
|
7
|
+
/* @__PURE__ */ e(
|
|
8
|
+
l,
|
|
9
|
+
{
|
|
10
|
+
content: /* @__PURE__ */ e("div", { children: "Modal Content" }),
|
|
11
|
+
trigger: /* @__PURE__ */ e("button", { role: "button", children: "Open Modal" })
|
|
12
|
+
}
|
|
13
|
+
)
|
|
14
|
+
), n(
|
|
15
|
+
t.getByRole("button", { name: "Open Modal" })
|
|
16
|
+
).toBeInTheDocument();
|
|
17
|
+
}), d("does not render the modal content initially", () => {
|
|
18
|
+
r(
|
|
19
|
+
/* @__PURE__ */ e(
|
|
20
|
+
l,
|
|
21
|
+
{
|
|
22
|
+
content: /* @__PURE__ */ e("div", { children: "Modal Content" }),
|
|
23
|
+
trigger: /* @__PURE__ */ e("button", { children: "Open Modal" })
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
), n(t.queryByText("Modal Content")).not.toBeInTheDocument();
|
|
27
|
+
}), d("it renders the modal content when the trigger is clicked", () => {
|
|
28
|
+
r(
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
l,
|
|
31
|
+
{
|
|
32
|
+
content: /* @__PURE__ */ e("div", { children: "Modal Content" }),
|
|
33
|
+
trigger: /* @__PURE__ */ e("button", { role: "button", children: "Open Modal" })
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
const o = t.getByRole("button", { name: "Open Modal" });
|
|
38
|
+
i.click(o), n(t.getByText("Modal Content")).toBeInTheDocument();
|
|
39
|
+
}), d("it closes the modal when clicking outside", () => {
|
|
40
|
+
r(
|
|
41
|
+
/* @__PURE__ */ s(a, { children: [
|
|
42
|
+
/* @__PURE__ */ e(
|
|
43
|
+
l,
|
|
44
|
+
{
|
|
45
|
+
content: /* @__PURE__ */ e("div", { children: "Modal Content" }),
|
|
46
|
+
trigger: /* @__PURE__ */ e("button", { role: "button", children: "Open Modal" })
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ e("div", { "data-testid": "outside", children: "Outside Element" })
|
|
50
|
+
] })
|
|
51
|
+
);
|
|
52
|
+
const o = t.getByRole("button", { name: "Open Modal" });
|
|
53
|
+
i.click(o), n(t.getByText("Modal Content")).toBeInTheDocument();
|
|
54
|
+
const c = t.getByTestId("outside");
|
|
55
|
+
i.mouseDown(c), setTimeout(() => {
|
|
56
|
+
n(t.queryByText("Modal Content")).not.toBeInTheDocument();
|
|
57
|
+
}, 100);
|
|
58
|
+
}), d("it closes the modal when the close button is clicked", () => {
|
|
59
|
+
r(
|
|
60
|
+
/* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(
|
|
61
|
+
l,
|
|
62
|
+
{
|
|
63
|
+
content: /* @__PURE__ */ e("div", { children: "Modal Content" }),
|
|
64
|
+
trigger: /* @__PURE__ */ e("button", { role: "button", children: "Open Modal" })
|
|
65
|
+
}
|
|
66
|
+
) })
|
|
67
|
+
);
|
|
68
|
+
const o = t.getByRole("button", { name: "Open Modal" });
|
|
69
|
+
i.click(o), n(t.getByText("Modal Content")).toBeInTheDocument();
|
|
70
|
+
const c = t.getByRole("button", { name: /close/i });
|
|
71
|
+
i.click(c), n(t.queryByText("Modal Content")).not.toBeInTheDocument();
|
|
72
|
+
}), d("handles controlled open state", () => {
|
|
73
|
+
const { rerender: o } = r(
|
|
74
|
+
/* @__PURE__ */ e(
|
|
75
|
+
l,
|
|
76
|
+
{
|
|
77
|
+
content: /* @__PURE__ */ e("div", { children: "Modal Content" }),
|
|
78
|
+
trigger: /* @__PURE__ */ e("button", { role: "button", children: "Open Modal" }),
|
|
79
|
+
isOpen: !1
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
n(t.queryByText("Modal Content")).not.toBeInTheDocument(), o(
|
|
84
|
+
/* @__PURE__ */ e(
|
|
85
|
+
l,
|
|
86
|
+
{
|
|
87
|
+
content: /* @__PURE__ */ e("div", { children: "Modal Content" }),
|
|
88
|
+
trigger: /* @__PURE__ */ e("button", { role: "button", children: "Open Modal" }),
|
|
89
|
+
isOpen: !0
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
), n(t.getByText("Modal Content")).toBeInTheDocument();
|
|
93
|
+
});
|
|
94
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as a, Fragment as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u } from "react";
|
|
3
|
+
import { X as h } from "../../x-CnsEH4Ox.js";
|
|
4
|
+
import '../../assets/index24.css';const f = "_overlay_nav1m_1", y = "_modal_nav1m_16", g = "_closeButton_nav1m_26", k = "_content_nav1m_37", n = {
|
|
5
|
+
overlay: f,
|
|
6
|
+
modal: y,
|
|
7
|
+
closeButton: g,
|
|
8
|
+
content: k
|
|
9
|
+
};
|
|
10
|
+
function b({
|
|
11
|
+
content: i,
|
|
12
|
+
trigger: r,
|
|
13
|
+
isOpen: s,
|
|
14
|
+
onClose: t,
|
|
15
|
+
className: m
|
|
16
|
+
}) {
|
|
17
|
+
const [d, v] = u(!1), c = s !== void 0, l = c ? s : d, e = () => {
|
|
18
|
+
c ? t == null || t() : v(!l);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ a(p, { children: [
|
|
21
|
+
/* @__PURE__ */ o("div", { onClick: e, children: r }),
|
|
22
|
+
l && /* @__PURE__ */ o("div", { className: n.overlay, onClick: e, children: /* @__PURE__ */ a(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: `${n.modal} ${m ?? ""}`,
|
|
26
|
+
onClick: (_) => _.stopPropagation(),
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ o("button", { "aria-label": "Close", className: n.closeButton, onClick: e, children: /* @__PURE__ */ o(h, { size: 21 }) }),
|
|
29
|
+
/* @__PURE__ */ o("div", { className: n.content, children: i })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
) })
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
b as Modal
|
|
37
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _e } from "react/jsx-runtime";
|
|
2
2
|
import en from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { c as H, d as tn, i as nn, r as Ge, g as Pe, s as Ae, v as rn } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
4
4
|
import { MultiSelect as Xe } from "./index.js";
|
|
5
|
+
import "../../index-Bgo8MuTU.js";
|
|
5
6
|
function a(e, t, n) {
|
|
6
7
|
return e.namespaceURI && e.namespaceURI !== "http://www.w3.org/1999/xhtml" || (t = Array.isArray(t) ? t : [
|
|
7
8
|
t
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs as d, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
+
import "../Tabs/index.js";
|
|
3
4
|
import { Label as h } from "../Label/index.js";
|
|
4
|
-
import '../../assets/
|
|
5
|
+
import '../../assets/index39.css';const w = "_wrapper_a587t_1", x = "_select_a587t_7", p = {
|
|
5
6
|
wrapper: w,
|
|
6
7
|
select: x
|
|
7
8
|
};
|
|
8
|
-
function
|
|
9
|
+
function A({
|
|
9
10
|
id: r,
|
|
10
11
|
name: m,
|
|
11
12
|
label: s,
|
|
@@ -41,5 +42,5 @@ function $({
|
|
|
41
42
|
] });
|
|
42
43
|
}
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
A as MultiSelect
|
|
45
46
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { d as b, i as r, r as i, g as t, s as a, f as s, w as l } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { Navbar as n } from "./index.js";
|
|
4
|
+
const c = [
|
|
5
|
+
{ label: "Home", href: "/" },
|
|
6
|
+
{
|
|
7
|
+
label: "About",
|
|
8
|
+
sublinks: [
|
|
9
|
+
{ label: "Leadership", href: "/about/leadership" },
|
|
10
|
+
{ label: "Contact", href: "/about/contact" }
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: "Services",
|
|
15
|
+
sublinks: [
|
|
16
|
+
{ label: "Service 1", href: "/services/service-1" },
|
|
17
|
+
{ label: "Service 2", href: "services//service-2" }
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{ label: "External", href: "https://example.com", isExternal: !0 }
|
|
21
|
+
];
|
|
22
|
+
b("Navbar", () => {
|
|
23
|
+
r("renders all top-level nav items", () => {
|
|
24
|
+
i(/* @__PURE__ */ o(n, { items: c })), t(a.getByText("Home")).toBeInTheDocument(), t(a.getByText("Services")).toBeInTheDocument(), t(a.getByText("External")).toBeInTheDocument();
|
|
25
|
+
}), r("toggles mobile menu", () => {
|
|
26
|
+
i(/* @__PURE__ */ o(n, { items: c }));
|
|
27
|
+
const e = a.getByLabelText("Open menu");
|
|
28
|
+
s.click(e), t(e).toHaveAttribute("aria-label", "Close menu"), s.click(e), t(e).toHaveAttribute("aria-label", "Open menu");
|
|
29
|
+
}), r("open and closes submenu on click", async () => {
|
|
30
|
+
i(/* @__PURE__ */ o(n, { items: c }));
|
|
31
|
+
const e = a.getByText("Services"), u = a.getByRole("menu", { name: "Services submenu" });
|
|
32
|
+
s.click(e), await l(() => {
|
|
33
|
+
t(u).toHaveClass("show");
|
|
34
|
+
}), s.click(e), await l(() => {
|
|
35
|
+
t(u).not.toHaveClass("show");
|
|
36
|
+
});
|
|
37
|
+
}), r("has appropriate aria attributes", async () => {
|
|
38
|
+
i(/* @__PURE__ */ o(n, { items: c }));
|
|
39
|
+
const e = a.getByText("Services");
|
|
40
|
+
s.click(e), await l(() => {
|
|
41
|
+
t(e).toHaveAttribute("aria-expanded", "true");
|
|
42
|
+
}), s.click(e), await l(() => {
|
|
43
|
+
t(e).toHaveAttribute("aria-expanded", "false");
|
|
44
|
+
});
|
|
45
|
+
}), r("only allows one submenu open at a time", async () => {
|
|
46
|
+
i(/* @__PURE__ */ o(n, { items: c }));
|
|
47
|
+
const e = a.getByRole("menu", { name: "Services submenu" });
|
|
48
|
+
s.click(a.getByText("Services")), await l(() => {
|
|
49
|
+
t(e).toHaveClass("show");
|
|
50
|
+
}), s.click(a.getByText("About")), await l(() => {
|
|
51
|
+
t(e).not.toHaveClass("show");
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useRef as L, useCallback as m, useEffect as z } from "react";
|
|
3
|
+
import { X as T } from "../../x-CnsEH4Ox.js";
|
|
4
|
+
import { c as I } from "../../createLucideIcon-C8GTh_Qx.js";
|
|
5
|
+
import { C as O } from "../../chevron-down-DSUzBz9F.js";
|
|
6
|
+
import '../../assets/index43.css';/**
|
|
7
|
+
* @license lucide-react v0.488.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
const W = [
|
|
13
|
+
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
14
|
+
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
15
|
+
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
16
|
+
], j = I("menu", W), M = "_navbar_1u7z9_5", R = "_sticky_1u7z9_19", S = "_container_1u7z9_25", P = "_logo_1u7z9_35", D = "_menuToggle_1u7z9_41", X = "_nav_1u7z9_5", q = "_linkWrapper_1u7z9_57", A = "_linkItem_1u7z9_63", B = "_sublinkToggle_1u7z9_71", F = "_link_1u7z9_57", G = "_sublinks_1u7z9_101", H = "_show_1u7z9_123", J = "_chevron_1u7z9_130", K = "_open_1u7z9_134", Q = "_parent_1u7z9_176", e = {
|
|
17
|
+
navbar: M,
|
|
18
|
+
sticky: R,
|
|
19
|
+
container: S,
|
|
20
|
+
logo: P,
|
|
21
|
+
menuToggle: D,
|
|
22
|
+
nav: X,
|
|
23
|
+
linkWrapper: q,
|
|
24
|
+
linkItem: A,
|
|
25
|
+
sublinkToggle: B,
|
|
26
|
+
link: F,
|
|
27
|
+
sublinks: G,
|
|
28
|
+
show: H,
|
|
29
|
+
chevron: J,
|
|
30
|
+
open: K,
|
|
31
|
+
parent: Q
|
|
32
|
+
};
|
|
33
|
+
function ne({
|
|
34
|
+
logo: y,
|
|
35
|
+
items: w,
|
|
36
|
+
isSticky: $ = !1,
|
|
37
|
+
className: x
|
|
38
|
+
}) {
|
|
39
|
+
const [l, _] = f(!1), [N, r] = f(null), i = L(null), C = () => {
|
|
40
|
+
_((s) => !s);
|
|
41
|
+
}, E = (s) => {
|
|
42
|
+
r((a) => a === s ? null : s);
|
|
43
|
+
}, v = m((s) => {
|
|
44
|
+
i.current && !i.current.contains(s.target) && r(null);
|
|
45
|
+
}, []), p = m(() => {
|
|
46
|
+
r(null);
|
|
47
|
+
}, []), b = m(() => {
|
|
48
|
+
window.innerWidth > 768 && (_(!1), r(null), document.body.style.overflow = "");
|
|
49
|
+
}, []);
|
|
50
|
+
z(() => (window.addEventListener("resize", b), document.addEventListener("click", v), window.addEventListener("scroll", p), () => {
|
|
51
|
+
window.removeEventListener("resize", b), document.removeEventListener("click", v), window.removeEventListener("scroll", p);
|
|
52
|
+
}), []), z(() => (document.body.style.overflow = l ? "hidden" : "", () => {
|
|
53
|
+
document.body.style.overflow = "";
|
|
54
|
+
}), [l]);
|
|
55
|
+
const h = (s, a = "") => s.map((n) => {
|
|
56
|
+
var g;
|
|
57
|
+
const t = `${a}/${n.label}`, c = N === t, u = (g = n.sublinks) == null ? void 0 : g.length;
|
|
58
|
+
return /* @__PURE__ */ d(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: `${e.linkWrapper} ${a ? "" : e.parent}`,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ o("div", { className: e.linkItem, children: n.href ? /* @__PURE__ */ o(
|
|
64
|
+
"a",
|
|
65
|
+
{
|
|
66
|
+
href: n.href,
|
|
67
|
+
className: e.link,
|
|
68
|
+
target: n.isExternal ? "_blank" : "_self",
|
|
69
|
+
rel: n.isExternal ? "noopener noreferrer" : void 0,
|
|
70
|
+
onClick: () => {
|
|
71
|
+
var k;
|
|
72
|
+
r(null), (k = n.onClick) == null || k.call(n);
|
|
73
|
+
},
|
|
74
|
+
role: "menuitem",
|
|
75
|
+
children: n.label
|
|
76
|
+
}
|
|
77
|
+
) : /* @__PURE__ */ d(
|
|
78
|
+
"button",
|
|
79
|
+
{
|
|
80
|
+
"aria-haspopup": u ? "true" : void 0,
|
|
81
|
+
"aria-expanded": c,
|
|
82
|
+
className: `${e.sublinkToggle} ${c ? e.open : ""}`,
|
|
83
|
+
onClick: () => E(t),
|
|
84
|
+
children: [
|
|
85
|
+
n.label,
|
|
86
|
+
u && /* @__PURE__ */ o(O, { size: 21, className: e.chevron })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
) }),
|
|
90
|
+
u && /* @__PURE__ */ o(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: `${e.sublinks} ${c ? e.show : ""}`,
|
|
94
|
+
role: "menu",
|
|
95
|
+
"aria-label": `${n.label} submenu`,
|
|
96
|
+
children: h(n.sublinks, t)
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
t
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
return /* @__PURE__ */ o(
|
|
105
|
+
"header",
|
|
106
|
+
{
|
|
107
|
+
ref: i,
|
|
108
|
+
className: `${e.navbar} ${$ ? e.sticky : ""} ${x ?? ""}`,
|
|
109
|
+
role: "navigation",
|
|
110
|
+
"aria-label": "Main navigation",
|
|
111
|
+
children: /* @__PURE__ */ d("div", { className: e.container, children: [
|
|
112
|
+
/* @__PURE__ */ o("div", { className: e.logo, children: y }),
|
|
113
|
+
/* @__PURE__ */ o(
|
|
114
|
+
"button",
|
|
115
|
+
{
|
|
116
|
+
className: e.menuToggle,
|
|
117
|
+
onClick: C,
|
|
118
|
+
"aria-label": l ? "Close menu" : "Open menu",
|
|
119
|
+
"aria-expanded": l,
|
|
120
|
+
"aria-controls": "main-menu",
|
|
121
|
+
children: l ? /* @__PURE__ */ o(T, { size: 24 }) : /* @__PURE__ */ o(j, { size: 24 })
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ o(
|
|
125
|
+
"nav",
|
|
126
|
+
{
|
|
127
|
+
className: `${e.nav} ${l ? e.open : ""}`,
|
|
128
|
+
id: "main-menu",
|
|
129
|
+
role: "menubar",
|
|
130
|
+
children: h(w)
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
] })
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
ne as Navbar
|
|
139
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { d as l, i, r as a, v as s, g as o, s as r, f as m } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { Notification as n } from "./index.js";
|
|
4
|
+
l("Notification", () => {
|
|
5
|
+
i("renders with the correct message", () => {
|
|
6
|
+
a(
|
|
7
|
+
/* @__PURE__ */ t(
|
|
8
|
+
n,
|
|
9
|
+
{
|
|
10
|
+
id: "1",
|
|
11
|
+
message: "Test Notification",
|
|
12
|
+
variant: "info",
|
|
13
|
+
duration: 3e3,
|
|
14
|
+
onClose: s.fn()
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
), o(r.getByText("Test Notification")).toBeInTheDocument();
|
|
18
|
+
}), i("applies the correct variant class", () => {
|
|
19
|
+
const { container: e } = a(
|
|
20
|
+
/* @__PURE__ */ t(
|
|
21
|
+
n,
|
|
22
|
+
{
|
|
23
|
+
id: "1",
|
|
24
|
+
message: "Error Notification",
|
|
25
|
+
variant: "error",
|
|
26
|
+
duration: 3e3,
|
|
27
|
+
onClose: s.fn()
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
o(e.firstChild).toHaveClass("error");
|
|
32
|
+
}), i("calls onClose after the duration", async () => {
|
|
33
|
+
s.useFakeTimers();
|
|
34
|
+
const e = s.fn();
|
|
35
|
+
a(
|
|
36
|
+
/* @__PURE__ */ t(
|
|
37
|
+
n,
|
|
38
|
+
{
|
|
39
|
+
id: "1",
|
|
40
|
+
message: "Auto Dismiss",
|
|
41
|
+
variant: "success",
|
|
42
|
+
duration: 3e3,
|
|
43
|
+
onClose: e
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
), s.advanceTimersByTime(2700), o(e).not.toHaveBeenCalled(), s.advanceTimersByTime(300), o(e).toHaveBeenCalledTimes(1), s.useRealTimers();
|
|
47
|
+
}), i("calls onClose when close button is clicked", () => {
|
|
48
|
+
const e = s.fn();
|
|
49
|
+
a(
|
|
50
|
+
/* @__PURE__ */ t(
|
|
51
|
+
n,
|
|
52
|
+
{
|
|
53
|
+
id: "1",
|
|
54
|
+
message: "Closable Notification",
|
|
55
|
+
variant: "success",
|
|
56
|
+
duration: 3e3,
|
|
57
|
+
onClose: e
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
const c = r.getByRole("button");
|
|
62
|
+
m.click(c), o(e).toHaveBeenCalledTimes(1);
|
|
63
|
+
});
|
|
64
|
+
});
|