@mci-ui/mci-ui 0.0.87 → 0.0.89

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 (33) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared/ui/MciModal/MciModal.js +30 -28
  3. package/dist/shared/ui/mciAccordion/MciAccordion.js +97 -64
  4. package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +45 -25
  5. package/dist/shared/ui/mciButton/MciButton.js +39 -31
  6. package/dist/shared/ui/mciCheck/MciCheck.js +86 -76
  7. package/dist/shared/ui/mciDrawer/MciDrawer.js +78 -54
  8. package/dist/shared/ui/mciInput/MciInput.js +39 -40
  9. package/dist/shared/ui/mciLoader/MciLoader.js +14 -14
  10. package/dist/shared/ui/mciPagination/MciPagination.js +28 -18
  11. package/dist/shared/ui/mciPicker/MciPicker.js +53 -53
  12. package/dist/shared/ui/mciSelect/MciSelect.js +42 -41
  13. package/dist/shared/ui/mciTable/MciTable.js +97 -90
  14. package/dist/shared/ui/mciTable/MciTableClamp2.js +4 -3
  15. package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +100 -79
  16. package/dist/shared/ui/mciTabs/MciTabs.js +66 -55
  17. package/dist/shared/ui/mciToggle/MciToggle.js +51 -43
  18. package/dist/shared/ui/mciUpload/MciUpload.js +129 -107
  19. package/dist/types/shared/types/mci-table.types.d.ts +2 -0
  20. package/dist/types/shared/types/ui/accordion.types.d.ts +1 -0
  21. package/dist/types/shared/types/ui/breadcrumb.types.d.ts +1 -1
  22. package/dist/types/shared/types/ui/button.types.d.ts +1 -1
  23. package/dist/types/shared/types/ui/check.types.d.ts +1 -1
  24. package/dist/types/shared/types/ui/drawer.types.d.ts +2 -0
  25. package/dist/types/shared/types/ui/loader.types.d.ts +1 -1
  26. package/dist/types/shared/types/ui/pagination.types.d.ts +1 -1
  27. package/dist/types/shared/types/ui/toggle.types.d.ts +1 -1
  28. package/dist/types/shared/types/ui/upload.types.d.ts +1 -1
  29. package/dist/types/shared/ui/mciAccordion/MciAccordion.d.ts +5 -3
  30. package/dist/types/shared/ui/mciDrawer/MciDrawer.d.ts +1 -1
  31. package/dist/types/shared/ui/mciTable/MciTable.d.ts +1 -1
  32. package/dist/types/shared/ui/mciTable/MciTableColumnsPanel.d.ts +3 -2
  33. package/package.json +1 -1
@@ -1,65 +1,70 @@
1
1
  import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
- import { ConfoundedSquare as I, SortVertical as W, SortFromTopToBottom as _, SortFromBottomToTop as H } from "@solar-icons/react";
3
- import { useState as J, useMemo as x, useEffect as K, useCallback as O } from "react";
2
+ import { ConfoundedSquare as _, SortVertical as H, SortFromTopToBottom as J, SortFromBottomToTop as K } from "@solar-icons/react";
3
+ import { useState as O, useMemo as v, useEffect as Q, useCallback as U } from "react";
4
4
  import { cn as a } from "../../lib/utils.js";
5
5
  /* empty css */
6
6
  import z from "../mciCheck/MciCheck.js";
