@babylonlabs-io/core-ui 1.5.0 → 1.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.
- package/dist/{components → elements}/FinalityProviderItem/FinalityProviderItem.d.ts +1 -1
- package/dist/{components → elements}/ProvidersList/ProvidersList.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.es.js +100 -99
- package/dist/index.es.js.map +1 -1
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.d.ts +10 -0
- package/package.json +1 -1
- package/dist/widgets/new-design/FinalityProviderSubsection/FinalityProviderSubsection.d.ts +0 -9
- /package/dist/{components → elements}/FinalityProviderItem/index.d.ts +0 -0
- /package/dist/{components → elements}/FinalityProviderLogo/FinalityProviderLogo.d.ts +0 -0
- /package/dist/{components → elements}/FinalityProviderLogo/index.d.ts +0 -0
- /package/dist/{components → elements}/ProvidersList/index.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/AmountSubsection/AmountSubsection.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/AmountSubsection/index.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/FeesSection/BBNFeeAmount.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/FeesSection/BTCFeeAmount.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/FeesSection/BTCFeeRate.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/FeesSection/FeeItem.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/FeesSection/FeesSection.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/FeesSection/Total.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/FeesSection/index.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/FinalityProviderSubsection/index.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/PreviewModal/PreviewModal.d.ts +0 -0
- /package/dist/widgets/{new-design → sections}/PreviewModal/index.d.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export * from './components/Toggle';
|
|
|
15
15
|
export * from './components/List';
|
|
16
16
|
export * from './components/Badge';
|
|
17
17
|
export * from './components/SubSection';
|
|
18
|
-
export * from './components/FinalityProviderLogo';
|
|
19
18
|
export * from './components/CounterButton';
|
|
20
19
|
export * from './components/Menu';
|
|
21
20
|
export * from './widgets/form/Form';
|
|
@@ -26,10 +25,12 @@ export * from './widgets/form/RadioField';
|
|
|
26
25
|
export * from './widgets/form/SelectField';
|
|
27
26
|
export * from './widgets/form/HiddenField';
|
|
28
27
|
export * from './widgets/form/hooks';
|
|
29
|
-
export * from './widgets/
|
|
30
|
-
export * from './widgets/
|
|
31
|
-
export * from './widgets/
|
|
32
|
-
export * from './widgets/
|
|
28
|
+
export * from './widgets/sections/AmountSubsection';
|
|
29
|
+
export * from './widgets/sections/FinalityProviderSubsection';
|
|
30
|
+
export * from './widgets/sections/FeesSection';
|
|
31
|
+
export * from './widgets/sections/PreviewModal';
|
|
32
|
+
export * from './elements/FinalityProviderLogo';
|
|
33
|
+
export * from './elements/FinalityProviderItem';
|
|
33
34
|
export * from './components/ListLegacy';
|
|
34
35
|
export { ScrollLocker } from './context/Dialog.context';
|
|
35
36
|
export { useFormContext, useFormState, useWatch } from 'react-hook-form';
|
package/dist/index.es.js
CHANGED
|
@@ -2078,42 +2078,11 @@ const Sr = ({
|
|
|
2078
2078
|
children: e,
|
|
2079
2079
|
style: t,
|
|
2080
2080
|
className: r
|
|
2081
|
-
}) => /* @__PURE__ */ h("div", { className: T("flex rounded bg-secondary-highlight p-4 text-accent-primary", r), style: t, children: e })
|
|
2082
|
-
|
|
2083
|
-
logo: "size-10",
|
|
2084
|
-
subLogo: "text-[0.8rem]"
|
|
2085
|
-
},
|
|
2086
|
-
md: {
|
|
2087
|
-
logo: "size-6",
|
|
2088
|
-
subLogo: "text-[0.5rem]"
|
|
2089
|
-
},
|
|
2090
|
-
sm: {
|
|
2091
|
-
logo: "size-5",
|
|
2092
|
-
subLogo: "text-[0.4rem]"
|
|
2093
|
-
}
|
|
2094
|
-
}, _o = ({ logoUrl: e, rank: t, moniker: r, size: n = "md", className: i }) => {
|
|
2095
|
-
const [s, a] = oe(!1), o = Fo[n], l = (r == null ? void 0 : r.charAt(0).toUpperCase()) ?? String(t);
|
|
2096
|
-
return /* @__PURE__ */ h("span", { className: Ie("relative inline-block", o.logo, i), children: e && !s ? /* @__PURE__ */ h(
|
|
2097
|
-
"img",
|
|
2098
|
-
{
|
|
2099
|
-
src: e,
|
|
2100
|
-
alt: r || `Finality Provider ${t}`,
|
|
2101
|
-
className: "h-full w-full rounded-full object-cover",
|
|
2102
|
-
onError: () => a(!0)
|
|
2103
|
-
}
|
|
2104
|
-
) : /* @__PURE__ */ h(
|
|
2105
|
-
Y,
|
|
2106
|
-
{
|
|
2107
|
-
as: "span",
|
|
2108
|
-
className: "inline-flex h-full w-full items-center justify-center rounded-full bg-secondary-main text-[1rem] text-accent-contrast",
|
|
2109
|
-
children: l
|
|
2110
|
-
}
|
|
2111
|
-
) });
|
|
2112
|
-
};
|
|
2113
|
-
function Do(e) {
|
|
2081
|
+
}) => /* @__PURE__ */ h("div", { className: T("flex rounded bg-secondary-highlight p-4 text-accent-primary", r), style: t, children: e });
|
|
2082
|
+
function Fo(e) {
|
|
2114
2083
|
return At({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z" }, child: [] }, { tag: "path", attr: { d: "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z" }, child: [] }] })(e);
|
|
2115
2084
|
}
|
|
2116
|
-
function
|
|
2085
|
+
function _o({ counter: e, max: t, onAdd: r, alwaysShowCounter: n = !1 }) {
|
|
2117
2086
|
const i = e < t, s = 0 < e && 1 < t || n && e === 0;
|
|
2118
2087
|
return /* @__PURE__ */ S(
|
|
2119
2088
|
"div",
|
|
@@ -2126,7 +2095,7 @@ function Vo({ counter: e, max: t, onAdd: r, alwaysShowCounter: n = !1 }) {
|
|
|
2126
2095
|
),
|
|
2127
2096
|
onClick: i ? r : void 0,
|
|
2128
2097
|
children: [
|
|
2129
|
-
i && /* @__PURE__ */ h("div", { className: "flex h-10 w-10 items-center justify-center", children: /* @__PURE__ */ h(
|
|
2098
|
+
i && /* @__PURE__ */ h("div", { className: "flex h-10 w-10 items-center justify-center", children: /* @__PURE__ */ h(Fo, { size: 20 }) }),
|
|
2130
2099
|
s && /* @__PURE__ */ S("div", { className: "flex h-10 items-center border-l border-accent-primary px-2 text-sm sm:px-4 sm:text-base", children: [
|
|
2131
2100
|
e,
|
|
2132
2101
|
"/",
|
|
@@ -2139,7 +2108,7 @@ function Vo({ counter: e, max: t, onAdd: r, alwaysShowCounter: n = !1 }) {
|
|
|
2139
2108
|
const jn = Yt(void 0), Bn = () => {
|
|
2140
2109
|
const e = kt(jn);
|
|
2141
2110
|
return !e && process.env.NODE_ENV === "development" && console.warn("useMenuContext must be used within a Menu component"), e;
|
|
2142
|
-
},
|
|
2111
|
+
}, Do = ({ children: e, value: t }) => /* @__PURE__ */ h(jn.Provider, { value: t, children: e }), In = ({
|
|
2143
2112
|
isOpen: e,
|
|
2144
2113
|
onClose: t,
|
|
2145
2114
|
title: r,
|
|
@@ -2228,7 +2197,7 @@ const jn = Yt(void 0), Bn = () => {
|
|
|
2228
2197
|
)
|
|
2229
2198
|
] });
|
|
2230
2199
|
};
|
|
2231
|
-
function
|
|
2200
|
+
function Vo(e = 768, t = 100) {
|
|
2232
2201
|
const [r, n] = oe(() => typeof window < "u" ? window.innerWidth < e : !1), i = et(), s = Oe(() => {
|
|
2233
2202
|
n(window.innerWidth < e);
|
|
2234
2203
|
}, [e]);
|
|
@@ -2245,10 +2214,10 @@ const Ma = ({
|
|
|
2245
2214
|
offset: s = [0, 8],
|
|
2246
2215
|
className: a
|
|
2247
2216
|
}) => {
|
|
2248
|
-
const [o, l] = oe(!1), u = et(null), c =
|
|
2217
|
+
const [o, l] = oe(!1), u = et(null), c = Vo(), f = r !== void 0 ? r : o, g = (y) => {
|
|
2249
2218
|
r === void 0 && l(y), n == null || n(y);
|
|
2250
2219
|
}, m = () => g(!1), x = /* @__PURE__ */ h("div", { className: "relative w-full overflow-hidden", children: e }), b = t || /* @__PURE__ */ h("button", { className: "rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800", onClick: () => g(!f), children: "Menu" });
|
|
2251
|
-
return /* @__PURE__ */ S(
|
|
2220
|
+
return /* @__PURE__ */ S(Do, { value: { isOpen: f, setIsOpen: g, onClose: m, isMobile: c }, children: [
|
|
2252
2221
|
/* @__PURE__ */ h("div", { ref: u, className: "inline-block", children: W.isValidElement(b) && W.cloneElement(b, {
|
|
2253
2222
|
onClick: () => g(!f),
|
|
2254
2223
|
"aria-haspopup": "true",
|
|
@@ -2456,7 +2425,7 @@ const Ma = ({
|
|
|
2456
2425
|
};
|
|
2457
2426
|
var _t = (e) => e.type === "checkbox", Ye = (e) => e instanceof Date, ae = (e) => e == null;
|
|
2458
2427
|
const $n = (e) => typeof e == "object";
|
|
2459
|
-
var re = (e) => !ae(e) && !Array.isArray(e) && $n(e) && !Ye(e), Un = (e) => re(e) && e.target ? _t(e.target) ? e.target.checked : e.target.value : e,
|
|
2428
|
+
var re = (e) => !ae(e) && !Array.isArray(e) && $n(e) && !Ye(e), Un = (e) => re(e) && e.target ? _t(e.target) ? e.target.checked : e.target.value : e, Lo = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Wn = (e, t) => e.has(Lo(t)), To = (e) => {
|
|
2460
2429
|
const t = e.constructor && e.constructor.prototype;
|
|
2461
2430
|
return re(t) && t.hasOwnProperty("isPrototypeOf");
|
|
2462
2431
|
}, Fr = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
@@ -2468,7 +2437,7 @@ function ce(e) {
|
|
|
2468
2437
|
else if (e instanceof Set)
|
|
2469
2438
|
t = new Set(e);
|
|
2470
2439
|
else if (!(Fr && (e instanceof Blob || n)) && (r || re(e)))
|
|
2471
|
-
if (t = r ? [] : {}, !r && !
|
|
2440
|
+
if (t = r ? [] : {}, !r && !To(e))
|
|
2472
2441
|
t = e;
|
|
2473
2442
|
else
|
|
2474
2443
|
for (const i in e)
|
|
@@ -2516,7 +2485,7 @@ const Wt = {
|
|
|
2516
2485
|
pattern: "pattern",
|
|
2517
2486
|
required: "required",
|
|
2518
2487
|
validate: "validate"
|
|
2519
|
-
}, qn = W.createContext(null), ft = () => W.useContext(qn),
|
|
2488
|
+
}, qn = W.createContext(null), ft = () => W.useContext(qn), Mo = (e) => {
|
|
2520
2489
|
const { children: t, ...r } = e;
|
|
2521
2490
|
return W.createElement(qn.Provider, { value: r }, t);
|
|
2522
2491
|
};
|
|
@@ -2583,7 +2552,7 @@ function Kn(e) {
|
|
|
2583
2552
|
const [l, u] = W.useState(r._getWatch(n, i));
|
|
2584
2553
|
return W.useEffect(() => r._removeUnmounted()), l;
|
|
2585
2554
|
}
|
|
2586
|
-
function
|
|
2555
|
+
function Po(e) {
|
|
2587
2556
|
const t = ft(), { name: r, disabled: n, control: i = t.control, shouldUnregister: s } = e, a = Wn(i._names.array, r), o = Kn({
|
|
2588
2557
|
control: i,
|
|
2589
2558
|
name: r,
|
|
@@ -2708,7 +2677,7 @@ const Nt = (e, t, r, n) => {
|
|
|
2708
2677
|
}
|
|
2709
2678
|
}
|
|
2710
2679
|
};
|
|
2711
|
-
var
|
|
2680
|
+
var Ro = (e, t, r) => {
|
|
2712
2681
|
const n = xt(O(e, r));
|
|
2713
2682
|
return H(n, "root", t[r]), H(e, r, n), e;
|
|
2714
2683
|
}, Vr = (e) => e.type === "file", Se = (e) => typeof e == "function", Ht = (e) => {
|
|
@@ -2834,22 +2803,22 @@ var st = (e) => re(e) && !qt(e) ? e : {
|
|
|
2834
2803
|
}
|
|
2835
2804
|
return D(!0), F;
|
|
2836
2805
|
};
|
|
2837
|
-
function
|
|
2806
|
+
function jo(e, t) {
|
|
2838
2807
|
const r = t.slice(0, -1).length;
|
|
2839
2808
|
let n = 0;
|
|
2840
2809
|
for (; n < r; )
|
|
2841
2810
|
e = Q(e) ? n++ : e[t[n++]];
|
|
2842
2811
|
return e;
|
|
2843
2812
|
}
|
|
2844
|
-
function
|
|
2813
|
+
function Bo(e) {
|
|
2845
2814
|
for (const t in e)
|
|
2846
2815
|
if (e.hasOwnProperty(t) && !Q(e[t]))
|
|
2847
2816
|
return !1;
|
|
2848
2817
|
return !0;
|
|
2849
2818
|
}
|
|
2850
2819
|
function ie(e, t) {
|
|
2851
|
-
const r = Array.isArray(t) ? t : _r(t) ? [t] : Hn(t), n = r.length === 1 ? e :
|
|
2852
|
-
return n && delete n[s], i !== 0 && (re(n) && ue(n) || Array.isArray(n) &&
|
|
2820
|
+
const r = Array.isArray(t) ? t : _r(t) ? [t] : Hn(t), n = r.length === 1 ? e : jo(e, r), i = r.length - 1, s = r[i];
|
|
2821
|
+
return n && delete n[s], i !== 0 && (re(n) && ue(n) || Array.isArray(n) && Bo(n)) && ie(e, r.slice(0, -1)), e;
|
|
2853
2822
|
}
|
|
2854
2823
|
var or = () => {
|
|
2855
2824
|
let e = [];
|
|
@@ -2891,7 +2860,7 @@ function We(e, t) {
|
|
|
2891
2860
|
}
|
|
2892
2861
|
return !0;
|
|
2893
2862
|
}
|
|
2894
|
-
var ti = (e) => e.type === "select-multiple",
|
|
2863
|
+
var ti = (e) => e.type === "select-multiple", Io = (e) => Lr(e) || _t(e), ar = (e) => Ht(e) && e.isConnected, ri = (e) => {
|
|
2895
2864
|
for (const t in e)
|
|
2896
2865
|
if (Se(e[t]))
|
|
2897
2866
|
return !0;
|
|
@@ -2917,7 +2886,7 @@ function lr(e) {
|
|
|
2917
2886
|
if (!(e.refs ? e.refs.every((r) => r.disabled) : t.disabled))
|
|
2918
2887
|
return Vr(t) ? t.files : Lr(t) ? ei(e.refs).value : ti(t) ? [...t.selectedOptions].map(({ value: r }) => r) : _t(t) ? Qn(e.refs).value : ii(Q(t.value) ? e.ref.value : t.value, e);
|
|
2919
2888
|
}
|
|
2920
|
-
var
|
|
2889
|
+
var $o = (e, t, r, n) => {
|
|
2921
2890
|
const i = {};
|
|
2922
2891
|
for (const s of e) {
|
|
2923
2892
|
const a = O(t, s);
|
|
@@ -2931,7 +2900,7 @@ var Wo = (e, t, r, n) => {
|
|
|
2931
2900
|
};
|
|
2932
2901
|
}, bt = (e) => Q(e) ? e : qt(e) ? e.source : re(e) ? qt(e.value) ? e.value.source : e.value : e;
|
|
2933
2902
|
const cn = "AsyncFunction";
|
|
2934
|
-
var
|
|
2903
|
+
var Uo = (e) => !!e && !!e.validate && !!(Se(e.validate) && e.validate.constructor.name === cn || re(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === cn)), Wo = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
2935
2904
|
function un(e, t, r) {
|
|
2936
2905
|
const n = O(e, r);
|
|
2937
2906
|
if (n || _r(r))
|
|
@@ -2955,15 +2924,15 @@ function un(e, t, r) {
|
|
|
2955
2924
|
name: r
|
|
2956
2925
|
};
|
|
2957
2926
|
}
|
|
2958
|
-
var
|
|
2959
|
-
const
|
|
2927
|
+
var Ho = (e, t, r, n, i) => i.isOnAll ? !1 : !r && i.isOnTouch ? !(t || e) : (r ? n.isOnBlur : i.isOnBlur) ? !e : (r ? n.isOnChange : i.isOnChange) ? e : !0, qo = (e, t) => !Jt(O(e, t)).length && ie(e, t);
|
|
2928
|
+
const zo = {
|
|
2960
2929
|
mode: Ne.onSubmit,
|
|
2961
2930
|
reValidateMode: Ne.onChange,
|
|
2962
2931
|
shouldFocusError: !0
|
|
2963
2932
|
};
|
|
2964
|
-
function
|
|
2933
|
+
function Zo(e = {}) {
|
|
2965
2934
|
let t = {
|
|
2966
|
-
...
|
|
2935
|
+
...zo,
|
|
2967
2936
|
...e
|
|
2968
2937
|
}, r = {
|
|
2969
2938
|
submitCount: 0,
|
|
@@ -3025,7 +2994,7 @@ function Yo(e = {}) {
|
|
|
3025
2994
|
}
|
|
3026
2995
|
if (w && Array.isArray(O(r.errors, d))) {
|
|
3027
2996
|
const P = p(O(r.errors, d), C.argA, C.argB);
|
|
3028
|
-
N && H(r.errors, d, P),
|
|
2997
|
+
N && H(r.errors, d, P), qo(r.errors, d);
|
|
3029
2998
|
}
|
|
3030
2999
|
if (c.touchedFields && w && Array.isArray(O(r.touchedFields, d))) {
|
|
3031
3000
|
const P = p(O(r.touchedFields, d), C.argA, C.argB);
|
|
@@ -3090,7 +3059,7 @@ function Yo(e = {}) {
|
|
|
3090
3059
|
}
|
|
3091
3060
|
}, B = async (d) => {
|
|
3092
3061
|
L(d, !0);
|
|
3093
|
-
const v = await t.resolver(s, t.context,
|
|
3062
|
+
const v = await t.resolver(s, t.context, $o(d || o.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
|
|
3094
3063
|
return L(d), v;
|
|
3095
3064
|
}, U = async (d) => {
|
|
3096
3065
|
const { errors: v } = await B(d);
|
|
@@ -3110,12 +3079,12 @@ function Yo(e = {}) {
|
|
|
3110
3079
|
if (N) {
|
|
3111
3080
|
const { _f: w, ...P } = N;
|
|
3112
3081
|
if (w) {
|
|
3113
|
-
const $ = o.array.has(w.name), ee = N._f &&
|
|
3082
|
+
const $ = o.array.has(w.name), ee = N._f && Uo(N._f);
|
|
3114
3083
|
ee && c.validatingFields && L([C], !0);
|
|
3115
3084
|
const te = await ln(N, s, x, t.shouldUseNativeValidation && !v, $);
|
|
3116
3085
|
if (ee && c.validatingFields && L([C]), te[w.name] && (p.valid = !1, v))
|
|
3117
3086
|
break;
|
|
3118
|
-
!v && (O(te, w.name) ? $ ?
|
|
3087
|
+
!v && (O(te, w.name) ? $ ? Ro(r.errors, te, w.name) : H(r.errors, w.name, te[w.name]) : ie(r.errors, w.name));
|
|
3119
3088
|
}
|
|
3120
3089
|
!ue(P) && await I(P, v, p);
|
|
3121
3090
|
}
|
|
@@ -3167,7 +3136,7 @@ function Yo(e = {}) {
|
|
|
3167
3136
|
};
|
|
3168
3137
|
if (N) {
|
|
3169
3138
|
let $, ee;
|
|
3170
|
-
const te = w(), Ae = d.type === Wt.BLUR || d.type === Wt.FOCUS_OUT, fi = !
|
|
3139
|
+
const te = w(), Ae = d.type === Wt.BLUR || d.type === Wt.FOCUS_OUT, fi = !Wo(N._f) && !t.resolver && !O(r.errors, p) && !N._f.deps || Ho(Ae, O(r.touchedFields, p), r.isSubmitted, m, g), nr = rn(p, o, Ae);
|
|
3171
3140
|
H(s, p, te), Ae ? (N._f.onBlur && N._f.onBlur(d), l && l(0)) : N._f.onChange && N._f.onChange(d);
|
|
3172
3141
|
const ir = A(p, te, Ae, !1), di = !ue(ir) || nr;
|
|
3173
3142
|
if (!Ae && f.values.next({
|
|
@@ -3278,7 +3247,7 @@ function Yo(e = {}) {
|
|
|
3278
3247
|
ref: (N) => {
|
|
3279
3248
|
if (N) {
|
|
3280
3249
|
xe(d, v), p = O(n, d);
|
|
3281
|
-
const w = Q(N.value) && N.querySelectorAll && N.querySelectorAll("input,select,textarea")[0] || N, P =
|
|
3250
|
+
const w = Q(N.value) && N.querySelectorAll && N.querySelectorAll("input,select,textarea")[0] || N, P = Io(w), $ = p._f.refs || [];
|
|
3282
3251
|
if (P ? $.find((ee) => ee === w) : w === p._f.ref)
|
|
3283
3252
|
return;
|
|
3284
3253
|
H(n, d, {
|
|
@@ -3480,7 +3449,7 @@ function Yo(e = {}) {
|
|
|
3480
3449
|
getFieldState: $e
|
|
3481
3450
|
};
|
|
3482
3451
|
}
|
|
3483
|
-
function
|
|
3452
|
+
function Xo(e = {}) {
|
|
3484
3453
|
const t = W.useRef(), r = W.useRef(), [n, i] = W.useState({
|
|
3485
3454
|
isDirty: !1,
|
|
3486
3455
|
isValidating: !1,
|
|
@@ -3498,7 +3467,7 @@ function Go(e = {}) {
|
|
|
3498
3467
|
defaultValues: Se(e.defaultValues) ? void 0 : e.defaultValues
|
|
3499
3468
|
});
|
|
3500
3469
|
t.current || (t.current = {
|
|
3501
|
-
...
|
|
3470
|
+
...Zo(e),
|
|
3502
3471
|
formState: n
|
|
3503
3472
|
});
|
|
3504
3473
|
const s = t.current.control;
|
|
@@ -3539,19 +3508,19 @@ const fn = (e, t, r) => {
|
|
|
3539
3508
|
const n = t.fields[r];
|
|
3540
3509
|
n && n.ref && "reportValidity" in n.ref ? fn(n.ref, r, e) : n.refs && n.refs.forEach((i) => fn(i, r, e));
|
|
3541
3510
|
}
|
|
3542
|
-
},
|
|
3511
|
+
}, Yo = (e, t) => {
|
|
3543
3512
|
t.shouldUseNativeValidation && si(e, t);
|
|
3544
3513
|
const r = {};
|
|
3545
3514
|
for (const n in e) {
|
|
3546
3515
|
const i = O(t.fields, n), s = Object.assign(e[n] || {}, { ref: i && i.ref });
|
|
3547
|
-
if (
|
|
3516
|
+
if (Go(t.names || Object.keys(e), n)) {
|
|
3548
3517
|
const a = Object.assign({}, O(r, n));
|
|
3549
3518
|
H(a, "root", s), H(r, n, a);
|
|
3550
3519
|
} else H(r, n, s);
|
|
3551
3520
|
}
|
|
3552
3521
|
return r;
|
|
3553
|
-
},
|
|
3554
|
-
function
|
|
3522
|
+
}, Go = (e, t) => e.some((r) => r.startsWith(t + "."));
|
|
3523
|
+
function Ko(e, t, r) {
|
|
3555
3524
|
return t === void 0 && (t = {}), r === void 0 && (r = {}), function(n, i, s) {
|
|
3556
3525
|
try {
|
|
3557
3526
|
return Promise.resolve(function(a, o) {
|
|
@@ -3565,7 +3534,7 @@ function Qo(e, t, r) {
|
|
|
3565
3534
|
return l && l.then ? l.then(void 0, o) : l;
|
|
3566
3535
|
}(0, function(a) {
|
|
3567
3536
|
if (!a.inner) throw a;
|
|
3568
|
-
return { values: {}, errors:
|
|
3537
|
+
return { values: {}, errors: Yo((o = a, l = !s.shouldUseNativeValidation && s.criteriaMode === "all", (o.inner || []).reduce(function(u, c) {
|
|
3569
3538
|
if (u[c.path] || (u[c.path] = { message: c.message, type: c.type }), l) {
|
|
3570
3539
|
var f = u[c.path].types, g = f && f[c.type];
|
|
3571
3540
|
u[c.path] = Jn(c.path, l, u, c.type, g ? [].concat(g, c.message) : c.message);
|
|
@@ -3591,17 +3560,17 @@ function Ba({
|
|
|
3591
3560
|
onSubmit: l = () => null,
|
|
3592
3561
|
onChange: u
|
|
3593
3562
|
}) {
|
|
3594
|
-
const c =
|
|
3563
|
+
const c = Xo({
|
|
3595
3564
|
mode: n,
|
|
3596
3565
|
reValidateMode: i,
|
|
3597
3566
|
defaultValues: s,
|
|
3598
|
-
resolver: a ?
|
|
3567
|
+
resolver: a ? Ko(a) : void 0
|
|
3599
3568
|
});
|
|
3600
3569
|
return le(() => {
|
|
3601
3570
|
if (!u) return;
|
|
3602
3571
|
const { unsubscribe: f } = c.watch(u);
|
|
3603
3572
|
return f;
|
|
3604
|
-
}, [u, c.watch]), /* @__PURE__ */ h(
|
|
3573
|
+
}, [u, c.watch]), /* @__PURE__ */ h(Mo, { ...c, children: /* @__PURE__ */ h(
|
|
3605
3574
|
"form",
|
|
3606
3575
|
{
|
|
3607
3576
|
className: T("bbn-form", e),
|
|
@@ -3620,7 +3589,7 @@ function dt({
|
|
|
3620
3589
|
shouldUnregister: i = !1,
|
|
3621
3590
|
validateOnMount: s = !0
|
|
3622
3591
|
}) {
|
|
3623
|
-
const { setFocus: a, trigger: o } = ft(), { field: l, fieldState: u } =
|
|
3592
|
+
const { setFocus: a, trigger: o } = ft(), { field: l, fieldState: u } = Po({ name: e, defaultValue: t, disabled: r, shouldUnregister: i }), { invalid: c, isTouched: f, error: g } = u;
|
|
3624
3593
|
return le(() => {
|
|
3625
3594
|
s ? o(e, { shouldFocus: n }) : n && a(e);
|
|
3626
3595
|
}, [e, s]), {
|
|
@@ -3634,7 +3603,7 @@ function Ia(e) {
|
|
|
3634
3603
|
const { getFieldState: t } = ft(), r = Yn({ name: e });
|
|
3635
3604
|
return Array.isArray(e) ? e.map((i) => t(i, r)) : t(e, r);
|
|
3636
3605
|
}
|
|
3637
|
-
const
|
|
3606
|
+
const Jo = /^-?\d*\.?\d*$/;
|
|
3638
3607
|
function $a({
|
|
3639
3608
|
name: e,
|
|
3640
3609
|
id: t = e,
|
|
@@ -3679,7 +3648,7 @@ function $a({
|
|
|
3679
3648
|
prefix: g,
|
|
3680
3649
|
state: A,
|
|
3681
3650
|
onChange: (U) => {
|
|
3682
|
-
|
|
3651
|
+
Jo.test(U.target.value) && D(U.target.value);
|
|
3683
3652
|
},
|
|
3684
3653
|
onBlur: F
|
|
3685
3654
|
}
|
|
@@ -3852,11 +3821,11 @@ function qa({
|
|
|
3852
3821
|
}
|
|
3853
3822
|
) });
|
|
3854
3823
|
}
|
|
3855
|
-
function
|
|
3824
|
+
function Qo({ displayError: e = !1, ...t }) {
|
|
3856
3825
|
const { error: r, value: n, onChange: i, onBlur: s, disabled: a, name: o, ref: l } = dt(t), u = /* @__PURE__ */ h("input", { ref: l, type: "hidden", name: o, disabled: a, value: n, onChange: i, onBlur: s });
|
|
3857
3826
|
return e ? /* @__PURE__ */ h(Kt, { hint: e ? r : "", state: e ? "error" : "default", children: u }) : u;
|
|
3858
3827
|
}
|
|
3859
|
-
var ht = 1e9,
|
|
3828
|
+
var ht = 1e9, ea = {
|
|
3860
3829
|
// These values must be integers within the stated ranges (inclusive).
|
|
3861
3830
|
// Most of these values can be changed during run-time using `Decimal.config`.
|
|
3862
3831
|
// The maximum number of significant digits of the result of a calculation or base conversion.
|
|
@@ -3892,7 +3861,7 @@ var ht = 1e9, ra = {
|
|
|
3892
3861
|
// The natural logarithm of 10.
|
|
3893
3862
|
// 115 digits
|
|
3894
3863
|
LN10: "2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"
|
|
3895
|
-
}, Mr, J = !0, we = "[DecimalError] ", Ke = we + "Invalid argument: ", Tr = we + "Exponent out of range: ", vt = Math.floor, Ze = Math.pow,
|
|
3864
|
+
}, Mr, J = !0, we = "[DecimalError] ", Ke = we + "Invalid argument: ", Tr = we + "Exponent out of range: ", vt = Math.floor, Ze = Math.pow, ta = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, pe, se = 1e7, X = 7, oi = 9007199254740991, Zt = vt(oi / X), V = {};
|
|
3896
3865
|
V.absoluteValue = V.abs = function() {
|
|
3897
3866
|
var e = new this.constructor(this);
|
|
3898
3867
|
return e.s && (e.s = 1), e;
|
|
@@ -4288,14 +4257,14 @@ function ui(e) {
|
|
|
4288
4257
|
return dn(a, s.toString());
|
|
4289
4258
|
} else if (typeof s != "string")
|
|
4290
4259
|
throw Error(Ke + s);
|
|
4291
|
-
if (s.charCodeAt(0) === 45 ? (s = s.slice(1), a.s = -1) : a.s = 1,
|
|
4260
|
+
if (s.charCodeAt(0) === 45 ? (s = s.slice(1), a.s = -1) : a.s = 1, ta.test(s)) dn(a, s);
|
|
4292
4261
|
else throw Error(Ke + s);
|
|
4293
4262
|
}
|
|
4294
|
-
if (i.prototype = V, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.clone = ui, i.config = i.set =
|
|
4263
|
+
if (i.prototype = V, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.clone = ui, i.config = i.set = ra, e === void 0 && (e = {}), e)
|
|
4295
4264
|
for (n = ["precision", "rounding", "toExpNeg", "toExpPos", "LN10"], t = 0; t < n.length; ) e.hasOwnProperty(r = n[t++]) || (e[r] = this[r]);
|
|
4296
4265
|
return i.config(e), i;
|
|
4297
4266
|
}
|
|
4298
|
-
function
|
|
4267
|
+
function ra(e) {
|
|
4299
4268
|
if (!e || typeof e != "object")
|
|
4300
4269
|
throw Error(we + "Object expected");
|
|
4301
4270
|
var t, r, n, i = [
|
|
@@ -4321,9 +4290,9 @@ function ia(e) {
|
|
|
4321
4290
|
else throw Error(Ke + r + ": " + n);
|
|
4322
4291
|
return this;
|
|
4323
4292
|
}
|
|
4324
|
-
var Mr = ui(
|
|
4293
|
+
var Mr = ui(ea);
|
|
4325
4294
|
pe = new Mr(1);
|
|
4326
|
-
const
|
|
4295
|
+
const na = {
|
|
4327
4296
|
prefix: "$",
|
|
4328
4297
|
precision: 2,
|
|
4329
4298
|
zeroDisplay: "-",
|
|
@@ -4332,20 +4301,20 @@ const sa = {
|
|
|
4332
4301
|
maximumFractionDigits: 2
|
|
4333
4302
|
}
|
|
4334
4303
|
};
|
|
4335
|
-
function
|
|
4304
|
+
function ia(e, t = {}) {
|
|
4336
4305
|
const { prefix: r, precision: n, zeroDisplay: i, format: s } = {
|
|
4337
|
-
...
|
|
4306
|
+
...na,
|
|
4338
4307
|
...t
|
|
4339
4308
|
};
|
|
4340
4309
|
if (e === 0) return i;
|
|
4341
4310
|
const a = e.toLocaleString("en", s ?? { maximumFractionDigits: n });
|
|
4342
4311
|
return `${r}${a}`;
|
|
4343
4312
|
}
|
|
4344
|
-
function
|
|
4313
|
+
function sa(e, t, r) {
|
|
4345
4314
|
const n = e * t;
|
|
4346
|
-
return
|
|
4315
|
+
return ia(n, r);
|
|
4347
4316
|
}
|
|
4348
|
-
const
|
|
4317
|
+
const oa = (e, t, r) => new Mr(e).toDecimalPlaces(t, r).toNumber(), za = ({
|
|
4349
4318
|
fieldName: e,
|
|
4350
4319
|
currencyIcon: t,
|
|
4351
4320
|
currencyName: r,
|
|
@@ -4356,7 +4325,7 @@ const la = (e, t, r) => new Mr(e).toDecimalPlaces(t, r).toNumber(), za = ({
|
|
|
4356
4325
|
step: o = "any",
|
|
4357
4326
|
autoFocus: l = !0
|
|
4358
4327
|
}) => {
|
|
4359
|
-
const u = Kn({ name: e, defaultValue: "" }), { setValue: c } = ft(), f = parseFloat(u || "0"), g =
|
|
4328
|
+
const u = Kn({ name: e, defaultValue: "" }), { setValue: c } = ft(), f = parseFloat(u || "0"), g = sa(f, (s == null ? void 0 : s.price) ?? 0, {
|
|
4360
4329
|
zeroDisplay: "$0.00"
|
|
4361
4330
|
});
|
|
4362
4331
|
return /* @__PURE__ */ S(Sr, { className: "flex w-full flex-col content-center justify-between gap-4", children: [
|
|
@@ -4388,12 +4357,12 @@ const la = (e, t, r) => new Mr(e).toDecimalPlaces(t, r).toNumber(), za = ({
|
|
|
4388
4357
|
}
|
|
4389
4358
|
)
|
|
4390
4359
|
] }),
|
|
4391
|
-
/* @__PURE__ */ h(
|
|
4360
|
+
/* @__PURE__ */ h(Qo, { name: e, defaultValue: "" }),
|
|
4392
4361
|
s && n ? /* @__PURE__ */ S("div", { className: "flex w-full flex-row content-center justify-between text-sm", children: [
|
|
4393
4362
|
/* @__PURE__ */ S("div", { children: [
|
|
4394
4363
|
"Stakable:",
|
|
4395
4364
|
" ",
|
|
4396
|
-
/* @__PURE__ */ h("span", { className: "cursor-default", children:
|
|
4365
|
+
/* @__PURE__ */ h("span", { className: "cursor-default", children: oa(Number(s.balance), s.decimals ?? 8) }),
|
|
4397
4366
|
" ",
|
|
4398
4367
|
s.symbol
|
|
4399
4368
|
] }),
|
|
@@ -4403,6 +4372,37 @@ const la = (e, t, r) => new Mr(e).toDecimalPlaces(t, r).toNumber(), za = ({
|
|
|
4403
4372
|
] })
|
|
4404
4373
|
] }) : null
|
|
4405
4374
|
] });
|
|
4375
|
+
}, aa = {
|
|
4376
|
+
lg: {
|
|
4377
|
+
logo: "size-10",
|
|
4378
|
+
subLogo: "text-[0.8rem]"
|
|
4379
|
+
},
|
|
4380
|
+
md: {
|
|
4381
|
+
logo: "size-6",
|
|
4382
|
+
subLogo: "text-[0.5rem]"
|
|
4383
|
+
},
|
|
4384
|
+
sm: {
|
|
4385
|
+
logo: "size-5",
|
|
4386
|
+
subLogo: "text-[0.4rem]"
|
|
4387
|
+
}
|
|
4388
|
+
}, la = ({ logoUrl: e, rank: t, moniker: r, size: n = "md", className: i }) => {
|
|
4389
|
+
const [s, a] = oe(!1), o = aa[n], l = (r == null ? void 0 : r.charAt(0).toUpperCase()) ?? String(t);
|
|
4390
|
+
return /* @__PURE__ */ h("span", { className: Ie("relative inline-block", o.logo, i), children: e && !s ? /* @__PURE__ */ h(
|
|
4391
|
+
"img",
|
|
4392
|
+
{
|
|
4393
|
+
src: e,
|
|
4394
|
+
alt: r || `Finality Provider ${t}`,
|
|
4395
|
+
className: "h-full w-full rounded-full object-cover",
|
|
4396
|
+
onError: () => a(!0)
|
|
4397
|
+
}
|
|
4398
|
+
) : /* @__PURE__ */ h(
|
|
4399
|
+
Y,
|
|
4400
|
+
{
|
|
4401
|
+
as: "span",
|
|
4402
|
+
className: "inline-flex h-full w-full items-center justify-center rounded-full bg-secondary-main text-[1rem] text-accent-contrast",
|
|
4403
|
+
children: l
|
|
4404
|
+
}
|
|
4405
|
+
) });
|
|
4406
4406
|
};
|
|
4407
4407
|
function ca({ bsnId: e, bsnName: t, bsnLogoUrl: r, provider: n, onRemove: i }) {
|
|
4408
4408
|
var a, o;
|
|
@@ -4411,7 +4411,7 @@ function ca({ bsnId: e, bsnName: t, bsnLogoUrl: r, provider: n, onRemove: i }) {
|
|
|
4411
4411
|
return /* @__PURE__ */ S("div", { className: "flex flex-row items-center justify-between", children: [
|
|
4412
4412
|
/* @__PURE__ */ S("div", { className: "flex h-10 flex-row gap-2", children: [
|
|
4413
4413
|
/* @__PURE__ */ h(
|
|
4414
|
-
|
|
4414
|
+
la,
|
|
4415
4415
|
{
|
|
4416
4416
|
logoUrl: n.logo_url,
|
|
4417
4417
|
rank: n.rank,
|
|
@@ -4451,14 +4451,14 @@ function ua({ items: e, onRemove: t }) {
|
|
|
4451
4451
|
`${n}-${a.rank}`
|
|
4452
4452
|
)) });
|
|
4453
4453
|
}
|
|
4454
|
-
function Za({ max: e, items: t = [],
|
|
4455
|
-
const
|
|
4454
|
+
function Za({ max: e, items: t = [], actionText: r, onAdd: n, onRemove: i }) {
|
|
4455
|
+
const s = He(() => t.length, [t]);
|
|
4456
4456
|
return /* @__PURE__ */ h(Sr, { children: /* @__PURE__ */ S("div", { className: "flex w-full flex-col gap-4", children: [
|
|
4457
4457
|
/* @__PURE__ */ h("div", { className: "flex flex-row", children: /* @__PURE__ */ S("div", { className: "flex w-full flex-row content-center items-center justify-between font-normal", children: [
|
|
4458
|
-
/* @__PURE__ */ h("span", { className: "text-sm sm:text-base", children:
|
|
4459
|
-
/* @__PURE__ */ h(
|
|
4458
|
+
/* @__PURE__ */ h("span", { className: "text-sm sm:text-base", children: r }),
|
|
4459
|
+
/* @__PURE__ */ h(_o, { counter: s, max: e, onAdd: n })
|
|
4460
4460
|
] }) }),
|
|
4461
|
-
|
|
4461
|
+
s > 0 && /* @__PURE__ */ h(ua, { items: t, onRemove: i })
|
|
4462
4462
|
] }) });
|
|
4463
4463
|
}
|
|
4464
4464
|
function Pr({ title: e, children: t, className: r, hint: n }) {
|
|
@@ -4682,19 +4682,20 @@ export {
|
|
|
4682
4682
|
Wa as CheckboxField,
|
|
4683
4683
|
Sa as Chip,
|
|
4684
4684
|
No as Column,
|
|
4685
|
-
|
|
4685
|
+
_o as CounterButton,
|
|
4686
4686
|
Ks as Dialog,
|
|
4687
4687
|
eo as DialogBody,
|
|
4688
4688
|
to as DialogFooter,
|
|
4689
4689
|
Qs as DialogHeader,
|
|
4690
4690
|
Pr as FeeItem,
|
|
4691
4691
|
Xa as FeesSection,
|
|
4692
|
-
|
|
4692
|
+
ca as FinalityProviderItem,
|
|
4693
|
+
la as FinalityProviderLogo,
|
|
4693
4694
|
Za as FinalityProviderSubsection,
|
|
4694
4695
|
Ba as Form,
|
|
4695
4696
|
Kt as FormControl,
|
|
4696
4697
|
br as Heading,
|
|
4697
|
-
|
|
4698
|
+
Qo as HiddenField,
|
|
4698
4699
|
pn as IconButton,
|
|
4699
4700
|
Ar as Input,
|
|
4700
4701
|
Va as List,
|