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,45 @@
1
+ import { jsxs as d, jsx as l } from "react/jsx-runtime";
2
+ import "react";
3
+ import { Label as h } from "../Label/index.js";
4
+ import '../../assets/index10.css';const w = "_wrapper_a587t_1", x = "_select_a587t_7", p = {
5
+ wrapper: w,
6
+ select: x
7
+ };
8
+ function $({
9
+ id: r,
10
+ name: m,
11
+ label: s,
12
+ value: o,
13
+ options: i,
14
+ required: c = !1,
15
+ disabled: a = !1,
16
+ onChange: t,
17
+ className: n,
18
+ ...u
19
+ }) {
20
+ const f = (e) => {
21
+ const _ = Array.from(e.target.selectedOptions).map((v) => v.value);
22
+ t == null || t(_);
23
+ };
24
+ return /* @__PURE__ */ d("div", { className: `${p.wrapper} ${n ?? ""}`, children: [
25
+ s && /* @__PURE__ */ l(h, { htmlFor: r, required: c, disabled: a, children: s }),
26
+ /* @__PURE__ */ l(
27
+ "select",
28
+ {
29
+ id: r,
30
+ name: m,
31
+ multiple: !0,
32
+ value: o,
33
+ required: c,
34
+ disabled: a,
35
+ onChange: f,
36
+ className: p.select,
37
+ ...u,
38
+ children: i.map((e) => /* @__PURE__ */ l("option", { value: e.value, children: e.label }, e.value))
39
+ }
40
+ )
41
+ ] });
42
+ }
43
+ export {
44
+ $ as MultiSelect
45
+ };
@@ -0,0 +1,39 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { d as l, i, r as n, g as o, s as t, v as r } from "../../index-BWTAh3RO.js";
3
+ import { Radio as s } from "./index.js";
4
+ l("Radio", () => {
5
+ i("renders correctly", () => {
6
+ n(
7
+ /* @__PURE__ */ a(s, { id: "option1", name: "testOptions", value: "1", label: "Option 1" })
8
+ ), o(t.getByRole("radio")).toBeInTheDocument(), o(t.getByLabelText("Option 1")).toBeInTheDocument();
9
+ }), i("can be disabled", () => {
10
+ n(
11
+ /* @__PURE__ */ a(
12
+ s,
13
+ {
14
+ id: "option2",
15
+ name: "testOptions",
16
+ value: "2",
17
+ label: "Option 2",
18
+ disabled: !0
19
+ }
20
+ )
21
+ );
22
+ const e = t.getByRole("radio");
23
+ o(e).toBeDisabled();
24
+ }), i("fires onChange event", () => {
25
+ const e = r.fn();
26
+ n(
27
+ /* @__PURE__ */ a(
28
+ s,
29
+ {
30
+ id: "option3",
31
+ name: "testOptions",
32
+ value: "3",
33
+ label: "Option 3",
34
+ onChange: e
35
+ }
36
+ )
37
+ ), t.getByRole("radio").click(), o(e).toHaveBeenCalled();
38
+ });
39
+ });
@@ -0,0 +1,8 @@
1
+ const a = {
2
+ radioWrapper: "radioWrapper",
3
+ radio: "radio",
4
+ label: "label"
5
+ };
6
+ export {
7
+ a as default
8
+ };
@@ -0,0 +1,37 @@
1
+ import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
+ import { Label as _ } from "../Label/index.js";
3
+ import '../../assets/index9.css';const m = "_wrapper_1s0a7_1", d = "_radio_1s0a7_7", f = "_label_1s0a7_29", a = {
4
+ wrapper: m,
5
+ radio: d,
6
+ label: f
7
+ };
8
+ function h({
9
+ id: r,
10
+ name: o,
11
+ value: p,
12
+ label: t,
13
+ disabled: s = !1,
14
+ required: e = !1,
15
+ className: c,
16
+ ...i
17
+ }) {
18
+ return /* @__PURE__ */ n("div", { className: `${a.wrapper} ${c ?? ""}`, children: [
19
+ /* @__PURE__ */ l(
20
+ "input",
21
+ {
22
+ type: "radio",
23
+ id: r,
24
+ name: o,
25
+ value: p,
26
+ disabled: s,
27
+ required: e,
28
+ className: a.radio,
29
+ ...i
30
+ }
31
+ ),
32
+ /* @__PURE__ */ l(_, { htmlFor: r, disabled: s, required: e, className: a.label, children: t })
33
+ ] });
34
+ }
35
+ export {
36
+ h as Radio
37
+ };
@@ -0,0 +1,39 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { d as g, i as l, r as n, g as e, s as a, v as i, f as m } from "../../index-BWTAh3RO.js";
3
+ import { Range as s } from "./index.js";
4
+ g("Range", () => {
5
+ l("renders with a label and value", () => {
6
+ n(
7
+ /* @__PURE__ */ r(s, { label: "Volume", name: "volume", defaultValue: 30, min: 0, max: 100 })
8
+ ), e(a.getByLabelText("Volume")).toBeInTheDocument(), e(a.getByText("30")).toBeInTheDocument();
9
+ }), l("calls onChange when value changes", () => {
10
+ const t = i.fn();
11
+ n(
12
+ /* @__PURE__ */ r(
13
+ s,
14
+ {
15
+ label: "Progress",
16
+ name: "progress",
17
+ defaultValue: 30,
18
+ min: 0,
19
+ max: 100,
20
+ onValueChange: t
21
+ }
22
+ )
23
+ );
24
+ const o = a.getByLabelText("Progress");
25
+ m.change(o, { target: { value: "70" } }), e(t).toHaveBeenCalled();
26
+ }), l("shows error message if error prop is set", () => {
27
+ n(
28
+ /* @__PURE__ */ r(
29
+ s,
30
+ {
31
+ label: "Brightness",
32
+ name: "brightness",
33
+ defaultValue: 30,
34
+ error: "Required field"
35
+ }
36
+ )
37
+ ), e(a.getByText("Required field")).toBeInTheDocument();
38
+ });
39
+ });
@@ -0,0 +1,64 @@
1
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
+ import { useState as M, useEffect as $ } from "react";
3
+ import { Label as I } from "../Label/index.js";
4
+ import '../../assets/index8.css';const j = "_wrapper_7toxm_1", y = "_trackContainer_7toxm_7", E = "_track_7toxm_7", S = "_value_7toxm_44", b = "_error_7toxm_52", F = "_errorMessage_7toxm_56", s = {
5
+ wrapper: j,
6
+ trackContainer: y,
7
+ track: E,
8
+ value: S,
9
+ error: b,
10
+ errorMessage: F
11
+ };
12
+ function h({
13
+ label: i,
14
+ id: v,
15
+ value: c,
16
+ defaultValue: o,
17
+ onValueChange: r,
18
+ className: x,
19
+ error: t,
20
+ required: k,
21
+ optional: f,
22
+ tooltip: N,
23
+ ...a
24
+ }) {
25
+ const [u, m] = M(), n = c != null, _ = v ?? a.name ?? `slider-${Math.random().toString(36).slice(2)}`, l = n ? c : u;
26
+ return $(() => {
27
+ n || (r == null || r(o ?? 0), m(o));
28
+ }, [o]), /* @__PURE__ */ d("div", { className: `${s.wrapper} ${x ?? ""}`, children: [
29
+ i && /* @__PURE__ */ e(
30
+ I,
31
+ {
32
+ htmlFor: _,
33
+ required: k,
34
+ optional: f,
35
+ intent: t ? "error" : "default",
36
+ tooltip: N,
37
+ showErrorIcon: !!t,
38
+ children: i
39
+ }
40
+ ),
41
+ /* @__PURE__ */ d("div", { className: s.trackContainer, children: [
42
+ /* @__PURE__ */ e(
43
+ "input",
44
+ {
45
+ id: _,
46
+ type: "range",
47
+ className: `${s.track} ${t ? s.error : ""}`,
48
+ "aria-invalid": !!t,
49
+ value: l ?? 0,
50
+ onChange: (w) => {
51
+ const p = Number(w.target.value);
52
+ n || m(p), r == null || r(p);
53
+ },
54
+ ...a
55
+ }
56
+ ),
57
+ /* @__PURE__ */ e("span", { className: s.value, children: l })
58
+ ] }),
59
+ t && /* @__PURE__ */ e("div", { className: s.errorMessage, children: t })
60
+ ] });
61
+ }
62
+ export {
63
+ h as Range
64
+ };
@@ -0,0 +1,48 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { d as i, i as n, r as s, g as o, s as a, v as r, f as m } from "../../index-BWTAh3RO.js";
3
+ import { Select as c } from "./index.js";
4
+ i("Select", () => {
5
+ const t = [
6
+ { label: "Option A", value: "a" },
7
+ { label: "Option B", value: "b" },
8
+ { label: "Option C", value: "c" }
9
+ ];
10
+ n("renders label and options", () => {
11
+ s(
12
+ /* @__PURE__ */ l(c, { id: "select1", name: "test", label: "Choose", options: t })
13
+ ), o(a.getByLabelText("Choose")).toBeInTheDocument(), t.forEach(
14
+ ({ label: e }) => o(a.getByRole("option", { name: e })).toBeInTheDocument()
15
+ );
16
+ }), n("calls onChange handler", () => {
17
+ const e = r.fn();
18
+ s(
19
+ /* @__PURE__ */ l(
20
+ c,
21
+ {
22
+ id: "select2",
23
+ name: "test",
24
+ label: "Pick",
25
+ options: t,
26
+ onChange: e
27
+ }
28
+ )
29
+ );
30
+ const b = a.getByRole("combobox");
31
+ m.change(b, { target: { value: "b" } }), o(e).toHaveBeenCalled();
32
+ }), n("respects default value", () => {
33
+ s(
34
+ /* @__PURE__ */ l(
35
+ c,
36
+ {
37
+ id: "select3",
38
+ name: "test",
39
+ label: "Choose",
40
+ options: t,
41
+ defaultValue: "b"
42
+ }
43
+ )
44
+ );
45
+ const e = a.getByRole("combobox");
46
+ o(e.value).toBe("b");
47
+ });
48
+ });
@@ -0,0 +1,43 @@
1
+ import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
+ import "react";
3
+ import { Label as d } from "../Label/index.js";
4
+ import '../../assets/index7.css';const _ = "_wrapper_3s7ns_1", f = "_select_3s7ns_7", a = {
5
+ wrapper: _,
6
+ select: f
7
+ };
8
+ function j({
9
+ id: s,
10
+ name: o,
11
+ label: r,
12
+ options: p,
13
+ defaultValue: i,
14
+ required: t = !1,
15
+ disabled: c = !1,
16
+ onChange: m,
17
+ className: h,
18
+ ...u
19
+ }) {
20
+ return /* @__PURE__ */ n("div", { className: `${a.wrapper} ${h ?? ""}`, children: [
21
+ r && /* @__PURE__ */ l(d, { htmlFor: s, required: t, disabled: c, children: r }),
22
+ /* @__PURE__ */ n(
23
+ "select",
24
+ {
25
+ id: s,
26
+ name: o,
27
+ defaultValue: i,
28
+ required: t,
29
+ disabled: c,
30
+ onChange: m,
31
+ className: a.select,
32
+ ...u,
33
+ children: [
34
+ /* @__PURE__ */ l("option", { value: "", disabled: !0, hidden: !0, children: "-- Select an option --" }),
35
+ p.map((e) => /* @__PURE__ */ l("option", { value: e.value, children: e.label }, e.value))
36
+ ]
37
+ }
38
+ )
39
+ ] });
40
+ }
41
+ export {
42
+ j as Select
43
+ };
@@ -0,0 +1,22 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { d as i, i as e, r as a, g as t } from "../../index-BWTAh3RO.js";
3
+ import { Spacer as c } from "./index.js";
4
+ i("Spacer", () => {
5
+ e("renders with default props", () => {
6
+ const { container: s } = a(/* @__PURE__ */ r(c, {}));
7
+ t(s.firstChild).toHaveClass("md", "horizontal", "spacer");
8
+ }), e("renders the correct classes", () => {
9
+ const { container: s } = a(/* @__PURE__ */ r(c, { axis: "vertical", size: "xl" }));
10
+ t(s.firstChild).toHaveClass("xl", "vertical", "spacer");
11
+ }), e("renders custom classes", () => {
12
+ const { container: s } = a(
13
+ /* @__PURE__ */ r(c, { className: "custom-class", axis: "vertical", size: "xl" })
14
+ );
15
+ t(s.firstChild).toHaveClass(
16
+ "custom-class",
17
+ "xl",
18
+ "vertical",
19
+ "spacer"
20
+ );
21
+ });
22
+ });
@@ -0,0 +1,12 @@
1
+ const l = {
2
+ spacer: "spacer",
3
+ sm: "sm",
4
+ md: "md",
5
+ lg: "lg",
6
+ xl: "xl",
7
+ horizontal: "horizontal",
8
+ vertical: "vertical"
9
+ };
10
+ export {
11
+ l as default
12
+ };
@@ -0,0 +1,29 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import '../../assets/index6.css';const r = "_spacer_1pz5u_1", _ = "_horizontal_1pz5u_6", n = "_vertical_1pz5u_11", i = "_sm_1pz5u_16", p = "_md_1pz5u_21", e = "_lg_1pz5u_26", m = "_xl_1pz5u_31", s = {
3
+ spacer: r,
4
+ horizontal: _,
5
+ vertical: n,
6
+ sm: i,
7
+ md: p,
8
+ lg: e,
9
+ xl: m
10
+ }, z = {
11
+ sm: s.sm,
12
+ md: s.md,
13
+ lg: s.lg,
14
+ xl: s.xl
15
+ }, u = {
16
+ horizontal: s.horizontal,
17
+ vertical: s.vertical
18
+ };
19
+ function d({
20
+ size: o = "md",
21
+ axis: t = "horizontal",
22
+ className: l,
23
+ ...a
24
+ }) {
25
+ return /* @__PURE__ */ c("div", { className: `${s.spacer} ${z[o]} ${u[t]} ${l ?? ""}`, ...a });
26
+ }
27
+ export {
28
+ d as Spacer
29
+ };
@@ -0,0 +1,60 @@
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { d as l, i as s, r as n, g as t, s as d } from "../../index-BWTAh3RO.js";
3
+ import { Stack as a } from "./index.js";
4
+ l("Stack", () => {
5
+ s("renders children", () => {
6
+ n(
7
+ /* @__PURE__ */ r(a, { children: [
8
+ /* @__PURE__ */ e("div", { children: "Item 1" }),
9
+ /* @__PURE__ */ e("div", { children: "Item 2" })
10
+ ] })
11
+ ), t(d.getByText("Item 1")).toBeInTheDocument(), t(d.getByText("Item 2")).toBeInTheDocument();
12
+ }), s("renders with default props", () => {
13
+ const { container: i } = n(
14
+ /* @__PURE__ */ r(a, { children: [
15
+ /* @__PURE__ */ e("div", { children: "Item 1" }),
16
+ /* @__PURE__ */ e("div", { children: "Item 2" })
17
+ ] })
18
+ );
19
+ t(i.firstChild).toHaveClass(
20
+ "stack",
21
+ "vertical",
22
+ "gapMd",
23
+ "alignStretch",
24
+ "justifyStart"
25
+ );
26
+ }), s("applies direction classes", () => {
27
+ const { container: i } = n(
28
+ /* @__PURE__ */ r(a, { direction: "horizontal", children: [
29
+ /* @__PURE__ */ e("div", { children: "Item 1" }),
30
+ /* @__PURE__ */ e("div", { children: "Item 2" })
31
+ ] })
32
+ );
33
+ t(i.firstChild).toHaveClass("horizontal");
34
+ }), s("applies align and justify classes", () => {
35
+ const { container: i } = n(
36
+ /* @__PURE__ */ r(a, { align: "center", justify: "space-between", children: [
37
+ /* @__PURE__ */ e("div", { children: "Item 1" }),
38
+ /* @__PURE__ */ e("div", { children: "Item 2" })
39
+ ] })
40
+ );
41
+ t(i.firstChild).toHaveClass("alignCenter"), t(i.firstChild).toHaveClass("justifySpaceBetween");
42
+ }), s("applies gap classes", () => {
43
+ const { container: i } = n(
44
+ /* @__PURE__ */ r(a, { gap: "lg", children: [
45
+ /* @__PURE__ */ e("div", { children: "Item 1" }),
46
+ /* @__PURE__ */ e("div", { children: "Item 2" })
47
+ ] })
48
+ );
49
+ t(i.firstChild).toHaveClass("gapLg");
50
+ }), s("respects the 'as' prop", () => {
51
+ var c;
52
+ const { container: i } = n(
53
+ /* @__PURE__ */ r(a, { as: "ul", children: [
54
+ /* @__PURE__ */ e("div", { children: "Item 1" }),
55
+ /* @__PURE__ */ e("div", { children: "Item 2" })
56
+ ] })
57
+ );
58
+ t((c = i.firstChild) == null ? void 0 : c.nodeName).toBe("UL");
59
+ });
60
+ });
@@ -0,0 +1,21 @@
1
+ const t = {
2
+ stack: "stack",
3
+ vertical: "vertical",
4
+ horizontal: "horizontal",
5
+ gapSm: "gapSm",
6
+ gapMd: "gapMd",
7
+ gapLg: "gapLg",
8
+ alignStart: "alignStart",
9
+ alignCenter: "alignCenter",
10
+ alignEnd: "alignEnd",
11
+ alignStretch: "alignStretch",
12
+ justifyStart: "justifyStart",
13
+ justifyCenter: "justifyCenter",
14
+ justifyEnd: "justifyEnd",
15
+ justifySpaceBetween: "justifySpaceBetween",
16
+ justifySpaceAround: "justifySpaceAround",
17
+ justifySpaceEvenly: "justifySpaceEvenly"
18
+ };
19
+ export {
20
+ t as default
21
+ };
@@ -0,0 +1,65 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import '../../assets/index5.css';const g = "_stack_134u6_1", y = "_vertical_134u6_5", f = "_horizontal_134u6_9", S = "_wrap_134u6_13", j = "_gapSm_134u6_18", d = "_gapMd_134u6_22", v = "_gapLg_134u6_26", C = "_alignStart_134u6_31", E = "_alignCenter_134u6_35", h = "_alignEnd_134u6_39", m = "_alignStretch_134u6_43", w = "_justifyStart_134u6_48", M = "_justifyCenter_134u6_52", k = "_justifyEnd_134u6_56", z = "_justifySpaceBetween_134u6_60", B = "_justifySpaceAround_134u6_64", A = "_justifySpaceEvenly_134u6_68", t = {
3
+ stack: g,
4
+ vertical: y,
5
+ horizontal: f,
6
+ wrap: S,
7
+ gapSm: j,
8
+ gapMd: d,
9
+ gapLg: v,
10
+ alignStart: C,
11
+ alignCenter: E,
12
+ alignEnd: h,
13
+ alignStretch: m,
14
+ justifyStart: w,
15
+ justifyCenter: M,
16
+ justifyEnd: k,
17
+ justifySpaceBetween: z,
18
+ justifySpaceAround: B,
19
+ justifySpaceEvenly: A
20
+ }, L = {
21
+ stack: t.stack,
22
+ vertical: t.vertical,
23
+ horizontal: t.horizontal
24
+ }, x = {
25
+ sm: t.gapSm,
26
+ md: t.gapMd,
27
+ lg: t.gapLg
28
+ }, b = {
29
+ start: t.alignStart,
30
+ center: t.alignCenter,
31
+ end: t.alignEnd,
32
+ stretch: t.alignStretch
33
+ }, N = {
34
+ start: t.justifyStart,
35
+ center: t.justifyCenter,
36
+ end: t.justifyEnd,
37
+ "space-between": t.justifySpaceBetween,
38
+ "space-around": t.justifySpaceAround,
39
+ "space-evenly": t.justifySpaceEvenly
40
+ };
41
+ function q({
42
+ direction: a = "vertical",
43
+ gap: n = "md",
44
+ align: s = "stretch",
45
+ justify: e = "start",
46
+ wrap: c = !1,
47
+ as: i = "div",
48
+ className: r,
49
+ children: _,
50
+ ...u
51
+ }) {
52
+ const o = i, l = [
53
+ t.stack,
54
+ L[a],
55
+ x[n],
56
+ b[s],
57
+ N[e],
58
+ c ? t.wrap : "",
59
+ r ?? ""
60
+ ].filter(Boolean).join(" ");
61
+ return /* @__PURE__ */ p(o, { className: l, ...u, children: _ });
62
+ }
63
+ export {
64
+ q as Stack
65
+ };
@@ -0,0 +1,48 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { d as h, i as a, r as s, g as n, s as c, v as i, f as g } from "../../index-BWTAh3RO.js";
3
+ import { Switch as l } from "./index.js";
4
+ h("Switch", () => {
5
+ a("renders with label", () => {
6
+ s(
7
+ /* @__PURE__ */ e(
8
+ l,
9
+ {
10
+ name: "switch1",
11
+ checked: !1,
12
+ onChange: () => {
13
+ },
14
+ label: "Toggle 1"
15
+ }
16
+ )
17
+ ), n(c.getByText("Toggle 1")).toBeInTheDocument();
18
+ }), a("fires onChange when toggled", () => {
19
+ const o = i.fn();
20
+ s(
21
+ /* @__PURE__ */ e(
22
+ l,
23
+ {
24
+ name: "switch2",
25
+ checked: !1,
26
+ onChange: o,
27
+ label: "Toggle 2"
28
+ }
29
+ )
30
+ );
31
+ const t = c.getByRole("checkbox");
32
+ g.click(t), n(o).toBeCalled();
33
+ }), a("is disabled when passed disabled prop", () => {
34
+ s(
35
+ /* @__PURE__ */ e(
36
+ l,
37
+ {
38
+ name: "switch3",
39
+ checked: !1,
40
+ onChange: () => {
41
+ },
42
+ label: "Toggle 3",
43
+ disabled: !0
44
+ }
45
+ )
46
+ );
47
+ });
48
+ });
@@ -0,0 +1,57 @@
1
+ import { jsx as e, jsxs as h } from "react/jsx-runtime";
2
+ import "react";
3
+ import { Label as u } from "../Label/index.js";
4
+ import '../../assets/index4.css';const d = "_wrapper_fzy93_1", y = "_input_fzy93_7", w = "_slider_fzy93_11", b = "_label_fzy93_41", s = {
5
+ wrapper: d,
6
+ input: y,
7
+ slider: w,
8
+ label: b
9
+ };
10
+ function k({
11
+ id: r,
12
+ name: a,
13
+ checked: x,
14
+ disabled: l = !1,
15
+ label: t,
16
+ required: p,
17
+ optional: c,
18
+ intent: n = "default",
19
+ size: i,
20
+ tooltip: o,
21
+ showErrorIcon: _,
22
+ className: m,
23
+ ...f
24
+ }) {
25
+ return /* @__PURE__ */ e("div", { className: `${s.wrapper} ${m ?? ""}`, children: /* @__PURE__ */ h(
26
+ u,
27
+ {
28
+ htmlFor: r,
29
+ intent: n,
30
+ size: i,
31
+ required: p,
32
+ optional: c,
33
+ disabled: l,
34
+ tooltip: o,
35
+ showErrorIcon: _,
36
+ children: [
37
+ /* @__PURE__ */ e(
38
+ "input",
39
+ {
40
+ type: "checkbox",
41
+ id: r,
42
+ name: a,
43
+ disabled: l,
44
+ required: p,
45
+ className: s.input,
46
+ ...f
47
+ }
48
+ ),
49
+ /* @__PURE__ */ e("span", { className: s.slider }),
50
+ t && /* @__PURE__ */ e("span", { className: s.label, children: t })
51
+ ]
52
+ }
53
+ ) });
54
+ }
55
+ export {
56
+ k as Switch
57
+ };
@@ -0,0 +1,31 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { d as g, i as n, r as a, g as e, s as t, v as i, f as h } from "../../index-BWTAh3RO.js";
3
+ import { Table as c } from "./index.js";
4
+ const s = [
5
+ { name: "Alice", age: 30 },
6
+ { name: "Bob", age: 33 }
7
+ ], l = [
8
+ { header: "Name", accessor: "name" },
9
+ { header: "Age", accessor: "age" }
10
+ ];
11
+ g("Table", () => {
12
+ n("renders headers and rows", () => {
13
+ a(/* @__PURE__ */ o(c, { data: s, columns: l })), e(t.getByText("Name")).toBeInTheDocument(), e(t.getByText("Age")).toBeInTheDocument(), e(t.getByText("Alice")).toBeInTheDocument(), e(t.getByText("30")).toBeInTheDocument(), e(t.getByText("Bob")).toBeInTheDocument(), e(t.getByText("33")).toBeInTheDocument();
14
+ }), n("renders custom cell content with cellRenderer", () => {
15
+ a(/* @__PURE__ */ o(c, { data: s, columns: [
16
+ {
17
+ header: "Name",
18
+ accessor: "name",
19
+ cellRenderer: (m) => /* @__PURE__ */ o("strong", { children: m })
20
+ },
21
+ { header: "Age", accessor: "age" }
22
+ ] })), e(t.getByText("Alice").tagName).toBe("STRONG");
23
+ }), n("renders empty message when no data", () => {
24
+ a(/* @__PURE__ */ o(c, { data: [], columns: l, emptyMessage: "Nothing here!" })), e(t.getByText("Nothing here!")).toBeInTheDocument();
25
+ }), n("calls onRowClick when a row is clicked", () => {
26
+ const r = i.fn();
27
+ a(/* @__PURE__ */ o(c, { data: s, columns: l, onRowClick: r }));
28
+ const m = t.getByText("Alice").closest("tr");
29
+ h.click(m), e(r).toHaveBeenCalledWith(s[0]);
30
+ });
31
+ });