@memobit/libs 3.4.3 → 3.6.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 (60) hide show
  1. package/dist/components/AngleSlider/AngleSlider2.js +27 -27
  2. package/dist/components/AppHeader/AppHeader2.js +39 -36
  3. package/dist/components/Auth/ChangePasswordModal/ChangePasswordModal2.js +48 -52
  4. package/dist/components/Auth/MfaSetupModal/MfaSetupModal2.js +64 -65
  5. package/dist/components/Blockquote/Blockquote2.js +14 -14
  6. package/dist/components/BulkActionBar/BulkActionBar2.js +34 -30
  7. package/dist/components/Calendar/Calendar2.js +10 -8
  8. package/dist/components/Card/Card.css +1 -1
  9. package/dist/components/Confetti/Confetti2.js +2 -3
  10. package/dist/components/ControlPanel/ControlPanelFilter.js +26 -26
  11. package/dist/components/DataView/DataView.CardView.js +8 -4
  12. package/dist/components/DataView/DataView.ColumnSelector.js +24 -21
  13. package/dist/components/DataView/DataView.MiniSort.js +18 -16
  14. package/dist/components/DataView/DataView2.js +90 -86
  15. package/dist/components/DiffViewer/DiffViewer2.js +124 -118
  16. package/dist/components/Dropdown/Dropdown2.js +0 -3
  17. package/dist/components/EventCalendar/EventCalendar.Chip.js +21 -21
  18. package/dist/components/EventCalendar/EventCalendar.Month.js +19 -19
  19. package/dist/components/FloatingWindow/FloatingWindow2.js +60 -60
  20. package/dist/components/Grid/Grid2.js +18 -18
  21. package/dist/components/InputPIN/InputPIN2.js +42 -42
  22. package/dist/components/MiniSort/MiniSort2.js +47 -43
  23. package/dist/components/MiniStatsCard/MiniStatsCard2.js +20 -20
  24. package/dist/components/Pagination/Pagination2.js +18 -18
  25. package/dist/components/Popover/Popover2.js +23 -21
  26. package/dist/components/ProtectedRoute/ProtectedRoute.css +1 -0
  27. package/dist/components/ProtectedRoute/ProtectedRoute2.js +19 -0
  28. package/dist/components/RangeSlider/RangeSlider2.js +25 -25
  29. package/dist/components/Rating/RatingIcon.js +9 -9
  30. package/dist/components/RichTextEditor/hooks/useLinkPrompt.js +7 -6
  31. package/dist/components/RollingNumber/RollingNumber2.js +33 -31
  32. package/dist/components/Separator/Separator2.js +27 -23
  33. package/dist/components/Skeleton/Skeleton2.js +6 -8
  34. package/dist/components/Slider/Slider2.js +32 -32
  35. package/dist/components/Splitter/Splitter2.js +34 -34
  36. package/dist/components/StackedBar/StackedBar2.js +36 -34
  37. package/dist/components/Stats/Stats2.js +20 -16
  38. package/dist/components/StickyBar/StickyBar2.js +26 -22
  39. package/dist/components/Timeline/Timeline2.js +53 -47
  40. package/dist/components/Tooltip/Tooltip2.js +7 -8
  41. package/dist/components/TourHud/TourHud2.js +20 -20
  42. package/dist/components/Transition/Transition2.js +20 -20
  43. package/dist/components/Tree/Tree2.js +23 -23
  44. package/dist/contexts/AuthContext/AuthContext.js +33 -32
  45. package/dist/helpers/Charts.js +18 -0
  46. package/dist/helpers/Http.js +102 -0
  47. package/dist/helpers/Images.js +19 -0
  48. package/dist/helpers/Numbers.js +5 -4
  49. package/dist/helpers/VersionInfo.js +1 -1
  50. package/dist/hooks/useAccountMenu.js +58 -0
  51. package/dist/http.d.ts +97 -0
  52. package/dist/http.js +14 -0
  53. package/dist/index.d.ts +152 -5
  54. package/dist/index.js +334 -309
  55. package/dist/node_modules/qrcode.react/lib/esm/index.js +2 -2
  56. package/dist/router.d.ts +18 -0
  57. package/dist/router.js +4 -0
  58. package/dist/version.js +2 -2
  59. package/dist/version.json +4 -4
  60. package/package.json +38 -23
@@ -1,20 +1,20 @@
1
1
  import './Pagination.css';
2
2
  import { Button as u } from "../Button/Button2.js";
3
- import { useBreakpoint as I } from "../../hooks/useBreakpoint.js";
4
- import { Dropdown as O } from "../Dropdown/Dropdown2.js";
3
+ import { useBreakpoint as E } from "../../hooks/useBreakpoint.js";
4
+ import { Dropdown as y } from "../Dropdown/Dropdown2.js";
5
5
  /* empty css */
