@konstructio/ui 0.0.12-alpha.1 → 0.0.12-alpha.3

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 (92) hide show
  1. package/dist/{Combination-BQYb0Gw7.js → Combination-b348x__d.js} +24 -24
  2. package/dist/{Modal-W2GbkC_F.js → Modal-ByNiP7eb.js} +316 -308
  3. package/dist/components/Alert/Alert.js +58 -0
  4. package/dist/components/Alert/Alert.variants.js +77 -0
  5. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  6. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  7. package/dist/components/AlertDialog/components/index.js +1 -1
  8. package/dist/components/Autocomplete/components/List/List.js +3 -3
  9. package/dist/components/Breadcrumb/Breadcrumb.js +3 -3
  10. package/dist/components/Breadcrumb/components/Item/Item.js +4 -4
  11. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  12. package/dist/components/Button/Button.js +1 -1
  13. package/dist/components/Card/Card.js +3 -3
  14. package/dist/components/Checkbox/Checkbox.js +5 -5
  15. package/dist/components/Command/Command.js +32 -0
  16. package/dist/components/Command/Command.variants.js +97 -0
  17. package/dist/components/Command/components/Command.js +8 -0
  18. package/dist/components/Command/components/CommandEmpty.js +15 -0
  19. package/dist/components/Command/components/CommandGroup.js +19 -0
  20. package/dist/components/Command/components/CommandInput.js +84 -0
  21. package/dist/components/Command/components/CommandItem.js +29 -0
  22. package/dist/components/Command/components/CommandList.js +16 -0
  23. package/dist/components/Command/components/CommandSeparator.js +16 -0
  24. package/dist/components/Command/components/CommandShortcut.js +19 -0
  25. package/dist/components/Command/components/DialogContent.js +31 -0
  26. package/dist/components/Command/components/DialogOverlay.js +19 -0
  27. package/dist/components/Command/components/index.js +20 -0
  28. package/dist/components/Command/contexts/Command.context.js +13 -0
  29. package/dist/components/Command/contexts/Command.provider.js +24 -0
  30. package/dist/components/Command/contexts/index.js +6 -0
  31. package/dist/components/Divider/Divider.js +10 -0
  32. package/dist/components/Divider/Divider.variants.js +14 -0
  33. package/dist/components/Loading/Loading.js +109 -0
  34. package/dist/components/Loading/Loading.variants.js +19 -0
  35. package/dist/components/Modal/Modal.js +2 -2
  36. package/dist/components/Modal/components/Body/Body.js +1 -1
  37. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  38. package/dist/components/Modal/components/Header/Header.js +1 -1
  39. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
  40. package/dist/components/Modal/components/index.js +1 -1
  41. package/dist/components/NumberInput/NumberInput.js +1 -1
  42. package/dist/components/ProgressBar/ProgressBar.js +3 -3
  43. package/dist/components/Radio/Radio.js +4 -4
  44. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  45. package/dist/components/Range/Range.js +4 -4
  46. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +3 -3
  47. package/dist/components/Slider/Slider.js +14 -14
  48. package/dist/components/Switch/Switch.js +17 -17
  49. package/dist/components/Tag/Tag.js +17 -5
  50. package/dist/components/Tag/Tag.variants.js +11 -1
  51. package/dist/components/TagSelect/TagSelect.js +6 -71
  52. package/dist/components/TagSelect/TagSelect.variants.js +29 -50
  53. package/dist/components/TagSelect/components/Item/Item.js +23 -0
  54. package/dist/components/TagSelect/components/Item/Item.variants.js +31 -0
  55. package/dist/components/TagSelect/components/List/List.js +13 -0
  56. package/dist/components/TagSelect/components/List/List.variants.js +37 -0
  57. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +88 -0
  58. package/dist/components/TagSelect/components/index.js +8 -0
  59. package/dist/components/TagSelect/contexts/TagSelect.context.js +19 -0
  60. package/dist/components/TagSelect/contexts/TagSelect.hook.js +11 -0
  61. package/dist/components/TagSelect/contexts/TagSelect.provider.js +69 -0
  62. package/dist/components/TagSelect/contexts/index.js +6 -0
  63. package/dist/components/TagSelect/hooks/useTagSelect.js +22 -27
  64. package/dist/components/Toast/Toast.js +11 -11
  65. package/dist/components/Tooltip/Tooltip.js +4 -4
  66. package/dist/components/Typography/Typography.js +31 -0
  67. package/dist/components/Typography/Typography.variants.js +63 -0
  68. package/dist/components/index.js +61 -53
  69. package/dist/{index-BxeV34ij.js → index-4ecjw_Aj.js} +1 -1
  70. package/dist/index-B_6_jmOO.js +68 -0
  71. package/dist/{index-BBjak_0p.js → index-BbsJ0VIJ.js} +2 -2
  72. package/dist/{index-CJsYodgi.js → index-BzaHYXkt.js} +9 -9
  73. package/dist/{index-KEdwcThH.js → index-CbTU3cnP.js} +1 -1
  74. package/dist/{index-8vgf-x5i.js → index-Cva-e5M4.js} +2 -2
  75. package/dist/index-CzSBQN5S.js +432 -0
  76. package/dist/index-D7QNmo_D.js +422 -0
  77. package/dist/index-DUA6Y_AE.js +126 -0
  78. package/dist/{index-CoqDsznq.js → index-D_76wh4w.js} +3 -3
  79. package/dist/{index-D4Q2rMby.js → index-Dj1pom3_.js} +2 -2
  80. package/dist/index-DyKo5ZJT.js +446 -0
  81. package/dist/index.d.ts +52 -3
  82. package/dist/index.js +76 -68
  83. package/dist/package.json +32 -29
  84. package/dist/plugins/konstruct.js +34 -31
  85. package/dist/plugins/utils/animation.styles.js +162 -0
  86. package/dist/plugins/utils/index.js +7 -0
  87. package/dist/styles.css +1 -1
  88. package/dist/{useBreadcrumb-CojbXFVD.js → useBreadcrumb-BsIeMoR1.js} +47 -47
  89. package/package.json +31 -29
  90. package/dist/index-1GLoikpT.js +0 -19134
  91. package/dist/index-BVppSRDQ.js +0 -551
  92. package/dist/index-DoOsnuB6.js +0 -72
