@adgytec/adgytec-web-ui-components 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{Disclosure-D79gqK4z.js → Disclosure-VEgfonAa.js} +1 -1
  2. package/dist/{DisclousreGroup-BSUcVzWX.js → DisclousreGroup-DEhMBMtj.js} +1 -1
  3. package/dist/{FieldError-CZn24fiL.js → FieldError-a_f080R9.js} +3 -3
  4. package/dist/Form-BrgsgT93.js +53 -0
  5. package/dist/Input-CcFMJrOW.js +33 -0
  6. package/dist/{MenuButton-BEwnL_jL.js → MenuButton-CAzQcvOm.js} +1 -1
  7. package/dist/{MenuLabel-ClmuA9_6.js → MenuLabel-B7jC7YwF.js} +8 -8
  8. package/dist/{NavigationMenu-DTqKWY2F.js → NavigationMenu-DNsB0lr1.js} +11 -11
  9. package/dist/{NavigationResponsive-BPybSnJ4.js → NavigationResponsive-D6d2f-k_.js} +2 -2
  10. package/dist/{NavigationSidebar-ByWsLISI.js → NavigationSidebar-CZEPGghA.js} +10 -10
  11. package/dist/Select-uiw8JPDT.js +85 -0
  12. package/dist/{TextArea-DBZO5z2H.js → TextArea-sEBd2qe1.js} +9 -9
  13. package/dist/{ToggleButtonGroup-BnNsIJX5.js → ToggleButtonGroup-Hw3WdsOM.js} +10 -10
  14. package/dist/Tree-DwJPCnFr.js +35 -0
  15. package/dist/assets/FieldError.css +1 -1
  16. package/dist/assets/Form.css +1 -0
  17. package/dist/assets/Input.css +1 -1
  18. package/dist/assets/NavigationSidebar.css +1 -1
  19. package/dist/assets/Select.css +1 -1
  20. package/dist/assets/TextArea.css +1 -1
  21. package/dist/assets/ToggleButtonGroup.css +1 -1
  22. package/dist/assets/Tree.css +1 -1
  23. package/dist/components/Disclosure/Disclosure/index.js +1 -1
  24. package/dist/components/Disclosure/DisclousureGroup/index.js +1 -1
  25. package/dist/components/Form/Form/Form.d.ts +3 -0
  26. package/dist/components/Form/Form/index.d.ts +2 -0
  27. package/dist/components/Form/Form/index.js +4 -0
  28. package/dist/components/Form/Form/types.d.ts +8 -0
  29. package/dist/components/Form/Input/index.js +1 -1
  30. package/dist/components/Form/TextArea/index.js +1 -1
  31. package/dist/components/Menu/index.js +2 -2
  32. package/dist/components/Navigation/NavigationMenu/index.js +1 -1
  33. package/dist/components/Navigation/NavigationResponsive/index.js +1 -1
  34. package/dist/components/Navigation/NavigationSidebar/index.js +1 -1
  35. package/dist/components/Navigation/index.js +3 -3
  36. package/dist/components/Select/index.js +1 -1
  37. package/dist/components/ToggleButtonGroup/index.js +1 -1
  38. package/dist/components/Tree/index.js +1 -1
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.js +46 -44
  41. package/dist/styles/main.css +193 -0
  42. package/dist/utils/form.d.ts +13 -0
  43. package/package.json +6 -4
  44. package/dist/Input-KLfZufI4.js +0 -33
  45. package/dist/Select-D0U2rIL2.js +0 -85
  46. package/dist/Tree-BwmYvUlr.js +0 -35
@@ -16,7 +16,7 @@ import './assets/Disclosure.css';const h = "_disclosure_1cz7p_1", u = "_trigger_
16
16
  theme: m.inverseSurface,
17
17
  shape: p.shrink,
18
18
  children: [
19
- /* @__PURE__ */ r(a, { strokeWidth: 3 }),
19
+ /* @__PURE__ */ r(a, {}),
20
20
  o
21
21
  ]
22
22
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { D as i } from "./Disclosure-D79gqK4z.js";
2
+ import { D as i } from "./Disclosure-VEgfonAa.js";
3
3
  import { DisclosureGroup as u } from "react-aria-components";