6
- import { useCallback as y, useEffect as H, useRef as L, useState as R } from "react";
6
+ import { useCallback as L, useEffect as R, useRef as I, useState as O } from "react";
7
7
  import { jsx as t, jsxs as c } from "react/jsx-runtime";
8
- var U = 45, V = 120, j = 45, C = 45, D = 8, G = 4, F = ({ currentPage: i, totalPages: r, totalItems: p, onPageChange: d, showPagesNumbers: M = !1, pageSizeOptions: o, pageSize: m, onPageSizeChange: v, pageSizeLabel: N = "Rows", horizontalAlign: x = "left" }) => {
9
- const { isAtLeast: a, isMobile: A } = I(), f = L(null), [l, W] = R(A ? 0 : 2), h = y(() => {
8
+ var V = 120, j = 45, C = 8, H = 4, z = ({ currentPage: i, totalPages: r, totalItems: p, onPageChange: d, showPagesNumbers: N = !1, pageSizeOptions: o, pageSize: m, onPageSizeChange: v, pageSizeLabel: x = "Rows", horizontalAlign: D = "left" }) => {
9
+ const { isAtLeast: a, isMobile: k } = E(), f = I(null), [l, w] = O(k ? 0 : 2), h = L(() => {
10
10
  const s = f.current, e = s?.parentElement;
11
11
  if (!s || !e) return;
12
12
  let n = 0;
13
- for (const T of e.children) T !== s && (n += T.offsetWidth + D);
14
- const w = e.clientWidth - n - ((a("desktop") ? V : j) * 2 + U * 2 + C * 2 + D * 6), B = Math.floor(w / 53), E = Math.min(G, Math.max(0, Math.floor(B / 2)));
15
- W(E);
13
+ for (const _ of e.children) _ !== s && (n += _.offsetWidth + C);
14
+ const T = e.clientWidth - n - ((a("desktop") ? V : j) * 2 + 90 + 90 + 48), W = Math.floor(T / 53), B = Math.min(H, Math.max(0, Math.floor(W / 2)));
15
+ w(B);
16
16
  }, [a]);
17
- H(() => {
17
+ R(() => {
18
18
  const s = f.current, e = s?.parentElement;
19
19
  if (!s || !e) return;
20
20
  const n = new ResizeObserver(() => {
@@ -22,16 +22,16 @@ var U = 45, V = 120, j = 45, C = 45, D = 8, G = 4, F = ({ currentPage: i, totalP
22
22
  });
23
23
  return n.observe(s), n.observe(e), h(), () => n.disconnect();
24
24
  }, [h]);
25
- const b = o && m !== void 0 && v, _ = o?.map((s) => ({
25
+ const b = o && m !== void 0 && v, M = o?.map((s) => ({
26
26
  label: `${s}`,
27
27
  value: s
28
- })), k = () => {
28
+ })), A = () => {
29
29
  const s = [], e = [];
30
30
  for (let n = Math.max(2, i - l); n <= Math.min(r - 1, i + l); n++) s.push(n);
31
31
  return i - l > 2 ? e.push(1, "...") : e.push(1), e.push(...s), i + l < r - 1 ? e.push("...", r) : r > 1 && e.push(r), e;
32
32
  };
33
33
  return p !== void 0 && o?.length && p <= Math.min(...o) || r <= 1 && !b ? null : /* @__PURE__ */ c("div", {
34
- className: `pagination pagination--${x}`,
34
+ className: `pagination pagination--${D}`,
35
35
  children: [
36
36
  r > 1 && /* @__PURE__ */ c("div", {
37
37
  className: "pagination__pages",
@@ -45,7 +45,7 @@ var U = 45, V = 120, j = 45, C = 45, D = 8, G = 4, F = ({ currentPage: i, totalP
45
45
  onClick: () => d(i - 1),
46
46
  children: a("desktop") ? "Previous" : ""
47
47
  }),
48
- k().map((s, e) => /* @__PURE__ */ t(u, {
48
+ A().map((s, e) => /* @__PURE__ */ t(u, {
49
49
  borders: "sharp",
50
50
  variant: s === i ? "warning" : "default",
51
51
  disabled: typeof s == "string",
@@ -62,11 +62,11 @@ var U = 45, V = 120, j = 45, C = 45, D = 8, G = 4, F = ({ currentPage: i, totalP
62
62
  })
63
63
  ]
64
64
  }),
65
- b && _ && /* @__PURE__ */ c("div", {
65
+ b && M && /* @__PURE__ */ c("div", {
66
66
  className: "pagination__page-size",
67
- children: [/* @__PURE__ */ t("span", { children: N }), /* @__PURE__ */ t(O, {
67
+ children: [/* @__PURE__ */ t("span", { children: x }), /* @__PURE__ */ t(y, {
68
68
  name: "pageSize",
69
- options: _,
69
+ options: M,
70
70
  value: m,
71
71
  searchable: !1,
72
72
  usePortal: !1,
@@ -75,7 +75,7 @@ var U = 45, V = 120, j = 45, C = 45, D = 8, G = 4, F = ({ currentPage: i, totalP
75
75
  }
76
76
  })]
77
77
  }),
78
- M && /* @__PURE__ */ c("span", {
78
+ N && /* @__PURE__ */ c("span", {
79
79
  className: "page-info",
80
80
  children: [
81
81
  "Page ",
@@ -88,5 +88,5 @@ var U = 45, V = 120, j = 45, C = 45, D = 8, G = 4, F = ({ currentPage: i, totalP
88
88
  });
89
89
  };
90
90
  export {
91
- F as Pagination
91
+ z as Pagination
92
92
  };
@@ -1,17 +1,17 @@
1
1
  import './Popover.css';
2
2
  /* empty css */
3
- import { useCallback as I, useEffect as O, useRef as _, useState as N } from "react";
4
- import { jsx as x, jsxs as M } from "react/jsx-runtime";
5
- import { createPortal as z } from "react-dom";
6
- var i = 20, P = 16, C = 8, j = ({ children: y, visible: h, onClose: g, anchorEl: f, offset: u = C, placement: a = "auto" }) => {
7
- const m = _(null), v = _(null), [w, A] = N({
3
+ import { useCallback as N, useEffect as O, useRef as _, useState as M } from "react";
4
+ import { jsx as x, jsxs as z } from "react/jsx-runtime";
5
+ import { createPortal as C } from "react-dom";
6
+ var i = 20, P = 16, G = 8, B = ({ children: y, visible: h, onClose: g, anchorEl: c, offset: u = G, placement: a = "auto" }) => {
7
+ const m = _(null), v = _(null), [w, A] = M({
8
8
  top: 0,
9
9
  left: 0,
10
10
  placement: "bottom",
11
11
  arrowOffset: null
12
- }), c = I(() => {
13
- if (!f || !m.current || !h) return;
14
- const t = f.getBoundingClientRect(), e = m.current.getBoundingClientRect(), n = {
12
+ }), f = N(() => {
13
+ if (!c || !m.current || !h) return;
14
+ const t = c.getBoundingClientRect(), e = m.current.getBoundingClientRect(), n = {
15
15
  width: window.innerWidth,
16
16
  height: window.innerHeight
17
17
  }, R = (p, d) => p >= i && d >= i && p + e.height <= n.height - i && d + e.width <= n.width - i, l = {
@@ -56,37 +56,38 @@ var i = 20, P = 16, C = 8, j = ({ children: y, visible: h, onClose: g, anchorEl:
56
56
  }) || a, { top: r, left: s } = l[o]);
57
57
  }
58
58
  (o === "top" || o === "bottom") && (s < i && (s = i), s + e.width > n.width - i && (s = n.width - e.width - i)), (o === "left" || o === "right") && (r < i && (r = i), r + e.height > n.height - i && (r = n.height - e.height - i));
59
- const E = o === "top" || o === "bottom", F = E ? t.left + t.width / 2 - s : t.top + t.height / 2 - r, b = E ? e.width : e.height, k = Math.min(Math.max(F, P), b - P);
59
+ const E = o === "top" || o === "bottom", b = E ? t.left + t.width / 2 - s : t.top + t.height / 2 - r, k = E ? e.width : e.height, I = Math.min(Math.max(b, P), k - P);
60
60
  A({
61
61
  top: r,
62
62
  left: s,
63
63
  placement: o,
64
- arrowOffset: k
64
+ arrowOffset: I
65
65
  });
66
66
  }, [
67
- f,
67
+ c,
68
68
  h,
69
69
  u,
70
70
  a
71
71
  ]);
72
- return O(() => (h && (v.current = requestAnimationFrame(c)), () => {
72
+ if (O(() => (h && (v.current = requestAnimationFrame(f)), () => {
73
73
  v.current !== null && cancelAnimationFrame(v.current);
74
- }), [h, c]), O(() => {
74
+ }), [h, f]), O(() => {
75
75
  if (!h) return;
76
76
  const t = (n) => {
77
- m.current && f && !m.current.contains(n.target) && !f.contains(n.target) && g();
77
+ m.current && c && !m.current.contains(n.target) && !c.contains(n.target) && g();
78
78
  }, e = (n) => {
79
79
  n.key === "Escape" && g();
80
80
  };
81
- return document.addEventListener("mousedown", t), document.addEventListener("keydown", e), window.addEventListener("resize", c), window.addEventListener("scroll", c, !0), () => {
82
- document.removeEventListener("mousedown", t), document.removeEventListener("keydown", e), window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0);
81
+ return document.addEventListener("mousedown", t), document.addEventListener("keydown", e), window.addEventListener("resize", f), window.addEventListener("scroll", f, !0), () => {
82
+ document.removeEventListener("mousedown", t), document.removeEventListener("keydown", e), window.removeEventListener("resize", f), window.removeEventListener("scroll", f, !0);
83
83
  };
84
84
  }, [
85
85
  h,
86
86
  g,
87
- f,
88
- c
89
- ]), !h || !f ? null : z(/* @__PURE__ */ M("div", {
87
+ c,
88
+ f
89
+ ]), !h || !c) return null;
90
+ const F = /* @__PURE__ */ z("div", {
90
91
  ref: m,
91
92
  className: `simple-popover simple-popover--${w.placement}`,
92
93
  style: {
@@ -102,8 +103,9 @@ var i = 20, P = 16, C = 8, j = ({ children: y, visible: h, onClose: g, anchorEl:
102
103
  className: "simple-popover__content",
103
104
  children: y
104
105
  })]
105
- }), document.body);
106
+ });
107
+ return C(F, document.body);
106
108
  };
107
109
  export {
108
- j as Popover
110
+ B as Popover
109
111
  };
@@ -0,0 +1 @@
1
+ .ProtectedRoute__loading{min-height:100vh;font-size:var(--font-size-xl);justify-content:center;align-items:center;display:flex}
@@ -0,0 +1,19 @@
1
+ import './ProtectedRoute.css';
2
+ import { Loading as n } from "../Loading/Loading2.js";
3
+ import { useAuth as m } from "../../hooks/useAuth/useAuth.js";
4
+ /* empty css */
5
+ import { Fragment as a, jsx as t } from "react/jsx-runtime";
6
+ import { Navigate as u } from "react-router";
7
+ function g({ children: r, loginPath: o = "/login" }) {
8
+ const { isAuthenticated: e, isLoading: i } = m();
9
+ return i ? /* @__PURE__ */ t("div", {
10
+ className: "ProtectedRoute__loading",
11
+ children: /* @__PURE__ */ t(n, {})
12
+ }) : e ? /* @__PURE__ */ t(a, { children: r }) : /* @__PURE__ */ t(u, {
13
+ to: o,
14
+ replace: !0
15
+ });
16
+ }
17
+ export {
18
+ g as ProtectedRoute
19
+ };
@@ -1,9 +1,9 @@
1
1
  import './RangeSlider.css';
2
2
  /* empty css */
3
- import { useCallback as a, useMemo as J, useRef as L } from "react";
3
+ import { useCallback as a, useMemo as O, useRef as L } from "react";
4
4
  import { jsx as p, jsxs as g } from "react/jsx-runtime";
5
- var O = (n) => !Number.isFinite(n) || n >= 1 ? 0 : String(n).split(".")[1]?.length ?? 0, Y = ({ disabled: n = !1, formatValue: M, label: N, max: i = 100, min: o = 0, minDistance: q, onChange: h, onChangeEnd: d, showValues: R = !0, step: c = 1, thin: v = !1, tickStep: w = 0, value: D, variant: z = "accent" }) => {
6
- const U = L(null), P = L(null), b = Math.max(1, i - o), T = q ?? c, f = O(c), [l, s] = D, _ = a((r) => M ? M(r) : f > 0 ? r.toFixed(f) : String(r), [f, M]), y = a((r) => {
5
+ var Q = (n) => !Number.isFinite(n) || n >= 1 ? 0 : String(n).split(".")[1]?.length ?? 0, Z = ({ disabled: n = !1, formatValue: M, label: N, max: i = 100, min: o = 0, minDistance: q, onChange: h, onChangeEnd: d, showValues: R = !0, step: c = 1, thin: v = !1, tickStep: w = 0, value: D, variant: z = "accent" }) => {
6
+ const U = L(null), P = L(null), b = Math.max(1, i - o), T = q ?? c, f = Q(c), [s, l] = D, _ = a((r) => M ? M(r) : f > 0 ? r.toFixed(f) : String(r), [f, M]), y = a((r) => {
7
7
  const e = c > 0 ? o + Math.round((r - o) / c) * c : r, t = Math.min(i, Math.max(o, e));
8
8
  return f > 0 ? Number(t.toFixed(f)) : t;
9
9
  }, [
@@ -13,12 +13,12 @@ var O = (n) => !Number.isFinite(n) || n >= 1 ? 0 : String(n).split(".")[1]?.leng
13
13
  c
14
14
  ]), m = a((r, e) => {
15
15
  const t = y(e);
16
- return r === "lower" ? [Math.min(t, s - T), s] : [l, Math.max(t, l + T)];
16
+ return r === "lower" ? [Math.min(t, l - T), l] : [s, Math.max(t, s + T)];
17
17
  }, [
18
18
  T,
19
- l,
19
+ s,
20
20
  y,
21
- s
21
+ l
22
22
  ]), k = a((r) => {
23
23
  const e = U.current;
24
24
  if (!e) return null;
@@ -42,19 +42,19 @@ var O = (n) => !Number.isFinite(n) || n >= 1 ? 0 : String(n).split(".")[1]?.leng
42
42
  if (n) return;
43
43
  const e = k(r.clientX);
44
44
  if (e === null) return;
45
- const t = Math.abs(e - l) <= Math.abs(e - s) ? "lower" : "upper", u = m(t, e);
45
+ const t = Math.abs(e - s) <= Math.abs(e - l) ? "lower" : "upper", u = m(t, e);
46
46
  h(u), d?.(u);
47
47
  }, [
48
48
  m,
49
49
  n,
50
- l,
50
+ s,
51
51
  h,
52
52
  d,
53
- s,
53
+ l,
54
54
  k
55
55
  ]), K = a((r, e) => {
56
56
  if (n) return;
57
- const t = e === "lower" ? l : s, u = c > 0 ? c : 1, X = r.key === "ArrowLeft" || r.key === "ArrowDown" ? t - u : r.key === "ArrowRight" || r.key === "ArrowUp" ? t + u : r.key === "PageDown" ? t - u * 10 : r.key === "PageUp" ? t + u * 10 : r.key === "Home" ? o : r.key === "End" ? i : null;
57
+ const t = e === "lower" ? s : l, u = c > 0 ? c : 1, X = r.key === "ArrowLeft" || r.key === "ArrowDown" ? t - u : r.key === "ArrowRight" || r.key === "ArrowUp" ? t + u : r.key === "PageDown" ? t - u * 10 : r.key === "PageUp" ? t + u * 10 : r.key === "Home" ? o : r.key === "End" ? i : null;
58
58
  if (X === null) return;
59
59
  r.preventDefault();
60
60
  const H = m(e, X);
@@ -62,14 +62,14 @@ var O = (n) => !Number.isFinite(n) || n >= 1 ? 0 : String(n).split(".")[1]?.leng
62
62
  }, [
63
63
  m,
64
64
  n,
65
- l,
65
+ s,
66
66
  i,
67
67
  o,
68
68
  h,
69
69
  d,
70
70
  c,
71
- s
72
- ]), B = J(() => {
71
+ l
72
+ ]), B = O(() => {
73
73
  if (!w || w <= 0) return [];
74
74
  const r = [];
75
75
  for (let e = o; e <= i; e += w) r.push(y(e));
@@ -79,14 +79,14 @@ var O = (n) => !Number.isFinite(n) || n >= 1 ? 0 : String(n).split(".")[1]?.leng
79
79
  o,
80
80
  y,
81
81
  w
82
- ]), $ = (r) => (Math.min(i, Math.max(o, r)) - o) / b * 100, x = $(l), I = $(s);
82
+ ]), $ = (r) => (Math.min(i, Math.max(o, r)) - o) / b * 100, x = $(s), I = $(l), J = [
83
+ "range-slider",
84
+ `range-slider--${z}`,
85
+ v ? "range-slider--thin" : "",
86
+ n ? "range-slider--disabled" : ""
87
+ ].filter(Boolean).join(" ");
83
88
  return /* @__PURE__ */ g("div", {
84
- className: [
85
- "range-slider",
86
- `range-slider--${z}`,
87
- v ? "range-slider--thin" : "",
88
- n ? "range-slider--disabled" : ""
89
- ].filter(Boolean).join(" "),
89
+ className: J,
90
90
  children: [
91
91
  (N || R) && /* @__PURE__ */ g("div", {
92
92
  className: "range-slider__header",
@@ -96,9 +96,9 @@ var O = (n) => !Number.isFinite(n) || n >= 1 ? 0 : String(n).split(".")[1]?.leng
96
96
  }), R && /* @__PURE__ */ g("span", {
97
97
  className: "range-slider__readout",
98
98
  children: [
99
- _(l),
99
+ _(s),
100
100
  " – ",
101
- _(s)
101
+ _(l)
102
102
  ]
103
103
  })]
104
104
  }),
@@ -122,7 +122,7 @@ var O = (n) => !Number.isFinite(n) || n >= 1 ? 0 : String(n).split(".")[1]?.leng
122
122
  onPointerMove: F,
123
123
  onPointerUp: j,
124
124
  style: { left: `${x}%` },
125
- title: _(l),
125
+ title: _(s),
126
126
  type: "button"
127
127
  }),
128
128
  /* @__PURE__ */ p("button", {
@@ -133,7 +133,7 @@ var O = (n) => !Number.isFinite(n) || n >= 1 ? 0 : String(n).split(".")[1]?.leng
133
133
  onPointerMove: F,
134
134
  onPointerUp: j,
135
135
  style: { left: `${I}%` },
136
- title: _(s),
136
+ title: _(l),
137
137
  type: "button"
138
138
  })
139
139
  ]
@@ -153,5 +153,5 @@ var O = (n) => !Number.isFinite(n) || n >= 1 ? 0 : String(n).split(".")[1]?.leng
153
153
  });
154
154
  };
155
155
  export {
156
- Y as RangeSlider
156
+ Z as RangeSlider
157
157
  };
@@ -1,12 +1,12 @@
1
- import { useId as u } from "react";
1
+ import { useId as x } from "react";
2
2
  import { jsx as r, jsxs as c } from "react/jsx-runtime";
3
- var p = {
3
+ var u = {
4
4
  success: "var(--rating-color-success)",
5
5
  info: "var(--rating-color-info)",
6
6
  warning: "var(--rating-color-warning)",
7
7
  danger: "var(--rating-color-danger)"
8
- }, m = 7.5, M = 16.5, e = 15.5, w = -4, O = 4.5, $ = ({ type: i, filled: l, variant: v, size: t = 16, mood: f = 1 }) => {
9
- const h = `rating-grad-${u()}`, g = p[v], d = "var(--rating-empty-color)", a = l === "full" ? g : l === "half" ? `url(#${h})` : d, s = () => l === "half" ? /* @__PURE__ */ r("defs", { children: /* @__PURE__ */ c("linearGradient", {
8
+ }, p = 7.5, m = 16.5, e = 15.5, M = -4, T = ({ type: i, filled: l, variant: w, size: t = 16, mood: v = 1 }) => {
9
+ const h = `rating-grad-${x()}`, g = u[w], d = "var(--rating-empty-color)", a = l === "full" ? g : l === "half" ? `url(#${h})` : d, s = () => l === "half" ? /* @__PURE__ */ r("defs", { children: /* @__PURE__ */ c("linearGradient", {
10
10
  id: h,
11
11
  x1: "0",
12
12
  x2: "1",
@@ -43,7 +43,7 @@ var p = {
43
43
  })]
44
44
  });
45
45
  if (i === "emoji") {
46
- const n = e + (w + (O - w) * Math.min(1, Math.max(0, f))), o = "var(--card-background-color)";
46
+ const n = e + (M + 8.5 * Math.min(1, Math.max(0, v))), o = "var(--card-background-color)";
47
47
  return /* @__PURE__ */ c("svg", {
48
48
  width: t,
49
49
  height: t,
@@ -69,7 +69,7 @@ var p = {
69
69
  fill: o
70
70
  }),
71
71
  /* @__PURE__ */ r("path", {
72
- d: `M ${m} ${e} Q 12 ${n} ${M} ${e}`,
72
+ d: `M ${p} ${e} Q 12 ${n} ${m} ${e}`,
73
73
  fill: "none",
74
74
  stroke: o,
75
75
  strokeWidth: "1.6",
@@ -79,7 +79,7 @@ var p = {
79
79
  });
80
80
  }
81
81
  if (i === "bar") {
82
- const n = Math.round(t * 1.75), o = Math.round(t * 0.5625), x = o / 2;
82
+ const n = Math.round(t * 1.75), o = Math.round(t * 0.5625), f = o / 2;
83
83
  return /* @__PURE__ */ c("svg", {
84
84
  width: n,
85
85
  height: o,
@@ -90,7 +90,7 @@ var p = {
90
90
  y: "0",
91
91
  width: n,
92
92
  height: o,
93
- rx: x,
93
+ rx: f,
94
94
  fill: a
95
95
  })]
96
96
  });
@@ -98,5 +98,5 @@ var p = {
98
98
  return null;
99
99
  };
100
100
  export {
101
- $ as RatingIcon
101
+ T as RatingIcon
102
102
  };
@@ -34,12 +34,13 @@ var h = ({ editorRef: m, snapshotForUndo: d, emitChange: g }) => {
34
34
  } else {
35
35
  d();
36
36
  const e = window.getSelection();
37
- if (s.current && (e?.removeAllRanges(), e?.addRange(s.current)), t) if (o && e?.toString() === "") document.execCommand("insertHTML", !1, `<a href="${t}" target="_blank" rel="noopener noreferrer">${o}</a>`);
38
- else {
39
- document.execCommand("createLink", !1, t);
40
- const l = e?.anchorNode?.parentElement?.closest("a");
41
- l && (l.setAttribute("target", "_blank"), l.setAttribute("rel", "noopener noreferrer"));
42
- }
37
+ if (s.current && (e?.removeAllRanges(), e?.addRange(s.current)), t)
38
+ if (o && e?.toString() === "") document.execCommand("insertHTML", !1, `<a href="${t}" target="_blank" rel="noopener noreferrer">${o}</a>`);
39
+ else {
40
+ document.execCommand("createLink", !1, t);
41
+ const l = e?.anchorNode?.parentElement?.closest("a");
42
+ l && (l.setAttribute("target", "_blank"), l.setAttribute("rel", "noopener noreferrer"));
43
+ }
43
44
  s.current = null;
44
45
  }
45
46
  u(!1), i(""), c(""), g();
@@ -1,8 +1,8 @@
1
1
  import './RollingNumber.css';
2
2
  /* empty css */
3
- import { useEffect as f, useRef as R, useState as $ } from "react";
4
- import { jsx as e, jsxs as w } from "react/jsx-runtime";
5
- var B = [
3
+ import { useEffect as f, useRef as B, useState as $ } from "react";
4
+ import { jsx as e, jsxs as F } from "react/jsx-runtime";
5
+ var I = [
6
6
  "0",
7
7
  "1",
8
8
  "2",
@@ -13,51 +13,53 @@ var B = [
13
13
  "7",
14
14
  "8",
15
15
  "9"
16
- ], F = (l, m, s, c) => {
17
- const u = l < 0, [i, r] = Math.abs(l).toFixed(m).split("."), t = s ? i.replace(/\B(?=(\d{3})+(?!\d))/g, s) : i, o = r ? `${t}${c}${r}` : t;
16
+ ], S = (s, c, l, m) => {
17
+ const u = s < 0, [t, r] = Math.abs(s).toFixed(c).split("."), i = l ? t.replace(/\B(?=(\d{3})+(?!\d))/g, l) : t, o = r ? `${i}${m}${r}` : i;
18
18
  return u ? `-${o}` : o;
19
- }, G = ({ className: l = "", colorByDirection: m = !1, decimals: s = 0, decimalSeparator: c = ".", duration: u = 600, groupSeparator: i = ",", prefix: r, size: t = "xl", stagger: o = 40, suffix: b, value: n, variant: h = "default" }) => {
20
- const d = R(n), [N, x] = $("none"), [j, y] = $(!1);
19
+ }, H = ({ className: s = "", colorByDirection: c = !1, decimals: l = 0, decimalSeparator: m = ".", duration: u = 600, groupSeparator: t = ",", prefix: r, size: i = "xl", stagger: o = 40, suffix: b, value: n, variant: h = "default" }) => {
20
+ const d = B(n), [N, x] = $("none"), [y, j] = $(!1);
21
21
  f(() => {
22
- y(!0);
22
+ j(!0);
23
23
  }, []), f(() => {
24
24
  n !== d.current && (x(n > d.current ? "up" : "down"), d.current = n);
25
25
  }, [n]);
26
- const p = F(n, s, i, c).split("");
27
- return /* @__PURE__ */ w("span", {
28
- className: [
29
- "rolling-number",
30
- `rolling-number--${t}`,
31
- m ? `rolling-number--direction-${N}` : `rolling-number--${h}`,
32
- j ? "rolling-number--animated" : "",
33
- l
34
- ].filter(Boolean).join(" "),
26
+ const g = S(n, l, t, m).split(""), D = [
27
+ "rolling-number",
28
+ `rolling-number--${i}`,
29
+ c ? `rolling-number--direction-${N}` : `rolling-number--${h}`,
30
+ y ? "rolling-number--animated" : "",
31
+ s
32
+ ].filter(Boolean).join(" ");
33
+ return /* @__PURE__ */ F("span", {
34
+ className: D,
35
35
  style: { "--_roll-duration": `${u}ms` },
36
- title: p.join(""),
36
+ title: g.join(""),
37
37
  children: [
38
38
  r && /* @__PURE__ */ e("span", {
39
39
  className: "rolling-number__affix",
40
40
  children: r
41
41
  }),
42
- p.map((a, D) => {
43
- const M = a >= "0" && a <= "9", g = p.length - 1 - D;
44
- return M ? /* @__PURE__ */ e("span", {
42
+ g.map((a, M) => {
43
+ const R = a >= "0" && a <= "9", p = g.length - 1 - M;
44
+ if (!R) return /* @__PURE__ */ e("span", {
45
+ className: "rolling-number__separator",
46
+ children: a
47
+ }, `sep-${p}`);
48
+ const w = {
49
+ "--_roll-delay": `${p * o}ms`,
50
+ "--_roll-digit": Number(a)
51
+ };
52
+ return /* @__PURE__ */ e("span", {
45
53
  className: "rolling-number__digit",
46
54
  children: /* @__PURE__ */ e("span", {
47
55
  className: "rolling-number__strip",
48
- style: {
49
- "--_roll-delay": `${g * o}ms`,
50
- "--_roll-digit": Number(a)
51
- },
52
- children: B.map((_) => /* @__PURE__ */ e("span", {
56
+ style: w,
57
+ children: I.map((_) => /* @__PURE__ */ e("span", {
53
58
  className: "rolling-number__cell",
54
59
  children: _
55
60
  }, _))
56
61
  })
57
- }, `digit-${g}`) : /* @__PURE__ */ e("span", {
58
- className: "rolling-number__separator",
59
- children: a
60
- }, `sep-${g}`);
62
+ }, `digit-${p}`);
61
63
  }),
62
64
  b && /* @__PURE__ */ e("span", {
63
65
  className: "rolling-number__affix",
@@ -67,5 +69,5 @@ var B = [
67
69
  });
68
70
  };
69
71
  export {
70
- G as RollingNumber
72
+ H as RollingNumber
71
73
  };
@@ -1,11 +1,11 @@
1
1
  import './Separator.css';
2
2
  /* empty css */
3
3
  import "react";
4
- import { jsx as a, jsxs as n } from "react/jsx-runtime";
5
- var x = ({ orientation: e = "horizontal", style: l = "solid", thickness: p = 1, spacing: r = 16, label: s, labelAlign: i = "center", className: m = "" }) => {
6
- const o = `separator separator--${e} separator--${l} ${m}`, t = {
4
+ import { jsx as a, jsxs as $ } from "react/jsx-runtime";
5
+ var _ = ({ orientation: s = "horizontal", style: l = "solid", thickness: p = 1, spacing: r = 16, label: t, labelAlign: i = "center", className: m = "" }) => {
6
+ const o = `separator separator--${s} separator--${l} ${m}`, e = {
7
7
  borderWidth: `${p}px`,
8
- ...e === "horizontal" ? {
8
+ ...s === "horizontal" ? {
9
9
  marginTop: `${r}px`,
10
10
  marginBottom: `${r}px`
11
11
  } : {
@@ -13,27 +13,31 @@ var x = ({ orientation: e = "horizontal", style: l = "solid", thickness: p = 1,
13
13
  marginRight: `${r}px`
14
14
  }
15
15
  };
16
- return s && e === "horizontal" ? /* @__PURE__ */ n("div", {
17
- className: `${o} separator--with-label ${`separator--align-${i}`}`,
18
- children: [
19
- /* @__PURE__ */ a("div", {
20
- className: "separator__line",
21
- style: t
22
- }),
23
- /* @__PURE__ */ a("span", {
24
- className: "separator__label",
25
- children: s
26
- }),
27
- /* @__PURE__ */ a("div", {
28
- className: "separator__line",
29
- style: t
30
- })
31
- ]
32
- }) : /* @__PURE__ */ a("div", {
16
+ if (t && s === "horizontal") {
17
+ const n = `separator--align-${i}`;
18
+ return /* @__PURE__ */ $("div", {
19
+ className: `${o} separator--with-label ${n}`,
20
+ children: [
21
+ /* @__PURE__ */ a("div", {
22
+ className: "separator__line",
23
+ style: e
24
+ }),
25
+ /* @__PURE__ */ a("span", {
26
+ className: "separator__label",
27
+ children: t
28
+ }),
29
+ /* @__PURE__ */ a("div", {
30
+ className: "separator__line",
31
+ style: e
32
+ })
33
+ ]
34
+ });
35
+ }
36
+ return /* @__PURE__ */ a("div", {
33
37
  className: o,
34
- style: t
38
+ style: e
35
39
  });
36
40
  };
37
41
  export {
38
- x as Separator
42
+ _ as Separator
39
43
  };
@@ -1,7 +1,7 @@
1
1
  import './Skeleton.css';
2
2
  /* empty css */
3
3
  import "react";
4
- import { Fragment as b, jsx as o } from "react/jsx-runtime";
4
+ import { Fragment as k, jsx as o } from "react/jsx-runtime";
5
5
  var y = ({ variant: a = "text", animation: n = "pulse", width: r, height: s, borderRadius: t, count: c = 1, className: p = "" }) => {
6
6
  const i = () => {
7
7
  const e = {};
@@ -18,7 +18,6 @@ var y = ({ variant: a = "text", animation: n = "pulse", width: r, height: s, bor
18
18
  break;
19
19
  case "rounded":
20
20
  e.height = "40px";
21
- break;
22
21
  }
23
22
  if (t !== void 0) e.borderRadius = typeof t == "number" ? `${t}px` : t;
24
23
  else switch (a) {
@@ -33,17 +32,16 @@ var y = ({ variant: a = "text", animation: n = "pulse", width: r, height: s, bor
33
32
  break;
34
33
  case "rounded":
35
34
  e.borderRadius = "8px";
36
- break;
37
35
  }
38
36
  return e;
39
- }, k = `skeleton skeleton--${a} skeleton--${n} ${p}`, m = i(), l = Array.from({ length: c }, (e, u) => /* @__PURE__ */ o("div", {
40
- className: k,
41
- style: m
42
- }, u));
37
+ }, m = `skeleton skeleton--${a} skeleton--${n} ${p}`, u = i(), l = Array.from({ length: c }, (e, x) => /* @__PURE__ */ o("div", {
38
+ className: m,
39
+ style: u
40
+ }, x));
43
41
  return c > 1 ? /* @__PURE__ */ o("div", {
44
42
  className: "skeleton-group",
45
43
  children: l
46
- }) : /* @__PURE__ */ o(b, { children: l });
44
+ }) : /* @__PURE__ */ o(k, { children: l });
47
45
  };
48
46
  export {
49
47
  y as Skeleton