@konstructio/ui 0.1.2-alpha.3 → 0.1.2-alpha.31

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 (163) hide show
  1. package/dist/DatePicker.css +1 -1
  2. package/dist/Modal-5xSxFoaD.js +99 -0
  3. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  4. package/dist/chevron-down-DgT-uSF9.js +5 -0
  5. package/dist/chevron-right-DYvXLeql.js +7 -0
  6. package/dist/chevron-up-DrQr2Fwd.js +5 -0
  7. package/dist/components/Alert/Alert.js +2 -2
  8. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  9. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  10. package/dist/components/AlertDialog/components/index.js +1 -1
  11. package/dist/components/Badge/Badge.js +30 -33
  12. package/dist/components/Badge/Badge.variants.js +8 -6
  13. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  14. package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
  15. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  16. package/dist/components/Button/Button.js +1 -1
  17. package/dist/components/Button/Button.variants.js +1 -1
  18. package/dist/components/Card/Card.variants.js +5 -9
  19. package/dist/components/Checkbox/Checkbox.js +6 -6
  20. package/dist/components/Command/Command.js +2 -2
  21. package/dist/components/Command/components/Command.js +1 -1
  22. package/dist/components/Command/components/CommandEmpty.js +1 -1
  23. package/dist/components/Command/components/CommandGroup.js +1 -1
  24. package/dist/components/Command/components/CommandInput.js +2 -2
  25. package/dist/components/Command/components/CommandItem.js +1 -1
  26. package/dist/components/Command/components/CommandList.js +1 -1
  27. package/dist/components/Command/components/CommandSeparator.js +1 -1
  28. package/dist/components/Command/components/DialogContent.js +2 -2
  29. package/dist/components/Command/components/DialogOverlay.js +1 -1
  30. package/dist/components/Datepicker/DatePicker.js +1209 -1147
  31. package/dist/components/Divider/Divider.variants.js +1 -1
  32. package/dist/components/Dropdown/Dropdown.js +46 -28
  33. package/dist/components/Dropdown/Dropdown.variants.js +32 -9
  34. package/dist/components/Dropdown/components/List/List.js +133 -54
  35. package/dist/components/Dropdown/components/List/List.variants.js +9 -7
  36. package/dist/components/Dropdown/components/ListItem/ListItem.js +74 -24
  37. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
  38. package/dist/components/Dropdown/components/Wrapper.js +144 -109
  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 +26 -8
  42. package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -19
  43. package/dist/components/Dropdown/hooks/useDropdown.js +83 -39
  44. package/dist/components/Dropdown/hooks/useNavigationList.js +28 -36
  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 +1 -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 +3 -3
  57. package/dist/components/Modal/components/index.js +1 -1
  58. package/dist/components/NumberInput/NumberInput.js +2 -2
  59. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
  60. package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +45 -0
  61. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +27 -0
  62. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +629 -0
  63. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +36 -0
  64. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
  65. package/dist/components/PhoneNumberInput/components/Wrapper.js +625 -0
  66. package/dist/components/PhoneNumberInput/components/index.js +6 -0
  67. package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
  68. package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
  69. package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
  70. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6139 -0
  71. package/dist/components/PhoneNumberInput/utils/index.js +11 -0
  72. package/dist/components/PieChart/PieChart.js +647 -664
  73. package/dist/components/RadioCard/RadioCard.variants.js +1 -6
  74. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  75. package/dist/components/Range/Range.js +1 -1
  76. package/dist/components/Sidebar/Sidebar.variants.js +2 -2
  77. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
  78. package/dist/components/Slider/Slider.js +1 -1
  79. package/dist/components/Switch/Switch.js +8 -8
  80. package/dist/components/Switch/Switch.variants.js +4 -4
  81. package/dist/components/Tabs/Tabs.js +1 -1
  82. package/dist/components/Tabs/Tabs.variants.js +45 -24
  83. package/dist/components/Tabs/components/Content.js +1 -1
  84. package/dist/components/Tabs/components/List.js +1 -1
  85. package/dist/components/Tabs/components/Trigger.js +9 -8
  86. package/dist/components/Tag/Tag.js +1 -1
  87. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
  88. package/dist/components/TimePicker/TimePicker.variants.js +2 -2
  89. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +2 -2
  90. package/dist/components/Toast/Toast.js +206 -181
  91. package/dist/components/Tooltip/Tooltip.js +1 -1
  92. package/dist/components/Typography/Typography.variants.js +18 -23
  93. package/dist/components/VirtualizedTable/VirtualizedTable.js +119 -0
  94. package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
  95. package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
  96. package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
  97. package/dist/components/VirtualizedTable/assets/index.js +6 -0
  98. package/dist/components/VirtualizedTable/components/Actions/Actions.js +72 -0
  99. package/dist/components/VirtualizedTable/components/Body/Body.js +51 -0
  100. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
  101. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
  102. package/dist/components/VirtualizedTable/components/Filter/Filter.js +88 -0
  103. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
  104. package/dist/components/VirtualizedTable/components/Header/Header.js +84 -0
  105. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +53 -0
  106. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
  107. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +34 -0
  108. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
  109. package/dist/components/VirtualizedTable/components/index.js +16 -0
  110. package/dist/components/VirtualizedTable/constants/index.js +5 -0
  111. package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
  112. package/dist/components/VirtualizedTable/contexts/index.js +8 -0
  113. package/dist/components/VirtualizedTable/contexts/table.context.js +32 -0
  114. package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
  115. package/dist/components/VirtualizedTable/contexts/table.provider.js +85 -0
  116. package/dist/components/index.js +79 -73
  117. package/dist/contexts/theme.provider.js +0 -1
  118. package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D4r5Phnh.js} +0 -24
  119. package/dist/debounce-BFejQm9P.js +200 -0
  120. package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
  121. package/dist/{index-h-Ul0anl.js → index--V_ZsiQe.js} +1 -22
  122. package/dist/index-2hB40Iuc.js +1873 -0
  123. package/dist/index-BZPx6jYI.js +8 -0
  124. package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
  125. package/dist/index-BtQfgaSF.js +60 -0
  126. package/dist/index-C3tHPg8y.js +662 -0
  127. package/dist/index-CIAmiWcw.js +200 -0
  128. package/dist/index-CSFe9uC5.js +14 -0
  129. package/dist/index-CSWGJT-v.js +1722 -0
  130. package/dist/index-CigKKiZS.js +91 -0
  131. package/dist/index-DDByhzds.js +137 -0
  132. package/dist/{index-BAraV3ai.js → index-DH2Fnov1.js} +11 -12
  133. package/dist/index-DLcqcWxM.js +29 -0
  134. package/dist/index-Dbt2vBmS.js +136 -0
  135. package/dist/{index-DB2XhXHn.js → index-DpW9ExsS.js} +7 -7
  136. package/dist/index-DrWQH0QF.js +55 -0
  137. package/dist/{index-D3xzCzcO.js → index-X4k_cU8k.js} +4 -4
  138. package/dist/index-kyuBfLcN.js +479 -0
  139. package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
  140. package/dist/index-ohdbKsws.js +27 -0
  141. package/dist/index.d.ts +184 -18
  142. package/dist/index.js +106 -98
  143. package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
  144. package/dist/package.json +46 -32
  145. package/dist/styles.css +1 -1
  146. package/dist/ui/civo-theme.css +191 -167
  147. package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
  148. package/dist/utils/index.js +534 -501
  149. package/dist/{x-BPcqkRZd.js → x-DPU9OdYH.js} +1 -1
  150. package/package.json +46 -32
  151. package/dist/Modal-V67Uz78z.js +0 -98
  152. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  153. package/dist/chevron-down-BLZPftpV.js +0 -11
  154. package/dist/chevron-up-RLP4nX7V.js +0 -54
  155. package/dist/index-BXuxPoz7.js +0 -435
  156. package/dist/index-BfXxHr_2.js +0 -125
  157. package/dist/index-C9T9HQaa.js +0 -423
  158. package/dist/index-CZnD2QxM.js +0 -32
  159. package/dist/index-CrBonFvu.js +0 -144
  160. package/dist/index-Cvx4lqTq.js +0 -47
  161. package/dist/index-DQH6odE9.js +0 -82
  162. package/dist/index-Oq5GlCHP.js +0 -131
  163. 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,30 +1,48 @@
