@konstructio/ui 0.0.12-alpha.9 → 0.0.13-alpha.1

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 (144) hide show
  1. package/dist/{Modal-B-E9uaA6.js → Modal-i7eolhYH.js} +311 -307
  2. package/dist/components/Alert/Alert.js +24 -29
  3. package/dist/components/Alert/Alert.variants.js +9 -15
  4. package/dist/components/AlertDialog/AlertDialog.js +59 -46
  5. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +2 -2
  6. package/dist/components/AlertDialog/components/index.js +1 -1
  7. package/dist/components/Autocomplete/Autocomplete.js +76 -72
  8. package/dist/components/Autocomplete/Autocomplete.variants.js +11 -20
  9. package/dist/components/Autocomplete/components/List/List.js +28 -30
  10. package/dist/components/Autocomplete/components/List/List.variants.js +34 -40
  11. package/dist/components/Breadcrumb/Breadcrumb.js +47 -56
  12. package/dist/components/Breadcrumb/Breadcrumb.variants.js +6 -26
  13. package/dist/components/Breadcrumb/components/Item/Item.js +29 -41
  14. package/dist/components/Breadcrumb/components/Item/Item.variants.js +2 -20
  15. package/dist/components/Button/Button.js +33 -37
  16. package/dist/components/Button/Button.variants.js +138 -195
  17. package/dist/components/Card/Card.js +32 -37
  18. package/dist/components/Card/Card.variants.js +18 -53
  19. package/dist/components/Checkbox/Checkbox.js +65 -68
  20. package/dist/components/Checkbox/Checkbox.variants.js +11 -35
  21. package/dist/components/Command/Command.js +33 -25
  22. package/dist/components/Command/Command.variants.js +47 -94
  23. package/dist/components/Command/components/Command.js +1 -1
  24. package/dist/components/Command/components/CommandEmpty.js +1 -1
  25. package/dist/components/Command/components/CommandGroup.js +1 -1
  26. package/dist/components/Command/components/CommandInput.js +1 -1
  27. package/dist/components/Command/components/CommandItem.js +1 -1
  28. package/dist/components/Command/components/CommandList.js +1 -1
  29. package/dist/components/Command/components/CommandSeparator.js +1 -1
  30. package/dist/components/Command/components/DialogContent.js +1 -1
  31. package/dist/components/Command/components/DialogOverlay.js +8 -8
  32. package/dist/components/Divider/Divider.js +3 -2
  33. package/dist/components/Divider/Divider.variants.js +12 -9
  34. package/dist/components/Dropdown/Dropdown.js +6 -6
  35. package/dist/components/Dropdown/Dropdown.variants.js +31 -38
  36. package/dist/components/Dropdown/components/List/List.js +17 -15
  37. package/dist/components/Dropdown/components/List/List.variants.js +22 -32
  38. package/dist/components/Dropdown/components/ListItem/ListItem.js +20 -19
  39. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +18 -30
  40. package/dist/components/Dropdown/components/Wrapper.js +127 -90
  41. package/dist/components/Dropdown/contexts/dropdown.context.js +1 -1
  42. package/dist/components/Dropdown/contexts/dropdown.provider.js +9 -9
  43. package/dist/components/Input/Input.js +37 -37
  44. package/dist/components/Input/Input.variants.js +8 -13
  45. package/dist/components/Loading/Loading.js +60 -58
  46. package/dist/components/Loading/Loading.variants.js +9 -15
  47. package/dist/components/Modal/Modal.js +2 -2
  48. package/dist/components/Modal/components/Body/Body.js +1 -1
  49. package/dist/components/Modal/components/Footer/Footer.js +2 -2
  50. package/dist/components/Modal/components/Header/Header.js +3 -3
  51. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -4
  52. package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +32 -46
  53. package/dist/components/Modal/components/index.js +1 -1
  54. package/dist/components/NumberInput/NumberInput.js +93 -111
  55. package/dist/components/NumberInput/NumberInput.variants.js +30 -51
  56. package/dist/components/ProgressBar/ProgressBar.js +25 -29
  57. package/dist/components/ProgressBar/ProgressBar.variants.js +10 -31
  58. package/dist/components/Radio/Radio.js +45 -46
  59. package/dist/components/Radio/Radio.variants.js +4 -13
  60. package/dist/components/RadioCard/RadioCard.js +31 -37
  61. package/dist/components/RadioCard/RadioCard.variants.js +8 -17
  62. package/dist/components/RadioCardGroup/RadioCardGroup.js +22 -23
  63. package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +3 -9
  64. package/dist/components/RadioGroup/RadioGroup.js +30 -31
  65. package/dist/components/RadioGroup/RadioGroup.variants.js +2 -8
  66. package/dist/components/Range/Range.js +28 -34
  67. package/dist/components/Range/Range.variants.js +21 -53
  68. package/dist/components/Sidebar/Sidebar.js +12 -13
  69. package/dist/components/Sidebar/Sidebar.variants.js +30 -56
  70. package/dist/components/Sidebar/components/Footer/Footer.js +5 -17
  71. package/dist/components/Sidebar/components/Footer/Footer.variants.js +9 -16
  72. package/dist/components/Sidebar/components/Logo/Logo.js +5 -15
  73. package/dist/components/Sidebar/components/Logo/Logo.variants.js +20 -36
  74. package/dist/components/Sidebar/components/Navigation/Navigation.js +15 -28
  75. package/dist/components/Sidebar/components/Navigation/Navigation.variants.js +3 -17
  76. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +21 -34
  77. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +2 -13
  78. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +21 -27
  79. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +7 -17
  80. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +7 -19
  81. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +6 -16
  82. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +8 -21
  83. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +11 -20
  84. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +41 -44
  85. package/dist/components/Slider/Slider.js +26 -27
  86. package/dist/components/Slider/Slider.variants.js +22 -34
  87. package/dist/components/Switch/Switch.js +103 -106
  88. package/dist/components/Switch/Switch.variants.js +28 -53
  89. package/dist/components/Table/Table.js +27 -0
  90. package/dist/components/Table/Table.variants.js +40 -0
  91. package/dist/components/Table/components/Body.js +18 -0
  92. package/dist/components/Table/components/Filter.js +9 -0
  93. package/dist/components/Table/components/Head.js +18 -0
  94. package/dist/components/Table/components/Row.js +28 -0
  95. package/dist/components/Table/components/index.js +10 -0
  96. package/dist/components/Tag/Tag.js +1 -1
  97. package/dist/components/TagSelect/TagSelect.variants.js +23 -55
  98. package/dist/components/TagSelect/components/Item/Item.js +12 -14
  99. package/dist/components/TagSelect/components/Item/Item.variants.js +11 -10
  100. package/dist/components/TagSelect/components/List/List.js +9 -10
  101. package/dist/components/TagSelect/components/List/List.variants.js +21 -35
  102. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +46 -48
  103. package/dist/components/TextArea/TextArea.js +20 -23
  104. package/dist/components/TextArea/TextArea.variants.js +19 -31
  105. package/dist/components/Toast/Toast.js +110 -116
  106. package/dist/components/Toast/Toast.variants.js +42 -70
  107. package/dist/components/Tooltip/Tooltip.js +21 -27
  108. package/dist/components/Tooltip/Tooltip.variants.js +61 -62
  109. package/dist/components/Typography/Typography.js +23 -19
  110. package/dist/components/Typography/Typography.variants.js +1 -7
  111. package/dist/components/index.js +22 -20
  112. package/dist/contexts/theme.provider.js +37 -39
  113. package/dist/domain/theme.js +0 -0
  114. package/dist/index-AM3avohj.js +133 -0
  115. package/dist/{index-BzaHYXkt.js → index-BOx5P4tS.js} +5 -5
  116. package/dist/index-Bk324h27.js +82 -0
  117. package/dist/{index-4ecjw_Aj.js → index-Bry5AFQ2.js} +1 -1
  118. package/dist/{index-CbTU3cnP.js → index-CWKdynYu.js} +1 -1
  119. package/dist/index-D9BbbgUq.js +47 -0
  120. package/dist/{index-DyKo5ZJT.js → index-DvFiic6N.js} +45 -45
  121. package/dist/{index-Dj1pom3_.js → index-G_6jG4Qc.js} +2 -2
  122. package/dist/{index-D_76wh4w.js → index-YaQrdkGE.js} +3 -3
  123. package/dist/{index-Cva-e5M4.js → index-bYyfdsls.js} +9 -9
  124. package/dist/index-dRxIWVBr.js +313 -0
  125. package/dist/{index-D7QNmo_D.js → index-g-TFwd6Y.js} +41 -41
  126. package/dist/index.d.ts +115 -98
  127. package/dist/index.js +30 -30
  128. package/dist/package.json +37 -36
  129. package/dist/styles.css +1 -1
  130. package/dist/ui/kubefirst-theme.css +296 -0
  131. package/dist/ui/theme.css +6 -0
  132. package/dist/ui/utilities.css +165 -0
  133. package/dist/utils/index.js +675 -424
  134. package/package.json +37 -36
  135. package/dist/components/AlertDialog/AlertDialog.variants.js +0 -15
  136. package/dist/index-B_6_jmOO.js +0 -68
  137. package/dist/index-BbsJ0VIJ.js +0 -47
  138. package/dist/index-CzSBQN5S.js +0 -432
  139. package/dist/index-DUA6Y_AE.js +0 -126
  140. package/dist/plugins/index.js +0 -4
  141. package/dist/plugins/konstruct.js +0 -118
  142. package/dist/plugins/utils/animation.styles.js +0 -162
  143. package/dist/plugins/utils/colors.js +0 -331
  144. package/dist/plugins/utils/index.js +0 -7
