@konstructio/ui 0.1.2-alpha.2 → 0.1.2-alpha.20

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