1
- import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
- import { forwardRef as p } from "react";
3
- import { DropdownProvider as n } from "./contexts/dropdown.provider.js";
4
- import { Wrapper as c } from "./components/Wrapper.js";
5
- const v = p(({ onChange: r, onBlur: l, value: a, error: s, helperText: e, name: o, ...i }, d) => /* @__PURE__ */ t(
6
- n,
7
- {
8
- onChange: r,
9
- onBlur: l,
10
- value: a,
11
- name: o,
12
- children: /* @__PURE__ */ m("div", { className: "relative w-full", children: [
13
- /* @__PURE__ */ t(
14
- c,
15
- {
16
- name: o,
17
- error: s,
18
- ref: d,
19
- onBlur: l,
20
- ...i
21
- }
22
- ),
23
- s ? /* @__PURE__ */ t("span", { className: "text-xs text-red-700", children: s }) : null,
24
- !s && e ? /* @__PURE__ */ t("span", { className: "text-xs text-slate-600", children: e }) : null
25
- ] })
26
- }
27
- ));
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(
7
+ ({
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,
22
+ {
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,
32
+ {
33
+ error: t,
34
+ name: l,
35
+ ref: x,
36
+ onBlur: e,
37
+ ...f
38
+ }
39
+ ),
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
42
+ ] })
43
+ }
44
+ )
45
+ );
28
46
  export {
29
- v as Dropdown
47
+ W as Dropdown
30
48
  };
