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

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,5 +1,5 @@
1
1
  import { c as a } from "../../index-D29mdTf5.js";
2
- const i = a(["h-[1px]", "bg-zinc-200", "w-full"], {
2
+ const i = a(["h-px", "bg-zinc-200", "w-full"], {
3
3
  variants: {
4
4
  variant: {
5
5
  default: ""
@@ -1,42 +1,48 @@
1
- import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
- import { forwardRef as n } from "react";
3
- import { DropdownProvider as c } from "./contexts/dropdown.provider.js";
4
- import { Wrapper as x } from "./components/Wrapper.js";
5
- const N = n(
1
+ import { jsx as s, jsxs as w } from "react/jsx-runtime";
2
+ import { forwardRef as h } from "react";
3
+ import { cn as o } from "../../utils/index.js";
4
+ import { DropdownProvider as v } from "./contexts/dropdown.provider.js";
5
+ import { Wrapper as N } from "./components/Wrapper.js";
6
+ const W = h(
6
7
  ({
7
- onChange: r,
8
- onBlur: l,
9
- value: a,
10
- error: s,
11
- helperText: e,
12
- name: o,
13
- highlightSearch: i,
14
- ...d
15
- }, m) => /* @__PURE__ */ t(
16
- c,
8
+ error: t,
9
+ errorClassName: i,
10
+ helperText: r,
11
+ helperTextClassName: m,
12
+ highlightSearch: a,
13
+ mainWrapperClassName: p,
14
+ name: l,
15
+ value: d,
16
+ options: n,
17
+ onChange: c,
18
+ onBlur: e,
19
+ ...f
20
+ }, x) => /* @__PURE__ */ s(
21
+ v,
17
22
  {
18
- highlightSearch: i,
19
- name: o,
20
- value: a,
21
- onBlur: l,
22
- onChange: r,
23
- children: /* @__PURE__ */ p("div", { className: "relative w-full", children: [
24
- /* @__PURE__ */ t(
25
- x,
23
+ highlightSearch: a,
24
+ name: l,
25
+ value: d,
26
+ options: n,
27
+ onBlur: e,
28
+ onChange: c,
29
+ children: /* @__PURE__ */ w("div", { className: o("relative w-full", p), children: [
30
+ /* @__PURE__ */ s(
31
+ N,
26
32
  {
27
- name: o,
28
- error: s,
29
- ref: m,
30
- onBlur: l,
31
- ...d
33
+ error: t,
34
+ name: l,
35
+ ref: x,
36
+ onBlur: e,
37
+ ...f
32
38
  }
33
39
  ),
34
- s ? /* @__PURE__ */ t("span", { className: "text-xs text-red-700", children: s }) : null,
35
- !s && e ? /* @__PURE__ */ t("span", { className: "text-xs text-slate-600", children: e }) : null
40
+ t ? /* @__PURE__ */ s("span", { className: o("text-xs text-red-700", i), children: t }) : null,
41
+ !t && r ? /* @__PURE__ */ s("span", { className: o("text-xs text-slate-600", m), children: r }) : null
36
42
  ] })
37
43
  }
38
44
  )
39
45
  );
40
46
  export {
41
- N as Dropdown
47
+ W as Dropdown
42
48
  };
@@ -35,10 +35,15 @@ const a = e(
35
35
  "kubefirst:text-red-600"
36
36
  ],
37
37
  false: ""
38
+ },
39
+ disabled: {
40
+ true: ["cursor-default", "bg-gray-100", "dark:bg-slate-700/80"],
41
+ false: []
38
42
  }
39
43
  },
40
44
  defaultVariants: {
41
- hasError: !1
45
+ hasError: !1,
46
+ disabled: !1
42
47
  }
43
48
  }
44
49
  ), t = e([
@@ -54,16 +59,16 @@ const a = e(
54
59
  "placeholder:select-none",
55
60
  "dark:placeholder:text-slate-400",
56
61
  "dark:text-slate-50"
57
- ]), n = e([
62
+ ]), d = e([
58
63
  "mb-1",
59
64
  "cursor-pointer",
60
65
  "text-sm",
61
- "leading-[20px]",
66
+ "leading-5",
62
67
  "tracking-[0.1px]",
63
68
  "dark:text-slate-50"
64
69
  ]);
65
70
  export {
66
71
  a as dropdownVariants,
67
72
  t as inputVariants,
68
- n as labelVariants
73
+ d as labelVariants
69
74
  };
@@ -1,76 +1,145 @@
1
- import { jsx as l, jsxs as x, Fragment as N } from "react/jsx-runtime";
2
- import { forwardRef as k, useRef as C, useImperativeHandle as y } from "react";
3
- import { cn as o } from "../../../../utils/index.js";
4
- import { useNavigationUlList as R } from "../../hooks/useNavigationList.js";
5
- import { ListItem as a } from "../ListItem/ListItem.js";
6
- import { listVariants as j } from "./List.variants.js";
7
- import { S as I } from "../../../../index-DQH6odE9.js";
8
- import { useDropdownContext as O } from "../../contexts/dropdown.hook.js";
9
- const z = k(
1
+ import { jsxs as V, jsx as r } from "react/jsx-runtime";
2
+ import { S as Z } from "../../../../index-BtQfgaSF.js";
3
+ import { d as B } from "../../../../debounce-BFejQm9P.js";
4
+ import { forwardRef as G, useRef as C, useState as J, useImperativeHandle as K, useMemo as M, useEffect as Q } from "react";
5
+ import { Loading as R } from "../../../Loading/Loading.js";
6
+ import { cn as a } from "../../../../utils/index.js";
7
+ import { useNavigationUlList as W } from "../../hooks/useNavigationList.js";
8
+ import { ListItem as b } from "../ListItem/ListItem.js";
9
+ import { listVariants as X } from "./List.variants.js";
10
+ import { DEFAULT_LIST_SIZE as Y } from "../../constants/pagination.js";
11
+ import { useDropdownContext as $ } from "../../contexts/dropdown.hook.js";
12
+ const fe = G(
10
13
  ({
11
- additionalOptions: m,
12
- className: f,
13
- inputRef: p,
14
- isLoading: u,
15
- itemClassName: s,
16
- name: d,
17
- options: n,
18
- searchable: i = !1,
19
- wrapperInputRef: g,
20
- wrapperRef: b
21
- }, h) => {
22
- const t = C(null), { isOpen: v, searchTerm: L } = O();
23
- y(h, () => t.current, [t]), R({
24
- ulRef: t,
25
- wrapperRef: b,
26
- wrapperInputRef: g,
27
- inputRef: p,
28
- searchable: i
14
+ additionalOptions: F,
15
+ className: N,
16
+ inputRef: i,
17
+ isLoading: E,
18
+ itemClassName: l,
19
+ name: I,
20
+ searchable: y = !1,
21
+ listItemSecondRowClassName: c,
22
+ wrapperInputRef: j,
23
+ isInfiniteScrollEnabled: u,
24
+ onFetchMoreOptions: f,
25
+ noOptionsText: L
26
+ }, O) => {
27
+ const o = C(null), m = C(null), [p, w] = J(!1), {
28
+ isOpen: P,
29
+ searchTerm: g,
30
+ canFilter: S,
31
+ canContinueFetching: n,
32
+ page: d,
33
+ options: x,
34
+ isTyping: k,
35
+ setOptions: T,
36
+ setPage: D,
37
+ setCanContinueFetching: U
38
+ } = $();
39
+ K(O, () => o.current, [o]);
40
+ const h = y && S ? x.filter((e) => {
41
+ const t = g.toLowerCase();
42
+ return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(t);
43
+ }) : x;
44
+ W({
45
+ ulRef: o,
46
+ wrapperInputRef: j,
47
+ searchable: y,
48
+ filteredOptions: h
29
49
  });
30
- const c = i ? n.filter((e) => {
31
- const r = L.toLowerCase();
32
- return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(r);
33
- }) : n, w = c.length === 0;
34
- return /* @__PURE__ */ l(
50
+ const _ = h.filter(
51
+ (e, t, s) => t === s.findIndex((v) => v.value === e.value)
52
+ ), q = h.length === 0, z = M(
53
+ () => B(async (e) => {
54
+ const [t] = e;
55
+ if (t.isIntersecting && !p && f && n)
56
+ try {
57
+ w(!0);
58
+ const s = d + 1, { data: v, hasMore: A } = await f({
59
+ page: s,
60
+ pageSize: Y,
61
+ termOfSearch: g
62
+ });
63
+ D(s), U(A), T((H) => [...H, ...v]);
64
+ } catch {
65
+ console.error("Error fetching more options");
66
+ } finally {
67
+ w(!1);
68
+ }
69
+ }, 100),
70
+ [p, f, g, d]
71
+ );
72
+ return Q(() => {
73
+ if (u && n && m.current && !k) {
74
+ const e = new IntersectionObserver(z, {
75
+ threshold: 0.1
76
+ });
77
+ return e.observe(m.current), () => e.disconnect();
78
+ }
79
+ }, [
80
+ u,
81
+ n,
82
+ p,
83
+ k,
84
+ d
85
+ ]), /* @__PURE__ */ V(
35
86
  "ul",
36
87
  {
37
- ref: t,
38
- title: d,
88
+ ref: o,
89
+ title: I,
39
90
  role: "listbox",
40
- className: o(j({ className: f })),
41
- "data-state": v ? "open" : "closed",
42
- children: u ? /* @__PURE__ */ l(
43
- a,
44
- {
45
- className: o("select-none", s),
46
- isClickable: !1,
47
- value: "Loading...",
48
- label: "Loading..."
49
- }
50
- ) : w ? /* @__PURE__ */ l(
51
- a,
52
- {
53
- className: o("select-none", s),
54
- isClickable: !1,
55
- value: "No options",
56
- label: "No options"
57
- }
58
- ) : /* @__PURE__ */ x(N, { children: [
59
- c.map((e) => /* @__PURE__ */ l(
60
- a,
91
+ className: a(X({ className: N })),
92
+ "data-state": P ? "open" : "closed",
93
+ children: [
94
+ E ? /* @__PURE__ */ r(
95
+ b,
96
+ {
97
+ className: a("select-none", l),
98
+ isClickable: !1,
99
+ inputRef: i,
100
+ value: "Loading...",
101
+ label: "Loading...",
102
+ listItemSecondRowClassName: c
103
+ }
104
+ ) : q ? /* @__PURE__ */ r(
105
+ b,
61
106
  {
62
- className: o("select-none", s),
107
+ isEmpty: !0,
108
+ className: a("select-none", l),
109
+ isClickable: !1,
110
+ inputRef: i,
111
+ value: L ?? "",
112
+ label: L ?? "No options",
113
+ listItemSecondRowClassName: c
114
+ }
115
+ ) : _.map((e) => /* @__PURE__ */ r(
116
+ b,
117
+ {
118
+ className: a("select-none", l),
63
119
  isClickable: !0,
120
+ inputRef: i,
121
+ listItemSecondRowClassName: c,
64
122
  ...e
65
123
  },
66
124
  e.value
67
125
  )),
68
- m?.map((e, r) => /* @__PURE__ */ l("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ l(I, { className: "flex p-2 w-full h-full gap-1 items-center text-sm [&>svg]:w-3.5 [&>svg]:h-3.5 [&>svg]:shrink-0 cursor-pointer select-none hover:bg-gray-50 hover:dark:bg-slate-700 focus:outline-0", children: e }) }, r))
69
- ] })
126
+ u && n && /* @__PURE__ */ r(
127
+ "li",
128
+ {
129
+ ref: m,
130
+ role: "option",
131
+ "data-action": "true",
132
+ className: "flex items-center justify-center py-3",
133
+ onClick: (e) => e.stopPropagation(),
134
+ children: /* @__PURE__ */ r(R, { className: "w-4 h-4 text-aurora-500 select-none" })
135
+ }
136
+ ),
137
+ F?.map((e, t) => /* @__PURE__ */ r("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ r(Z, { className: "flex p-2 w-full h-full gap-1 items-center text-sm [&>svg]:w-3.5 [&>svg]:h-3.5 [&>svg]:shrink-0 cursor-pointer select-none hover:bg-gray-50 hover:dark:bg-slate-700 focus:outline-0", children: e }) }, t))
138
+ ]
70
139
  }
71
140
  );
72
141
  }
73
142
  );
74
143
  export {
75
- z as List
144
+ fe as List
76
145
  };
@@ -1,66 +1,117 @@
1
- import { jsx as o, jsxs as x } from "react/jsx-runtime";
2
- import { useRef as u, useCallback as l } from "react";
3
- import { Typography as b } from "../../../Typography/Typography.js";
4
- import { cn as w } from "../../../../utils/index.js";
5
- import { listItemVariants as y } from "./ListItem.variants.js";
6
- import { useDropdownContext as k } from "../../contexts/dropdown.hook.js";
7
- const D = ({
8
- isClickable: f,
9
- className: p,
1
+ import { jsx as s, jsxs as d } from "react/jsx-runtime";
2
+ import { useRef as I, useCallback as u } from "react";
3
+ import { cn as l } from "../../../../utils/index.js";
4
+ import { Typography as y } from "../../../Typography/Typography.js";
5
+ import { listItemVariants as L } from "./ListItem.variants.js";
6
+ import { useDropdownContext as V } from "../../contexts/dropdown.hook.js";
7
+ function j(c, n) {
8
+ const i = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp(`(${i})`, "gi");
9
+ return c.split(o).map((a, t) => a.toLowerCase() === n.toLowerCase() ? /* @__PURE__ */ s(
10
+ "mark",
11
+ {
12
+ className: "bg-transparent font-semibold text-slate-800 dark:text-slate-50",
13
+ children: a
14
+ },
15
+ t
16
+ ) : /* @__PURE__ */ s("span", { children: a }, t));
17
+ }
18
+ const K = ({
19
+ isEmpty: c,
20
+ isClickable: n,
21
+ className: i,
22
+ inputRef: o,
23
+ listItemSecondRowClassName: a,
10
24
  ...t
11
25
  }) => {
12
- const { searchTerm: r, highlightSearchEnabled: i, setValue: c, toggleOpen: m } = k(), d = u(null), a = l(
26
+ const { searchTerm: m, highlightSearchEnabled: h, setValue: p, toggleOpen: x } = V(), b = I(null), f = u(
13
27
  (e) => {
14
- c(e.value), m(!1);
28
+ p(e.value, o), x(!1);
15
29
  },
16
- [c, m]
17
- ), h = l(
18
- (e, s) => {
19
- e.key === "Enter" && (e.stopPropagation(), a(s));
30
+ [p, x]
31
+ ), w = u(
32
+ (e, r) => {
33
+ e.key === "Enter" && (e.stopPropagation(), f(r));
20
34
  },
21
- [a]
22
- ), g = l(
23
- (e) => {
35
+ [f]
36
+ ), N = u(
37
+ ({ label: e, rightComponent: r, subLabel: g, rightComponentClassName: C }) => {
38
+ if (c)
39
+ return /* @__PURE__ */ s(
40
+ y,
41
+ {
42
+ variant: "body2",
43
+ className: "text-zinc-800 dark:text-slate-50 italic",
44
+ children: e
45
+ }
46
+ );
24
47
  if (typeof e != "string")
25
48
  return e;
26
- const s = i && r.length > 0 ? e.split(new RegExp(`(${r})`, "gi")).map((n) => n.toLowerCase() === r.toLowerCase() ? /* @__PURE__ */ o(
27
- "mark",
28
- {
29
- className: "bg-transparent font-semibold text-slate-800 dark:text-slate-50",
30
- children: n
31
- },
32
- n
33
- ) : n) : [e];
34
- return /* @__PURE__ */ o(
35
- b,
49
+ const k = h && m.length > 0 ? j(e, m) : [e];
50
+ return /* @__PURE__ */ d(
51
+ y,
36
52
  {
37
53
  variant: "body2",
38
- className: "text-zinc-700 dark:text-slate-50",
39
- children: s
54
+ className: "text-zinc-700 dark:text-slate-50 font-medium",
55
+ children: [
56
+ r ? /* @__PURE__ */ d(
57
+ "span",
58
+ {
59
+ className: l("flex gap-2 items-center", C),
60
+ children: [
61
+ k,
62
+ " ",
63
+ r
64
+ ]
65
+ }
66
+ ) : k,
67
+ g ? /* @__PURE__ */ s(
68
+ "span",
69
+ {
70
+ className: l(
71
+ "block font-normal text-sm text-slate-800 dark:text-slate-50",
72
+ a
73
+ ),
74
+ children: g
75
+ }
76
+ ) : null
77
+ ]
40
78
  }
41
79
  );
42
80
  },
43
- [i, r]
81
+ [h, m]
44
82
  );
45
- return /* @__PURE__ */ x(
83
+ return /* @__PURE__ */ d(
46
84
  "li",
47
85
  {
48
- ref: d,
86
+ ref: b,
49
87
  role: "option",
50
88
  "data-action": "false",
51
- className: w(y({ className: p })),
89
+ className: l(L({ className: i })),
52
90
  tabIndex: 0,
53
91
  onClick: (e) => {
54
- f && (a(t), e.stopPropagation());
92
+ n && (f(t), e.stopPropagation());
55
93
  },
56
- onKeyDown: (e) => h(e, t),
94
+ onKeyDown: (e) => w(e, t),
57
95
  children: [
58
- t.leftIcon ? /* @__PURE__ */ o("span", { className: "w-4 h-4 flex justify-center items-center", children: t.leftIcon }) : null,
59
- g(t.label)
96
+ t.leftIcon ? /* @__PURE__ */ s(
97
+ "span",
98
+ {
99
+ className: l(
100
+ "w-4 h-4 flex justify-center",
101
+ {
102
+ "items-center": !t.subLabel,
103
+ "items-baseline -translate-y-2": !!t.subLabel
104
+ },
105
+ t.leftIconClassName
106
+ ),
107
+ children: t.leftIcon
108
+ }
109
+ ) : null,
110
+ N(t)
60
111
  ]
61
112
  }
62
113
  );
63
114
  };
64
115
  export {
65
- D as ListItem
116
+ K as ListItem
66
117
  };