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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { d as r, i as o, r as c, g as i, s, v as d, f as m } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { FloatingActionButton as l } from "./index.js";
|
|
4
|
+
import { c as h } from "../../createLucideIcon-C8GTh_Qx.js";
|
|
5
|
+
/**
|
|
6
|
+
* @license lucide-react v0.488.0 - ISC
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the ISC license.
|
|
9
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/
|
|
11
|
+
const p = [
|
|
12
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
13
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
14
|
+
], n = h("plus", p);
|
|
15
|
+
r("FloatingActionButton", () => {
|
|
16
|
+
o("renders the icon", () => {
|
|
17
|
+
c(/* @__PURE__ */ e(l, { icon: /* @__PURE__ */ e(n, {}), "aria-label": "Add" })), i(s.getByLabelText("Add")).toBeInTheDocument();
|
|
18
|
+
}), o("calls onClick when clicked", () => {
|
|
19
|
+
const t = d.fn();
|
|
20
|
+
c(
|
|
21
|
+
/* @__PURE__ */ e(
|
|
22
|
+
l,
|
|
23
|
+
{
|
|
24
|
+
onClick: t,
|
|
25
|
+
icon: /* @__PURE__ */ e(n, {}),
|
|
26
|
+
"aria-label": "Add"
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
), m.click(s.getByLabelText("Add")), i(t).toHaveBeenCalledTimes(1);
|
|
30
|
+
}), o("applies the correct size class", () => {
|
|
31
|
+
const { container: t } = c(
|
|
32
|
+
/* @__PURE__ */ e(l, { icon: /* @__PURE__ */ e(n, {}), "aria-label": "Add", size: "lg" })
|
|
33
|
+
), a = t.querySelector("button");
|
|
34
|
+
i(a == null ? void 0 : a.className).toMatch(/lg/);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index12.css';const b = "_fab_1p460_1", c = "_sm_1p460_22", f = "_md_1p460_27", g = "_lg_1p460_31", r = "_disabled_1p460_56", t = {
|
|
3
|
+
fab: b,
|
|
4
|
+
sm: c,
|
|
5
|
+
md: f,
|
|
6
|
+
lg: g,
|
|
7
|
+
"bottom-right": "_bottom-right_1p460_36",
|
|
8
|
+
"bottom-left": "_bottom-left_1p460_41",
|
|
9
|
+
"top-right": "_top-right_1p460_46",
|
|
10
|
+
"top-left": "_top-left_1p460_51",
|
|
11
|
+
disabled: r
|
|
12
|
+
}, h = {
|
|
13
|
+
sm: t.sm,
|
|
14
|
+
md: t.md,
|
|
15
|
+
lg: t.lg
|
|
16
|
+
};
|
|
17
|
+
function u({
|
|
18
|
+
icon: o,
|
|
19
|
+
size: _ = "md",
|
|
20
|
+
onClick: l,
|
|
21
|
+
className: m,
|
|
22
|
+
position: n = "bottom-right",
|
|
23
|
+
disabled: s = !1,
|
|
24
|
+
...i
|
|
25
|
+
}) {
|
|
26
|
+
const a = h[_] ?? "", p = t[n] || "", e = s ? t.disabled : "";
|
|
27
|
+
return /* @__PURE__ */ d(
|
|
28
|
+
"button",
|
|
29
|
+
{
|
|
30
|
+
className: `${t.fab} ${a} ${p} ${e} ${m ?? ""}`,
|
|
31
|
+
onClick: l,
|
|
32
|
+
disabled: s,
|
|
33
|
+
...i,
|
|
34
|
+
children: o
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
u as FloatingActionButton
|
|
40
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { d as i, i as o, r, g as s, s as a } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { Form as m } from "./index.js";
|
|
4
|
+
i("Form", () => {
|
|
5
|
+
o("renders children", () => {
|
|
6
|
+
r(
|
|
7
|
+
/* @__PURE__ */ e(m, { children: /* @__PURE__ */ e("input", { type: "text", placeholder: "Text input" }) })
|
|
8
|
+
), s(a.getByPlaceholderText("Text input")).toBeInTheDocument();
|
|
9
|
+
}), o("applies custom classes", () => {
|
|
10
|
+
r(/* @__PURE__ */ e(m, { "aria-label": "Test form", className: "custom-class", children: "Content" }));
|
|
11
|
+
const t = a.getByLabelText("Test form");
|
|
12
|
+
s(t).toHaveClass("custom-class");
|
|
13
|
+
}), o("sets form attributes", () => {
|
|
14
|
+
r(
|
|
15
|
+
/* @__PURE__ */ e(m, { "aria-label": "Test form", method: "get", action: "/submit", children: "Content" })
|
|
16
|
+
);
|
|
17
|
+
const t = a.getByLabelText("Test form");
|
|
18
|
+
s(t).toHaveAttribute("method", "get"), s(t).toHaveAttribute("action", "/submit");
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index20.css';const c = "_form_s0yvj_1", a = {
|
|
3
|
+
form: c
|
|
4
|
+
};
|
|
5
|
+
function p({
|
|
6
|
+
method: o = "post",
|
|
7
|
+
action: r,
|
|
8
|
+
encType: s,
|
|
9
|
+
noValidate: m = !1,
|
|
10
|
+
className: f = "",
|
|
11
|
+
children: t,
|
|
12
|
+
...e
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ n(
|
|
15
|
+
"form",
|
|
16
|
+
{
|
|
17
|
+
method: o,
|
|
18
|
+
action: r,
|
|
19
|
+
encType: s,
|
|
20
|
+
noValidate: m,
|
|
21
|
+
className: `${f ?? ""} ${a.form}`,
|
|
22
|
+
...e,
|
|
23
|
+
children: t
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
p as Form
|
|
29
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { d as o, i as d, r as s, g as i, s as m } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { Grid as l } from "./index.js";
|
|
4
|
+
o("Grid", () => {
|
|
5
|
+
d("renders children", () => {
|
|
6
|
+
s(
|
|
7
|
+
/* @__PURE__ */ n(l, { columns: 2, children: [
|
|
8
|
+
/* @__PURE__ */ e("div", { children: "Item 1" }),
|
|
9
|
+
/* @__PURE__ */ e("div", { children: "Item 2" })
|
|
10
|
+
] })
|
|
11
|
+
), i(m.getByText("Item 1")).toBeInTheDocument(), i(m.getByText("Item 2")).toBeInTheDocument();
|
|
12
|
+
}), d("applies correct number of columns", () => {
|
|
13
|
+
const { container: t } = s(
|
|
14
|
+
/* @__PURE__ */ n(l, { columns: 3, children: [
|
|
15
|
+
/* @__PURE__ */ e("div", { children: "Item 1" }),
|
|
16
|
+
/* @__PURE__ */ e("div", { children: "Item 2" }),
|
|
17
|
+
/* @__PURE__ */ e("div", { children: "Item 3" })
|
|
18
|
+
] })
|
|
19
|
+
), r = t.firstChild;
|
|
20
|
+
i(r.style.gridTemplateColumns).toBe("repeat(3, 1fr)");
|
|
21
|
+
}), d("uses auto-fit minmax", () => {
|
|
22
|
+
const { container: t } = s(
|
|
23
|
+
/* @__PURE__ */ n(l, { columns: 3, autoFitMinMax: "250px", gap: "2rem", children: [
|
|
24
|
+
/* @__PURE__ */ e("div", { children: "Item 1" }),
|
|
25
|
+
/* @__PURE__ */ e("div", { children: "Item 2" }),
|
|
26
|
+
/* @__PURE__ */ e("div", { children: "Item 3" })
|
|
27
|
+
] })
|
|
28
|
+
);
|
|
29
|
+
i(
|
|
30
|
+
t.firstChild.style.gridTemplateColumns
|
|
31
|
+
).toBe("repeat(auto-fit, minmax(250px, 1fr))");
|
|
32
|
+
}), d("applies named areas", () => {
|
|
33
|
+
const t = [
|
|
34
|
+
["header", "header"],
|
|
35
|
+
["sidebar", "main"],
|
|
36
|
+
["footer, footer"]
|
|
37
|
+
], { container: r } = s(
|
|
38
|
+
/* @__PURE__ */ n(l, { columns: 3, areas: t, gap: "2rem", children: [
|
|
39
|
+
/* @__PURE__ */ e("div", { children: "Item 1" }),
|
|
40
|
+
/* @__PURE__ */ e("div", { children: "Item 2" }),
|
|
41
|
+
/* @__PURE__ */ e("div", { children: "Item 3" })
|
|
42
|
+
] })
|
|
43
|
+
);
|
|
44
|
+
i(
|
|
45
|
+
r.firstChild.style.gridTemplateAreas
|
|
46
|
+
).toContain("header"), i(
|
|
47
|
+
r.firstChild.style.gridTemplateAreas
|
|
48
|
+
).toContain("main");
|
|
49
|
+
}), d("applies custom gap", () => {
|
|
50
|
+
const { container: t } = s(
|
|
51
|
+
/* @__PURE__ */ n(l, { columns: 3, gap: "2rem", children: [
|
|
52
|
+
/* @__PURE__ */ e("div", { children: "Item 1" }),
|
|
53
|
+
/* @__PURE__ */ e("div", { children: "Item 2" }),
|
|
54
|
+
/* @__PURE__ */ e("div", { children: "Item 3" })
|
|
55
|
+
] })
|
|
56
|
+
), r = t.firstChild;
|
|
57
|
+
i(r.style.gap).toBe("2rem");
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index16.css';const g = "_grid_1ua6c_1", n = {
|
|
3
|
+
grid: g
|
|
4
|
+
};
|
|
5
|
+
function y({
|
|
6
|
+
columns: r = 1,
|
|
7
|
+
gap: d = "1rem",
|
|
8
|
+
areas: i,
|
|
9
|
+
autoFitMinMax: t,
|
|
10
|
+
className: s,
|
|
11
|
+
children: m,
|
|
12
|
+
style: l,
|
|
13
|
+
...o
|
|
14
|
+
}) {
|
|
15
|
+
const e = {
|
|
16
|
+
...l,
|
|
17
|
+
display: "grid",
|
|
18
|
+
gap: d
|
|
19
|
+
};
|
|
20
|
+
return i ? e.gridTemplateAreas = i.map((p) => `"${p.join(" ")}"`).join(" ") : t ? e.gridTemplateColumns = `repeat(auto-fit, minmax(${t}, 1fr))` : e.gridTemplateColumns = typeof r == "number" ? `repeat(${r}, 1fr)` : r, /* @__PURE__ */ a(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
className: `${n.grid} ${s ?? ""}`,
|
|
24
|
+
style: e,
|
|
25
|
+
...o,
|
|
26
|
+
children: m
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
y as Grid
|
|
32
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { d as i, i as a, r as s, s as d, g as l } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { Heading as n } from "./index.js";
|
|
4
|
+
i("Heading", () => {
|
|
5
|
+
a("renders with default level (h1)", () => {
|
|
6
|
+
s(/* @__PURE__ */ t(n, { children: "Test Heading" }));
|
|
7
|
+
const e = d.getByText("Test Heading");
|
|
8
|
+
l(e.tagName).toBe("H1");
|
|
9
|
+
}), a("renders the correct heading level", () => {
|
|
10
|
+
s(/* @__PURE__ */ t(n, { level: 3, children: "Heading Level 3" }));
|
|
11
|
+
const e = d.getByText("Heading Level 3");
|
|
12
|
+
l(e.tagName).toBe("H3");
|
|
13
|
+
}), a("applies className and style from level", () => {
|
|
14
|
+
s(
|
|
15
|
+
/* @__PURE__ */ t(n, { level: 2, className: "custom-class", children: "Styled Heading" })
|
|
16
|
+
);
|
|
17
|
+
const e = d.getByText("Styled Heading");
|
|
18
|
+
l(e).toHaveClass("custom-class"), l(e).toHaveClass("h2");
|
|
19
|
+
}), a("renders children properly", () => {
|
|
20
|
+
s(
|
|
21
|
+
/* @__PURE__ */ t(n, { level: 4, children: /* @__PURE__ */ t("span", { children: "Child Text" }) })
|
|
22
|
+
);
|
|
23
|
+
const e = d.getByText("Child Text");
|
|
24
|
+
l(e).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../assets/
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import o from "react";
|
|
2
|
+
import '../../assets/index15.css';const e = "_h1_mq0ks_1", m = "_h2_mq0ks_2", a = "_h3_mq0ks_3", k = "_h4_mq0ks_4", q = "_h5_mq0ks_5", r = "_h6_mq0ks_6", l = {
|
|
3
|
+
h1: e,
|
|
4
|
+
h2: m,
|
|
5
|
+
h3: a,
|
|
6
|
+
h4: k,
|
|
7
|
+
h5: q,
|
|
8
|
+
h6: r
|
|
9
|
+
};
|
|
10
|
+
function f({
|
|
11
|
+
level: s = 1,
|
|
12
|
+
className: h,
|
|
5
13
|
children: t,
|
|
6
|
-
...
|
|
14
|
+
..._
|
|
7
15
|
}) {
|
|
8
|
-
|
|
16
|
+
const n = `h${s}`, c = l[`h${s}`] || "";
|
|
17
|
+
return o.createElement(
|
|
18
|
+
n,
|
|
19
|
+
{ className: `${h ?? ""} ${c}`, ..._ },
|
|
20
|
+
t
|
|
21
|
+
);
|
|
9
22
|
}
|
|
10
23
|
export {
|
|
11
|
-
|
|
24
|
+
f as Heading
|
|
12
25
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { d as r, i as a, r as o, s as n, g as s, v as m, f as b } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { IconButton as l } from "./index.js";
|
|
4
|
+
import { T as c } from "../../trash-2-2Rn0a4s6.js";
|
|
5
|
+
r("IconButton", () => {
|
|
6
|
+
a("renders with icon and accessible label", () => {
|
|
7
|
+
o(
|
|
8
|
+
/* @__PURE__ */ t(l, { icon: /* @__PURE__ */ t(c, { size: 21 }), srOnlyLabel: "Delete item" })
|
|
9
|
+
);
|
|
10
|
+
const e = n.getByRole("button", { name: /delete item/i });
|
|
11
|
+
s(e).toBeInTheDocument();
|
|
12
|
+
}), a("applies the correct size and intent classes", () => {
|
|
13
|
+
o(
|
|
14
|
+
/* @__PURE__ */ t(
|
|
15
|
+
l,
|
|
16
|
+
{
|
|
17
|
+
icon: /* @__PURE__ */ t(c, { size: 21 }),
|
|
18
|
+
size: "lg",
|
|
19
|
+
intent: "error",
|
|
20
|
+
className: "custom-class",
|
|
21
|
+
srOnlyLabel: "Delete item"
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
const e = n.getByRole("button", { name: /delete item/i });
|
|
26
|
+
s(e.className).toMatch("custom-class"), s(e.className).toMatch("iconButton"), s(e.className).toMatch("lg"), s(e.className).toMatch("error");
|
|
27
|
+
}), a("can be disabled", () => {
|
|
28
|
+
o(
|
|
29
|
+
/* @__PURE__ */ t(l, { icon: /* @__PURE__ */ t(c, { size: 21 }), disabled: !0, srOnlyLabel: "Disabled" })
|
|
30
|
+
);
|
|
31
|
+
const e = n.getByRole("button", { name: /disabled/i });
|
|
32
|
+
s(e.className).toBeDisabled;
|
|
33
|
+
}), a("calls onClick when clicked", () => {
|
|
34
|
+
const e = m.fn();
|
|
35
|
+
o(
|
|
36
|
+
/* @__PURE__ */ t(
|
|
37
|
+
l,
|
|
38
|
+
{
|
|
39
|
+
onClick: e,
|
|
40
|
+
icon: /* @__PURE__ */ t(c, { size: 21 }),
|
|
41
|
+
srOnlyLabel: "Click me"
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
const i = n.getByRole("button", { name: /click me/i });
|
|
46
|
+
b.click(i), s(e).toHaveBeenCalledTimes(1);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as a, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index14.css';const i = "_iconButton_e9jmu_1", j = "_sm_e9jmu_18", f = "_md_e9jmu_23", B = "_lg_e9jmu_28", x = "_muted_e9jmu_38", y = "_accent_e9jmu_43", $ = "_error_e9jmu_48", g = "_srOnly_e9jmu_53", t = {
|
|
3
|
+
iconButton: i,
|
|
4
|
+
sm: j,
|
|
5
|
+
md: f,
|
|
6
|
+
lg: B,
|
|
7
|
+
default: "_default_e9jmu_33",
|
|
8
|
+
muted: x,
|
|
9
|
+
accent: y,
|
|
10
|
+
error: $,
|
|
11
|
+
srOnly: g
|
|
12
|
+
};
|
|
13
|
+
function O({
|
|
14
|
+
icon: s,
|
|
15
|
+
size: e = "md",
|
|
16
|
+
intent: o = "default",
|
|
17
|
+
srOnlyLabel: n,
|
|
18
|
+
disabled: c = !1,
|
|
19
|
+
className: _,
|
|
20
|
+
...u
|
|
21
|
+
}) {
|
|
22
|
+
const m = t[e] ?? "", r = t[o] ?? "", l = n ? /* @__PURE__ */ d("span", { className: t.srOnly, children: n }) : null;
|
|
23
|
+
return /* @__PURE__ */ a(
|
|
24
|
+
"button",
|
|
25
|
+
{
|
|
26
|
+
className: `${_ ?? ""} ${t.iconButton} ${m} ${r}`,
|
|
27
|
+
disabled: c,
|
|
28
|
+
"aria-label": n,
|
|
29
|
+
...u,
|
|
30
|
+
children: [
|
|
31
|
+
s,
|
|
32
|
+
l
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
O as IconButton
|
|
39
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { d as m, i, r as t, g as e, s as a } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { Input as l } from "./index.js";
|
|
4
|
+
m("Input", () => {
|
|
5
|
+
i("renders an input with a label", () => {
|
|
6
|
+
t(/* @__PURE__ */ r(l, { label: "email", name: "email" })), e(a.getByLabelText("email")).toBeInTheDocument();
|
|
7
|
+
}), i("renders an error message if provided", () => {
|
|
8
|
+
t(/* @__PURE__ */ r(l, { label: "email", name: "email", error: "Required field" })), e(a.getByText("Required field")).toBeInTheDocument(), e(a.getByLabelText("email")).toHaveAttribute(
|
|
9
|
+
"aria-invalid",
|
|
10
|
+
"true"
|
|
11
|
+
);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -1,9 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Label as u } from "../Label/index.js";
|
|
4
|
+
import '../../assets/index21.css';const d = "_wrapper_1fwv5_1", l = "_input_1fwv5_7", w = "_error_1fwv5_25", f = "_errorMessage_1fwv5_29", e = {
|
|
5
|
+
wrapper: d,
|
|
6
|
+
input: l,
|
|
7
|
+
error: w,
|
|
8
|
+
errorMessage: f
|
|
9
|
+
};
|
|
10
|
+
function M({
|
|
11
|
+
label: t,
|
|
12
|
+
id: o,
|
|
13
|
+
className: a,
|
|
14
|
+
error: r,
|
|
15
|
+
required: p,
|
|
16
|
+
optional: c,
|
|
17
|
+
tooltip: _,
|
|
18
|
+
...s
|
|
19
|
+
}) {
|
|
20
|
+
const i = o ?? s.name ?? `input-${Math.random().toString(36).slice(2)}`;
|
|
21
|
+
return /* @__PURE__ */ m("div", { className: `${e.wrapper} ${a ?? ""}`, children: [
|
|
22
|
+
t && /* @__PURE__ */ n(
|
|
23
|
+
u,
|
|
24
|
+
{
|
|
25
|
+
htmlFor: i,
|
|
26
|
+
required: p,
|
|
27
|
+
optional: c,
|
|
28
|
+
intent: r ? "error" : "default",
|
|
29
|
+
tooltip: _,
|
|
30
|
+
showErrorIcon: !!r,
|
|
31
|
+
children: t
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ n(
|
|
35
|
+
"input",
|
|
36
|
+
{
|
|
37
|
+
id: i,
|
|
38
|
+
className: `${e.input} ${r ? e.error : ""}`,
|
|
39
|
+
"aria-invalid": !!r,
|
|
40
|
+
...s
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
r && /* @__PURE__ */ n("div", { className: e.errorMessage, children: r })
|
|
44
|
+
] });
|
|
6
45
|
}
|
|
7
46
|
export {
|
|
8
|
-
|
|
47
|
+
M as Input
|
|
9
48
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { d as s, i as o, r as n, g as e, s as r } from "../../index-BWTAh3RO.js";
|
|
3
|
+
import { Label as l } from "./index.js";
|
|
4
|
+
s("Label", () => {
|
|
5
|
+
o("renders label text", () => {
|
|
6
|
+
n(/* @__PURE__ */ t(l, { htmlFor: "username", children: "Username" })), e(r.getByText("Username")).toBeInTheDocument();
|
|
7
|
+
}), o("renders required asterisk when required", () => {
|
|
8
|
+
n(
|
|
9
|
+
/* @__PURE__ */ t(l, { htmlFor: "username", required: !0, children: "Email" })
|
|
10
|
+
), e(r.getByText("*")).toBeInTheDocument();
|
|
11
|
+
}), o("renders (optional) when optional", () => {
|
|
12
|
+
n(
|
|
13
|
+
/* @__PURE__ */ t(l, { htmlFor: "email", optional: !0, children: "Email" })
|
|
14
|
+
), e(r.getByText("(optional)")).toBeInTheDocument();
|
|
15
|
+
}), o("renders tooltip icon and text", () => {
|
|
16
|
+
n(
|
|
17
|
+
/* @__PURE__ */ t(l, { htmlFor: "email", tooltip: "Helpful tooltip info", children: "Email" })
|
|
18
|
+
), e(r.getByLabelText("Help")).toBeInTheDocument(), e(r.getByText("Helpful tooltip info")).toBeInTheDocument();
|
|
19
|
+
}), o("renders error icon when showErrorIcon is true", () => {
|
|
20
|
+
n(
|
|
21
|
+
/* @__PURE__ */ t(l, { htmlFor: "password", intent: "error", showErrorIcon: !0, children: "Password" })
|
|
22
|
+
), e(r.getByLabelText("Error")).toBeInTheDocument();
|
|
23
|
+
}), o("applies visually hidden class when srOnly is true", () => {
|
|
24
|
+
n(
|
|
25
|
+
/* @__PURE__ */ t(l, { htmlFor: "secret", size: "md", srOnly: !0, children: "Hidden Label" })
|
|
26
|
+
);
|
|
27
|
+
const i = r.getByText("Hidden Label").closest("label");
|
|
28
|
+
e(i == null ? void 0 : i.className).toMatch(/srOnly/);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
label: "label",
|
|
3
|
+
text: "text",
|
|
4
|
+
required: "required",
|
|
5
|
+
optional: "optional",
|
|
6
|
+
default: "default",
|
|
7
|
+
error: "error",
|
|
8
|
+
icon: "icon",
|
|
9
|
+
tooltipWrapper: "tooltipWrapper",
|
|
10
|
+
tooltipIcon: "tooltipIcon",
|
|
11
|
+
tooltipText: "tooltipText",
|
|
12
|
+
srOnly: "srOnly"
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
t as default
|
|
16
|
+
};
|
|
@@ -1,9 +1,97 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as a } from "../../createLucideIcon-C8GTh_Qx.js";
|
|
3
|
+
import '../../assets/index26.css';const b = "_label_15ngo_1", h = "_text_15ngo_6", N = "_sm_15ngo_13", k = "_md_15ngo_17", I = "_lg_15ngo_21", $ = "_muted_15ngo_30", O = "_accent_15ngo_34", q = "_disabled_15ngo_38", C = "_error_15ngo_42", T = "_required_15ngo_47", W = "_optional_15ngo_52", z = "_srOnly_15ngo_58", j = "_icon_15ngo_71", v = "_tooltipWrapper_15ngo_77", L = "_tooltipIcon_15ngo_83", M = "_tooltipText_15ngo_91", o = {
|
|
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
|
+
/**
|
|
23
|
+
* @license lucide-react v0.488.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/
|
|
28
|
+
const A = [
|
|
29
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
30
|
+
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
31
|
+
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
32
|
+
], E = a("circle-alert", A);
|
|
33
|
+
/**
|
|
34
|
+
* @license lucide-react v0.488.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/
|
|
39
|
+
const H = [
|
|
40
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
41
|
+
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
42
|
+
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
43
|
+
], w = a("info", H);
|
|
44
|
+
function F({
|
|
45
|
+
htmlFor: r,
|
|
46
|
+
size: i = "md",
|
|
47
|
+
intent: t = "default",
|
|
48
|
+
required: n = !1,
|
|
49
|
+
optional: _ = !1,
|
|
50
|
+
disabled: l = !1,
|
|
51
|
+
srOnly: p = !1,
|
|
52
|
+
tooltip: s,
|
|
53
|
+
showErrorIcon: d = !1,
|
|
54
|
+
className: m,
|
|
55
|
+
children: g,
|
|
56
|
+
...y
|
|
57
|
+
}) {
|
|
58
|
+
const x = o[i] ?? "", f = l ? o.disabled : o[t] ?? "", u = p ? o.srOnly : "";
|
|
59
|
+
return /* @__PURE__ */ e(
|
|
60
|
+
"label",
|
|
61
|
+
{
|
|
62
|
+
className: `${m ?? ""} ${o.label} ${x} ${f} ${u}`,
|
|
63
|
+
"aria-disabled": l || void 0,
|
|
64
|
+
...y,
|
|
65
|
+
htmlFor: r,
|
|
66
|
+
children: /* @__PURE__ */ c("span", { className: o.text, children: [
|
|
67
|
+
g,
|
|
68
|
+
n && /* @__PURE__ */ e("span", { className: o.required, children: " *" }),
|
|
69
|
+
!n && _ && /* @__PURE__ */ e("span", { className: o.optional, children: "(optional)" }),
|
|
70
|
+
t === "error" && d && /* @__PURE__ */ e(
|
|
71
|
+
E,
|
|
72
|
+
{
|
|
73
|
+
size: 16,
|
|
74
|
+
className: o.icon,
|
|
75
|
+
"aria-label": "Error",
|
|
76
|
+
role: "img"
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
s && /* @__PURE__ */ c("span", { className: o.tooltipWrapper, children: [
|
|
80
|
+
/* @__PURE__ */ e(
|
|
81
|
+
w,
|
|
82
|
+
{
|
|
83
|
+
size: 16,
|
|
84
|
+
className: o.tooltipIcon,
|
|
85
|
+
"aria-label": "Help",
|
|
86
|
+
role: "img"
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ e("span", { className: o.tooltipText, children: s })
|
|
90
|
+
] })
|
|
91
|
+
] })
|
|
92
|
+
}
|
|
93
|
+
);
|
|
6
94
|
}
|
|
7
95
|
export {
|
|
8
|
-
|
|
96
|
+
F as Label
|
|
9
97
|
};
|