@konstructio/ui 0.1.2-alpha.4 → 0.1.2-alpha.41

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 (179) hide show
  1. package/dist/{Combination-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
  2. package/dist/DatePicker.css +1 -1
  3. package/dist/Modal-CtAG97Ts.js +99 -0
  4. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  5. package/dist/chevron-down-DgT-uSF9.js +5 -0
  6. package/dist/chevron-left-C4LEg1fH.js +7 -0
  7. package/dist/chevron-up-CRyLc5Ml.js +54 -0
  8. package/dist/chevron-up-DrQr2Fwd.js +5 -0
  9. package/dist/components/Alert/Alert.js +2 -2
  10. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  11. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  12. package/dist/components/AlertDialog/components/index.js +1 -1
  13. package/dist/components/Badge/Badge.js +42 -44
  14. package/dist/components/Badge/Badge.variants.js +8 -6
  15. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  16. package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
  17. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  18. package/dist/components/Button/Button.js +1 -1
  19. package/dist/components/Button/Button.variants.js +1 -1
  20. package/dist/components/Card/Card.variants.js +5 -9
  21. package/dist/components/Checkbox/Checkbox.js +6 -6
  22. package/dist/components/Command/Command.js +2 -2
  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 +2 -2
  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 +2 -2
  31. package/dist/components/Command/components/DialogOverlay.js +1 -1
  32. package/dist/components/Datepicker/DatePicker.js +1243 -1191
  33. package/dist/components/Divider/Divider.variants.js +1 -1
  34. package/dist/components/Dropdown/Dropdown.js +37 -31
  35. package/dist/components/Dropdown/Dropdown.variants.js +9 -4
  36. package/dist/components/Dropdown/components/List/List.js +128 -59
  37. package/dist/components/Dropdown/components/ListItem/ListItem.js +90 -39
  38. package/dist/components/Dropdown/components/Wrapper.js +141 -134
  39. package/dist/components/Dropdown/constants/index.js +4 -0
  40. package/dist/components/Dropdown/constants/pagination.js +4 -0
  41. package/dist/components/Dropdown/contexts/dropdown.context.js +17 -0
  42. package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -20
  43. package/dist/components/Dropdown/hooks/useDropdown.js +74 -29
  44. package/dist/components/Dropdown/hooks/useNavigationList.js +27 -39
  45. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  46. package/dist/components/Filter/Filter.variants.js +2 -2
  47. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  48. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
  49. package/dist/components/Input/Input.js +1 -1
  50. package/dist/components/Input/Input.variants.js +2 -1
  51. package/dist/components/Loading/Loading.js +1 -7
  52. package/dist/components/Modal/Modal.js +2 -2
  53. package/dist/components/Modal/components/Body/Body.js +1 -1
  54. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  55. package/dist/components/Modal/components/Header/Header.js +1 -1
  56. package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -4
  57. package/dist/components/Modal/components/index.js +1 -1
  58. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
  59. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +34 -0
  60. package/dist/components/MultiSelectDropdown/components/Item/Item.js +38 -0
  61. package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
  62. package/dist/components/MultiSelectDropdown/components/List/List.js +37 -0
  63. package/dist/components/MultiSelectDropdown/components/List/List.variants.js +23 -0
  64. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +105 -0
  65. package/dist/components/MultiSelectDropdown/components/index.js +8 -0
  66. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
  67. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
  68. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
  69. package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
  70. package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
  71. package/dist/components/NumberInput/NumberInput.js +2 -2
  72. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
  73. package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
  74. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +27 -0
  75. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +629 -0
  76. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +36 -0
  77. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
  78. package/dist/components/PhoneNumberInput/components/Wrapper.js +625 -0
  79. package/dist/components/PhoneNumberInput/components/index.js +6 -0
  80. package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
  81. package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
  82. package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
  83. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
  84. package/dist/components/PhoneNumberInput/utils/index.js +11 -0
  85. package/dist/components/PieChart/PieChart.js +647 -664
  86. package/dist/components/RadioCard/RadioCard.variants.js +1 -6
  87. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  88. package/dist/components/Range/Range.js +1 -1
  89. package/dist/components/Sidebar/Sidebar.variants.js +2 -2
  90. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
  91. package/dist/components/Slider/Slider.js +1 -1
  92. package/dist/components/Switch/Switch.js +8 -8
  93. package/dist/components/Switch/Switch.variants.js +4 -4
  94. package/dist/components/Tabs/Tabs.js +1 -1
  95. package/dist/components/Tabs/Tabs.variants.js +1 -1
  96. package/dist/components/Tabs/components/Content.js +1 -1
  97. package/dist/components/Tabs/components/List.js +1 -1
  98. package/dist/components/Tabs/components/Trigger.js +1 -1
  99. package/dist/components/Tag/Tag.js +1 -1
  100. package/dist/components/Tag/Tag.variants.js +1 -0
  101. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
  102. package/dist/components/TimePicker/TimePicker.variants.js +2 -2
  103. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +2 -2
  104. package/dist/components/Toast/Toast.js +283 -255
  105. package/dist/components/Toast/Toast.variants.js +37 -24
  106. package/dist/components/Tooltip/Tooltip.js +15 -14
  107. package/dist/components/Tooltip/Tooltip.variants.js +5 -4
  108. package/dist/components/Typography/Typography.variants.js +18 -23
  109. package/dist/components/VirtualizedTable/VirtualizedTable.js +121 -0
  110. package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
  111. package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
  112. package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
  113. package/dist/components/VirtualizedTable/assets/index.js +6 -0
  114. package/dist/components/VirtualizedTable/components/Actions/Actions.js +72 -0
  115. package/dist/components/VirtualizedTable/components/Body/Body.js +51 -0
  116. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
  117. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
  118. package/dist/components/VirtualizedTable/components/Filter/Filter.js +93 -0
  119. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
  120. package/dist/components/VirtualizedTable/components/Header/Header.js +84 -0
  121. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +53 -0
  122. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
  123. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +34 -0
  124. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
  125. package/dist/components/VirtualizedTable/components/index.js +16 -0
  126. package/dist/components/VirtualizedTable/constants/index.js +5 -0
  127. package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
  128. package/dist/components/VirtualizedTable/contexts/index.js +8 -0
  129. package/dist/components/VirtualizedTable/contexts/table.context.js +32 -0
  130. package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
  131. package/dist/components/VirtualizedTable/contexts/table.provider.js +85 -0
  132. package/dist/components/index.js +88 -80
  133. package/dist/contexts/theme.provider.js +0 -1
  134. package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D4r5Phnh.js} +0 -24
  135. package/dist/debounce-BFejQm9P.js +200 -0
  136. package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
  137. package/dist/{index-h-Ul0anl.js → index--V_ZsiQe.js} +1 -22
  138. package/dist/index-2hB40Iuc.js +1873 -0
  139. package/dist/index-BZPx6jYI.js +8 -0
  140. package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
  141. package/dist/index-BtQfgaSF.js +60 -0
  142. package/dist/index-C3tHPg8y.js +662 -0
  143. package/dist/index-C65LtGuU.js +137 -0
  144. package/dist/index-CIAmiWcw.js +200 -0
  145. package/dist/index-CSFe9uC5.js +14 -0
  146. package/dist/index-CSWGJT-v.js +1722 -0
  147. package/dist/{index-D3xzCzcO.js → index-CdwPV0FE.js} +4 -4
  148. package/dist/index-CigKKiZS.js +91 -0
  149. package/dist/{index-BAraV3ai.js → index-DH2Fnov1.js} +11 -12
  150. package/dist/index-DLcqcWxM.js +29 -0
  151. package/dist/index-Dbt2vBmS.js +136 -0
  152. package/dist/{index-DB2XhXHn.js → index-DpW9ExsS.js} +7 -7
  153. package/dist/index-DrWQH0QF.js +55 -0
  154. package/dist/index-Ds6U2x4Z.js +479 -0
  155. package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
  156. package/dist/index-ohdbKsws.js +27 -0
  157. package/dist/index.d.ts +232 -23
  158. package/dist/index.js +112 -102
  159. package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
  160. package/dist/loader-juvMSJ9L.js +5 -0
  161. package/dist/package.json +48 -34
  162. package/dist/styles.css +1 -1
  163. package/dist/ui/civo-theme.css +191 -167
  164. package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
  165. package/dist/utils/index.js +534 -501
  166. package/dist/{x-BPcqkRZd.js → x-DPU9OdYH.js} +1 -1
  167. package/package.json +48 -34
  168. package/dist/Modal-V67Uz78z.js +0 -98
  169. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  170. package/dist/chevron-down-BLZPftpV.js +0 -11
  171. package/dist/index-BXuxPoz7.js +0 -435
  172. package/dist/index-BfXxHr_2.js +0 -125
  173. package/dist/index-C9T9HQaa.js +0 -423
  174. package/dist/index-CZnD2QxM.js +0 -32
  175. package/dist/index-CrBonFvu.js +0 -144
  176. package/dist/index-Cvx4lqTq.js +0 -47
  177. package/dist/index-DQH6odE9.js +0 -82
  178. package/dist/index-Oq5GlCHP.js +0 -131
  179. package/dist/index-iXyXtdgP.js +0 -31