@@ -1,73 +1,8 @@
1
- import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as g, useId as w, useRef as C, useImperativeHandle as T, useEffect as R } from "react";
3
- import { cn as r } from "../../utils/index.js";
4
- import { Tag as d } from "../Tag/Tag.js";
5
- import { useTagSelect as S } from "./hooks/useTagSelect.js";
6
- import { tagSelectVariants as k, tagListVariants as I, tagItemVariants as V } from "./TagSelect.variants.js";
7
- import { C as j } from "../../chevron-up-DgLBQCKD.js";
8
- import { useTheme as y } from "../../contexts/theme.hook.js";
9
- const z = g(({ label: s, name: l, options: f, placeholder: h = "Select a value...", theme: o }, x) => {
10
- const c = w(), { theme: a } = y(), t = C(null), {
11
- isOpen: n,
12
- selectedTag: m,
13
- value: p,
14
- wrapperRef: b,
15
- handleClickTag: N,
16
- handleOpenDropdown: v
17
- } = S();
18
- return T(x, () => t.current, [t]), R(() => {
19
- t.current && (t.current.value = p);
20
- }, [p]), /* @__PURE__ */ u("div", { ref: b, className: "flex flex-col w-full relative", children: [
21
- s ? /* @__PURE__ */ e("label", { className: "m-2 cursor-pointer", htmlFor: l ?? c, children: s }) : null,
22
- /* @__PURE__ */ u(
23
- "div",
24
- {
25
- id: l ?? c,
26
- className: r(k({ theme: o ?? a })),
27
- role: "combobox",
28
- onClick: v,
29
- "aria-expanded": n,
30
- children: [
31
- m ? /* @__PURE__ */ e(d, { ...m }) : /* @__PURE__ */ e("span", { className: "text-base text-inherit", children: h }),
32
- /* @__PURE__ */ e(
33
- j,
34
- {
35
- className: r(
36
- "w-4 h-4 text-inherit transition-all duration-50",
37
- n ? "rotate-0" : "rotate-180"
38
- )
39
- }
40
- )
41
- ]
42
- }
43
- ),
44
- /* @__PURE__ */ e("input", { ref: t, type: "text", name: l, className: "hidden" }),
45
- n ? /* @__PURE__ */ e(
46
- "ul",
47
- {
48
- role: "listbox",
49
- className: r(I({ theme: o ?? a })),
50
- children: f.map((i) => /* @__PURE__ */ e(
51
- "li",
52
- {
53
- className: r(V({ theme: o ?? a })),
54
- role: "option",
55
- children: /* @__PURE__ */ e(
56
- "button",
57
- {
58
- type: "button",
59
- role: "button",
60
- className: "m-0 p-0 w-full",
61
- onClick: () => N(i),
62
- children: /* @__PURE__ */ e(d, { label: i.label, color: i.color })
63
- }
64
- )
65
- }
66
- ))
67
- }
68
- ) : null
69
- ] });
70
- });
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as p } from "react";
3
+ import { TagSelectProvider as f } from "./contexts/TagSelect.provider.js";
4
+ import { Wrapper as i } from "./components/Wrapper/Wrapper.js";
5
+ const n = p(({ options: o, multiselect: e, ...t }, m) => /* @__PURE__ */ r(f, { defaultOptions: o, multiselect: e, children: /* @__PURE__ */ r(i, { ref: m, ...t }) }));
71
6
  export {
72
- z as TagSelect
7
+ n as TagSelect
73
8
  };
