@chainberry/ui-components 1.0.19 → 1.0.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.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +97 -95
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9,11 +9,11 @@ import { HugeiconsIcon as x, HugeiconsIcon as S } from "@hugeicons/react";
|
|
|
9
9
|
import * as C from "@radix-ui/react-checkbox";
|
|
10
10
|
import * as w from "@radix-ui/react-dialog";
|
|
11
11
|
import * as T from "@radix-ui/react-dropdown-menu";
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
15
|
-
import * as
|
|
16
|
-
import { addDays as
|
|
12
|
+
import * as E from "@radix-ui/react-label";
|
|
13
|
+
import * as ee from "@radix-ui/react-popover";
|
|
14
|
+
import * as te from "@radix-ui/react-radio-group";
|
|
15
|
+
import * as D from "@radix-ui/react-tooltip";
|
|
16
|
+
import { addDays as ne, addMonths as re, differenceInCalendarDays as ie, eachDayOfInterval as O, endOfMonth as ae, endOfWeek as oe, format as k, max as se, min as ce, parseISO as le, startOfMonth as ue, startOfWeek as de, subDays as fe, subMonths as pe, subWeeks as me } from "date-fns";
|
|
17
17
|
import he from "qrcode";
|
|
18
18
|
//#region \0rolldown/runtime.js
|
|
19
19
|
var ge = Object.defineProperty, A = (e, t) => {
|
|
@@ -155742,7 +155742,7 @@ function K5({ className: e, type: t, ...n }) {
|
|
|
155742
155742
|
//#endregion
|
|
155743
155743
|
//#region ../../react-app/src/components/ui/label.tsx
|
|
155744
155744
|
function q5({ className: e, ...t }) {
|
|
155745
|
-
return /* @__PURE__ */ _(
|
|
155745
|
+
return /* @__PURE__ */ _(E.Root, {
|
|
155746
155746
|
"data-slot": "label",
|
|
155747
155747
|
className: j("flex items-center gap-2 text-sm text-foreground select-none", "peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
|
|
155748
155748
|
...t
|
|
@@ -155857,27 +155857,27 @@ function xBe({ className: e, ...t }) {
|
|
|
155857
155857
|
//#endregion
|
|
155858
155858
|
//#region ../../react-app/src/components/ui/popover.tsx
|
|
155859
155859
|
function Z5(e) {
|
|
155860
|
-
return /* @__PURE__ */ _(
|
|
155860
|
+
return /* @__PURE__ */ _(ee.Root, {
|
|
155861
155861
|
"data-slot": "popover",
|
|
155862
155862
|
...e
|
|
155863
155863
|
});
|
|
155864
155864
|
}
|
|
155865
155865
|
function Q5(e) {
|
|
155866
|
-
return /* @__PURE__ */ _(
|
|
155866
|
+
return /* @__PURE__ */ _(ee.Trigger, {
|
|
155867
155867
|
"data-slot": "popover-trigger",
|
|
155868
155868
|
...e
|
|
155869
155869
|
});
|
|
155870
155870
|
}
|
|
155871
155871
|
function SBe(e) {
|
|
155872
|
-
return /* @__PURE__ */ _(
|
|
155872
|
+
return /* @__PURE__ */ _(ee.Anchor, {
|
|
155873
155873
|
"data-slot": "popover-anchor",
|
|
155874
155874
|
...e
|
|
155875
155875
|
});
|
|
155876
155876
|
}
|
|
155877
155877
|
function $5({ className: e, align: t = "center", sideOffset: n = 8, ...r }) {
|
|
155878
|
-
return /* @__PURE__ */ _(
|
|
155878
|
+
return /* @__PURE__ */ _(ee.Portal, { children: /* @__PURE__ */ _("div", {
|
|
155879
155879
|
className: _e,
|
|
155880
|
-
children: /* @__PURE__ */ _(
|
|
155880
|
+
children: /* @__PURE__ */ _(ee.Content, {
|
|
155881
155881
|
"data-slot": "popover-content",
|
|
155882
155882
|
align: t,
|
|
155883
155883
|
sideOffset: n,
|
|
@@ -155889,18 +155889,18 @@ function $5({ className: e, align: t = "center", sideOffset: n = 8, ...r }) {
|
|
|
155889
155889
|
//#endregion
|
|
155890
155890
|
//#region ../../react-app/src/components/ui/radio-group.tsx
|
|
155891
155891
|
function CBe({ className: e, ...t }) {
|
|
155892
|
-
return /* @__PURE__ */ _(
|
|
155892
|
+
return /* @__PURE__ */ _(te.Root, {
|
|
155893
155893
|
"data-slot": "radio-group",
|
|
155894
155894
|
className: j("grid gap-2", e),
|
|
155895
155895
|
...t
|
|
155896
155896
|
});
|
|
155897
155897
|
}
|
|
155898
155898
|
function e7({ className: e, ...t }) {
|
|
155899
|
-
return /* @__PURE__ */ _(
|
|
155899
|
+
return /* @__PURE__ */ _(te.Item, {
|
|
155900
155900
|
"data-slot": "radio-group-item",
|
|
155901
155901
|
className: j("aspect-square size-4 shrink-0 rounded-full border border-slate-300 bg-background shadow-xs outline-none transition-colors", "focus-visible:ring-2 focus-visible:ring-primary/30 data-[state=checked]:border-primary", "disabled:cursor-not-allowed disabled:opacity-50", e),
|
|
155902
155902
|
...t,
|
|
155903
|
-
children: /* @__PURE__ */ _(
|
|
155903
|
+
children: /* @__PURE__ */ _(te.Indicator, {
|
|
155904
155904
|
className: "flex items-center justify-center",
|
|
155905
155905
|
children: /* @__PURE__ */ _("span", { className: "size-2 rounded-full bg-primary" })
|
|
155906
155906
|
})
|
|
@@ -156203,33 +156203,33 @@ function h7({ className: e, ...t }) {
|
|
|
156203
156203
|
//#endregion
|
|
156204
156204
|
//#region ../../react-app/src/components/ui/tooltip.tsx
|
|
156205
156205
|
function NBe({ delayDuration: e = 200, ...t }) {
|
|
156206
|
-
return /* @__PURE__ */ _(
|
|
156206
|
+
return /* @__PURE__ */ _(D.Provider, {
|
|
156207
156207
|
"data-slot": "tooltip-provider",
|
|
156208
156208
|
delayDuration: e,
|
|
156209
156209
|
...t
|
|
156210
156210
|
});
|
|
156211
156211
|
}
|
|
156212
156212
|
function g7(e) {
|
|
156213
|
-
return /* @__PURE__ */ _(NBe, { children: /* @__PURE__ */ _(
|
|
156213
|
+
return /* @__PURE__ */ _(NBe, { children: /* @__PURE__ */ _(D.Root, {
|
|
156214
156214
|
"data-slot": "tooltip",
|
|
156215
156215
|
...e
|
|
156216
156216
|
}) });
|
|
156217
156217
|
}
|
|
156218
156218
|
function _7(e) {
|
|
156219
|
-
return /* @__PURE__ */ _(
|
|
156219
|
+
return /* @__PURE__ */ _(D.Trigger, {
|
|
156220
156220
|
"data-slot": "tooltip-trigger",
|
|
156221
156221
|
...e
|
|
156222
156222
|
});
|
|
156223
156223
|
}
|
|
156224
156224
|
function v7({ className: e, sideOffset: t = 6, children: n, ...r }) {
|
|
156225
|
-
return /* @__PURE__ */ _(
|
|
156225
|
+
return /* @__PURE__ */ _(D.Portal, { children: /* @__PURE__ */ _("div", {
|
|
156226
156226
|
className: _e,
|
|
156227
|
-
children: /* @__PURE__ */ v(
|
|
156227
|
+
children: /* @__PURE__ */ v(D.Content, {
|
|
156228
156228
|
"data-slot": "tooltip-content",
|
|
156229
156229
|
sideOffset: t,
|
|
156230
156230
|
className: j("z-50 rounded-md bg-slate-900 px-2 py-1 text-xs font-medium text-white shadow-md dark:bg-slate-700", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95", e),
|
|
156231
156231
|
...r,
|
|
156232
|
-
children: [n, /* @__PURE__ */ _(
|
|
156232
|
+
children: [n, /* @__PURE__ */ _(D.Arrow, { className: "fill-slate-900 dark:fill-slate-700" })]
|
|
156233
156233
|
})
|
|
156234
156234
|
}) });
|
|
156235
156235
|
}
|
|
@@ -156722,7 +156722,7 @@ function tVe() {
|
|
|
156722
156722
|
};
|
|
156723
156723
|
}
|
|
156724
156724
|
function C7({ name: e = "Ivan Krstić", avatarSrc: t, navMode: n = "primary", onNavModeChange: r, headerMode: i = "v2", onHeaderModeChange: a, onAccount: o, onLogout: s, onTakeTour: c, onResetDemo: l, collapsed: u = !1, side: f = "bottom", align: p = "end", fullWidth: m = !1 }) {
|
|
156725
|
-
let { dark: h, setTheme: y } = eVe(), { navStyle: b, toggleNavStyle: x } = tVe(), [C, w] = d("en"), [T,
|
|
156725
|
+
let { dark: h, setTheme: y } = eVe(), { navStyle: b, toggleNavStyle: x } = tVe(), [C, w] = d("en"), [T, E] = d("admin"), ee = QBe.find((e) => e.code === C)?.label ?? "English", te = $Be.find((e) => e.id === T)?.label ?? "Admin", D = (e) => /* @__PURE__ */ _(S, {
|
|
156726
156726
|
icon: e,
|
|
156727
156727
|
size: 16,
|
|
156728
156728
|
strokeWidth: 2,
|
|
@@ -156755,10 +156755,10 @@ function C7({ name: e = "Ivan Krstić", avatarSrc: t, navMode: n = "primary", on
|
|
|
156755
156755
|
children: [
|
|
156756
156756
|
/* @__PURE__ */ v(B5, {
|
|
156757
156757
|
onSelect: () => o?.(),
|
|
156758
|
-
children: [
|
|
156758
|
+
children: [D(x8), "Account information"]
|
|
156759
156759
|
}),
|
|
156760
156760
|
/* @__PURE__ */ v(H5, { children: [/* @__PURE__ */ v(U5, { children: [
|
|
156761
|
-
|
|
156761
|
+
D(h ? sX : P4),
|
|
156762
156762
|
"Theme: ",
|
|
156763
156763
|
h ? "Dark mode" : "Light mode"
|
|
156764
156764
|
] }), /* @__PURE__ */ _(W5, { children: /* @__PURE__ */ v(G5, {
|
|
@@ -156773,9 +156773,9 @@ function C7({ name: e = "Ivan Krstić", avatarSrc: t, navMode: n = "primary", on
|
|
|
156773
156773
|
})]
|
|
156774
156774
|
}) })] }),
|
|
156775
156775
|
/* @__PURE__ */ v(H5, { children: [/* @__PURE__ */ v(U5, { children: [
|
|
156776
|
-
|
|
156776
|
+
D(aM),
|
|
156777
156777
|
"Language: ",
|
|
156778
|
-
|
|
156778
|
+
ee
|
|
156779
156779
|
] }), /* @__PURE__ */ _(W5, { children: /* @__PURE__ */ _(G5, {
|
|
156780
156780
|
value: C,
|
|
156781
156781
|
onValueChange: w,
|
|
@@ -156786,11 +156786,11 @@ function C7({ name: e = "Ivan Krstić", avatarSrc: t, navMode: n = "primary", on
|
|
|
156786
156786
|
}) })] }),
|
|
156787
156787
|
/* @__PURE__ */ v(B5, {
|
|
156788
156788
|
onSelect: () => c?.(),
|
|
156789
|
-
children: [
|
|
156789
|
+
children: [D(M8), "Take the tour"]
|
|
156790
156790
|
}),
|
|
156791
156791
|
/* @__PURE__ */ _(V5, {}),
|
|
156792
156792
|
/* @__PURE__ */ v(H5, { children: [/* @__PURE__ */ v(U5, { children: [
|
|
156793
|
-
|
|
156793
|
+
D(c2),
|
|
156794
156794
|
"Navigation mode: ",
|
|
156795
156795
|
n === "full" ? "Full" : "MVP"
|
|
156796
156796
|
] }), /* @__PURE__ */ _(W5, { children: /* @__PURE__ */ v(G5, {
|
|
@@ -156809,13 +156809,13 @@ function C7({ name: e = "Ivan Krstić", avatarSrc: t, navMode: n = "primary", on
|
|
|
156809
156809
|
e.preventDefault(), x();
|
|
156810
156810
|
},
|
|
156811
156811
|
children: [
|
|
156812
|
-
|
|
156812
|
+
D(Eg),
|
|
156813
156813
|
"Nav bar style: ",
|
|
156814
156814
|
b === "classic" ? "Classic" : "New"
|
|
156815
156815
|
]
|
|
156816
156816
|
}),
|
|
156817
156817
|
a && /* @__PURE__ */ v(H5, { children: [/* @__PURE__ */ v(U5, { children: [
|
|
156818
|
-
|
|
156818
|
+
D(g0),
|
|
156819
156819
|
"Header: ",
|
|
156820
156820
|
i === "v1" ? "No search" : "Search"
|
|
156821
156821
|
] }), /* @__PURE__ */ _(W5, { children: /* @__PURE__ */ v(G5, {
|
|
@@ -156829,12 +156829,12 @@ function C7({ name: e = "Ivan Krstić", avatarSrc: t, navMode: n = "primary", on
|
|
|
156829
156829
|
children: "Version 2 · search"
|
|
156830
156830
|
})]
|
|
156831
156831
|
}) })] }),
|
|
156832
|
-
/* @__PURE__ */ v(H5, { children: [/* @__PURE__ */ v(U5, { children: [
|
|
156832
|
+
/* @__PURE__ */ v(H5, { children: [/* @__PURE__ */ v(U5, { children: [D(P8), /* @__PURE__ */ v("span", {
|
|
156833
156833
|
className: "min-w-0 flex-1 truncate",
|
|
156834
|
-
children: ["View as: ",
|
|
156834
|
+
children: ["View as: ", te]
|
|
156835
156835
|
})] }), /* @__PURE__ */ _(W5, { children: /* @__PURE__ */ _(G5, {
|
|
156836
156836
|
value: T,
|
|
156837
|
-
onValueChange:
|
|
156837
|
+
onValueChange: E,
|
|
156838
156838
|
children: $Be.map((e) => /* @__PURE__ */ _(z, {
|
|
156839
156839
|
value: e.id,
|
|
156840
156840
|
children: e.label
|
|
@@ -156842,12 +156842,12 @@ function C7({ name: e = "Ivan Krstić", avatarSrc: t, navMode: n = "primary", on
|
|
|
156842
156842
|
}) })] }),
|
|
156843
156843
|
/* @__PURE__ */ v(B5, {
|
|
156844
156844
|
onSelect: () => l?.(),
|
|
156845
|
-
children: [
|
|
156845
|
+
children: [D(T1), "Reset demo"]
|
|
156846
156846
|
}),
|
|
156847
156847
|
/* @__PURE__ */ _(V5, {}),
|
|
156848
156848
|
/* @__PURE__ */ v(B5, {
|
|
156849
156849
|
onSelect: () => s?.(),
|
|
156850
|
-
children: [
|
|
156850
|
+
children: [D(vW), "Logout"]
|
|
156851
156851
|
})
|
|
156852
156852
|
]
|
|
156853
156853
|
})] });
|
|
@@ -157731,7 +157731,7 @@ function yVe(e, t) {
|
|
|
157731
157731
|
return r;
|
|
157732
157732
|
}
|
|
157733
157733
|
function P7({ columns: e, data: t, getRowId: n, layout: r = "auto", density: i = "comfortable", pageSize: a, totalItems: o = 0, currentPage: s = 0, onPageChange: c, loading: l = !1, skeletonRows: u = 10, columnVisibility: d, onRowClick: f, rowLeading: p, emptyMessage: m = "No results.", toolbarBelow: h, sort: g, onSortChange: y }) {
|
|
157734
|
-
let b = r === "fill", x = i === "compact" ? "py-1.5" : "py-3", S = (e) => g?.id === e && g.dir, C = d ?? Object.fromEntries(e.map((e) => [e.id, !0])), w = (e) => C[e] ?? !0, T = e.filter((e) => w(e.id)),
|
|
157734
|
+
let b = r === "fill", x = i === "compact" ? "py-1.5" : "py-3", S = (e) => g?.id === e && g.dir, C = d ?? Object.fromEntries(e.map((e) => [e.id, !0])), w = (e) => C[e] ?? !0, T = e.filter((e) => w(e.id)), E = a ? Math.max(1, Math.ceil(o / a)) : 1, ee = T.length + +!!p;
|
|
157735
157735
|
return /* @__PURE__ */ v("div", {
|
|
157736
157736
|
className: j("flex flex-col", b && "min-h-0 flex-1"),
|
|
157737
157737
|
children: [
|
|
@@ -157770,7 +157770,7 @@ function P7({ columns: e, data: t, getRowId: n, layout: r = "auto", density: i =
|
|
|
157770
157770
|
}, t)) : t.length === 0 ? /* @__PURE__ */ _(d7, {
|
|
157771
157771
|
className: "border-0 hover:bg-transparent",
|
|
157772
157772
|
children: /* @__PURE__ */ _(W, {
|
|
157773
|
-
colSpan:
|
|
157773
|
+
colSpan: ee,
|
|
157774
157774
|
className: "py-12 text-center text-muted-foreground",
|
|
157775
157775
|
children: m
|
|
157776
157776
|
})
|
|
@@ -157796,13 +157796,13 @@ function P7({ columns: e, data: t, getRowId: n, layout: r = "auto", density: i =
|
|
|
157796
157796
|
disabled: s === 0,
|
|
157797
157797
|
onClick: () => c?.(s - 1)
|
|
157798
157798
|
}) }),
|
|
157799
|
-
yVe(s,
|
|
157799
|
+
yVe(s, E).map((e, t) => e === "ellipsis" ? /* @__PURE__ */ _(Y5, { children: /* @__PURE__ */ _(xBe, {}) }, `ellipsis-${t}`) : /* @__PURE__ */ _(Y5, { children: /* @__PURE__ */ _(X5, {
|
|
157800
157800
|
isActive: e === s,
|
|
157801
157801
|
onClick: () => c?.(e),
|
|
157802
157802
|
children: e + 1
|
|
157803
157803
|
}) }, e)),
|
|
157804
157804
|
/* @__PURE__ */ _(Y5, { children: /* @__PURE__ */ _(bBe, {
|
|
157805
|
-
disabled: s >=
|
|
157805
|
+
disabled: s >= E - 1,
|
|
157806
157806
|
onClick: () => c?.(s + 1)
|
|
157807
157807
|
}) })
|
|
157808
157808
|
] }) })]
|
|
@@ -157923,11 +157923,13 @@ function q({ primary: e, secondary: t, align: n = "start", tabularNums: r = !1,
|
|
|
157923
157923
|
var z7 = {
|
|
157924
157924
|
DEPOSIT: {
|
|
157925
157925
|
label: "Deposit",
|
|
157926
|
-
direction: "in"
|
|
157926
|
+
direction: "in",
|
|
157927
|
+
icon: IY
|
|
157927
157928
|
},
|
|
157928
157929
|
WITHDRAWAL: {
|
|
157929
157930
|
label: "Withdrawal",
|
|
157930
|
-
direction: "out"
|
|
157931
|
+
direction: "out",
|
|
157932
|
+
icon: qY
|
|
157931
157933
|
},
|
|
157932
157934
|
CHECKOUT: {
|
|
157933
157935
|
label: "Checkout",
|
|
@@ -162614,7 +162616,7 @@ var WUe = /* @__PURE__ */ A({
|
|
|
162614
162616
|
let t = pe(e, 1);
|
|
162615
162617
|
return {
|
|
162616
162618
|
from: ue(t),
|
|
162617
|
-
to:
|
|
162619
|
+
to: ae(t)
|
|
162618
162620
|
};
|
|
162619
162621
|
}
|
|
162620
162622
|
},
|
|
@@ -162824,14 +162826,14 @@ function eWe({ value: e, onChange: t, today: n = x9, className: r }) {
|
|
|
162824
162826
|
function o(n) {
|
|
162825
162827
|
if (e.mode === "month") t({
|
|
162826
162828
|
mode: "month",
|
|
162827
|
-
month: n === 1 ?
|
|
162829
|
+
month: n === 1 ? re(e.month, 1) : pe(e.month, 1)
|
|
162828
162830
|
});
|
|
162829
162831
|
else {
|
|
162830
|
-
let r =
|
|
162832
|
+
let r = ie(e.to, e.from) + 1;
|
|
162831
162833
|
t({
|
|
162832
162834
|
mode: "range",
|
|
162833
|
-
from:
|
|
162834
|
-
to:
|
|
162835
|
+
from: ne(e.from, n * r),
|
|
162836
|
+
to: ne(e.to, n * r)
|
|
162835
162837
|
});
|
|
162836
162838
|
}
|
|
162837
162839
|
}
|
|
@@ -163169,7 +163171,7 @@ function gWe(e) {
|
|
|
163169
163171
|
function _We(e) {
|
|
163170
163172
|
return e.mode === "month" ? {
|
|
163171
163173
|
start: ue(e.month),
|
|
163172
|
-
end:
|
|
163174
|
+
end: ae(e.month)
|
|
163173
163175
|
} : {
|
|
163174
163176
|
start: e.from,
|
|
163175
163177
|
end: e.to
|
|
@@ -163242,7 +163244,7 @@ function SWe(e) {
|
|
|
163242
163244
|
}));
|
|
163243
163245
|
}
|
|
163244
163246
|
function CWe(e, t, n) {
|
|
163245
|
-
let r = (e) => n() < e, i =
|
|
163247
|
+
let r = (e) => n() < e, i = O({
|
|
163246
163248
|
start: e,
|
|
163247
163249
|
end: t
|
|
163248
163250
|
}), a = E9(600 + n() * 150);
|
|
@@ -163261,7 +163263,7 @@ function CWe(e, t, n) {
|
|
|
163261
163263
|
}).reverse();
|
|
163262
163264
|
}
|
|
163263
163265
|
function wWe(e, t = "volume") {
|
|
163264
|
-
let { start: n, end: r } = _We(e), i = se([n, pWe]), a = ce([r, mWe]), o = a >= i ?
|
|
163266
|
+
let { start: n, end: r } = _We(e), i = se([n, pWe]), a = ce([r, mWe]), o = a >= i ? ie(a, i) + 1 : 0;
|
|
163265
163267
|
if (o <= 0) return {
|
|
163266
163268
|
isEmpty: !0,
|
|
163267
163269
|
summaries: SWe(t),
|
|
@@ -165371,17 +165373,17 @@ function tGe({ seconds: e, total: t }) {
|
|
|
165371
165373
|
//#region ../../react-app/src/components/convert/ConvertPanel.tsx
|
|
165372
165374
|
var Q9 = 30;
|
|
165373
165375
|
function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
165374
|
-
let [r, i] = d(null), [a, s] = d(""), [c, l] = d(""), [u, f] = d(""), [p, m] = d(""), [h, y] = d(""), [b, x] = d(!1), [C, w] = d(""), [T,
|
|
165376
|
+
let [r, i] = d(null), [a, s] = d(""), [c, l] = d(""), [u, f] = d(""), [p, m] = d(""), [h, y] = d(""), [b, x] = d(!1), [C, w] = d(""), [T, E] = d(!1), [ee, te] = d(1), [D, ne] = d(Q9), [re, ie] = d(0), O = s9.find((e) => e.id === r) ?? null, ae = O != null && a ? l9.find((e) => e.name === O.name && e.coin === a && e.network === c) ?? l9.find((e) => e.name === O.name && e.coin === a) ?? null : null, oe = (u ? l9.find((e) => e.coin === u && e.network === p) ?? l9.find((e) => e.coin === u) : null) ?? null, k = a ? c9.find((e) => e.code === a) ?? null : null, se = c9.find((e) => e.code === u) ?? null, ce = d9(h), le = ae ? d9(ae.amount) : Infinity, ue = ae != null && ce > le, de = h.trim() !== "" && ce > 0, fe = a != null && se != null && u !== a, pe = (k && se ? k.price / se.price : 0) * ee, me = k ? ce * k.price : 0, he = me * o9, ge = ce * pe * (1 - o9), A = O != null && fe && c !== "" && p !== "" && de && !ue, _e = de ? p9(ce) : null, ve = de && fe ? p9(ge) : null, be = a && se ? `1 ${a} = ${p9(pe)} ${u}` : null, xe = de ? `${f9(he)} · ${(o9 * 100).toFixed(1)}%` : null;
|
|
165375
165377
|
o(() => {
|
|
165376
165378
|
if (!A) {
|
|
165377
|
-
|
|
165379
|
+
ne(Q9);
|
|
165378
165380
|
return;
|
|
165379
165381
|
}
|
|
165380
165382
|
let e = Date.now() + Q9 * 1e3;
|
|
165381
|
-
|
|
165383
|
+
ne(Q9), te(1 + (Math.random() - .5) * .012), ie((e) => e + 1);
|
|
165382
165384
|
let t = setInterval(() => {
|
|
165383
165385
|
let t = Math.max(0, Math.ceil((e - Date.now()) / 1e3));
|
|
165384
|
-
|
|
165386
|
+
ne(t), t === 0 && (te(1 + (Math.random() - .5) * .012), ie((e) => e + 1), e = Date.now() + Q9 * 1e3);
|
|
165385
165387
|
}, 250);
|
|
165386
165388
|
return () => clearInterval(t);
|
|
165387
165389
|
}, [
|
|
@@ -165393,20 +165395,20 @@ function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
165393
165395
|
let t = c9.find((t) => t.code === e)?.networks ?? [];
|
|
165394
165396
|
return t.length === 1 ? t[0] : "";
|
|
165395
165397
|
}, Ce = (e) => {
|
|
165396
|
-
i(e),
|
|
165398
|
+
i(e), E(!1);
|
|
165397
165399
|
}, we = (e) => {
|
|
165398
|
-
s(e), l(Se(e)), e === u && (f(""), m("")),
|
|
165400
|
+
s(e), l(Se(e)), e === u && (f(""), m("")), E(!1);
|
|
165399
165401
|
}, Te = (e) => {
|
|
165400
|
-
f(e), m(Se(e)), e === a && (s(""), l("")),
|
|
165402
|
+
f(e), m(Se(e)), e === a && (s(""), l("")), E(!1);
|
|
165401
165403
|
}, Ee = () => {
|
|
165402
|
-
s(u), f(a), l(p), m(c),
|
|
165404
|
+
s(u), f(a), l(p), m(c), E(!1);
|
|
165403
165405
|
}, De = () => {
|
|
165404
|
-
|
|
165406
|
+
ae && y(ae.amount);
|
|
165405
165407
|
}, Oe = (e) => {
|
|
165406
165408
|
let t = e.replace(/[^0-9.,]/g, ""), n = t.indexOf(".");
|
|
165407
165409
|
n !== -1 && (t = t.slice(0, n + 1) + t.slice(n + 1).replace(/\./g, "")), y(t);
|
|
165408
165410
|
}, ke = () => {
|
|
165409
|
-
if (!
|
|
165411
|
+
if (!O || !a || !se || !fe) return;
|
|
165410
165412
|
let n = /* @__PURE__ */ new Date(), r = {
|
|
165411
165413
|
id: `cv-${n.getTime()}`,
|
|
165412
165414
|
date: n.toLocaleDateString("en-US", {
|
|
@@ -165419,7 +165421,7 @@ function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
165419
165421
|
minute: "2-digit"
|
|
165420
165422
|
}),
|
|
165421
165423
|
initiator: e,
|
|
165422
|
-
wallet:
|
|
165424
|
+
wallet: O.name,
|
|
165423
165425
|
fromCoin: a,
|
|
165424
165426
|
toCoin: u,
|
|
165425
165427
|
fromAmount: `-${p9(ce)}`,
|
|
@@ -165428,13 +165430,13 @@ function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
165428
165430
|
fiatValue: f9(me),
|
|
165429
165431
|
status: "PROCESSING"
|
|
165430
165432
|
};
|
|
165431
|
-
t?.(r),
|
|
165433
|
+
t?.(r), E(!0);
|
|
165432
165434
|
}, Ae = (e) => {
|
|
165433
165435
|
if (e) {
|
|
165434
165436
|
x(!0);
|
|
165435
165437
|
return;
|
|
165436
165438
|
}
|
|
165437
|
-
x(!1), w(""), T && (
|
|
165439
|
+
x(!1), w(""), T && (E(!1), y(""));
|
|
165438
165440
|
}, je = (e) => ({
|
|
165439
165441
|
value: e,
|
|
165440
165442
|
label: e,
|
|
@@ -165484,7 +165486,7 @@ function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
165484
165486
|
value: a,
|
|
165485
165487
|
options: Ne,
|
|
165486
165488
|
onChange: we,
|
|
165487
|
-
disabled: !
|
|
165489
|
+
disabled: !O
|
|
165488
165490
|
}), /* @__PURE__ */ _($, {
|
|
165489
165491
|
id: "cv-from-network",
|
|
165490
165492
|
label: "From network",
|
|
@@ -165492,7 +165494,7 @@ function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
165492
165494
|
value: c,
|
|
165493
165495
|
options: Pe,
|
|
165494
165496
|
onChange: l,
|
|
165495
|
-
disabled: !
|
|
165497
|
+
disabled: !O || !a
|
|
165496
165498
|
})]
|
|
165497
165499
|
}),
|
|
165498
165500
|
/* @__PURE__ */ _(Y9, {
|
|
@@ -165500,17 +165502,17 @@ function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
165500
165502
|
value: h,
|
|
165501
165503
|
onChange: Oe,
|
|
165502
165504
|
suffix: a,
|
|
165503
|
-
disabled: !
|
|
165505
|
+
disabled: !O || !a,
|
|
165504
165506
|
invalid: ue,
|
|
165505
165507
|
onMax: De,
|
|
165506
|
-
maxDisabled: !
|
|
165507
|
-
hint:
|
|
165508
|
+
maxDisabled: !ae,
|
|
165509
|
+
hint: O ? a ? ae ? /* @__PURE__ */ v(g, { children: [
|
|
165508
165510
|
"Available:",
|
|
165509
165511
|
" ",
|
|
165510
165512
|
/* @__PURE__ */ v("span", {
|
|
165511
165513
|
className: "font-medium text-foreground",
|
|
165512
165514
|
children: [
|
|
165513
|
-
|
|
165515
|
+
ae.amount,
|
|
165514
165516
|
" ",
|
|
165515
165517
|
a
|
|
165516
165518
|
]
|
|
@@ -165529,7 +165531,7 @@ function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
165529
165531
|
children: [/* @__PURE__ */ _("div", { className: "border-t border-cb-line" }), /* @__PURE__ */ _("button", {
|
|
165530
165532
|
type: "button",
|
|
165531
165533
|
onClick: Ee,
|
|
165532
|
-
disabled: !
|
|
165534
|
+
disabled: !O,
|
|
165533
165535
|
"aria-label": "Swap the From and To currency and network",
|
|
165534
165536
|
title: "Swap currencies & networks",
|
|
165535
165537
|
className: j("absolute left-1/2 top-1/2 flex size-8 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full border border-cb-line bg-cb-card text-muted-foreground transition-colors", "hover:border-slate-300 hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none", "disabled:pointer-events-none"),
|
|
@@ -165549,7 +165551,7 @@ function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
165549
165551
|
value: u,
|
|
165550
165552
|
options: Fe,
|
|
165551
165553
|
onChange: Te,
|
|
165552
|
-
disabled: !
|
|
165554
|
+
disabled: !O
|
|
165553
165555
|
}), /* @__PURE__ */ _($, {
|
|
165554
165556
|
id: "cv-to-network",
|
|
165555
165557
|
label: "To network",
|
|
@@ -165557,7 +165559,7 @@ function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
165557
165559
|
value: p,
|
|
165558
165560
|
options: Ie,
|
|
165559
165561
|
onChange: m,
|
|
165560
|
-
disabled: !
|
|
165562
|
+
disabled: !O || !u
|
|
165561
165563
|
})]
|
|
165562
165564
|
}),
|
|
165563
165565
|
/* @__PURE__ */ v("div", {
|
|
@@ -165590,12 +165592,12 @@ function nGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
165590
165592
|
receiveAmount: ve,
|
|
165591
165593
|
receiveFiat: de && fe ? f9(me * (1 - o9)) : null,
|
|
165592
165594
|
rateLabel: be,
|
|
165593
|
-
rateCountdown: A ?
|
|
165595
|
+
rateCountdown: A ? D : null,
|
|
165594
165596
|
rateTtl: Q9,
|
|
165595
|
-
rateVersion:
|
|
165597
|
+
rateVersion: re,
|
|
165596
165598
|
feeLabel: xe,
|
|
165597
|
-
fromWalletName:
|
|
165598
|
-
fromWalletAddress:
|
|
165599
|
+
fromWalletName: O?.name ?? null,
|
|
165600
|
+
fromWalletAddress: ae?.address ?? null,
|
|
165599
165601
|
toWalletName: fe ? oe?.name ?? null : null,
|
|
165600
165602
|
toWalletAddress: fe ? oe?.address ?? null : null,
|
|
165601
165603
|
footer: /* @__PURE__ */ _(M, {
|
|
@@ -166288,22 +166290,22 @@ function pGe(e) {
|
|
|
166288
166290
|
return e.length > 18 ? `${e.slice(0, 10)}…${e.slice(-6)}` : e;
|
|
166289
166291
|
}
|
|
166290
166292
|
function mGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
166291
|
-
let [r, i] = d("USDT"), [a, o] = d("ETH"), [s, c] = d(null), [u, f] = d(""), [p, m] = d(""), [h, y] = d(""), [b, x] = d(!1), [C, w] = d(""), [T,
|
|
166293
|
+
let [r, i] = d("USDT"), [a, o] = d("ETH"), [s, c] = d(null), [u, f] = d(""), [p, m] = d(""), [h, y] = d(""), [b, x] = d(!1), [C, w] = d(""), [T, E] = d(!1), ee = (n9.find((e) => e.code === r) ?? n9[0]).networks, te = l(() => WHe.filter((e) => e.coin === r && e.network === a), [r, a]), D = te.find((e) => e.id === s) ?? null, ne = p.trim() !== "", re = r === "TON", ie = !re || u.trim() !== "", O = i9(h), ae = D ? i9(D.amount) : 0, oe = D != null && O > ae, k = h.trim() !== "" && O > 0, se = D && k ? a9(O * D.fiatRate) : null, ce = k ? O.toLocaleString("en-US", {
|
|
166292
166294
|
minimumFractionDigits: 2,
|
|
166293
166295
|
maximumFractionDigits: 8
|
|
166294
|
-
}) : null, le =
|
|
166296
|
+
}) : null, le = D != null && ne && k && !oe && ie, ue = (e) => {
|
|
166295
166297
|
i(e);
|
|
166296
166298
|
let t = n9.find((t) => t.code === e);
|
|
166297
166299
|
o(t?.networks[0] ?? ""), c(null), f("");
|
|
166298
166300
|
}, de = (e) => {
|
|
166299
166301
|
o(e), c(null);
|
|
166300
166302
|
}, fe = () => {
|
|
166301
|
-
|
|
166303
|
+
D && y(D.amount);
|
|
166302
166304
|
}, pe = (e) => {
|
|
166303
166305
|
let t = e.replace(/[^0-9.,]/g, ""), n = t.indexOf(".");
|
|
166304
166306
|
n !== -1 && (t = t.slice(0, n + 1) + t.slice(n + 1).replace(/\./g, "")), y(t);
|
|
166305
166307
|
}, me = () => {
|
|
166306
|
-
if (!
|
|
166308
|
+
if (!D || !ne) return;
|
|
166307
166309
|
let n = /* @__PURE__ */ new Date(), i = {
|
|
166308
166310
|
id: `wd-${n.getTime()}`,
|
|
166309
166311
|
date: n.toLocaleDateString("en-US", {
|
|
@@ -166316,23 +166318,23 @@ function mGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
166316
166318
|
minute: "2-digit"
|
|
166317
166319
|
}),
|
|
166318
166320
|
initiator: e,
|
|
166319
|
-
fromWallet:
|
|
166320
|
-
fromAddress:
|
|
166321
|
+
fromWallet: D.name,
|
|
166322
|
+
fromAddress: D.address,
|
|
166321
166323
|
toLabel: "External address",
|
|
166322
166324
|
toAddress: p.trim(),
|
|
166323
166325
|
coin: r,
|
|
166324
166326
|
network: a,
|
|
166325
166327
|
amount: `-${h}`,
|
|
166326
|
-
amountFiat: `-${a9(
|
|
166328
|
+
amountFiat: `-${a9(O * D.fiatRate)}`,
|
|
166327
166329
|
status: "PROCESSING"
|
|
166328
166330
|
};
|
|
166329
|
-
t?.(i),
|
|
166331
|
+
t?.(i), E(!0);
|
|
166330
166332
|
}, he = (e) => {
|
|
166331
166333
|
if (e) {
|
|
166332
166334
|
x(!0);
|
|
166333
166335
|
return;
|
|
166334
166336
|
}
|
|
166335
|
-
x(!1), w(""), T && (
|
|
166337
|
+
x(!1), w(""), T && (E(!1), y(""), m(""), f(""));
|
|
166336
166338
|
}, ge = n9.map((e) => ({
|
|
166337
166339
|
value: e.code,
|
|
166338
166340
|
label: e.code,
|
|
@@ -166342,7 +166344,7 @@ function mGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
166342
166344
|
src: J(e.code),
|
|
166343
166345
|
className: "size-6"
|
|
166344
166346
|
})
|
|
166345
|
-
})), A =
|
|
166347
|
+
})), A = ee.map((e) => ({
|
|
166346
166348
|
value: e,
|
|
166347
166349
|
label: e,
|
|
166348
166350
|
sublabel: t9[e]?.name ?? e,
|
|
@@ -166351,7 +166353,7 @@ function mGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
166351
166353
|
src: J(e),
|
|
166352
166354
|
className: "size-6"
|
|
166353
166355
|
})
|
|
166354
|
-
})), _e =
|
|
166356
|
+
})), _e = te.map((e) => ({
|
|
166355
166357
|
id: e.id,
|
|
166356
166358
|
name: e.name,
|
|
166357
166359
|
address: e.address,
|
|
@@ -166384,7 +166386,7 @@ function mGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
166384
166386
|
onChange: de
|
|
166385
166387
|
})]
|
|
166386
166388
|
}),
|
|
166387
|
-
|
|
166389
|
+
re ? /* @__PURE__ */ v("div", {
|
|
166388
166390
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
166389
166391
|
children: [/* @__PURE__ */ _(Z9, {
|
|
166390
166392
|
id: "wd-source",
|
|
@@ -166431,17 +166433,17 @@ function mGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
166431
166433
|
value: h,
|
|
166432
166434
|
onChange: pe,
|
|
166433
166435
|
suffix: r,
|
|
166434
|
-
disabled: !
|
|
166436
|
+
disabled: !D,
|
|
166435
166437
|
invalid: oe,
|
|
166436
166438
|
onMax: fe,
|
|
166437
|
-
maxDisabled: !
|
|
166438
|
-
hint:
|
|
166439
|
+
maxDisabled: !D,
|
|
166440
|
+
hint: D ? /* @__PURE__ */ v(g, { children: [
|
|
166439
166441
|
"Available:",
|
|
166440
166442
|
" ",
|
|
166441
166443
|
/* @__PURE__ */ v("span", {
|
|
166442
166444
|
className: "font-medium text-foreground",
|
|
166443
166445
|
children: [
|
|
166444
|
-
|
|
166446
|
+
D.amount,
|
|
166445
166447
|
" ",
|
|
166446
166448
|
r
|
|
166447
166449
|
]
|
|
@@ -166465,11 +166467,11 @@ function mGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
166465
166467
|
networkName: t9[a]?.name,
|
|
166466
166468
|
amount: ce,
|
|
166467
166469
|
amountFiat: se,
|
|
166468
|
-
from:
|
|
166469
|
-
label:
|
|
166470
|
-
address:
|
|
166470
|
+
from: D ? {
|
|
166471
|
+
label: D.name,
|
|
166472
|
+
address: D.address
|
|
166471
166473
|
} : null,
|
|
166472
|
-
to:
|
|
166474
|
+
to: ne ? { address: p.trim() } : null,
|
|
166473
166475
|
footer: /* @__PURE__ */ _(M, {
|
|
166474
166476
|
type: "button",
|
|
166475
166477
|
size: "lg",
|
|
@@ -166533,7 +166535,7 @@ function mGe({ currentUser: e = "Maya Okafor", onSubmit: t, className: n }) {
|
|
|
166533
166535
|
" ",
|
|
166534
166536
|
/* @__PURE__ */ _("span", {
|
|
166535
166537
|
className: "font-mono text-foreground",
|
|
166536
|
-
children:
|
|
166538
|
+
children: ne ? pGe(p.trim()) : ""
|
|
166537
166539
|
})
|
|
166538
166540
|
]
|
|
166539
166541
|
}), /* @__PURE__ */ v("div", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainberry/ui-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"description": "Chainberry navigation UI components — React + Tailwind. Canonical source lives in ../../react-app/src/components; this package re-exports, builds, and publishes them.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"type": "module",
|