@gearbox-protocol/ui-kit 3.14.0-next.25 → 3.14.0-next.27
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/cjs/components/app-bar/app-bar.cjs +1 -1
- package/dist/cjs/components/assets-list-cell/assets-list-cell.cjs +1 -1
- package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
- package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -0
- package/dist/cjs/components/block-sync-pill/index.cjs +1 -0
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
- package/dist/cjs/components/composites/pool-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/preview/OperationPreviewContent.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/operations/OperationsCard.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/operations/PoolDepositView.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/operations/PoolWithdrawView.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/state-change/BalanceChangeGroup.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/state-change/StateChangeCard.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/layout/app-footer/app-footer.cjs +1 -0
- package/dist/cjs/components/layout/app-footer/index.cjs +1 -0
- package/dist/cjs/components/layout/app-header/app-header.cjs +1 -0
- package/dist/cjs/components/layout/app-header/index.cjs +1 -0
- package/dist/cjs/components/layout/index.cjs +1 -1
- package/dist/cjs/components/loader-guard/loader-guard.cjs +1 -1
- package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
- package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
- package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/hooks/index.cjs +1 -1
- package/dist/cjs/hooks/use-filter.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/app-bar/app-bar.js +1 -1
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +4 -2
- package/dist/esm/components/block-sync/block-sync.js +4 -2
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +241 -0
- package/dist/esm/components/block-sync-pill/index.js +4 -0
- package/dist/esm/components/checkbox/checkbox-labeled.js +2 -0
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +2 -0
- package/dist/esm/components/complex-input/complex-input.js +4 -2
- package/dist/esm/components/composites/pool-table/columns.js +20 -18
- package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +4 -2
- package/dist/esm/components/composites/tx-preview/confirm/preview/OperationPreviewContent.js +4 -2
- package/dist/esm/components/composites/tx-preview/operations/OperationsCard.js +4 -2
- package/dist/esm/components/composites/tx-preview/operations/PoolDepositView.js +4 -2
- package/dist/esm/components/composites/tx-preview/operations/PoolWithdrawView.js +4 -2
- package/dist/esm/components/composites/tx-preview/state-change/BalanceChangeGroup.js +4 -2
- package/dist/esm/components/composites/tx-preview/state-change/StateChangeCard.js +4 -2
- package/dist/esm/components/compound-apy/compound-apy.js +4 -2
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +2 -0
- package/dist/esm/components/index.js +735 -728
- package/dist/esm/components/layout/app-footer/app-footer.js +54 -0
- package/dist/esm/components/layout/app-footer/index.js +5 -0
- package/dist/esm/components/layout/app-header/app-header.js +98 -0
- package/dist/esm/components/layout/app-header/index.js +4 -0
- package/dist/esm/components/layout/index.js +32 -27
- package/dist/esm/components/loader-guard/loader-guard.js +7 -5
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +4 -2
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +2 -0
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +4 -2
- package/dist/esm/components/with-copy/with-copy.js +4 -2
- package/dist/esm/hooks/index.js +50 -47
- package/dist/esm/hooks/use-filter.js +63 -29
- package/dist/esm/index.js +898 -888
- package/dist/esm/locale/en.json.js +3 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/block-sync-pill/block-sync-pill.d.ts +35 -0
- package/dist/types/components/block-sync-pill/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/layout/app-footer/app-footer.d.ts +62 -0
- package/dist/types/components/layout/app-footer/index.d.ts +1 -0
- package/dist/types/components/layout/app-header/app-header.d.ts +63 -0
- package/dist/types/components/layout/app-header/index.d.ts +1 -0
- package/dist/types/components/layout/index.d.ts +2 -0
- package/dist/types/hooks/use-filter.d.ts +46 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/locale/en.json.d.ts +4 -0
- package/dist/types/types/footer.d.ts +24 -3
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { BlockSyncPill as x } from "../../block-sync-pill/block-sync-pill.js";
|
|
4
|
+
import { cn as h } from "../../../utils/cn.js";
|
|
5
|
+
const u = [
|
|
6
|
+
{ label: "Docs", href: "https://docs.gearbox.finance" },
|
|
7
|
+
{ label: "Support", href: "https://discord.com/invite/gearbox" },
|
|
8
|
+
{ label: "Terms", href: "https://gearbox.finance/terms" },
|
|
9
|
+
{ label: "Privacy Policy", href: "https://gearbox.finance/privacy" }
|
|
10
|
+
], g = d.forwardRef(
|
|
11
|
+
({
|
|
12
|
+
links: o = u,
|
|
13
|
+
copyright: s,
|
|
14
|
+
year: l = (/* @__PURE__ */ new Date()).getFullYear(),
|
|
15
|
+
showStatus: c = !0,
|
|
16
|
+
statusLabel: m = "Status",
|
|
17
|
+
blockSyncProps: t,
|
|
18
|
+
className: n,
|
|
19
|
+
...i
|
|
20
|
+
}, p) => /* @__PURE__ */ e(
|
|
21
|
+
"footer",
|
|
22
|
+
{
|
|
23
|
+
ref: p,
|
|
24
|
+
className: h(
|
|
25
|
+
"border-t border-border/60 px-4 sm:px-6 lg:px-8",
|
|
26
|
+
n
|
|
27
|
+
),
|
|
28
|
+
...i,
|
|
29
|
+
children: /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center justify-center gap-x-4 gap-y-3 py-3 text-xs text-muted-foreground sm:justify-start sm:gap-x-6 sm:gap-y-2", children: [
|
|
30
|
+
/* @__PURE__ */ e("span", { className: "order-1", children: s ?? /* @__PURE__ */ a(f, { children: [
|
|
31
|
+
"© Gearbox Protocol, ",
|
|
32
|
+
l
|
|
33
|
+
] }) }),
|
|
34
|
+
c && t ? /* @__PURE__ */ e("div", { className: "order-2 sm:order-3", children: /* @__PURE__ */ e(x, { ...t, statusLabel: m }) }) : null,
|
|
35
|
+
/* @__PURE__ */ e("nav", { className: "order-3 flex w-full flex-wrap items-center justify-center gap-4 sm:order-2 sm:ml-auto sm:w-auto sm:justify-start", children: o.map((r) => /* @__PURE__ */ e(
|
|
36
|
+
"a",
|
|
37
|
+
{
|
|
38
|
+
href: r.href,
|
|
39
|
+
target: "_blank",
|
|
40
|
+
rel: "noopener noreferrer",
|
|
41
|
+
className: "transition-colors hover:text-foreground",
|
|
42
|
+
children: r.label
|
|
43
|
+
},
|
|
44
|
+
r.label
|
|
45
|
+
)) })
|
|
46
|
+
] })
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
g.displayName = "AppFooter";
|
|
51
|
+
export {
|
|
52
|
+
g as AppFooter,
|
|
53
|
+
u as DEFAULT_APP_FOOTER_LINKS
|
|
54
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as N from "react";
|
|
3
|
+
import { AppBar as w, AppBarSidePanel as i, AppBarCenter as L, AppBarCenterContent as k } from "../../app-bar/app-bar.js";
|
|
4
|
+
import { BaseLink as a } from "../../base-link/base-link.js";
|
|
5
|
+
import { NavBarLogo as l } from "../../navbar-logo/navbar-logo.js";
|
|
6
|
+
import { cn as v } from "../../../utils/cn.js";
|
|
7
|
+
import { getStatic as e } from "../../../utils/static.js";
|
|
8
|
+
function A({ href: r }) {
|
|
9
|
+
return /* @__PURE__ */ o(
|
|
10
|
+
a,
|
|
11
|
+
{
|
|
12
|
+
size: "unset",
|
|
13
|
+
variant: "unset",
|
|
14
|
+
color: "main",
|
|
15
|
+
href: r,
|
|
16
|
+
className: "inline-flex",
|
|
17
|
+
children: /* @__PURE__ */ o(
|
|
18
|
+
l,
|
|
19
|
+
{
|
|
20
|
+
src: e("/logo/logo_monochrome_white.png"),
|
|
21
|
+
srcSet: `${e(
|
|
22
|
+
"/logo/logo_monochrome_white.png"
|
|
23
|
+
)} 1x, ${e(
|
|
24
|
+
"/logo/logo_monochrome_white@2x.png"
|
|
25
|
+
)} 2x, ${e("/logo/logo_monochrome_white@2x.png")} 3x`,
|
|
26
|
+
alt: "Logo",
|
|
27
|
+
style: { height: "32px" },
|
|
28
|
+
className: "w-auto cursor-pointer"
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function B({ href: r }) {
|
|
35
|
+
return /* @__PURE__ */ o(
|
|
36
|
+
a,
|
|
37
|
+
{
|
|
38
|
+
size: "unset",
|
|
39
|
+
variant: "unset",
|
|
40
|
+
color: "main",
|
|
41
|
+
href: r,
|
|
42
|
+
className: "inline-flex",
|
|
43
|
+
children: /* @__PURE__ */ o(
|
|
44
|
+
l,
|
|
45
|
+
{
|
|
46
|
+
src: e("/logo/sign_monochrome_white.png"),
|
|
47
|
+
srcSet: `${e(
|
|
48
|
+
"/logo/sign_monochrome_white.png"
|
|
49
|
+
)} 1x, ${e(
|
|
50
|
+
"/logo/sign_monochrome_white@2x.png"
|
|
51
|
+
)} 2x, ${e("/logo/sign_monochrome_white@2x.png")} 3x`,
|
|
52
|
+
alt: "Logo",
|
|
53
|
+
style: { height: "34px", marginLeft: "4px", marginTop: "4px" },
|
|
54
|
+
className: "w-auto cursor-pointer"
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
const $ = N.forwardRef(
|
|
61
|
+
({
|
|
62
|
+
homeHref: r = "/",
|
|
63
|
+
desktopLogo: s,
|
|
64
|
+
mobileLogo: m,
|
|
65
|
+
mobileMenu: t,
|
|
66
|
+
tabs: c,
|
|
67
|
+
actions: p,
|
|
68
|
+
wallet: g,
|
|
69
|
+
leftTestId: h,
|
|
70
|
+
centerTestId: d,
|
|
71
|
+
rightTestId: x,
|
|
72
|
+
className: f,
|
|
73
|
+
..._
|
|
74
|
+
}, u) => /* @__PURE__ */ n(
|
|
75
|
+
w,
|
|
76
|
+
{
|
|
77
|
+
ref: u,
|
|
78
|
+
className: v("!h-14 md:px-4 lg:px-10", f),
|
|
79
|
+
..._,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ n(i, { "data-testid": h, children: [
|
|
82
|
+
t && /* @__PURE__ */ o("div", { className: "block lg:hidden", children: t }),
|
|
83
|
+
/* @__PURE__ */ o("div", { className: "hidden lg:block", children: s ?? /* @__PURE__ */ o(A, { href: r }) }),
|
|
84
|
+
/* @__PURE__ */ o("div", { className: "block lg:hidden", children: m ?? /* @__PURE__ */ o(B, { href: r }) })
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ o(L, { "data-testid": d, className: "md:px-0 lg:px-3", children: /* @__PURE__ */ o(k, { className: "md:hidden lg:block", children: c }) }),
|
|
87
|
+
/* @__PURE__ */ n(i, { "data-testid": x, className: "ml-auto", children: [
|
|
88
|
+
p,
|
|
89
|
+
g
|
|
90
|
+
] })
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
);
|
|
95
|
+
$.displayName = "AppHeader";
|
|
96
|
+
export {
|
|
97
|
+
$ as AppHeader
|
|
98
|
+
};
|
|
@@ -1,31 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { AppFooter as e, DEFAULT_APP_FOOTER_LINKS as t } from "./app-footer/app-footer.js";
|
|
2
|
+
import { AppHeader as m } from "./app-header/app-header.js";
|
|
3
|
+
import { AppLogo as f, AppLogoLink as a } from "./app-logo/app-logo.js";
|
|
4
|
+
import { Block as L } from "./block/block.js";
|
|
5
|
+
import { Col as A } from "./col/col.js";
|
|
6
|
+
import { Container as l } from "./container/container.js";
|
|
7
|
+
import { Footer as u, FooterLink as d, FooterLinkSection as g, GearboxFooter as k } from "./footer/footer.js";
|
|
8
|
+
import { Grid as y } from "./grid/grid.js";
|
|
9
|
+
import { Header as P, useMobileMenu as S } from "./header/header.js";
|
|
10
|
+
import { Layout as b } from "./layout/layout.js";
|
|
11
|
+
import { LegalDisclaimer as D } from "./legal-disclaimer/legal-disclaimer.js";
|
|
10
12
|
import { MainAsideLayout as G } from "./main-aside-layout/main-aside-layout.js";
|
|
11
|
-
import { PageLayout as
|
|
12
|
-
import { SocialIcons as
|
|
13
|
+
import { PageLayout as I } from "./page-layout/page-layout.js";
|
|
14
|
+
import { SocialIcons as T } from "./social-icons/social-icons.js";
|
|
13
15
|
export {
|
|
14
|
-
e as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
l as
|
|
21
|
-
|
|
22
|
-
u as
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
e as AppFooter,
|
|
17
|
+
m as AppHeader,
|
|
18
|
+
f as AppLogo,
|
|
19
|
+
a as AppLogoLink,
|
|
20
|
+
L as Block,
|
|
21
|
+
A as Col,
|
|
22
|
+
l as Container,
|
|
23
|
+
t as DEFAULT_APP_FOOTER_LINKS,
|
|
24
|
+
u as Footer,
|
|
25
|
+
d as FooterLink,
|
|
26
|
+
g as FooterLinkSection,
|
|
27
|
+
k as GearboxFooter,
|
|
28
|
+
y as Grid,
|
|
29
|
+
P as Header,
|
|
30
|
+
b as Layout,
|
|
31
|
+
D as LegalDisclaimer,
|
|
27
32
|
G as MainAsideLayout,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
I as PageLayout,
|
|
34
|
+
T as SocialIcons,
|
|
35
|
+
S as useMobileMenu
|
|
31
36
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { jsx as m, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import { Guard as p } from "../guard/guard.js";
|
|
3
|
+
import "../layout/app-footer/app-footer.js";
|
|
4
|
+
import "../layout/app-header/app-header.js";
|
|
3
5
|
import "../base-link/base-link.js";
|
|
4
6
|
import "react";
|
|
5
7
|
import "@gearbox-protocol/sdk";
|
|
@@ -20,12 +22,12 @@ import "../buttons/back-button/back-button.js";
|
|
|
20
22
|
import "../page-title/page-title.js";
|
|
21
23
|
import "../layout/social-icons/social-icons.js";
|
|
22
24
|
import { Skeleton as r } from "../skeleton/skeleton.js";
|
|
23
|
-
function
|
|
25
|
+
function E({
|
|
24
26
|
showGuard: s,
|
|
25
27
|
children: i,
|
|
26
|
-
loader:
|
|
28
|
+
loader: t
|
|
27
29
|
}) {
|
|
28
|
-
const
|
|
30
|
+
const a = /* @__PURE__ */ m(e, { children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-4 p-4 sm:p-6 w-full", children: [
|
|
29
31
|
/* @__PURE__ */ m(r, { className: "h-6 sm:h-8 w-48 sm:w-64" }),
|
|
30
32
|
/* @__PURE__ */ o("div", { className: "space-y-2 mb-4", children: [
|
|
31
33
|
/* @__PURE__ */ m(r, { className: "h-3 sm:h-4 w-full" }),
|
|
@@ -37,8 +39,8 @@ function B({
|
|
|
37
39
|
/* @__PURE__ */ m(r, { className: "h-48 sm:h-64 md:h-72 md:w-1/3 w-full" })
|
|
38
40
|
] })
|
|
39
41
|
] }) }), l = s;
|
|
40
|
-
return /* @__PURE__ */ m(p, { showGuard: l, guard: l && (
|
|
42
|
+
return /* @__PURE__ */ m(p, { showGuard: l, guard: l && (t || a), children: i });
|
|
41
43
|
}
|
|
42
44
|
export {
|
|
43
|
-
|
|
45
|
+
E as LoaderGuard
|
|
44
46
|
};
|
|
@@ -2,6 +2,8 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect as y } from "react";
|
|
3
3
|
import h from "react-markdown";
|
|
4
4
|
import k from "remark-gfm";
|
|
5
|
+
import "../layout/app-footer/app-footer.js";
|
|
6
|
+
import "../layout/app-header/app-header.js";
|
|
5
7
|
import "../base-link/base-link.js";
|
|
6
8
|
import "@gearbox-protocol/sdk";
|
|
7
9
|
import { cn as p } from "../../utils/cn.js";
|
|
@@ -182,7 +184,7 @@ function a(o) {
|
|
|
182
184
|
}
|
|
183
185
|
return { id: T(l), displayText: o };
|
|
184
186
|
}
|
|
185
|
-
function
|
|
187
|
+
function zr({
|
|
186
188
|
content: o,
|
|
187
189
|
title: l,
|
|
188
190
|
backButton: s,
|
|
@@ -394,5 +396,5 @@ function Ar({
|
|
|
394
396
|
return c ? d : /* @__PURE__ */ r(w, { title: l || "", backButton: s, children: d });
|
|
395
397
|
}
|
|
396
398
|
export {
|
|
397
|
-
|
|
399
|
+
zr as MarkdownViewer
|
|
398
400
|
};
|
|
@@ -114,6 +114,8 @@ import "lightweight-charts";
|
|
|
114
114
|
import "../graph/graph-view.js";
|
|
115
115
|
import "../health-factor/health-factor.js";
|
|
116
116
|
import "../horizontal-indicator/horizontal-indicator.js";
|
|
117
|
+
import "../layout/app-footer/app-footer.js";
|
|
118
|
+
import "../layout/app-header/app-header.js";
|
|
117
119
|
import "../layout/col/col.js";
|
|
118
120
|
import "../layout/container/container.js";
|
|
119
121
|
import "../layout/footer/footer.js";
|
|
@@ -113,6 +113,8 @@ import "lightweight-charts";
|
|
|
113
113
|
import "../graph/graph-view.js";
|
|
114
114
|
import "../health-factor/health-factor.js";
|
|
115
115
|
import "../horizontal-indicator/horizontal-indicator.js";
|
|
116
|
+
import "../layout/app-footer/app-footer.js";
|
|
117
|
+
import "../layout/app-header/app-header.js";
|
|
116
118
|
import "../layout/col/col.js";
|
|
117
119
|
import "../layout/container/container.js";
|
|
118
120
|
import "../layout/footer/footer.js";
|
|
@@ -161,7 +163,7 @@ import "../theme-provider.js";
|
|
|
161
163
|
import "../time-to-liquidation/time-to-liquidation.js";
|
|
162
164
|
import "../toggle/toggle.js";
|
|
163
165
|
import "../with-filter-button/with-filter-button.js";
|
|
164
|
-
function
|
|
166
|
+
function Br({
|
|
165
167
|
balances: a,
|
|
166
168
|
tokensList: l,
|
|
167
169
|
maxAssets: p = 3,
|
|
@@ -224,5 +226,5 @@ function qr({
|
|
|
224
226
|
] });
|
|
225
227
|
}
|
|
226
228
|
export {
|
|
227
|
-
|
|
229
|
+
Br as TokensListCell
|
|
228
230
|
};
|
|
@@ -113,6 +113,8 @@ import "lightweight-charts";
|
|
|
113
113
|
import "../graph/graph-view.js";
|
|
114
114
|
import "../health-factor/health-factor.js";
|
|
115
115
|
import "../horizontal-indicator/horizontal-indicator.js";
|
|
116
|
+
import "../layout/app-footer/app-footer.js";
|
|
117
|
+
import "../layout/app-header/app-header.js";
|
|
116
118
|
import "../layout/col/col.js";
|
|
117
119
|
import "../layout/container/container.js";
|
|
118
120
|
import "../layout/footer/footer.js";
|
|
@@ -161,7 +163,7 @@ import "../theme-provider.js";
|
|
|
161
163
|
import "../time-to-liquidation/time-to-liquidation.js";
|
|
162
164
|
import "../toggle/toggle.js";
|
|
163
165
|
import "../with-filter-button/with-filter-button.js";
|
|
164
|
-
function
|
|
166
|
+
function Kr({
|
|
165
167
|
toCopy: u,
|
|
166
168
|
children: d,
|
|
167
169
|
onCopySuccess: f,
|
|
@@ -243,5 +245,5 @@ function Dr({
|
|
|
243
245
|
return a ? /* @__PURE__ */ t(T, { placement: "top", triangle: !0, title: c(), children: a }) : c();
|
|
244
246
|
}
|
|
245
247
|
export {
|
|
246
|
-
|
|
248
|
+
Kr as WithCopy
|
|
247
249
|
};
|
package/dist/esm/hooks/index.js
CHANGED
|
@@ -1,56 +1,59 @@
|
|
|
1
|
-
import { useCheckboxSelect as
|
|
1
|
+
import { useCheckboxSelect as r } from "./use-checkbox-select.js";
|
|
2
2
|
import { useControllableState as i } from "./use-controllable-state.js";
|
|
3
3
|
import { useDebounce as u } from "./use-debounce.js";
|
|
4
4
|
import { useDebounceCall as l } from "./use-debounce-call.js";
|
|
5
|
-
import { getSortForField as p,
|
|
6
|
-
import { useHF as
|
|
7
|
-
import { useEditPriceManually as
|
|
8
|
-
import { useIsDesktop as
|
|
9
|
-
import { useOpenedState as
|
|
10
|
-
import { usePrevious as
|
|
11
|
-
import { useSmartNumberInput as
|
|
12
|
-
import { CELL_BAD as
|
|
5
|
+
import { getSortForField as p, getSortForFields as L, nextMultiSortState as x, useFilterAllSelected as n, useMultiSort as A, useRangeFilter as I, useSelectFilter as f, useSort as S } from "./use-filter.js";
|
|
6
|
+
import { useHF as C } from "./use-hf.js";
|
|
7
|
+
import { useEditPriceManually as E, useLiquidationGraphParams as F, useLiquidationHeatmap as b } from "./use-liquidation/index.js";
|
|
8
|
+
import { useIsDesktop as D, useIsExtraSmall as M, useIsMedium as P, useIsMobile as T, useIsTablet as h, useMediaQuery as O } from "./use-media-query.js";
|
|
9
|
+
import { useOpenedState as v } from "./use-opened-state.js";
|
|
10
|
+
import { usePrevious as N } from "./use-previous.js";
|
|
11
|
+
import { useSmartNumberInput as U } from "./use-smart-number-input.js";
|
|
12
|
+
import { CELL_BAD as H, CELL_CURRENT as X, CELL_GOOD as k, CELL_HOVERED as y, CELL_LIQUIDATION as Q, CELL_OK as V, DEFAULT_AXIS_MAX as B, DEFAULT_AXIS_MIN as K, formatAxisLabel as W, formatAxisTipLabel as j, formatAxisTipPrice as w, getCellClass as z, isPointInCell as J, useAxis as Y, useFixedAssets as Z, useIsAxisInRelativeUnits as $, useLiquidationGraphActivePrice as ee, useLiquidationGraphCurrentActiveValue as te, usePriceInNumber as re, useWithLiquidationGraphActivePrices as se } from "./use-liquidation/utils.js";
|
|
13
13
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
H as CELL_BAD,
|
|
15
|
+
X as CELL_CURRENT,
|
|
16
|
+
k as CELL_GOOD,
|
|
17
|
+
y as CELL_HOVERED,
|
|
18
|
+
Q as CELL_LIQUIDATION,
|
|
19
|
+
V as CELL_OK,
|
|
20
|
+
B as DEFAULT_AXIS_MAX,
|
|
21
|
+
K as DEFAULT_AXIS_MIN,
|
|
22
|
+
W as formatAxisLabel,
|
|
23
|
+
j as formatAxisTipLabel,
|
|
24
|
+
w as formatAxisTipPrice,
|
|
25
|
+
z as getCellClass,
|
|
26
26
|
p as getSortForField,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
L as getSortForFields,
|
|
28
|
+
J as isPointInCell,
|
|
29
|
+
x as nextMultiSortState,
|
|
30
|
+
Y as useAxis,
|
|
31
|
+
r as useCheckboxSelect,
|
|
30
32
|
i as useControllableState,
|
|
31
33
|
u as useDebounce,
|
|
32
34
|
l as useDebounceCall,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
E as useEditPriceManually,
|
|
36
|
+
n as useFilterAllSelected,
|
|
37
|
+
Z as useFixedAssets,
|
|
38
|
+
C as useHF,
|
|
39
|
+
$ as useIsAxisInRelativeUnits,
|
|
40
|
+
D as useIsDesktop,
|
|
41
|
+
M as useIsExtraSmall,
|
|
42
|
+
P as useIsMedium,
|
|
43
|
+
T as useIsMobile,
|
|
44
|
+
h as useIsTablet,
|
|
45
|
+
ee as useLiquidationGraphActivePrice,
|
|
46
|
+
te as useLiquidationGraphCurrentActiveValue,
|
|
47
|
+
F as useLiquidationGraphParams,
|
|
48
|
+
b as useLiquidationHeatmap,
|
|
49
|
+
O as useMediaQuery,
|
|
50
|
+
A as useMultiSort,
|
|
51
|
+
v as useOpenedState,
|
|
52
|
+
N as usePrevious,
|
|
53
|
+
re as usePriceInNumber,
|
|
54
|
+
I as useRangeFilter,
|
|
55
|
+
f as useSelectFilter,
|
|
56
|
+
U as useSmartNumberInput,
|
|
57
|
+
S as useSort,
|
|
58
|
+
se as useWithLiquidationGraphActivePrices
|
|
56
59
|
};
|
|
@@ -1,40 +1,74 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
function
|
|
3
|
-
const [
|
|
4
|
-
return [
|
|
1
|
+
import { useState as i, useCallback as c, useMemo as a } from "react";
|
|
2
|
+
function F() {
|
|
3
|
+
const [e, t] = i(null), r = c(() => t(null), []);
|
|
4
|
+
return [e, t, r];
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
const [
|
|
8
|
-
return [
|
|
6
|
+
function y(e = null) {
|
|
7
|
+
const [t, r] = i(e), n = c(() => r(null), []);
|
|
8
|
+
return [t, r, n];
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
10
|
+
const S = (e) => e === "asc" ? "desc" : "asc", M = (e, t) => {
|
|
11
|
+
if (e === t?.field)
|
|
12
|
+
return t.sort;
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
const [
|
|
16
|
-
|
|
17
|
-
),
|
|
18
|
-
(
|
|
19
|
-
|
|
14
|
+
function R(e = null) {
|
|
15
|
+
const [t, r] = i(
|
|
16
|
+
e
|
|
17
|
+
), n = c(
|
|
18
|
+
(o, s = "asc") => {
|
|
19
|
+
o === t?.field ? r({ field: o, sort: S(t.sort) }) : r({ field: o, sort: s });
|
|
20
20
|
},
|
|
21
|
-
[
|
|
21
|
+
[t]
|
|
22
22
|
);
|
|
23
|
-
return [
|
|
23
|
+
return [t, n];
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const b = (e, t) => {
|
|
26
|
+
const r = t?.findIndex((n) => n.field === e) ?? -1;
|
|
27
|
+
return !t || r === -1 ? { sort: void 0, priority: void 0 } : { sort: t[r].sort, priority: r + 1 };
|
|
28
|
+
};
|
|
29
|
+
function g(e, t, r = "asc", n = 2) {
|
|
30
|
+
const o = e.findIndex((u) => u.field === t);
|
|
31
|
+
if (o !== -1) {
|
|
32
|
+
if (e[o].sort === r) {
|
|
33
|
+
const u = [...e];
|
|
34
|
+
return u[o] = { field: t, sort: S(e[o].sort) }, u;
|
|
35
|
+
}
|
|
36
|
+
return e.filter((u) => u.field !== t);
|
|
37
|
+
}
|
|
38
|
+
const s = [{ field: t, sort: r }, ...e];
|
|
39
|
+
return s.length > n ? s.slice(0, n) : s;
|
|
40
|
+
}
|
|
41
|
+
function p(e = null, { maxFields: t = 2 } = {}) {
|
|
42
|
+
const [r, n] = i(
|
|
43
|
+
e ?? []
|
|
44
|
+
), o = c(
|
|
45
|
+
(l, d = "asc") => {
|
|
46
|
+
n(
|
|
47
|
+
(f) => g(f, l, d, t)
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
[t]
|
|
51
|
+
), s = c((l) => {
|
|
52
|
+
n((d) => d.filter((f) => f.field !== l));
|
|
53
|
+
}, []), u = c(() => n([]), []);
|
|
54
|
+
return [r, o, { removeSortField: s, resetSort: u }];
|
|
55
|
+
}
|
|
56
|
+
function C(e) {
|
|
57
|
+
return a(() => Object.values(e).reduce(
|
|
58
|
+
([r, n], o) => {
|
|
59
|
+
const s = !!o.state;
|
|
60
|
+
return [r || s, n && s];
|
|
30
61
|
},
|
|
31
62
|
[!1, !0]
|
|
32
|
-
), [
|
|
63
|
+
), [e]);
|
|
33
64
|
}
|
|
34
65
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
66
|
+
M as getSortForField,
|
|
67
|
+
b as getSortForFields,
|
|
68
|
+
g as nextMultiSortState,
|
|
69
|
+
C as useFilterAllSelected,
|
|
70
|
+
p as useMultiSort,
|
|
71
|
+
F as useRangeFilter,
|
|
72
|
+
y as useSelectFilter,
|
|
73
|
+
R as useSort
|
|
40
74
|
};
|