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.
Files changed (211) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index.css.d.ts +7 -0
  3. package/dist/assets/index10.css +1 -0
  4. package/dist/assets/index10.css.d.ts +6 -0
  5. package/dist/assets/index11.css +1 -0
  6. package/dist/assets/index11.css.d.ts +7 -0
  7. package/dist/assets/index12.css +1 -0
  8. package/dist/assets/index12.css.d.ts +13 -0
  9. package/dist/assets/index13.css +1 -0
  10. package/dist/assets/index13.css.d.ts +8 -0
  11. package/dist/assets/index14.css +1 -0
  12. package/dist/assets/index14.css.d.ts +13 -0
  13. package/dist/assets/index15.css +1 -0
  14. package/dist/assets/index15.css.d.ts +10 -0
  15. package/dist/assets/index16.css +1 -0
  16. package/dist/assets/index16.css.d.ts +8 -0
  17. package/dist/assets/index17.css +1 -0
  18. package/dist/assets/index17.css.d.ts +11 -0
  19. package/dist/assets/index18.css +1 -0
  20. package/dist/assets/index18.css.d.ts +31 -0
  21. package/dist/assets/index19.css +1 -0
  22. package/dist/assets/index19.css.d.ts +7 -0
  23. package/dist/assets/index2.css +1 -1
  24. package/dist/assets/index2.css.d.ts +9 -0
  25. package/dist/assets/index20.css +1 -0
  26. package/dist/assets/index20.css.d.ts +5 -0
  27. package/dist/assets/index21.css +1 -0
  28. package/dist/assets/index21.css.d.ts +8 -0
  29. package/dist/assets/index22.css +1 -0
  30. package/dist/assets/index22.css.d.ts +6 -0
  31. package/dist/assets/index23.css +1 -0
  32. package/dist/assets/index23.css.d.ts +7 -0
  33. package/dist/assets/index24.css +1 -0
  34. package/dist/assets/index24.css.d.ts +7 -0
  35. package/dist/assets/index25.css +1 -0
  36. package/dist/assets/index25.css.d.ts +9 -0
  37. package/dist/assets/index26.css +1 -0
  38. package/dist/assets/index26.css.d.ts +21 -0
  39. package/dist/assets/index27.css +1 -0
  40. package/dist/assets/index27.css.d.ts +9 -0
  41. package/dist/assets/index28.css +1 -0
  42. package/dist/assets/index28.css.d.ts +12 -0
  43. package/dist/assets/index3.css +1 -1
  44. package/dist/assets/index3.css.d.ts +8 -0
  45. package/dist/assets/index4.css +1 -1
  46. package/dist/assets/index4.css.d.ts +8 -0
  47. package/dist/assets/index5.css +1 -0
  48. package/dist/assets/index5.css.d.ts +21 -0
  49. package/dist/assets/index6.css +1 -0
  50. package/dist/assets/index6.css.d.ts +11 -0
  51. package/dist/assets/index7.css +1 -0
  52. package/dist/assets/index7.css.d.ts +6 -0
  53. package/dist/assets/index8.css +1 -0
  54. package/dist/assets/index8.css.d.ts +10 -0
  55. package/dist/assets/index9.css +1 -0
  56. package/dist/assets/index9.css.d.ts +7 -0
  57. package/dist/components/Box/Box.test.js +20 -0
  58. package/dist/components/Box/__mocks__/styles.module.css.js +20 -0
  59. package/dist/components/Box/index.js +89 -0
  60. package/dist/components/Button/Button.test.js +33 -0
  61. package/dist/components/Button/__mocks__/styles.module.css.js +9 -0
  62. package/dist/components/Button/index.js +17 -7
  63. package/dist/components/ButtonGroup/ButtonGroup.test.js +37 -0
  64. package/dist/components/ButtonGroup/__mocks__/styles.module.css.js +7 -0
  65. package/dist/components/ButtonGroup/index.js +26 -0
  66. package/dist/components/Calendar/Calendar.test.js +40 -0
  67. package/dist/components/Calendar/index.js +7 -0
  68. package/dist/components/Checkbox/Checkbox.test.js +37 -0
  69. package/dist/components/Checkbox/__mocks__/styles.module.css.js +8 -0
  70. package/dist/components/Checkbox/index.js +45 -0
  71. package/dist/components/Container/Container.test.js +25 -0
  72. package/dist/components/Container/__mocks__/styles.module.css.js +11 -0
  73. package/dist/components/Container/index.js +31 -0
  74. package/dist/components/DatePicker/DatePicker.test.js +42 -0
  75. package/dist/components/DatePicker/index.js +56 -0
  76. package/dist/components/Divider/Divider.test.js +21 -0
  77. package/dist/components/Divider/__mocks__/styles.module.css.js +8 -0
  78. package/dist/components/Divider/index.js +19 -0
  79. package/dist/components/Fieldset/Fieldset.test.js +12 -0
  80. package/dist/components/Fieldset/index.js +19 -0
  81. package/dist/components/FileUpload/FileUpload.test.js +33 -0
  82. package/dist/components/FileUpload/index.js +99 -0
  83. package/dist/components/FloatingActionButton/FloatingActionButton.test.js +36 -0
  84. package/dist/components/FloatingActionButton/__mocks__/styles.module.css.js +9 -0
  85. package/dist/components/FloatingActionButton/index.js +40 -0
  86. package/dist/components/Form/Form.test.js +20 -0
  87. package/dist/components/Form/index.js +29 -0
  88. package/dist/components/Grid/Grid.test.js +59 -0
  89. package/dist/components/Grid/index.js +32 -0
  90. package/dist/components/Heading/Heading.test.js +26 -0
  91. package/dist/components/Heading/__mocks__/styles.module.css.js +11 -0
  92. package/dist/components/Heading/index.js +20 -7
  93. package/dist/components/IconButton/IconButton.test.js +48 -0
  94. package/dist/components/IconButton/__mocks__/styles.module.css.js +12 -0
  95. package/dist/components/IconButton/index.js +39 -0
  96. package/dist/components/Input/Input.test.js +13 -0
  97. package/dist/components/Input/__mocks__/styles.module.css.js +9 -0
  98. package/dist/components/Input/index.js +45 -6
  99. package/dist/components/Label/Label.test.js +30 -0
  100. package/dist/components/Label/__mocks__/styles.module.css.js +16 -0
  101. package/dist/components/Label/index.js +94 -6
  102. package/dist/components/Link/Link.test.js +32 -0
  103. package/dist/components/Link/__mocks__/styles.module.css.js +8 -0
  104. package/dist/components/Link/index.js +5 -0
  105. package/dist/components/MultiSelect/MultiSelect.test.js +3144 -0
  106. package/dist/components/MultiSelect/index.js +45 -0
  107. package/dist/components/Radio/Radio.test.js +39 -0
  108. package/dist/components/Radio/__mocks__/styles.module.css.js +8 -0
  109. package/dist/components/Radio/index.js +37 -0
  110. package/dist/components/Range/Range.test.js +39 -0
  111. package/dist/components/Range/index.js +64 -0
  112. package/dist/components/Select/Select.test.js +48 -0
  113. package/dist/components/Select/index.js +43 -0
  114. package/dist/components/Spacer/Spacer.test.js +22 -0
  115. package/dist/components/Spacer/__mocks__/styles.module.css.js +12 -0
  116. package/dist/components/Spacer/index.js +29 -0
  117. package/dist/components/Stack/Stack.test.js +60 -0
  118. package/dist/components/Stack/__mocks__/styles.module.css.js +21 -0
  119. package/dist/components/Stack/index.js +65 -0
  120. package/dist/components/Switch/Switch.test.js +48 -0
  121. package/dist/components/Switch/index.js +57 -0
  122. package/dist/components/Table/Table.test.js +31 -0
  123. package/dist/components/Table/index.js +31 -0
  124. package/dist/components/Text/Text.test.js +65 -0
  125. package/dist/components/Text/__mocks__/styles.module.css.js +9 -0
  126. package/dist/components/Text/index.js +50 -0
  127. package/dist/components/Textarea/Textarea.test.js +37 -0
  128. package/dist/components/Textarea/index.js +47 -0
  129. package/dist/createLucideIcon-C8GTh_Qx.js +89 -0
  130. package/dist/index-BWTAh3RO.js +57529 -0
  131. package/dist/index-BtY6pil2.js +1621 -0
  132. package/dist/index-DhqFdMqD.js +1416 -0
  133. package/dist/lib/components/Box/Box.test.d.ts +0 -0
  134. package/dist/lib/components/Box/__mocks__/styles.module.css.d.ts +18 -0
  135. package/dist/lib/components/Box/index.d.ts +59 -0
  136. package/dist/lib/components/Button/Button.test.d.ts +0 -0
  137. package/dist/lib/components/Button/__mocks__/styles.module.css.d.ts +7 -0
  138. package/dist/lib/components/Button/index.d.ts +11 -1
  139. package/dist/lib/components/ButtonGroup/ButtonGroup.test.d.ts +0 -0
  140. package/dist/lib/components/ButtonGroup/__mocks__/styles.module.css.d.ts +5 -0
  141. package/dist/lib/components/ButtonGroup/index.d.ts +8 -0
  142. package/dist/lib/components/Calendar/Calendar.test.d.ts +0 -0
  143. package/dist/lib/components/Calendar/index.d.ts +6 -0
  144. package/dist/lib/components/Checkbox/Checkbox.test.d.ts +0 -0
  145. package/dist/lib/components/Checkbox/__mocks__/styles.module.css.d.ts +6 -0
  146. package/dist/lib/components/Checkbox/index.d.ts +10 -0
  147. package/dist/lib/components/Container/Container.test.d.ts +0 -0
  148. package/dist/lib/components/Container/__mocks__/styles.module.css.d.ts +9 -0
  149. package/dist/lib/components/Container/index.d.ts +20 -0
  150. package/dist/lib/components/DatePicker/DatePicker.test.d.ts +0 -0
  151. package/dist/lib/components/DatePicker/index.d.ts +13 -0
  152. package/dist/lib/components/Divider/Divider.test.d.ts +0 -0
  153. package/dist/lib/components/Divider/__mocks__/styles.module.css.d.ts +6 -0
  154. package/dist/lib/components/Divider/index.d.ts +12 -0
  155. package/dist/lib/components/Fieldset/Fieldset.test.d.ts +0 -0
  156. package/dist/lib/components/Fieldset/index.d.ts +7 -0
  157. package/dist/lib/components/FileUpload/FileUpload.test.d.ts +0 -0
  158. package/dist/lib/components/FileUpload/index.d.ts +13 -0
  159. package/dist/lib/components/FloatingActionButton/FloatingActionButton.test.d.ts +0 -0
  160. package/dist/lib/components/FloatingActionButton/__mocks__/styles.module.css.d.ts +7 -0
  161. package/dist/lib/components/FloatingActionButton/index.d.ts +18 -0
  162. package/dist/lib/components/Form/Form.test.d.ts +0 -0
  163. package/dist/lib/components/Form/index.d.ts +12 -0
  164. package/dist/lib/components/Grid/Grid.test.d.ts +0 -0
  165. package/dist/lib/components/Grid/index.d.ts +11 -0
  166. package/dist/lib/components/Heading/Heading.test.d.ts +0 -0
  167. package/dist/lib/components/Heading/__mocks__/styles.module.css.d.ts +9 -0
  168. package/dist/lib/components/Heading/index.d.ts +291 -1
  169. package/dist/lib/components/IconButton/IconButton.test.d.ts +0 -0
  170. package/dist/lib/components/IconButton/__mocks__/styles.module.css.d.ts +10 -0
  171. package/dist/lib/components/IconButton/index.d.ts +24 -0
  172. package/dist/lib/components/Input/Input.test.d.ts +0 -0
  173. package/dist/lib/components/Input/__mocks__/styles.module.css.d.ts +7 -0
  174. package/dist/lib/components/Input/index.d.ts +10 -1
  175. package/dist/lib/components/Label/Label.test.d.ts +0 -0
  176. package/dist/lib/components/Label/__mocks__/styles.module.css.d.ts +14 -0
  177. package/dist/lib/components/Label/index.d.ts +29 -1
  178. package/dist/lib/components/Link/Link.test.d.ts +0 -0
  179. package/dist/lib/components/Link/__mocks__/styles.module.css.d.ts +6 -0
  180. package/dist/lib/components/Link/index.d.ts +18 -0
  181. package/dist/lib/components/MultiSelect/MultiSelect.test.d.ts +0 -0
  182. package/dist/lib/components/MultiSelect/index.d.ts +17 -0
  183. package/dist/lib/components/Radio/Radio.test.d.ts +0 -0
  184. package/dist/lib/components/Radio/__mocks__/styles.module.css.d.ts +6 -0
  185. package/dist/lib/components/Radio/index.d.ts +12 -0
  186. package/dist/lib/components/Range/Range.test.d.ts +0 -0
  187. package/dist/lib/components/Range/index.d.ts +15 -0
  188. package/dist/lib/components/Select/Select.test.d.ts +0 -0
  189. package/dist/lib/components/Select/index.d.ts +18 -0
  190. package/dist/lib/components/Spacer/Spacer.test.d.ts +0 -0
  191. package/dist/lib/components/Spacer/__mocks__/styles.module.css.d.ts +10 -0
  192. package/dist/lib/components/Spacer/index.d.ts +20 -0
  193. package/dist/lib/components/Stack/Stack.test.d.ts +0 -0
  194. package/dist/lib/components/Stack/__mocks__/styles.module.css.d.ts +19 -0
  195. package/dist/lib/components/Stack/index.d.ts +42 -0
  196. package/dist/lib/components/Switch/Switch.test.d.ts +0 -0
  197. package/dist/lib/components/Switch/index.d.ts +18 -0
  198. package/dist/lib/components/Table/Table.test.d.ts +0 -0
  199. package/dist/lib/components/Table/index.d.ts +15 -0
  200. package/dist/lib/components/Text/Text.test.d.ts +0 -0
  201. package/dist/lib/components/Text/__mocks__/styles.module.css.d.ts +7 -0
  202. package/dist/lib/components/Text/index.d.ts +17 -0
  203. package/dist/lib/components/Textarea/Textarea.test.d.ts +0 -0
  204. package/dist/lib/components/Textarea/index.d.ts +13 -0
  205. package/dist/lib/main.d.ts +26 -1
  206. package/dist/lib/utils/renderRichText.d.ts +25 -0
  207. package/dist/magic-string.es-D4UQQyt0.js +859 -0
  208. package/dist/main.js +54 -6
  209. package/dist/trash-2-2Rn0a4s6.js +17 -0
  210. package/dist/utils/renderRichText.js +26 -0
  211. 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,9 @@