@@ -1,6 +1,7 @@
1
- import { c as r } from "../../index-D29mdTf5.js";
2
- const a = r(
1
+ import { c as e } from "../../index-D29mdTf5.js";
2
+ const a = e(
3
3
  [
4
+ "group",
4
5
  "border",
5
6
  "cursor-pointer",
6
7
  "ease-in-out",
@@ -20,7 +21,9 @@ const a = r(
20
21
  "aria-expanded:border-aurora-500",
21
22
  "aria-expanded:text-aurora-500",
22
23
  "kubefirst:aria-expanded:border-kubefirst-primary",
23
- "kubefirst:aria-expanded:text-kubefirst-secondary"
24
+ "kubefirst:aria-expanded:text-kubefirst-secondary",
25
+ "dark:border-slate-600",
26
+ "dark:focus-visible:bg-slate-800"
24
27
  ],
25
28
  {
26
29
  variants: {
@@ -32,20 +35,40 @@ const a = r(
32
35
  "kubefirst:text-red-600"
33
36
  ],
34
37
  false: ""
38
+ },
39
+ disabled: {
40
+ true: ["cursor-default", "bg-gray-100", "dark:bg-slate-700/80"],
41
+ false: []
35
42
  }
36
43
  },
37
44
  defaultVariants: {
38
- hasError: !1
45
+ hasError: !1,
46
+ disabled: !1
39
47
  }
40
48
  }
41
- ), t = r([
49
+ ), t = e([
50
+ "flex-1",
51
+ "bg-transparent",
52
+ "border-none",
53
+ "outline-none",
54
+ "text-zinc-700",
55
+ "text-sm",
56
+ "capitalize",
57
+ "placeholder:text-sm",
58
+ "placeholder:normal-case",
59
+ "placeholder:select-none",
60
+ "dark:placeholder:text-slate-400",
61
+ "dark:text-slate-50"
62
+ ]), d = e([
42
63
  "mb-1",
43
64
  "cursor-pointer",
44
- "text-[14px]",
45
- "leading-[20px]",
46
- "tracking-[0.1px]"
65
+ "text-sm",
66
+ "leading-5",
67
+ "tracking-[0.1px]",
68
+ "dark:text-slate-50"
47
69
  ]);
48
70
  export {
49
71
  a as dropdownVariants,
50
- t as labelVariants
72
+ t as inputVariants,
73
+ d as labelVariants
51
74
  };
@@ -1,64 +1,143 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as v, useRef as w, useImperativeHandle as N } from "react";
3
- import { cn as h } from "../../../../utils/index.js";
4
- import { useNavigationUlList as x } from "../../hooks/useNavigationList.js";
5
- import { ListItem as s } from "../ListItem/ListItem.js";
6
- import { listVariants as C } from "./List.variants.js";
7
- import { useDropdownContext as k } from "../../contexts/dropdown.hook.js";
8
- const T = v(
1
+ import { jsxs as H, jsx as o } from "react/jsx-runtime";
2
+ import { S as V } from "../../../../index-BtQfgaSF.js";
3
+ import { d as Z } from "../../../../debounce-BFejQm9P.js";
4
+ import { forwardRef as B, useRef as k, useState as G, useImperativeHandle as J, useMemo as K, useEffect as M } from "react";
5
+ import { Loading as Q } from "../../../Loading/Loading.js";
6
+ import { cn as a } from "../../../../utils/index.js";
7
+ import { useNavigationUlList as R } from "../../hooks/useNavigationList.js";
8
+ import { ListItem as b } from "../ListItem/ListItem.js";
9
+ import { listVariants as W } from "./List.variants.js";
10
+ import { DEFAULT_LIST_SIZE as X } from "../../constants/pagination.js";
11
+ import { useDropdownContext as Y } from "../../contexts/dropdown.hook.js";
12
+ const ue = B(
9
13
  ({
10
- className: i,
11
- isLoading: n,
12
- itemClassName: o,
13
- name: c,
14
- options: r,
15
- searchable: m = !1,
16
- wrapperInputRef: f,
17
- wrapperRef: p
18
- }, u) => {
19
- const l = w(null), { isOpen: b, searchTerm: d } = k();
20
- N(u, () => l.current, [l]), x({ ulRef: l, wrapperRef: p, wrapperInputRef: f });
21
- const a = m ? r.filter((e) => {
22
- const g = d.toLowerCase();
23
- return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(g);
24
- }) : r, L = a.length === 0;
25
- return /* @__PURE__ */ t(
14
+ additionalOptions: C,
15
+ className: F,
16
+ inputRef: i,
17
+ isLoading: N,
18
+ itemClassName: l,
19
+ name: I,
20
+ searchable: L = !1,
21
+ listItemSecondRowClassName: c,
22
+ wrapperInputRef: O,
23
+ isInfiniteScrollEnabled: u,
24
+ onFetchMoreOptions: f
25
+ }, T) => {
26
+ const s = k(null), m = k(null), [p, x] = G(!1), {
27
+ isOpen: j,
28
+ searchTerm: g,
29
+ canFilter: E,
30
+ canContinueFetching: n,
31
+ page: d,
32
+ options: y,
33
+ isTyping: w,
34
+ setOptions: P,
35
+ setPage: S,
36
+ setCanContinueFetching: D
37
+ } = Y();
38
+ J(T, () => s.current, [s]);
39
+ const h = L && E ? y.filter((e) => {
40
+ const t = g.toLowerCase();
41
+ return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(t);
42
+ }) : y;
43
+ R({
44
+ ulRef: s,
45
+ wrapperInputRef: O,
46
+ searchable: L,
47
+ filteredOptions: h
48
+ });
49
+ const U = h.filter(
50
+ (e, t, r) => t === r.findIndex((v) => v.value === e.value)
51
+ ), _ = h.length === 0, q = K(
52
+ () => Z(async (e) => {
53
+ const [t] = e;
54
+ if (t.isIntersecting && !p && f && n)
55
+ try {
56
+ x(!0);
57
+ const r = d + 1, { data: v, hasMore: z } = await f({
58
+ page: r,
59
+ pageSize: X,
60
+ termOfSearch: g
61
+ });
62
+ S(r), D(z), P((A) => [...A, ...v]);
63
+ } catch {
64
+ console.error("Error fetching more options");
65
+ } finally {
66
+ x(!1);
67
+ }
68
+ }, 100),
69
+ [p, f, g, d]
70
+ );
71
+ return M(() => {
72
+ if (u && n && m.current && !w) {
73
+ const e = new IntersectionObserver(q, {
74
+ threshold: 0.1
75
+ });
76
+ return e.observe(m.current), () => e.disconnect();
77
+ }
78
+ }, [
79
+ u,
80
+ n,
81
+ p,
82
+ w,
83
+ d
84
+ ]), /* @__PURE__ */ H(
26
85
  "ul",
27
86
  {
28
- ref: l,
29
- title: c,
87
+ ref: s,
88
+ title: I,
30
89
  role: "listbox",
31
- className: h(C({ className: i })),
32
- "data-state": b ? "open" : "closed",
33
- children: n ? /* @__PURE__ */ t(
34
- s,
35
- {
36
- className: o,
37
- isClickable: !1,
38
- value: "Loading...",
39
- label: "Loading..."
40
- }
41
- ) : L ? /* @__PURE__ */ t(
42
- s,
43
- {
44
- className: o,
45
- isClickable: !1,
46
- value: "No options",
47
- label: "No options"
48
- }
49
- ) : a.map((e) => /* @__PURE__ */ t(
50
- s,
51
- {
52
- className: o,
53
- isClickable: !0,
54
- ...e
55
- },
56
- e.value
57
- ))
90
+ className: a(W({ className: F })),
91
+ "data-state": j ? "open" : "closed",
92
+ children: [
93
+ N ? /* @__PURE__ */ o(
94
+ b,
95
+ {
96
+ className: a("select-none", l),
97
+ isClickable: !1,
98
+ inputRef: i,
99
+ value: "Loading...",
100
+ label: "Loading...",
101
+ listItemSecondRowClassName: c
102
+ }
103
+ ) : _ ? /* @__PURE__ */ o(
104
+ b,
105
+ {
106
+ className: a("select-none", l),
107
+ isClickable: !1,
108
+ inputRef: i,
109
+ value: "No options",
110
+ label: "No options",
111
+ listItemSecondRowClassName: c
112
+ }
113
+ ) : U.map((e) => /* @__PURE__ */ o(
114
+ b,
115
+ {
116
+ className: a("select-none", l),
117
+ isClickable: !0,
118
+ inputRef: i,
119
+ listItemSecondRowClassName: c,
120
+ ...e
121
+ },
122
+ e.value
123
+ )),
124
+ u && n && /* @__PURE__ */ o(
125
+ "li",
126
+ {
127
+ ref: m,
128
+ role: "option",
129
+ "data-action": "true",
130
+ className: "flex items-center justify-center py-3",
131
+ onClick: (e) => e.stopPropagation(),
132
+ children: /* @__PURE__ */ o(Q, { className: "w-4 h-4 text-aurora-500 select-none" })
133
+ }
134
+ ),
135
+ C?.map((e, t) => /* @__PURE__ */ o("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ o(V, { 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))
136
+ ]
58
137
  }
59
138
  );
60
139
  }
61
140
  );
62
141
  export {
63
- T as List
142
+ ue as List
64
143
  };
@@ -1,26 +1,28 @@
1
1
  import { c as o } from "../../../../index-D29mdTf5.js";
2
- const a = o([
2
+ const t = o([
3
3
  "absolute",
4
4
  "bg-white",
5
5
  "border",
6
- "duration-100",
7
- "ease-in-out",
8
6
  "flex-col",
9
7
  "mt-1",
10
8
  "overflow-hidden",
11
9
  "rounded-md",
12
10
  "shadow-2xs",
13
11
  "top-full",
14
- "transition-all",
15
12
  "w-full",
16
13
  "z-10",
17
14
  "max-h-[185px]",
18
15
  "overflow-y-auto",
19
16
  "border-gray-200",
20
17
  "text-zinc-700",
21
- "data-[state=open]:block",
22
- "data-[state=closed]:hidden"
18
+ "animate-in",
19
+ "fade-in-50",
20
+ "zoom-in-95",
21
+ "duration-[200ms]",
22
+ "dark:bg-slate-800",
23
+ "dark:border-slate-700",
24
+ "dark:text-slate-50"
23
25
  ]);
24
26
  export {
25
- a as listVariants
27
+ t as listVariants
26
28
  };
@@ -1,43 +1,93 @@
1
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import { useRef as u, useCallback as s } from "react";
3
- import { Typography as d } from "../../../Typography/Typography.js";
4
- import { cn as h } from "../../../../utils/index.js";
5
- import { listItemVariants as x } from "./ListItem.variants.js";
6
- import { useDropdownContext as y } from "../../contexts/dropdown.hook.js";
7
- const j = ({
8
- isClickable: a,
9
- className: i,
1
+ import { jsxs as g, jsx as l } from "react/jsx-runtime";
2
+ import { useRef as y, useCallback as m } from "react";
3
+ import { Typography as w } from "../../../Typography/Typography.js";
4
+ import { cn as f } from "../../../../utils/index.js";
5
+ import { listItemVariants as C } from "./ListItem.variants.js";
6
+ import { useDropdownContext as L } from "../../contexts/dropdown.hook.js";
7
+ function I(r, n) {
8
+ const o = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), c = new RegExp(`(${o})`, "gi");
9
+ return r.split(c).map((t, a) => t.toLowerCase() === n.toLowerCase() ? /* @__PURE__ */ l(
10
+ "mark",
11
+ {
12
+ className: "bg-transparent font-semibold text-slate-800 dark:text-slate-50",
13
+ children: t
14
+ },
15
+ a
16
+ ) : /* @__PURE__ */ l("span", { children: t }, a));
17
+ }
18
+ const $ = ({
19
+ isClickable: r,
20
+ className: n,
21
+ inputRef: o,
22
+ listItemSecondRowClassName: c,
10
23
  ...t
11
24
  }) => {
12
- const { setValue: l, toggleOpen: n } = y(), c = u(null), o = s(
25
+ const { searchTerm: a, highlightSearchEnabled: d, setValue: h, toggleOpen: u } = L(), p = y(null), i = m(
13
26
  (e) => {
14
- l(e.value), n(!1);
27
+ h(e.value, o), u(!1);
28
+ },
29
+ [h, u]
30
+ ), x = m(
31
+ (e, s) => {
32
+ e.key === "Enter" && (e.stopPropagation(), i(s));
15
33
  },
16
- [l, n]
17
- ), m = s(
18
- (e, f) => {
19
- e.key === "Enter" && (e.stopPropagation(), o(f));
34
+ [i]
35
+ ), b = m(
36
+ (e, s) => {
37
+ if (typeof e != "string")
38
+ return e;
39
+ const k = d && a.length > 0 ? I(e, a) : [e];
40
+ return /* @__PURE__ */ g(
41
+ w,
42
+ {
43
+ variant: "body2",
44
+ className: "text-zinc-700 dark:text-slate-50 font-medium",
45
+ children: [
46
+ k,
47
+ s ? /* @__PURE__ */ l(
48
+ "span",
49
+ {
50
+ className: f(
51
+ "block font-normal text-sm text-slate-800 dark:text-slate-50",
52
+ c
53
+ ),
54
+ children: s
55
+ }
56
+ ) : null
57
+ ]
58
+ }
59
+ );
20
60
  },
21
- [o]
61
+ [d, a]
22
62
  );
23
- return /* @__PURE__ */ p(
63
+ return /* @__PURE__ */ g(
24
64
  "li",
25
65
  {
26
- ref: c,
66
+ ref: p,
27
67
  role: "option",
28
- className: h(x({ className: i })),
68
+ "data-action": "false",
69
+ className: f(C({ className: n })),
29
70
  tabIndex: 0,
30
71
  onClick: (e) => {
31
- a && (o(t), e.stopPropagation());
72
+ r && (i(t), e.stopPropagation());
32
73
  },
33
- onKeyDown: (e) => m(e, t),
74
+ onKeyDown: (e) => x(e, t),
34
75
  children: [
35
- t.leftIcon ? /* @__PURE__ */ r("span", { className: "w-4 h-4 flex justify-center items-center", children: t.leftIcon }) : null,
36
- /* @__PURE__ */ r(d, { variant: "body2", className: "text-zinc-700", children: t.label })
76
+ t.leftIcon ? /* @__PURE__ */ l(
77
+ "span",
78
+ {
79
+ className: f("w-4 h-4 flex justify-center", {
80
+ "items-center": !t.subLabel,
81
+ "items-baseline -translate-y-2": !!t.subLabel
82
+ }),
83
+ children: t.leftIcon
84
+ }
85
+ ) : null,
86
+ b(t.label, t.subLabel)
37
87
  ]
38
88
  }
39
89
  );
40
90
  };
41
91
  export {
42
- j as ListItem
92
+ $ as ListItem
43
93
  };
@@ -1,5 +1,5 @@
1
- import { c as o } from "../../../../index-D29mdTf5.js";
2
- const i = o([
1
+ import { c as r } from "../../../../index-D29mdTf5.js";
2
+ const t = r([
3
3
  "cursor-pointer",
4
4
  "py-2",
5
5
  "px-2",
@@ -10,11 +10,13 @@ const i = o([
10
10
  "flex",
11
11
  "items-center",
12
12
  "gap-3",
13
- "hover:bg-slate-50",
14
- "focus:bg-slate-50",
15
- "civo:focus:bg-civo-primary/5",
16
- "civo:hover:bg-civo-primary/5"
13
+ "transition-bg",
14
+ "duration-250",
15
+ "hover:bg-gray-50",
16
+ "focus:bg-gray-50",
17
+ "dark:hover:bg-slate-700",
18
+ "dark:focus:bg-slate-700"
17
19
  ]);
18
20
  export {
19
- i as listItemVariants
21
+ t as listItemVariants
20
22
  };