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

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 (103) hide show
  1. package/dist/{Modal-V67Uz78z.js → Modal-D-NOEWMX.js} +3 -3
  2. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  3. package/dist/{chevron-down-BLZPftpV.js → chevron-down-MZvQoT2F.js} +2 -2
  4. package/dist/chevron-right-VYBOBhRt.js +19 -0
  5. package/dist/components/Alert/Alert.js +2 -2
  6. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  7. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  8. package/dist/components/AlertDialog/components/index.js +1 -1
  9. package/dist/components/Badge/Badge.js +2 -2
  10. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  11. package/dist/components/Breadcrumb/components/Item/Item.js +16 -15
  12. package/dist/components/Checkbox/Checkbox.js +5 -4
  13. package/dist/components/Command/Command.js +2 -2
  14. package/dist/components/Command/components/Command.js +1 -1
  15. package/dist/components/Command/components/CommandEmpty.js +1 -1
  16. package/dist/components/Command/components/CommandGroup.js +1 -1
  17. package/dist/components/Command/components/CommandInput.js +2 -2
  18. package/dist/components/Command/components/CommandItem.js +1 -1
  19. package/dist/components/Command/components/CommandList.js +1 -1
  20. package/dist/components/Command/components/CommandSeparator.js +1 -1
  21. package/dist/components/Command/components/DialogContent.js +2 -2
  22. package/dist/components/Command/components/DialogOverlay.js +1 -1
  23. package/dist/components/Datepicker/DatePicker.js +545 -543
  24. package/dist/components/Dropdown/Dropdown.js +36 -24
  25. package/dist/components/Dropdown/Dropdown.variants.js +25 -7
  26. package/dist/components/Dropdown/components/List/List.js +59 -44
  27. package/dist/components/Dropdown/components/List/List.variants.js +9 -7
  28. package/dist/components/Dropdown/components/ListItem/ListItem.js +48 -24
  29. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
  30. package/dist/components/Dropdown/components/Wrapper.js +141 -106
  31. package/dist/components/Dropdown/contexts/dropdown.context.js +9 -8
  32. package/dist/components/Dropdown/contexts/dropdown.provider.js +20 -19
  33. package/dist/components/Dropdown/hooks/useDropdown.js +26 -27
  34. package/dist/components/Dropdown/hooks/useNavigationList.js +32 -28
  35. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  36. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  37. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
  38. package/dist/components/Input/Input.js +1 -1
  39. package/dist/components/Loading/Loading.js +2 -2
  40. package/dist/components/Modal/Modal.js +2 -2
  41. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
  42. package/dist/components/Modal/components/index.js +1 -1
  43. package/dist/components/NumberInput/NumberInput.js +2 -2
  44. package/dist/components/PieChart/PieChart.js +217 -215
  45. package/dist/components/Range/Range.js +1 -1
  46. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
  47. package/dist/components/Slider/Slider.js +1 -1
  48. package/dist/components/Switch/Switch.js +6 -5
  49. package/dist/components/Tabs/Tabs.js +1 -1
  50. package/dist/components/Tabs/Tabs.variants.js +45 -24
  51. package/dist/components/Tabs/components/Content.js +1 -1
  52. package/dist/components/Tabs/components/List.js +1 -1
  53. package/dist/components/Tabs/components/Trigger.js +9 -8
  54. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
  55. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
  56. package/dist/components/Toast/Toast.js +8 -7
  57. package/dist/components/VirtualizedTable/VirtualizedTable.js +99 -0
  58. package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
  59. package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
  60. package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
  61. package/dist/components/VirtualizedTable/assets/index.js +6 -0
  62. package/dist/components/VirtualizedTable/components/Actions/Actions.js +46 -0
  63. package/dist/components/VirtualizedTable/components/Body/Body.js +25 -0
  64. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
  65. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
  66. package/dist/components/VirtualizedTable/components/Filter/Filter.js +73 -0
  67. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
  68. package/dist/components/VirtualizedTable/components/Header/Header.js +82 -0
  69. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +45 -0
  70. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1870 -0
  71. package/dist/components/VirtualizedTable/components/index.js +14 -0
  72. package/dist/components/VirtualizedTable/constants/index.js +5 -0
  73. package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
  74. package/dist/components/VirtualizedTable/contexts/index.js +8 -0
  75. package/dist/components/VirtualizedTable/contexts/table.context.js +31 -0
  76. package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
  77. package/dist/components/VirtualizedTable/contexts/table.provider.js +778 -0
  78. package/dist/components/index.js +44 -40
  79. package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D2CN7Ma9.js} +4 -4
  80. package/dist/debounce-BFejQm9P.js +200 -0
  81. package/dist/{index-D3xzCzcO.js → index-B7t8D14s.js} +2 -2
  82. package/dist/index-BAEWsOG1.js +27 -0
  83. package/dist/{index-C9T9HQaa.js → index-BITvcJAz.js} +1 -1
  84. package/dist/index-BZPx6jYI.js +8 -0
  85. package/dist/{index-BAraV3ai.js → index-Bnb0ezr3.js} +1 -1
  86. package/dist/{index-DB2XhXHn.js → index-C84F4YyO.js} +11 -10
  87. package/dist/index-Cd2vhaop.js +137 -0
  88. package/dist/{index-iXyXtdgP.js → index-DBbEcSUG.js} +1 -1
  89. package/dist/index-Dx2grAuN.js +1742 -0
  90. package/dist/{index-BXuxPoz7.js → index-DzIBBMjs.js} +18 -17
  91. package/dist/{index-h-Ul0anl.js → index-N2OStZoU.js} +1 -1
  92. package/dist/{index-Oq5GlCHP.js → index-os7vysFS.js} +1 -1
  93. package/dist/index-ti1b9kqV.js +14 -0
  94. package/dist/index.d.ts +94 -5
  95. package/dist/index.js +41 -37
  96. package/dist/package.json +26 -22
  97. package/dist/styles.css +1 -1
  98. package/dist/{x-BPcqkRZd.js → x-4F_5p77m.js} +1 -1
  99. package/package.json +26 -22
  100. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  101. package/dist/chevron-up-RLP4nX7V.js +0 -54
  102. package/dist/index-CZnD2QxM.js +0 -32
  103. package/dist/index-CrBonFvu.js +0 -144