7
- import A from "../mciSkeleton/MciSkeleton.js";
8
- import Q from "./MciTableClamp2.js";
9
- import { sortRows as U, normalizeColWidth as X } from "./mci-table.utils.js";
10
- function re({
11
- columns: b,
12
- data: v = [],
13
- loading: p = !1,
14
- skeletonRows: B = 5,
15
- noDataText: D = "",
7
+ import B from "../mciSkeleton/MciSkeleton.js";
8
+ import X from "./MciTableClamp2.js";
9
+ import { sortRows as Y, normalizeColWidth as Z } from "./mci-table.utils.js";
10
+ const w = (o) => {
11
+ const b = String(o.key).toLowerCase(), d = o.title.toLowerCase();
12
+ return b === "action" || b === "actions" || b.includes("action") || d === "action" || d === "actions" || d.includes("action");
13
+ };
14
+ function ae({
15
+ columns: o,
16
+ data: b = [],
17
+ loading: d = !1,
18
+ skeletonRows: D = 5,
19
+ noDataText: P = "",
16
20
  sort: n,
17
21
  onSortChange: N,
18
- className: L,
19
- headerClassName: w,
20
- bodyClassName: C,
21
- darkMode: r = !1,
22
- rowKey: u = "id",
23
- rowSelection: s
22
+ className: F,
23
+ headerClassName: C,
24
+ bodyClassName: R,
25
+ darkMode: i = !1,
26
+ variant: j = "orange",
27
+ rowKey: p = "id",
28
+ rowSelection: l
24
29
  }) {
25
- const [P, R] = J(null), d = n ?? P, g = x(() => Array.isArray(v) ? v : [], [v]), j = x(() => U(g, d, !!n), [g, d, n]);
26
- K(() => {
27
- n !== void 0 && R(null);
30
+ const [V, A] = O(null), h = n ?? V, x = v(() => Array.isArray(b) ? b : [], [b]), L = v(() => Y(x, h, !!n), [x, h, n]);
31
+ Q(() => {
32
+ n !== void 0 && A(null);
28
33
  }, [n]);
29
- const m = x(
30
- () => p ? [] : n ? g : j,
31
- [p, n, g, j]
32
- ), F = O(
34
+ const f = v(
35
+ () => d ? [] : n ? x : L,
36
+ [d, n, x, L]
37
+ ), q = U(
33
38
  (e) => {
34
39
  if (!e.sortable) return;
35
- let l = null;
36
- d?.key !== e.key ? l = { key: e.key, direction: "asc" } : d.direction === "asc" && (l = { key: e.key, direction: "desc" }), n !== void 0 ? N?.(l) : R(l);
40
+ let s = null;
41
+ h?.key !== e.key ? s = { key: e.key, direction: "asc" } : h.direction === "asc" && (s = { key: e.key, direction: "desc" }), n !== void 0 ? N?.(s) : A(s);
37
42
  },
38
- [d, n, N]
39
- ), V = (e) => {
40
- if (!s) return;
41
- const { onChange: l, getCheckboxProps: o } = s;
43
+ [h, n, N]
44
+ ), E = (e) => {
45
+ if (!l) return;
46
+ const { onChange: s, getCheckboxProps: m } = l;
42
47
  if (e.target.checked) {
43
- const i = m.filter((h) => !o?.(h)?.disabled).map((h) => h[u]);
44
- l(i);
48
+ const r = f.filter((u) => !m?.(u)?.disabled).map((u) => u[p]);
49
+ s(r);
45
50
  } else
46
- l([]);
47
- }, q = (e, l) => {
48
- if (!s) return;
49
- const { selectedRowKeys: o, onChange: y } = s, f = e[u], i = l ? [...o, f] : o.filter((h) => h !== f);
50
- y(i);
51
- }, E = x(() => {
52
- if (!s || m.length === 0) return !1;
53
- const e = m.filter((l) => !s.getCheckboxProps?.(l)?.disabled);
51
+ s([]);
52
+ }, G = (e, s) => {
53
+ if (!l) return;
54
+ const { selectedRowKeys: m, onChange: y } = l, g = e[p], r = s ? [...m, g] : m.filter((u) => u !== g);
55
+ y(r);
56
+ }, I = v(() => {
57
+ if (!l || f.length === 0) return !1;
58
+ const e = f.filter((s) => !l.getCheckboxProps?.(s)?.disabled);
54
59
  return e.length === 0 ? !1 : e.every(
55
- (l) => s.selectedRowKeys.includes(l[u])
60
+ (s) => l.selectedRowKeys.includes(s[p])
56
61
  );
57
- }, [s, m, u]), G = (e) => {
58
- const l = a(r ? "text-neutral-100" : "text-slate-base", "shrink-0");
59
- return e.sortable ? !d || d.key !== e.key ? /* @__PURE__ */ t(W, { weight: "Linear", size: 20, className: l }) : d.direction === "asc" ? /* @__PURE__ */ t(_, { weight: "Linear", size: 20, className: l }) : /* @__PURE__ */ t(H, { weight: "Linear", size: 20, className: l }) : null;
62
+ }, [l, f, p]), W = (e) => {
63
+ const s = a(i ? "text-neutral-100" : "text-slate-base", "shrink-0");
64
+ return e.sortable ? !h || h.key !== e.key ? /* @__PURE__ */ t(H, { weight: "Linear", size: 20, className: s }) : h.direction === "asc" ? /* @__PURE__ */ t(J, { weight: "Linear", size: 20, className: s }) : /* @__PURE__ */ t(K, { weight: "Linear", size: 20, className: s }) : null;
60
65
  }, T = () => /* @__PURE__ */ c("colgroup", { children: [
61
- s && /* @__PURE__ */ t("col", { style: { width: 48 } }),
62
- b.map((e) => /* @__PURE__ */ t("col", { style: { width: X(e.width) ?? "auto" } }, e.key))
66
+ l && /* @__PURE__ */ t("col", { style: { width: 48 } }),
67
+ o.map((e) => /* @__PURE__ */ t("col", { style: { width: Z(e.width) ?? (w(e) ? "1%" : "auto") } }, e.key))
63
68
  ] });
64
69
  return /* @__PURE__ */ t(
65
70
  "div",
@@ -68,10 +73,10 @@ function re({
68
73
  "w-full overflow-x-auto pb-0.5",
69
74
  "[&::-webkit-scrollbar]:h-1",
70
75
  "[&::-webkit-scrollbar-track]:bg-transparent",
71
- r ? "[&::-webkit-scrollbar-thumb]:bg-neutral-200" : "[&::-webkit-scrollbar-thumb]:bg-slate-200",
76
+ i ? "[&::-webkit-scrollbar-thumb]:bg-neutral-200" : "[&::-webkit-scrollbar-thumb]:bg-slate-200",
72
77
  "[&::-webkit-scrollbar-thumb]:rounded-full",
73
- r ? "hover:[&::-webkit-scrollbar-thumb]:bg-neutral-100" : "hover:[&::-webkit-scrollbar-thumb]:bg-slate-300",
74
- L
78
+ i ? "hover:[&::-webkit-scrollbar-thumb]:bg-neutral-100" : "hover:[&::-webkit-scrollbar-thumb]:bg-slate-300",
79
+ F
75
80
  ),
76
81
  children: /* @__PURE__ */ c("div", { className: "inline-block min-w-full align-middle", children: [
77
82
  /* @__PURE__ */ t(
@@ -79,33 +84,34 @@ function re({
79
84
  {
80
85
  className: a(
81
86
  "overflow-hidden rounded-xl border",
82
- r ? "border-neutral-200 bg-neutral-300" : "border-slate-200 bg-slate-100"
87
+ i ? "border-neutral-200 bg-neutral-300" : "border-slate-200 bg-slate-100"
83
88
  ),
84
89
  children: /* @__PURE__ */ c("table", { className: "w-full table-fixed", children: [
85
90
  T(),
86
91
  /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ c("tr", { children: [
87
- s && /* @__PURE__ */ t("th", { className: a("w-12 px-4 py-3", w), children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ t(
92
+ l && /* @__PURE__ */ t("th", { className: a("w-12 px-4 py-3", C), children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ t(
88
93
  z,
89
94
  {
90
- checked: E,
91
- onChange: V,
92
- variant: "yellow",
93
- darkMode: r,
94
- disabled: p || m.length === 0
95
+ checked: I,
96
+ onChange: E,
97
+ variant: j,
98
+ darkMode: i,
99
+ disabled: d || f.length === 0
95
100
  }
96
101
  ) }) }),
97
- b.map((e) => /* @__PURE__ */ t(
102
+ o.map((e) => /* @__PURE__ */ t(
98
103
  "th",
99
104
  {
100
- onClick: () => F(e),
105
+ onClick: () => q(e),
101
106
  className: a(
102
107
  "px-4 py-3 text-left text-sm font-medium transition-colors",
103
- r ? "text-neutral-50" : "text-slate-700",
108
+ i ? "text-neutral-50" : "text-slate-700",
104
109
  "whitespace-nowrap overflow-hidden text-ellipsis",
110
+ w(e) && "w-px",
105
111
  e.align === "center" && "text-center",
106
112
  e.align === "right" && "text-right",
107
- e.sortable && (r ? "cursor-pointer hover:bg-neutral-200" : "cursor-pointer hover:bg-slate-200"),
108
- w
113
+ e.sortable && (i ? "cursor-pointer hover:bg-neutral-200" : "cursor-pointer hover:bg-slate-200"),
114
+ C
109
115
  ),
110
116
  children: /* @__PURE__ */ c(
111
117
  "div",
@@ -113,7 +119,7 @@ function re({
113
119
  className: a("flex items-center gap-2 min-w-0", e.align === "right" && "justify-end"),
114
120
  children: [
115
121
  /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", title: e.title, children: e.title }),
116
- G(e)
122
+ W(e)
117
123
  ]
118
124
  }
119
125
  )
@@ -129,56 +135,57 @@ function re({
129
135
  {
130
136
  className: a(
131
137
  "overflow-hidden rounded-xl border border-t-0",
132
- r ? "border-neutral-200 bg-transparent" : "border-slate-200 bg-white"
138
+ i ? "border-neutral-200 bg-transparent" : "border-slate-200 bg-white"
133
139
  ),
134
140
  children: /* @__PURE__ */ c("table", { className: "w-full table-fixed", children: [
135
141
  T(),
136
- /* @__PURE__ */ t("tbody", { className: a("divide-y", r ? "divide-neutral-200" : "divide-slate-200"), children: p ? Array.from({ length: B }).map((e, l) => /* @__PURE__ */ c("tr", { children: [
137
- s && /* @__PURE__ */ t("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ t(A, { height: 20, width: 20, variant: "rounded" }) }),
138
- b.map((o) => /* @__PURE__ */ t("td", { className: "px-4 py-3", children: /* @__PURE__ */ t(A, { height: 30, variant: "rounded" }) }, o.key))
139
- ] }, l)) : m.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: b.length + (s ? 1 : 0), className: "py-20", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center", children: [
142
+ /* @__PURE__ */ t("tbody", { className: a("divide-y", i ? "divide-neutral-200" : "divide-slate-200"), children: d ? Array.from({ length: D }).map((e, s) => /* @__PURE__ */ c("tr", { children: [
143
+ l && /* @__PURE__ */ t("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ t(B, { height: 20, width: 20, variant: "rounded" }) }),
144
+ o.map((m) => /* @__PURE__ */ t("td", { className: "px-4 py-3", children: /* @__PURE__ */ t(B, { height: 30, variant: "rounded" }) }, m.key))
145
+ ] }, s)) : f.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: o.length + (l ? 1 : 0), className: "py-20", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center", children: [
140
146
  /* @__PURE__ */ t("div", { className: "relative mb-4", children: /* @__PURE__ */ t(
141
- I,
147
+ _,
142
148
  {
143
149
  weight: "Bold",
144
150
  size: 64,
145
- className: a("animate-float", r ? "text-neutral-100" : "text-slate-400")
151
+ className: a("animate-float", i ? "text-neutral-100" : "text-slate-400")
146
152
  }
147
153
  ) }),
148
- /* @__PURE__ */ t("p", { className: a("text-sm font-medium", r ? "text-neutral-100" : "text-slate-400"), children: D })
149
- ] }) }) }) : m.map((e, l) => {
150
- const o = e[u], y = s?.selectedRowKeys.includes(o), f = s?.getCheckboxProps?.(e)?.disabled;
151
- return /* @__PURE__ */ c("tr", { className: a("group transition-colors", r ? "hover:bg-neutral-100/35" : "hover:bg-slate-50"), children: [
152
- s && /* @__PURE__ */ t("td", { className: a("w-12 px-4 py-3 align-top", C), children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center pt-1", children: /* @__PURE__ */ t(
154
+ /* @__PURE__ */ t("p", { className: a("text-sm font-medium", i ? "text-neutral-100" : "text-slate-400"), children: P })
155
+ ] }) }) }) : f.map((e, s) => {
156
+ const m = e[p], y = l?.selectedRowKeys.includes(m), g = l?.getCheckboxProps?.(e)?.disabled;
157
+ return /* @__PURE__ */ c("tr", { className: a("group transition-colors", i ? "hover:bg-neutral-100/35" : "hover:bg-slate-50"), children: [
158
+ l && /* @__PURE__ */ t("td", { className: a("w-12 px-4 py-3 align-top", R), children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center pt-1", children: /* @__PURE__ */ t(
153
159
  z,
154
160
  {
155
161
  checked: y,
156
- disabled: f,
157
- variant: "yellow",
158
- darkMode: r,
159
- onChange: (i) => q(e, i.target.checked)
162
+ disabled: g,
163
+ variant: j,
164
+ darkMode: i,
165
+ onChange: (r) => G(e, r.target.checked)
160
166
  }
161
167
  ) }) }),
162
- b.map((i) => {
163
- const h = e[i.key], k = i.render ? i.render(h, e) : String(h ?? "-");
168
+ o.map((r) => {
169
+ const u = e[r.key], k = r.render ? r.render(u, e) : String(u ?? "-");
164
170
  return /* @__PURE__ */ t(
165
171
  "td",
166
172
  {
167
173
  className: a(
168
- "align-top px-4 py-3 text-sm font-normal",
169
- r ? "text-neutral-50" : "text-black",
174
+ "align-top px-4 py-3 text-sm font-normal overflow-visible",
175
+ i ? "text-neutral-50" : "text-black",
170
176
  "min-w-0 whitespace-normal",
171
- i.align === "center" && "text-center",
172
- i.align === "right" && "text-right",
173
- C,
174
- i.className
177
+ w(r) && "w-px whitespace-nowrap",
178
+ r.align === "center" && "text-center",
179
+ r.align === "right" && "text-right",
180
+ R,
181
+ r.className
175
182
  ),
176
- children: /* @__PURE__ */ t(Q, { title: typeof k == "string" ? k : void 0, children: k })
183
+ children: /* @__PURE__ */ t(X, { title: typeof k == "string" ? k : void 0, children: k })
177
184
  },
178
- i.key
185
+ r.key
179
186
  );
180
187
  })
181
- ] }, l);
188
+ ] }, s);
182
189
  }) })
183
190
  ] })
184
191
  }
@@ -188,5 +195,5 @@ function re({
188
195
  );
189
196
  }
190
197
  export {
191
- re as default
198
+ ae as default
192
199
  };
@@ -1,7 +1,8 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- function l({ children: t, title: a }) {
3
- return /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("div", { className: "clamp-2 break-words", title: a ?? (typeof t == "string" ? t : void 0), children: t }) });
2
+ function o({ children: t, title: i }) {
3
+ const a = typeof t == "string" ? t : void 0;
4
+ return typeof t != "string" && typeof t != "number" ? /* @__PURE__ */ e("div", { className: "-m-1 inline-flex w-fit max-w-full items-start overflow-visible p-1 align-top", children: t }) : /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("div", { className: "clamp-2 break-words", title: i ?? a, children: t }) });
4
5
  }
5
6
  export {
6
- l as default
7
+ o as default
7
8
  };
@@ -1,122 +1,142 @@
1
- import { jsxs as g, jsx as l } from "react/jsx-runtime";
2
- import { useRef as K, useEffect as _, useMemo as F, useState as p, useCallback as d } from "react";
3
- import { TransferVertical as q } from "@solar-icons/react";
4
- import { useClickOutside as H, cn as s } from "../../lib/utils.js";
1
+ import { jsxs as g, jsx as s } from "react/jsx-runtime";
2
+ import { useRef as K, useEffect as q, useMemo as Y, useState as p, useCallback as h } from "react";
3
+ import { TransferVertical as J } from "@solar-icons/react";
4
+ import { useClickOutside as U, cn as l } from "../../lib/utils.js";
5
5
  /* empty css */
6
- import J from "../mciCheck/MciCheck.js";
7
- const U = {
6
+ import V from "../mciCheck/MciCheck.js";
7
+ const W = {
8
8
  ru: {
9
9
  title: "Настройки",
10
10
  close: "Закрыть",
11
11
  activeColumns: "Активные колонки",
12
- minColumns: (c) => `Минимум ${c} колонок`,
12
+ minColumns: (u) => `Минимум ${u} колонок`,
13
13
  drag: "Перетащить"
14
14
  },
15
15
  uz: {
16
16
  title: "Sozlamalar",
17
17
  close: "Yopish",
18
18
  activeColumns: "Aktiv ustunlar",
19
- minColumns: (c) => `Kamida ${c} ta ustun`,
19
+ minColumns: (u) => `Kamida ${u} ta ustun`,
20
20
  drag: "Sudrash"
21
21
  }
22
+ }, X = {
23
+ blue: {
24
+ dropIndicator: "bg-blue-300",
25
+ darkDropIndicator: "bg-blue-500",
26
+ close: "hover:bg-blue-50 hover:text-blue-600 focus-visible:ring-2 focus-visible:ring-[rgba(21,93,252,0.25)]",
27
+ darkClose: "hover:bg-blue-500/20 hover:text-blue-400 focus-visible:ring-2 focus-visible:ring-[rgba(21,93,252,0.25)]"
28
+ },
29
+ yellow: {
30
+ dropIndicator: "bg-yellow-400",
31
+ darkDropIndicator: "bg-yellow-500",
32
+ close: "hover:bg-yellow-50 hover:text-yellow-600 focus-visible:ring-2 focus-visible:ring-yellow-200",
33
+ darkClose: "hover:bg-yellow-500/20 hover:text-yellow-300 focus-visible:ring-2 focus-visible:ring-yellow-300/40"
34
+ },
35
+ orange: {
36
+ dropIndicator: "bg-orange-400",
37
+ darkDropIndicator: "bg-orange-600",
38
+ close: "hover:bg-orange-50 hover:text-orange-600 focus-visible:ring-2 focus-visible:ring-[rgba(227,98,12,0.25)]",
39
+ darkClose: "hover:bg-orange-600/20 hover:text-orange-400 focus-visible:ring-2 focus-visible:ring-[rgba(227,98,12,0.25)]"
40
+ }
22
41
  };
23
- function te({
24
- open: c,
25
- onClose: C,
42
+ function ae({
43
+ open: u,
44
+ onClose: N,
26
45
  columns: i,
27
- hidden: y,
28
- onToggle: T,
29
- onMove: k,
46
+ hidden: k,
47
+ onToggle: I,
48
+ onMove: T,
30
49
  onMoveByKey: x,
31
50
  minVisible: S = 5,
32
- locale: Q = "ru",
33
- darkMode: r = !1
51
+ locale: _ = "ru",
52
+ darkMode: r = !1,
53
+ variant: E = "orange"
34
54
  }) {
35
- const I = K(null), { handleClick: v } = H(I, C), m = U[Q];
36
- _(() => {
37
- if (c)
38
- return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
39
- }, [c, v]);
40
- const w = F(() => new Set(y), [y]), O = F(() => {
55
+ const L = K(null), { handleClick: w } = U(L, N), f = W[_], v = X[E];
56
+ q(() => {
57
+ if (u)
58
+ return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
59
+ }, [u, w]);
60
+ const D = Y(() => new Set(k), [k]), O = Y(() => {
41
61
  let e = 0;
42
- for (const t of i) w.has(t.key) || e++;
62
+ for (const t of i) D.has(t.key) || e++;
43
63
  return e;
44
- }, [i, w]), [A, E] = p(null), [L, N] = p(null), [Y, z] = p(null), [f, D] = p("before"), P = d(
64
+ }, [i, D]), [y, P] = p(null), [z, A] = p(null), [$, R] = p(null), [m, C] = p("before"), j = h(
45
65
  (e, t, a) => {
46
66
  let n = a === "after" ? t + 1 : t;
47
67
  return e < n && (n -= 1), n;
48
68
  },
49
69
  []
50
- ), h = d(() => {
51
- E(null), z(null), N(null), D("before");
52
- }, []), $ = d(
70
+ ), d = h(() => {
71
+ P(null), R(null), A(null), C("before");
72
+ }, []), B = h(
53
73
  (e, t, a) => {
54
- E(t), z(String(a)), N(null), D("before"), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", String(t));
74
+ P(t), R(String(a)), A(null), C("before"), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", String(t));
55
75
  const n = new Image();
56
76
  n.src = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", e.dataTransfer.setDragImage(n, 0, 0);
57
77
  },
58
78
  []
59
- ), B = d(
79
+ ), G = h(
60
80
  (e, t) => {
61
81
  e.preventDefault();
62
- const a = A ?? Number.parseInt(e.dataTransfer.getData("text/plain") || "-1", 10);
82
+ const a = y ?? Number.parseInt(e.dataTransfer.getData("text/plain") || "-1", 10);
63
83
  if (!Number.isFinite(a) || a < 0) {
64
- h();
84
+ d();
65
85
  return;
66
86
  }
67
87
  const n = i[a], b = i[t];
68
88
  if (!n || !b) {
69
- h();
89
+ d();
70
90
  return;
71
91
  }
72
- const o = P(a, t, f);
73
- o !== a && (x ? x(n.key, b.key, f) : k(a, o)), h();
92
+ const o = j(a, t, m);
93
+ o !== a && (x ? x(n.key, b.key, m) : T(a, o)), d();
74
94
  },
75
- [i, P, A, f, k, x, h]
76
- ), G = d(
95
+ [i, j, y, m, T, x, d]
96
+ ), H = h(
77
97
  (e, t) => {
78
- t || T(e);
98
+ t || I(e);
79
99
  },
80
- [T]
100
+ [I]
81
101
  );
82
- return c ? /* @__PURE__ */ g(
102
+ return u ? /* @__PURE__ */ g(
83
103
  "div",
84
104
  {
85
- ref: I,
86
- className: s(
105
+ ref: L,
106
+ className: l(
87
107
  "absolute right-0 top-full z-50 mt-2 w-[320px]",
88
108
  "rounded-2xl p-4",
89
109
  r ? "border border-neutral-200 bg-[#22242A] shadow-xl" : "border border-slate-200 bg-white"
90
110
  ),
91
111
  children: [
92
112
  /* @__PURE__ */ g("div", { className: "flex items-center justify-between gap-4", children: [
93
- /* @__PURE__ */ l("h4", { className: s("text-large font-normal", r ? "text-neutral-50" : "text-slate-600"), children: m.title }),
94
- /* @__PURE__ */ l(
113
+ /* @__PURE__ */ s("h4", { className: l("text-large font-normal", r ? "text-neutral-50" : "text-slate-600"), children: f.title }),
114
+ /* @__PURE__ */ s(
95
115
  "button",
96
116
  {
97
117
  type: "button",
98
- onClick: C,
99
- className: s(
100
- "rounded-lg px-2 py-1",
101
- r ? "text-neutral-100 hover:bg-neutral-300" : "text-slate-500 hover:bg-slate-100"
118
+ onClick: N,
119
+ className: l(
120
+ "cursor-pointer rounded-lg px-2 py-1",
121
+ r ? l("text-neutral-100 hover:bg-neutral-300", v.darkClose) : l("text-slate-500 hover:bg-slate-100", v.close)
102
122
  ),
103
- "aria-label": m.close,
123
+ "aria-label": f.close,
104
124
  children: "✕"
105
125
  }
106
126
  )
107
127
  ] }),
108
- /* @__PURE__ */ l("div", { className: s("my-4 h-px", r ? "bg-neutral-200" : "bg-slate-100") }),
109
- /* @__PURE__ */ g("p", { className: s("mb-3 text-xs", r ? "text-neutral-100" : "text-slate-500"), children: [
110
- m.activeColumns,
128
+ /* @__PURE__ */ s("div", { className: l("my-4 h-px", r ? "bg-neutral-200" : "bg-slate-100") }),
129
+ /* @__PURE__ */ g("p", { className: l("mb-3 text-xs", r ? "text-neutral-100" : "text-slate-500"), children: [
130
+ f.activeColumns,
111
131
  ": ",
112
132
  O,
113
133
  "/",
114
134
  i.length
115
135
  ] }),
116
- /* @__PURE__ */ l(
136
+ /* @__PURE__ */ s(
117
137
  "div",
118
138
  {
119
- className: s(
139
+ className: l(
120
140
  "max-h-[275px] overflow-auto",
121
141
  "[&::-webkit-scrollbar]:w-1.5",
122
142
  "[&::-webkit-scrollbar-track]:bg-transparent",
@@ -125,15 +145,15 @@ function te({
125
145
  r ? "hover:[&::-webkit-scrollbar-thumb]:bg-neutral-100" : "hover:[&::-webkit-scrollbar-thumb]:bg-slate-300"
126
146
  ),
127
147
  children: i.map((e, t) => {
128
- const a = !w.has(e.key), n = a && O <= S, b = L === t, o = Y === e.key;
148
+ const a = !D.has(e.key), n = a && O <= S, b = z === t, o = $ === e.key;
129
149
  return /* @__PURE__ */ g("div", { className: "relative", children: [
130
- b && !o && /* @__PURE__ */ l(
150
+ b && !o && /* @__PURE__ */ s(
131
151
  "div",
132
152
  {
133
- className: s(
153
+ className: l(
134
154
  "pointer-events-none absolute left-2 right-2 z-10 h-0.5 rounded-full",
135
- r ? "bg-blue-500" : "bg-blue-300",
136
- f === "before" ? "top-0" : "bottom-0"
155
+ r ? v.darkDropIndicator : v.dropIndicator,
156
+ m === "before" ? "top-0" : "bottom-0"
137
157
  )
138
158
  }
139
159
  ),
@@ -141,57 +161,58 @@ function te({
141
161
  "div",
142
162
  {
143
163
  draggable: !0,
144
- onDragStart: (u) => $(u, t, e.key),
145
- onDragOver: (u) => {
146
- if (A == null) return;
147
- u.preventDefault(), u.dataTransfer.dropEffect = "move";
148
- const R = u.currentTarget.getBoundingClientRect(), j = u.clientY - R.top > R.height / 2 ? "after" : "before";
149
- L !== t && N(t), f !== j && D(j);
164
+ onDragStart: (c) => B(c, t, e.key),
165
+ onDragOver: (c) => {
166
+ if (y == null) return;
167
+ c.preventDefault(), c.dataTransfer.dropEffect = "move";
168
+ const F = c.currentTarget.getBoundingClientRect(), Q = c.clientY - F.top > F.height / 2 ? "after" : "before";
169
+ z !== t && A(t), m !== Q && C(Q);
150
170
  },
151
- onDrop: (u) => B(u, t),
152
- onDragEnd: h,
153
- className: s(
171
+ onDrop: (c) => G(c, t),
172
+ onDragEnd: d,
173
+ className: l(
154
174
  "group flex items-center py-2 px-1 gap-4",
155
175
  "rounded-md box-border overflow-visible",
156
176
  "transition-[background,transform] duration-150",
177
+ !o && "cursor-grab",
157
178
  !o && !b && (r ? "hover:bg-neutral-300/60" : "hover:bg-slate-50"),
158
179
  b && !o && (r ? "bg-neutral-300/60" : "bg-slate-50"),
159
180
  o && (r ? "bg-neutral-300 opacity-100 scale-[0.99] cursor-grabbing" : "bg-slate-50 opacity-100 scale-[0.99] cursor-grabbing")
160
181
  ),
161
182
  children: [
162
- /* @__PURE__ */ l(
183
+ /* @__PURE__ */ s(
163
184
  "button",
164
185
  {
165
186
  type: "button",
166
- className: s(
187
+ className: l(
167
188
  "shrink-0",
168
189
  r ? "text-neutral-100" : "text-slate-400",
169
190
  "cursor-grab active:cursor-grabbing",
170
191
  r ? "rounded-lg p-1 hover:bg-neutral-200" : "rounded-lg p-1 hover:bg-slate-100",
171
192
  o && "cursor-grabbing"
172
193
  ),
173
- "aria-label": m.drag,
174
- children: /* @__PURE__ */ l(q, { weight: "Linear", size: 20 })
194
+ "aria-label": f.drag,
195
+ children: /* @__PURE__ */ s(J, { weight: "Linear", size: 20 })
175
196
  }
176
197
  ),
177
- /* @__PURE__ */ l("div", { className: "shrink-0", children: /* @__PURE__ */ l(
178
- J,
198
+ /* @__PURE__ */ s("div", { className: "shrink-0", children: /* @__PURE__ */ s(
199
+ V,
179
200
  {
180
201
  checked: a,
181
202
  disabled: n,
182
- onChange: () => G(e.key, n),
183
- variant: "blue",
203
+ onChange: () => H(e.key, n),
204
+ variant: E,
184
205
  darkMode: r
185
206
  }
186
207
  ) }),
187
208
  /* @__PURE__ */ g("div", { className: "min-w-0 flex-1", children: [
188
- /* @__PURE__ */ l("h4", { className: s("truncate text-base font-medium", r ? "text-neutral-50" : "text-slate-700"), title: e.title, children: e.title }),
189
- n && /* @__PURE__ */ l("p", { className: s("mt-0.5 text-xs", r ? "text-neutral-100" : "text-slate-400"), children: m.minColumns(S) })
209
+ /* @__PURE__ */ s("h4", { className: l("truncate text-base font-medium", r ? "text-neutral-50" : "text-slate-700"), title: e.title, children: e.title }),
210
+ n && /* @__PURE__ */ s("p", { className: l("mt-0.5 text-xs", r ? "text-neutral-100" : "text-slate-400"), children: f.minColumns(S) })
190
211
  ] })
191
212
  ]
192
213
  }
193
214
  ),
194
- t !== i.length - 1 && /* @__PURE__ */ l("div", { className: s("mx-2 h-px", r ? "bg-neutral-200" : "bg-slate-100") })
215
+ t !== i.length - 1 && /* @__PURE__ */ s("div", { className: l("mx-2 h-px", r ? "bg-neutral-200" : "bg-slate-100") })
195
216
  ] }, e.key);
196
217
  })
197
218
  }
@@ -201,5 +222,5 @@ function te({
201
222
  ) : null;
202
223
  }
203
224
  export {
204
- te as default
225
+ ae as default
205
226
  };