@@ -1,62 +1,50 @@
1
- import { useRef as g, useEffect as l } from "react";
2
- import { useDropdownContext as d } from "../contexts/dropdown.hook.js";
3
- const w = ({
4
- inputRef: s,
5
- searchable: i,
6
- ulRef: e,
7
- wrapperInputRef: u,
8
- wrapperRef: a
1
+ import { useRef as g, useEffect as a } from "react";
2
+ import { useDropdownContext as k } from "../contexts/dropdown.hook.js";
3
+ const A = ({
4
+ searchable: o,
5
+ ulRef: n,
6
+ wrapperInputRef: e,
7
+ filteredOptions: f
9
8
  }) => {
10
- const r = g(0), { isOpen: b } = d();
11
- l(() => {
12
- const o = e.current?.querySelectorAll("li") ?? [], t = Array.from(o).filter(
13
- (n) => n.getAttribute("data-action") !== "true"
14
- ), c = new AbortController(), f = () => {
9
+ const r = g(0), { isOpen: s } = k();
10
+ a(() => {
11
+ const m = n.current?.querySelectorAll("li") ?? [], t = Array.from(m).filter(
12
+ (c) => c.getAttribute("data-action") !== "true"
13
+ ), u = new AbortController(), i = () => {
15
14
  r.current < t.length - 1 ? (r.current = r.current + 1, t[r.current].focus()) : (r.current = 0, t[0].focus());
16
- }, m = () => {
17
- r.current > 0 ? (r.current = r.current - 1, t[r.current].focus()) : (r.current = 0, s?.current && i ? s.current.focus() : u.current?.focus());
15
+ }, l = () => {
16
+ r.current > 0 ? (r.current = r.current - 1, t[r.current].focus()) : (r.current = 0, e?.current && o ? e.current.querySelector("input")?.focus() : e.current?.focus());
18
17
  };
19
- return e.current?.addEventListener(
18
+ return n.current?.addEventListener(
20
19
  "keydown",
21
- (n) => {
22
- switch (n.preventDefault(), n.key) {
20
+ (c) => {
21
+ switch (c.preventDefault(), c.key) {
23
22
  case "ArrowDown": {
24
- f();
23
+ i();
25
24
  break;
26
25
  }
27
26
  case "Tab": {
28
- n.shiftKey ? m() : f();
27
+ c.shiftKey ? l() : i();
29
28
  break;
30
29
  }
31
30
  case "ArrowUp": {
32
- r.current === 0 ? u.current?.focus() : m();
31
+ r.current === 0 ? e.current?.focus() : l();
33
32
  break;
34
33
  }
35
34
  case "Enter": {
36
- t[r.current].querySelector("button")?.click();
35
+ t[r.current]?.click();
37
36
  break;
38
37
  }
39
38
  }
40
39
  },
41
- { signal: c.signal }
40
+ { signal: u.signal }
42
41
  ), () => {
43
- c.abort();
42
+ u.abort();
44
43
  };
45
- }, [e, r, u, s, i]), l(() => {
46
- const o = new AbortController();
47
- return a.current?.addEventListener(
48
- "mouseenter",
49
- () => {
50
- (e.current?.querySelectorAll("li") ?? []).forEach((c) => c.blur());
51
- },
52
- { signal: o.signal }
53
- ), () => {
54
- o.abort();
55
- };
56
- }, [e, a]), l(() => {
57
- b || (r.current = 0);
58
- }, [b]);
44
+ }, [n, r, e, o, f.length]), a(() => {
45
+ s || (r.current = 0);
46
+ }, [s]);
59
47
  };
60
48
  export {
61
- w as useNavigationUlList
49
+ A as useNavigationUlList
62
50
  };
@@ -2,7 +2,7 @@ import { jsxs as h, jsx as p } from "react/jsx-runtime";
2
2
  import v, { forwardRef as x, useState as C, useRef as w, useCallback as b, useEffect as E } from "react";
3
3
  import { cn as l } from "../../utils/index.js";
4
4
  import { Button as P } from "../Button/Button.js";
5
- import { P as c } from "../../index-h-Ul0anl.js";
5
+ import { P as c } from "../../index--V_ZsiQe.js";
6
6
  function m() {
7
7
  return m = Object.assign || function(e) {
8
8
  for (var i = 1; i < arguments.length; i++) {
@@ -9,8 +9,8 @@ const a = t(["flex", "gap-8", "items-center"]), n = t([
9
9
  "w-max"
10
10
  ]), r = t([
11
11
  "text-slate-400",
12
- "h-[20px]",
13
- "w-[20px]",
12
+ "h-5",
13
+ "w-5",
14
14
  "transition-all",
15
15
  "duration-150",
16
16
  "ease-in-out"
@@ -5,7 +5,7 @@ import { Checkbox as C } from "../../../Checkbox/Checkbox.js";
5
5
  import { cn as n } from "../../../../utils/index.js";
6
6
  import { filterButtonIconVariants as y, filterButtonVariants as N } from "../../Filter.variants.js";
7
7
  import { useBadgeMultiSelect as B } from "./BadgeMultiSelect.hook.js";
8
- import { C as O } from "../../../../chevron-down-BLZPftpV.js";
8
+ import { C as O } from "../../../../chevron-down-DgT-uSF9.js";
9
9
  const $ = ({
10
10
  options: i,
11
11
  label: p,
@@ -5,7 +5,7 @@ import { DatePicker as w } from "../../../Datepicker/DatePicker.js";
5
5
  import { cn as o } from "../../../../utils/index.js";
6
6
  import { filterButtonIconVariants as x, filterButtonVariants as y } from "../../Filter.variants.js";
7
7
  import { useDateFilterDropdown as D } from "./DateFilterDropdown.hook.js";
8
- import { C as N } from "../../../../chevron-down-BLZPftpV.js";
8
+ import { C as N } from "../../../../chevron-down-DgT-uSF9.js";
9
9
  const R = ({
10
10
  label: s,
11
11
  position: l = "left",
@@ -4,7 +4,7 @@ import { cn as u } from "../../utils/index.js";
4
4
  import { inputVariants as $ } from "./Input.variants.js";
5
5
  import { SearchIcon as L } from "../../assets/icons/components/Search.js";
6
6
  import { Warning as T } from "../../assets/icons/components/Warning.js";
7
- import { P as i } from "../../index-h-Ul0anl.js";
7
+ import { P as i } from "../../index--V_ZsiQe.js";
8
8
  function h() {
9
9
  return h = Object.assign || function(t) {
10
10
  for (var n = 1; n < arguments.length; n++) {
@@ -19,6 +19,7 @@ const a = r(
19
19
  "text-sm",
20
20
  "w-full",
21
21
  "transition-all",
22
+ "focus-visible:border-transparent",
22
23
  "data-[error=false]:dark:focus:ring-aurora-500",
23
24
  "data-[error=false]:focus:ring-aurora-500",
24
25
  "data-[error=false]:kubefirst:focus:ring-kubefirst-primary",
@@ -39,7 +40,7 @@ const a = r(
39
40
  variants: {
40
41
  variant: {
41
42
  default: "",
42
- error: "border-red-600 kubefirst-dark:border-red-500 dark:border-red-500 dark:border-red-500 pr-8 focus-visible:ring-transparent"
43
+ error: "border-red-600 kubefirst-dark:border-red-500 dark:border-red-500 pr-8 focus-visible:border-red-600 focus-visible:ring-transparent"
43
44
  }
44
45
  },
45
46
  defaultVariants: {
@@ -1,13 +1,7 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { cn as c } from "../../utils/index.js";
3
3
  import { loadingVariants as i } from "./Loading.variants.js";
4
- import { c as t } from "../../createLucideIcon-DbC6TvM5.js";
5
- /**
6
- * @license lucide-react v0.544.0 - ISC
7
- *
8
- * This source code is licensed under the ISC license.
9
- * See the LICENSE file in the root directory of this source tree.
10
- */
4
+ import { c as t } from "../../createLucideIcon-D4r5Phnh.js";
11
5
  const d = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], m = t("loader-circle", d), n = ({ className: o, theme: a, ...r }) => /* @__PURE__ */ e(
12
6
  m,
13
7
  {
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import "../../index-C9T9HQaa.js";
4
- import { M as d } from "../../Modal-V67Uz78z.js";
3
+ import "react-dom";
4
+ import { M as d } from "../../Modal-CtAG97Ts.js";
5
5
  import "./components/Header/Header.js";
6
6
  import "./components/Body/Body.js";
7
7
  import "./components/Footer/Footer.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { S as n } from "../../../../index-DQH6odE9.js";
2
+ import { S as n } from "../../../../index-BtQfgaSF.js";
3
3
  import { cn as e } from "../../../../utils/index.js";
4
4
  const i = ({ children: o, asChild: t, className: m }) => /* @__PURE__ */ r(t ? n : "div", { className: e("flex-1", m), children: o });
5
5
  export {
@@ -1,5 +1,5 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import { S as n } from "../../../../index-DQH6odE9.js";
2
+ import { S as n } from "../../../../index-BtQfgaSF.js";
3
3
  import { cn as e } from "../../../../utils/index.js";
4
4
  const a = ({ children: o, asChild: r, className: t }) => /* @__PURE__ */ m(r ? n : "div", { className: e("border-zinc-200", t), children: o });
5
5
  export {
@@ -1,5 +1,5 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import { S as n } from "../../../../index-DQH6odE9.js";
2
+ import { S as n } from "../../../../index-BtQfgaSF.js";
3
3
  import { cn as e } from "../../../../utils/index.js";
4
4
  const a = ({ children: o, asChild: r, className: t }) => /* @__PURE__ */ m(r ? n : "div", { className: e("border-zinc-200", t), children: o });
5
5
  export {
@@ -1,11 +1,11 @@
1
1
  import "react/jsx-runtime";
2
- import "../../../../index-iXyXtdgP.js";
2
+ import "../../../../index-DrWQH0QF.js";
3
3
  import "react";
4
- import "../../../../Combination-VYaRRJBZ.js";
5
- import { W as f } from "../../../../Modal-V67Uz78z.js";
4
+ import "../../../../Combination-BtmnusWq.js";
5
+ import { W as f } from "../../../../Modal-CtAG97Ts.js";
6
6
  import "../../../../utils/index.js";
7
7
  import "./Wrapper.variants.js";
8
- import "../../../../x-BPcqkRZd.js";
8
+ import "../../../../x-DPU9OdYH.js";
9
9
  export {
10
10
  f as Wrapper
11
11
  };
@@ -1,7 +1,7 @@
1
1
  import { Body as e } from "./Body/Body.js";
2
2
  import { Footer as t } from "./Footer/Footer.js";
3
3
  import { Header as m } from "./Header/Header.js";
4
- import { W as a } from "../../../Modal-V67Uz78z.js";
4
+ import { W as a } from "../../../Modal-CtAG97Ts.js";
5
5
  export {
6
6
  e as Body,
7
7
  t as Footer,
@@ -0,0 +1,34 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import { MultiSelectDropdownProvider as a } from "./contexts/MultiSelectDropdown.provider.js";
4
+ import { Wrapper as s } from "./components/Wrapper/Wrapper.js";
5
+ const u = n(
6
+ ({
7
+ options: t,
8
+ multiselect: e,
9
+ value: p,
10
+ onChange: i,
11
+ onBlur: l,
12
+ name: o,
13
+ isLoading: d,
14
+ noOptionsText: m,
15
+ ...f
16
+ }, c) => /* @__PURE__ */ r(
17
+ a,
18
+ {
19
+ defaultOptions: t,
20
+ multiselect: e,
21
+ value: p,
22
+ onChange: i,
23
+ onBlur: l,
24
+ name: o,
25
+ isLoading: d,
26
+ noOptionsText: m,
27
+ children: /* @__PURE__ */ r(s, { ref: c, ...f, name: o })
28
+ }
29
+ )
30
+ );
31
+ u.displayName = "MultiSelectDropdown";
32
+ export {
33
+ u as MultiSelectDropdown
34
+ };
@@ -0,0 +1,34 @@
1
+ import { c as t } from "../../index-D29mdTf5.js";
2
+ const r = t([
3
+ "flex",
4
+ "flex-col",
5
+ "w-full",
6
+ "relative",
7
+ "text-slate-500",
8
+ "mb-1",
9
+ "cursor-pointer",
10
+ "text-sm",
11
+ "leading-5",
12
+ "tracking-[0.1px]",
13
+ "dark:text-slate-50"
14
+ ]), a = t(["cursor-pointer", "mb-1"]), o = t([
15
+ "h-9",
16
+ "border",
17
+ "cursor-pointer",
18
+ "duration-250",
19
+ "ease-in-out",
20
+ "flex",
21
+ "items-center",
22
+ "justify-between",
23
+ "px-2",
24
+ "py-1",
25
+ "rounded-md",
26
+ "transition-all",
27
+ "w-full",
28
+ "border-gray-200"
29
+ ]);
30
+ export {
31
+ a as labelVariants,
32
+ o as multiSelectDropdownVariants,
33
+ r as wrapperVariants
34
+ };
@@ -0,0 +1,38 @@
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
+ import { cn as i } from "../../../../utils/index.js";
3
+ import { wrapperVariants as s } from "./Item.variants.js";
4
+ import { useMultiSelectDropdown as c } from "../../contexts/MultiSelectDropdown.hook.js";
5
+ import { Typography as p } from "../../../Typography/Typography.js";
6
+ import { Tag as n } from "../../../Tag/Tag.js";
7
+ const u = ({
8
+ option: r,
9
+ theme: e,
10
+ isSelected: a,
11
+ className: o
12
+ }) => {
13
+ const { onSelectOption: l } = c();
14
+ return /* @__PURE__ */ m(
15
+ "li",
16
+ {
17
+ role: "option",
18
+ "data-theme": e,
19
+ className: i(s({ isSelected: a }), o),
20
+ onClick: () => l(r),
21
+ children: [
22
+ /* @__PURE__ */ t(p, { variant: "body2", className: "text-slate-800", children: r.label }),
23
+ r.tagLabel && /* @__PURE__ */ t(
24
+ n,
25
+ {
26
+ id: r.id,
27
+ label: r.tagLabel,
28
+ color: r.tagColor,
29
+ isSelected: a
30
+ }
31
+ )
32
+ ]
33
+ }
34
+ );
35
+ };
36
+ export {
37
+ u as Item
38
+ };
@@ -0,0 +1,38 @@
1
+ import { c as e } from "../../../../index-D29mdTf5.js";
2
+ const r = 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-gray-50",
11
+ "focus:bg-gray-50",
12
+ "dark:hover:bg-slate-700",
13
+ "dark:focus:bg-slate-700",
14
+ "flex",
15
+ "items-center",
16
+ "gap-4"
17
+ ],
18
+ {
19
+ variants: {
20
+ isSelected: {
21
+ true: "",
22
+ false: ""
23
+ }
24
+ },
25
+ compoundVariants: [
26
+ {
27
+ isSelected: !0,
28
+ class: ["bg-slate-50"]
29
+ }
30
+ ],
31
+ defaultVariants: {
32
+ isSelected: !1
33
+ }
34
+ }
35
+ );
36
+ export {
37
+ r as wrapperVariants
38
+ };
@@ -0,0 +1,37 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { cn as m } from "../../../../utils/index.js";
3
+ import { Item as i } from "../Item/Item.js";
4
+ import { wrapperVariants as p } from "./List.variants.js";
5
+ import { useMultiSelectDropdown as c } from "../../contexts/MultiSelectDropdown.hook.js";
6
+ import { Typography as d } from "../../../Typography/Typography.js";
7
+ const y = ({ theme: s }) => {
8
+ const { options: o, selectedOptions: n, isLoading: r, noOptionsText: a } = c();
9
+ return /* @__PURE__ */ e("ul", { role: "listbox", "data-theme": s, className: m(p()), children: r ? /* @__PURE__ */ e(
10
+ i,
11
+ {
12
+ option: { id: "loading", label: "Loading..." },
13
+ className: "select-none pointer-events-none",
14
+ isSelected: !1
15
+ },
16
+ "loading"
17
+ ) : o.length > 0 ? o.map((t) => /* @__PURE__ */ e(
18
+ i,
19
+ {
20
+ option: t,
21
+ isSelected: n.some(
22
+ (l) => l.id === t.id
23
+ )
24
+ },
25
+ t.id
26
+ )) : /* @__PURE__ */ e("li", { className: "select-none", children: /* @__PURE__ */ e(
27
+ d,
28
+ {
29
+ variant: "body2",
30
+ className: "text-zinc-800 dark:text-slate-50 italic px-2 py-2",
31
+ children: a ?? "No options"
32
+ }
33
+ ) }) });
34
+ };
35
+ export {
36
+ y as List
37
+ };
@@ -0,0 +1,23 @@
1
+ import { c as o } from "../../../../index-D29mdTf5.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
+ ]);
21
+ export {
22
+ a as wrapperVariants
23
+ };
@@ -0,0 +1,105 @@
1
+ import "../Item/Item.js";
2
+ import { List as N } from "../List/List.js";
3
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
4
+ import * as c from "react";
5
+ import { forwardRef as S, useId as b, useImperativeHandle as C } from "react";
6
+ import { S as O } from "../../../../loader-juvMSJ9L.js";
7
+ import { cn as t } from "../../../../utils/index.js";
8
+ import { useMultiSelectDropdown as k } from "../../hooks/useMultiSelectDropdown.js";
9
+ import { labelVariants as D, multiSelectDropdownVariants as M, wrapperVariants as R } from "../../MultiSelectDropdown.variants.js";
10
+ import { C as y } from "../../../../chevron-up-CRyLc5Ml.js";
11
+ import { useMultiSelectDropdown as I } from "../../contexts/MultiSelectDropdown.hook.js";
12
+ import { Tag as V } from "../../../Tag/Tag.js";
13
+ const j = (r) => /* @__PURE__ */ c.createElement("svg", { width: 9, height: 9, viewBox: "0 0 9 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ c.createElement("path", { d: "M8.16667 0.8225L7.34417 0L4.08333 3.26083L0.8225 0L0 0.8225L3.26083 4.08333L0 7.34417L0.8225 8.16667L4.08333 4.90583L7.34417 8.16667L8.16667 7.34417L4.90583 4.08333L8.16667 0.8225Z", fill: "#364153" })), E = S(
14
+ ({ label: r, labelClassName: p, name: l, placeholder: d = "", theme: h, wrapperClassName: f }, u) => {
15
+ const o = b(), {
16
+ selectedOptions: n,
17
+ isOpen: s,
18
+ onOpen: w,
19
+ onRemoveOption: L,
20
+ inputRef: i,
21
+ isLoading: g
22
+ } = I(), { wrapperRef: x, handleOpen: v } = k();
23
+ return C(u, () => i.current, [i]), /* @__PURE__ */ m(
24
+ "div",
25
+ {
26
+ ref: x,
27
+ className: t(
28
+ R({
29
+ className: f
30
+ })
31
+ ),
32
+ "data-theme": h,
33
+ children: [
34
+ r ? /* @__PURE__ */ e(
35
+ "label",
36
+ {
37
+ htmlFor: l ?? o,
38
+ className: t(
39
+ D({
40
+ className: p
41
+ })
42
+ ),
43
+ onClick: () => w(!0),
44
+ children: r
45
+ }
46
+ ) : null,
47
+ /* @__PURE__ */ m(
48
+ "div",
49
+ {
50
+ id: l ?? o,
51
+ className: t(M()),
52
+ role: "combobox",
53
+ onClick: v,
54
+ "aria-expanded": s,
55
+ children: [
56
+ n.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: d }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: n.map((a) => /* @__PURE__ */ e(
57
+ V,
58
+ {
59
+ id: a.id,
60
+ label: a.value || a.tagLabel || "",
61
+ color: a.tagColor || "gray-800",
62
+ className: "select-none gap-2",
63
+ rightIcon: /* @__PURE__ */ e(
64
+ j,
65
+ {
66
+ className: "w-2 h-2",
67
+ onClick: () => L(a)
68
+ }
69
+ ),
70
+ "data-value": a.label
71
+ },
72
+ a.id
73
+ )) }),
74
+ g ? /* @__PURE__ */ e(O, { className: "w-4 h-4 text-slate-400 animate-spin shrink-0" }) : /* @__PURE__ */ e(
75
+ y,
76
+ {
77
+ className: t(
78
+ "w-4 h-4 text-inherit transition-all duration-50 shrink-0",
79
+ s ? "rotate-0" : "rotate-180"
80
+ )
81
+ }
82
+ )
83
+ ]
84
+ }
85
+ ),
86
+ /* @__PURE__ */ e(
87
+ "input",
88
+ {
89
+ ref: i,
90
+ type: "text",
91
+ name: l,
92
+ className: "hidden",
93
+ readOnly: !0
94
+ }
95
+ ),
96
+ s ? /* @__PURE__ */ e(N, {}) : null
97
+ ]
98
+ }
99
+ );
100
+ }
101
+ );
102
+ E.displayName = "MultiSelectDropdownWrapper";
103
+ export {
104
+ E as Wrapper
105
+ };
@@ -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,21 @@
1
+ import { createContext as n } from "react";
2
+ const t = {
3
+ options: [],
4
+ selectedOptions: [],
5
+ isOpen: !1,
6
+ inputRef: null,
7
+ onSelectOption() {
8
+ throw new Error("Function not implemented.");
9
+ },
10
+ onRemoveOption() {
11
+ throw new Error("Function not implemented.");
12
+ },
13
+ onOpen() {
14
+ throw new Error("Function not implemented.");
15
+ },
16
+ isLoading: !1,
17
+ noOptionsText: void 0
18
+ }, e = n(t);
19
+ export {
20
+ e as MultiSelectDropdownContext
21
+ };
@@ -0,0 +1,13 @@
1
+ import { useContext as o } from "react";
2
+ import { MultiSelectDropdownContext as e } from "./MultiSelectDropdown.context.js";
3
+ const i = () => {
4
+ const t = o(e);
5
+ if (!t)
6
+ throw new Error(
7
+ "useMultiSelectDropdown must be used within a MultiSelectDropdownProvider"
8
+ );
9
+ return t;
10
+ };
11
+ export {
12
+ i as useMultiSelectDropdown
13
+ };