@memobit/libs 3.4.3 → 3.5.0

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 (45) hide show
  1. package/dist/components/AngleSlider/AngleSlider2.js +27 -27
  2. package/dist/components/AppHeader/AppHeader2.js +39 -36
  3. package/dist/components/Blockquote/Blockquote2.js +14 -14
  4. package/dist/components/BulkActionBar/BulkActionBar2.js +34 -30
  5. package/dist/components/Calendar/Calendar2.js +10 -8
  6. package/dist/components/Card/Card.css +1 -1
  7. package/dist/components/Confetti/Confetti2.js +2 -3
  8. package/dist/components/ControlPanel/ControlPanelFilter.js +26 -26
  9. package/dist/components/DataView/DataView.CardView.js +8 -4
  10. package/dist/components/DataView/DataView.ColumnSelector.js +24 -21
  11. package/dist/components/DataView/DataView.MiniSort.js +18 -16
  12. package/dist/components/DataView/DataView2.js +90 -86
  13. package/dist/components/DiffViewer/DiffViewer2.js +124 -118
  14. package/dist/components/Dropdown/Dropdown2.js +0 -3
  15. package/dist/components/EventCalendar/EventCalendar.Chip.js +21 -21
  16. package/dist/components/EventCalendar/EventCalendar.Month.js +19 -19
  17. package/dist/components/FloatingWindow/FloatingWindow2.js +60 -60
  18. package/dist/components/Grid/Grid2.js +18 -18
  19. package/dist/components/InputPIN/InputPIN2.js +42 -42
  20. package/dist/components/MiniSort/MiniSort2.js +47 -43
  21. package/dist/components/MiniStatsCard/MiniStatsCard2.js +20 -20
  22. package/dist/components/Pagination/Pagination2.js +18 -18
  23. package/dist/components/Popover/Popover2.js +23 -21
  24. package/dist/components/RangeSlider/RangeSlider2.js +25 -25
  25. package/dist/components/Rating/RatingIcon.js +9 -9
  26. package/dist/components/RichTextEditor/hooks/useLinkPrompt.js +7 -6
  27. package/dist/components/RollingNumber/RollingNumber2.js +33 -31
  28. package/dist/components/Separator/Separator2.js +27 -23
  29. package/dist/components/Skeleton/Skeleton2.js +6 -8
  30. package/dist/components/Slider/Slider2.js +32 -32
  31. package/dist/components/Splitter/Splitter2.js +34 -34
  32. package/dist/components/StackedBar/StackedBar2.js +36 -34
  33. package/dist/components/Stats/Stats2.js +20 -16
  34. package/dist/components/StickyBar/StickyBar2.js +26 -22
  35. package/dist/components/Timeline/Timeline2.js +53 -47
  36. package/dist/components/Tooltip/Tooltip2.js +7 -8
  37. package/dist/components/TourHud/TourHud2.js +20 -20
  38. package/dist/components/Transition/Transition2.js +20 -20
  39. package/dist/components/Tree/Tree2.js +23 -23
  40. package/dist/helpers/VersionInfo.js +1 -1
  41. package/dist/index.d.ts +5 -5
  42. package/dist/node_modules/qrcode.react/lib/esm/index.js +2 -2
  43. package/dist/version.js +2 -2
  44. package/dist/version.json +4 -4
  45. package/package.json +24 -23
@@ -1,11 +1,11 @@
1
1
  import './FloatingWindow.css';
2
- import { Icon as tt } from "../Icon/Icon2.js";
3
- import { Tooltip as N } from "../Tooltip/Tooltip2.js";
2
+ import { Icon as nt } from "../Icon/Icon2.js";
3
+ import { Tooltip as E } from "../Tooltip/Tooltip2.js";
4
4
  /* empty css */