@@ -0,0 +1,27 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { cn as i } from "../../utils/index.js";
3
+ import { tableVariants as p } from "./Table.variants.js";
4
+ import { Body as f } from "./components/Body.js";
5
+ import { Filter as l } from "./components/Filter.js";
6
+ import { Head as d } from "./components/Head.js";
7
+ import { Row as s } from "./components/Row.js";
8
+ const o = ({ children: r, className: m, theme: t, ...a }) => /* @__PURE__ */ e(
9
+ "table",
10
+ {
11
+ className: i(
12
+ p({
13
+ className: m
14
+ })
15
+ ),
16
+ "data-theme": t,
17
+ ...a,
18
+ children: r
19
+ }
20
+ );
21
+ o.Body = f;
22
+ o.Filter = l;
23
+ o.Head = d;
24
+ o.Row = s;
25
+ export {
26
+ o as Table
27
+ };
@@ -0,0 +1,40 @@
1
+ import { c as t } from "../../index-BNmRGtA6.js";
2
+ const r = t([
3
+ "table-auto",
4
+ "w-full",
5
+ "border-collapse",
6
+ "border-spacing-0",
7
+ "rounded",
8
+ "shadow-sm"
9
+ ]), a = t(
10
+ [
11
+ "h-8",
12
+ "text-inherit",
13
+ "[&>td]:py-3",
14
+ "[&>td]:px-4",
15
+ "text-slate-700",
16
+ "hover:bg-zinc-100",
17
+ "hover:cursor-pointer"
18
+ ],
19
+ {
20
+ variants: {
21
+ isSelected: {
22
+ true: "bg-purple-50",
23
+ false: ""
24
+ }
25
+ }
26
+ }
27
+ ), s = t([
28
+ "h-[18px]",
29
+ "bg-slate-100",
30
+ "[&>tr>th]:py-3",
31
+ "[&>tr>th]:px-4",
32
+ "[&>tr>th]:uppercase",
33
+ "text-left"
34
+ ]), o = t([]);
35
+ export {
36
+ o as bodyVariants,
37
+ s as headVariants,
38
+ a as rowVariants,
39
+ r as tableVariants
40
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { cn as s } from "../../../utils/index.js";
3
+ import { bodyVariants as a } from "../Table.variants.js";
4
+ const d = ({ children: o, className: r, ...m }) => /* @__PURE__ */ t(
5
+ "tbody",
6
+ {
7
+ className: s(
8
+ a({
9
+ className: r
10
+ })
11
+ ),
12
+ ...m,
13
+ children: o
14
+ }
15
+ );
16
+ export {
17
+ d as Body
18
+ };
@@ -0,0 +1,9 @@
1
+ import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
+ import { Input as i } from "../../Input/Input.js";
3
+ const o = ({ children: e, ...r }) => /* @__PURE__ */ t("div", { className: "flex px-4 py-6 rounded-t", children: [
4
+ /* @__PURE__ */ s(i, { className: "!w-1/3", ...r }),
5
+ /* @__PURE__ */ s("div", { className: "w-1/4 flex justify-end", children: e })
6
+ ] });
7
+ export {
8
+ o as Filter
9
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { cn as t } from "../../../utils/index.js";
3
+ import { headVariants as e } from "../Table.variants.js";
4
+ const c = ({ children: o, className: r, ...a }) => /* @__PURE__ */ m(
5
+ "thead",
6
+ {
7
+ className: t(
8
+ e({
9
+ className: r
10
+ })
11
+ ),
12
+ ...a,
13
+ children: o
14
+ }
15
+ );
16
+ export {
17
+ c as Head
18
+ };
@@ -0,0 +1,28 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { cn as c } from "../../../utils/index.js";
3
+ import { rowVariants as n } from "../Table.variants.js";
4
+ const l = ({
5
+ children: o,
6
+ className: r,
7
+ width: t,
8
+ isSelected: m,
9
+ onSelect: s,
10
+ ...i
11
+ }) => /* @__PURE__ */ a(
12
+ "tr",
13
+ {
14
+ style: { width: t },
15
+ onClick: s,
16
+ className: c(
17
+ n({
18
+ className: r,
19
+ isSelected: m
20
+ })
21
+ ),
22
+ ...i,
23
+ children: o
24
+ }
25
+ );
26
+ export {
27
+ l as Row
28
+ };
@@ -0,0 +1,10 @@
1
+ import { Body as e } from "./Body.js";
2
+ import { Filter as f } from "./Filter.js";
3
+ import { Head as p } from "./Head.js";
4
+ import { Row as d } from "./Row.js";
5
+ export {
6
+ e as Body,
7
+ f as Filter,
8
+ p as Head,
9
+ d as Row
10
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
- import { S as r } from "../../index-B_6_jmOO.js";
2
+ import { S as r } from "../../index-Bk324h27.js";
3
3
  import { cn as o } from "../../utils/index.js";
4
4
  import { tagVariants as c } from "./Tag.variants.js";
5
5
  const u = ({
@@ -1,59 +1,27 @@
1
1
  import { c as e } from "../../index-BNmRGtA6.js";
2
- const r = e(
3
- ["flex", "flex-col", "w-full", "relative", "text-zinc-500"],
4
- {
5
- variants: {
6
- theme: {
7
- colony: "",
8
- kubefirst: "",
9
- civo: ""
10
- }
11
- },
12
- defaultVariants: {
13
- theme: "kubefirst"
14
- }
15
- }
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(
28
- [
29
- "border",
30
- "cursor-pointer",
31
- "duration-250",
32
- "ease-in-out",
33
- "flex",
34
- "items-center",
35
- "justify-between",
36
- "px-2",
37
- "py-1",
38
- "rounded",
39
- "transition-all",
40
- "w-full"
41
- ],
42
- {
43
- variants: {
44
- theme: {
45
- colony: "",
46
- kubefirst: "",
47
- civo: ""
48
- }
49
- },
50
- defaultVariants: {
51
- theme: "kubefirst"
52
- }
53
- }
54
- );
2
+ const t = e([
3
+ "flex",
4
+ "flex-col",
5
+ "w-full",
6
+ "relative",
7
+ "text-zinc-500"
8
+ ]), a = e(["my-2", "cursor-pointer"]), o = e([
9
+ "border",
10
+ "cursor-pointer",
11
+ "duration-250",
12
+ "ease-in-out",
13
+ "flex",
14
+ "items-center",
15
+ "justify-between",
16
+ "px-2",
17
+ "py-1",
18
+ "rounded",
19
+ "transition-all",
20
+ "w-full",
21
+ "border-gray-200"
22
+ ]);
55
23
  export {
56
24
  a as labelVariants,
57
- i as tagSelectVariants,
58
- r as wrapperVariants
25
+ o as tagSelectVariants,
26
+ t as wrapperVariants
59
27
  };
@@ -1,23 +1,21 @@
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(
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Tag as m } from "../../../Tag/Tag.js";
3
+ import { cn as a } from "../../../../utils/index.js";
4
+ import { wrapperVariants as c } from "./Item.variants.js";
5
+ import { useTagSelect as i } from "../../contexts/TagSelect.hook.js";
6
+ const d = ({ option: e, theme: t }) => {
7
+ const { onSelectTag: o } = i();
8
+ return /* @__PURE__ */ r(
10
9
  "li",
11
10
  {
12
11
  role: "option",
13
- className: c(
14
- n({ theme: r ?? m, isSelected: e.isSelected })
15
- ),
12
+ "data-theme": t,
13
+ className: a(c({ isSelected: e.isSelected })),
16
14
  onClick: () => o(e),
17
- children: /* @__PURE__ */ t(i, { ...e })
15
+ children: /* @__PURE__ */ r(m, { ...e })
18
16
  }
19
17
  );
20
18
  };
21
19
  export {
22
- g as Item
20
+ d as Item
23
21
  };
@@ -1,13 +1,16 @@
1
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"],
2
+ const t = e(
3
+ [
4
+ "cursor-pointer",
5
+ "py-1.5",
6
+ "px-2",
7
+ "last:pb-2",
8
+ "first:pt-2",
9
+ "h-full",
10
+ "hover:bg-purple-100"
11
+ ],
4
12
  {
5
13
  variants: {
6
- theme: {
7
- colony: "",
8
- kubefirst: ["hover:bg-purple-100"],
9
- civo: ""
10
- },
11
14
  isSelected: {
12
15
  true: "",
13
16
  false: ""
@@ -15,17 +18,15 @@ const r = e(
15
18
  },
16
19
  compoundVariants: [
17
20
  {
18
- theme: "kubefirst",
19
21
  isSelected: !0,
20
22
  class: ["bg-purple-100"]
21
23
  }
22
24
  ],
23
25
  defaultVariants: {
24
- theme: "kubefirst",
25
26
  isSelected: !1
26
27
  }
27
28
  }
28
29
  );
29
30
  export {
30
- r as wrapperVariants
31
+ t as wrapperVariants
31
32
  };
@@ -1,13 +1,12 @@
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" }) });
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { cn as m } from "../../../../utils/index.js";
3
+ import { Item as s } from "../Item/Item.js";
4
+ import { wrapperVariants as a } from "./List.variants.js";
5
+ import { useTagSelect as i } from "../../contexts/TagSelect.hook.js";
6
+ const f = ({ theme: o }) => {
7
+ const { tags: e } = i();
8
+ return /* @__PURE__ */ t("ul", { role: "listbox", "data-theme": o, className: m(a()), children: e.length > 0 ? e.map((r) => /* @__PURE__ */ t(s, { option: r }, r.id)) : /* @__PURE__ */ t("span", { className: "text-center text-sm px-4 py-2", children: "There is not options available" }) });
10
9
  };
11
10
  export {
12
- d as List
11
+ f as List
13
12
  };
@@ -1,37 +1,23 @@
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
- );
1
+ import { c as o } from "../../../../index-BNmRGtA6.js";
2
+ const a = o([
3
+ "absolute",
4
+ "bg-white",
5
+ "border",
6
+ "duration-100",
7
+ "flex",
8
+ "flex-col",
9
+ "mt-0.5",
10
+ "rounded",
11
+ "shadow-xs",
12
+ "top-full",
13
+ "transition-all",
14
+ "w-full",
15
+ "z-10",
16
+ "animate-in",
17
+ "fade-in-50",
18
+ "overflow-hidden",
19
+ "border-gray-200"
20
+ ]);
35
21
  export {
36
- t as wrapperVariants
22
+ a as wrapperVariants
37
23
  };
@@ -1,88 +1,86 @@
1
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(
2
+ import { List as g } from "../List/List.js";
3
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
4
+ import { forwardRef as w, useId as T, useImperativeHandle as b } from "react";
5
+ import { Tag as C } from "../../../Tag/Tag.js";
6
+ import { cn as r } from "../../../../utils/index.js";
7
+ import { useTagSelect as S } from "../../hooks/useTagSelect.js";
8
+ import { labelVariants as k, tagSelectVariants as R, wrapperVariants as I } from "../../TagSelect.variants.js";
9
+ import { X as O } from "../../../../x-DU-Zw-L_.js";
10
+ import { C as V } from "../../../../chevron-up-DgLBQCKD.js";
11
+ import { useTagSelect as j } from "../../contexts/TagSelect.hook.js";
12
+ const B = w(
14
13
  ({
15
- label: n,
16
- labelClassName: p,
17
- name: s,
18
- placeholder: h = "Select a value...",
14
+ label: o,
15
+ labelClassName: c,
16
+ name: t,
17
+ placeholder: p = "Select a value...",
19
18
  theme: d,
20
19
  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(
20
+ }, h) => {
21
+ const i = T(), { selectedTags: n, isOpen: s, onOpen: u, onRemoveTag: x, inputRef: l } = j(), { wrapperRef: N, handleOpen: v } = S();
22
+ return b(h, () => l.current, [l]), /* @__PURE__ */ m(
24
23
  "div",
25
24
  {
26
- ref: T,
27
- className: a(
28
- V({
29
- theme: t,
25
+ ref: N,
26
+ className: r(
27
+ I({
30
28
  className: f
31
29
  })
32
30
  ),
31
+ "data-theme": d,
33
32
  children: [
34
- n ? /* @__PURE__ */ e(
33
+ o ? /* @__PURE__ */ e(
35
34
  "label",
36
35
  {
37
- htmlFor: s ?? l,
38
- className: a(
39
- I({
40
- theme: t,
41
- className: p
36
+ htmlFor: t ?? i,
37
+ className: r(
38
+ k({
39
+ className: c
42
40
  })
43
41
  ),
44
- onClick: () => N(!0),
45
- children: n
42
+ onClick: () => u(!0),
43
+ children: o
46
44
  }
47
45
  ) : null,
48
- /* @__PURE__ */ c(
46
+ /* @__PURE__ */ m(
49
47
  "div",
50
48
  {
51
- id: s ?? l,
52
- className: a(O({ theme: t })),
49
+ id: t ?? i,
50
+ className: r(R()),
53
51
  role: "combobox",
54
- onClick: g,
55
- "aria-expanded": o,
52
+ onClick: v,
53
+ "aria-expanded": s,
56
54
  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,
55
+ n.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: p }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: n.map((a) => /* @__PURE__ */ e(
56
+ C,
59
57
  {
60
- ...r,
58
+ ...a,
61
59
  className: "select-none",
62
- rightIcon: /* @__PURE__ */ e(j, { className: "w-3 h-3", onClick: () => v(r) }),
63
- "data-value": r.label
60
+ rightIcon: /* @__PURE__ */ e(O, { className: "w-3 h-3", onClick: () => x(a) }),
61
+ "data-value": a.label
64
62
  },
65
- r.id
63
+ a.id
66
64
  )) }),
67
65
  /* @__PURE__ */ e(
68
- y,
66
+ V,
69
67
  {
70
- className: a(
68
+ className: r(
71
69
  "w-4 h-4 text-inherit transition-all duration-50 shrink-0",
72
- o ? "rotate-0" : "rotate-180"
70
+ s ? "rotate-0" : "rotate-180"
73
71
  )
74
72
  }
75
73
  )
76
74
  ]
77
75
  }
78
76
  ),
79
- /* @__PURE__ */ e("input", { ref: i, type: "text", name: s, className: "hidden" }),
80
- o ? /* @__PURE__ */ e(w, { theme: t }) : null
77
+ /* @__PURE__ */ e("input", { ref: l, type: "text", name: t, className: "hidden" }),
78
+ s ? /* @__PURE__ */ e(g, {}) : null
81
79
  ]
82
80
  }
83
81
  );
84
82
  }
85
83
  );
86
84
  export {
87
- J as Wrapper
85
+ B as Wrapper
88
86
  };
@@ -1,33 +1,30 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as h, useId as u } from "react";
3
- import { cn as p } from "../../utils/index.js";
4
- import { textAreaVariants as v } from "./TextArea.variants.js";
5
- import { useTheme as N } from "../../contexts/theme.hook.js";
6
- const w = h(
1
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as x, useId as u } from "react";
3
+ import { cn as h } from "../../utils/index.js";
4
+ import { textAreaVariants as p } from "./TextArea.variants.js";
5
+ const I = x(
7
6
  ({
8
- initialValue: a,
7
+ initialValue: m,
9
8
  label: e,
10
- name: s,
11
- placeholder: l,
9
+ name: l,
10
+ placeholder: s,
12
11
  rows: c = 3,
13
- theme: n,
14
- className: i,
12
+ theme: i,
13
+ className: n,
15
14
  ...r
16
- }, f) => {
17
- const t = u(), { theme: x } = N(), m = s ? `${t}-name` : t;
18
- return /* @__PURE__ */ d("div", { className: "flex flex-col gap-2", children: [
19
- e ? /* @__PURE__ */ o("label", { htmlFor: m, className: "cursor-pointer", children: e }) : null,
15
+ }, d) => {
16
+ const t = u(), a = l ? `${t}-name` : t;
17
+ return /* @__PURE__ */ f("div", { className: "flex flex-col gap-2", "data-theme": i, children: [
18
+ e ? /* @__PURE__ */ o("label", { htmlFor: a, className: "cursor-pointer", children: e }) : null,
20
19
  /* @__PURE__ */ o(
21
20
  "textarea",
22
21
  {
23
- id: m,
24
- ref: f,
25
- className: p(
26
- v({ className: i, theme: n ?? x })
27
- ),
22
+ id: a,
23
+ ref: d,
24
+ className: h(p({ className: n })),
28
25
  rows: c,
29
- placeholder: l,
30
- value: a ?? r.value,
26
+ placeholder: s,
27
+ value: m ?? r.value,
31
28
  ...r
32
29
  }
33
30
  )
@@ -35,5 +32,5 @@ const w = h(
35
32
  }
36
33
  );
37
34
  export {
38
- w as TextArea
35
+ I as TextArea
39
36
  };