quirk-ui 0.0.4 → 0.0.6
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/assets/index.css +1 -1
- package/dist/assets/index.css.d.ts +7 -0
- package/dist/assets/index10.css +1 -0
- package/dist/assets/index10.css.d.ts +6 -0
- package/dist/assets/index11.css +1 -0
- package/dist/assets/index11.css.d.ts +7 -0
- package/dist/assets/index12.css +1 -0
- package/dist/assets/index12.css.d.ts +13 -0
- package/dist/assets/index13.css +1 -0
- package/dist/assets/index13.css.d.ts +8 -0
- package/dist/assets/index14.css +1 -0
- package/dist/assets/index14.css.d.ts +13 -0
- package/dist/assets/index15.css +1 -0
- package/dist/assets/index15.css.d.ts +10 -0
- package/dist/assets/index16.css +1 -0
- package/dist/assets/index16.css.d.ts +8 -0
- package/dist/assets/index17.css +1 -0
- package/dist/assets/index17.css.d.ts +11 -0
- package/dist/assets/index18.css +1 -0
- package/dist/assets/index18.css.d.ts +31 -0
- package/dist/assets/index19.css +1 -0
- package/dist/assets/index19.css.d.ts +7 -0
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index2.css.d.ts +9 -0
- package/dist/assets/index20.css +1 -0
- package/dist/assets/index20.css.d.ts +5 -0
- package/dist/assets/index21.css +1 -0
- package/dist/assets/index21.css.d.ts +8 -0
- package/dist/assets/index22.css +1 -0
- package/dist/assets/index22.css.d.ts +6 -0
- package/dist/assets/index23.css +1 -0
- package/dist/assets/index23.css.d.ts +7 -0
- package/dist/assets/index24.css +1 -0
- package/dist/assets/index24.css.d.ts +7 -0
- package/dist/assets/index25.css +1 -0
- package/dist/assets/index25.css.d.ts +9 -0
- package/dist/assets/index26.css +1 -0
- package/dist/assets/index26.css.d.ts +21 -0
- package/dist/assets/index27.css +1 -0
- package/dist/assets/index27.css.d.ts +9 -0
- package/dist/assets/index28.css +1 -0
- package/dist/assets/index28.css.d.ts +12 -0
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index3.css.d.ts +8 -0
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index4.css.d.ts +8 -0
- package/dist/assets/index5.css +1 -0
- package/dist/assets/index5.css.d.ts +21 -0
- package/dist/assets/index6.css +1 -0
- package/dist/assets/index6.css.d.ts +11 -0
- package/dist/assets/index7.css +1 -0
- package/dist/assets/index7.css.d.ts +6 -0
- package/dist/assets/index8.css +1 -0
- package/dist/assets/index8.css.d.ts +10 -0
- package/dist/assets/index9.css +1 -0
- package/dist/assets/index9.css.d.ts +7 -0
- package/dist/components/Box/Box.test.js +20 -0
- package/dist/components/Box/__mocks__/styles.module.css.js +20 -0
- package/dist/components/Box/index.js +89 -0
- package/dist/components/Button/Button.test.js +33 -0
- package/dist/components/Button/__mocks__/styles.module.css.js +9 -0
- package/dist/components/Button/index.js +17 -7
- package/dist/components/ButtonGroup/ButtonGroup.test.js +37 -0
- package/dist/components/ButtonGroup/__mocks__/styles.module.css.js +7 -0
- package/dist/components/ButtonGroup/index.js +26 -0
- package/dist/components/Calendar/Calendar.test.js +40 -0
- package/dist/components/Calendar/index.js +7 -0
- package/dist/components/Checkbox/Checkbox.test.js +37 -0
- package/dist/components/Checkbox/__mocks__/styles.module.css.js +8 -0
- package/dist/components/Checkbox/index.js +45 -0
- package/dist/components/Container/Container.test.js +25 -0
- package/dist/components/Container/__mocks__/styles.module.css.js +11 -0
- package/dist/components/Container/index.js +31 -0
- package/dist/components/DatePicker/DatePicker.test.js +42 -0
- package/dist/components/DatePicker/index.js +56 -0
- package/dist/components/Divider/Divider.test.js +21 -0
- package/dist/components/Divider/__mocks__/styles.module.css.js +8 -0
- package/dist/components/Divider/index.js +19 -0
- package/dist/components/Fieldset/Fieldset.test.js +12 -0
- package/dist/components/Fieldset/index.js +19 -0
- package/dist/components/FileUpload/FileUpload.test.js +33 -0
- package/dist/components/FileUpload/index.js +99 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.test.js +36 -0
- package/dist/components/FloatingActionButton/__mocks__/styles.module.css.js +9 -0
- package/dist/components/FloatingActionButton/index.js +40 -0
- package/dist/components/Form/Form.test.js +20 -0
- package/dist/components/Form/index.js +29 -0
- package/dist/components/Grid/Grid.test.js +59 -0
- package/dist/components/Grid/index.js +32 -0
- package/dist/components/Heading/Heading.test.js +26 -0
- package/dist/components/Heading/__mocks__/styles.module.css.js +11 -0
- package/dist/components/Heading/index.js +20 -7
- package/dist/components/IconButton/IconButton.test.js +48 -0
- package/dist/components/IconButton/__mocks__/styles.module.css.js +12 -0
- package/dist/components/IconButton/index.js +39 -0
- package/dist/components/Input/Input.test.js +13 -0
- package/dist/components/Input/__mocks__/styles.module.css.js +9 -0
- package/dist/components/Input/index.js +45 -6
- package/dist/components/Label/Label.test.js +30 -0
- package/dist/components/Label/__mocks__/styles.module.css.js +16 -0
- package/dist/components/Label/index.js +94 -6
- package/dist/components/Link/Link.test.js +32 -0
- package/dist/components/Link/__mocks__/styles.module.css.js +8 -0
- package/dist/components/Link/index.js +5 -0
- package/dist/components/MultiSelect/MultiSelect.test.js +3144 -0
- package/dist/components/MultiSelect/index.js +45 -0
- package/dist/components/Radio/Radio.test.js +39 -0
- package/dist/components/Radio/__mocks__/styles.module.css.js +8 -0
- package/dist/components/Radio/index.js +37 -0
- package/dist/components/Range/Range.test.js +39 -0
- package/dist/components/Range/index.js +64 -0
- package/dist/components/Select/Select.test.js +48 -0
- package/dist/components/Select/index.js +43 -0
- package/dist/components/Spacer/Spacer.test.js +22 -0
- package/dist/components/Spacer/__mocks__/styles.module.css.js +12 -0
- package/dist/components/Spacer/index.js +29 -0
- package/dist/components/Stack/Stack.test.js +60 -0
- package/dist/components/Stack/__mocks__/styles.module.css.js +21 -0
- package/dist/components/Stack/index.js +65 -0
- package/dist/components/Switch/Switch.test.js +48 -0
- package/dist/components/Switch/index.js +57 -0
- package/dist/components/Table/Table.test.js +31 -0
- package/dist/components/Table/index.js +31 -0
- package/dist/components/Text/Text.test.js +65 -0
- package/dist/components/Text/__mocks__/styles.module.css.js +9 -0
- package/dist/components/Text/index.js +50 -0
- package/dist/components/Textarea/Textarea.test.js +37 -0
- package/dist/components/Textarea/index.js +47 -0
- package/dist/createLucideIcon-C8GTh_Qx.js +89 -0
- package/dist/index-BWTAh3RO.js +57529 -0
- package/dist/index-BtY6pil2.js +1621 -0
- package/dist/index-DhqFdMqD.js +1416 -0
- package/dist/lib/components/Box/Box.test.d.ts +0 -0
- package/dist/lib/components/Box/__mocks__/styles.module.css.d.ts +18 -0
- package/dist/lib/components/Box/index.d.ts +59 -0
- package/dist/lib/components/Button/Button.test.d.ts +0 -0
- package/dist/lib/components/Button/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/Button/index.d.ts +11 -1
- package/dist/lib/components/ButtonGroup/ButtonGroup.test.d.ts +0 -0
- package/dist/lib/components/ButtonGroup/__mocks__/styles.module.css.d.ts +5 -0
- package/dist/lib/components/ButtonGroup/index.d.ts +8 -0
- package/dist/lib/components/Calendar/Calendar.test.d.ts +0 -0
- package/dist/lib/components/Calendar/index.d.ts +6 -0
- package/dist/lib/components/Checkbox/Checkbox.test.d.ts +0 -0
- package/dist/lib/components/Checkbox/__mocks__/styles.module.css.d.ts +6 -0
- package/dist/lib/components/Checkbox/index.d.ts +10 -0
- package/dist/lib/components/Container/Container.test.d.ts +0 -0
- package/dist/lib/components/Container/__mocks__/styles.module.css.d.ts +9 -0
- package/dist/lib/components/Container/index.d.ts +20 -0
- package/dist/lib/components/DatePicker/DatePicker.test.d.ts +0 -0
- package/dist/lib/components/DatePicker/index.d.ts +13 -0
- package/dist/lib/components/Divider/Divider.test.d.ts +0 -0
- package/dist/lib/components/Divider/__mocks__/styles.module.css.d.ts +6 -0
- package/dist/lib/components/Divider/index.d.ts +12 -0
- package/dist/lib/components/Fieldset/Fieldset.test.d.ts +0 -0
- package/dist/lib/components/Fieldset/index.d.ts +7 -0
- package/dist/lib/components/FileUpload/FileUpload.test.d.ts +0 -0
- package/dist/lib/components/FileUpload/index.d.ts +13 -0
- package/dist/lib/components/FloatingActionButton/FloatingActionButton.test.d.ts +0 -0
- package/dist/lib/components/FloatingActionButton/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/FloatingActionButton/index.d.ts +18 -0
- package/dist/lib/components/Form/Form.test.d.ts +0 -0
- package/dist/lib/components/Form/index.d.ts +12 -0
- package/dist/lib/components/Grid/Grid.test.d.ts +0 -0
- package/dist/lib/components/Grid/index.d.ts +11 -0
- package/dist/lib/components/Heading/Heading.test.d.ts +0 -0
- package/dist/lib/components/Heading/__mocks__/styles.module.css.d.ts +9 -0
- package/dist/lib/components/Heading/index.d.ts +291 -1
- package/dist/lib/components/IconButton/IconButton.test.d.ts +0 -0
- package/dist/lib/components/IconButton/__mocks__/styles.module.css.d.ts +10 -0
- package/dist/lib/components/IconButton/index.d.ts +24 -0
- package/dist/lib/components/Input/Input.test.d.ts +0 -0
- package/dist/lib/components/Input/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/Input/index.d.ts +10 -1
- package/dist/lib/components/Label/Label.test.d.ts +0 -0
- package/dist/lib/components/Label/__mocks__/styles.module.css.d.ts +14 -0
- package/dist/lib/components/Label/index.d.ts +29 -1
- package/dist/lib/components/Link/Link.test.d.ts +0 -0
- package/dist/lib/components/Link/__mocks__/styles.module.css.d.ts +6 -0
- package/dist/lib/components/Link/index.d.ts +18 -0
- package/dist/lib/components/MultiSelect/MultiSelect.test.d.ts +0 -0
- package/dist/lib/components/MultiSelect/index.d.ts +17 -0
- package/dist/lib/components/Radio/Radio.test.d.ts +0 -0
- package/dist/lib/components/Radio/__mocks__/styles.module.css.d.ts +6 -0
- package/dist/lib/components/Radio/index.d.ts +12 -0
- package/dist/lib/components/Range/Range.test.d.ts +0 -0
- package/dist/lib/components/Range/index.d.ts +15 -0
- package/dist/lib/components/Select/Select.test.d.ts +0 -0
- package/dist/lib/components/Select/index.d.ts +18 -0
- package/dist/lib/components/Spacer/Spacer.test.d.ts +0 -0
- package/dist/lib/components/Spacer/__mocks__/styles.module.css.d.ts +10 -0
- package/dist/lib/components/Spacer/index.d.ts +20 -0
- package/dist/lib/components/Stack/Stack.test.d.ts +0 -0
- package/dist/lib/components/Stack/__mocks__/styles.module.css.d.ts +19 -0
- package/dist/lib/components/Stack/index.d.ts +42 -0
- package/dist/lib/components/Switch/Switch.test.d.ts +0 -0
- package/dist/lib/components/Switch/index.d.ts +18 -0
- package/dist/lib/components/Table/Table.test.d.ts +0 -0
- package/dist/lib/components/Table/index.d.ts +15 -0
- package/dist/lib/components/Text/Text.test.d.ts +0 -0
- package/dist/lib/components/Text/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/Text/index.d.ts +17 -0
- package/dist/lib/components/Textarea/Textarea.test.d.ts +0 -0
- package/dist/lib/components/Textarea/index.d.ts +13 -0
- package/dist/lib/main.d.ts +26 -1
- package/dist/lib/utils/renderRichText.d.ts +25 -0
- package/dist/magic-string.es-D4UQQyt0.js +859 -0
- package/dist/main.js +54 -6
- package/dist/trash-2-2Rn0a4s6.js +17 -0
- package/dist/utils/renderRichText.js +26 -0
- package/package.json +23 -6
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import '../../assets/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index13.css';const c = "_button_v8ol8_1", y = "_primary_v8ol8_21", _ = "_secondary_v8ol8_29", e = "_ghost_v8ol8_37", o = {
|
|
3
|
+
button: c,
|
|
4
|
+
primary: y,
|
|
5
|
+
secondary: _,
|
|
6
|
+
ghost: e
|
|
7
|
+
}, i = {
|
|
8
|
+
primary: o.primary,
|
|
9
|
+
secondary: o.secondary,
|
|
10
|
+
ghost: o.ghost
|
|
11
|
+
};
|
|
12
|
+
function p({
|
|
13
|
+
variant: t = "primary",
|
|
14
|
+
className: r,
|
|
15
|
+
children: s,
|
|
6
16
|
...n
|
|
7
17
|
}) {
|
|
8
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ a("button", { className: `${r ?? ""} ${o.button} ${i[t]}`, ...n, children: s });
|
|
9
19
|
}
|
|
10
20
|
export {
|
|
11
|
-
|
|
21
|
+
p as Button
|
|
12
22
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { d as a, i, r, g as n, s as c } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { ButtonGroup as s } from "./index.js";
|
|
4
|
+
a("ButtonGroup", () => {
|
|
5
|
+
i("renders children", () => {
|
|
6
|
+
r(
|
|
7
|
+
/* @__PURE__ */ o(s, { children: [
|
|
8
|
+
/* @__PURE__ */ t("button", { children: "One" }),
|
|
9
|
+
/* @__PURE__ */ t("button", { children: "Two" })
|
|
10
|
+
] })
|
|
11
|
+
), n(c.getByText("One")).toBeInTheDocument(), n(c.getByText("Two")).toBeInTheDocument();
|
|
12
|
+
}), i("applies horizontal orientation by default", () => {
|
|
13
|
+
const { container: e } = r(
|
|
14
|
+
/* @__PURE__ */ o(s, { children: [
|
|
15
|
+
/* @__PURE__ */ t("button", { children: "One" }),
|
|
16
|
+
/* @__PURE__ */ t("button", { children: "Two" })
|
|
17
|
+
] })
|
|
18
|
+
);
|
|
19
|
+
n(e.firstChild).toHaveClass("horizontal");
|
|
20
|
+
}), i("applies vertical orientation when specified", () => {
|
|
21
|
+
const { container: e } = r(
|
|
22
|
+
/* @__PURE__ */ o(s, { orientation: "vertical", children: [
|
|
23
|
+
/* @__PURE__ */ t("button", { children: "One" }),
|
|
24
|
+
/* @__PURE__ */ t("button", { children: "Two" })
|
|
25
|
+
] })
|
|
26
|
+
);
|
|
27
|
+
n(e.firstChild).toHaveClass("vertical");
|
|
28
|
+
}), i("accepts a custom class anme", () => {
|
|
29
|
+
const { container: e } = r(
|
|
30
|
+
/* @__PURE__ */ o(s, { className: "custom-class", children: [
|
|
31
|
+
/* @__PURE__ */ t("button", { children: "One" }),
|
|
32
|
+
/* @__PURE__ */ t("button", { children: "Two" })
|
|
33
|
+
] })
|
|
34
|
+
);
|
|
35
|
+
n(e.firstChild).toHaveClass("custom-class");
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index11.css';const l = "_buttonGroup_c695y_1", u = "_vertical_c695y_10", s = "_horizontal_c695y_14", o = {
|
|
3
|
+
buttonGroup: l,
|
|
4
|
+
vertical: u,
|
|
5
|
+
horizontal: s
|
|
6
|
+
};
|
|
7
|
+
function p({
|
|
8
|
+
children: t,
|
|
9
|
+
className: r,
|
|
10
|
+
orientation: n = "horizontal",
|
|
11
|
+
role: e = "group",
|
|
12
|
+
...c
|
|
13
|
+
}) {
|
|
14
|
+
const i = n === "vertical" ? o.vertical : o.horizontal;
|
|
15
|
+
return /* @__PURE__ */ a(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: `${o.buttonGroup} ${i} ${r ?? ""}`,
|
|
19
|
+
...c,
|
|
20
|
+
children: t
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
p as ButtonGroup
|
|
26
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { d as D, i as s, r as l, g as n, s as a, v as y, f as d } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { f as h, C as r } from "../../index-DhqFdMqD.js";
|
|
4
|
+
D("Calendar", () => {
|
|
5
|
+
s("renders the current month and year", () => {
|
|
6
|
+
const t = new Date(2025, 4, 15);
|
|
7
|
+
l(/* @__PURE__ */ c(r, { selectedDate: t, onSelectDate: () => {
|
|
8
|
+
} })), n(a.getByText("May 2025")).toBeInTheDocument();
|
|
9
|
+
}), s("renders the day names (Sun to Sat)", () => {
|
|
10
|
+
l(/* @__PURE__ */ c(r, { selectedDate: /* @__PURE__ */ new Date(), onSelectDate: () => {
|
|
11
|
+
} })), ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"].forEach((e) => {
|
|
12
|
+
n(a.getByText(e)).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
}), s("renders all days for the visible calendar grid", () => {
|
|
15
|
+
const t = new Date(2025, 4, 1);
|
|
16
|
+
l(/* @__PURE__ */ c(r, { selectedDate: t, onSelectDate: () => {
|
|
17
|
+
} }));
|
|
18
|
+
const e = a.getAllByRole("button").filter(
|
|
19
|
+
(i) => /^\d+$/.test(i.textContent || "")
|
|
20
|
+
);
|
|
21
|
+
n(e.length).toBeGreaterThanOrEqual(28);
|
|
22
|
+
}), s("calls onSelectDate with the correct date when a day is clicked", () => {
|
|
23
|
+
const t = new Date(2025, 4, 1), o = y.fn();
|
|
24
|
+
l(
|
|
25
|
+
/* @__PURE__ */ c(r, { selectedDate: t, onSelectDate: o })
|
|
26
|
+
);
|
|
27
|
+
const e = a.getAllByRole("button").find((u) => u.textContent === "15");
|
|
28
|
+
n(e).toBeTruthy(), e && d.click(e), n(o).toHaveBeenCalledTimes(1);
|
|
29
|
+
const i = o.mock.calls[0][0];
|
|
30
|
+
n(h(i, "yyyy-MM-dd")).toBe("2025-05-15");
|
|
31
|
+
}), s("navigates to previous and next months", () => {
|
|
32
|
+
const t = new Date(2025, 4, 1);
|
|
33
|
+
l(/* @__PURE__ */ c(r, { selectedDate: t, onSelectDate: () => {
|
|
34
|
+
} }));
|
|
35
|
+
const o = a.getByLabelText("Decrease month number");
|
|
36
|
+
d.click(o), n(a.getByText("April 2025")).toBeInTheDocument();
|
|
37
|
+
const e = a.getByLabelText("Increase month number");
|
|
38
|
+
d.click(e), d.click(e), n(a.getByText("June 2025")).toBeInTheDocument();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { d as n, i as b, r as s, g as c, s as o, v as h } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { Checkbox as a } from "./index.js";
|
|
4
|
+
n("Checkbox", () => {
|
|
5
|
+
b("renders correctly", () => {
|
|
6
|
+
s(
|
|
7
|
+
/* @__PURE__ */ t(a, { id: "checkbox1", name: "testCheckboxes", label: "Accept terms" })
|
|
8
|
+
), c(o.getByRole("checkbox")).toBeInTheDocument(), c(o.getByLabelText("Accept terms")).toBeInTheDocument();
|
|
9
|
+
}), b("can be disabled", () => {
|
|
10
|
+
s(
|
|
11
|
+
/* @__PURE__ */ t(
|
|
12
|
+
a,
|
|
13
|
+
{
|
|
14
|
+
id: "checkbox2",
|
|
15
|
+
name: "testCheckboxes",
|
|
16
|
+
label: "Disabled checkbox",
|
|
17
|
+
disabled: !0
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
const e = o.getByRole("checkbox");
|
|
22
|
+
c(e).toBeDisabled();
|
|
23
|
+
}), b("fires onChange event", () => {
|
|
24
|
+
const e = h.fn();
|
|
25
|
+
s(
|
|
26
|
+
/* @__PURE__ */ t(
|
|
27
|
+
a,
|
|
28
|
+
{
|
|
29
|
+
id: "checkbox3",
|
|
30
|
+
name: "testCheckboxes",
|
|
31
|
+
label: "Checkbox with onChange",
|
|
32
|
+
onChange: e
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
), o.getByRole("checkbox").click(), c(e).toHaveBeenCalled();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Label as x } from "../Label/index.js";
|
|
4
|
+
import '../../assets/index23.css';const b = "_wrapper_zxmf0_1", n = "_checkbox_zxmf0_7", h = "_label_zxmf0_29", e = {
|
|
5
|
+
wrapper: b,
|
|
6
|
+
checkbox: n,
|
|
7
|
+
label: h
|
|
8
|
+
};
|
|
9
|
+
function i({
|
|
10
|
+
id: c,
|
|
11
|
+
name: a,
|
|
12
|
+
label: s,
|
|
13
|
+
disabled: o = !1,
|
|
14
|
+
required: l = !1,
|
|
15
|
+
className: p,
|
|
16
|
+
...t
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ m("div", { className: `${e.wrapper} ${p ?? ""}`, children: [
|
|
19
|
+
/* @__PURE__ */ r(
|
|
20
|
+
"input",
|
|
21
|
+
{
|
|
22
|
+
type: "checkbox",
|
|
23
|
+
id: c,
|
|
24
|
+
name: a,
|
|
25
|
+
disabled: o,
|
|
26
|
+
required: l,
|
|
27
|
+
className: e.checkbox,
|
|
28
|
+
...t
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ r(
|
|
32
|
+
x,
|
|
33
|
+
{
|
|
34
|
+
htmlFor: c,
|
|
35
|
+
disabled: o,
|
|
36
|
+
required: l,
|
|
37
|
+
className: e.label,
|
|
38
|
+
children: s
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
i as Checkbox
|
|
45
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { d as c, i as t, r as i, g as n, s as o } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { Container as a } from "./index.js";
|
|
4
|
+
c("Container", () => {
|
|
5
|
+
t("renders children", () => {
|
|
6
|
+
i(/* @__PURE__ */ s(a, { children: "Test content" })), n(o.getByText("Test content")).toBeInTheDocument();
|
|
7
|
+
}), t("applies the default size class", () => {
|
|
8
|
+
const { container: e } = i(/* @__PURE__ */ s(a, { children: "Test" }));
|
|
9
|
+
n(e.firstChild).toHaveClass("md");
|
|
10
|
+
}), t("applies a custom size class", () => {
|
|
11
|
+
const { container: e } = i(/* @__PURE__ */ s(a, { size: "lg", children: "Test" }));
|
|
12
|
+
n(e.firstChild).toHaveClass("lg");
|
|
13
|
+
}), t("applies fluid class", () => {
|
|
14
|
+
const { container: e } = i(/* @__PURE__ */ s(a, { fluid: !0, children: "Fluid Container" }));
|
|
15
|
+
n(e.firstChild).toHaveClass("fluid");
|
|
16
|
+
}), t("applies a custom className", () => {
|
|
17
|
+
const { container: e } = i(
|
|
18
|
+
/* @__PURE__ */ s(a, { className: "custom-class", children: "Test" })
|
|
19
|
+
);
|
|
20
|
+
n(e.firstChild).toHaveClass("custom-class");
|
|
21
|
+
}), t("renders with a custom tag", () => {
|
|
22
|
+
const { container: e } = i(/* @__PURE__ */ s(a, { as: "section", children: "Test" }));
|
|
23
|
+
n(e.querySelector("section")).toBeInTheDocument();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index17.css';const a = "_container_171d6_1", f = "_sm_171d6_9", m = "_md_171d6_13", r = "_lg_171d6_17", u = "_xl_171d6_21", x = "_full_171d6_25", g = "_fluid_171d6_29", n = {
|
|
3
|
+
container: a,
|
|
4
|
+
sm: f,
|
|
5
|
+
md: m,
|
|
6
|
+
lg: r,
|
|
7
|
+
xl: u,
|
|
8
|
+
full: x,
|
|
9
|
+
fluid: g
|
|
10
|
+
};
|
|
11
|
+
function p({
|
|
12
|
+
children: s,
|
|
13
|
+
className: _ = "",
|
|
14
|
+
as: l = "div",
|
|
15
|
+
size: t = "md",
|
|
16
|
+
fluid: o = !1,
|
|
17
|
+
...c
|
|
18
|
+
}) {
|
|
19
|
+
const d = l, i = o ? n.fluid : n[t] ?? "";
|
|
20
|
+
return /* @__PURE__ */ e(
|
|
21
|
+
d,
|
|
22
|
+
{
|
|
23
|
+
className: `${n.container} ${i} ${_ ?? ""}`,
|
|
24
|
+
...c,
|
|
25
|
+
children: s
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
p as Container
|
|
31
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { v as r, d as k, i as c, r as d, g as t, s as a, f as l } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { DatePicker as o } from "./index.js";
|
|
4
|
+
import { f as u } from "../../index-DhqFdMqD.js";
|
|
5
|
+
r.mock("../Calendar", () => ({
|
|
6
|
+
Calendar: ({ onSelectDate: e }) => /* @__PURE__ */ n(
|
|
7
|
+
"button",
|
|
8
|
+
{
|
|
9
|
+
onClick: () => e(/* @__PURE__ */ new Date("2025-05-02")),
|
|
10
|
+
"data-testid": "mock-calendar",
|
|
11
|
+
children: "Select Date"
|
|
12
|
+
}
|
|
13
|
+
)
|
|
14
|
+
}));
|
|
15
|
+
k("DatePicker", () => {
|
|
16
|
+
c("renders label and input", () => {
|
|
17
|
+
d(/* @__PURE__ */ n(o, { id: "date", name: "date", label: "Pick a date" })), t(a.getByText("Pick a date")).toBeInTheDocument();
|
|
18
|
+
}), c("opens a calendar on input click", () => {
|
|
19
|
+
d(/* @__PURE__ */ n(o, { id: "date", name: "date", label: "Pick a date" }));
|
|
20
|
+
const e = a.getByPlaceholderText("Select date");
|
|
21
|
+
l.click(e), t(a.getByTestId("mock-calendar")).toBeInTheDocument();
|
|
22
|
+
}), c("calls onValueChange and updates the value", () => {
|
|
23
|
+
const e = r.fn();
|
|
24
|
+
d(
|
|
25
|
+
/* @__PURE__ */ n(
|
|
26
|
+
o,
|
|
27
|
+
{
|
|
28
|
+
id: "date",
|
|
29
|
+
name: "date",
|
|
30
|
+
label: "Pick a date",
|
|
31
|
+
onValueChange: e
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
);
|
|
35
|
+
const i = a.getByPlaceholderText("Select date");
|
|
36
|
+
l.click(i);
|
|
37
|
+
const s = a.getByTestId("mock-calendar");
|
|
38
|
+
l.click(s);
|
|
39
|
+
const m = u(/* @__PURE__ */ new Date("2025-05-02"), "yyyy-MM-dd");
|
|
40
|
+
t(e).toHaveBeenCalledWith(/* @__PURE__ */ new Date("2025-05-02")), t(i).toHaveValue(m);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as n } from "react";
|
|
3
|
+
import { Label as w } from "../Label/index.js";
|
|
4
|
+
import { f as x, C as D } from "../../index-DhqFdMqD.js";
|
|
5
|
+
import '../../assets/index24.css';const S = "_wrapper_13tha_1", N = "_input_13tha_7", O = "_popover_13tha_25", s = {
|
|
6
|
+
wrapper: S,
|
|
7
|
+
input: N,
|
|
8
|
+
popover: O
|
|
9
|
+
};
|
|
10
|
+
function F({
|
|
11
|
+
id: o,
|
|
12
|
+
name: i,
|
|
13
|
+
label: m,
|
|
14
|
+
onValueChange: r,
|
|
15
|
+
required: a = !1,
|
|
16
|
+
disabled: c = !1,
|
|
17
|
+
min: f,
|
|
18
|
+
max: _,
|
|
19
|
+
className: d,
|
|
20
|
+
...v
|
|
21
|
+
}) {
|
|
22
|
+
const [p, y] = n(null), [u, l] = n(!1);
|
|
23
|
+
return /* @__PURE__ */ h("div", { className: `${s.wrapper} ${d ?? ""}`, children: [
|
|
24
|
+
/* @__PURE__ */ t(w, { htmlFor: o, required: a, disabled: c, children: m }),
|
|
25
|
+
/* @__PURE__ */ t(
|
|
26
|
+
"input",
|
|
27
|
+
{
|
|
28
|
+
id: o,
|
|
29
|
+
name: i,
|
|
30
|
+
type: "text",
|
|
31
|
+
readOnly: !0,
|
|
32
|
+
value: p ? x(p, "yyyy-MM-dd") : "",
|
|
33
|
+
onClick: () => l((e) => !e),
|
|
34
|
+
placeholder: "Select date",
|
|
35
|
+
required: a,
|
|
36
|
+
disabled: c,
|
|
37
|
+
min: f,
|
|
38
|
+
max: _,
|
|
39
|
+
className: s.input,
|
|
40
|
+
...v
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
u && /* @__PURE__ */ t("div", { className: s.popover, children: /* @__PURE__ */ t(
|
|
44
|
+
D,
|
|
45
|
+
{
|
|
46
|
+
selectedDate: p,
|
|
47
|
+
onSelectDate: (e) => {
|
|
48
|
+
r == null || r(e), y(e), l(!1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
) })
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
F as DatePicker
|
|
56
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { d as c, i as e, r as i, g as a } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { Divider as t } from "./index.js";
|
|
4
|
+
c("Spacer", () => {
|
|
5
|
+
e("renders with default props", () => {
|
|
6
|
+
const { container: s } = i(/* @__PURE__ */ r(t, {}));
|
|
7
|
+
a(s.firstChild).toHaveClass("horizontal", "divider");
|
|
8
|
+
}), e("renders the correct classes", () => {
|
|
9
|
+
const { container: s } = i(/* @__PURE__ */ r(t, { axis: "vertical" }));
|
|
10
|
+
a(s.firstChild).toHaveClass("vertical", "divider");
|
|
11
|
+
}), e("renders custom classes", () => {
|
|
12
|
+
const { container: s } = i(
|
|
13
|
+
/* @__PURE__ */ r(t, { className: "custom-class", axis: "vertical" })
|
|
14
|
+
);
|
|
15
|
+
a(s.firstChild).toHaveClass(
|
|
16
|
+
"custom-class",
|
|
17
|
+
"vertical",
|
|
18
|
+
"divider"
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index19.css';const s = "_divider_zjbsg_1", e = "_horizontal_zjbsg_6", l = "_vertical_zjbsg_11", i = {
|
|
3
|
+
divider: s,
|
|
4
|
+
horizontal: e,
|
|
5
|
+
vertical: l
|
|
6
|
+
}, n = {
|
|
7
|
+
horizontal: i.horizontal,
|
|
8
|
+
vertical: i.vertical
|
|
9
|
+
};
|
|
10
|
+
function v({
|
|
11
|
+
axis: o = "horizontal",
|
|
12
|
+
className: r,
|
|
13
|
+
...t
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ a("div", { className: `${i.divider} ${n[o]} ${r ?? ""}`, ...t });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
v as Divider
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { d as l, i as t, r, g as n, s as d } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { Fieldset as i } from "./index.js";
|
|
4
|
+
l("Fieldset", () => {
|
|
5
|
+
t("renders children", () => {
|
|
6
|
+
r(
|
|
7
|
+
/* @__PURE__ */ e(i, { children: /* @__PURE__ */ e("input", { type: "text", placeholder: "Text input" }) })
|
|
8
|
+
), n(d.getByPlaceholderText("Text input")).toBeInTheDocument();
|
|
9
|
+
}), t("renders legend if provided", () => {
|
|
10
|
+
r(/* @__PURE__ */ e(i, { legend: "Test legend", children: "Content" })), n(d.getByText("Test legend")).toBeInTheDocument();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index22.css';const c = "_fieldset_1i2zv_1", f = "_legend_1i2zv_8", s = {
|
|
3
|
+
fieldset: c,
|
|
4
|
+
legend: f
|
|
5
|
+
};
|
|
6
|
+
function r({
|
|
7
|
+
legend: e,
|
|
8
|
+
className: l,
|
|
9
|
+
children: t,
|
|
10
|
+
...d
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ i("fieldset", { className: `${s.fieldset} ${l ?? ""}`, ...d, children: [
|
|
13
|
+
e && /* @__PURE__ */ n("legend", { className: s.legend, children: e }),
|
|
14
|
+
t
|
|
15
|
+
] });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
r as Fieldset
|
|
19
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { d as c, i as t, r as l, g as s, s as n, v as a, f as d } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { FileUpload as r } from "./index.js";
|
|
4
|
+
c("FileUpload", () => {
|
|
5
|
+
t("renders the label correctly", () => {
|
|
6
|
+
l(/* @__PURE__ */ o(r, { label: "Upload your resume", onFilesChange: () => {
|
|
7
|
+
} })), s(n.getByText("Upload your resume")).toBeInTheDocument();
|
|
8
|
+
}), t("opens file picker on click", () => {
|
|
9
|
+
l(/* @__PURE__ */ o(r, { label: "Upload your resume", onFilesChange: () => {
|
|
10
|
+
} }));
|
|
11
|
+
const e = n.getByLabelText("Upload your resume");
|
|
12
|
+
s(e).toBeInTheDocument();
|
|
13
|
+
}), t("triggers onFilesChange when files are dropped", () => {
|
|
14
|
+
const e = a.fn();
|
|
15
|
+
l(
|
|
16
|
+
/* @__PURE__ */ o(
|
|
17
|
+
r,
|
|
18
|
+
{
|
|
19
|
+
label: "Upload your resume",
|
|
20
|
+
onFilesChange: e
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
);
|
|
24
|
+
const i = n.getByRole("button"), p = {
|
|
25
|
+
files: [new File(["file content"], "test.txt", {
|
|
26
|
+
type: "text/plain"
|
|
27
|
+
})],
|
|
28
|
+
types: ["Files"],
|
|
29
|
+
getData: a.fn()
|
|
30
|
+
};
|
|
31
|
+
d.drop(i, { dataTransfer: p });
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as x, useState as h } from "react";
|
|
3
|
+
import { IconButton as N } from "../IconButton/index.js";
|
|
4
|
+
import { Label as Z } from "../Label/index.js";
|
|
5
|
+
import { T as z } from "../../trash-2-2Rn0a4s6.js";
|
|
6
|
+
import '../../assets/index25.css';const I = "_wrapper_s8dew_1", R = "_dropZone_s8dew_7", T = "_dragging_s8dew_25", j = "_input_s8dew_30", A = "_fileList_s8dew_34", i = {
|
|
7
|
+
wrapper: I,
|
|
8
|
+
dropZone: R,
|
|
9
|
+
dragging: T,
|
|
10
|
+
input: j,
|
|
11
|
+
fileList: A
|
|
12
|
+
};
|
|
13
|
+
function b({
|
|
14
|
+
id: D,
|
|
15
|
+
name: w,
|
|
16
|
+
label: p = "Upload files",
|
|
17
|
+
accept: y,
|
|
18
|
+
multiple: k = !1,
|
|
19
|
+
required: f = !1,
|
|
20
|
+
disabled: o = !1,
|
|
21
|
+
className: v,
|
|
22
|
+
onFilesChange: s
|
|
23
|
+
}) {
|
|
24
|
+
const a = x(null), [d, l] = h(!1), [t, u] = h([]), m = (e) => {
|
|
25
|
+
if (!e) return;
|
|
26
|
+
const r = Array.from(e);
|
|
27
|
+
u((_) => [..._, ...r]), s(r);
|
|
28
|
+
}, L = (e) => {
|
|
29
|
+
const r = t.filter((_, $) => $ !== e);
|
|
30
|
+
u(r), s == null || s(r);
|
|
31
|
+
}, g = D ?? `upload-${Math.random().toString(36).slice(2)}`;
|
|
32
|
+
return /* @__PURE__ */ c("div", { className: `${i.wrapper} ${v ?? ""}`, children: [
|
|
33
|
+
p && /* @__PURE__ */ n(Z, { htmlFor: g, required: f, disabled: o, children: p }),
|
|
34
|
+
/* @__PURE__ */ n(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: `${i.dropZone} ${d ? i.dragging : ""}`,
|
|
38
|
+
onClick: () => {
|
|
39
|
+
var e;
|
|
40
|
+
return !o && ((e = a.current) == null ? void 0 : e.click());
|
|
41
|
+
},
|
|
42
|
+
onDragOver: (e) => {
|
|
43
|
+
e.preventDefault(), o || l(!0);
|
|
44
|
+
},
|
|
45
|
+
onDragLeave: () => l(!1),
|
|
46
|
+
onDrop: (e) => {
|
|
47
|
+
e.preventDefault(), o || (l(!1), m(e.dataTransfer.files));
|
|
48
|
+
},
|
|
49
|
+
role: "button",
|
|
50
|
+
tabIndex: 0,
|
|
51
|
+
onKeyDown: (e) => {
|
|
52
|
+
var r;
|
|
53
|
+
(e.key === "Enter" || e.key === " ") && ((r = a.current) == null || r.click());
|
|
54
|
+
},
|
|
55
|
+
"aria-disabled": o,
|
|
56
|
+
children: /* @__PURE__ */ n("p", { children: d ? "Drop files here" : "Drag files here or click to upload" })
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ n(
|
|
60
|
+
"input",
|
|
61
|
+
{
|
|
62
|
+
ref: a,
|
|
63
|
+
id: g,
|
|
64
|
+
name: w,
|
|
65
|
+
type: "file",
|
|
66
|
+
accept: y,
|
|
67
|
+
multiple: k,
|
|
68
|
+
required: f,
|
|
69
|
+
disabled: o,
|
|
70
|
+
onChange: (e) => m(e.target.files),
|
|
71
|
+
className: i.input,
|
|
72
|
+
hidden: !0
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
(t == null ? void 0 : t.length) > 0 && /* @__PURE__ */ n("ul", { className: i.fileList, children: t == null ? void 0 : t.map((e, r) => /* @__PURE__ */ c("li", { children: [
|
|
76
|
+
/* @__PURE__ */ c("span", { children: [
|
|
77
|
+
" ",
|
|
78
|
+
e.name,
|
|
79
|
+
" (",
|
|
80
|
+
(e.size / 1024).toFixed(1),
|
|
81
|
+
" KB)"
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ n(
|
|
84
|
+
N,
|
|
85
|
+
{
|
|
86
|
+
type: "button",
|
|
87
|
+
icon: /* @__PURE__ */ n(z, { size: 21 }),
|
|
88
|
+
size: "sm",
|
|
89
|
+
intent: "error",
|
|
90
|
+
srOnlyLabel: "Decrease month number",
|
|
91
|
+
onClick: () => L(r)
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] }, `${e.name}-${r}`)) })
|
|
95
|
+
] });
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
b as FileUpload
|
|
99
|
+
};
|