5
- import { useCallback as d, useEffect as Z, useRef as G, useState as g } from "react";
6
- import { Fragment as nt, jsx as o, jsxs as w } from "react/jsx-runtime";
7
- import { createPortal as it } from "react-dom";
8
- var et = [
5
+ import { useCallback as d, useEffect as Z, useRef as $, useState as g } from "react";
6
+ import { Fragment as it, jsx as o, jsxs as w } from "react/jsx-runtime";
7
+ import { createPortal as et } from "react-dom";
8
+ var ot = [
9
9
  "n",
10
10
  "s",
11
11
  "e",
@@ -14,23 +14,23 @@ var et = [
14
14
  "nw",
15
15
  "se",
16
16
  "sw"
17
- ], z = 48, x = 16, ct = ({ children: V, className: W = "", closeOnEscape: D = !1, defaultPosition: q, defaultSize: _ = {
17
+ ], N = 48, G = 16, wt = ({ children: V, className: W = "", closeOnEscape: z = !1, defaultPosition: q, defaultSize: x = {
18
18
  height: 360,
19
19
  width: 480
20
- }, footer: R, isOpen: l, minimizable: H = !0, minHeight: y = 140, minWidth: P = 260, onClose: M, onGeometryChange: b, resizable: I = !0, title: J, titleIcon: k, usePortal: K = !0, zIndex: C = 900 }) => {
21
- const [e, L] = g(_), [r, h] = g(() => q ?? {
22
- x: Math.max(0, (window.innerWidth - _.width) / 2),
23
- y: Math.max(0, (window.innerHeight - _.height) / 3)
24
- }), [s, S] = g(!1), [a, Q] = g(!1), T = G(null), m = G(null), u = d((t, n) => ({
25
- x: Math.min(Math.max(t.x, z - n.width), window.innerWidth - z),
26
- y: Math.min(Math.max(t.y, 0), window.innerHeight - z)
27
- }), []), $ = d(() => {
28
- b?.({
20
+ }, footer: D, isOpen: l, minimizable: H = !0, minHeight: _ = 140, minWidth: y = 260, onClose: P, onGeometryChange: R, resizable: M = !0, title: J, titleIcon: b, usePortal: K = !0, zIndex: k = 900 }) => {
21
+ const [e, C] = g(x), [r, h] = g(() => q ?? {
22
+ x: Math.max(0, (window.innerWidth - x.width) / 2),
23
+ y: Math.max(0, (window.innerHeight - x.height) / 3)
24
+ }), [s, L] = g(!1), [a, Q] = g(!1), S = $(null), m = $(null), u = d((t, n) => ({
25
+ x: Math.min(Math.max(t.x, N - n.width), window.innerWidth - N),
26
+ y: Math.min(Math.max(t.y, 0), window.innerHeight - N)
27
+ }), []), T = d(() => {
28
+ R?.({
29
29
  ...r,
30
30
  ...e
31
31
  });
32
32
  }, [
33
- b,
33
+ R,
34
34
  r,
35
35
  e
36
36
  ]), j = d((t, n) => {
@@ -53,16 +53,16 @@ var et = [
53
53
  ]), F = d((t) => {
54
54
  const n = m.current;
55
55
  if (!n || n.pointerId !== t.pointerId) return;
56
- const v = t.clientX - n.startPointer.x, E = t.clientY - n.startPointer.y, { startRect: i, direction: c } = n;
56
+ const I = t.clientX - n.startPointer.x, v = t.clientY - n.startPointer.y, { startRect: i, direction: c } = n;
57
57
  if (!c) {
58
58
  h(u({
59
- x: i.x + v,
60
- y: i.y + E
59
+ x: i.x + I,
60
+ y: i.y + v
61
61
  }, i));
62
62
  return;
63
63
  }
64
64
  let { height: f, width: p, x: B, y: Y } = i;
65
- c.includes("e") && (p = Math.max(P, i.width + v)), c.includes("w") && (p = Math.max(P, i.width - v), B = i.x + (i.width - p)), c.includes("s") && (f = Math.max(y, i.height + E)), c.includes("n") && (f = Math.max(y, i.height - E), Y = i.y + (i.height - f)), L({
65
+ c.includes("e") && (p = Math.max(y, i.width + I)), c.includes("w") && (p = Math.max(y, i.width - I), B = i.x + (i.width - p)), c.includes("s") && (f = Math.max(_, i.height + v)), c.includes("n") && (f = Math.max(_, i.height - v), Y = i.y + (i.height - f)), C({
66
66
  height: f,
67
67
  width: p
68
68
  }), h({
@@ -71,38 +71,38 @@ var et = [
71
71
  });
72
72
  }, [
73
73
  u,
74
- y,
75
- P
74
+ _,
75
+ y
76
76
  ]), U = d((t) => {
77
- m.current && (t.currentTarget.releasePointerCapture(t.pointerId), m.current = null, $());
78
- }, [$]), X = d(() => {
77
+ m.current && (t.currentTarget.releasePointerCapture(t.pointerId), m.current = null, T());
78
+ }, [T]), X = d(() => {
79
79
  Q((t) => {
80
80
  if (t) {
81
- const n = T.current;
81
+ const n = S.current;
82
82
  return n && (h({
83
83
  x: n.x,
84
84
  y: n.y
85
- }), L({
85
+ }), C({
86
86
  height: n.height,
87
87
  width: n.width
88
88
  })), !1;
89
89
  }
90
- return T.current = {
90
+ return S.current = {
91
91
  ...r,
92
92
  ...e
93
- }, S(!1), !0;
93
+ }, L(!1), !0;
94
94
  });
95
95
  }, [r, e]);
96
96
  if (Z(() => {
97
- if (!l || !D) return;
97
+ if (!l || !z) return;
98
98
  const t = (n) => {
99
- n.key === "Escape" && M();
99
+ n.key === "Escape" && P();
100
100
  };
101
101
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
102
102
  }, [
103
- D,
103
+ z,
104
104
  l,
105
- M
105
+ P
106
106
  ]), Z(() => {
107
107
  if (!l) return;
108
108
  const t = () => h((n) => u(n, e));
@@ -113,52 +113,52 @@ var et = [
113
113
  e
114
114
  ]), !l) return null;
115
115
  const O = a ? {
116
- "--_window-z": C,
117
- height: `calc(100vh - ${x * 2}px)`,
118
- left: x,
119
- top: x,
120
- width: `calc(100vw - ${x * 2}px)`
116
+ "--_window-z": k,
117
+ height: "calc(100vh - 32px)",
118
+ left: G,
119
+ top: G,
120
+ width: "calc(100vw - 32px)"
121
121
  } : {
122
- "--_window-z": C,
122
+ "--_window-z": k,
123
123
  height: s ? void 0 : e.height,
124
124
  left: r.x,
125
125
  top: r.y,
126
126
  width: e.width
127
- }, A = /* @__PURE__ */ w("div", {
128
- className: [
129
- "floating-window",
130
- a ? "floating-window--maximized" : "",
131
- s ? "floating-window--minimized" : "",
132
- W
133
- ].filter(Boolean).join(" "),
127
+ }, tt = [
128
+ "floating-window",
129
+ a ? "floating-window--maximized" : "",
130
+ s ? "floating-window--minimized" : "",
131
+ W
132
+ ].filter(Boolean).join(" "), A = /* @__PURE__ */ w("div", {
133
+ className: tt,
134
134
  style: O,
135
135
  children: [
136
136
  /* @__PURE__ */ w("div", {
137
137
  className: "floating-window__header",
138
- onDoubleClick: I ? X : void 0,
138
+ onDoubleClick: M ? X : void 0,
139
139
  onPointerDown: j,
140
140
  onPointerMove: F,
141
141
  onPointerUp: U,
142
142
  children: [/* @__PURE__ */ w("span", {
143
143
  className: "floating-window__title",
144
- children: [k && /* @__PURE__ */ o(tt, {
145
- name: k,
144
+ children: [b && /* @__PURE__ */ o(nt, {
145
+ name: b,
146
146
  size: "sm"
147
147
  }), J]
148
148
  }), /* @__PURE__ */ w("span", {
149
149
  className: "floating-window__actions",
150
150
  children: [
151
- H && /* @__PURE__ */ o(N, {
151
+ H && /* @__PURE__ */ o(E, {
152
152
  title: s ? "Expand" : "Collapse",
153
153
  children: /* @__PURE__ */ o("button", {
154
154
  className: "floating-window__action",
155
- onClick: () => S((t) => !t),
155
+ onClick: () => L((t) => !t),
156
156
  onPointerDown: (t) => t.stopPropagation(),
157
157
  type: "button",
158
158
  children: s ? "▢" : "—"
159
159
  })
160
160
  }),
161
- I && /* @__PURE__ */ o(N, {
161
+ M && /* @__PURE__ */ o(E, {
162
162
  title: a ? "Restore" : "Maximize",
163
163
  children: /* @__PURE__ */ o("button", {
164
164
  className: "floating-window__action",
@@ -168,11 +168,11 @@ var et = [
168
168
  children: a ? "❐" : "□"
169
169
  })
170
170
  }),
171
- /* @__PURE__ */ o(N, {
171
+ /* @__PURE__ */ o(E, {
172
172
  title: "Close",
173
173
  children: /* @__PURE__ */ o("button", {
174
174
  className: "floating-window__action floating-window__action--close",
175
- onClick: M,
175
+ onClick: P,
176
176
  onPointerDown: (t) => t.stopPropagation(),
177
177
  type: "button",
178
178
  children: "✕"
@@ -181,14 +181,14 @@ var et = [
181
181
  ]
182
182
  })]
183
183
  }),
184
- !s && /* @__PURE__ */ w(nt, { children: [/* @__PURE__ */ o("div", {
184
+ !s && /* @__PURE__ */ w(it, { children: [/* @__PURE__ */ o("div", {
185
185
  className: "floating-window__body",
186
186
  children: V
187
- }), R && /* @__PURE__ */ o("div", {
187
+ }), D && /* @__PURE__ */ o("div", {
188
188
  className: "floating-window__footer",
189
- children: R
189
+ children: D
190
190
  })] }),
191
- I && !a && !s && et.map((t) => /* @__PURE__ */ o("span", {
191
+ M && !a && !s && ot.map((t) => /* @__PURE__ */ o("span", {
192
192
  className: `floating-window__handle floating-window__handle--${t}`,
193
193
  onPointerDown: (n) => j(n, t),
194
194
  onPointerMove: F,
@@ -196,8 +196,8 @@ var et = [
196
196
  }, t))
197
197
  ]
198
198
  });
199
- return K ? it(A, document.body) : A;
199
+ return K ? et(A, document.body) : A;
200
200
  };
201
201
  export {
202
- ct as FloatingWindow
202
+ wt as FloatingWindow
203
203
  };
@@ -1,28 +1,28 @@
1
1
  import './Grid.css';
2
2
  /* empty css */
3
- import { jsx as _ } from "react/jsx-runtime";
4
- var x = (r) => r > 2 ? 2 : r, m = ({ align: r = "stretch", children: a, className: e = "", cols: o = 2, colsMobile: s = 1, colsTablet: l, gap: t = "16", justify: n = "start", minColWidth: i, rowGap: g, style: c }) => {
5
- const d = t === "0" ? "0px" : `var(--spacing-${t})`, p = g === void 0 ? d : g === "0" ? "0px" : `var(--spacing-${g})`, v = {
6
- "--_grid-cols": o,
7
- "--_grid-cols-mobile": s,
8
- "--_grid-cols-tablet": l ?? x(o),
9
- "--_grid-gap": d,
3
+ import { jsx as x } from "react/jsx-runtime";
4
+ var $ = (r) => r > 2 ? 2 : r, b = ({ align: r = "stretch", children: a, className: d = "", cols: s = 2, colsMobile: e = 1, colsTablet: l, gap: t = "16", justify: c = "start", minColWidth: i, rowGap: o, style: n }) => {
5
+ const g = t === "0" ? "0px" : `var(--spacing-${t})`, p = o === void 0 ? g : o === "0" ? "0px" : `var(--spacing-${o})`, v = {
6
+ "--_grid-cols": s,
7
+ "--_grid-cols-mobile": e,
8
+ "--_grid-cols-tablet": l ?? $(s),
9
+ "--_grid-gap": g,
10
10
  "--_grid-row-gap": p,
11
11
  ...i === void 0 ? {} : { "--_grid-min-col": `${i}px` },
12
- ...c
13
- };
14
- return /* @__PURE__ */ _("div", {
15
- className: [
16
- "grid",
17
- i === void 0 ? "" : "grid--fluid",
18
- `grid--align-${r}`,
19
- `grid--justify-${n}`,
20
- e
21
- ].filter(Boolean).join(" "),
12
+ ...n
13
+ }, _ = [
14
+ "grid",
15
+ i === void 0 ? "" : "grid--fluid",
16
+ `grid--align-${r}`,
17
+ `grid--justify-${c}`,
18
+ d
19
+ ].filter(Boolean).join(" ");
20
+ return /* @__PURE__ */ x("div", {
21
+ className: _,
22
22
  style: v,
23
23
  children: a
24
24
  });
25
25
  };
26
26
  export {
27
- m as Grid
27
+ b as Grid
28
28
  };
@@ -1,95 +1,95 @@
1
1
  import './InputPIN.css';
2
2
  /* empty css */
3
3
  import { useCallback as o, useEffect as P, useRef as j } from "react";
4
- import { jsx as f, jsxs as B } from "react/jsx-runtime";
5
- var K = /[^0-9]/g, U = /[^0-9a-zA-Z]/g, W = ({ autoFocus: y = !1, disabled: M = !1, error: N, id: m, label: C, length: s = 6, groupSize: E, onChange: g, onComplete: k, secret: $ = !1, success: D, type: A = "numeric", value: I }) => {
6
- const R = j([]), v = j(!1), n = o((r) => r.replace(A === "numeric" ? K : U, "").slice(0, s), [s, A]), p = n(I), c = p.split("");
4
+ import { jsx as f, jsxs as K } from "react/jsx-runtime";
5
+ var U = /[^0-9]/g, z = /[^0-9a-zA-Z]/g, Z = ({ autoFocus: v = !1, disabled: M = !1, error: N, id: m, label: w, length: s = 6, groupSize: y, onChange: E, onComplete: g, secret: $ = !1, success: D, type: A = "numeric", value: I }) => {
6
+ const C = j([]), R = j(!1), n = o((r) => r.replace(A === "numeric" ? U : z, "").slice(0, s), [s, A]), p = n(I), a = p.split("");
7
7
  P(() => {
8
- p.length === s && !v.current && (v.current = !0, k?.(p)), p.length < s && (v.current = !1);
8
+ p.length === s && !R.current && (R.current = !0, g?.(p)), p.length < s && (R.current = !1);
9
9
  }, [
10
10
  p,
11
11
  s,
12
- k
12
+ g
13
13
  ]), P(() => {
14
- y && R.current[0]?.focus();
15
- }, [y]);
16
- const a = o((r) => {
17
- const t = R.current[Math.min(Math.max(r, 0), s - 1)];
14
+ v && C.current[0]?.focus();
15
+ }, [v]);
16
+ const c = o((r) => {
17
+ const t = C.current[Math.min(Math.max(r, 0), s - 1)];
18
18
  t?.focus(), t?.select();
19
19
  }, [s]), l = o((r) => {
20
20
  const t = r.join("").replace(/\s/g, "");
21
- g(n(t));
22
- }, [g, n]), T = o((r, t) => {
23
- const e = c[r] ?? "", h = e && t.startsWith(e) ? t.slice(e.length) : t, i = n(h);
21
+ E(n(t));
22
+ }, [E, n]), T = o((r, t) => {
23
+ const e = a[r] ?? "", h = e && t.startsWith(e) ? t.slice(e.length) : t, i = n(h);
24
24
  if (!i) return;
25
- const u = [...c];
26
- i.split("").forEach((_, w) => {
27
- r + w < s && (u[r + w] = _);
28
- }), l(u), a(r + i.length);
25
+ const u = [...a];
26
+ i.split("").forEach((B, k) => {
27
+ r + k < s && (u[r + k] = B);
28
+ }), l(u), c(r + i.length);
29
29
  }, [
30
- c,
31
- l,
32
30
  a,
31
+ l,
32
+ c,
33
33
  s,
34
34
  n
35
35
  ]), b = o((r, t) => {
36
36
  if (r.key === "Backspace") {
37
37
  r.preventDefault();
38
- const e = [...c];
38
+ const e = [...a];
39
39
  if (e[t]) {
40
40
  e.splice(t, 1), l(e);
41
41
  return;
42
42
  }
43
- t > 0 && (e.splice(t - 1, 1), l(e), a(t - 1));
43
+ t > 0 && (e.splice(t - 1, 1), l(e), c(t - 1));
44
44
  return;
45
45
  }
46
46
  if (r.key === "Delete") {
47
47
  r.preventDefault();
48
- const e = [...c];
48
+ const e = [...a];
49
49
  e.splice(t, 1), l(e);
50
50
  return;
51
51
  }
52
52
  if (r.key === "ArrowLeft") {
53
- r.preventDefault(), a(t - 1);
53
+ r.preventDefault(), c(t - 1);
54
54
  return;
55
55
  }
56
- r.key === "ArrowRight" && (r.preventDefault(), a(t + 1));
56
+ r.key === "ArrowRight" && (r.preventDefault(), c(t + 1));
57
57
  }, [
58
- c,
58
+ a,
59
59
  l,
60
- a
60
+ c
61
61
  ]), L = o((r, t) => {
62
62
  r.preventDefault();
63
63
  const e = n(r.clipboardData.getData("text"));
64
64
  if (!e) return;
65
- const h = [...c];
65
+ const h = [...a];
66
66
  e.split("").forEach((i, u) => {
67
67
  t + u < s && (h[t + u] = i);
68
- }), l(h), a(t + e.length);
68
+ }), l(h), c(t + e.length);
69
69
  }, [
70
- c,
71
- l,
72
70
  a,
71
+ l,
72
+ c,
73
73
  s,
74
74
  n
75
- ]);
76
- return /* @__PURE__ */ B("div", {
77
- className: [
78
- "input-pin-wrapper",
79
- N ? "input-pin-wrapper--error" : "",
80
- D ? "input-pin-wrapper--success" : ""
81
- ].filter(Boolean).join(" "),
75
+ ]), _ = [
76
+ "input-pin-wrapper",
77
+ N ? "input-pin-wrapper--error" : "",
78
+ D ? "input-pin-wrapper--success" : ""
79
+ ].filter(Boolean).join(" ");
80
+ return /* @__PURE__ */ K("div", {
81
+ className: _,
82
82
  children: [
83
- C && /* @__PURE__ */ f("label", {
83
+ w && /* @__PURE__ */ f("label", {
84
84
  className: "input-pin-label",
85
85
  htmlFor: m ? `${m}-0` : void 0,
86
- children: C
86
+ children: w
87
87
  }),
88
88
  /* @__PURE__ */ f("div", {
89
89
  className: "input-pin-cells",
90
90
  children: Array.from({ length: s }, (r, t) => /* @__PURE__ */ f("input", {
91
91
  autoComplete: t === 0 ? "one-time-code" : "off",
92
- className: `input-pin-cell${c[t] ? " input-pin-cell--filled" : ""}${E && t > 0 && t % E === 0 ? " input-pin-cell--group-start" : ""}`,
92
+ className: `input-pin-cell${a[t] ? " input-pin-cell--filled" : ""}${y && t > 0 && t % y === 0 ? " input-pin-cell--group-start" : ""}`,
93
93
  disabled: M,
94
94
  id: m ? `${m}-${t}` : void 0,
95
95
  inputMode: A === "numeric" ? "numeric" : "text",
@@ -100,9 +100,9 @@ var K = /[^0-9]/g, U = /[^0-9a-zA-Z]/g, W = ({ autoFocus: y = !1, disabled: M =
100
100
  onPaste: (e) => L(e, t),
101
101
  type: $ ? "password" : "text",
102
102
  ref: (e) => {
103
- R.current[t] = e;
103
+ C.current[t] = e;
104
104
  },
105
- value: c[t] ?? ""
105
+ value: a[t] ?? ""
106
106
  }, t))
107
107
  }),
108
108
  N && /* @__PURE__ */ f("span", {
@@ -117,5 +117,5 @@ var K = /[^0-9]/g, U = /[^0-9a-zA-Z]/g, W = ({ autoFocus: y = !1, disabled: M =
117
117
  });
118
118
  };
119
119
  export {
120
- W as InputPIN
120
+ Z as InputPIN
121
121
  };
@@ -1,57 +1,61 @@
1
1
  import './MiniSort.css';
2
2
  import { Icon as u } from "../Icon/Icon2.js";
3
- import { Button as f } from "../Button/Button2.js";
4
- import { Tooltip as p } from "../Tooltip/Tooltip2.js";
3
+ import { Button as p } from "../Button/Button2.js";
4
+ import { Tooltip as f } from "../Tooltip/Tooltip2.js";
5
5
  /* empty css */
6
6
  import "react";
7
- import { jsx as s, jsxs as z } from "react/jsx-runtime";
8
- var B = ({ items: o, sortKey: i, sortDirection: n, onSort: v, align: _ = "left", showDirectionToggle: l = !1, className: $ = "" }) => o.length === 0 ? null : /* @__PURE__ */ z("div", {
9
- className: [
7
+ import { jsx as s, jsxs as h } from "react/jsx-runtime";
8
+ var I = ({ items: r, sortKey: e, sortDirection: n, onSort: v, align: _ = "left", showDirectionToggle: l = !1, className: $ = "" }) => {
9
+ if (r.length === 0) return null;
10
+ const x = [
10
11
  "mini-sort",
11
12
  `mini-sort--align-${_}`,
12
13
  $
13
- ].filter(Boolean).join(" "),
14
- children: [o.map((a, x) => {
15
- const c = a.direction ?? "asc", t = i === a.value, r = !l && o.filter((m) => m.value === a.value).length === 1, e = l || r ? t : t && n === c, d = typeof a.label == "string" || typeof a.label == "number" ? String(a.label) : a.value, b = (m) => m === "asc" ? "ascending" : "descending", N = l ? t ? n : c : r && e ? n === "asc" ? "desc" : "asc" : c;
16
- return /* @__PURE__ */ s(p, {
17
- title: l ? `Sort by ${d}` : r && e ? `Sorted by ${d} ${b(n)} — click to reverse` : `Sort by ${d} ${b(c)}`,
18
- children: /* @__PURE__ */ s(f, {
19
- className: `mini-sort__button${e ? " is-active" : ""}`,
20
- disabled: a.disabled,
21
- icon: a.icon ? /* @__PURE__ */ s(u, {
22
- className: "mini-sort__icon",
23
- name: a.icon,
24
- size: "sm",
25
- variant: e ? "accent" : "muted"
26
- }) : void 0,
27
- sufixIcon: r && e ? /* @__PURE__ */ s(u, {
14
+ ].filter(Boolean).join(" ");
15
+ return /* @__PURE__ */ h("div", {
16
+ className: x,
17
+ children: [r.map((a, N) => {
18
+ const i = a.direction ?? "asc", t = e === a.value, o = !l && r.filter((m) => m.value === a.value).length === 1, c = l || o ? t : t && n === i, d = typeof a.label == "string" || typeof a.label == "number" ? String(a.label) : a.value, b = (m) => m === "asc" ? "ascending" : "descending", z = l ? t ? n : i : o && c ? n === "asc" ? "desc" : "asc" : i, S = l ? `Sort by ${d}` : o && c ? `Sorted by ${d} ${b(n)} — click to reverse` : `Sort by ${d} ${b(i)}`;
19
+ return /* @__PURE__ */ s(f, {
20
+ title: S,
21
+ children: /* @__PURE__ */ s(p, {
22
+ className: `mini-sort__button${c ? " is-active" : ""}`,
23
+ disabled: a.disabled,
24
+ icon: a.icon ? /* @__PURE__ */ s(u, {
25
+ className: "mini-sort__icon",
26
+ name: a.icon,
27
+ size: "sm",
28
+ variant: c ? "accent" : "muted"
29
+ }) : void 0,
30
+ sufixIcon: o && c ? /* @__PURE__ */ s(u, {
31
+ className: "mini-sort__icon",
32
+ name: n === "asc" ? "arrow-up" : "arrow-down",
33
+ size: "sm"
34
+ }) : void 0,
35
+ size: "small",
36
+ variant: "ghost",
37
+ onClick: () => v(a.value, z),
38
+ children: a.label ?? a.value
39
+ })
40
+ }, `${a.value}-${N}`);
41
+ }), l && /* @__PURE__ */ s(f, {
42
+ title: `Direction: ${n === "asc" ? "ascending" : "descending"}`,
43
+ children: /* @__PURE__ */ s(p, {
44
+ className: "mini-sort__button mini-sort__direction",
45
+ disabled: e === null,
46
+ icon: /* @__PURE__ */ s(u, {
28
47
  className: "mini-sort__icon",
29
48
  name: n === "asc" ? "arrow-up" : "arrow-down",
30
- size: "sm"
31
- }) : void 0,
49
+ size: "sm",
50
+ variant: "accent"
51
+ }),
32
52
  size: "small",
33
53
  variant: "ghost",
34
- onClick: () => v(a.value, N),
35
- children: a.label ?? a.value
54
+ onClick: () => e !== null && v(e, n === "asc" ? "desc" : "asc")
36
55
  })
37
- }, `${a.value}-${x}`);
38
- }), l && /* @__PURE__ */ s(p, {
39
- title: `Direction: ${n === "asc" ? "ascending" : "descending"}`,
40
- children: /* @__PURE__ */ s(f, {
41
- className: "mini-sort__button mini-sort__direction",
42
- disabled: i === null,
43
- icon: /* @__PURE__ */ s(u, {
44
- className: "mini-sort__icon",
45
- name: n === "asc" ? "arrow-up" : "arrow-down",
46
- size: "sm",
47
- variant: "accent"
48
- }),
49
- size: "small",
50
- variant: "ghost",
51
- onClick: () => i !== null && v(i, n === "asc" ? "desc" : "asc")
52
- })
53
- })]
54
- });
56
+ })]
57
+ });
58
+ };
55
59
  export {
56
- B as MiniSort
60
+ I as MiniSort
57
61
  };
@@ -1,50 +1,50 @@
1
1
  import './MiniStatsCard.css';
2
- import { Card as g } from "../Card/Card2.js";
2
+ import { Card as j } from "../Card/Card2.js";
3
3
  /* empty css */
4
4
  import "react";
5
5
  import { jsx as a, jsxs as s } from "react/jsx-runtime";
6
- var V = ({ label: o, value: _, unit: t, variant: r = "default", align: u = "center", labelPosition: e = "bottom", trend: i, trendUnit: n = "%", trendLabel: v, trendVariant: h = "success", footer: c, filled: d = !1, className: N = "" }) => {
6
+ var y = ({ label: o, value: _, unit: i, variant: r = "default", align: u = "center", labelPosition: e = "bottom", trend: t, trendUnit: n = "%", trendLabel: v, trendVariant: N = "success", footer: c, filled: d = !1, className: h = "" }) => {
7
7
  const p = () => /* @__PURE__ */ s("div", {
8
8
  className: `mini-stats-card__value mini-stats-card__value--${r}`,
9
9
  children: [/* @__PURE__ */ a("span", {
10
10
  className: "mini-stats-card__value-number",
11
11
  children: _
12
- }), t && /* @__PURE__ */ a("span", {
12
+ }), i && /* @__PURE__ */ a("span", {
13
13
  className: "mini-stats-card__value-unit",
14
- children: t
14
+ children: i
15
15
  })]
16
16
  }), l = () => /* @__PURE__ */ a("div", {
17
17
  className: "mini-stats-card__label",
18
18
  children: o
19
19
  }), f = () => {
20
- if (i === void 0) return null;
21
- const $ = i > 0, b = i < 0, m = Math.abs(i), x = v ?? (n ? `${m}${n}` : `${m}`);
20
+ if (t === void 0) return null;
21
+ const b = t > 0, x = t < 0, m = Math.abs(t), g = v ?? (n ? `${m}${n}` : `${m}`);
22
22
  return /* @__PURE__ */ s("div", {
23
- className: `mini-stats-card__trend mini-stats-card__trend--${h}`,
23
+ className: `mini-stats-card__trend mini-stats-card__trend--${N}`,
24
24
  children: [
25
- $ && /* @__PURE__ */ a("span", {
25
+ b && /* @__PURE__ */ a("span", {
26
26
  className: "mini-stats-card__trend-arrow",
27
27
  children: "↑"
28
28
  }),
29
- b && /* @__PURE__ */ a("span", {
29
+ x && /* @__PURE__ */ a("span", {
30
30
  className: "mini-stats-card__trend-arrow",
31
31
  children: "↓"
32
32
  }),
33
33
  /* @__PURE__ */ a("span", {
34
34
  className: "mini-stats-card__trend-value",
35
- children: x
35
+ children: g
36
36
  })
37
37
  ]
38
38
  });
39
- };
40
- return /* @__PURE__ */ s(g, {
41
- className: [
42
- "mini-stats-card",
43
- `mini-stats-card--align-${u}`,
44
- d ? "mini-stats-card--filled" : "",
45
- d ? `mini-stats-card--variant-${r}` : "",
46
- N
47
- ].filter(Boolean).join(" "),
39
+ }, $ = [
40
+ "mini-stats-card",
41
+ `mini-stats-card--align-${u}`,
42
+ d ? "mini-stats-card--filled" : "",
43
+ d ? `mini-stats-card--variant-${r}` : "",
44
+ h
45
+ ].filter(Boolean).join(" ");
46
+ return /* @__PURE__ */ s(j, {
47
+ className: $,
48
48
  noPadding: !0,
49
49
  children: [/* @__PURE__ */ s("div", {
50
50
  className: "mini-stats-card__content",
@@ -63,5 +63,5 @@ var V = ({ label: o, value: _, unit: t, variant: r = "default", align: u = "cent
63
63
  });
64
64
  };
65
65
  export {
66
- V as MiniStatsCard
66
+ y as MiniStatsCard
67
67
  };