@@ -1,131 +1,163 @@
1
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as W, useId as q, useRef as T, useImperativeHandle as G, useMemo as J, useEffect as N } from "react";
3
- import { Loading as K } from "../../Loading/Loading.js";
4
- import { Typography as Q } from "../../Typography/Typography.js";
1
+ import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as K, useId as Q, useRef as R, useImperativeHandle as S, useMemo as X, useEffect as g } from "react";
3
+ import { Loading as Y } from "../../Loading/Loading.js";
4
+ import { Typography as Z } from "../../Typography/Typography.js";
5
5
  import { cn as s } from "../../../utils/index.js";
6
- import { labelVariants as X, dropdownVariants as Y } from "../Dropdown.variants.js";
7
- import { useDropdown as Z } from "../hooks/useDropdown.js";
8
- import { List as _ } from "./List/List.js";
9
- import { C as B } from "../../../chevron-up-RLP4nX7V.js";
10
- import { useDropdownContext as ee } from "../contexts/dropdown.hook.js";
11
- const fe = W(
6
+ import { labelVariants as B, inputVariants as ee, dropdownVariants as te } from "../Dropdown.variants.js";
7
+ import { useDropdown as ae } from "../hooks/useDropdown.js";
8
+ import { List as re } from "./List/List.js";
9
+ import { c as T } from "../../../createLucideIcon-D2CN7Ma9.js";
10
+ import { useDropdownContext as ne } from "../contexts/dropdown.hook.js";
11
+ /**
12
+ * @license lucide-react v0.545.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */
17
+ const le = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], oe = T("chevron-up", le);
18
+ /**
19
+ * @license lucide-react v0.545.0 - ISC
20
+ *
21
+ * This source code is licensed under the ISC license.
22
+ * See the LICENSE file in the root directory of this source tree.
23
+ */
24
+ const se = [
25
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
26
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
27
+ ], ce = T("search", se), we = K(
12
28
  ({
13
- className: j,
14
- defaultValue: p,
29
+ additionalOptions: V,
30
+ className: _,
31
+ defaultValue: x,
15
32
  error: f,
16
- iconClassName: k,
17
- isLoading: C,
18
- label: x,
19
- labelClassName: V,
20
- listClassName: D,
21
- listItemClassName: F,
22
- name: u,
23
- options: a,
24
- placeholder: h,
25
- isRequired: g,
26
- searchable: y = !1,
27
- theme: M,
28
- wrapperClassName: $,
29
- onBlur: I
30
- }, A) => {
31
- const L = q(), n = T(null), O = T(null), { wrapperRef: c, wrapperInputRef: R, handleOpen: z, handleOpenIfClosed: H } = Z({ ulRef: O }), { isOpen: v, searchTerm: P, value: r, toggleOpen: E, setValue: b, setSearchTerm: w } = ee(), i = u ? `${L}-${u}` : L;
32
- G(A, () => n.current, [n]);
33
- const l = J(() => a.find(({ value: e }) => e === r), [a, r]);
34
- N(() => {
35
- n.current && (n.current.value = r ? l?.value : "");
36
- }, [l, r]), N(() => {
37
- if (p && !r) {
38
- const e = a && a.find((o) => o.value === p);
39
- e && b(e.value);
33
+ iconClassName: $,
34
+ inputClassName: D,
35
+ isLoading: L,
36
+ isRequired: h,
37
+ label: v,
38
+ labelClassName: F,
39
+ listClassName: M,
40
+ listItemClassName: A,
41
+ name: c,
42
+ options: n,
43
+ placeholder: N,
44
+ searchable: w = !1,
45
+ showSearchIcon: C,
46
+ theme: H,
47
+ wrapperClassName: P,
48
+ onBlur: j,
49
+ ...z
50
+ }, U) => {
51
+ const I = Q(), t = R(null), E = R(null), { wrapperRef: i, wrapperInputRef: O, handleOpen: k } = ae({
52
+ ulRef: E,
53
+ inputRef: t
54
+ }), { isOpen: m, searchTerm: W, value: l, toggleOpen: q, setValue: y, setSearchTerm: b } = ne(), d = c ? `${I}-${c}` : I;
55
+ S(U, () => t.current, [t]);
56
+ const r = X(() => n.find(({ value: e }) => e === l), [n, l]);
57
+ g(() => {
58
+ t.current && (t.current.value = l ? r?.value : "");
59
+ }, [r, l]), g(() => {
60
+ if (x && !l) {
61
+ const e = n && n.find((o) => o.value === x);
62
+ e && y(e.value);
40
63
  }
41
- }, [p, a, b, r]), N(() => {
64
+ }, [x, n, y, l]), g(() => {
42
65
  const e = new AbortController();
43
- return c.current?.addEventListener("focusout", (o) => {
44
- const d = o.relatedTarget;
45
- (!d || !c.current?.contains(d)) && (E(!1), w(""), n.current?.value || I?.());
66
+ return i.current?.addEventListener("focusout", (o) => {
67
+ const u = o.relatedTarget;
68
+ (!u || !i.current?.contains(u)) && (b(""), t.current?.value || j?.());
46
69
  }), () => {
47
70
  e.abort();
48
71
  };
49
- }, [E, c, w, I, r]);
50
- const S = (e) => {
72
+ }, [q, i, b, j, l]);
73
+ const G = (e) => {
51
74
  const o = e.target.value;
52
- w(o);
53
- const d = a.find(
54
- (U) => U.value.toLocaleLowerCase() === o.toLocaleLowerCase()
75
+ b(o);
76
+ const u = n.find(
77
+ (J) => J.value.toLocaleLowerCase() === o.toLocaleLowerCase()
55
78
  );
56
- d && b(d.value);
79
+ u && y(u.value);
57
80
  };
58
- return /* @__PURE__ */ m(
81
+ return /* @__PURE__ */ p(
59
82
  "div",
60
83
  {
61
- ref: c,
62
- className: s("flex flex-col w-full relative", $),
63
- "data-theme": M,
84
+ ref: i,
85
+ className: s("flex flex-col w-full relative", P),
86
+ "data-theme": H,
64
87
  children: [
65
- x ? /* @__PURE__ */ m(
88
+ v ? /* @__PURE__ */ p(
66
89
  "label",
67
90
  {
68
- id: i,
69
- className: s(X({ className: V })),
70
- htmlFor: i,
71
- onClick: H,
91
+ id: d,
92
+ className: s(B({ className: F })),
93
+ htmlFor: d,
94
+ onClick: k,
72
95
  children: [
73
- x,
74
- g ? /* @__PURE__ */ t("span", { className: "text-red-600 ml-1", children: "*" }) : null
96
+ v,
97
+ h && /* @__PURE__ */ a("span", { className: "text-red-600 ml-1", children: "*" })
75
98
  ]
76
99
  }
77
100
  ) : null,
78
- /* @__PURE__ */ m(
101
+ /* @__PURE__ */ p(
79
102
  "div",
80
103
  {
81
- ref: R,
82
- id: i,
83
- className: s(Y({ className: j, hasError: !!f })),
104
+ ref: O,
105
+ id: d,
106
+ className: s(te({ className: _, hasError: !!f })),
84
107
  role: "combobox",
85
- onClick: z,
86
- "aria-expanded": v,
108
+ onClick: k,
109
+ "aria-expanded": m,
87
110
  tabIndex: 0,
88
- "aria-labelledby": i,
111
+ "aria-labelledby": d,
89
112
  children: [
90
- /* @__PURE__ */ m("div", { className: "flex gap-3 items-center flex-1", children: [
91
- l?.leftIcon && /* @__PURE__ */ t("span", { className: "w-4 h-4 flex justify-center items-center", children: l.leftIcon }),
92
- y ? /* @__PURE__ */ t(
113
+ /* @__PURE__ */ p("div", { className: "flex gap-2.5 items-center flex-1", children: [
114
+ r?.leftIcon && !C && /* @__PURE__ */ a("span", { className: "w-4 h-4 flex justify-center items-center dark:text-slate-50", children: r.leftIcon }),
115
+ C && /* @__PURE__ */ a(ce, { className: "w-4 h-4 text-zinc-500 select-none dark:text-slate-300 dark:group-focus-within:text-slate-50 transition-colors duration-300" }),
116
+ w ? /* @__PURE__ */ a(
93
117
  "input",
94
118
  {
119
+ ref: t,
95
120
  type: "text",
96
- value: v ? P : l?.label || "",
97
- onChange: S,
98
- placeholder: h,
99
- className: s(
100
- "flex-1 bg-transparent border-none outline-none text-zinc-700 text-base",
101
- {
102
- "text-red-700 placeholder:text-red-700": !!f
103
- }
104
- ),
121
+ value: m ? W : r?.label || "",
122
+ name: c,
123
+ onChange: G,
124
+ placeholder: N,
125
+ className: s(ee({ className: D }), {
126
+ "text-red-700 placeholder:text-red-700": !!f
127
+ }),
105
128
  onClick: (e) => {
106
- e.stopPropagation(), z();
129
+ e.stopPropagation(), k();
107
130
  },
108
- "aria-label": x || h,
109
- "aria-labelledby": i
131
+ "aria-label": v || N,
132
+ "aria-labelledby": d,
133
+ required: h,
134
+ autoComplete: "off",
135
+ autoCapitalize: "words",
136
+ ...z
110
137
  }
111
- ) : /* @__PURE__ */ t(
112
- Q,
138
+ ) : /* @__PURE__ */ a(
139
+ Z,
113
140
  {
114
141
  variant: "body2",
115
- className: s("flex-1 text-zinc-700 text-base", {
116
- "text-red-700": !!f
117
- }),
118
- children: l?.label || h
142
+ className: s(
143
+ "flex-1 text-zinc-400 text-sm dark:text-slate-400",
144
+ {
145
+ "text-red-700": !!f,
146
+ "select-none": !r,
147
+ "text-slate-800 dark:text-slate-50": r
148
+ }
149
+ ),
150
+ children: r?.label || N
119
151
  }
120
152
  )
121
153
  ] }),
122
- C ? /* @__PURE__ */ t(K, { className: "w-4 h-4 text-zinc-500" }) : /* @__PURE__ */ t(
123
- B,
154
+ L ? /* @__PURE__ */ a(Y, { className: "w-4 h-4 text-zinc-500 select-none" }) : !C && /* @__PURE__ */ a(
155
+ oe,
124
156
  {
125
- "data-state": v ? "open" : "closed",
157
+ "data-state": m ? "open" : "closed",
126
158
  className: s(
127
- "w-4 h-4 text-zinc-500 transition-all duration-50 data-[state=open]:rotate-0 data-[state=closed]:rotate-180",
128
- k,
159
+ "w-4 h-4 text-zinc-500 transition-all duration-100 data-[state=open]:rotate-0 data-[state=closed]:rotate-180 select-none dark:group-focus-within:text-slate-50",
160
+ $,
129
161
  {
130
162
  "text-red-700": !!f
131
163
  }
@@ -135,29 +167,32 @@ const fe = W(
135
167
  ]
136
168
  }
137
169
  ),
138
- /* @__PURE__ */ t(
170
+ !w && /* @__PURE__ */ a(
139
171
  "input",
140
172
  {
141
- ref: n,
173
+ ref: t,
142
174
  type: "text",
143
- name: u,
175
+ name: c,
144
176
  className: "hidden",
145
177
  "aria-hidden": "true",
146
- required: g
178
+ required: h,
179
+ ...z
147
180
  }
148
181
  ),
149
- /* @__PURE__ */ t(
150
- _,
182
+ m && /* @__PURE__ */ a(
183
+ re,
151
184
  {
152
- ref: O,
153
- className: D,
154
- itemClassName: F,
155
- name: u,
156
- wrapperRef: c,
157
- wrapperInputRef: R,
158
- options: a,
159
- isLoading: !!C,
160
- searchable: y
185
+ ref: E,
186
+ additionalOptions: V,
187
+ className: M,
188
+ itemClassName: A,
189
+ name: c,
190
+ wrapperRef: i,
191
+ wrapperInputRef: O,
192
+ inputRef: t,
193
+ options: n,
194
+ isLoading: !!L,
195
+ searchable: w
161
196
  }
162
197
  )
163
198
  ]
@@ -166,5 +201,5 @@ const fe = W(
166
201
  }
167
202
  );
168
203
  export {
169
- fe as Wrapper
204
+ we as Wrapper
170
205
  };
@@ -1,18 +1,19 @@
1
1
  import { createContext as e } from "react";
2
- const o = e({
2
+ const t = e({
3
+ highlightSearchEnabled: !1,
3
4
  isOpen: !1,
4
- toggleOpen() {
5
- throw new Error("toggleOpen function must be overridden");
6
- },
5
+ searchTerm: "",
7
6
  value: void 0,
7
+ setSearchTerm() {
8
+ throw new Error("setSearchTerm function must be overridden");
9
+ },
8
10
  setValue() {
9
11
  throw new Error("setValue function must be overridden");
10
12
  },
11
- searchTerm: "",
12
- setSearchTerm() {
13
- throw new Error("setSearchTerm function must be overridden");
13
+ toggleOpen() {
14
+ throw new Error("toggleOpen function must be overridden");
14
15
  }
15
16
  });
16
17
  export {
17
- o as DropdownContext
18
+ t as DropdownContext
18
19
  };
@@ -1,29 +1,30 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { useState as u, useCallback as d } from "react";
3
- import { DropdownContext as f } from "./dropdown.context.js";
4
- import { useToggle as g } from "../../../hooks/useToggle.js";
5
- const w = ({ children: t, value: s, name: e, onChange: r, onBlur: o }) => {
6
- const [a, m] = g(!1), [n, p] = u(""), l = d(
7
- (c) => {
8
- r?.({ target: { value: c, name: e ?? "" } }), o?.();
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useRef as p, useState as d, useCallback as v } from "react";
3
+ import { DropdownContext as S } from "./dropdown.context.js";
4
+ import { useToggle as b } from "../../../hooks/useToggle.js";
5
+ const D = ({ children: s, value: n, name: e, highlightSearch: c = !1, onChange: r, onBlur: t }) => {
6
+ const l = p(c), [h, i] = b(!1), [m, g] = d(""), u = v(
7
+ (o, a) => {
8
+ a?.current && (a.current.value = o), r?.({ target: { value: o, name: e ?? "" } }), t?.();
9
9
  },
10
- [r, e, o]
10
+ [r, e, t]
11
11
  );
12
- return /* @__PURE__ */ i(
13
- f.Provider,
12
+ return /* @__PURE__ */ f(
13
+ S.Provider,
14
14
  {
15
15
  value: {
16
- value: s,
17
- isOpen: a,
18
- searchTerm: n,
19
- setSearchTerm: p,
20
- setValue: l,
21
- toggleOpen: m
16
+ highlightSearchEnabled: l.current,
17
+ isOpen: h,
18
+ searchTerm: m,
19
+ value: n,
20
+ setSearchTerm: g,
21
+ setValue: u,
22
+ toggleOpen: i
22
23
  },
23
- children: t
24
+ children: s
24
25
  }
25
26
  );
26
27
  };
27
28
  export {
28
- w as DropdownProvider
29
+ D as DropdownProvider
29
30
  };
@@ -1,59 +1,58 @@
1
- import { useRef as c, useEffect as d, useCallback as u } from "react";
1
+ import { useRef as c, useEffect as u, useCallback as f } from "react";
2
2
  import { useDropdownContext as g } from "../contexts/dropdown.hook.js";
3
- const b = ({ ulRef: a }) => {
4
- const o = c(null), t = c(null), { isOpen: i, toggleOpen: e } = g();
5
- d(() => {
6
- const n = new AbortController(), s = (l) => {
7
- l.key === "Escape" && e(!1);
8
- }, r = (l) => {
9
- o.current?.contains(l.target) || e(!1);
3
+ const w = ({ ulRef: l, inputRef: i }) => {
4
+ const o = c(null), t = c(null), { toggleOpen: n } = g();
5
+ u(() => {
6
+ const e = new AbortController(), s = (a) => {
7
+ a.key === "Escape" && n(!1);
8
+ }, r = (a) => {
9
+ o.current?.contains(a.target) || n(!1);
10
10
  };
11
11
  return document.addEventListener("keydown", s, {
12
- signal: n.signal
12
+ signal: e.signal
13
13
  }), document.addEventListener("mousedown", r, {
14
- signal: n.signal
14
+ signal: e.signal
15
15
  }), document.addEventListener(
16
16
  "visibilitychange",
17
17
  () => {
18
- document.hidden && e(!1);
18
+ document.hidden && n(!1);
19
19
  },
20
20
  {
21
- signal: n.signal
21
+ signal: e.signal
22
22
  }
23
23
  ), t.current?.addEventListener(
24
24
  "focus",
25
25
  () => {
26
- e(!0);
26
+ n(!0);
27
27
  },
28
- { signal: n.signal }
28
+ { signal: e.signal }
29
29
  ), () => {
30
- n.abort();
30
+ e.abort();
31
31
  };
32
- }, [e, o]), d(() => {
33
- const n = new AbortController();
32
+ }, [n, o]), u(() => {
33
+ const e = new AbortController();
34
34
  return t.current?.addEventListener(
35
35
  "keydown",
36
36
  (s) => {
37
37
  if (s.key === "ArrowDown") {
38
- const r = a.current?.querySelector("li");
38
+ const r = l.current?.querySelector("li");
39
39
  r && r.focus();
40
40
  }
41
41
  },
42
- { signal: n.signal }
42
+ { signal: e.signal }
43
43
  ), () => {
44
- n.abort();
44
+ e.abort();
45
45
  };
46
- }, [t, a]);
47
- const f = u(() => e(!0), [e]), p = u(() => {
48
- i || e(!1);
49
- }, [i, e]);
46
+ }, [t, l]);
47
+ const d = f(() => {
48
+ n(!0), requestAnimationFrame(() => i?.current?.focus());
49
+ }, [i, n]);
50
50
  return {
51
51
  wrapperRef: o,
52
52
  wrapperInputRef: t,
53
- handleOpen: f,
54
- handleOpenIfClosed: p
53
+ handleOpen: d
55
54
  };
56
55
  };
57
56
  export {
58
- b as useDropdown
57
+ w as useDropdown
59
58
  };
@@ -1,58 +1,62 @@
1
- import { useRef as b, useEffect as u } from "react";
2
- import { useDropdownContext as f } from "../contexts/dropdown.hook.js";
3
- const d = ({
1
+ import { useRef as g, useEffect as i } from "react";
2
+ import { useDropdownContext as d } from "../contexts/dropdown.hook.js";
3
+ const w = ({
4
+ inputRef: s,
5
+ searchable: l,
4
6
  ulRef: t,
5
- wrapperRef: i,
6
- wrapperInputRef: o
7
+ wrapperInputRef: u,
8
+ wrapperRef: a
7
9
  }) => {
8
- const r = b(0), { isOpen: l } = f();
9
- u(() => {
10
- const e = t.current?.querySelectorAll("li") ?? [], c = new AbortController(), n = () => {
10
+ const r = g(0), { isOpen: f } = d();
11
+ i(() => {
12
+ const c = t.current?.querySelectorAll("li") ?? [], e = Array.from(c).filter(
13
+ (n) => n.getAttribute("data-action") !== "true"
14
+ ), o = new AbortController(), m = () => {
11
15
  r.current < e.length - 1 ? (r.current = r.current + 1, e[r.current].focus()) : (r.current = 0, e[0].focus());
12
- }, a = () => {
13
- r.current > 0 ? (r.current = r.current - 1, e[r.current].focus()) : (r.current = 0, o.current?.focus());
16
+ }, b = () => {
17
+ r.current > 0 ? (r.current = r.current - 1, e[r.current].focus()) : (r.current = 0, s?.current && l ? s.current.focus() : u.current?.focus());
14
18
  };
15
19
  return t.current?.addEventListener(
16
20
  "keydown",
17
- (s) => {
18
- switch (s.preventDefault(), s.key) {
21
+ (n) => {
22
+ switch (n.preventDefault(), n.key) {
19
23
  case "ArrowDown": {
20
- n();
24
+ m();
21
25
  break;
22
26
  }
23
27
  case "Tab": {
24
- s.shiftKey ? a() : n();
28
+ n.shiftKey ? b() : m();
25
29
  break;
26
30
  }
27
31
  case "ArrowUp": {
28
- r.current === 0 ? o.current?.focus() : a();
32
+ r.current === 0 ? u.current?.focus() : b();
29
33
  break;
30
34
  }
31
35
  case "Enter": {
32
- e[r.current].querySelector("button")?.click();
36
+ e[r.current]?.click();
33
37
  break;
34
38
  }
35
39
  }
36
40
  },
37
- { signal: c.signal }
41
+ { signal: o.signal }
38
42
  ), () => {
39
- c.abort();
43
+ o.abort();
40
44
  };
41
- }, [t, r, o]), u(() => {
42
- const e = new AbortController();
43
- return i.current?.addEventListener(
45
+ }, [t, r, u, s, l]), i(() => {
46
+ const c = new AbortController();
47
+ return a.current?.addEventListener(
44
48
  "mouseenter",
45
49
  () => {
46
- (t.current?.querySelectorAll("li") ?? []).forEach((n) => n.blur());
50
+ (t.current?.querySelectorAll("li") ?? []).forEach((o) => o.blur());
47
51
  },
48
- { signal: e.signal }
52
+ { signal: c.signal }
49
53
  ), () => {
50
- e.abort();
54
+ c.abort();
51
55
  };
52
- }, [t, i]), u(() => {
53
- l || (r.current = 0);
54
- }, [l]);
56
+ }, [t, a]), i(() => {
57
+ f || (r.current = 0);
58
+ }, [f]);
55
59
  };
56
60
  export {
57
- d as useNavigationUlList
61
+ w as useNavigationUlList
58
62
  };
@@ -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-N2OStZoU.js";
6
6
  function m() {
7
7
  return m = Object.assign || function(e) {
8
8
  for (var i = 1; i < arguments.length; i++) {
@@ -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-MZvQoT2F.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-MZvQoT2F.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-N2OStZoU.js";
8
8
  function h() {
9
9
  return h = Object.assign || function(t) {
10
10
  for (var n = 1; n < arguments.length; n++) {
@@ -1,9 +1,9 @@
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";
4
+ import { c as t } from "../../createLucideIcon-D2CN7Ma9.js";
5
5
  /**
6
- * @license lucide-react v0.544.0 - ISC
6
+ * @license lucide-react v0.545.0 - ISC
7
7
  *
8
8
  * This source code is licensed under the ISC license.
9
9
  * See the LICENSE file in the root directory of this source tree.
@@ -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 "../../index-BITvcJAz.js";
4
+ import { M as d } from "../../Modal-D-NOEWMX.js";
5
5
  import "./components/Header/Header.js";
6
6
  import "./components/Body/Body.js";
7
7
  import "./components/Footer/Footer.js";
@@ -1,11 +1,11 @@
1
1
  import "react/jsx-runtime";
2
- import "../../../../index-iXyXtdgP.js";
2
+ import "../../../../index-DBbEcSUG.js";
3
3
  import "react";
4
4
  import "../../../../Combination-VYaRRJBZ.js";
5
- import { W as f } from "../../../../Modal-V67Uz78z.js";
5
+ import { W as f } from "../../../../Modal-D-NOEWMX.js";
6
6
  import "../../../../utils/index.js";
7
7
  import "./Wrapper.variants.js";
8
- import "../../../../x-BPcqkRZd.js";
8
+ import "../../../../x-4F_5p77m.js";
9
9
  export {
10
10
  f as Wrapper
11
11
  };