4
4
  import './assets/DisclousreGroup.css';const e = {
5
5
  "disclosure-group": "_disclosure-group_vh6v0_1"
@@ -1,8 +1,8 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { Label as l, FieldError as s } from "react-aria-components";
3
- import './assets/FieldError.css';const a = "_label_1ladm_1", o = {
3
+ import './assets/FieldError.css';const a = "_label_1qx1g_1", o = {
4
4
  label: a
5
- }, b = (r) => /* @__PURE__ */ e(l, { ...r, className: r.className ?? o.label, children: r.children }), t = "_error_srqbn_1", c = {
5
+ }, m = (r) => /* @__PURE__ */ e(l, { ...r, className: r.className ?? o.label, children: r.children }), t = "_error_srqbn_1", c = {
6
6
  error: t
7
7
  }, i = (r) => /* @__PURE__ */ e(
8
8
  s,
@@ -13,5 +13,5 @@ import './assets/FieldError.css';const a = "_label_1ladm_1", o = {
13
13
  );
14
14
  export {
15
15
  i as F,
16
- b as L
16
+ m as L
17
17
  };
@@ -0,0 +1,53 @@
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { Form as i } from "react-aria-components";
3
+ import { useState as l } from "react";
4
+ import './assets/Form.css';function d(o, e = (r) => r.message) {
5
+ const r = {}, s = [];
6
+ for (const t of o.issues)
7
+ t.path.length > 0 ? (r[t.path[0]] = r[t.path[0]] || [], r[t.path[0]].push(e(t))) : s.push(e(t));
8
+ return { formErrors: s, fieldErrors: r };
9
+ }
10
+ const h = "_form_1k1fe_1", E = {
11
+ form: h
12
+ }, F = (o, e) => {
13
+ const r = Object.fromEntries(new FormData(o)), s = e.safeParse(r);
14
+ return s.success ? {
15
+ success: !0,
16
+ data: s.data
17
+ } : {
18
+ success: !1,
19
+ errors: d(s.error).fieldErrors
20
+ };
21
+ }, g = ({
22
+ schema: o,
23
+ onSubmit: e,
24
+ children: r,
25
+ ...s
26
+ }) => {
27
+ const [t, a] = l({});
28
+ return /* @__PURE__ */ f(
29
+ i,
30
+ {
31
+ ...s,
32
+ validationErrors: t,
33
+ onSubmit: async (c) => {
34
+ c.preventDefault(), a({});
35
+ const m = c.currentTarget, n = F(m, o);
36
+ if (!n.success) {
37
+ a(n.errors);
38
+ return;
39
+ }
40
+ const u = await e(n.data, () => m.reset());
41
+ if (u) {
42
+ a(u);
43
+ return;
44
+ }
45
+ },
46
+ className: s.className ?? E.form,
47
+ children: r
48
+ }
49
+ );
50
+ };
51
+ export {
52
+ g as F
53
+ };
@@ -0,0 +1,33 @@
1
+ import { jsxs as a, jsx as s } from "react/jsx-runtime";
2
+ import { TextField as m, Input as c } from "react-aria-components";
3
+ import { L as p, F as d } from "./FieldError-a_f080R9.js";
4
+ import './assets/Input.css';const l = "_input_xzjym_1", u = "_editor_xzjym_11", o = {
5
+ input: l,
6
+ editor: u
7
+ }, I = ({
8
+ label: t,
9
+ textFieldProps: r,
10
+ inputProps: e,
11
+ labelProps: i,
12
+ fieldErrorProps: n
13
+ }) => /* @__PURE__ */ a(
14
+ m,
15
+ {
16
+ ...r,
17
+ className: r?.className ?? o.input,
18
+ children: [
19
+ t && /* @__PURE__ */ s(p, { ...i, children: t }),
20
+ /* @__PURE__ */ s(
21
+ c,
22
+ {
23
+ ...e,
24
+ className: e?.className ?? o.editor
25
+ }
26
+ ),
27
+ /* @__PURE__ */ s(d, { ...n })
28
+ ]
29
+ }
30
+ );
31
+ export {
32
+ I
33
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { a as n } from "./MenuLabel-ClmuA9_6.js";
2
+ import { a as n } from "./MenuLabel-B7jC7YwF.js";
3
3
  const s = ({ children: o, menuItems: r }) => /* @__PURE__ */ t(n, { menuItems: r, children: o });
4
4
  export {
5
5
  s as M
@@ -1,4 +1,4 @@
1
- import { jsxs as o, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
2
  import { MenuTrigger as m, Menu as c, Separator as l, MenuItem as p, SubmenuTrigger as d, Pressable as h } from "react-aria-components";
3
3
  import { P as i } from "./Popover-D3iGWJwQ.js";
4
4
  import { ChevronRight as _ } from "lucide-react";
@@ -12,7 +12,7 @@ import './assets/MenuLabel.css';const f = "_menu_c70ku_1", g = "_separator_c70ku
12
12
  }, u = ({ menuItem: e }) => {
13
13
  if (e.type === "separator")
14
14
  return /* @__PURE__ */ r(l, { className: `${t.separator}` });
15
- const n = !!e.subItems?.length, s = /* @__PURE__ */ o(
15
+ const n = !!e.subItems?.length, s = /* @__PURE__ */ a(
16
16
  p,
17
17
  {
18
18
  className: `${t["menu-item"]} ${t[e.type]}`,
@@ -21,23 +21,23 @@ import './assets/MenuLabel.css';const f = "_menu_c70ku_1", g = "_separator_c70ku
21
21
  target: e.target,
22
22
  children: [
23
23
  e.node,
24
- n && /* @__PURE__ */ r(_, { size: 18, strokeWidth: 3 })
24
+ n && /* @__PURE__ */ r(_, {})
25
25
  ]
26
26
  }
27
27
  );
28
- return n ? /* @__PURE__ */ o(d, { children: [
28
+ return n ? /* @__PURE__ */ a(d, { children: [
29
29
  s,
30
- /* @__PURE__ */ r(i, { children: /* @__PURE__ */ r(c, { className: `${t.menu}`, children: e.subItems.map((a) => /* @__PURE__ */ r(u, { menuItem: a }, a.id)) }) })
30
+ /* @__PURE__ */ r(i, { children: /* @__PURE__ */ r(c, { className: `${t.menu}`, children: e.subItems.map((o) => /* @__PURE__ */ r(u, { menuItem: o }, o.id)) }) })
31
31
  ] }) : s;
32
- }, k = ({ children: e, menuItems: n }) => /* @__PURE__ */ o(m, { children: [
32
+ }, $ = ({ children: e, menuItems: n }) => /* @__PURE__ */ a(m, { children: [
33
33
  e,
34
34
  /* @__PURE__ */ r(i, { children: /* @__PURE__ */ r(c, { className: `${t.menu}`, children: n.map((s) => /* @__PURE__ */ r(u, { menuItem: s }, s.id)) }) })
35
35
  ] }), y = ({
36
36
  children: e,
37
37
  menuItems: n,
38
38
  description: s
39
- }) => /* @__PURE__ */ r(k, { menuItems: n, children: /* @__PURE__ */ r(b, { description: s, children: /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r("span", { role: "button", className: t.pressable, children: e }) }) }) });
39
+ }) => /* @__PURE__ */ r($, { menuItems: n, children: /* @__PURE__ */ r(b, { description: s, children: /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r("span", { role: "button", className: t.pressable, children: e }) }) }) });
40
40
  export {
41
41
  y as M,
42
- k as a
42
+ $ as a
43
43
  };
@@ -1,26 +1,26 @@
1
1
  import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
- import { M as u } from "./MenuLabel-ClmuA9_6.js";
3
- import { L as i } from "./Link-CbLEp2fF.js";
4
- import { T as m } from "./TextButton-BJRez1un.js";
2
+ import { M as u } from "./MenuLabel-B7jC7YwF.js";
3
+ import { L as m } from "./Link-CbLEp2fF.js";
4
+ import { T as i } from "./TextButton-BJRez1un.js";
5
5
  import { C as n } from "./types-C1YOMbh5.js";
6
6
  import { a as c } from "./useSplash-7h6ni4l2.js";
7
- import { ChevronDown as h } from "lucide-react";
8
- import './assets/NavigationMenu.css';const p = "_menu_sata7_1", d = {
9
- menu: p
10
- }, g = ({ items: s, className: o }) => {
7
+ import { ChevronDown as p } from "lucide-react";
8
+ import './assets/NavigationMenu.css';const h = "_menu_sata7_1", d = {
9
+ menu: h
10
+ }, k = ({ items: s, className: o }) => {
11
11
  const t = s.filter((e) => e.type !== "separator");
12
12
  return /* @__PURE__ */ r("div", { className: o || d.menu, children: t.map((e) => {
13
13
  switch (e.type) {
14
14
  case "sub-items":
15
15
  return /* @__PURE__ */ a(u, { menuItems: e.subItems, children: [
16
16
  e.node,
17
- /* @__PURE__ */ r(h, { strokeWidth: 3 })
17
+ /* @__PURE__ */ r(p, {})
18
18
  ] }, e.id);
19
19
  case "item-node":
20
20
  return e.node;
21
21
  case "link":
22
22
  return /* @__PURE__ */ r(
23
- i,
23
+ m,
24
24
  {
25
25
  href: e.href,
26
26
  target: e.target,
@@ -31,7 +31,7 @@ import './assets/NavigationMenu.css';const p = "_menu_sata7_1", d = {
31
31
  );
32
32
  case "button":
33
33
  return /* @__PURE__ */ r(
34
- m,
34
+ i,
35
35
  {
36
36
  onPress: e.onPress,
37
37
  theme: n.inverseSurface,
@@ -43,5 +43,5 @@ import './assets/NavigationMenu.css';const p = "_menu_sata7_1", d = {
43
43
  }) });
44
44
  };
45
45
  export {
46
- g as N
46
+ k as N
47
47
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { useMediaQuery as t } from "usehooks-ts";
3
- import { N as e } from "./NavigationMenu-DTqKWY2F.js";
4
- import { N as s } from "./NavigationSidebar-ByWsLISI.js";
3
+ import { N as e } from "./NavigationMenu-DNsB0lr1.js";
4
+ import { N as s } from "./NavigationSidebar-CZEPGghA.js";
5
5
  const f = ({
6
6
  items: o,
7
7
  mediaQuery: r,
@@ -2,27 +2,27 @@ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import { T as r } from "./TextButton-BJRez1un.js";
3
3
  import { a as s } from "./useSplash-7h6ni4l2.js";
4
4
  import { S as m } from "./Sidebar-LlVvowsG.js";
5
- import { T as c } from "./Tree-BwmYvUlr.js";
6
- import { X as l, Menu as p } from "lucide-react";
7
- import { C as h } from "./types-C1YOMbh5.js";
8
- import './assets/NavigationSidebar.css';const d = "_nav_15psm_1", f = "_close_15psm_15", o = {
9
- nav: d,
10
- close: f
11
- }, g = ({
5
+ import { T as c } from "./Tree-DwJPCnFr.js";
6
+ import { X as l, Menu as h } from "lucide-react";
7
+ import { C as p } from "./types-C1YOMbh5.js";
8
+ import './assets/NavigationSidebar.css';const f = "_nav_1fjh5_1", d = "_close_1fjh5_15", o = {
9
+ nav: f,
10
+ close: d
11
+ }, N = ({
12
12
  items: a,
13
13
  ...t
14
14
  }) => /* @__PURE__ */ e(
15
15
  m,
16
16
  {
17
17
  ...t,
18
- trigger: /* @__PURE__ */ e(r, { shape: s.square, children: /* @__PURE__ */ e(p, {}) }),
18
+ trigger: /* @__PURE__ */ e(r, { shape: s.square, children: /* @__PURE__ */ e(h, {}) }),
19
19
  children: ({ close: n }) => /* @__PURE__ */ i("div", { className: o.nav, children: [
20
20
  /* @__PURE__ */ e("div", { className: o.close, children: /* @__PURE__ */ e(
21
21
  r,
22
22
  {
23
23
  onPress: n,
24
24
  shape: s.square,
25
- theme: h.inverseSurface,
25
+ theme: p.inverseSurface,
26
26
  children: /* @__PURE__ */ e(l, {})
27
27
  }
28
28
  ) }),
@@ -31,5 +31,5 @@ import './assets/NavigationSidebar.css';const d = "_nav_15psm_1", f = "_close_15
31
31
  }
32
32
  );
33
33
  export {
34
- g as N
34
+ N
35
35
  };
@@ -0,0 +1,85 @@
1
+ import { jsxs as i, jsx as e, Fragment as n } from "react/jsx-runtime";
2
+ import { O as S, F as T } from "./OutlinedButton-DaLKO8zx.js";
3
+ import { B as o } from "./useSplash-7h6ni4l2.js";
4
+ import { Select as b, SelectValue as m, ListBox as k, Text as d, ListBoxItem as V } from "react-aria-components";
5
+ import { P as y } from "./Popover-D3iGWJwQ.js";
6
+ import { ChevronsUpDown as C, Check as F } from "lucide-react";
7
+ import { T as $ } from "./TextButton-BJRez1un.js";
8
+ import { C as p } from "./types-C1YOMbh5.js";
9
+ import { T as L } from "./Tooltip-DAYtebkl.js";
10
+ import { L as D, F as j } from "./FieldError-a_f080R9.js";
11
+ import './assets/Select.css';const w = "_select_17r3s_1", I = "_trigger_17r3s_37", t = {
12
+ select: w,
13
+ "selected-value": "_selected-value_17r3s_11",
14
+ "option-description": "_option-description_17r3s_19",
15
+ trigger: I,
16
+ "options-list": "_options-list_17r3s_51",
17
+ "options-item-group": "_options-item-group_17r3s_63",
18
+ "options-item": "_options-item_17r3s_63"
19
+ }, K = ({
20
+ options: u,
21
+ label: a,
22
+ name: _,
23
+ disabled: h,
24
+ isRequired: f,
25
+ triggerVariant: g = o.filled,
26
+ description: x,
27
+ placeholder: c,
28
+ selectedKey: v,
29
+ onSelectionChange: B
30
+ }) => {
31
+ let r;
32
+ switch (g) {
33
+ case o.filled:
34
+ r = T;
35
+ break;
36
+ case o.outlined:
37
+ r = S;
38
+ break;
39
+ case o.text:
40
+ r = $;
41
+ break;
42
+ }
43
+ return /* @__PURE__ */ i(
44
+ b,
45
+ {
46
+ className: t.select,
47
+ isDisabled: h,
48
+ isRequired: f,
49
+ name: _,
50
+ selectedKey: v,
51
+ onSelectionChange: B,
52
+ children: [
53
+ a && /* @__PURE__ */ e(D, { children: a }),
54
+ /* @__PURE__ */ e(L, { description: x, theme: p.inverseSurface, children: /* @__PURE__ */ e(r, { theme: p.inverseSurface, children: /* @__PURE__ */ i("span", { className: t.trigger, children: [
55
+ c ? /* @__PURE__ */ e(m, { className: `${t["selected-value"]}`, children: ({ defaultChildren: s, isPlaceholder: l }) => l ? c : s }) : /* @__PURE__ */ e(m, {}),
56
+ /* @__PURE__ */ e(C, {})
57
+ ] }) }) }),
58
+ /* @__PURE__ */ e(j, {}),
59
+ /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(k, { className: `${t["options-list"]}`, items: u, children: (s) => {
60
+ const l = /* @__PURE__ */ i(n, { children: [
61
+ /* @__PURE__ */ e(d, { children: s.displayValue }),
62
+ s.description && /* @__PURE__ */ e(d, { className: t["option-description"], children: s.description })
63
+ ] });
64
+ return /* @__PURE__ */ e(
65
+ V,
66
+ {
67
+ className: `${t["options-item-group"]}`,
68
+ id: s.key,
69
+ textValue: s.displayValue,
70
+ isDisabled: s.disabled,
71
+ children: ({ isSelected: N }) => /* @__PURE__ */ i(n, { children: [
72
+ /* @__PURE__ */ e("div", { className: `${t["options-item"]}`, children: l }),
73
+ N && /* @__PURE__ */ e(F, {})
74
+ ] })
75
+ },
76
+ s.key
77
+ );
78
+ } }) })
79
+ ]
80
+ }
81
+ );
82
+ };
83
+ export {
84
+ K as S
85
+ };
@@ -1,7 +1,7 @@
1
- import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
- import { TextField as c, TextArea as m } from "react-aria-components";
3
- import { L as d, F as l } from "./FieldError-CZn24fiL.js";
4
- import './assets/TextArea.css';const n = "_textarea_1fx5i_1", _ = "_editor_1fx5i_11", s = {
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { TextField as m, TextArea as x } from "react-aria-components";
3
+ import { L as d, F as l } from "./FieldError-a_f080R9.js";
4
+ import './assets/TextArea.css';const n = "_textarea_1o47z_1", _ = "_editor_1o47z_11", s = {
5
5
  textarea: n,
6
6
  editor: _
7
7
  }, h = ({
@@ -9,22 +9,22 @@ import './assets/TextArea.css';const n = "_textarea_1fx5i_1", _ = "_editor_1fx5i
9
9
  textFieldProps: r,
10
10
  textAreaProps: t,
11
11
  labelProps: o,
12
- fieldErrorProps: i
13
- }) => /* @__PURE__ */ x(
14
- c,
12
+ fieldErrorProps: c
13
+ }) => /* @__PURE__ */ i(
14
+ m,
15
15
  {
16
16
  ...r,
17
17
  className: r?.className ?? s.textarea,
18
18
  children: [
19
19
  a && /* @__PURE__ */ e(d, { ...o, children: a }),
20
20
  /* @__PURE__ */ e(
21
- m,
21
+ x,
22
22
  {
23
23
  ...t,
24
24
  className: t?.className ?? s.editor
25
25
  }
26
26
  ),
27
- /* @__PURE__ */ e(l, { ...i })
27
+ /* @__PURE__ */ e(l, { ...c })
28
28
  ]
29
29
  }
30
30
  );
@@ -1,19 +1,19 @@
1
1
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
2
  import { ToggleButton as m, ToggleButtonGroup as p } from "react-aria-components";
3
3
  import { u as c, s, S as d, B as T, a as B } from "./useSplash-7h6ni4l2.js";
4
- import { T as b } from "./Tooltip-DAYtebkl.js";
5
- import { C as l } from "./types-C1YOMbh5.js";
6
- import './assets/ToggleButtonGroup.css';const h = {
7
- "toggle-button-group": "_toggle-button-group_b7n8c_1"
4
+ import { T as h } from "./Tooltip-DAYtebkl.js";
5
+ import { C as n } from "./types-C1YOMbh5.js";
6
+ import './assets/ToggleButtonGroup.css';const b = {
7
+ "toggle-button-group": "_toggle-button-group_1tyg5_1"
8
8
  }, $ = ({
9
9
  id: e,
10
10
  value: a,
11
11
  description: o,
12
12
  isDisabled: t,
13
- theme: u = l.primary
13
+ theme: u = n.primary
14
14
  }) => {
15
- const { coords: n, handlePress: g } = c();
16
- return /* @__PURE__ */ r(b, { description: o, children: /* @__PURE__ */ i(
15
+ const { coords: l, handlePress: g } = c();
16
+ return /* @__PURE__ */ r(h, { description: o, children: /* @__PURE__ */ i(
17
17
  m,
18
18
  {
19
19
  id: e,
@@ -21,20 +21,20 @@ import './assets/ToggleButtonGroup.css';const h = {
21
21
  className: `${s.button} ${s[u]} ${s[T.outlined]} ${s[B.rectangle]}`,
22
22
  isDisabled: t,
23
23
  children: [
24
- n && /* @__PURE__ */ r(d, { ...n }),
24
+ l && /* @__PURE__ */ r(d, { ...l }),
25
25
  a
26
26
  ]
27
27
  }
28
28
  ) });
29
29
  }, G = ({
30
30
  items: e,
31
- theme: a = l.primary,
31
+ theme: a = n.primary,
32
32
  ...o
33
33
  }) => /* @__PURE__ */ r(
34
34
  p,
35
35
  {
36
36
  ...o,
37
- className: o.className ?? h["toggle-button-group"],
37
+ className: o.className ?? b["toggle-button-group"],
38
38
  children: e.map((t) => /* @__PURE__ */ r(
39
39
  $,
40
40
  {
@@ -0,0 +1,35 @@
1
+ import { jsx as t, Fragment as i, jsxs as s } from "react/jsx-runtime";
2
+ import { Tree as p, TreeItem as l, TreeItemContent as h } from "react-aria-components";
3
+ import { ChevronRight as T } from "lucide-react";
4
+ import './assets/Tree.css';const f = "_tree_1s2dv_1", o = {
5
+ tree: f,
6
+ "tree-item": "_tree-item_1s2dv_11"
7
+ }, a = ({ item: e }) => {
8
+ if (e.type === "separator") return /* @__PURE__ */ t(i, {});
9
+ const r = e.type === "link", d = e.type === "button", c = e.type === "item-node", u = e.active;
10
+ return /* @__PURE__ */ s(
11
+ l,
12
+ {
13
+ textValue: e.id,
14
+ target: e.target,
15
+ onAction: e.onPress,
16
+ href: e.href,
17
+ className: o["tree-item"],
18
+ ...r && { "data-link": !0 },
19
+ ...d && { "data-button": !0 },
20
+ ...c && { "data-node": !0 },
21
+ ...u && { "data-active": !0 },
22
+ children: [
23
+ /* @__PURE__ */ s(h, { children: [
24
+ e.node,
25
+ e.subItems && /* @__PURE__ */ t(T, {})
26
+ ] }),
27
+ e.subItems && e.subItems.map((n) => /* @__PURE__ */ t(a, { item: n }, n.id))
28
+ ]
29
+ },
30
+ e.id
31
+ );
32
+ }, y = ({ items: e }) => /* @__PURE__ */ t(p, { className: o.tree, children: e.map((r) => /* @__PURE__ */ t(a, { item: r }, r.id)) });
33
+ export {
34
+ y as T
35
+ };
@@ -1 +1 @@
1
- ._label_1ladm_1{font-weight:500}._error_srqbn_1{font-size:.875rem;color:var(--color-error)}
1
+ ._label_1qx1g_1{font-weight:500;font-size:var(--form-label-text)}._error_srqbn_1{font-size:.875rem;color:var(--color-error)}
@@ -0,0 +1 @@
1
+ ._form_1k1fe_1{display:grid;gap:var(--form-gap)}
@@ -1 +1 @@
1
- ._input_sezs4_1{display:grid;gap:.25rem}._editor_sezs4_11{font-weight:500;border-radius:var(--radius);padding-inline:.625em;padding-block:.625em;max-inline-size:100%;border-style:solid;background-color:var(--color-surface-container-highest);color:var(--color-on-surface)}._editor_sezs4_11[data-invalid]{border-color:var(--color-error)}
1
+ ._input_xzjym_1{display:grid;gap:var(--form-input-gap, .25rem)}._editor_xzjym_11{font-weight:500;border-radius:var(--radius);padding-inline:.625em;padding-block:.625em;max-inline-size:100%;border-style:solid;background-color:var(--color-surface-container-highest);color:var(--color-on-surface);font-size:var(--form-input-text)}._editor_xzjym_11[data-invalid]{border-color:var(--color-error)}
@@ -1 +1 @@
1
- ._nav_15psm_1{--_tree-font-size: 1.25rem;--_tree-gap: 1.5em;display:grid}._close_15psm_15{display:flex;justify-content:end;position:sticky;inset-block-start:0}
1
+ ._nav_1fjh5_1{--tree-font-size: 1.25rem;--_tree-gap: 1.5em;display:grid}._close_1fjh5_15{display:flex;justify-content:end;position:sticky;inset-block-start:0}
@@ -1 +1 @@
1
- ._select_3q7jl_1{display:grid;gap:.25rem}._selected-value_3q7jl_11 ._option-description_3q7jl_13{display:none}._selected-value_3q7jl_11[data-placeholder]{font-style:italic}._trigger_3q7jl_31{display:flex;align-items:center;gap:.75rem;justify-content:space-between}._options-list_3q7jl_45{display:grid;gap:1rem;border-radius:inherit}._options-item-group_3q7jl_57{display:flex;gap:.5rem;align-items:center;justify-content:space-between;cursor:pointer;border-radius:inherit;padding-inline:.75rem;padding-block:.5rem;color:var(--_item-text);background-color:var(--_item-color);transition:background-color .25s,color .25s}._options-item-group_3q7jl_57[data-hovered],._options-item-group_3q7jl_57[data-focused]{--_item-color: hsl(from var(--_popover-bg) h s calc(l + 10) );--_item-text: hsl(from var(--_popover-text) h s calc(l + 10) )}._options-item-group_3q7jl_57[data-selected]{--_item-color: hsl(from var(--_popover-bg) h s calc(l - 10) );--_item-text: hsl(from var(--_popover-text) h s calc(l - 10) )}._options-item_3q7jl_57{display:grid;gap:.25em}._options-item_3q7jl_57 ._option-description_3q7jl_13{font-size:.875em;font-style:italic}
1
+ ._select_17r3s_1{display:grid;gap:var(--form-input-gap)}._selected-value_17r3s_11{font-size:var(--form-input-text);font-weight:600}._selected-value_17r3s_11 ._option-description_17r3s_19{display:none}._selected-value_17r3s_11[data-placeholder]{font-style:italic}._trigger_17r3s_37{display:flex;align-items:center;gap:.75rem;justify-content:space-between}._options-list_17r3s_51{display:grid;gap:var(--form-gap);border-radius:inherit}._options-item-group_17r3s_63{display:flex;gap:.5rem;align-items:center;justify-content:space-between;cursor:pointer;border-radius:inherit;padding-inline:.75rem;padding-block:.5rem;color:var(--_item-text);background-color:var(--_item-color);transition:background-color .25s,color .25s}._options-item-group_17r3s_63[data-hovered],._options-item-group_17r3s_63[data-focused]{--_item-color: hsl(from var(--_popover-bg) h s calc(l + 10) );--_item-text: hsl(from var(--_popover-text) h s calc(l + 10) )}._options-item-group_17r3s_63[data-selected]{--_item-color: hsl(from var(--_popover-bg) h s calc(l - 10) );--_item-text: hsl(from var(--_popover-text) h s calc(l - 10) )}._options-item_17r3s_63{font-size:var(--form-input-text);display:grid;gap:.25rem}._options-item_17r3s_63 ._option-description_17r3s_19{font-size:.875em;font-style:italic}
@@ -1 +1 @@
1
- ._textarea_1fx5i_1{display:grid;gap:.25rem}._editor_1fx5i_11{font-weight:500;border-radius:var(--radius);padding-inline:.625em;padding-block:.625em;max-inline-size:100%;border-style:solid;background-color:var(--color-surface-container-highest);color:var(--color-on-surface);resize:vertical;max-height:15rem}._editor_1fx5i_11[data-invalid]{border-color:var(--color-error)}
1
+ ._textarea_1o47z_1{display:grid;gap:var(--form-input-gap, .25rem)}._editor_1o47z_11{font-weight:500;border-radius:var(--radius);padding-inline:.625em;padding-block:.625em;max-inline-size:100%;border-style:solid;background-color:var(--color-surface-container-highest);color:var(--color-on-surface);resize:vertical;max-height:15rem;font-size:var(--form-input-text)}._editor_1o47z_11[data-invalid]{border-color:var(--color-error)}
@@ -1 +1 @@
1
- ._toggle-button-group_b7n8c_1{--_flex-direction: row;--button-border-width: .075rem;display:flex;flex-direction:var(--_flex-direction)}._toggle-button-group_b7n8c_1>button{border-radius:0}._toggle-button-group_b7n8c_1[data-orientation=vertical]{--_flex-direction: column;--radius-button: var(--radius)}._toggle-button-group_b7n8c_1[data-orientation=vertical]>button{margin-block-start:calc(-1 * var(--button-border-width))}._toggle-button-group_b7n8c_1[data-orientation=vertical]>button:first-child{border-radius:var(--radius-button) var(--radius-button) 0 0;margin-block-start:0}._toggle-button-group_b7n8c_1[data-orientation=vertical]>button:last-child{border-radius:0 0 var(--radius-button) var(--radius-button)}._toggle-button-group_b7n8c_1[data-orientation=horizontal]>button{margin-inline-start:calc(-1 * var(--button-border-width))}._toggle-button-group_b7n8c_1[data-orientation=horizontal]>button:first-child{margin-inline-start:0;border-radius:var(--radius-button) 0 0 var(--radius-button)}._toggle-button-group_b7n8c_1[data-orientation=horizontal]>button:last-child{border-radius:0 var(--radius-button) var(--radius-button) 0}
1
+ ._toggle-button-group_1tyg5_1{--_flex-direction: row;display:flex;flex-direction:var(--_flex-direction)}._toggle-button-group_1tyg5_1>button{border-radius:0}._toggle-button-group_1tyg5_1[data-orientation=vertical]{--_flex-direction: column;--radius-button: var(--radius)}._toggle-button-group_1tyg5_1[data-orientation=vertical]>button{margin-block-start:calc(-1 * var(--button-border-width))}._toggle-button-group_1tyg5_1[data-orientation=vertical]>button:first-child{border-radius:var(--radius-button) var(--radius-button) 0 0;margin-block-start:0}._toggle-button-group_1tyg5_1[data-orientation=vertical]>button:last-child{border-radius:0 0 var(--radius-button) var(--radius-button)}._toggle-button-group_1tyg5_1[data-orientation=horizontal]>button{margin-inline-start:calc(-1 * var(--button-border-width))}._toggle-button-group_1tyg5_1[data-orientation=horizontal]>button:first-child{margin-inline-start:0;border-radius:var(--radius-button) 0 0 var(--radius-button)}._toggle-button-group_1tyg5_1[data-orientation=horizontal]>button:last-child{border-radius:0 var(--radius-button) var(--radius-button) 0}
@@ -1 +1 @@
1
- ._tree_1hbk9_1{display:grid;gap:var(--_tree-gap, 1em)}._tree-item_1hbk9_11{display:flex;align-items:center;gap:.5em;-webkit-text-decoration:underline transparent;text-decoration:underline transparent;font-size:var(--_tree-font-size, 1rem);cursor:context-menu;padding-inline-start:calc(calc(var(--tree-item-level) - 1) * 1em);transition:text-decoration-color .25s}._tree-item_1hbk9_11[data-active]{color:var(--color-primary)}._tree-item_1hbk9_11:not([data-node]){cursor:pointer}._tree-item_1hbk9_11[data-link][data-hovered],._tree-item_1hbk9_11[data-link][data-focus-visible]{text-decoration-color:currentColor}._tree-item_1hbk9_11 svg{transition:rotate .25s;width:.875em}._tree-item_1hbk9_11[data-expanded] svg{rotate:90deg}
1
+ ._tree_1s2dv_1{display:grid;gap:var(--_tree-gap, 1em)}._tree-item_1s2dv_11{display:flex;align-items:center;gap:.5em;-webkit-text-decoration:underline transparent;text-decoration:underline transparent;font-size:var(--tree-font-size, 1rem);cursor:context-menu;padding-inline-start:calc(calc(var(--tree-item-level) - 1) * 1em);transition:text-decoration-color .25s}._tree-item_1s2dv_11[data-active]{color:var(--color-primary)}._tree-item_1s2dv_11:not([data-node]){cursor:pointer}._tree-item_1s2dv_11[data-link][data-hovered],._tree-item_1s2dv_11[data-link][data-focus-visible]{text-decoration-color:currentColor}._tree-item_1s2dv_11 svg{transition:rotate .25s;width:.875em}._tree-item_1s2dv_11[data-expanded] svg{rotate:90deg}
@@ -1,4 +1,4 @@
1
- import { D as s } from "../../../Disclosure-D79gqK4z.js";
1
+ import { D as s } from "../../../Disclosure-VEgfonAa.js";
2
2
  export {
3
3
  s as Disclosure
4
4
  };
@@ -1,4 +1,4 @@
1
- import { D as s } from "../../../DisclousreGroup-BSUcVzWX.js";
1
+ import { D as s } from "../../../DisclousreGroup-DEhMBMtj.js";
2
2
  export {
3
3
  s as DisclosureGroup
4
4
  };
@@ -0,0 +1,3 @@
1
+ import { FormProps } from './types';
2
+ import * as z from "zod";
3
+ export declare const Form: <T extends z.ZodObject<any>>({ schema, onSubmit, children, ...props }: FormProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './Form';
@@ -0,0 +1,4 @@
1
+ import { F as m } from "../../../Form-BrgsgT93.js";
2
+ export {
3
+ m as Form
4
+ };
@@ -0,0 +1,8 @@
1
+ import { FormProps as AriaFormProps } from 'react-aria-components';
2
+ import * as z from "zod";
3
+ export type FormReset = () => void;
4
+ export type submitHandler<T> = (values: T, reset: FormReset) => void | Promise<void> | Promise<Partial<Record<keyof T, string | string[]>>>;
5
+ export interface FormProps<T extends z.ZodObject<any>> extends Omit<AriaFormProps, "onSubmit" | "validationErrors"> {
6
+ schema: T;
7
+ onSubmit: submitHandler<z.infer<T>>;
8
+ }
@@ -1,4 +1,4 @@
1
- import { I as r } from "../../../Input-KLfZufI4.js";
1
+ import { I as r } from "../../../Input-CcFMJrOW.js";
2
2
  export {
3
3
  r as Input
4
4
  };
@@ -1,4 +1,4 @@
1
- import { T as a } from "../../../TextArea-DBZO5z2H.js";
1
+ import { T as a } from "../../../TextArea-sEBd2qe1.js";
2
2
  export {
3
3
  a as TextArea
4
4
  };
@@ -1,5 +1,5 @@
1
- import { M as r } from "../../MenuButton-BEwnL_jL.js";
2
- import { M } from "../../MenuLabel-ClmuA9_6.js";
1
+ import { M as r } from "../../MenuButton-CAzQcvOm.js";
2
+ import { M } from "../../MenuLabel-B7jC7YwF.js";
3
3
  export {
4
4
  r as MenuButton,
5
5
  M as MenuLabel
@@ -1,4 +1,4 @@
1
- import { N as e } from "../../../NavigationMenu-DTqKWY2F.js";
1
+ import { N as e } from "../../../NavigationMenu-DNsB0lr1.js";
2
2
  export {
3
3
  e as NavigationMenu
4
4
  };
@@ -1,4 +1,4 @@
1
- import { N as e } from "../../../NavigationResponsive-BPybSnJ4.js";
1
+ import { N as e } from "../../../NavigationResponsive-D6d2f-k_.js";
2
2
  export {
3
3
  e as NavigationResponsive
4
4
  };
@@ -1,4 +1,4 @@
1
- import { N as o } from "../../../NavigationSidebar-ByWsLISI.js";
1
+ import { N as o } from "../../../NavigationSidebar-CZEPGghA.js";
2
2
  export {
3
3
  o as NavigationSidebar
4
4
  };
@@ -1,6 +1,6 @@
1
- import { N as i } from "../../NavigationResponsive-BPybSnJ4.js";
2
- import { N as r } from "../../NavigationSidebar-ByWsLISI.js";
3
- import { N } from "../../NavigationMenu-DTqKWY2F.js";
1
+ import { N as i } from "../../NavigationResponsive-D6d2f-k_.js";
2
+ import { N as r } from "../../NavigationSidebar-CZEPGghA.js";
3
+ import { N } from "../../NavigationMenu-DNsB0lr1.js";
4
4
  export {
5
5
  N as NavigationMenu,
6
6
  i as NavigationResponsive,
@@ -1,4 +1,4 @@
1
- import { S as r } from "../../Select-D0U2rIL2.js";
1
+ import { S as r } from "../../Select-uiw8JPDT.js";
2
2
  export {
3
3
  r as Select
4
4
  };
@@ -1,4 +1,4 @@
1
- import { T as t } from "../../ToggleButtonGroup-BnNsIJX5.js";
1
+ import { T as t } from "../../ToggleButtonGroup-Hw3WdsOM.js";
2
2
  export {
3
3
  t as ToggleButtonGroup
4
4
  };
@@ -1,4 +1,4 @@
1
- import { T as o } from "../../Tree-BwmYvUlr.js";
1
+ import { T as o } from "../../Tree-DwJPCnFr.js";
2
2
  export {
3
3
  o as Tree
4
4
  };
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from './components/Button';
4
4
  export * from './components/Disclosure/Disclosure';
5
5
  export * from './components/Disclosure/DisclousureGroup';
6
6
  export * from './components/Error';
7
+ export * from './components/Form/Form';
7
8
  export * from './components/Form/Input';
8
9
  export * from './components/Form/TextArea';
9
10
  export * from './components/Link';
package/dist/index.js CHANGED
@@ -1,61 +1,63 @@
1
1
  import { C as a } from "./types-C1YOMbh5.js";
2
2
  import { A as t, a as s, b as p } from "./Avatar-vPRORJSz.js";
3
- import { a as i, B as m } from "./useSplash-7h6ni4l2.js";
3
+ import { a as x, B as i } from "./useSplash-7h6ni4l2.js";
4
4
  import { F as f, O as u } from "./OutlinedButton-DaLKO8zx.js";
5
5
  import { T as d } from "./TextButton-BJRez1un.js";
6
- import { D as B } from "./Disclosure-D79gqK4z.js";
7
- import { D as T } from "./DisclousreGroup-BSUcVzWX.js";
6
+ import { D as B } from "./Disclosure-VEgfonAa.js";
7
+ import { D as T } from "./DisclousreGroup-DEhMBMtj.js";
8
8
  import { E as c } from "./Error-y2dIWjyb.js";
9
- import { I as A } from "./Input-KLfZufI4.js";
10
- import { T as g } from "./TextArea-DBZO5z2H.js";
11
- import { F as D, O as F } from "./OutlinedButtonLink-BvCiAZyQ.js";
12
- import { L as P } from "./Link-CbLEp2fF.js";
13
- import { M as C } from "./MenuButton-BEwnL_jL.js";
14
- import { M as z } from "./MenuLabel-ClmuA9_6.js";
15
- import { M as G, a as I, b as y } from "./ModalAction-DjHBeAOr.js";
16
- import { M as V } from "./ModalBase-DLaR_yid.js";
17
- import { N as q } from "./NavigationResponsive-BPybSnJ4.js";
18
- import { S as H, a as J, b as K } from "./Sidebar-LlVvowsG.js";
19
- import { N as U } from "./NavigationSidebar-ByWsLISI.js";
20
- import { N as X } from "./NavigationMenu-DTqKWY2F.js";
21
- import { P as Z } from "./Popover-D3iGWJwQ.js";
22
- import { S as $ } from "./Select-D0U2rIL2.js";
23
- import { S as ro } from "./Success-Bh3pb5T7.js";
24
- import { T as eo } from "./ToggleButtonGroup-BnNsIJX5.js";
25
- import { T as so } from "./Tree-BwmYvUlr.js";
9
+ import { F as A } from "./Form-BrgsgT93.js";
10
+ import { I as N } from "./Input-CcFMJrOW.js";
11
+ import { T as L } from "./TextArea-sEBd2qe1.js";
12
+ import { F as O, O as P } from "./OutlinedButtonLink-BvCiAZyQ.js";
13
+ import { L as C } from "./Link-CbLEp2fF.js";
14
+ import { M as z } from "./MenuButton-CAzQcvOm.js";
15
+ import { M as G } from "./MenuLabel-B7jC7YwF.js";
16
+ import { M as y, a as R, b as V } from "./ModalAction-DjHBeAOr.js";
17
+ import { M as q } from "./ModalBase-DLaR_yid.js";
18
+ import { N as H } from "./NavigationResponsive-D6d2f-k_.js";
19
+ import { S as K, a as Q, b as U } from "./Sidebar-LlVvowsG.js";
20
+ import { N as X } from "./NavigationSidebar-CZEPGghA.js";
21
+ import { N as Z } from "./NavigationMenu-DNsB0lr1.js";
22
+ import { P as $ } from "./Popover-D3iGWJwQ.js";
23
+ import { S as ro } from "./Select-uiw8JPDT.js";
24
+ import { S as eo } from "./Success-Bh3pb5T7.js";
25
+ import { T as so } from "./ToggleButtonGroup-Hw3WdsOM.js";
26
+ import { T as mo } from "./Tree-DwJPCnFr.js";
26
27
  export {
27
28
  t as Avatar,
28
29
  s as AvatarSize,
29
30
  p as AvatarType,
30
- i as ButtonShape,
31
- m as ButtonVariant,
31
+ x as ButtonShape,
32
+ i as ButtonVariant,
32
33
  a as ColorTheme,
33
34
  B as Disclosure,
34
35
  T as DisclosureGroup,
35
36
  c as Error,
36
37
  f as FilledButton,
37
- D as FilledButtonLink,
38
- A as Input,
39
- P as Link,
40
- C as MenuButton,
41
- z as MenuLabel,
42
- G as ModalAction,
43
- I as ModalActionPlacement,
44
- V as ModalBase,
45
- y as ModalCloseText,
46
- X as NavigationMenu,
47
- q as NavigationResponsive,
48
- U as NavigationSidebar,
38
+ O as FilledButtonLink,
39
+ A as Form,
40
+ N as Input,
41
+ C as Link,
42
+ z as MenuButton,
43
+ G as MenuLabel,
44
+ y as ModalAction,
45
+ R as ModalActionPlacement,
46
+ q as ModalBase,
47
+ V as ModalCloseText,
48
+ Z as NavigationMenu,
49
+ H as NavigationResponsive,
50
+ X as NavigationSidebar,
49
51
  u as OutlinedButton,
50
- F as OutlinedButtonLink,
51
- Z as Popover,
52
- $ as Select,
53
- H as Sidebar,
54
- J as SidebarPosition,
55
- K as SidebarSize,
56
- ro as Success,
57
- g as TextArea,
52
+ P as OutlinedButtonLink,
53
+ $ as Popover,
54
+ ro as Select,
55
+ K as Sidebar,
56
+ Q as SidebarPosition,
57
+ U as SidebarSize,
58
+ eo as Success,
59
+ L as TextArea,
58
60
  d as TextButton,
59
- eo as ToggleButtonGroup,
60
- so as Tree
61
+ so as ToggleButtonGroup,
62
+ mo as Tree
61
63
  };
@@ -0,0 +1,193 @@
1
+ @import url("https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap");
2
+ @import "reset.css";
3
+
4
+ [data-shape="sharp"] {
5
+ --radius: 0;
6
+ --radius-sidebar: 0;
7
+ --radius-button: var(--radius);
8
+ --radius-circular: 0;
9
+ }
10
+
11
+ [data-shape="round"] {
12
+ --radius: 0.5rem;
13
+ --radius-sidebar: 2.5rem;
14
+ --radius-button: var(--radius);
15
+ --radius-circular: 50%;
16
+
17
+ &[data-button-shape="pill"] {
18
+ --radius-button: 100vi;
19
+ }
20
+ }
21
+
22
+ [data-theme="dark"] {
23
+ --color-primary: rgb(134 209 233);
24
+ --color-surface-tint: rgb(134 209 233);
25
+ --color-on-primary: rgb(0 54 66);
26
+ --color-primary-container: rgb(0 78 94);
27
+ --color-on-primary-container: rgb(178 235 255);
28
+ --color-secondary: rgb(178 202 211);
29
+ --color-on-secondary: rgb(29 52 59);
30
+ --color-secondary-container: rgb(52 74 82);
31
+ --color-on-secondary-container: rgb(206 231 240);
32
+ --color-tertiary: rgb(193 196 235);
33
+ --color-on-tertiary: rgb(42 46 77);
34
+ --color-tertiary-container: rgb(65 68 101);
35
+ --color-on-tertiary-container: rgb(223 224 255);
36
+ --color-error: rgb(255 180 171);
37
+ --color-on-error: rgb(105 0 5);
38
+ --color-error-container: rgb(147 0 10);
39
+ --color-on-error-container: rgb(255 218 214);
40
+ --color-success: rgb(160 212 155);
41
+ --color-on-success: rgb(7 57 16);
42
+ --color-success-container: rgb(34 80 37);
43
+ --color-on-success-container: rgb(187 240 181);
44
+ --color-background: rgb(15 20 22);
45
+ --color-on-background: rgb(222 227 230);
46
+ --color-surface: rgb(15 20 22);
47
+ --color-on-surface: rgb(222 227 230);
48
+ --color-surface-variant: rgb(64 72 75);
49
+ --color-on-surface-variant: rgb(191 200 204);
50
+ --color-outline: rgb(137 146 150);
51
+ --color-outline-variant: rgb(64 72 75);
52
+ --color-shadow: rgb(0 0 0);
53
+ --color-scrim: rgb(0 0 0);
54
+ --color-inverse-surface: rgb(222 227 230);
55
+ --color-inverse-on-surface: rgb(44 49 51);
56
+ --color-inverse-primary: rgb(0 103 125);
57
+ --color-primary-fixed: rgb(178 235 255);
58
+ --color-on-primary-fixed: rgb(0 31 39);
59
+ --color-primary-fixed-dim: rgb(134 209 233);
60
+ --color-on-primary-fixed-variant: rgb(0 78 94);
61
+ --color-secondary-fixed: rgb(206 231 240);
62
+ --color-on-secondary-fixed: rgb(6 30 37);
63
+ --color-secondary-fixed-dim: rgb(178 202 211);
64
+ --color-on-secondary-fixed-variant: rgb(52 74 82);
65
+ --color-tertiary-fixed: rgb(223 224 255);
66
+ --color-on-tertiary-fixed: rgb(21 25 55);
67
+ --color-tertiary-fixed-dim: rgb(193 196 235);
68
+ --color-on-tertiary-fixed-variant: rgb(65 68 101);
69
+ --color-surface-dim: rgb(15 20 22);
70
+ --color-surface-bright: rgb(52 58 60);
71
+ --color-surface-container-lowest: rgb(9 15 17);
72
+ --color-surface-container-low: rgb(23 28 30);
73
+ --color-surface-container: rgb(27 32 34);
74
+ --color-surface-container-high: rgb(37 43 45);
75
+ --color-surface-container-highest: rgb(48 54 56);
76
+ --color-primary-variant: rgb(220 198 110);
77
+ --color-on-primary-variant: rgb(58 48 0);
78
+ --color-primary-variant-container: rgb(84 70 0);
79
+ --color-on-primary-variant-container: rgb(249 226 135);
80
+ }
81
+
82
+ [data-theme="light"] {
83
+ --color-primary: rgb(0 103 125);
84
+ --color-surface-tint: rgb(0 103 125);
85
+ --color-on-primary: rgb(255 255 255);
86
+ --color-primary-container: rgb(178 235 255);
87
+ --color-on-primary-container: rgb(0 78 94);
88
+ --color-secondary: rgb(75 98 106);
89
+ --color-on-secondary: rgb(255 255 255);
90
+ --color-secondary-container: rgb(206 231 240);
91
+ --color-on-secondary-container: rgb(52 74 82);
92
+ --color-tertiary: rgb(88 92 126);
93
+ --color-on-tertiary: rgb(255 255 255);
94
+ --color-tertiary-container: rgb(223 224 255);
95
+ --color-on-tertiary-container: rgb(65 68 101);
96
+ --color-error: rgb(186 26 26);
97
+ --color-on-error: rgb(255 255 255);
98
+ --color-error-container: rgb(255 218 214);
99
+ --color-on-error-container: rgb(147 0 10);
100
+ --color-success: rgb(58 105 58);
101
+ --color-on-success: rgb(255 255 255);
102
+ --color-success-container: rgb(187 240 181);
103
+ --color-on-success-container: rgb(34 80 37);
104
+ --color-background: rgb(245 250 253);
105
+ --color-on-background: rgb(23 28 30);
106
+ --color-surface: rgb(245 250 253);
107
+ --color-on-surface: rgb(23 28 30);
108
+ --color-surface-variant: rgb(219 228 232);
109
+ --color-on-surface-variant: rgb(64 72 75);
110
+ --color-outline: rgb(112 120 124);
111
+ --color-outline-variant: rgb(191 200 204);
112
+ --color-shadow: rgb(0 0 0);
113
+ --color-scrim: rgb(0 0 0);
114
+ --color-inverse-surface: rgb(44 49 51);
115
+ --color-inverse-on-surface: rgb(236 241 244);
116
+ --color-inverse-primary: rgb(134 209 233);
117
+ --color-primary-fixed: rgb(178 235 255);
118
+ --color-on-primary-fixed: rgb(0 31 39);
119
+ --color-primary-fixed-dim: rgb(134 209 233);
120
+ --color-on-primary-fixed-variant: rgb(0 78 94);
121
+ --color-secondary-fixed: rgb(206 231 240);
122
+ --color-on-secondary-fixed: rgb(6 30 37);
123
+ --color-secondary-fixed-dim: rgb(178 202 211);
124
+ --color-on-secondary-fixed-variant: rgb(52 74 82);
125
+ --color-tertiary-fixed: rgb(223 224 255);
126
+ --color-on-tertiary-fixed: rgb(21 25 55);
127
+ --color-tertiary-fixed-dim: rgb(193 196 235);
128
+ --color-on-tertiary-fixed-variant: rgb(65 68 101);
129
+ --color-surface-dim: rgb(214 219 221);
130
+ --color-surface-bright: rgb(245 250 253);
131
+ --color-surface-container-lowest: rgb(255 255 255);
132
+ --color-surface-container-low: rgb(239 244 247);
133
+ --color-surface-container: rgb(234 239 241);
134
+ --color-surface-container-high: rgb(228 233 235);
135
+ --color-surface-container-highest: rgb(222 227 230);
136
+ --color-primary-variant: rgb(110 93 14);
137
+ --color-on-primary-variant: rgb(255 255 255);
138
+ --color-primary-variant-container: rgb(249 226 135);
139
+ --color-on-primary-variant-container: rgb(84 70 0);
140
+ }
141
+
142
+ :root {
143
+ --font-normal: "Lexend", sans-serif;
144
+ --font-heading: "Lexend", sans-serif;
145
+
146
+ --elevation-1: 0px 2px 6px 1.5px hsl(from var(--color-shadow) h s l / 0.375);
147
+ --elevation-2: 0px 4px 12px 1.5px hsl(from var(--color-shadow) h s l / 0.375);
148
+
149
+ --disabled-opacity: 0.625;
150
+ --button-border-width: 0.125rem;
151
+ --tree-font-size: 1rem;
152
+
153
+ --form-label-text: 1rem;
154
+ --form-input-text: 1rem;
155
+ --form-input-gap: 0.5rem;
156
+ --form-gap: 1rem;
157
+
158
+ caret-color: var(--color-primary);
159
+ accent-color: var(--color-primary);
160
+ }
161
+
162
+ /* lucide icon global config */
163
+ .lucide {
164
+ width: 1rem;
165
+ aspect-ratio: 1/1;
166
+ stroke-width: 0.1875rem;
167
+ }
168
+
169
+ [data-disabled] {
170
+ cursor: not-allowed;
171
+ }
172
+
173
+ [data-disabled]:not([data-disabled] [data-disabled]) {
174
+ opacity: var(--disabled-opacity);
175
+ filter: grayscale(75%);
176
+ }
177
+
178
+ body {
179
+ background-color: var(--color-surface);
180
+ color: var(--color-on-surface);
181
+ font-family: var(--font-normal);
182
+ }
183
+
184
+ [data-heading] {
185
+ font-family: var(--font-heading);
186
+ font-weight: 700;
187
+ }
188
+
189
+ em,
190
+ i {
191
+ font-family: var(--font-normal);
192
+ font-style: italic;
193
+ }
@@ -0,0 +1,13 @@
1
+ import * as z from "zod";
2
+ interface FormValidateSuccessResult<T> {
3
+ success: true;
4
+ data: T;
5
+ }
6
+ interface FormValidateFailureResult<T> {
7
+ success: false;
8
+ errors: Partial<Record<keyof T, string | string[]>>;
9
+ }
10
+ type FormValidateResult<T> = FormValidateSuccessResult<T> | FormValidateFailureResult<T>;
11
+ export type ValidateAndGetFormValues = <T extends z.ZodObject<any>>(formElement: HTMLFormElement, schema: T) => FormValidateResult<z.infer<T>>;
12
+ export declare const validateAndGetFormValues: ValidateAndGetFormValues;
13
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adgytec/adgytec-web-ui-components",
3
3
  "private": false,
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -18,14 +18,15 @@
18
18
  "lint": "eslint .",
19
19
  "preview": "vite preview",
20
20
  "generate:exports": "node ./src/scripts/generate-exports.js",
21
- "publish": "npm run build && npm publish --public"
21
+ "release": "npm run build && npm publish --public"
22
22
  },
23
23
  "dependencies": {
24
24
  "lucide-react": "^0.525.0",
25
25
  "react": "^19.1.0",
26
26
  "react-aria-components": "^1.10.1",
27
27
  "react-dom": "^19.1.0",
28
- "usehooks-ts": "^3.1.1"
28
+ "usehooks-ts": "^3.1.1",
29
+ "zod": "^4.0.5"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@eslint/js": "^9.29.0",
@@ -44,7 +45,8 @@
44
45
  "typescript-eslint": "^8.34.1",
45
46
  "vite": "^7.0.0",
46
47
  "vite-plugin-dts": "^4.5.4",
47
- "vite-plugin-lib-inject-css": "^2.2.2"
48
+ "vite-plugin-lib-inject-css": "^2.2.2",
49
+ "vite-plugin-static-copy": "^3.1.1"
48
50
  },
49
51
  "author": {
50
52
  "name": "Adgytec",
@@ -1,33 +0,0 @@
1
- import { jsxs as a, jsx as s } from "react/jsx-runtime";
2
- import { TextField as c, Input as m } from "react-aria-components";
3
- import { L as p, F as d } from "./FieldError-CZn24fiL.js";
4
- import './assets/Input.css';const l = "_input_sezs4_1", u = "_editor_sezs4_11", o = {
5
- input: l,
6
- editor: u
7
- }, f = ({
8
- label: t,
9
- textFieldProps: e,
10
- inputProps: r,
11
- labelProps: i,
12
- fieldErrorProps: n
13
- }) => /* @__PURE__ */ a(
14
- c,
15
- {
16
- ...e,
17
- className: e?.className ?? o.input,
18
- children: [
19
- t && /* @__PURE__ */ s(p, { ...i, children: t }),
20
- /* @__PURE__ */ s(
21
- m,
22
- {
23
- ...r,
24
- className: r?.className ?? o.editor
25
- }
26
- ),
27
- /* @__PURE__ */ s(d, { ...n })
28
- ]
29
- }
30
- );
31
- export {
32
- f as I
33
- };
@@ -1,85 +0,0 @@
1
- import { jsxs as r, jsx as e, Fragment as n } from "react/jsx-runtime";
2
- import { O as q, F as B } from "./OutlinedButton-DaLKO8zx.js";
3
- import { B as l } from "./useSplash-7h6ni4l2.js";
4
- import { Select as N, SelectValue as m, ListBox as S, Text as d, ListBoxItem as T } from "react-aria-components";
5
- import { P as b } from "./Popover-D3iGWJwQ.js";
6
- import { ChevronsUpDown as V, Check as y } from "lucide-react";
7
- import { T as C } from "./TextButton-BJRez1un.js";
8
- import { C as p } from "./types-C1YOMbh5.js";
9
- import { T as F } from "./Tooltip-DAYtebkl.js";
10
- import { L as $, F as L } from "./FieldError-CZn24fiL.js";
11
- import './assets/Select.css';const D = "_select_3q7jl_1", w = "_trigger_3q7jl_31", i = {
12
- select: D,
13
- "selected-value": "_selected-value_3q7jl_11",
14
- "option-description": "_option-description_3q7jl_13",
15
- trigger: w,
16
- "options-list": "_options-list_3q7jl_45",
17
- "options-item-group": "_options-item-group_3q7jl_57",
18
- "options-item": "_options-item_3q7jl_57"
19
- }, J = ({
20
- options: h,
21
- label: a,
22
- name: u,
23
- disabled: _,
24
- isRequired: f,
25
- triggerVariant: g = l.filled,
26
- description: j,
27
- placeholder: c,
28
- selectedKey: x,
29
- onSelectionChange: k
30
- }) => {
31
- let s;
32
- switch (g) {
33
- case l.filled:
34
- s = B;
35
- break;
36
- case l.outlined:
37
- s = q;
38
- break;
39
- case l.text:
40
- s = C;
41
- break;
42
- }
43
- return /* @__PURE__ */ r(
44
- N,
45
- {
46
- className: i.select,
47
- isDisabled: _,
48
- isRequired: f,
49
- name: u,
50
- selectedKey: x,
51
- onSelectionChange: k,
52
- children: [
53
- a && /* @__PURE__ */ e($, { children: a }),
54
- /* @__PURE__ */ e(F, { description: j, theme: p.inverseSurface, children: /* @__PURE__ */ e(s, { theme: p.inverseSurface, children: /* @__PURE__ */ r("span", { className: i.trigger, children: [
55
- c ? /* @__PURE__ */ e(m, { className: `${i["selected-value"]}`, children: ({ defaultChildren: t, isPlaceholder: o }) => o ? c : t }) : /* @__PURE__ */ e(m, {}),
56
- /* @__PURE__ */ e(V, { size: 16, strokeWidth: 3 })
57
- ] }) }) }),
58
- /* @__PURE__ */ e(L, {}),
59
- /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(S, { className: `${i["options-list"]}`, items: h, children: (t) => {
60
- const o = /* @__PURE__ */ r(n, { children: [
61
- /* @__PURE__ */ e(d, { children: t.displayValue }),
62
- t.description && /* @__PURE__ */ e(d, { className: i["option-description"], children: t.description })
63
- ] });
64
- return /* @__PURE__ */ e(
65
- T,
66
- {
67
- className: `${i["options-item-group"]}`,
68
- id: t.key,
69
- textValue: t.displayValue,
70
- isDisabled: t.disabled,
71
- children: ({ isSelected: v }) => /* @__PURE__ */ r(n, { children: [
72
- /* @__PURE__ */ e("div", { className: `${i["options-item"]}`, children: o }),
73
- v && /* @__PURE__ */ e(y, { strokeWidth: 3 })
74
- ] })
75
- },
76
- t.key
77
- );
78
- } }) })
79
- ]
80
- }
81
- );
82
- };
83
- export {
84
- J as S
85
- };
@@ -1,35 +0,0 @@
1
- import { jsx as t, Fragment as u, jsxs as s } from "react/jsx-runtime";
2
- import { Tree as p, TreeItem as h, TreeItemContent as l } from "react-aria-components";
3
- import { ChevronRight as T } from "lucide-react";
4
- import './assets/Tree.css';const b = "_tree_1hbk9_1", o = {
5
- tree: b,
6
- "tree-item": "_tree-item_1hbk9_11"
7
- }, a = ({ item: e }) => {
8
- if (e.type === "separator") return /* @__PURE__ */ t(u, {});
9
- const r = e.type === "link", c = e.type === "button", d = e.type === "item-node", i = e.active;
10
- return /* @__PURE__ */ s(
11
- h,
12
- {
13
- textValue: e.id,
14
- target: e.target,
15
- onAction: e.onPress,
16
- href: e.href,
17
- className: o["tree-item"],
18
- ...r && { "data-link": !0 },
19
- ...c && { "data-button": !0 },
20
- ...d && { "data-node": !0 },
21
- ...i && { "data-active": !0 },
22
- children: [
23
- /* @__PURE__ */ s(l, { children: [
24
- e.node,
25
- e.subItems && /* @__PURE__ */ t(T, { strokeWidth: 3 })
26
- ] }),
27
- e.subItems && e.subItems.map((n) => /* @__PURE__ */ t(a, { item: n }, n.id))
28
- ]
29
- },
30
- e.id
31
- );
32
- }, _ = ({ items: e }) => /* @__PURE__ */ t(p, { className: o.tree, children: e.map((r) => /* @__PURE__ */ t(a, { item: r }, r.id)) });
33
- export {
34
- _ as T
35
- };