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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsxs as x, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useEffect as l } from "react";
|
|
3
|
+
import { X as g } from "../../x-CnsEH4Ox.js";
|
|
4
|
+
import '../../assets/index27.css';const p = "_notification_1txoc_1", T = "_exiting_1txoc_23", w = "_info_1txoc_27", h = "_success_1txoc_32", B = "_warning_1txoc_37", $ = "_error_1txoc_42", d = "_closeButton_1txoc_47", i = {
|
|
5
|
+
notification: p,
|
|
6
|
+
exiting: T,
|
|
7
|
+
info: w,
|
|
8
|
+
success: h,
|
|
9
|
+
warning: B,
|
|
10
|
+
error: $,
|
|
11
|
+
closeButton: d
|
|
12
|
+
}, E = {
|
|
13
|
+
info: i.info,
|
|
14
|
+
success: i.success,
|
|
15
|
+
warning: i.warning,
|
|
16
|
+
error: i.error
|
|
17
|
+
};
|
|
18
|
+
function v({
|
|
19
|
+
message: e,
|
|
20
|
+
variant: o = "info",
|
|
21
|
+
duration: c = 3e3,
|
|
22
|
+
onClose: t,
|
|
23
|
+
className: r
|
|
24
|
+
}) {
|
|
25
|
+
const [a, s] = m(!1);
|
|
26
|
+
l(() => {
|
|
27
|
+
const u = setTimeout(() => {
|
|
28
|
+
s(!0);
|
|
29
|
+
}, c - 300), f = setTimeout(() => {
|
|
30
|
+
t == null || t();
|
|
31
|
+
}, c);
|
|
32
|
+
return () => {
|
|
33
|
+
clearTimeout(u), clearTimeout(f);
|
|
34
|
+
};
|
|
35
|
+
}, [c, t]);
|
|
36
|
+
const _ = () => {
|
|
37
|
+
s(!0), t == null || t();
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ x(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: `${i.notification} ${E[o]} ${a ? i.exiting : ""} ${r ?? ""}`,
|
|
43
|
+
role: "alert",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ n("span", { children: e }),
|
|
46
|
+
/* @__PURE__ */ n(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
className: i.closeButton,
|
|
50
|
+
onClick: _,
|
|
51
|
+
"aria-label": "Close",
|
|
52
|
+
children: /* @__PURE__ */ n(g, { size: 20 })
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
v as Notification
|
|
61
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { d as r, i as n, r as s, s as t, g as o } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { NotificationContainer as a } from "./index.js";
|
|
4
|
+
r("NotificationContainer", () => {
|
|
5
|
+
const i = [
|
|
6
|
+
{
|
|
7
|
+
id: "1",
|
|
8
|
+
message: "Notification 1",
|
|
9
|
+
variant: "info",
|
|
10
|
+
onClose: () => {
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: "2",
|
|
15
|
+
message: "Notification 2",
|
|
16
|
+
variant: "success",
|
|
17
|
+
onClose: () => {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
n("renders the correct number of notifications", () => {
|
|
22
|
+
s(/* @__PURE__ */ e(a, { notifications: i }));
|
|
23
|
+
const c = t.getAllByRole("button");
|
|
24
|
+
o(c.length).toBe(2);
|
|
25
|
+
}), n("displays the correct notification messages", () => {
|
|
26
|
+
s(/* @__PURE__ */ e(a, { notifications: i })), o(t.getByText("Notification 1")).toBeInTheDocument(), o(t.getByText("Notification 2")).toBeInTheDocument();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Notification as n } from "../Notification/index.js";
|
|
4
|
+
import "../Tabs/index.js";
|
|
5
|
+
import '../../assets/index28.css';const r = "_container_61msx_1", c = {
|
|
6
|
+
container: r
|
|
7
|
+
};
|
|
8
|
+
function p({
|
|
9
|
+
notifications: i
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ t("div", { className: c.container, children: i.map((o) => /* @__PURE__ */ t(n, { ...o }, o.id)) });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
p as NotificationContainer
|
|
15
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { d as p, i as t, r as o, s as a, g as e } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { ProgressBar as g } from "./index.js";
|
|
4
|
+
p("ProgressBar", () => {
|
|
5
|
+
t("renders the progress bar with the correct progress", () => {
|
|
6
|
+
o(/* @__PURE__ */ s(g, { progress: 50 }));
|
|
7
|
+
const r = a.getByRole("progressbar");
|
|
8
|
+
e(r).toHaveAttribute("aria-valuenow", "50"), e(r).toHaveStyle({ width: "50%" });
|
|
9
|
+
}), t("clamps the progress to a maximum of 100", () => {
|
|
10
|
+
o(/* @__PURE__ */ s(g, { progress: 120 }));
|
|
11
|
+
const r = a.getByRole("progressbar");
|
|
12
|
+
e(r).toHaveAttribute("aria-valuenow", "100"), e(r).toHaveStyle({ width: "100%" });
|
|
13
|
+
}), t("clamps the progress to a minimum of 0", () => {
|
|
14
|
+
o(/* @__PURE__ */ s(g, { progress: -20 }));
|
|
15
|
+
const r = a.getByRole("progressbar");
|
|
16
|
+
e(r).toHaveAttribute("aria-valuenow", "0"), e(r).toHaveStyle({ width: "0%" });
|
|
17
|
+
}), t("renders the label when showLabel is true", () => {
|
|
18
|
+
o(/* @__PURE__ */ s(g, { progress: 20, showLabel: !0 })), e(a.getByText("20%")).toBeInTheDocument();
|
|
19
|
+
}), t("applies the correct variant class", () => {
|
|
20
|
+
o(/* @__PURE__ */ s(g, { progress: 40, variant: "danger" }));
|
|
21
|
+
const r = a.getByRole("progressbar").parentElement;
|
|
22
|
+
e(r).toHaveClass("danger");
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index29.css';const c = "_progressBarContainer_a1m8u_1", m = "_progressBar_a1m8u_1", t = "_fill_a1m8u_18", _ = "_primary_a1m8u_29", g = "_success_a1m8u_33", p = "_warning_a1m8u_37", u = "_danger_a1m8u_41", d = "_label_a1m8u_45", r = {
|
|
3
|
+
progressBarContainer: c,
|
|
4
|
+
progressBar: m,
|
|
5
|
+
fill: t,
|
|
6
|
+
primary: _,
|
|
7
|
+
success: g,
|
|
8
|
+
warning: p,
|
|
9
|
+
danger: u,
|
|
10
|
+
label: d
|
|
11
|
+
}, B = {
|
|
12
|
+
primary: r.primary,
|
|
13
|
+
success: r.success,
|
|
14
|
+
warning: r.warning,
|
|
15
|
+
danger: r.danger
|
|
16
|
+
};
|
|
17
|
+
function f({
|
|
18
|
+
progress: n,
|
|
19
|
+
variant: i = "primary",
|
|
20
|
+
showLabel: l = !1,
|
|
21
|
+
className: o
|
|
22
|
+
}) {
|
|
23
|
+
const a = Math.min(100, Math.max(0, n));
|
|
24
|
+
return /* @__PURE__ */ s("div", { className: r.progressBarContainer, children: [
|
|
25
|
+
/* @__PURE__ */ e(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: `${r.progressBar} ${B[i]} ${o ?? ""}`,
|
|
29
|
+
children: /* @__PURE__ */ e(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: r.fill,
|
|
33
|
+
style: { width: `${a}%` },
|
|
34
|
+
role: "progressbar",
|
|
35
|
+
"aria-valuenow": a,
|
|
36
|
+
"aria-valuemin": 0,
|
|
37
|
+
"aria-valuemax": 100
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
l && /* @__PURE__ */ s("span", { className: r.label, children: [
|
|
43
|
+
a,
|
|
44
|
+
"%"
|
|
45
|
+
] })
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
f as ProgressBar
|
|
50
|
+
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { d as
|
|
3
|
-
import { Radio as
|
|
4
|
-
|
|
2
|
+
import { d as s, i, r as n, g as o, s as t, v as l } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { Radio as r } from "./index.js";
|
|
4
|
+
import "../../index-Bgo8MuTU.js";
|
|
5
|
+
s("Radio", () => {
|
|
5
6
|
i("renders correctly", () => {
|
|
6
7
|
n(
|
|
7
|
-
/* @__PURE__ */ a(
|
|
8
|
+
/* @__PURE__ */ a(r, { id: "option1", name: "testOptions", value: "1", label: "Option 1" })
|
|
8
9
|
), o(t.getByRole("radio")).toBeInTheDocument(), o(t.getByLabelText("Option 1")).toBeInTheDocument();
|
|
9
10
|
}), i("can be disabled", () => {
|
|
10
11
|
n(
|
|
11
12
|
/* @__PURE__ */ a(
|
|
12
|
-
|
|
13
|
+
r,
|
|
13
14
|
{
|
|
14
15
|
id: "option2",
|
|
15
16
|
name: "testOptions",
|
|
@@ -22,10 +23,10 @@ l("Radio", () => {
|
|
|
22
23
|
const e = t.getByRole("radio");
|
|
23
24
|
o(e).toBeDisabled();
|
|
24
25
|
}), i("fires onChange event", () => {
|
|
25
|
-
const e =
|
|
26
|
+
const e = l.fn();
|
|
26
27
|
n(
|
|
27
28
|
/* @__PURE__ */ a(
|
|
28
|
-
|
|
29
|
+
r,
|
|
29
30
|
{
|
|
30
31
|
id: "option3",
|
|
31
32
|
name: "testOptions",
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsxs as n, jsx as
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Label as _ } from "../Label/index.js";
|
|
3
|
-
import '../../assets/
|
|
3
|
+
import '../../assets/index36.css';const m = "_wrapper_1p7l5_1", d = "_radio_1p7l5_7", f = "_label_1p7l5_29", a = {
|
|
4
4
|
wrapper: m,
|
|
5
5
|
radio: d,
|
|
6
6
|
label: f
|
|
7
7
|
};
|
|
8
8
|
function h({
|
|
9
9
|
id: r,
|
|
10
|
-
name:
|
|
11
|
-
value:
|
|
10
|
+
name: p,
|
|
11
|
+
value: s,
|
|
12
12
|
label: t,
|
|
13
|
-
disabled:
|
|
13
|
+
disabled: l = !1,
|
|
14
14
|
required: e = !1,
|
|
15
15
|
className: c,
|
|
16
16
|
...i
|
|
17
17
|
}) {
|
|
18
18
|
return /* @__PURE__ */ n("div", { className: `${a.wrapper} ${c ?? ""}`, children: [
|
|
19
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ o(
|
|
20
20
|
"input",
|
|
21
21
|
{
|
|
22
22
|
type: "radio",
|
|
23
23
|
id: r,
|
|
24
|
-
name:
|
|
25
|
-
value:
|
|
26
|
-
disabled:
|
|
24
|
+
name: p,
|
|
25
|
+
value: s,
|
|
26
|
+
disabled: l,
|
|
27
27
|
required: e,
|
|
28
28
|
className: a.radio,
|
|
29
29
|
...i
|
|
30
30
|
}
|
|
31
31
|
),
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ o(_, { htmlFor: r, disabled: l, required: e, className: a.label, children: t })
|
|
33
33
|
] });
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { d as
|
|
2
|
+
import { d as i, i as l, r as n, g as e, s as a, v as m, f as g } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
3
|
import { Range as s } from "./index.js";
|
|
4
|
-
|
|
4
|
+
import "../../index-Bgo8MuTU.js";
|
|
5
|
+
i("Range", () => {
|
|
5
6
|
l("renders with a label and value", () => {
|
|
6
7
|
n(
|
|
7
8
|
/* @__PURE__ */ r(s, { label: "Volume", name: "volume", defaultValue: 30, min: 0, max: 100 })
|
|
8
9
|
), e(a.getByLabelText("Volume")).toBeInTheDocument(), e(a.getByText("30")).toBeInTheDocument();
|
|
9
10
|
}), l("calls onChange when value changes", () => {
|
|
10
|
-
const t =
|
|
11
|
+
const t = m.fn();
|
|
11
12
|
n(
|
|
12
13
|
/* @__PURE__ */ r(
|
|
13
14
|
s,
|
|
@@ -22,7 +23,7 @@ g("Range", () => {
|
|
|
22
23
|
)
|
|
23
24
|
);
|
|
24
25
|
const o = a.getByLabelText("Progress");
|
|
25
|
-
|
|
26
|
+
g.change(o, { target: { value: "70" } }), e(t).toHaveBeenCalled();
|
|
26
27
|
}), l("shows error message if error prop is set", () => {
|
|
27
28
|
n(
|
|
28
29
|
/* @__PURE__ */ r(
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as M, useEffect as $ } from "react";
|
|
3
|
+
import "../Tabs/index.js";
|
|
3
4
|
import { Label as I } from "../Label/index.js";
|
|
4
|
-
import '../../assets/
|
|
5
|
+
import '../../assets/index41.css';const j = "_wrapper_7toxm_1", y = "_trackContainer_7toxm_7", E = "_track_7toxm_7", S = "_value_7toxm_44", b = "_error_7toxm_52", F = "_errorMessage_7toxm_56", s = {
|
|
5
6
|
wrapper: j,
|
|
6
7
|
trackContainer: y,
|
|
7
8
|
track: E,
|
|
@@ -9,8 +10,8 @@ import '../../assets/index8.css';const j = "_wrapper_7toxm_1", y = "_trackContai
|
|
|
9
10
|
error: b,
|
|
10
11
|
errorMessage: F
|
|
11
12
|
};
|
|
12
|
-
function
|
|
13
|
-
label:
|
|
13
|
+
function q({
|
|
14
|
+
label: n,
|
|
14
15
|
id: v,
|
|
15
16
|
value: c,
|
|
16
17
|
defaultValue: o,
|
|
@@ -22,11 +23,11 @@ function h({
|
|
|
22
23
|
tooltip: N,
|
|
23
24
|
...a
|
|
24
25
|
}) {
|
|
25
|
-
const [u, m] = M(),
|
|
26
|
+
const [u, m] = M(), i = c != null, _ = v ?? a.name ?? `slider-${Math.random().toString(36).slice(2)}`, p = i ? c : u;
|
|
26
27
|
return $(() => {
|
|
27
|
-
|
|
28
|
+
i || (r == null || r(o ?? 0), m(o));
|
|
28
29
|
}, [o]), /* @__PURE__ */ d("div", { className: `${s.wrapper} ${x ?? ""}`, children: [
|
|
29
|
-
|
|
30
|
+
n && /* @__PURE__ */ e(
|
|
30
31
|
I,
|
|
31
32
|
{
|
|
32
33
|
htmlFor: _,
|
|
@@ -35,7 +36,7 @@ function h({
|
|
|
35
36
|
intent: t ? "error" : "default",
|
|
36
37
|
tooltip: N,
|
|
37
38
|
showErrorIcon: !!t,
|
|
38
|
-
children:
|
|
39
|
+
children: n
|
|
39
40
|
}
|
|
40
41
|
),
|
|
41
42
|
/* @__PURE__ */ d("div", { className: s.trackContainer, children: [
|
|
@@ -46,19 +47,19 @@ function h({
|
|
|
46
47
|
type: "range",
|
|
47
48
|
className: `${s.track} ${t ? s.error : ""}`,
|
|
48
49
|
"aria-invalid": !!t,
|
|
49
|
-
value:
|
|
50
|
+
value: p ?? 0,
|
|
50
51
|
onChange: (w) => {
|
|
51
|
-
const
|
|
52
|
-
|
|
52
|
+
const l = Number(w.target.value);
|
|
53
|
+
i || m(l), r == null || r(l);
|
|
53
54
|
},
|
|
54
55
|
...a
|
|
55
56
|
}
|
|
56
57
|
),
|
|
57
|
-
/* @__PURE__ */ e("span", { className: s.value, children:
|
|
58
|
+
/* @__PURE__ */ e("span", { className: s.value, children: p })
|
|
58
59
|
] }),
|
|
59
60
|
t && /* @__PURE__ */ e("div", { className: s.errorMessage, children: t })
|
|
60
61
|
] });
|
|
61
62
|
}
|
|
62
63
|
export {
|
|
63
|
-
|
|
64
|
+
q as Range
|
|
64
65
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { d as
|
|
2
|
+
import { d as r, i as n, r as s, g as o, s as a, v as b, f as m } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
3
|
import { Select as c } from "./index.js";
|
|
4
|
-
|
|
4
|
+
import "../../index-Bgo8MuTU.js";
|
|
5
|
+
r("Select", () => {
|
|
5
6
|
const t = [
|
|
6
7
|
{ label: "Option A", value: "a" },
|
|
7
8
|
{ label: "Option B", value: "b" },
|
|
@@ -14,7 +15,7 @@ i("Select", () => {
|
|
|
14
15
|
({ label: e }) => o(a.getByRole("option", { name: e })).toBeInTheDocument()
|
|
15
16
|
);
|
|
16
17
|
}), n("calls onChange handler", () => {
|
|
17
|
-
const e =
|
|
18
|
+
const e = b.fn();
|
|
18
19
|
s(
|
|
19
20
|
/* @__PURE__ */ l(
|
|
20
21
|
c,
|
|
@@ -27,8 +28,8 @@ i("Select", () => {
|
|
|
27
28
|
}
|
|
28
29
|
)
|
|
29
30
|
);
|
|
30
|
-
const
|
|
31
|
-
m.change(
|
|
31
|
+
const i = a.getByRole("combobox");
|
|
32
|
+
m.change(i, { target: { value: "b" } }), o(e).toHaveBeenCalled();
|
|
32
33
|
}), n("respects default value", () => {
|
|
33
34
|
s(
|
|
34
35
|
/* @__PURE__ */ l(
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
+
import "../Tabs/index.js";
|
|
3
4
|
import { Label as d } from "../Label/index.js";
|
|
4
|
-
import '../../assets/
|
|
5
|
+
import '../../assets/index38.css';const _ = "_wrapper_3s7ns_1", f = "_select_3s7ns_7", a = {
|
|
5
6
|
wrapper: _,
|
|
6
7
|
select: f
|
|
7
8
|
};
|
|
8
|
-
function
|
|
9
|
-
id:
|
|
9
|
+
function N({
|
|
10
|
+
id: r,
|
|
10
11
|
name: o,
|
|
11
|
-
label:
|
|
12
|
+
label: s,
|
|
12
13
|
options: p,
|
|
13
14
|
defaultValue: i,
|
|
14
15
|
required: t = !1,
|
|
@@ -18,11 +19,11 @@ function j({
|
|
|
18
19
|
...u
|
|
19
20
|
}) {
|
|
20
21
|
return /* @__PURE__ */ n("div", { className: `${a.wrapper} ${h ?? ""}`, children: [
|
|
21
|
-
|
|
22
|
+
s && /* @__PURE__ */ l(d, { htmlFor: r, required: t, disabled: c, children: s }),
|
|
22
23
|
/* @__PURE__ */ n(
|
|
23
24
|
"select",
|
|
24
25
|
{
|
|
25
|
-
id:
|
|
26
|
+
id: r,
|
|
26
27
|
name: o,
|
|
27
28
|
defaultValue: i,
|
|
28
29
|
required: t,
|
|
@@ -39,5 +40,5 @@ function j({
|
|
|
39
40
|
] });
|
|
40
41
|
}
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
N as Select
|
|
43
44
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { d as n, i as r, r as i, s as a, g as t } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { Skeleton as s } from "./index.js";
|
|
4
|
+
n("Skeleton", () => {
|
|
5
|
+
r("render a default rectangle skeleton", () => {
|
|
6
|
+
i(/* @__PURE__ */ o(s, {}));
|
|
7
|
+
const e = a.getByRole("presentation");
|
|
8
|
+
t(e).toBeInTheDocument(), t(e).toHaveStyle({ width: "100%", height: "16px" });
|
|
9
|
+
}), r("render a default rectangle skeleton", () => {
|
|
10
|
+
i(/* @__PURE__ */ o(s, { variant: "circle", width: "50px", height: "50px" }));
|
|
11
|
+
const e = a.getByRole("presentation");
|
|
12
|
+
t(e).toHaveClass("circle"), t(e).toHaveStyle({
|
|
13
|
+
width: "50px",
|
|
14
|
+
height: "50px",
|
|
15
|
+
borderRadius: "50%"
|
|
16
|
+
});
|
|
17
|
+
}), r("applies custom width, height and borderRadius", () => {
|
|
18
|
+
i(/* @__PURE__ */ o(s, { width: "200px", height: "60px", borderRadius: "6px" }));
|
|
19
|
+
const e = a.getByRole("presentation");
|
|
20
|
+
t(e).toHaveStyle({
|
|
21
|
+
width: "200px",
|
|
22
|
+
height: "60px",
|
|
23
|
+
borderRadius: "6px"
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index10.css';const o = "_skeleton_u21vc_1", a = "_text_u21vc_16", _ = "_circle_u21vc_22", i = "_rectangle_u21vc_27", e = {
|
|
3
|
+
skeleton: o,
|
|
4
|
+
text: a,
|
|
5
|
+
circle: _,
|
|
6
|
+
rectangle: i
|
|
7
|
+
}, x = {
|
|
8
|
+
text: e.text,
|
|
9
|
+
circle: e.circle,
|
|
10
|
+
rectangle: e.rectangle
|
|
11
|
+
};
|
|
12
|
+
function g({
|
|
13
|
+
width: c = "100%",
|
|
14
|
+
height: l = "16px",
|
|
15
|
+
borderRadius: n = "4px",
|
|
16
|
+
variant: t = "rectangle",
|
|
17
|
+
className: r
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ s(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: `${e.skeleton} ${x[t]} ${r ?? ""}`,
|
|
23
|
+
style: {
|
|
24
|
+
width: c,
|
|
25
|
+
height: l,
|
|
26
|
+
borderRadius: t === "circle" ? "50%" : n
|
|
27
|
+
},
|
|
28
|
+
role: "presentation"
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
g as Skeleton
|
|
34
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { d as i, i as e, r as a, g as t } from "../../
|
|
2
|
+
import { d as i, i as e, r as a, g as t } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
3
|
import { Spacer as c } from "./index.js";
|
|
4
|
+
import "../../index-Bgo8MuTU.js";
|
|
4
5
|
i("Spacer", () => {
|
|
5
6
|
e("renders with default props", () => {
|
|
6
7
|
const { container: s } = a(/* @__PURE__ */ r(c, {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import '../../assets/
|
|
2
|
+
import '../../assets/index9.css';const r = "_spacer_1pz5u_1", _ = "_horizontal_1pz5u_6", n = "_vertical_1pz5u_11", i = "_sm_1pz5u_16", p = "_md_1pz5u_21", e = "_lg_1pz5u_26", m = "_xl_1pz5u_31", s = {
|
|
3
3
|
spacer: r,
|
|
4
4
|
horizontal: _,
|
|
5
5
|
vertical: n,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { d as l, i as r, r as t, s as o, g as a } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
|
+
import { Spinner as c } from "./index.js";
|
|
4
|
+
l("Spinner", () => {
|
|
5
|
+
r("renders with 10 prongs", () => {
|
|
6
|
+
t(/* @__PURE__ */ e(c, {}));
|
|
7
|
+
const s = o.getByRole("status").querySelectorAll(".prong");
|
|
8
|
+
a(s.length).toBe(10);
|
|
9
|
+
}), r("applies the correct size class", () => {
|
|
10
|
+
t(/* @__PURE__ */ e(c, { size: "large" }));
|
|
11
|
+
const s = o.getByRole("status");
|
|
12
|
+
a(s).toHaveClass("large");
|
|
13
|
+
}), r("applies the correct color class", () => {
|
|
14
|
+
t(/* @__PURE__ */ e(c, { color: "success" }));
|
|
15
|
+
const s = o.getByRole("status");
|
|
16
|
+
a(s).toHaveClass("success");
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index8.css';const i = "_spinner_sf4mt_1", t = "_small_sf4mt_8", _ = "_medium_sf4mt_13", c = "_large_sf4mt_18", l = "_prong_sf4mt_23", o = "_primary_sf4mt_34", g = "_success_sf4mt_38", p = "_warning_sf4mt_42", d = "_danger_sf4mt_46", s = {
|
|
3
|
+
spinner: i,
|
|
4
|
+
small: t,
|
|
5
|
+
medium: _,
|
|
6
|
+
large: c,
|
|
7
|
+
prong: l,
|
|
8
|
+
primary: o,
|
|
9
|
+
success: g,
|
|
10
|
+
warning: p,
|
|
11
|
+
danger: d
|
|
12
|
+
}, u = {
|
|
13
|
+
small: s.small,
|
|
14
|
+
medium: s.medium,
|
|
15
|
+
large: s.large
|
|
16
|
+
}, f = {
|
|
17
|
+
primary: s.primary,
|
|
18
|
+
success: s.success,
|
|
19
|
+
warning: s.warning,
|
|
20
|
+
danger: s.danger
|
|
21
|
+
};
|
|
22
|
+
function $({
|
|
23
|
+
size: n = "medium",
|
|
24
|
+
color: a = "primary",
|
|
25
|
+
className: m
|
|
26
|
+
}) {
|
|
27
|
+
return /* @__PURE__ */ r(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: `${s.spinner} ${u[n]} ${f[a]} ${m ?? ""}`,
|
|
31
|
+
role: "status",
|
|
32
|
+
"aria-label": "Loading",
|
|
33
|
+
children: Array.from({ length: 10 }).map((y, e) => /* @__PURE__ */ r("div", { className: s.prong }, e))
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
$ as Spinner
|
|
39
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { d as l, i as s, r as n, g as t, s as d } from "../../
|
|
2
|
+
import { d as l, i as s, r as n, g as t, s as d } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
3
|
import { Stack as a } from "./index.js";
|
|
4
|
+
import "../../index-Bgo8MuTU.js";
|
|
4
5
|
l("Stack", () => {
|
|
5
6
|
s("renders children", () => {
|
|
6
7
|
n(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import '../../assets/
|
|
2
|
+
import '../../assets/index7.css';const g = "_stack_134u6_1", y = "_vertical_134u6_5", f = "_horizontal_134u6_9", S = "_wrap_134u6_13", j = "_gapSm_134u6_18", d = "_gapMd_134u6_22", v = "_gapLg_134u6_26", C = "_alignStart_134u6_31", E = "_alignCenter_134u6_35", h = "_alignEnd_134u6_39", m = "_alignStretch_134u6_43", w = "_justifyStart_134u6_48", M = "_justifyCenter_134u6_52", k = "_justifyEnd_134u6_56", z = "_justifySpaceBetween_134u6_60", B = "_justifySpaceAround_134u6_64", A = "_justifySpaceEvenly_134u6_68", t = {
|
|
3
3
|
stack: g,
|
|
4
4
|
vertical: y,
|
|
5
5
|
horizontal: f,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { d as
|
|
2
|
+
import { d as i, i as a, r as s, g as n, s as c, v as h, f as g } from "../../vi.B-PuvDzu-a048kFcX.js";
|
|
3
3
|
import { Switch as l } from "./index.js";
|
|
4
|
-
|
|
4
|
+
import "../../index-Bgo8MuTU.js";
|
|
5
|
+
i("Switch", () => {
|
|
5
6
|
a("renders with label", () => {
|
|
6
7
|
s(
|
|
7
8
|
/* @__PURE__ */ e(
|
|
@@ -16,7 +17,7 @@ h("Switch", () => {
|
|
|
16
17
|
)
|
|
17
18
|
), n(c.getByText("Toggle 1")).toBeInTheDocument();
|
|
18
19
|
}), a("fires onChange when toggled", () => {
|
|
19
|
-
const o =
|
|
20
|
+
const o = h.fn();
|
|
20
21
|
s(
|
|
21
22
|
/* @__PURE__ */ e(
|
|
22
23
|
l,
|