@gearbox-protocol/permissionless-ui 1.22.0-next.41 → 1.22.0-next.42
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/block-sync/block-sync.cjs +1 -1
- 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/complex-input/index.cjs +1 -1
- package/dist/cjs/components/currency-button/currency-button.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/smart-number-input/balance-indicator.cjs +1 -0
- package/dist/cjs/components/smart-number-input/index.cjs +1 -1
- package/dist/cjs/components/smart-number-input/smart-number-input.cjs +1 -1
- package/dist/cjs/hooks/index.cjs +1 -1
- package/dist/cjs/hooks/use-debounce-call.cjs +1 -1
- package/dist/cjs/hooks/use-hf.cjs +1 -1
- package/dist/cjs/hooks/use-media-query.cjs +1 -1
- package/dist/cjs/hooks/use-smart-number-input.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/utils/format-money.cjs +1 -1
- package/dist/esm/components/block-sync/block-sync.js +7 -5
- package/dist/esm/components/checkbox/checkbox-labeled.js +5 -3
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +5 -3
- package/dist/esm/components/complex-input/complex-input.js +57 -102
- package/dist/esm/components/complex-input/index.js +2 -3
- package/dist/esm/components/currency-button/currency-button.js +96 -74
- package/dist/esm/components/index.js +456 -455
- package/dist/esm/components/smart-number-input/balance-indicator.js +60 -0
- package/dist/esm/components/smart-number-input/index.js +4 -2
- package/dist/esm/components/smart-number-input/smart-number-input.js +139 -146
- package/dist/esm/hooks/index.js +38 -35
- package/dist/esm/hooks/use-debounce-call.js +7 -14
- package/dist/esm/hooks/use-hf.js +33 -25
- package/dist/esm/hooks/use-media-query.js +12 -11
- package/dist/esm/hooks/use-smart-number-input.js +10 -0
- package/dist/esm/index.js +590 -586
- package/dist/esm/utils/format-money.js +3 -5
- package/dist/globals.css +1 -1
- package/dist/types/components/complex-input/complex-input.d.ts +1 -33
- package/dist/types/components/currency-button/currency-button.d.ts +26 -61
- package/dist/types/components/smart-number-input/balance-indicator.d.ts +41 -0
- package/dist/types/components/smart-number-input/index.d.ts +1 -0
- package/dist/types/components/smart-number-input/smart-number-input.d.ts +29 -102
- package/dist/types/components/token-template/token-template.d.ts +2 -5
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/use-debounce-call.d.ts +1 -19
- package/dist/types/hooks/use-hf.d.ts +2 -1
- package/dist/types/hooks/use-media-query.d.ts +4 -0
- package/dist/types/hooks/use-smart-number-input.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,84 +1,106 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as b, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { IconExpand as g } from "@gearbox-protocol/static";
|
|
3
|
-
import {
|
|
3
|
+
import { cva as u } from "class-variance-authority";
|
|
4
|
+
import { TokenSymbol as k } from "../token-symbol/token-symbol.js";
|
|
4
5
|
import "react";
|
|
5
6
|
import "@gearbox-protocol/sdk";
|
|
6
|
-
import { cn as
|
|
7
|
+
import { cn as x } from "../../utils/cn.js";
|
|
7
8
|
import "sonner";
|
|
8
|
-
const w =
|
|
9
|
-
|
|
9
|
+
const w = 13, N = u(
|
|
10
|
+
"flex flex-row items-center text-foreground cursor-[unset]",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
xs: "text-sm leading-[17px]",
|
|
15
|
+
sm: "text-[16px] leading-[21px]",
|
|
16
|
+
md: "text-[21px] leading-[33px]"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: { size: "md" }
|
|
20
|
+
}
|
|
21
|
+
), V = {
|
|
10
22
|
sm: { symbol: 16, arrow: 8 },
|
|
11
|
-
md: { symbol: 28, arrow: 12 }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
md: { symbol: 28, arrow: 12 }
|
|
24
|
+
}, B = u(
|
|
25
|
+
"ml-0.5 leading-none text-gray-100 transition-transform duration-100 ease-[ease]",
|
|
26
|
+
{
|
|
27
|
+
variants: {
|
|
28
|
+
size: {
|
|
29
|
+
sm: "px-1",
|
|
30
|
+
md: "px-1.5"
|
|
31
|
+
},
|
|
32
|
+
active: {
|
|
33
|
+
true: "rotate-180",
|
|
34
|
+
false: ""
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: { size: "md", active: !1 }
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
function M({
|
|
41
|
+
title: n,
|
|
42
|
+
maxLength: l = w,
|
|
43
|
+
token: m,
|
|
44
|
+
disabled: d,
|
|
45
|
+
showSelectDialog: t,
|
|
46
|
+
size: o,
|
|
47
|
+
active: f = !1,
|
|
48
|
+
chainId: v,
|
|
49
|
+
network: y,
|
|
50
|
+
className: z,
|
|
51
|
+
children: c
|
|
33
52
|
}) {
|
|
34
|
-
const
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
53
|
+
const s = !d && t ? t : void 0, e = !!(t && !d), a = o === "xs" ? "sm" : o ?? "md", p = V[a];
|
|
54
|
+
return (
|
|
55
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: A uses div (CurrencyBlock); role + keyboard for a11y
|
|
56
|
+
/* @__PURE__ */ b(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
role: e ? "button" : void 0,
|
|
60
|
+
tabIndex: e ? 0 : void 0,
|
|
61
|
+
onKeyDown: e && s ? (i) => {
|
|
62
|
+
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), s());
|
|
63
|
+
} : void 0,
|
|
64
|
+
"data-active": e,
|
|
65
|
+
"data-testid": "currency-button",
|
|
66
|
+
onClick: s,
|
|
67
|
+
className: x(
|
|
68
|
+
"group",
|
|
69
|
+
N({ size: o }),
|
|
70
|
+
e && "cursor-pointer",
|
|
71
|
+
e && "hover:[&_.expand-wrap]:text-foreground",
|
|
72
|
+
z
|
|
73
|
+
),
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ r(
|
|
76
|
+
k,
|
|
77
|
+
{
|
|
78
|
+
title: n,
|
|
79
|
+
size: p.symbol,
|
|
80
|
+
token: m,
|
|
81
|
+
showSymbol: !0,
|
|
82
|
+
maxLength: l,
|
|
83
|
+
marginSize: a,
|
|
84
|
+
chainId: v,
|
|
85
|
+
network: y
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
!m && (c ?? n) ? /* @__PURE__ */ r("span", { className: "text-muted-foreground truncate", children: c ?? n }) : null,
|
|
89
|
+
t && /* @__PURE__ */ r(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: x(
|
|
93
|
+
"expand-wrap",
|
|
94
|
+
B({ size: a, active: f })
|
|
95
|
+
),
|
|
96
|
+
children: /* @__PURE__ */ r(g, { size: p.arrow })
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
)
|
|
80
102
|
);
|
|
81
103
|
}
|
|
82
104
|
export {
|
|
83
|
-
|
|
105
|
+
M as CurrencyButton
|
|
84
106
|
};
|