1
+ const s = {
2
+ sm: "sm",
3
+ md: "md",
4
+ lg: "lg",
5
+ disabled: "disabled"
6
+ };
7
+ export {
8
+ s as default
9
+ };
@@ -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
+ });
@@ -0,0 +1,11 @@
1
+ const h = {
2
+ h1: "style-h1",
3
+ h2: "style-h2",
4
+ h3: "style-h3",
5
+ h4: "style-h4",
6
+ h5: "style-h5",
7
+ h6: "style-h6"
8
+ };
9
+ export {
10
+ h as default
11
+ };
@@ -1,12 +1,25 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import '../../assets/index3.css';const o = "_heading_12n5i_13";
3
- function r({
4
- className: n,
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
- ...e
14
+ ..._
7
15
  }) {
8
- return /* @__PURE__ */ i("button", { className: `${n ?? ""} ${o}`, ...e, children: t });
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
- r as Heading
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,12 @@
1
+ const e = {
2
+ sm: "sm",
3
+ md: "md",
4
+ lg: "lg",
5
+ default: "default",
6
+ muted: "muted",
7
+ accent: "accent",
8
+ error: "error"
9
+ };
10
+ export {
11
+ e as default
12
+ };
@@ -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
+ });
@@ -0,0 +1,9 @@
1
+ const r = {
2
+ wrapper: "wrapper",
3
+ input: "input",
4
+ error: "error",
5
+ errorMessage: "errorMessage"
6
+ };
7
+ export {
8
+ r as default
9
+ };
@@ -1,9 +1,48 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import '../../assets/index2.css';const p = "_input_zg0ml_1";
3
- function u(t) {
4
- const { className: n, ...s } = t;
5
- return /* @__PURE__ */ o("input", { className: `${n} ${p}`, ...s });
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
- u as Input
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 a } from "react/jsx-runtime";
2
- import '../../assets/index.css';const o = "_label_bm5f3_1";
3
- function t(e) {
4
- const { className: l, ...s } = e;
5
- return /* @__PURE__ */ a("label", { className: `${l} ${o}`, ...s });
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
- t as Label
96
+ F as Label
9
97
  };