@@ -1,27 +1,11 @@
1
1
  import { c as e } from "../../index-BNmRGtA6.js";
2
- const t = e(
3
- [
4
- "border",
5
- "cursor-pointer",
6
- "duration-250",
7
- "ease-in-out",
8
- "flex",
9
- "items-center",
10
- "justify-between",
11
- "px-3",
12
- "py-1",
13
- "rounded-md",
14
- "transition-all",
15
- "w-full"
16
- ],
2
+ const r = e(
3
+ ["flex", "flex-col", "w-full", "relative", "text-zinc-500"],
17
4
  {
18
5
  variants: {
19
6
  theme: {
20
- colony: ["aria-expanded:border-red-400", "aria-expanded:text-red-400"],
21
- kubefirst: [
22
- "aria-expanded:border-kubefirst-primary",
23
- "aria-expanded:text-kubefirst-secondary"
24
- ],
7
+ colony: "",
8
+ kubefirst: "",
25
9
  civo: ""
26
10
  }
27
11
  },
@@ -29,42 +13,37 @@ const t = e(
29
13
  theme: "kubefirst"
30
14
  }
31
15
  }
32
- ), a = e(
16
+ ), a = e(["my-2", "cursor-pointer"], {
17
+ variants: {
18
+ theme: {
19
+ colony: "",
20
+ kubefirst: "",
21
+ civo: ""
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ theme: "kubefirst"
26
+ }
27
+ }), i = e(
33
28
  [
34
- "absolute",
35
- "bg-white",
36
29
  "border",
37
- "duration-100",
30
+ "cursor-pointer",
31
+ "duration-250",
38
32
  "ease-in-out",
39
33
  "flex",
40
- "flex-col",
41
- "mt-1",
42
- "rounded-md",
43
- "shadow-sm",
44
- "top-full",
34
+ "items-center",
35
+ "justify-between",
36
+ "px-2",
37
+ "py-1",
38
+ "rounded",
45
39
  "transition-all",
46
- "w-full",
47
- "z-10"
40
+ "w-full"
48
41
  ],
49
42
  {
50
43
  variants: {
51
44
  theme: {
52
- colony: ["border-red-400"],
53
- kubefirst: ["border-kubefirst-primary"],
54
- civo: ""
55
- }
56
- },
57
- defaultVariants: {
58
- theme: "kubefirst"
59
- }
60
- }
61
- ), i = e(
62
- ["cursor-pointer", "py-1", "px-2", "last:mb-2", "first:mt-2", "h-full"],
63
- {
64
- variants: {
65
- theme: {
66
- colony: "hover:bg-red-100",
67
- kubefirst: "hover:bg-purple-100",
45
+ colony: "",
46
+ kubefirst: "",
68
47
  civo: ""
69
48
  }
70
49
  },
@@ -74,7 +53,7 @@ const t = e(
74
53
  }
75
54
  );
76
55
  export {
77
- i as tagItemVariants,
78
- a as tagListVariants,
79
- t as tagSelectVariants
56
+ a as labelVariants,
57
+ i as tagSelectVariants,
58
+ r as wrapperVariants
80
59
  };
@@ -0,0 +1,23 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Tag as i } from "../../../Tag/Tag.js";
3
+ import { cn as c } from "../../../../utils/index.js";
4
+ import { wrapperVariants as n } from "./Item.variants.js";
5
+ import { useTagSelect as s } from "../../contexts/TagSelect.hook.js";
6
+ import { useTheme as h } from "../../../../contexts/theme.hook.js";
7
+ const g = ({ option: e, theme: r }) => {
8
+ const { theme: m } = h(), { onSelectTag: o } = s();
9
+ return /* @__PURE__ */ t(
10
+ "li",
11
+ {
12
+ role: "option",
13
+ className: c(
14
+ n({ theme: r ?? m, isSelected: e.isSelected })
15
+ ),
16
+ onClick: () => o(e),
17
+ children: /* @__PURE__ */ t(i, { ...e })
18
+ }
19
+ );
20
+ };
21
+ export {
22
+ g as Item
23
+ };
@@ -0,0 +1,31 @@
1
+ import { c as e } from "../../../../index-BNmRGtA6.js";
2
+ const r = e(
3
+ ["cursor-pointer", "py-1.5", "px-2", "last:pb-2", "first:pt-2", "h-full"],
4
+ {
5
+ variants: {
6
+ theme: {
7
+ colony: "",
8
+ kubefirst: ["hover:bg-purple-100"],
9
+ civo: ""
10
+ },
11
+ isSelected: {
12
+ true: "",
13
+ false: ""
14
+ }
15
+ },
16
+ compoundVariants: [
17
+ {
18
+ theme: "kubefirst",
19
+ isSelected: !0,
20
+ class: ["bg-purple-100"]
21
+ }
22
+ ],
23
+ defaultVariants: {
24
+ theme: "kubefirst",
25
+ isSelected: !1
26
+ }
27
+ }
28
+ );
29
+ export {
30
+ r as wrapperVariants
31
+ };
@@ -0,0 +1,13 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { cn as i } from "../../../../utils/index.js";
3
+ import { Item as n } from "../Item/Item.js";
4
+ import { wrapperVariants as p } from "./List.variants.js";
5
+ import { useTagSelect as a } from "../../contexts/TagSelect.hook.js";
6
+ import { useTheme as c } from "../../../../contexts/theme.hook.js";
7
+ const d = ({ theme: m }) => {
8
+ const { tags: t } = a(), { theme: s } = c(), o = m ?? s;
9
+ return /* @__PURE__ */ e("ul", { role: "listbox", className: i(p({ theme: o })), children: t.length > 0 ? t.map((r) => /* @__PURE__ */ e(n, { theme: o, option: r }, r.id)) : /* @__PURE__ */ e("span", { className: "text-center text-sm px-4 py-2", children: "There is not options available" }) });
10
+ };
11
+ export {
12
+ d as List
13
+ };
@@ -0,0 +1,37 @@
1
+ import { c as e } from "../../../../index-BNmRGtA6.js";
2
+ const t = e(
3
+ [
4
+ "absolute",
5
+ "bg-white",
6
+ "border",
7
+ "duration-100",
8
+ "flex",
9
+ "flex-col",
10
+ "mt-0.5",
11
+ "rounded",
12
+ "shadow-sm",
13
+ "top-full",
14
+ "transition-all",
15
+ "w-full",
16
+ "z-10",
17
+ "animate-in",
18
+ "fade-in-60",
19
+ "zoom-in-95",
20
+ "overflow-hidden"
21
+ ],
22
+ {
23
+ variants: {
24
+ theme: {
25
+ colony: "",
26
+ kubefirst: "",
27
+ civo: ""
28
+ }
29
+ },
30
+ defaultVariants: {
31
+ theme: "kubefirst"
32
+ }
33
+ }
34
+ );
35
+ export {
36
+ t as wrapperVariants
37
+ };
@@ -0,0 +1,88 @@
1
+ import "../Item/Item.js";
2
+ import { List as w } from "../List/List.js";
3
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
4
+ import { forwardRef as C, useId as b, useImperativeHandle as S } from "react";
5
+ import { Tag as k } from "../../../Tag/Tag.js";
6
+ import { cn as a } from "../../../../utils/index.js";
7
+ import { useTagSelect as R } from "../../hooks/useTagSelect.js";
8
+ import { labelVariants as I, tagSelectVariants as O, wrapperVariants as V } from "../../TagSelect.variants.js";
9
+ import { X as j } from "../../../../x-DU-Zw-L_.js";
10
+ import { C as y } from "../../../../chevron-up-DgLBQCKD.js";
11
+ import { useTheme as F } from "../../../../contexts/theme.hook.js";
12
+ import { useTagSelect as H } from "../../contexts/TagSelect.hook.js";
13
+ const J = C(
14
+ ({
15
+ label: n,
16
+ labelClassName: p,
17
+ name: s,
18
+ placeholder: h = "Select a value...",
19
+ theme: d,
20
+ wrapperClassName: f
21
+ }, u) => {
22
+ const l = b(), { theme: x } = F(), { selectedTags: m, isOpen: o, onOpen: N, onRemoveTag: v, inputRef: i } = H(), { wrapperRef: T, handleOpen: g } = R(), t = d ?? x;
23
+ return S(u, () => i.current, [i]), /* @__PURE__ */ c(
24
+ "div",
25
+ {
26
+ ref: T,
27
+ className: a(
28
+ V({
29
+ theme: t,
30
+ className: f
31
+ })
32
+ ),
33
+ children: [
34
+ n ? /* @__PURE__ */ e(
35
+ "label",
36
+ {
37
+ htmlFor: s ?? l,
38
+ className: a(
39
+ I({
40
+ theme: t,
41
+ className: p
42
+ })
43
+ ),
44
+ onClick: () => N(!0),
45
+ children: n
46
+ }
47
+ ) : null,
48
+ /* @__PURE__ */ c(
49
+ "div",
50
+ {
51
+ id: s ?? l,
52
+ className: a(O({ theme: t })),
53
+ role: "combobox",
54
+ onClick: g,
55
+ "aria-expanded": o,
56
+ children: [
57
+ m.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: h }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: m.map((r) => /* @__PURE__ */ e(
58
+ k,
59
+ {
60
+ ...r,
61
+ className: "select-none",
62
+ rightIcon: /* @__PURE__ */ e(j, { className: "w-3 h-3", onClick: () => v(r) }),
63
+ "data-value": r.label
64
+ },
65
+ r.id
66
+ )) }),
67
+ /* @__PURE__ */ e(
68
+ y,
69
+ {
70
+ className: a(
71
+ "w-4 h-4 text-inherit transition-all duration-50 shrink-0",
72
+ o ? "rotate-0" : "rotate-180"
73
+ )
74
+ }
75
+ )
76
+ ]
77
+ }
78
+ ),
79
+ /* @__PURE__ */ e("input", { ref: i, type: "text", name: s, className: "hidden" }),
80
+ o ? /* @__PURE__ */ e(w, { theme: t }) : null
81
+ ]
82
+ }
83
+ );
84
+ }
85
+ );
86
+ export {
87
+ J as Wrapper
88
+ };
@@ -0,0 +1,8 @@
1
+ import { Item as e } from "./Item/Item.js";
2
+ import { List as t } from "./List/List.js";
3
+ import { Wrapper as f } from "./Wrapper/Wrapper.js";
4
+ export {
5
+ e as Item,
6
+ t as List,
7
+ f as Wrapper
8
+ };
@@ -0,0 +1,19 @@
1
+ import { createContext as e } from "react";
2
+ const t = {
3
+ tags: [],
4
+ selectedTags: [],
5
+ isOpen: !1,
6
+ inputRef: null,
7
+ onSelectTag() {
8
+ throw new Error("Function not implemented.");
9
+ },
10
+ onRemoveTag() {
11
+ throw new Error("Function not implemented.");
12
+ },
13
+ onOpen() {
14
+ throw new Error("Function not implemented.");
15
+ }
16
+ }, o = e(t);
17
+ export {
18
+ o as TagSelectContext
19
+ };
@@ -0,0 +1,11 @@
1
+ import { useContext as t } from "react";
2
+ import { TagSelectContext as o } from "./TagSelect.context.js";
3
+ const c = () => {
4
+ const e = t(o);
5
+ if (!e)
6
+ throw new Error("useTagSelect must be used within a TagSelectProvider");
7
+ return e;
8
+ };
9
+ export {
10
+ c as useTagSelect
11
+ };
@@ -0,0 +1,69 @@
1
+ import { jsx as I } from "react/jsx-runtime";
2
+ import { useRef as R, useState as T, useCallback as l } from "react";
3
+ import { TagSelectContext as x } from "./TagSelect.context.js";
4
+ import { useToggle as w } from "../../../hooks/useToggle.js";
5
+ const k = ({
6
+ children: m,
7
+ defaultOptions: n = [],
8
+ multiselect: d = !0
9
+ }) => {
10
+ const i = R(null), [p, a] = w(!1), [S, g] = T(n), [r, u] = T([]), o = l((t) => {
11
+ if (i.current) {
12
+ const s = t.map(({ id: c, label: e }) => ({
13
+ id: c,
14
+ value: e
15
+ }));
16
+ i.current.value = JSON.stringify(s);
17
+ }
18
+ }, []), f = l(
19
+ (t) => {
20
+ const s = [...d ? r : [], t];
21
+ u(s);
22
+ const c = s.map((e) => e.id);
23
+ g(() => d ? n.filter(
24
+ (e) => !c.includes(e.id)
25
+ ) : n.map((e) => ({
26
+ ...e,
27
+ isSelected: c.includes(e.id)
28
+ }))), o(s), a(!1);
29
+ },
30
+ [
31
+ n,
32
+ o,
33
+ d,
34
+ r,
35
+ a
36
+ ]
37
+ ), v = l(
38
+ (t) => {
39
+ const s = r.filter((e) => e.id !== t.id);
40
+ u(s);
41
+ const c = s.map((e) => e.id);
42
+ g(
43
+ () => n.filter((e) => !c.includes(e.id))
44
+ ), o(s);
45
+ },
46
+ [n, o, r]
47
+ ), h = l(
48
+ (t) => a(t),
49
+ [a]
50
+ );
51
+ return /* @__PURE__ */ I(
52
+ x.Provider,
53
+ {
54
+ value: {
55
+ tags: S,
56
+ selectedTags: r,
57
+ isOpen: p,
58
+ inputRef: i,
59
+ onSelectTag: f,
60
+ onRemoveTag: v,
61
+ onOpen: h
62
+ },
63
+ children: m
64
+ }
65
+ );
66
+ };
67
+ export {
68
+ k as TagSelectProvider
69
+ };
@@ -0,0 +1,6 @@
1
+ import { useTagSelect as o } from "./TagSelect.hook.js";
2
+ import { TagSelectProvider as a } from "./TagSelect.provider.js";
3
+ export {
4
+ a as TagSelectProvider,
5
+ o as useTagSelect
6
+ };
@@ -1,39 +1,34 @@
1
- import { useRef as b, useState as o, useEffect as k, useCallback as a } from "react";
2
- import { useToggle as w } from "../../../hooks/useToggle.js";
3
- const C = () => {
4
- const t = b(null), [r, e] = w(!1), [c, d] = o(null), [u, i] = o("");
5
- k(() => {
6
- const n = new AbortController(), p = (s) => {
1
+ import { useRef as c, useEffect as u, useCallback as i } from "react";
2
+ import { useTagSelect as d } from "../contexts/TagSelect.hook.js";
3
+ const g = () => {
4
+ const a = c(null), { onOpen: e } = d();
5
+ u(() => {
6
+ const t = new AbortController(), n = (s) => {
7
7
  s.key === "Escape" && e(!1);
8
- }, m = (s) => {
9
- var l;
10
- (l = t.current) != null && l.contains(s.target) || e(!1);
8
+ }, o = (s) => {
9
+ var r;
10
+ (r = a.current) != null && r.contains(s.target) || e(!1);
11
11
  };
12
- return document.addEventListener("keydown", p, {
13
- signal: n.signal
14
- }), document.addEventListener("mousedown", m, {
15
- signal: n.signal
12
+ return document.addEventListener("keydown", n, {
13
+ signal: t.signal
14
+ }), document.addEventListener("mousedown", o, {
15
+ signal: t.signal
16
16
  }), () => {
17
- n.abort();
17
+ t.abort();
18
18
  };
19
- }, [e, t]);
20
- const f = a(() => {
21
- e();
22
- }, [e]), g = a(
23
- (n) => {
24
- d(n), e(!1), i(n.label);
19
+ }, [e, a]);
20
+ const l = i(
21
+ (t) => {
22
+ const n = t.target;
23
+ (n == null ? void 0 : n.closest("[data-value]")) || e(!0);
25
24
  },
26
25
  [e]
27
26
  );
28
27
  return {
29
- isOpen: r,
30
- selectedTag: c,
31
- value: u,
32
- wrapperRef: t,
33
- handleClickTag: g,
34
- handleOpenDropdown: f
28
+ wrapperRef: a,
29
+ handleOpen: l
35
30
  };
36
31
  };
37
32
  export {
38
- C as useTagSelect
33
+ g as useTagSelect
39
34
  };
@@ -1,15 +1,15 @@
1
- import { jsxs as D, jsx as c, Fragment as se } from "react/jsx-runtime";
2
- import { u as ae, S as j } from "../../index-DoOsnuB6.js";
1
+ import { jsx as c, jsxs as D, Fragment as se } from "react/jsx-runtime";
2
+ import { u as ae, S as j } from "../../index-B_6_jmOO.js";
3
3
  import * as s from "react";
4
4
  import { useState as Re, useRef as be, useEffect as ge, useMemo as oe, isValidElement as re, useCallback as Se } from "react";
5
- import { P as L, r as Ie, d as Ne } from "../../index-1GLoikpT.js";
6
- import { c as Ae, a as Fe, b as X, d as b, u as _e } from "../../index-8vgf-x5i.js";
7
- import { c as De } from "../../index-BBjak_0p.js";
8
- import { B as Le, R as Oe, P as Me } from "../../index-CoqDsznq.js";
9
- import { P as ke } from "../../index-D4Q2rMby.js";
10
- import { V as ie, R as Ve } from "../../index-KEdwcThH.js";
5
+ import { P as L, r as Ie, d as Ne } from "../../index-D7QNmo_D.js";
6
+ import { c as Ae, a as Fe, b, d as X, u as _e } from "../../index-Cva-e5M4.js";
7
+ import { c as De } from "../../index-BbsJ0VIJ.js";
8
+ import { B as Le, R as Oe, P as Me } from "../../index-D_76wh4w.js";
9
+ import { P as ke } from "../../index-Dj1pom3_.js";
10
+ import { V as ie, R as Ve } from "../../index-CbTU3cnP.js";
11
11
  import { cn as q } from "../../utils/index.js";
12
- import { toastVariants as Ke, closeToastVariants as He, viewportToastVariants as We } from "./Toast.variants.js";
12
+ import { closeToastVariants as Ke, toastVariants as He, viewportToastVariants as We } from "./Toast.variants.js";
13
13
  import { X as Xe } from "../../x-DU-Zw-L_.js";
14
14
  import { useTheme as $e } from "../../contexts/theme.hook.js";
15
15
  var Z = "ToastProvider", [ee, Ue, Ye] = De("Toast"), [ce, gt] = Ae("Toast", [Ye]), [Be, $] = ce(Z), ue = (e) => {
@@ -452,14 +452,14 @@ const St = ({
452
452
  /* @__PURE__ */ D(
453
453
  ut,
454
454
  {
455
- className: q(Ke({ theme: R, className: v })),
455
+ className: q(He({ theme: R, className: v })),
456
456
  open: n,
457
457
  onOpenChange: w,
458
458
  children: [
459
459
  /* @__PURE__ */ c(lt, { asChild: !0, className: "text-lg mb-2 font-semibold", children: g }),
460
460
  /* @__PURE__ */ c(dt, { asChild: !0, children: l }),
461
461
  m && /* @__PURE__ */ c(ft, { asChild: !0, altText: "Close the toast", children: /* @__PURE__ */ D("button", { type: "button", className: "absolute right-1.5 top-1.5", children: [
462
- /* @__PURE__ */ c(Xe, { className: q(He({ theme: R })) }),
462
+ /* @__PURE__ */ c(Xe, { className: q(Ke({ theme: R })) }),
463
463
  /* @__PURE__ */ c(Ve, { children: "Close toast" })
464
464
  ] }) })
465
465
  ]
@@ -1,8 +1,8 @@
1
1
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import { forwardRef as N, useRef as w, useImperativeHandle as x, useMemo as R, isValidElement as T } from "react";
3
- import { S as a } from "../../index-DoOsnuB6.js";
3
+ import { S as a } from "../../index-B_6_jmOO.js";
4
4
  import { cn as o } from "../../utils/index.js";
5
- import { tooltipVariants as V, arrowVariants as b } from "./Tooltip.variants.js";
5
+ import { arrowVariants as V, tooltipVariants as b } from "./Tooltip.variants.js";
6
6
  import { useTooltip as j } from "./hooks/useTooltip.js";
7
7
  import { useTheme as C } from "../../contexts/theme.hook.js";
8
8
  const q = N(
@@ -19,13 +19,13 @@ const q = N(
19
19
  "div",
20
20
  {
21
21
  ref: d,
22
- className: o(V({ theme: m, position: s })),
22
+ className: o(b({ theme: m, position: s })),
23
23
  "data-visible": u,
24
24
  children: [
25
25
  /* @__PURE__ */ e(
26
26
  "span",
27
27
  {
28
- className: o(b({ theme: m, position: s }))
28
+ className: o(V({ theme: m, position: s }))
29
29
  }
30
30
  ),
31
31
  /* @__PURE__ */ e(a, { children: l })
@@ -0,0 +1,31 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { useId as d } from "react";
3
+ import { typographyVariants as f } from "./Typography.variants.js";
4
+ import { useTheme as n } from "../../contexts/theme.hook.js";
5
+ const u = ({
6
+ className: e,
7
+ theme: m,
8
+ children: p,
9
+ variant: o,
10
+ component: s,
11
+ ...t
12
+ }) => {
13
+ const r = d(), { theme: h } = n(), y = s ?? (o != null && o.includes("h") ? o : "p");
14
+ return /* @__PURE__ */ c(
15
+ y,
16
+ {
17
+ id: r,
18
+ className: f({
19
+ className: e,
20
+ theme: m ?? h,
21
+ variant: o
22
+ }),
23
+ ...t,
24
+ children: p
25
+ }
26
+ );
27
+ };
28
+ u.displayName = "Typography";
29
+ export {
30
+ u as Typography
31
+ };