@gearbox-protocol/permissionless-ui 1.22.0-next.41 → 1.22.0-next.43
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/help-tip/help-tip.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/help-tip/help-tip.js +19 -19
- 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
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { IconQuestionCircle as u, IconInfo as v } from "@gearbox-protocol/static";
|
|
3
3
|
import { cva as T } from "class-variance-authority";
|
|
4
4
|
import * as l from "react";
|
|
5
5
|
import "@gearbox-protocol/sdk";
|
|
6
|
-
import { cn as
|
|
6
|
+
import { cn as c } from "../../utils/cn.js";
|
|
7
7
|
import "sonner";
|
|
8
8
|
import { SimpleTooltip as C } from "../tooltip/simple-tooltip.js";
|
|
9
9
|
const H = T("transition-colors", {
|
|
@@ -44,7 +44,7 @@ const H = T("transition-colors", {
|
|
|
44
44
|
({
|
|
45
45
|
className: t,
|
|
46
46
|
children: r,
|
|
47
|
-
maxWidth:
|
|
47
|
+
maxWidth: e,
|
|
48
48
|
minWidth: a,
|
|
49
49
|
delayShow: g = 200,
|
|
50
50
|
placement: y = "bottom",
|
|
@@ -55,8 +55,8 @@ const H = T("transition-colors", {
|
|
|
55
55
|
onPointerEnter: m,
|
|
56
56
|
...d
|
|
57
57
|
}, f) => {
|
|
58
|
-
const h = /* @__PURE__ */
|
|
59
|
-
|
|
58
|
+
const h = /* @__PURE__ */ o(
|
|
59
|
+
p,
|
|
60
60
|
{
|
|
61
61
|
ref: f,
|
|
62
62
|
iconSize: n,
|
|
@@ -68,13 +68,13 @@ const H = T("transition-colors", {
|
|
|
68
68
|
...d
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ o(
|
|
72
72
|
C,
|
|
73
73
|
{
|
|
74
74
|
title: h,
|
|
75
75
|
placement: y,
|
|
76
76
|
delayShow: g,
|
|
77
|
-
maxWidth:
|
|
77
|
+
maxWidth: e,
|
|
78
78
|
minWidth: a,
|
|
79
79
|
children: r
|
|
80
80
|
}
|
|
@@ -82,48 +82,48 @@ const H = T("transition-colors", {
|
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
84
|
I.displayName = "HelpTip";
|
|
85
|
-
const
|
|
85
|
+
const p = l.forwardRef(
|
|
86
86
|
({
|
|
87
87
|
className: t,
|
|
88
88
|
iconSize: r = 14,
|
|
89
|
-
iconColor:
|
|
89
|
+
iconColor: e = "gray-90",
|
|
90
90
|
iconHoverColor: a = "gray-110",
|
|
91
91
|
iconVariant: g = "question",
|
|
92
92
|
onPointerEnter: y,
|
|
93
93
|
...n
|
|
94
94
|
}, i) => {
|
|
95
95
|
const s = g === "question" ? u : v;
|
|
96
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ o(
|
|
97
97
|
"span",
|
|
98
98
|
{
|
|
99
99
|
ref: i,
|
|
100
100
|
role: "img",
|
|
101
101
|
"aria-hidden": !0,
|
|
102
|
-
className:
|
|
103
|
-
"inline-
|
|
104
|
-
H({ iconColor:
|
|
102
|
+
className: c(
|
|
103
|
+
"inline-flex items-center justify-center cursor-help",
|
|
104
|
+
H({ iconColor: e, iconHoverColor: a }),
|
|
105
105
|
t
|
|
106
106
|
),
|
|
107
107
|
style: { width: r, height: r },
|
|
108
108
|
onPointerEnter: y,
|
|
109
109
|
...n,
|
|
110
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ o(s, { size: r })
|
|
111
111
|
}
|
|
112
112
|
);
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
|
-
|
|
116
|
-
const N = l.forwardRef(({ className: t, ...r },
|
|
115
|
+
p.displayName = "HelpTipIcon";
|
|
116
|
+
const N = l.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ o(
|
|
117
117
|
"span",
|
|
118
118
|
{
|
|
119
|
-
ref:
|
|
120
|
-
className:
|
|
119
|
+
ref: e,
|
|
120
|
+
className: c("ml-1.5 inline-block leading-none", t),
|
|
121
121
|
...r
|
|
122
122
|
}
|
|
123
123
|
));
|
|
124
124
|
N.displayName = "TipWrap";
|
|
125
125
|
export {
|
|
126
126
|
I as HelpTip,
|
|
127
|
-
|
|
127
|
+
p as HelpTipIcon,
|
|
128
128
|
N as TipWrap
|
|
129
129
|
};
|