@hyperbridge/ui 0.0.2
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/LICENSE.txt +21 -0
- package/dist/chunk-O7MCYCGJ.mjs +1442 -0
- package/dist/icons/index.d.mts +101 -0
- package/dist/icons/index.mjs +100 -0
- package/dist/index.d.mts +845 -0
- package/dist/index.mjs +4812 -0
- package/package.json +75 -0
- package/styles/base.css +292 -0
- package/styles/shadcn.css +123 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,4812 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Alert_default,
|
|
3
|
+
ArrowBottomTop_default,
|
|
4
|
+
ArrowRight_default,
|
|
5
|
+
ArrowSplit_default,
|
|
6
|
+
ArrowTriangleBottom_default,
|
|
7
|
+
ArrowUpRight_default,
|
|
8
|
+
Check_default,
|
|
9
|
+
ChevronBottomDown_default,
|
|
10
|
+
ChevronDoubleRight_default,
|
|
11
|
+
ChevronDownSmall_default,
|
|
12
|
+
CircleInfo_default,
|
|
13
|
+
CirclePlaceholderDashed_default,
|
|
14
|
+
CirclePlaceholder_default,
|
|
15
|
+
Circle_default,
|
|
16
|
+
Clock_default,
|
|
17
|
+
Copy_default,
|
|
18
|
+
Gas_default,
|
|
19
|
+
Pen_default,
|
|
20
|
+
Percent_default,
|
|
21
|
+
Power_default,
|
|
22
|
+
RotateCcw_default,
|
|
23
|
+
Search_default,
|
|
24
|
+
Server_default,
|
|
25
|
+
StepBack_default,
|
|
26
|
+
Wallet_default,
|
|
27
|
+
XCircle_default,
|
|
28
|
+
XIcon_default,
|
|
29
|
+
__objRest,
|
|
30
|
+
__spreadProps,
|
|
31
|
+
__spreadValues
|
|
32
|
+
} from "./chunk-O7MCYCGJ.mjs";
|
|
33
|
+
|
|
34
|
+
// src/components/atoms/search-input.tsx
|
|
35
|
+
import { cva } from "class-variance-authority";
|
|
36
|
+
|
|
37
|
+
// src/lib/utils.ts
|
|
38
|
+
import { clsx } from "clsx";
|
|
39
|
+
import { twMerge } from "tailwind-merge";
|
|
40
|
+
function cn(...inputs) {
|
|
41
|
+
return twMerge(clsx(inputs));
|
|
42
|
+
}
|
|
43
|
+
function isSSR() {
|
|
44
|
+
return typeof window === "undefined";
|
|
45
|
+
}
|
|
46
|
+
function shortenAccountAddress(address, length = 6) {
|
|
47
|
+
return `${address.substring(0, length)}...${address.substring(
|
|
48
|
+
address.length - length
|
|
49
|
+
)}`;
|
|
50
|
+
}
|
|
51
|
+
var defaultPolkadotImage = {
|
|
52
|
+
name: "Polkadot",
|
|
53
|
+
src: "https://app.hyperbridge.network/networks/polkadot.png"
|
|
54
|
+
};
|
|
55
|
+
var defaultEvmImage = {
|
|
56
|
+
name: "Ethereum",
|
|
57
|
+
src: "https://app.hyperbridge.network/networks/ethereum.png"
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// src/components/atoms/search-input.tsx
|
|
61
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
62
|
+
function SearchInput(_a) {
|
|
63
|
+
var _b = _a, {
|
|
64
|
+
className = "h-[2rem]",
|
|
65
|
+
size = "sm"
|
|
66
|
+
} = _b, props = __objRest(_b, [
|
|
67
|
+
"className",
|
|
68
|
+
"size"
|
|
69
|
+
]);
|
|
70
|
+
return /* @__PURE__ */ jsxs(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: cn(
|
|
74
|
+
"flex items-center bg-brand-black-350 rounded-md relative",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
Search_default,
|
|
80
|
+
{
|
|
81
|
+
width: "1rem",
|
|
82
|
+
height: "1rem",
|
|
83
|
+
className: "basis-[1rem] absolute start-[0.625rem] shrink-0"
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ jsx(
|
|
87
|
+
"input",
|
|
88
|
+
__spreadProps(__spreadValues({
|
|
89
|
+
placeholder: "Search for transaction"
|
|
90
|
+
}, props), {
|
|
91
|
+
type: "text",
|
|
92
|
+
className: searchInput({ size })
|
|
93
|
+
})
|
|
94
|
+
)
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
var searchInput = cva(
|
|
100
|
+
"indent-[1.875rem] text-white py-[0.5rem] flex-1 h-full !outline-none rounded-md ring-1 ring-transparent focus:text-brand-white-500 focus-visible:ring-brand-black-300 placeholder:text-brand-black-100 pr-[0.625rem]",
|
|
101
|
+
{
|
|
102
|
+
variants: {
|
|
103
|
+
size: {
|
|
104
|
+
sm: "text-[calc(12rem/16)]",
|
|
105
|
+
md: "text-[calc(13rem/16)]"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
defaultVariants: {
|
|
109
|
+
size: "sm"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
// src/components/atoms/separator.tsx
|
|
115
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
116
|
+
function LabelledSeperator(props) {
|
|
117
|
+
return /* @__PURE__ */ jsxs2("div", { role: "presentation", className: "flex items-center", children: [
|
|
118
|
+
/* @__PURE__ */ jsx2("div", { className: "flex-1 border-t-2 border-brand-black-500" }),
|
|
119
|
+
/* @__PURE__ */ jsx2("div", { className: "inline-block px-2 text-xs", children: props.children }),
|
|
120
|
+
/* @__PURE__ */ jsx2("div", { className: "flex-1 border-t-2 border-brand-black-500" })
|
|
121
|
+
] });
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// src/components/atoms/text.tsx
|
|
125
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
126
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
127
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
128
|
+
var variant_ = {
|
|
129
|
+
disiplay: "text-display font-bold",
|
|
130
|
+
h1: "text-h1 font-bold",
|
|
131
|
+
h2: "text-h2 font-medium",
|
|
132
|
+
h3: "text-h3 font-bold",
|
|
133
|
+
h4: "text-h4 font-bold",
|
|
134
|
+
h5: "text-h5 font-bold",
|
|
135
|
+
h6: "text-h6 font-bold",
|
|
136
|
+
h7: "text-[1.25rem] font-medium",
|
|
137
|
+
body1: "text-body-2 font-medium",
|
|
138
|
+
body2: "text-body font-medium",
|
|
139
|
+
p: "text-base font-normal",
|
|
140
|
+
caption: "text-caption font-medium",
|
|
141
|
+
caption2: "text-caption-2 font-medium"
|
|
142
|
+
};
|
|
143
|
+
var textCVA = cva2("", {
|
|
144
|
+
variants: {
|
|
145
|
+
variant: variant_
|
|
146
|
+
},
|
|
147
|
+
defaultVariants: {
|
|
148
|
+
variant: "body1"
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
function Text(_a) {
|
|
152
|
+
var _b = _a, {
|
|
153
|
+
variant
|
|
154
|
+
} = _b, props = __objRest(_b, [
|
|
155
|
+
"variant"
|
|
156
|
+
]);
|
|
157
|
+
const _a2 = props, { asChild, className } = _a2, _props = __objRest(_a2, ["asChild", "className"]);
|
|
158
|
+
const Component = asChild ? Slot : "p";
|
|
159
|
+
return /* @__PURE__ */ jsx3(Component, __spreadProps(__spreadValues({}, _props), { className: textCVA({ variant, className }), children: props.children }));
|
|
160
|
+
}
|
|
161
|
+
function ListHeading({ text, count }) {
|
|
162
|
+
return /* @__PURE__ */ jsxs3(Text, { variant: "body2", className: "leading-[1.25rem]", children: [
|
|
163
|
+
/* @__PURE__ */ jsx3("span", { className: "text-brand-white-500", children: text }),
|
|
164
|
+
"\xA0",
|
|
165
|
+
/* @__PURE__ */ jsx3("span", { className: "text-brand-black-100", children: count })
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// src/components/badge-icon.tsx
|
|
170
|
+
import { Image } from "@unpic/react";
|
|
171
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
172
|
+
var safeRem = (value, defaultValue) => {
|
|
173
|
+
const parsed = Number.parseFloat(String(value));
|
|
174
|
+
if (Number.isNaN(parsed)) return defaultValue;
|
|
175
|
+
return `${parsed}rem`;
|
|
176
|
+
};
|
|
177
|
+
function BadgeIcon(props) {
|
|
178
|
+
const {
|
|
179
|
+
src = "",
|
|
180
|
+
className,
|
|
181
|
+
alt = "--",
|
|
182
|
+
badgeSrc = "",
|
|
183
|
+
badgeAlt = "",
|
|
184
|
+
outline = false
|
|
185
|
+
} = props;
|
|
186
|
+
const size = safeRem(props.size, "2rem");
|
|
187
|
+
return /* @__PURE__ */ jsxs4(
|
|
188
|
+
"div",
|
|
189
|
+
{
|
|
190
|
+
"data-chain": "true",
|
|
191
|
+
"data-token": "BNC",
|
|
192
|
+
className: "relative rounded-full w-[var(--badge-size)] h-[var(--badge-size)]",
|
|
193
|
+
style: {
|
|
194
|
+
fontSize: size,
|
|
195
|
+
"--badge-size": size
|
|
196
|
+
},
|
|
197
|
+
children: [
|
|
198
|
+
/* @__PURE__ */ jsx4(
|
|
199
|
+
Image,
|
|
200
|
+
{
|
|
201
|
+
src,
|
|
202
|
+
layout: "constrained",
|
|
203
|
+
width: 400,
|
|
204
|
+
aspectRatio: 1,
|
|
205
|
+
alt,
|
|
206
|
+
draggable: false,
|
|
207
|
+
objectFit: "cover",
|
|
208
|
+
className: cn(
|
|
209
|
+
"absolute inset-0 aspect-square h-full w-full rounded-full bg-white shrink-0",
|
|
210
|
+
className,
|
|
211
|
+
{
|
|
212
|
+
"border border-brand-black-600": outline
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
/* @__PURE__ */ jsx4(
|
|
218
|
+
"div",
|
|
219
|
+
{
|
|
220
|
+
className: cn(
|
|
221
|
+
"w-[0.4375em] h-[0.4375em] right-0 bottom-0 absolute bg-white rounded-[0.15625em] overflow-hidden outline outline-offset-[-1px] outline-neutral-900",
|
|
222
|
+
{
|
|
223
|
+
"outline-brand-black-600": outline
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
children: /* @__PURE__ */ jsx4(
|
|
227
|
+
Image,
|
|
228
|
+
{
|
|
229
|
+
src: badgeSrc,
|
|
230
|
+
layout: "constrained",
|
|
231
|
+
width: 24,
|
|
232
|
+
aspectRatio: 1,
|
|
233
|
+
draggable: false,
|
|
234
|
+
objectFit: "cover",
|
|
235
|
+
className: "w-full h-full",
|
|
236
|
+
alt: badgeAlt
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
function TokenTransferPair(props) {
|
|
246
|
+
const { fromToken, toToken } = props;
|
|
247
|
+
return /* @__PURE__ */ jsxs4("div", { className: "shrink-0 flex gap-1 items-center", children: [
|
|
248
|
+
/* @__PURE__ */ jsx4(BadgeIcon, __spreadProps(__spreadValues({}, fromToken), { size: props.size })),
|
|
249
|
+
/* @__PURE__ */ jsx4(ArrowRight_default, { width: "0.75rem", height: "0.75rem" }),
|
|
250
|
+
/* @__PURE__ */ jsx4(BadgeIcon, __spreadProps(__spreadValues({}, toToken), { size: props.size }))
|
|
251
|
+
] });
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// src/components/button/button.tsx
|
|
255
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
256
|
+
|
|
257
|
+
// src/@/ui/button.tsx
|
|
258
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
259
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
260
|
+
|
|
261
|
+
// src/components/button/shared.ts
|
|
262
|
+
var sharedButtonStyles = {
|
|
263
|
+
normalize: "inline-flex items-center justify-center select-none gap-2 whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
264
|
+
default: "bg-white text-brand-black-600 hover:bg-brand-white-400 focus-visible:ring-brand-neutral-200 disabled:opacity-100 disabled:text-brand-neutral-200",
|
|
265
|
+
secondary: "bg-brand-black-500 text-white focus-visible:ring-brand-black-200 disabled:text-brand-black-100 hover:bg-brand-black-300 disabled:opacity-100",
|
|
266
|
+
level_1: "bg-brand-black-350 text-white focus-visible:ring-brand-black-200 disabled:text-brand-black-100 hover:bg-brand-black-300 disabled:opacity-100",
|
|
267
|
+
level_2: "bg-brand-black-300 text-white focus-visible:ring-brand-black-200 disabled:text-brand-black-100 hover:bg-brand-black-200 disabled:opacity-100",
|
|
268
|
+
primary: "bg-white text-brand-black-600 hover:bg-brand-white-400 focus-visible:ring-brand-neutral-200 disabled:opacity-100 disabled:bg-brand-black-500 disabled:text-brand-black-100",
|
|
269
|
+
destructive: "bg-brand-danger-200 text-brand-danger-500 pointer-events-none focus-visible:ring-brand-danger-200 disabled:opacity-100",
|
|
270
|
+
unstyled: ""
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
// src/@/ui/button.tsx
|
|
274
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
275
|
+
var buttonVariants = cva3(
|
|
276
|
+
"inline-flex items-center justify-center select-none gap-2 whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",
|
|
277
|
+
{
|
|
278
|
+
variants: {
|
|
279
|
+
variant: {
|
|
280
|
+
default: sharedButtonStyles.default,
|
|
281
|
+
primary: sharedButtonStyles.primary,
|
|
282
|
+
secondary: sharedButtonStyles.secondary,
|
|
283
|
+
level_1: sharedButtonStyles.level_1,
|
|
284
|
+
level_2: sharedButtonStyles.level_2,
|
|
285
|
+
unset: sharedButtonStyles.unstyled,
|
|
286
|
+
message: "bg-brand-black-300 text-white hover:brightness-110",
|
|
287
|
+
destructive: sharedButtonStyles.destructive,
|
|
288
|
+
outline: "border bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
289
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
290
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
291
|
+
},
|
|
292
|
+
size: {
|
|
293
|
+
sm: "h-[30px] px-2 py-1.5 text-xs rounded-[0.625rem] gap-1.5 has-[>svg]:px-2.5",
|
|
294
|
+
xs: "h-[24px] px-1.5 py-1 text-xs rounded-lg gap-1 has-[>svg]:px-2.5",
|
|
295
|
+
default: "h-[46px] px-4 text-base py-2 rounded-2xl gap-2 has-[>svg]:px-3",
|
|
296
|
+
lg: "h-[48px] px-4 py-3.5 rounded-2xl text-base gap-2 has-[>svg]:px-4",
|
|
297
|
+
xl: "h-[52px] px-4 py-3.5 text-lg rounded-2xl gap-3 has-[>svg]:px-4",
|
|
298
|
+
unset: ""
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
defaultVariants: {
|
|
302
|
+
variant: "default",
|
|
303
|
+
size: "default"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
function Button(_a) {
|
|
308
|
+
var _b = _a, {
|
|
309
|
+
className,
|
|
310
|
+
variant,
|
|
311
|
+
size,
|
|
312
|
+
asChild = false,
|
|
313
|
+
animatedGradient = false
|
|
314
|
+
} = _b, props = __objRest(_b, [
|
|
315
|
+
"className",
|
|
316
|
+
"variant",
|
|
317
|
+
"size",
|
|
318
|
+
"asChild",
|
|
319
|
+
"animatedGradient"
|
|
320
|
+
]);
|
|
321
|
+
const Comp = asChild ? Slot2 : "button";
|
|
322
|
+
if (animatedGradient) {
|
|
323
|
+
return /* @__PURE__ */ jsx5("div", { className: "relative p-[1.5px] rounded-2xl animated-gradient-border", children: /* @__PURE__ */ jsx5(
|
|
324
|
+
Comp,
|
|
325
|
+
__spreadValues({
|
|
326
|
+
"data-slot": "button",
|
|
327
|
+
className: cn(buttonVariants({ variant, size, className }))
|
|
328
|
+
}, props)
|
|
329
|
+
) });
|
|
330
|
+
}
|
|
331
|
+
return /* @__PURE__ */ jsx5(
|
|
332
|
+
Comp,
|
|
333
|
+
__spreadValues({
|
|
334
|
+
"data-slot": "button",
|
|
335
|
+
className: cn(buttonVariants({ variant, size, className }))
|
|
336
|
+
}, props)
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// src/components/button/button.tsx
|
|
341
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
342
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
343
|
+
function Button2(_a) {
|
|
344
|
+
var _b = _a, { children } = _b, other = __objRest(_b, ["children"]);
|
|
345
|
+
return /* @__PURE__ */ jsx6(Button, __spreadProps(__spreadValues({ type: "button" }, other), { children }));
|
|
346
|
+
}
|
|
347
|
+
function ButtonAccessory(props) {
|
|
348
|
+
const { leftIcon = null, rightIcon = null, size = "default" } = props;
|
|
349
|
+
const accessory_classname = cn(
|
|
350
|
+
"inline-flex items-center justify-center aspect-square",
|
|
351
|
+
ACCESSORY_MAP[size]
|
|
352
|
+
);
|
|
353
|
+
return /* @__PURE__ */ jsxs5(
|
|
354
|
+
"span",
|
|
355
|
+
{
|
|
356
|
+
className: cn("inline-flex justify-center items-center", GAP_MAP[size]),
|
|
357
|
+
children: [
|
|
358
|
+
leftIcon ? /* @__PURE__ */ jsx6("span", { className: accessory_classname, children: leftIcon }) : null,
|
|
359
|
+
props.children,
|
|
360
|
+
rightIcon ? /* @__PURE__ */ jsx6("span", { className: accessory_classname, children: rightIcon }) : null
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
var GAP_MAP = {
|
|
366
|
+
xs: "gap-1",
|
|
367
|
+
sm: "gap-1.5",
|
|
368
|
+
default: "gap-2",
|
|
369
|
+
lg: "gap-2",
|
|
370
|
+
xl: "gap-3"
|
|
371
|
+
};
|
|
372
|
+
var ACCESSORY_MAP = {
|
|
373
|
+
xs: "w-[14px]",
|
|
374
|
+
sm: "w-[16px]",
|
|
375
|
+
default: "w-[20px]",
|
|
376
|
+
lg: "w-[20px]",
|
|
377
|
+
xl: "w-[24px]"
|
|
378
|
+
};
|
|
379
|
+
function AccessoryButton(_a) {
|
|
380
|
+
var _b = _a, {
|
|
381
|
+
children,
|
|
382
|
+
leftIcon,
|
|
383
|
+
rightIcon
|
|
384
|
+
} = _b, other = __objRest(_b, [
|
|
385
|
+
"children",
|
|
386
|
+
"leftIcon",
|
|
387
|
+
"rightIcon"
|
|
388
|
+
]);
|
|
389
|
+
return /* @__PURE__ */ jsx6(Button, __spreadProps(__spreadValues({ type: "button" }, other), { children: /* @__PURE__ */ jsx6(
|
|
390
|
+
ButtonAccessory,
|
|
391
|
+
{
|
|
392
|
+
size: other.size,
|
|
393
|
+
leftIcon,
|
|
394
|
+
rightIcon,
|
|
395
|
+
children
|
|
396
|
+
}
|
|
397
|
+
) }));
|
|
398
|
+
}
|
|
399
|
+
var cvaIconButton = cva4(
|
|
400
|
+
"aspect-square inline-flex items-center justify-center select-none gap-2 transition-all disabled:pointer-events-none disabled:opacity-50 outline-none focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
401
|
+
{
|
|
402
|
+
variants: {
|
|
403
|
+
variant: {
|
|
404
|
+
default: sharedButtonStyles.default,
|
|
405
|
+
secondary: sharedButtonStyles.secondary,
|
|
406
|
+
level_1: sharedButtonStyles.level_1,
|
|
407
|
+
level_2: sharedButtonStyles.level_2,
|
|
408
|
+
primary: sharedButtonStyles.primary,
|
|
409
|
+
destructive: sharedButtonStyles.destructive,
|
|
410
|
+
message: "bg-brand-black-300 text-white hover:brightness-110",
|
|
411
|
+
unset: ""
|
|
412
|
+
},
|
|
413
|
+
size: {
|
|
414
|
+
xs: "w-[20px]",
|
|
415
|
+
smx: "w-[30px]",
|
|
416
|
+
sm: "w-[32px]",
|
|
417
|
+
default: "w-[40px]",
|
|
418
|
+
lg: "w-[48px]",
|
|
419
|
+
xl: "w-[52px]",
|
|
420
|
+
unset: ""
|
|
421
|
+
},
|
|
422
|
+
rounded: {
|
|
423
|
+
xs: "rounded-[8px]",
|
|
424
|
+
smx: "rounded-[10px]",
|
|
425
|
+
sm: "rounded-[10px]",
|
|
426
|
+
lg: "rounded-[16px]",
|
|
427
|
+
xl: "rounded-[16px]",
|
|
428
|
+
default: "rounded-[16px]",
|
|
429
|
+
full: "rounded-full",
|
|
430
|
+
unset: ""
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
defaultVariants: {
|
|
434
|
+
variant: "default",
|
|
435
|
+
size: "default"
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
);
|
|
439
|
+
function IconButton(props) {
|
|
440
|
+
const _a = props, {
|
|
441
|
+
variant,
|
|
442
|
+
asChild = false,
|
|
443
|
+
size = "default",
|
|
444
|
+
rounded = "default",
|
|
445
|
+
className
|
|
446
|
+
} = _a, _props = __objRest(_a, [
|
|
447
|
+
"variant",
|
|
448
|
+
"asChild",
|
|
449
|
+
"size",
|
|
450
|
+
"rounded",
|
|
451
|
+
"className"
|
|
452
|
+
]);
|
|
453
|
+
const Component = asChild ? Slot3 : "button";
|
|
454
|
+
return /* @__PURE__ */ jsx6(
|
|
455
|
+
Component,
|
|
456
|
+
__spreadProps(__spreadValues({
|
|
457
|
+
type: "button"
|
|
458
|
+
}, _props), {
|
|
459
|
+
className: cvaIconButton({
|
|
460
|
+
variant,
|
|
461
|
+
size,
|
|
462
|
+
rounded: rounded === "default" ? size : "full",
|
|
463
|
+
className: cn("inline-flex items-center justify-center", className)
|
|
464
|
+
}),
|
|
465
|
+
children: props.children
|
|
466
|
+
})
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// src/components/button/tag-button.tsx
|
|
471
|
+
import { Image as Image2 } from "@unpic/react";
|
|
472
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
473
|
+
function TagButton(props) {
|
|
474
|
+
const _a = props, { className, variant = "trigger" } = _a, _props = __objRest(_a, ["className", "variant"]);
|
|
475
|
+
return /* @__PURE__ */ jsxs6(
|
|
476
|
+
BaseButton,
|
|
477
|
+
__spreadProps(__spreadValues({
|
|
478
|
+
type: "button"
|
|
479
|
+
}, _props), {
|
|
480
|
+
className: cn("h-10", className, {
|
|
481
|
+
"pe-3": variant === "badge"
|
|
482
|
+
}),
|
|
483
|
+
children: [
|
|
484
|
+
/* @__PURE__ */ jsx7(
|
|
485
|
+
Image2,
|
|
486
|
+
{
|
|
487
|
+
src: props.src,
|
|
488
|
+
alt: props.symbol,
|
|
489
|
+
layout: "constrained",
|
|
490
|
+
className: "w-5 h-5 shrink-0 rounded-full",
|
|
491
|
+
width: 20,
|
|
492
|
+
aspectRatio: 1
|
|
493
|
+
}
|
|
494
|
+
),
|
|
495
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[14px] w-max shrink-0 overflow-hidden", children: props.symbol }),
|
|
496
|
+
variant === "trigger" ? /* @__PURE__ */ jsx7("span", { className: "w-4 h-4 shrink-0 inline-flex items-center justify-center text-brand-black-100 aspect-square", children: /* @__PURE__ */ jsx7(ChevronDownSmall_default, { className: "size-[1rem]" }) }) : null
|
|
497
|
+
]
|
|
498
|
+
})
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
function SwapTokenButton(props) {
|
|
502
|
+
const _a = props, { token, network } = _a, _props = __objRest(_a, ["token", "network"]);
|
|
503
|
+
return /* @__PURE__ */ jsxs6(BaseButton, __spreadProps(__spreadValues({}, _props), { children: [
|
|
504
|
+
/* @__PURE__ */ jsx7("span", { className: "inline-flex text-[0.875rem]", children: /* @__PURE__ */ jsx7(
|
|
505
|
+
BadgeIcon,
|
|
506
|
+
{
|
|
507
|
+
src: token.image,
|
|
508
|
+
alt: token.symbol,
|
|
509
|
+
badgeAlt: network.name,
|
|
510
|
+
badgeSrc: network.image
|
|
511
|
+
}
|
|
512
|
+
) }),
|
|
513
|
+
/* @__PURE__ */ jsxs6("span", { className: "flex flex-col font-medium shrink-0 text-start max-w-[10ch]", children: [
|
|
514
|
+
/* @__PURE__ */ jsx7("span", { className: "text-sm uppercase text-brand-white-500 leading-[1.2]", children: token.symbol.toLowerCase() }),
|
|
515
|
+
/* @__PURE__ */ jsxs6("span", { className: "text-xs text-brand-black-100 leading-[1.2]", children: [
|
|
516
|
+
"on ",
|
|
517
|
+
/* @__PURE__ */ jsx7("span", { className: "capitalize", children: network.name.toLowerCase() })
|
|
518
|
+
] })
|
|
519
|
+
] }),
|
|
520
|
+
/* @__PURE__ */ jsx7("span", { className: "w-4 h-4 shrink-0 ml-1 inline-flex items-center justify-center text-brand-black-100 aspect-square", children: /* @__PURE__ */ jsx7(ChevronDownSmall_default, { className: "size-3", strokeWidth: 3 }) })
|
|
521
|
+
] }));
|
|
522
|
+
}
|
|
523
|
+
function BridgeTokenButton(props) {
|
|
524
|
+
const _a = props, { token } = _a, _props = __objRest(_a, ["token"]);
|
|
525
|
+
return /* @__PURE__ */ jsxs6(BaseButton, __spreadProps(__spreadValues({}, _props), { children: [
|
|
526
|
+
/* @__PURE__ */ jsx7(
|
|
527
|
+
Image2,
|
|
528
|
+
{
|
|
529
|
+
src: token.image,
|
|
530
|
+
alt: token.symbol,
|
|
531
|
+
layout: "constrained",
|
|
532
|
+
className: "w-[1.75rem] h-[1.75rem] shrink-0 rounded-full",
|
|
533
|
+
width: 20,
|
|
534
|
+
aspectRatio: 1
|
|
535
|
+
}
|
|
536
|
+
),
|
|
537
|
+
/* @__PURE__ */ jsx7("span", { className: "flex flex-col font-medium shrink-0 text-start max-w-[10ch]", children: /* @__PURE__ */ jsx7("span", { className: "text-sm uppercase text-brand-white-500", children: token.symbol.toLowerCase() }) }),
|
|
538
|
+
/* @__PURE__ */ jsx7("span", { className: "w-4 h-4 shrink-0 ml-1 inline-flex items-center justify-center text-brand-black-100 aspect-square", children: /* @__PURE__ */ jsx7(ChevronDownSmall_default, { strokeWidth: 3, className: "size-[0.8em]" }) })
|
|
539
|
+
] }));
|
|
540
|
+
}
|
|
541
|
+
function BaseButton(props) {
|
|
542
|
+
const _a = props, { className } = _a, restProps = __objRest(_a, ["className"]);
|
|
543
|
+
return /* @__PURE__ */ jsx7(
|
|
544
|
+
"button",
|
|
545
|
+
__spreadProps(__spreadValues({
|
|
546
|
+
type: "button"
|
|
547
|
+
}, restProps), {
|
|
548
|
+
className: cn(
|
|
549
|
+
sharedButtonStyles.normalize,
|
|
550
|
+
sharedButtonStyles.secondary,
|
|
551
|
+
"items-center font-medium px-[0.375rem] pe-[0.5rem] py-[0.375rem] gap-[8px] justify-center rounded-[1rem] hover:brightness-110 bg-brand-black-300",
|
|
552
|
+
className
|
|
553
|
+
),
|
|
554
|
+
children: props.children
|
|
555
|
+
})
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// src/components/button/gradient-button.tsx
|
|
560
|
+
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
561
|
+
import React from "react";
|
|
562
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
563
|
+
var GradientButton = React.forwardRef((props, ref) => {
|
|
564
|
+
const _a = props, { asChild, variant, size, className } = _a, PROPS = __objRest(_a, ["asChild", "variant", "size", "className"]);
|
|
565
|
+
const Comp = asChild ? Slot4 : "button";
|
|
566
|
+
return /* @__PURE__ */ jsx8("div", { className: "relative p-[1.5px] rounded-2xl animated-gradient-border", children: /* @__PURE__ */ jsx8(
|
|
567
|
+
Comp,
|
|
568
|
+
__spreadProps(__spreadValues({
|
|
569
|
+
ref,
|
|
570
|
+
"data-slot": "button"
|
|
571
|
+
}, PROPS), {
|
|
572
|
+
className: cn("w-full", buttonVariants({ variant, size, className }))
|
|
573
|
+
})
|
|
574
|
+
) });
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
// src/@/ui/input.tsx
|
|
578
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
579
|
+
function Input(_a) {
|
|
580
|
+
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
581
|
+
return /* @__PURE__ */ jsx9(
|
|
582
|
+
"input",
|
|
583
|
+
__spreadValues({
|
|
584
|
+
type,
|
|
585
|
+
"data-slot": "input",
|
|
586
|
+
className: cn(
|
|
587
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
588
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
589
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
590
|
+
className
|
|
591
|
+
)
|
|
592
|
+
}, props)
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// src/lib/form-utils.ts
|
|
597
|
+
var createKeyDownHandler = () => {
|
|
598
|
+
return (e) => {
|
|
599
|
+
if (["e", "E", "+", "-"].includes(e.key) || /^[a-zA-Z]$/.test(e.key)) {
|
|
600
|
+
e.preventDefault();
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
// src/components/form/swap-form.tsx
|
|
606
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
607
|
+
function SwapForm({
|
|
608
|
+
senderAddress,
|
|
609
|
+
senderBalance = "0",
|
|
610
|
+
senderAmount = "",
|
|
611
|
+
senderUsdValue = "0",
|
|
612
|
+
senderToken = {
|
|
613
|
+
symbol: "DOT",
|
|
614
|
+
image: "https://app.hyperbridge.network/networks/polkadot.png",
|
|
615
|
+
network: {
|
|
616
|
+
name: "Polkadot",
|
|
617
|
+
image: "https://app.hyperbridge.network/networks/polkadot.png"
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
onSenderAmountChange,
|
|
621
|
+
onSenderTokenSelect,
|
|
622
|
+
receiverAddress,
|
|
623
|
+
receiverAmount = "0",
|
|
624
|
+
receiverUsdValue = "0",
|
|
625
|
+
receiverToken = {
|
|
626
|
+
symbol: "DOT",
|
|
627
|
+
image: "https://app.hyperbridge.network/networks/polkadot.png",
|
|
628
|
+
network: {
|
|
629
|
+
name: "Ethereum",
|
|
630
|
+
image: "https://app.hyperbridge.network/networks/ethereum.png"
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
onReceiverTokenSelect,
|
|
634
|
+
onReceiverAddressEdit,
|
|
635
|
+
percentagePresets = [25, 50, 100],
|
|
636
|
+
activePercentage = null,
|
|
637
|
+
onPercentageClick,
|
|
638
|
+
onPercentageReset,
|
|
639
|
+
onInvert,
|
|
640
|
+
estimatedTime = "~ 10 min",
|
|
641
|
+
isLoading = false,
|
|
642
|
+
className,
|
|
643
|
+
error = false
|
|
644
|
+
}) {
|
|
645
|
+
const handleKeyDown = createKeyDownHandler();
|
|
646
|
+
const handlePercentageClick = (percentage) => {
|
|
647
|
+
const numericBalance = Number.parseFloat(senderBalance.replace(/[^\d.]/g, "")) || 0;
|
|
648
|
+
const amount = numericBalance * percentage / 100;
|
|
649
|
+
onSenderAmountChange == null ? void 0 : onSenderAmountChange(amount.toString());
|
|
650
|
+
onPercentageClick == null ? void 0 : onPercentageClick(percentage);
|
|
651
|
+
};
|
|
652
|
+
const handleInvert = () => {
|
|
653
|
+
onInvert == null ? void 0 : onInvert();
|
|
654
|
+
};
|
|
655
|
+
const formatPercentageLabel = (percentage) => {
|
|
656
|
+
return percentage === 100 ? "Max" : `${percentage}%`;
|
|
657
|
+
};
|
|
658
|
+
return /* @__PURE__ */ jsxs7(
|
|
659
|
+
"div",
|
|
660
|
+
{
|
|
661
|
+
className: cn(
|
|
662
|
+
"flex flex-col bg-brand-black-550 h-[300px] max-w-[440px] rounded-[16px]",
|
|
663
|
+
className
|
|
664
|
+
),
|
|
665
|
+
children: [
|
|
666
|
+
/* @__PURE__ */ jsx10(
|
|
667
|
+
"div",
|
|
668
|
+
{
|
|
669
|
+
"data-testid": "send-section",
|
|
670
|
+
className: cn(
|
|
671
|
+
"relative h-1/2 -mx-[1.5px] rounded-[16px] p-[1.5px] transition-all duration-200",
|
|
672
|
+
error ? "bg-brand-danger-500 focus-within:bg-brand-danger-500/60 hover:bg-brand-danger-500/60" : "bridge-form-border"
|
|
673
|
+
),
|
|
674
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "bg-brand-black-500 rounded-[14.5px] h-full p-3 relative", children: [
|
|
675
|
+
/* @__PURE__ */ jsxs7("div", { className: "w-full flex justify-between", children: [
|
|
676
|
+
/* @__PURE__ */ jsx10("div", { className: "w-1/2", children: /* @__PURE__ */ jsx10("p", { className: "text-caption text-brand-black-100 font-medium", children: "Send" }) }),
|
|
677
|
+
/* @__PURE__ */ jsx10("div", { className: "w-1/2", children: /* @__PURE__ */ jsxs7("div", { className: "text-caption text-brand-black-100 font-medium text-right flex items-center gap-1 justify-end", children: [
|
|
678
|
+
/* @__PURE__ */ jsx10("span", { className: "max-w-[100px] truncate", children: senderAddress ? senderAddress : "Balance" }),
|
|
679
|
+
" ",
|
|
680
|
+
/* @__PURE__ */ jsx10("span", { className: "text-white max-w-[100px] truncate", children: isLoading ? /* @__PURE__ */ jsx10(
|
|
681
|
+
"div",
|
|
682
|
+
{
|
|
683
|
+
className: cn(
|
|
684
|
+
"w-8 h-3 bg-brand-black-200 animate-pulse rounded",
|
|
685
|
+
error && "text-danger-500"
|
|
686
|
+
)
|
|
687
|
+
}
|
|
688
|
+
) : senderBalance })
|
|
689
|
+
] }) })
|
|
690
|
+
] }),
|
|
691
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex mt-3", children: [
|
|
692
|
+
/* @__PURE__ */ jsx10(
|
|
693
|
+
Input,
|
|
694
|
+
{
|
|
695
|
+
min: 0,
|
|
696
|
+
type: "number",
|
|
697
|
+
placeholder: "0",
|
|
698
|
+
value: senderAmount,
|
|
699
|
+
onChange: (event) => {
|
|
700
|
+
onSenderAmountChange == null ? void 0 : onSenderAmountChange(event.target.value, event);
|
|
701
|
+
onPercentageReset == null ? void 0 : onPercentageReset();
|
|
702
|
+
},
|
|
703
|
+
onKeyDown: handleKeyDown,
|
|
704
|
+
disabled: isLoading,
|
|
705
|
+
"data-testid": "sender-amount-input",
|
|
706
|
+
className: "border-none ring-0 focus-visible:ring-0 focus-visible:ring-offset-0 text-[48px] leading-[1.2] h-[58px] p-0 text-white placeholder:text-brand-black-100 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none disabled:opacity-50"
|
|
707
|
+
}
|
|
708
|
+
),
|
|
709
|
+
/* @__PURE__ */ jsx10("div", { className: "w-[170px] pl-3 py-[13px]", children: /* @__PURE__ */ jsx10(
|
|
710
|
+
SwapTokenButton,
|
|
711
|
+
{
|
|
712
|
+
network: senderToken.network,
|
|
713
|
+
token: { image: senderToken.image, symbol: senderToken.symbol },
|
|
714
|
+
onClick: onSenderTokenSelect,
|
|
715
|
+
disabled: isLoading
|
|
716
|
+
}
|
|
717
|
+
) })
|
|
718
|
+
] }),
|
|
719
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex justify-between pt-1 pb-3", children: [
|
|
720
|
+
/* @__PURE__ */ jsxs7(
|
|
721
|
+
"div",
|
|
722
|
+
{
|
|
723
|
+
"data-testid": "sender-usd-value",
|
|
724
|
+
className: "flex items-center text-caption text-brand-black-100 font-medium min-h-6",
|
|
725
|
+
children: [
|
|
726
|
+
"$",
|
|
727
|
+
isLoading ? /* @__PURE__ */ jsx10("div", { className: "w-8 h-3 bg-brand-black-200 animate-pulse rounded ml-1" }) : senderUsdValue
|
|
728
|
+
]
|
|
729
|
+
}
|
|
730
|
+
),
|
|
731
|
+
senderAddress && /* @__PURE__ */ jsx10("div", { className: "flex gap-[6px]", children: percentagePresets.map((percentage) => /* @__PURE__ */ jsx10(
|
|
732
|
+
Button,
|
|
733
|
+
{
|
|
734
|
+
onClick: () => handlePercentageClick(percentage),
|
|
735
|
+
disabled: isLoading,
|
|
736
|
+
className: cn(
|
|
737
|
+
"rounded-[60px] h-6 py-1 px-[9.5px] text-caption transition-colors",
|
|
738
|
+
activePercentage === percentage ? "bg-white text-brand-black-500 hover:bg-white/90" : "text-brand-black-100 hover:text-white hover:bg-brand-black-200"
|
|
739
|
+
),
|
|
740
|
+
variant: "message",
|
|
741
|
+
size: "sm",
|
|
742
|
+
children: formatPercentageLabel(percentage)
|
|
743
|
+
},
|
|
744
|
+
percentage
|
|
745
|
+
)) })
|
|
746
|
+
] }),
|
|
747
|
+
/* @__PURE__ */ jsx10(
|
|
748
|
+
"button",
|
|
749
|
+
{
|
|
750
|
+
type: "button",
|
|
751
|
+
onClick: handleInvert,
|
|
752
|
+
disabled: isLoading,
|
|
753
|
+
"aria-label": "ArrowDownUp",
|
|
754
|
+
className: "absolute group -bottom-[15px] left-1/2 -translate-x-1/2 bg-brand-black-200 rounded-[8px] p-[6px] border-[3px] border-brand-black-500 cursor-pointer hover:scale-105 transition-all duration-200 disabled:cursor-not-allowed disabled:hover:scale-100",
|
|
755
|
+
children: /* @__PURE__ */ jsx10(
|
|
756
|
+
ArrowBottomTop_default,
|
|
757
|
+
{
|
|
758
|
+
className: "text-brand-black-100 size-3.5 transition-transform duration-200"
|
|
759
|
+
}
|
|
760
|
+
)
|
|
761
|
+
}
|
|
762
|
+
)
|
|
763
|
+
] })
|
|
764
|
+
}
|
|
765
|
+
),
|
|
766
|
+
/* @__PURE__ */ jsxs7("div", { className: "h-1/2 relative p-3", children: [
|
|
767
|
+
/* @__PURE__ */ jsxs7("div", { className: "w-full flex justify-between", children: [
|
|
768
|
+
/* @__PURE__ */ jsx10("div", { className: "w-1/2", children: /* @__PURE__ */ jsx10("div", { className: "text-caption text-brand-black-100 font-medium", children: "Receive" }) }),
|
|
769
|
+
receiverAddress && /* @__PURE__ */ jsx10("div", { className: "w-1/2", children: /* @__PURE__ */ jsxs7("div", { className: "text-caption text-brand-black-100 font-medium text-right flex items-center justify-end", children: [
|
|
770
|
+
/* @__PURE__ */ jsx10("span", { className: "max-w-[100px] truncate", children: receiverAddress }),
|
|
771
|
+
" ",
|
|
772
|
+
/* @__PURE__ */ jsx10(
|
|
773
|
+
"button",
|
|
774
|
+
{
|
|
775
|
+
type: "button",
|
|
776
|
+
onClick: onReceiverAddressEdit,
|
|
777
|
+
disabled: isLoading,
|
|
778
|
+
"aria-label": "Edit receiver's address",
|
|
779
|
+
className: "cursor-pointer hover:scale-110 transition-transform disabled:opacity-50 ml-1",
|
|
780
|
+
children: /* @__PURE__ */ jsx10(Pen_default, { className: "size-3.5" })
|
|
781
|
+
}
|
|
782
|
+
)
|
|
783
|
+
] }) })
|
|
784
|
+
] }),
|
|
785
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex mt-3", children: [
|
|
786
|
+
/* @__PURE__ */ jsx10("div", { className: "w-full text-[48px] leading-[1.2] h-[58px] flex items-center", children: isLoading ? /* @__PURE__ */ jsx10("div", { className: "w-16 h-12 bg-brand-black-200 animate-pulse rounded" }) : /* @__PURE__ */ jsx10(
|
|
787
|
+
"span",
|
|
788
|
+
{
|
|
789
|
+
"data-testid": "receiver-amount",
|
|
790
|
+
className: "text-brand-black-100 max-w-[250px] truncate",
|
|
791
|
+
children: receiverAmount
|
|
792
|
+
}
|
|
793
|
+
) }),
|
|
794
|
+
/* @__PURE__ */ jsx10("div", { className: "w-[170px] pl-3 py-[13px]", children: /* @__PURE__ */ jsx10(
|
|
795
|
+
SwapTokenButton,
|
|
796
|
+
{
|
|
797
|
+
network: receiverToken.network,
|
|
798
|
+
token: {
|
|
799
|
+
image: receiverToken.image,
|
|
800
|
+
symbol: receiverToken.symbol
|
|
801
|
+
},
|
|
802
|
+
onClick: onReceiverTokenSelect,
|
|
803
|
+
disabled: isLoading
|
|
804
|
+
}
|
|
805
|
+
) })
|
|
806
|
+
] }),
|
|
807
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex justify-between pt-1 pb-3", children: [
|
|
808
|
+
/* @__PURE__ */ jsxs7(
|
|
809
|
+
"div",
|
|
810
|
+
{
|
|
811
|
+
"data-testid": "receiver-usd-value",
|
|
812
|
+
className: "flex items-center text-caption text-brand-black-100 font-medium",
|
|
813
|
+
children: [
|
|
814
|
+
"$",
|
|
815
|
+
isLoading ? /* @__PURE__ */ jsx10("div", { className: "w-8 h-3 bg-brand-black-200 animate-pulse rounded ml-1" }) : receiverUsdValue
|
|
816
|
+
]
|
|
817
|
+
}
|
|
818
|
+
),
|
|
819
|
+
senderAddress && receiverAddress && /* @__PURE__ */ jsx10("div", { className: "text-brand-black-100 text-caption font-medium", children: isLoading ? /* @__PURE__ */ jsx10("div", { className: "w-12 h-3 bg-brand-black-200 animate-pulse rounded" }) : `~ ${estimatedTime}` })
|
|
820
|
+
] })
|
|
821
|
+
] })
|
|
822
|
+
]
|
|
823
|
+
}
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// src/components/images/token-image.tsx
|
|
828
|
+
import { Image as Image3 } from "@unpic/react";
|
|
829
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
830
|
+
function TokenImage(props) {
|
|
831
|
+
return /* @__PURE__ */ jsx11(
|
|
832
|
+
Image3,
|
|
833
|
+
{
|
|
834
|
+
src: props.src,
|
|
835
|
+
alt: props.alt,
|
|
836
|
+
layout: "constrained",
|
|
837
|
+
className: cn("shrink-0 object-cover rounded-full", props.className),
|
|
838
|
+
width: 20,
|
|
839
|
+
aspectRatio: 1
|
|
840
|
+
}
|
|
841
|
+
);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// src/components/atoms/smooth-corners.tsx
|
|
845
|
+
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
846
|
+
import React2 from "react";
|
|
847
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
848
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
849
|
+
var SmoothCornersSingleton = {
|
|
850
|
+
activated: false,
|
|
851
|
+
promise: null,
|
|
852
|
+
async init() {
|
|
853
|
+
if (isSSR()) return;
|
|
854
|
+
if (this.activated && this.promise) {
|
|
855
|
+
await this.promise;
|
|
856
|
+
return;
|
|
857
|
+
}
|
|
858
|
+
if ("CSS" in window) {
|
|
859
|
+
this.promise = (CSS.paintWorklet || paintWorklet).addModule(
|
|
860
|
+
"worklets/smooth-corners/paint.js"
|
|
861
|
+
);
|
|
862
|
+
this.activated = true;
|
|
863
|
+
await this.promise;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
var smoothCornersVariants = cva5("superellipse", {
|
|
868
|
+
variants: {
|
|
869
|
+
size: {
|
|
870
|
+
sm: "superellipse-sm",
|
|
871
|
+
default: "superellipse-base"
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
defaultVariants: {
|
|
875
|
+
size: "default"
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
function SmoothCorners(props) {
|
|
879
|
+
const { size } = props;
|
|
880
|
+
const [isLoaded, setIsLoaded] = React2.useState(false);
|
|
881
|
+
React2.useEffect(() => {
|
|
882
|
+
SmoothCornersSingleton.init().then(() => setIsLoaded(true)).catch(() => {
|
|
883
|
+
console.error(
|
|
884
|
+
"SmoothCorners/SuperEllipsePainter: Error Loading Necessary Worklet"
|
|
885
|
+
);
|
|
886
|
+
});
|
|
887
|
+
}, []);
|
|
888
|
+
return /* @__PURE__ */ jsx12(
|
|
889
|
+
Slot5,
|
|
890
|
+
{
|
|
891
|
+
className: cn(
|
|
892
|
+
props.className,
|
|
893
|
+
smoothCornersVariants({ size }),
|
|
894
|
+
isLoaded ? "loaded" : ""
|
|
895
|
+
),
|
|
896
|
+
children: props.children
|
|
897
|
+
}
|
|
898
|
+
);
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// src/components/molecules/network-switcher.tsx
|
|
902
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
903
|
+
var NetworkSwitcher = ({
|
|
904
|
+
from,
|
|
905
|
+
to,
|
|
906
|
+
onNetworkInvert,
|
|
907
|
+
onSourceClick,
|
|
908
|
+
onDestinationClick
|
|
909
|
+
}) => {
|
|
910
|
+
return /* @__PURE__ */ jsxs8("div", { className: "relative flex w-full max-w-[440px] gap-2", children: [
|
|
911
|
+
/* @__PURE__ */ jsx13(
|
|
912
|
+
NetworkSwitcherButton,
|
|
913
|
+
{
|
|
914
|
+
label: "From",
|
|
915
|
+
image: { src: from.image, alt: from.name },
|
|
916
|
+
onClick: onSourceClick,
|
|
917
|
+
children: from.name
|
|
918
|
+
}
|
|
919
|
+
),
|
|
920
|
+
/* @__PURE__ */ jsx13(
|
|
921
|
+
NetworkSwitcherButton,
|
|
922
|
+
{
|
|
923
|
+
label: "To",
|
|
924
|
+
image: { src: to.image, alt: to.name },
|
|
925
|
+
onClick: onDestinationClick,
|
|
926
|
+
children: to.name
|
|
927
|
+
}
|
|
928
|
+
),
|
|
929
|
+
/* @__PURE__ */ jsx13(
|
|
930
|
+
Button,
|
|
931
|
+
{
|
|
932
|
+
type: "button",
|
|
933
|
+
onClick: onNetworkInvert,
|
|
934
|
+
className: "size-6 rounded-[7.5px] p-0 bg-brand-black-600 flex items-center justify-center absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 hover:scale-110 transition-all",
|
|
935
|
+
"aria-label": "Switch networks",
|
|
936
|
+
children: /* @__PURE__ */ jsx13("div", { className: "size-[19.2px] rounded-[6px] bg-brand-black-500 flex items-center justify-center", children: /* @__PURE__ */ jsx13(ArrowRight_default, { className: "text-brand-black-100 size-3" }) })
|
|
937
|
+
}
|
|
938
|
+
)
|
|
939
|
+
] });
|
|
940
|
+
};
|
|
941
|
+
function NetworkSwitcherButton(props) {
|
|
942
|
+
const _a = props, { image, label } = _a, _props = __objRest(_a, ["image", "label"]);
|
|
943
|
+
return /* @__PURE__ */ jsx13(SmoothCorners, { children: /* @__PURE__ */ jsx13(
|
|
944
|
+
"button",
|
|
945
|
+
__spreadProps(__spreadValues({}, _props), {
|
|
946
|
+
type: "button",
|
|
947
|
+
className: "bg-brand-black-500 select-none rounded-[16px] py-[10px] px-3 w-[49%] cursor-pointer hover:bg-brand-black-300 duration-200 transition-all",
|
|
948
|
+
children: /* @__PURE__ */ jsxs8("span", { className: "flex gap-3 items-center", children: [
|
|
949
|
+
/* @__PURE__ */ jsx13(TokenImage, { className: "size-8", src: image.src, alt: image.alt }),
|
|
950
|
+
/* @__PURE__ */ jsxs8("span", { className: "flex flex-col items-start", children: [
|
|
951
|
+
/* @__PURE__ */ jsx13("span", { className: "text-caption font-medium text-brand-black-100", children: label }),
|
|
952
|
+
/* @__PURE__ */ jsx13("span", { className: "text-body text-white font-medium", children: props.children })
|
|
953
|
+
] })
|
|
954
|
+
] })
|
|
955
|
+
})
|
|
956
|
+
) });
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
// src/components/network/network-selector.tsx
|
|
960
|
+
import { useMemo } from "react";
|
|
961
|
+
|
|
962
|
+
// src/components/molecules/modal.tsx
|
|
963
|
+
import { motion, AnimatePresence } from "motion/react";
|
|
964
|
+
import { useEffect, useState } from "react";
|
|
965
|
+
|
|
966
|
+
// src/@/ui/drawer.tsx
|
|
967
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
968
|
+
import { Fragment, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
969
|
+
function Drawer(_a) {
|
|
970
|
+
var props = __objRest(_a, []);
|
|
971
|
+
return /* @__PURE__ */ jsx14(DrawerPrimitive.Root, __spreadValues({ "data-slot": "drawer" }, props));
|
|
972
|
+
}
|
|
973
|
+
function DrawerOverlay(_a) {
|
|
974
|
+
var _b = _a, {
|
|
975
|
+
className
|
|
976
|
+
} = _b, props = __objRest(_b, [
|
|
977
|
+
"className"
|
|
978
|
+
]);
|
|
979
|
+
return /* @__PURE__ */ jsx14(
|
|
980
|
+
DrawerPrimitive.Overlay,
|
|
981
|
+
__spreadValues({
|
|
982
|
+
"data-slot": "drawer-overlay",
|
|
983
|
+
className: cn(
|
|
984
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
985
|
+
className
|
|
986
|
+
)
|
|
987
|
+
}, props)
|
|
988
|
+
);
|
|
989
|
+
}
|
|
990
|
+
function DrawerContent(_a) {
|
|
991
|
+
var _b = _a, {
|
|
992
|
+
className,
|
|
993
|
+
children
|
|
994
|
+
} = _b, props = __objRest(_b, [
|
|
995
|
+
"className",
|
|
996
|
+
"children"
|
|
997
|
+
]);
|
|
998
|
+
return /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
999
|
+
/* @__PURE__ */ jsx14(DrawerOverlay, {}),
|
|
1000
|
+
/* @__PURE__ */ jsxs9(
|
|
1001
|
+
DrawerPrimitive.Content,
|
|
1002
|
+
__spreadProps(__spreadValues({
|
|
1003
|
+
"data-slot": "drawer-content",
|
|
1004
|
+
className: cn(
|
|
1005
|
+
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
1006
|
+
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
1007
|
+
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
1008
|
+
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
1009
|
+
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
1010
|
+
className
|
|
1011
|
+
)
|
|
1012
|
+
}, props), {
|
|
1013
|
+
children: [
|
|
1014
|
+
/* @__PURE__ */ jsx14("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
|
|
1015
|
+
children
|
|
1016
|
+
]
|
|
1017
|
+
})
|
|
1018
|
+
)
|
|
1019
|
+
] });
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
// src/lib/animations.ts
|
|
1023
|
+
var modalVariants = {
|
|
1024
|
+
initial: {
|
|
1025
|
+
opacity: 0,
|
|
1026
|
+
y: 50,
|
|
1027
|
+
scale: 0.95
|
|
1028
|
+
},
|
|
1029
|
+
animate: {
|
|
1030
|
+
opacity: 1,
|
|
1031
|
+
y: 0,
|
|
1032
|
+
scale: 1
|
|
1033
|
+
},
|
|
1034
|
+
exit: {
|
|
1035
|
+
opacity: 0,
|
|
1036
|
+
y: 30,
|
|
1037
|
+
scale: 0.95
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
var springTransition = {
|
|
1041
|
+
type: "spring",
|
|
1042
|
+
damping: 25,
|
|
1043
|
+
stiffness: 300,
|
|
1044
|
+
duration: 0.3
|
|
1045
|
+
};
|
|
1046
|
+
var smoothTransition = {
|
|
1047
|
+
type: "tween",
|
|
1048
|
+
duration: 0.2,
|
|
1049
|
+
ease: "easeInOut"
|
|
1050
|
+
};
|
|
1051
|
+
var fastTransition = {
|
|
1052
|
+
type: "tween",
|
|
1053
|
+
duration: 0.15,
|
|
1054
|
+
ease: "easeOut"
|
|
1055
|
+
};
|
|
1056
|
+
var slideUpVariants = {
|
|
1057
|
+
initial: {
|
|
1058
|
+
opacity: 0,
|
|
1059
|
+
y: 20
|
|
1060
|
+
},
|
|
1061
|
+
animate: {
|
|
1062
|
+
opacity: 1,
|
|
1063
|
+
y: 0
|
|
1064
|
+
},
|
|
1065
|
+
exit: {
|
|
1066
|
+
opacity: 0,
|
|
1067
|
+
y: -10
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
var slideDownVariants = {
|
|
1071
|
+
initial: {
|
|
1072
|
+
opacity: 0,
|
|
1073
|
+
y: -20
|
|
1074
|
+
},
|
|
1075
|
+
animate: {
|
|
1076
|
+
opacity: 1,
|
|
1077
|
+
y: 0
|
|
1078
|
+
},
|
|
1079
|
+
exit: {
|
|
1080
|
+
opacity: 0,
|
|
1081
|
+
y: 10
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
var fadeVariants = {
|
|
1085
|
+
initial: {
|
|
1086
|
+
opacity: 0
|
|
1087
|
+
},
|
|
1088
|
+
animate: {
|
|
1089
|
+
opacity: 1
|
|
1090
|
+
},
|
|
1091
|
+
exit: {
|
|
1092
|
+
opacity: 0
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
var scaleVariants = {
|
|
1096
|
+
initial: {
|
|
1097
|
+
opacity: 0,
|
|
1098
|
+
scale: 0.9
|
|
1099
|
+
},
|
|
1100
|
+
animate: {
|
|
1101
|
+
opacity: 1,
|
|
1102
|
+
scale: 1
|
|
1103
|
+
},
|
|
1104
|
+
exit: {
|
|
1105
|
+
opacity: 0,
|
|
1106
|
+
scale: 0.95
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
var animationPresets = {
|
|
1110
|
+
modal: {
|
|
1111
|
+
variants: modalVariants,
|
|
1112
|
+
transition: springTransition
|
|
1113
|
+
},
|
|
1114
|
+
slideUp: {
|
|
1115
|
+
variants: slideUpVariants,
|
|
1116
|
+
transition: smoothTransition
|
|
1117
|
+
},
|
|
1118
|
+
slideDown: {
|
|
1119
|
+
variants: slideDownVariants,
|
|
1120
|
+
transition: smoothTransition
|
|
1121
|
+
},
|
|
1122
|
+
fade: {
|
|
1123
|
+
variants: fadeVariants,
|
|
1124
|
+
transition: smoothTransition
|
|
1125
|
+
},
|
|
1126
|
+
scale: {
|
|
1127
|
+
variants: scaleVariants,
|
|
1128
|
+
transition: fastTransition
|
|
1129
|
+
}
|
|
1130
|
+
};
|
|
1131
|
+
|
|
1132
|
+
// src/components/molecules/modal.tsx
|
|
1133
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1134
|
+
var Modal = ({
|
|
1135
|
+
isOpen,
|
|
1136
|
+
children,
|
|
1137
|
+
onClose,
|
|
1138
|
+
className = "",
|
|
1139
|
+
animationPreset = "modal"
|
|
1140
|
+
}) => {
|
|
1141
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
1142
|
+
useEffect(() => {
|
|
1143
|
+
const checkMobile = () => {
|
|
1144
|
+
setIsMobile(window.innerWidth < 768);
|
|
1145
|
+
};
|
|
1146
|
+
checkMobile();
|
|
1147
|
+
window.addEventListener("resize", checkMobile);
|
|
1148
|
+
return () => {
|
|
1149
|
+
window.removeEventListener("resize", checkMobile);
|
|
1150
|
+
};
|
|
1151
|
+
}, []);
|
|
1152
|
+
useEffect(() => {
|
|
1153
|
+
const handleEscapeKey = (event) => {
|
|
1154
|
+
if (event.key === "Escape" && isOpen && onClose && !isMobile) {
|
|
1155
|
+
onClose();
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1158
|
+
if (isOpen && !isMobile) {
|
|
1159
|
+
document.addEventListener("keydown", handleEscapeKey);
|
|
1160
|
+
}
|
|
1161
|
+
return () => {
|
|
1162
|
+
document.removeEventListener("keydown", handleEscapeKey);
|
|
1163
|
+
};
|
|
1164
|
+
}, [isOpen, onClose, isMobile]);
|
|
1165
|
+
const { variants, transition } = animationPresets[animationPreset];
|
|
1166
|
+
if (isMobile) {
|
|
1167
|
+
return /* @__PURE__ */ jsx15(Drawer, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsx15(DrawerContent, { className: "bg-brand-black-550 border-brand-black-300 min-h-[90dvh]", children }) });
|
|
1168
|
+
}
|
|
1169
|
+
return /* @__PURE__ */ jsx15(AnimatePresence, { mode: "wait", children: isOpen && /* @__PURE__ */ jsx15(
|
|
1170
|
+
motion.div,
|
|
1171
|
+
{
|
|
1172
|
+
className: cn(
|
|
1173
|
+
"absolute inset-0 z-50 bg-brand-black-550 rounded-xl w-full max-w-[440px] mx-auto overflow-hidden h-[min(515px,90vh)] flex flex-col ring-3 ring-brand-black-550",
|
|
1174
|
+
className
|
|
1175
|
+
),
|
|
1176
|
+
variants,
|
|
1177
|
+
initial: "initial",
|
|
1178
|
+
animate: "animate",
|
|
1179
|
+
exit: "exit",
|
|
1180
|
+
transition,
|
|
1181
|
+
children
|
|
1182
|
+
}
|
|
1183
|
+
) });
|
|
1184
|
+
};
|
|
1185
|
+
|
|
1186
|
+
// src/hooks/selector-hooks.ts
|
|
1187
|
+
import { useState as useState2, useRef, useEffect as useEffect2 } from "react";
|
|
1188
|
+
var useScrollBorder = () => {
|
|
1189
|
+
const [showHeaderBorder, setShowHeaderBorder] = useState2(false);
|
|
1190
|
+
const scrollableRef = useRef(null);
|
|
1191
|
+
useEffect2(() => {
|
|
1192
|
+
const scrollableElement = scrollableRef.current;
|
|
1193
|
+
if (!scrollableElement) return;
|
|
1194
|
+
const handleScroll = () => {
|
|
1195
|
+
const { scrollTop, scrollHeight, clientHeight } = scrollableElement;
|
|
1196
|
+
const hasOverflow = scrollHeight > clientHeight;
|
|
1197
|
+
const hasScrolled = scrollTop > 0;
|
|
1198
|
+
setShowHeaderBorder(hasOverflow && hasScrolled);
|
|
1199
|
+
};
|
|
1200
|
+
handleScroll();
|
|
1201
|
+
scrollableElement.addEventListener("scroll", handleScroll);
|
|
1202
|
+
const resizeObserver = new ResizeObserver(handleScroll);
|
|
1203
|
+
resizeObserver.observe(scrollableElement);
|
|
1204
|
+
return () => {
|
|
1205
|
+
scrollableElement.removeEventListener("scroll", handleScroll);
|
|
1206
|
+
resizeObserver.disconnect();
|
|
1207
|
+
};
|
|
1208
|
+
}, []);
|
|
1209
|
+
return { showHeaderBorder, scrollableRef };
|
|
1210
|
+
};
|
|
1211
|
+
var useSearch = () => {
|
|
1212
|
+
const [searchQuery, setSearchQuery] = useState2("");
|
|
1213
|
+
const resetSearch = () => setSearchQuery("");
|
|
1214
|
+
return { searchQuery, setSearchQuery, resetSearch };
|
|
1215
|
+
};
|
|
1216
|
+
var filterItems = (items, searchQuery, searchFields) => {
|
|
1217
|
+
if (!searchQuery.trim()) return items;
|
|
1218
|
+
const query = searchQuery.toLowerCase();
|
|
1219
|
+
return items.filter(
|
|
1220
|
+
(item) => searchFields(item).some((field) => field.toLowerCase().includes(query))
|
|
1221
|
+
);
|
|
1222
|
+
};
|
|
1223
|
+
var sortItems = (items, sortFn) => {
|
|
1224
|
+
return [...items].sort(sortFn);
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1227
|
+
// src/components/molecules/empty-state.tsx
|
|
1228
|
+
import React3 from "react";
|
|
1229
|
+
import { Fragment as Fragment2, jsx as jsx16 } from "react/jsx-runtime";
|
|
1230
|
+
var ContextDefault = {
|
|
1231
|
+
isEmpty: true
|
|
1232
|
+
};
|
|
1233
|
+
var EmptyStateCtx = isSSR() ? {} : React3.createContext(ContextDefault);
|
|
1234
|
+
function useContext() {
|
|
1235
|
+
const context = React3.useContext(EmptyStateCtx);
|
|
1236
|
+
return isSSR() ? ContextDefault : context;
|
|
1237
|
+
}
|
|
1238
|
+
var EmptyStateContent = React3.forwardRef(function Content(props, ref) {
|
|
1239
|
+
const { isEmpty } = useContext();
|
|
1240
|
+
if (!isEmpty) return null;
|
|
1241
|
+
return /* @__PURE__ */ jsx16(
|
|
1242
|
+
"div",
|
|
1243
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1244
|
+
ref,
|
|
1245
|
+
className: cn("flex flex-col items-center gap-4", props.className)
|
|
1246
|
+
})
|
|
1247
|
+
);
|
|
1248
|
+
});
|
|
1249
|
+
var EmptyStateTitle = React3.forwardRef(function ESTitle(props, ref) {
|
|
1250
|
+
return /* @__PURE__ */ jsx16(
|
|
1251
|
+
"h6",
|
|
1252
|
+
__spreadProps(__spreadValues({
|
|
1253
|
+
ref
|
|
1254
|
+
}, props), {
|
|
1255
|
+
className: cn("font-500 text-center font-semibold", props.className)
|
|
1256
|
+
})
|
|
1257
|
+
);
|
|
1258
|
+
});
|
|
1259
|
+
var EmptyStateDescription = React3.forwardRef(function ESDescription(props, ref) {
|
|
1260
|
+
return /* @__PURE__ */ jsx16(
|
|
1261
|
+
"div",
|
|
1262
|
+
__spreadProps(__spreadValues({
|
|
1263
|
+
ref
|
|
1264
|
+
}, props), {
|
|
1265
|
+
className: cn("text-xs text-muted-foreground", props.className)
|
|
1266
|
+
})
|
|
1267
|
+
);
|
|
1268
|
+
});
|
|
1269
|
+
function EmptyStateConceal(props) {
|
|
1270
|
+
const { isEmpty } = useContext();
|
|
1271
|
+
if (isEmpty) return null;
|
|
1272
|
+
return /* @__PURE__ */ jsx16(Fragment2, { children: props.children });
|
|
1273
|
+
}
|
|
1274
|
+
function EmptyState(props) {
|
|
1275
|
+
const { isEmpty = true, children } = props;
|
|
1276
|
+
if (isSSR()) return /* @__PURE__ */ jsx16(Fragment2, { children });
|
|
1277
|
+
return /* @__PURE__ */ jsx16(EmptyStateCtx.Provider, { value: { isEmpty }, children });
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
// src/components/network/network-selector.tsx
|
|
1281
|
+
import React5 from "react";
|
|
1282
|
+
|
|
1283
|
+
// src/components/molecules/scroll-aware-area.tsx
|
|
1284
|
+
import React4 from "react";
|
|
1285
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1286
|
+
function ScrollAwareSeparator(props) {
|
|
1287
|
+
const _a = props, { scrollRef } = _a, props_ = __objRest(_a, ["scrollRef"]);
|
|
1288
|
+
const [showHeaderBorder, setShowHeaderBorder] = React4.useState(false);
|
|
1289
|
+
React4.useEffect(() => {
|
|
1290
|
+
let scrollableElement = scrollRef.current;
|
|
1291
|
+
if (!scrollableElement) return;
|
|
1292
|
+
const radixScrollArea = scrollableElement == null ? void 0 : scrollableElement.querySelector(
|
|
1293
|
+
"[data-radix-scroll-area-viewport]"
|
|
1294
|
+
);
|
|
1295
|
+
scrollableElement = radixScrollArea ? radixScrollArea : scrollableElement;
|
|
1296
|
+
const handleScroll = () => {
|
|
1297
|
+
const { scrollTop, scrollHeight, clientHeight } = scrollableElement;
|
|
1298
|
+
const hasOverflow = scrollHeight > clientHeight;
|
|
1299
|
+
const hasScrolled = scrollTop > 0;
|
|
1300
|
+
setShowHeaderBorder(hasOverflow && hasScrolled);
|
|
1301
|
+
};
|
|
1302
|
+
handleScroll();
|
|
1303
|
+
scrollableElement.addEventListener("scroll", handleScroll);
|
|
1304
|
+
const resizeObserver = new ResizeObserver(handleScroll);
|
|
1305
|
+
resizeObserver.observe(scrollableElement);
|
|
1306
|
+
return () => {
|
|
1307
|
+
scrollableElement.removeEventListener("scroll", handleScroll);
|
|
1308
|
+
resizeObserver.disconnect();
|
|
1309
|
+
};
|
|
1310
|
+
}, [scrollRef]);
|
|
1311
|
+
return /* @__PURE__ */ jsx17(
|
|
1312
|
+
"div",
|
|
1313
|
+
__spreadProps(__spreadValues({}, props_), {
|
|
1314
|
+
className: cn(
|
|
1315
|
+
"border-b data-[active=true]:border-brand-black-300/70 data-[active=false]:border-brand-black-300/0",
|
|
1316
|
+
props.className
|
|
1317
|
+
),
|
|
1318
|
+
"data-active": showHeaderBorder
|
|
1319
|
+
})
|
|
1320
|
+
);
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
// src/components/network/network-selector.tsx
|
|
1324
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1325
|
+
var NetworkSelector = ({
|
|
1326
|
+
title,
|
|
1327
|
+
availableNetworks,
|
|
1328
|
+
unavailableNetworks,
|
|
1329
|
+
selectedNetwork,
|
|
1330
|
+
onNetworkSelect,
|
|
1331
|
+
isOpen = false,
|
|
1332
|
+
onClose
|
|
1333
|
+
}) => {
|
|
1334
|
+
const { searchQuery, setSearchQuery } = useSearch();
|
|
1335
|
+
const scrollableRef = React5.useRef(null);
|
|
1336
|
+
const filteredAvailableNetworks = useMemo(() => {
|
|
1337
|
+
return filterItems(availableNetworks, searchQuery, (network) => [
|
|
1338
|
+
network.name
|
|
1339
|
+
]);
|
|
1340
|
+
}, [availableNetworks, searchQuery]);
|
|
1341
|
+
const filteredUnavailableNetworks = useMemo(() => {
|
|
1342
|
+
return filterItems(unavailableNetworks, searchQuery, (network) => [
|
|
1343
|
+
network.name
|
|
1344
|
+
]);
|
|
1345
|
+
}, [unavailableNetworks, searchQuery]);
|
|
1346
|
+
const handleNetworkSelect = (network) => {
|
|
1347
|
+
onNetworkSelect(network);
|
|
1348
|
+
};
|
|
1349
|
+
const renderNetworkItem = (network, isAvailable) => {
|
|
1350
|
+
const isSelected = (selectedNetwork == null ? void 0 : selectedNetwork.name) === network.name;
|
|
1351
|
+
return /* @__PURE__ */ jsx18(
|
|
1352
|
+
NetworkSelectionItem,
|
|
1353
|
+
{
|
|
1354
|
+
network,
|
|
1355
|
+
isActive: isSelected,
|
|
1356
|
+
variant: isAvailable ? "default" : "secondary",
|
|
1357
|
+
onClick: () => isAvailable && handleNetworkSelect(network),
|
|
1358
|
+
SecondaryContent: /* @__PURE__ */ jsx18(Button2, { variant: "message", size: "sm", children: /* @__PURE__ */ jsx18("span", { className: "text-caption font-medium", children: "Connect" }) })
|
|
1359
|
+
}
|
|
1360
|
+
);
|
|
1361
|
+
};
|
|
1362
|
+
const hasNoResults = searchQuery.trim() && filteredAvailableNetworks.length === 0 && filteredUnavailableNetworks.length === 0;
|
|
1363
|
+
const isEmpty = availableNetworks.length === 0 && unavailableNetworks.length === 0;
|
|
1364
|
+
return /* @__PURE__ */ jsxs10(Modal, { isOpen, onClose, children: [
|
|
1365
|
+
/* @__PURE__ */ jsxs10(
|
|
1366
|
+
"div",
|
|
1367
|
+
{
|
|
1368
|
+
className: cn(
|
|
1369
|
+
"bg-brand-black-550 px-6 pt-6 pb-4 transition-all duration-200"
|
|
1370
|
+
),
|
|
1371
|
+
children: [
|
|
1372
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between", children: [
|
|
1373
|
+
/* @__PURE__ */ jsx18("div", { className: "body-1 font-medium text-white max-w-[200px] break-words", children: title != null ? title : "Select chain" }),
|
|
1374
|
+
/* @__PURE__ */ jsx18(
|
|
1375
|
+
IconButton,
|
|
1376
|
+
{
|
|
1377
|
+
size: "xs",
|
|
1378
|
+
onClick: onClose,
|
|
1379
|
+
variant: "unset",
|
|
1380
|
+
className: "text-brand-black-100 hover:text-white",
|
|
1381
|
+
children: /* @__PURE__ */ jsx18(XIcon_default, {})
|
|
1382
|
+
}
|
|
1383
|
+
)
|
|
1384
|
+
] }),
|
|
1385
|
+
/* @__PURE__ */ jsx18("div", { className: "mt-4", children: /* @__PURE__ */ jsx18(
|
|
1386
|
+
SearchInput,
|
|
1387
|
+
{
|
|
1388
|
+
className: "h-10",
|
|
1389
|
+
placeholder: "Search for chain",
|
|
1390
|
+
value: searchQuery,
|
|
1391
|
+
onChange: (e) => setSearchQuery(e.target.value)
|
|
1392
|
+
}
|
|
1393
|
+
) })
|
|
1394
|
+
]
|
|
1395
|
+
}
|
|
1396
|
+
),
|
|
1397
|
+
/* @__PURE__ */ jsxs10(EmptyState, { isEmpty, children: [
|
|
1398
|
+
/* @__PURE__ */ jsxs10(EmptyStateConceal, { children: [
|
|
1399
|
+
/* @__PURE__ */ jsx18(
|
|
1400
|
+
ScrollAwareSeparator,
|
|
1401
|
+
{
|
|
1402
|
+
scrollRef: scrollableRef,
|
|
1403
|
+
className: "data-[active=true]:border-brand-black-300/70 data-[active=false]:border-brand-black-300/0"
|
|
1404
|
+
}
|
|
1405
|
+
),
|
|
1406
|
+
/* @__PURE__ */ jsxs10(
|
|
1407
|
+
"div",
|
|
1408
|
+
{
|
|
1409
|
+
ref: scrollableRef,
|
|
1410
|
+
className: "px-6 pb-6 overflow-y-auto h-full space-y-4 no-scrollbar",
|
|
1411
|
+
children: [
|
|
1412
|
+
filteredAvailableNetworks.length > 0 && /* @__PURE__ */ jsxs10("div", { children: [
|
|
1413
|
+
/* @__PURE__ */ jsx18("p", { className: "text-caption text-brand-black-100", children: "Available" }),
|
|
1414
|
+
/* @__PURE__ */ jsx18("div", { className: "mt-[6px] space-y-2", children: filteredAvailableNetworks.map(
|
|
1415
|
+
(network) => renderNetworkItem(network, true)
|
|
1416
|
+
) })
|
|
1417
|
+
] }),
|
|
1418
|
+
filteredUnavailableNetworks.length > 0 && /* @__PURE__ */ jsxs10("div", { children: [
|
|
1419
|
+
/* @__PURE__ */ jsx18("p", { className: "text-caption text-brand-black-100", children: "Not available" }),
|
|
1420
|
+
/* @__PURE__ */ jsx18("div", { className: "mt-[6px] space-y-2", children: filteredUnavailableNetworks.map(
|
|
1421
|
+
(network) => renderNetworkItem(network, false)
|
|
1422
|
+
) })
|
|
1423
|
+
] }),
|
|
1424
|
+
hasNoResults && /* @__PURE__ */ jsx18("div", { className: "text-center py-8 h-full flex items-center justify-center", children: /* @__PURE__ */ jsxs10("p", { className: "text-caption text-brand-black-100", children: [
|
|
1425
|
+
"No results found for",
|
|
1426
|
+
" ",
|
|
1427
|
+
/* @__PURE__ */ jsx18("span", { className: "text-white font-medium", children: searchQuery })
|
|
1428
|
+
] }) })
|
|
1429
|
+
]
|
|
1430
|
+
}
|
|
1431
|
+
)
|
|
1432
|
+
] }),
|
|
1433
|
+
/* @__PURE__ */ jsx18(EmptyStateContent, { className: "text-center py-8 h-full flex items-center justify-center", children: /* @__PURE__ */ jsxs10("div", { children: [
|
|
1434
|
+
/* @__PURE__ */ jsx18("p", { className: "body-2 text-brand-black-100 mb-1", children: "No networks available" }),
|
|
1435
|
+
/* @__PURE__ */ jsx18("p", { className: "text-caption text-brand-black-100", children: "Networks will appear here when available" })
|
|
1436
|
+
] }) })
|
|
1437
|
+
] })
|
|
1438
|
+
] });
|
|
1439
|
+
};
|
|
1440
|
+
function NetworkSelectionItem(props) {
|
|
1441
|
+
const _a = props, {
|
|
1442
|
+
network,
|
|
1443
|
+
disabled = false,
|
|
1444
|
+
variant = "default",
|
|
1445
|
+
isActive
|
|
1446
|
+
} = _a, PROPS = __objRest(_a, [
|
|
1447
|
+
"network",
|
|
1448
|
+
"disabled",
|
|
1449
|
+
"variant",
|
|
1450
|
+
"isActive"
|
|
1451
|
+
]);
|
|
1452
|
+
const buttonRef = React5.useRef(null);
|
|
1453
|
+
const is_default_mode = variant === "default";
|
|
1454
|
+
const buttonContent = /* @__PURE__ */ jsxs10(
|
|
1455
|
+
"div",
|
|
1456
|
+
{
|
|
1457
|
+
className: cn(
|
|
1458
|
+
"w-full cursor-pointer group bg-brand-black-350 rounded-[16px] p-3 flex items-center justify-between hover:bg-brand-black-300 duration-200 transition-colors",
|
|
1459
|
+
{
|
|
1460
|
+
"pointer-events-none bg-transparent opacity-50": disabled
|
|
1461
|
+
}
|
|
1462
|
+
),
|
|
1463
|
+
onClick: () => {
|
|
1464
|
+
var _a2;
|
|
1465
|
+
return (_a2 = buttonRef.current) == null ? void 0 : _a2.click();
|
|
1466
|
+
},
|
|
1467
|
+
onKeyDown: () => {
|
|
1468
|
+
var _a2;
|
|
1469
|
+
return (_a2 = buttonRef.current) == null ? void 0 : _a2.click();
|
|
1470
|
+
},
|
|
1471
|
+
children: [
|
|
1472
|
+
/* @__PURE__ */ jsxs10(
|
|
1473
|
+
"button",
|
|
1474
|
+
__spreadProps(__spreadValues({
|
|
1475
|
+
type: "button",
|
|
1476
|
+
ref: buttonRef,
|
|
1477
|
+
className: "flex items-center gap-[10px]"
|
|
1478
|
+
}, PROPS), {
|
|
1479
|
+
disabled,
|
|
1480
|
+
children: [
|
|
1481
|
+
/* @__PURE__ */ jsx18(TokenImage, { className: "size-8", src: network.image, alt: network.name }),
|
|
1482
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col items-start", children: [
|
|
1483
|
+
/* @__PURE__ */ jsx18("div", { className: "body-2 font-medium text-white", children: network.name }),
|
|
1484
|
+
/* @__PURE__ */ jsx18("div", { className: "text-caption font-medium text-brand-black-100", children: network.group })
|
|
1485
|
+
] })
|
|
1486
|
+
]
|
|
1487
|
+
})
|
|
1488
|
+
),
|
|
1489
|
+
is_default_mode ? /* @__PURE__ */ jsx18(IconButton, { className: "cursor-pointer group", variant: "secondary", children: isActive ? /* @__PURE__ */ jsx18(Check_default, { className: "size-4 text-white" }) : /* @__PURE__ */ jsx18(Circle_default, { className: "size-4 text-brand-black-100 group-hover:text-white duration-200 transition-colors" }) }) : null,
|
|
1490
|
+
variant === "secondary" ? props.SecondaryContent : null
|
|
1491
|
+
]
|
|
1492
|
+
}
|
|
1493
|
+
);
|
|
1494
|
+
return /* @__PURE__ */ jsx18(
|
|
1495
|
+
"div",
|
|
1496
|
+
{
|
|
1497
|
+
className: cn(
|
|
1498
|
+
"relative p-[1.5px] rounded-[16px]",
|
|
1499
|
+
is_default_mode && isActive && "animated-gradient-border"
|
|
1500
|
+
),
|
|
1501
|
+
children: buttonContent
|
|
1502
|
+
},
|
|
1503
|
+
network.name
|
|
1504
|
+
);
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
// src/components/tokens/token-selector.tsx
|
|
1508
|
+
import React6 from "react";
|
|
1509
|
+
|
|
1510
|
+
// src/@/ui/scroll-area.tsx
|
|
1511
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
1512
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1513
|
+
function ScrollArea(_a) {
|
|
1514
|
+
var _b = _a, {
|
|
1515
|
+
className,
|
|
1516
|
+
children
|
|
1517
|
+
} = _b, props = __objRest(_b, [
|
|
1518
|
+
"className",
|
|
1519
|
+
"children"
|
|
1520
|
+
]);
|
|
1521
|
+
return /* @__PURE__ */ jsxs11(
|
|
1522
|
+
ScrollAreaPrimitive.Root,
|
|
1523
|
+
__spreadProps(__spreadValues({
|
|
1524
|
+
"data-slot": "scroll-area",
|
|
1525
|
+
className: cn("relative", className)
|
|
1526
|
+
}, props), {
|
|
1527
|
+
children: [
|
|
1528
|
+
/* @__PURE__ */ jsx19(
|
|
1529
|
+
ScrollAreaPrimitive.Viewport,
|
|
1530
|
+
{
|
|
1531
|
+
"data-slot": "scroll-area-viewport",
|
|
1532
|
+
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
1533
|
+
children
|
|
1534
|
+
}
|
|
1535
|
+
),
|
|
1536
|
+
/* @__PURE__ */ jsx19(ScrollBar, {}),
|
|
1537
|
+
/* @__PURE__ */ jsx19(ScrollAreaPrimitive.Corner, {})
|
|
1538
|
+
]
|
|
1539
|
+
})
|
|
1540
|
+
);
|
|
1541
|
+
}
|
|
1542
|
+
function ScrollBar(_a) {
|
|
1543
|
+
var _b = _a, {
|
|
1544
|
+
className,
|
|
1545
|
+
orientation = "vertical"
|
|
1546
|
+
} = _b, props = __objRest(_b, [
|
|
1547
|
+
"className",
|
|
1548
|
+
"orientation"
|
|
1549
|
+
]);
|
|
1550
|
+
return /* @__PURE__ */ jsx19(
|
|
1551
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
1552
|
+
__spreadProps(__spreadValues({
|
|
1553
|
+
"data-slot": "scroll-area-scrollbar",
|
|
1554
|
+
orientation,
|
|
1555
|
+
className: cn(
|
|
1556
|
+
"flex touch-none p-px transition-colors select-none",
|
|
1557
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
1558
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
1559
|
+
className
|
|
1560
|
+
)
|
|
1561
|
+
}, props), {
|
|
1562
|
+
children: /* @__PURE__ */ jsx19(
|
|
1563
|
+
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
1564
|
+
{
|
|
1565
|
+
"data-slot": "scroll-area-thumb",
|
|
1566
|
+
className: "bg-brand-black-350 hover:bg-brand-black-200 !w-[0.5rem] relative flex-1 rounded-full"
|
|
1567
|
+
}
|
|
1568
|
+
)
|
|
1569
|
+
})
|
|
1570
|
+
);
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
// src/components/tokens/token-selector.tsx
|
|
1574
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1575
|
+
var tokenSortFn = (a, b) => {
|
|
1576
|
+
const aHasAmount = a.amount > 0;
|
|
1577
|
+
const bHasAmount = b.amount > 0;
|
|
1578
|
+
if (aHasAmount && !bHasAmount) return -1;
|
|
1579
|
+
if (!aHasAmount && bHasAmount) return 1;
|
|
1580
|
+
return a.name.localeCompare(b.name);
|
|
1581
|
+
};
|
|
1582
|
+
var tokenSearchFields = (token) => [
|
|
1583
|
+
token.name,
|
|
1584
|
+
token.symbol,
|
|
1585
|
+
token.address
|
|
1586
|
+
];
|
|
1587
|
+
var TokenSelector = ({
|
|
1588
|
+
title,
|
|
1589
|
+
isOpen,
|
|
1590
|
+
onClose,
|
|
1591
|
+
allTokens,
|
|
1592
|
+
availableTokens,
|
|
1593
|
+
selectedToken,
|
|
1594
|
+
onTokenSelect,
|
|
1595
|
+
onAddToWallet
|
|
1596
|
+
}) => {
|
|
1597
|
+
const { showHeaderBorder, scrollableRef } = useScrollBorder();
|
|
1598
|
+
const { searchQuery, setSearchQuery } = useSearch();
|
|
1599
|
+
const isTokenAvailable = (token) => {
|
|
1600
|
+
return availableTokens.some(
|
|
1601
|
+
(availableToken) => availableToken.symbol === token.symbol && availableToken.address === token.address
|
|
1602
|
+
);
|
|
1603
|
+
};
|
|
1604
|
+
const handleTokenSelect = (token) => {
|
|
1605
|
+
onTokenSelect == null ? void 0 : onTokenSelect(token);
|
|
1606
|
+
};
|
|
1607
|
+
const handleAddToWallet = (token) => {
|
|
1608
|
+
onAddToWallet == null ? void 0 : onAddToWallet(token);
|
|
1609
|
+
};
|
|
1610
|
+
const getFilteredTokens = () => {
|
|
1611
|
+
if (searchQuery.trim()) {
|
|
1612
|
+
const allSearchableTokens = [...availableTokens, ...allTokens];
|
|
1613
|
+
const uniqueTokens = allSearchableTokens.filter(
|
|
1614
|
+
(token, index, self) => index === self.findIndex(
|
|
1615
|
+
(t) => t.symbol === token.symbol && t.address === token.address
|
|
1616
|
+
)
|
|
1617
|
+
);
|
|
1618
|
+
const filtered = filterItems(
|
|
1619
|
+
uniqueTokens,
|
|
1620
|
+
searchQuery,
|
|
1621
|
+
tokenSearchFields
|
|
1622
|
+
);
|
|
1623
|
+
return {
|
|
1624
|
+
searchResults: sortItems(filtered, tokenSortFn),
|
|
1625
|
+
availableTokens: [],
|
|
1626
|
+
allTokens: []
|
|
1627
|
+
};
|
|
1628
|
+
}
|
|
1629
|
+
return {
|
|
1630
|
+
searchResults: [],
|
|
1631
|
+
availableTokens: sortItems(availableTokens, tokenSortFn),
|
|
1632
|
+
allTokens: sortItems(allTokens, tokenSortFn)
|
|
1633
|
+
};
|
|
1634
|
+
};
|
|
1635
|
+
const {
|
|
1636
|
+
searchResults,
|
|
1637
|
+
availableTokens: sortedAvailableTokens,
|
|
1638
|
+
allTokens: sortedAllTokens
|
|
1639
|
+
} = getFilteredTokens();
|
|
1640
|
+
const renderTokenItem = (token) => {
|
|
1641
|
+
const isSelected = (selectedToken == null ? void 0 : selectedToken.symbol) === token.symbol && (selectedToken == null ? void 0 : selectedToken.address) === token.address;
|
|
1642
|
+
const isAvailable = isTokenAvailable(token);
|
|
1643
|
+
return /* @__PURE__ */ jsx20(
|
|
1644
|
+
TokenSelectionItem,
|
|
1645
|
+
{
|
|
1646
|
+
token,
|
|
1647
|
+
isActive: isSelected,
|
|
1648
|
+
isAvailable,
|
|
1649
|
+
onClick: () => handleTokenSelect(token),
|
|
1650
|
+
AddWalletButton: /* @__PURE__ */ jsx20(
|
|
1651
|
+
Button,
|
|
1652
|
+
{
|
|
1653
|
+
variant: "message",
|
|
1654
|
+
size: "sm",
|
|
1655
|
+
onClick: (e) => {
|
|
1656
|
+
e.stopPropagation();
|
|
1657
|
+
handleAddToWallet(token);
|
|
1658
|
+
},
|
|
1659
|
+
children: /* @__PURE__ */ jsx20("span", { className: "text-caption font-medium", children: "Add to wallet" })
|
|
1660
|
+
}
|
|
1661
|
+
)
|
|
1662
|
+
},
|
|
1663
|
+
`${token.symbol}-${token.address}`
|
|
1664
|
+
);
|
|
1665
|
+
};
|
|
1666
|
+
const hasSearchResults = searchQuery.trim() && searchResults.length > 0;
|
|
1667
|
+
const hasNoResults = searchQuery.trim() && searchResults.length === 0;
|
|
1668
|
+
const isEmpty = availableTokens.length === 0 && allTokens.length === 0;
|
|
1669
|
+
return /* @__PURE__ */ jsxs12(Modal, { isOpen, onClose, children: [
|
|
1670
|
+
/* @__PURE__ */ jsxs12(
|
|
1671
|
+
"div",
|
|
1672
|
+
{
|
|
1673
|
+
className: cn(
|
|
1674
|
+
"bg-brand-black-550 px-6 pt-6 pb-4 transition-all duration-200",
|
|
1675
|
+
showHeaderBorder && "border-b border-brand-black-300/70"
|
|
1676
|
+
),
|
|
1677
|
+
children: [
|
|
1678
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between", children: [
|
|
1679
|
+
/* @__PURE__ */ jsx20("div", { className: "body-1 font-medium text-white max-w-[200px] break-words", children: title != null ? title : "Select token" }),
|
|
1680
|
+
/* @__PURE__ */ jsx20(
|
|
1681
|
+
XIcon_default,
|
|
1682
|
+
{
|
|
1683
|
+
className: "size-4 cursor-pointer text-brand-black-100 hover:text-white duration-200 transition-colors",
|
|
1684
|
+
onClick: onClose
|
|
1685
|
+
}
|
|
1686
|
+
)
|
|
1687
|
+
] }),
|
|
1688
|
+
/* @__PURE__ */ jsx20("div", { className: "mt-4", children: /* @__PURE__ */ jsx20(
|
|
1689
|
+
SearchInput,
|
|
1690
|
+
{
|
|
1691
|
+
className: "h-10",
|
|
1692
|
+
placeholder: "Search for token",
|
|
1693
|
+
value: searchQuery,
|
|
1694
|
+
onChange: (e) => setSearchQuery(e.target.value)
|
|
1695
|
+
}
|
|
1696
|
+
) })
|
|
1697
|
+
]
|
|
1698
|
+
}
|
|
1699
|
+
),
|
|
1700
|
+
/* @__PURE__ */ jsx20(ScrollAwareSeparator, { scrollRef: scrollableRef }),
|
|
1701
|
+
/* @__PURE__ */ jsx20(ScrollArea, { ref: scrollableRef, className: "h-full", children: /* @__PURE__ */ jsxs12("div", { className: "px-6 pb-6 space-y-4", children: [
|
|
1702
|
+
hasSearchResults && /* @__PURE__ */ jsxs12("div", { children: [
|
|
1703
|
+
/* @__PURE__ */ jsx20("p", { className: "text-caption text-brand-black-100", children: "Search results" }),
|
|
1704
|
+
/* @__PURE__ */ jsx20("div", { className: "mt-[6px] space-y-2", children: searchResults.map(renderTokenItem) })
|
|
1705
|
+
] }),
|
|
1706
|
+
!searchQuery.trim() && sortedAvailableTokens.length > 0 && /* @__PURE__ */ jsxs12("div", { children: [
|
|
1707
|
+
/* @__PURE__ */ jsx20("p", { className: "text-caption text-brand-black-100", children: "Your tokens" }),
|
|
1708
|
+
/* @__PURE__ */ jsx20("div", { className: "mt-[6px] space-y-2", children: sortedAvailableTokens.map(renderTokenItem) })
|
|
1709
|
+
] }),
|
|
1710
|
+
!searchQuery.trim() && sortedAllTokens.length > 0 && /* @__PURE__ */ jsxs12("div", { children: [
|
|
1711
|
+
/* @__PURE__ */ jsx20("p", { className: "text-caption text-brand-black-100", children: "All tokens" }),
|
|
1712
|
+
/* @__PURE__ */ jsx20("div", { className: "mt-[6px] space-y-2", children: sortedAllTokens.map(renderTokenItem) })
|
|
1713
|
+
] }),
|
|
1714
|
+
hasNoResults && /* @__PURE__ */ jsx20("div", { className: "text-center py-8 h-full flex items-center justify-center", children: /* @__PURE__ */ jsxs12("p", { className: "text-caption text-brand-black-100", children: [
|
|
1715
|
+
"No results found for",
|
|
1716
|
+
" ",
|
|
1717
|
+
/* @__PURE__ */ jsx20("span", { className: "text-white font-medium", children: searchQuery })
|
|
1718
|
+
] }) }),
|
|
1719
|
+
isEmpty && /* @__PURE__ */ jsx20("div", { className: "text-center py-8 h-full flex items-center justify-center", children: /* @__PURE__ */ jsxs12("div", { children: [
|
|
1720
|
+
/* @__PURE__ */ jsx20("p", { className: "body-2 text-brand-black-100 mb-1", children: "No tokens available" }),
|
|
1721
|
+
/* @__PURE__ */ jsx20("p", { className: "text-caption text-brand-black-100", children: "Tokens will appear here when available" })
|
|
1722
|
+
] }) })
|
|
1723
|
+
] }) })
|
|
1724
|
+
] });
|
|
1725
|
+
};
|
|
1726
|
+
function TokenSelectionItem(props) {
|
|
1727
|
+
const _a = props, { token, isAvailable, isActive, AddWalletButton } = _a, PROPS = __objRest(_a, ["token", "isAvailable", "isActive", "AddWalletButton"]);
|
|
1728
|
+
const hasAmount = token.amount > 0;
|
|
1729
|
+
const buttonRef = React6.useRef(null);
|
|
1730
|
+
const buttonContent = /* @__PURE__ */ jsxs12(
|
|
1731
|
+
"div",
|
|
1732
|
+
{
|
|
1733
|
+
className: "cursor-pointer flex items-center justify-between w-full bg-brand-black-500 hover:bg-brand-black-300 duration-200 transition-colors p-3 rounded-[16px]",
|
|
1734
|
+
onClick: () => {
|
|
1735
|
+
var _a2;
|
|
1736
|
+
return (_a2 = buttonRef.current) == null ? void 0 : _a2.click();
|
|
1737
|
+
},
|
|
1738
|
+
onKeyDown: () => {
|
|
1739
|
+
var _a2;
|
|
1740
|
+
return (_a2 = buttonRef.current) == null ? void 0 : _a2.click();
|
|
1741
|
+
},
|
|
1742
|
+
children: [
|
|
1743
|
+
/* @__PURE__ */ jsxs12(
|
|
1744
|
+
"button",
|
|
1745
|
+
__spreadProps(__spreadValues({
|
|
1746
|
+
ref: buttonRef
|
|
1747
|
+
}, PROPS), {
|
|
1748
|
+
type: "button",
|
|
1749
|
+
className: "flex items-center text-start gap-3",
|
|
1750
|
+
disabled: !isAvailable || props.disabled,
|
|
1751
|
+
children: [
|
|
1752
|
+
/* @__PURE__ */ jsx20(TokenImage, { src: token.image, alt: token.symbol, className: "size-6" }),
|
|
1753
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-[2px] items-start", children: [
|
|
1754
|
+
/* @__PURE__ */ jsx20("p", { className: "body-1 font-medium text-white", children: token.name }),
|
|
1755
|
+
/* @__PURE__ */ jsxs12("p", { className: "text-caption text-brand-black-100", children: [
|
|
1756
|
+
token.symbol,
|
|
1757
|
+
" \u2022 ",
|
|
1758
|
+
token.address
|
|
1759
|
+
] })
|
|
1760
|
+
] })
|
|
1761
|
+
]
|
|
1762
|
+
})
|
|
1763
|
+
),
|
|
1764
|
+
/* @__PURE__ */ jsx20("div", { className: "flex flex-col items-end gap-[2px]", children: isAvailable ? hasAmount ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1765
|
+
/* @__PURE__ */ jsx20("p", { className: "body-1 font-medium text-white", children: token.amount.toFixed(6) }),
|
|
1766
|
+
/* @__PURE__ */ jsx20("p", { className: "text-caption text-brand-black-100", children: token.usdValue })
|
|
1767
|
+
] }) : /* @__PURE__ */ jsx20("p", { className: "body-1 font-medium text-brand-black-100", children: "0" }) : AddWalletButton })
|
|
1768
|
+
]
|
|
1769
|
+
}
|
|
1770
|
+
);
|
|
1771
|
+
return /* @__PURE__ */ jsx20(
|
|
1772
|
+
"div",
|
|
1773
|
+
{
|
|
1774
|
+
className: cn(
|
|
1775
|
+
"relative p-[1.5px] rounded-[16px]",
|
|
1776
|
+
isAvailable && isActive && "animated-gradient-border"
|
|
1777
|
+
),
|
|
1778
|
+
children: buttonContent
|
|
1779
|
+
}
|
|
1780
|
+
);
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
// src/components/form/bridge-form.tsx
|
|
1784
|
+
import { useState as useState3 } from "react";
|
|
1785
|
+
|
|
1786
|
+
// src/components/input/input.tsx
|
|
1787
|
+
import * as React7 from "react";
|
|
1788
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1789
|
+
var Input2 = React7.forwardRef((_a, ref) => {
|
|
1790
|
+
var _b = _a, { className, label, error, helperText, id } = _b, props = __objRest(_b, ["className", "label", "error", "helperText", "id"]);
|
|
1791
|
+
const inputId = id || React7.useId();
|
|
1792
|
+
return /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
|
|
1793
|
+
label && /* @__PURE__ */ jsx21(
|
|
1794
|
+
"label",
|
|
1795
|
+
{
|
|
1796
|
+
htmlFor: inputId,
|
|
1797
|
+
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
1798
|
+
children: label
|
|
1799
|
+
}
|
|
1800
|
+
),
|
|
1801
|
+
/* @__PURE__ */ jsx21(
|
|
1802
|
+
Input,
|
|
1803
|
+
__spreadValues({
|
|
1804
|
+
ref,
|
|
1805
|
+
id: inputId,
|
|
1806
|
+
className: cn(
|
|
1807
|
+
error && "border-destructive focus-visible:border-destructive",
|
|
1808
|
+
className
|
|
1809
|
+
)
|
|
1810
|
+
}, props)
|
|
1811
|
+
),
|
|
1812
|
+
(error || helperText) && /* @__PURE__ */ jsx21(
|
|
1813
|
+
"p",
|
|
1814
|
+
{
|
|
1815
|
+
className: cn(
|
|
1816
|
+
"text-sm",
|
|
1817
|
+
error ? "text-destructive" : "text-muted-foreground"
|
|
1818
|
+
),
|
|
1819
|
+
children: error || helperText
|
|
1820
|
+
}
|
|
1821
|
+
)
|
|
1822
|
+
] });
|
|
1823
|
+
});
|
|
1824
|
+
Input2.displayName = "Input";
|
|
1825
|
+
|
|
1826
|
+
// src/components/form/bridge-input.tsx
|
|
1827
|
+
import React8 from "react";
|
|
1828
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1829
|
+
function BridgeInput(props) {
|
|
1830
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1831
|
+
const {
|
|
1832
|
+
receiver,
|
|
1833
|
+
sender,
|
|
1834
|
+
percentage = {
|
|
1835
|
+
options: [25, 50, 100],
|
|
1836
|
+
value: null
|
|
1837
|
+
},
|
|
1838
|
+
presentation = "default",
|
|
1839
|
+
mode = "ready",
|
|
1840
|
+
hasError: error
|
|
1841
|
+
} = props;
|
|
1842
|
+
const isConnected = mode === "ready";
|
|
1843
|
+
const isLoading = presentation === "loading";
|
|
1844
|
+
const handleKeyDown = createKeyDownHandler();
|
|
1845
|
+
const formatPercentageLabel = (percentage2) => {
|
|
1846
|
+
return percentage2 === 100 ? "Max" : `${percentage2}%`;
|
|
1847
|
+
};
|
|
1848
|
+
return /* @__PURE__ */ jsxs14(
|
|
1849
|
+
"div",
|
|
1850
|
+
{
|
|
1851
|
+
className: cn(
|
|
1852
|
+
"flex flex-col bg-brand-black-550 select-none max-w-[440px] rounded-[16px]",
|
|
1853
|
+
isConnected && "border-dashed-wide"
|
|
1854
|
+
),
|
|
1855
|
+
children: [
|
|
1856
|
+
/* @__PURE__ */ jsx22(
|
|
1857
|
+
"section",
|
|
1858
|
+
{
|
|
1859
|
+
"data-testid": "send-section",
|
|
1860
|
+
className: cn(
|
|
1861
|
+
"relative h-1/2 -mx-[1.5px] rounded-[16px] p-[1.5px] transition-all duration-200",
|
|
1862
|
+
isConnected && "bg-brand-black-200",
|
|
1863
|
+
error ? "bg-brand-danger-500" : "bridge-form-border"
|
|
1864
|
+
),
|
|
1865
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "bg-brand-black-500 rounded-[14.5px] h-full relative px-3", children: [
|
|
1866
|
+
/* @__PURE__ */ jsxs14("div", { className: "w-full flex justify-between h-10 items-center", children: [
|
|
1867
|
+
/* @__PURE__ */ jsx22("div", { className: "w-1/2", children: /* @__PURE__ */ jsx22("p", { className: "text-caption text-brand-black-100 font-medium", children: "Send" }) }),
|
|
1868
|
+
/* @__PURE__ */ jsx22("div", { className: "w-1/2", children: /* @__PURE__ */ jsxs14("div", { className: "text-caption text-brand-black-100 font-medium text-right flex items-center gap-1 justify-end", children: [
|
|
1869
|
+
/* @__PURE__ */ jsx22("span", { className: "max-w-[100px] truncate", children: sender.address ? sender.address : "Balance" }),
|
|
1870
|
+
" ",
|
|
1871
|
+
/* @__PURE__ */ jsx22(
|
|
1872
|
+
"span",
|
|
1873
|
+
{
|
|
1874
|
+
className: cn(
|
|
1875
|
+
"max-w-[100px] truncate",
|
|
1876
|
+
props.hasError ? "text-brand-danger-500" : "text-white"
|
|
1877
|
+
),
|
|
1878
|
+
children: /* @__PURE__ */ jsx22(
|
|
1879
|
+
React8.Suspense,
|
|
1880
|
+
{
|
|
1881
|
+
fallback: /* @__PURE__ */ jsx22(
|
|
1882
|
+
"div",
|
|
1883
|
+
{
|
|
1884
|
+
className: cn(
|
|
1885
|
+
"w-8 h-3 bg-brand-black-200 animate-pulse rounded",
|
|
1886
|
+
error && "text-danger-500"
|
|
1887
|
+
)
|
|
1888
|
+
}
|
|
1889
|
+
),
|
|
1890
|
+
children: sender.balance
|
|
1891
|
+
}
|
|
1892
|
+
)
|
|
1893
|
+
}
|
|
1894
|
+
)
|
|
1895
|
+
] }) })
|
|
1896
|
+
] }),
|
|
1897
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex h-[70px] items-center", children: [
|
|
1898
|
+
/* @__PURE__ */ jsx22(
|
|
1899
|
+
Input2,
|
|
1900
|
+
{
|
|
1901
|
+
min: 0,
|
|
1902
|
+
type: "number",
|
|
1903
|
+
placeholder: "0",
|
|
1904
|
+
value: sender.amount,
|
|
1905
|
+
disabled: isLoading,
|
|
1906
|
+
onKeyDown: handleKeyDown,
|
|
1907
|
+
"data-testid": "sender-amount-input",
|
|
1908
|
+
className: "border-none ring-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 text-[48px] leading-[1.2] h-[58px] p-0 text-white placeholder:text-brand-black-100 disabled:opacity-50",
|
|
1909
|
+
onChange: (event) => {
|
|
1910
|
+
var _a2;
|
|
1911
|
+
(_a2 = props.onValueChange) == null ? void 0 : _a2.call(props, event.target.value, event);
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
),
|
|
1915
|
+
/* @__PURE__ */ jsx22("div", { className: "w-[170px] pl-3 py-[13px] flex justify-end", children: props.TokenChangeButton })
|
|
1916
|
+
] }),
|
|
1917
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between h-10", children: [
|
|
1918
|
+
/* @__PURE__ */ jsxs14(
|
|
1919
|
+
"div",
|
|
1920
|
+
{
|
|
1921
|
+
"data-testid": "sender-usd-value",
|
|
1922
|
+
className: "flex items-center text-caption text-brand-black-100 font-medium min-h-6 hover:text-white duration-200 transition-colors",
|
|
1923
|
+
children: [
|
|
1924
|
+
"$",
|
|
1925
|
+
isLoading ? /* @__PURE__ */ jsx22("div", { className: "w-8 h-3 bg-brand-black-200 animate-pulse rounded ml-1" }) : sender.usdValue
|
|
1926
|
+
]
|
|
1927
|
+
}
|
|
1928
|
+
),
|
|
1929
|
+
isConnected && /* @__PURE__ */ jsx22("div", { className: "flex gap-[6px] pt-1", children: percentage.options.map((percent_value) => /* @__PURE__ */ jsx22(
|
|
1930
|
+
Button2,
|
|
1931
|
+
{
|
|
1932
|
+
type: "button",
|
|
1933
|
+
size: "sm",
|
|
1934
|
+
disabled: isLoading,
|
|
1935
|
+
variant: "message",
|
|
1936
|
+
className: cn(
|
|
1937
|
+
"rounded-[60px] h-6 py-1 px-[9.5px] text-caption transition-colors",
|
|
1938
|
+
percentage.value === percent_value ? "bg-white text-brand-black-500 hover:bg-white/90" : "text-brand-black-100 hover:text-white hover:bg-brand-black-200"
|
|
1939
|
+
),
|
|
1940
|
+
onClick: () => props.onPercentageChange(percent_value),
|
|
1941
|
+
children: formatPercentageLabel(percent_value)
|
|
1942
|
+
},
|
|
1943
|
+
percent_value
|
|
1944
|
+
)) })
|
|
1945
|
+
] })
|
|
1946
|
+
] })
|
|
1947
|
+
}
|
|
1948
|
+
),
|
|
1949
|
+
/* @__PURE__ */ jsx22(
|
|
1950
|
+
"section",
|
|
1951
|
+
{
|
|
1952
|
+
className: cn(
|
|
1953
|
+
"grid transition-all duration-200 ease-out",
|
|
1954
|
+
isConnected ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
1955
|
+
),
|
|
1956
|
+
children: /* @__PURE__ */ jsx22("div", { className: "overflow-hidden min-h-0", children: /* @__PURE__ */ jsxs14("div", { className: "p-3", children: [
|
|
1957
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between", children: [
|
|
1958
|
+
/* @__PURE__ */ jsx22("p", { className: "text-caption text-brand-black-100 font-medium w-1/2", children: "Receive" }),
|
|
1959
|
+
!props.EditDestAddressTrigger ? /* @__PURE__ */ jsx22("span", { className: "text-caption text-brand-black-100 font-medium text-right flex items-center justify-end w-1/2", children: /* @__PURE__ */ jsx22("span", { className: "max-w-[100px] truncate", children: receiver.address }) }) : /* @__PURE__ */ jsx22(props.EditDestAddressTrigger, { asChild: true, children: /* @__PURE__ */ jsxs14(
|
|
1960
|
+
"button",
|
|
1961
|
+
{
|
|
1962
|
+
type: "button",
|
|
1963
|
+
disabled: isLoading,
|
|
1964
|
+
"aria-label": "Edit receiver address",
|
|
1965
|
+
className: "cursor-pointer flex !gap-1.5 !text-caption text-brand-black-100 font-medium text-right items-center justify-end w-1/2",
|
|
1966
|
+
children: [
|
|
1967
|
+
/* @__PURE__ */ jsx22("span", { className: "max-w-[100px] truncate", children: receiver.address }),
|
|
1968
|
+
/* @__PURE__ */ jsx22(
|
|
1969
|
+
"span",
|
|
1970
|
+
{
|
|
1971
|
+
"aria-label": "Edit address",
|
|
1972
|
+
className: "cursor-pointer text-foreground hover:scale-110 transition-transform disabled:opacity-50",
|
|
1973
|
+
children: /* @__PURE__ */ jsx22(Pen_default, { className: "size-[0.875rem]" })
|
|
1974
|
+
}
|
|
1975
|
+
)
|
|
1976
|
+
]
|
|
1977
|
+
}
|
|
1978
|
+
) })
|
|
1979
|
+
] }),
|
|
1980
|
+
/* @__PURE__ */ jsx22(
|
|
1981
|
+
"div",
|
|
1982
|
+
{
|
|
1983
|
+
className: cn(
|
|
1984
|
+
"grid transition-all duration-200 ease-out",
|
|
1985
|
+
sender.amount ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
1986
|
+
),
|
|
1987
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "overflow-hidden min-h-0", children: [
|
|
1988
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 py-2", children: [
|
|
1989
|
+
/* @__PURE__ */ jsx22(
|
|
1990
|
+
BadgeIcon,
|
|
1991
|
+
{
|
|
1992
|
+
src: (_b = (_a = sender.token) == null ? void 0 : _a.image) != null ? _b : "",
|
|
1993
|
+
alt: (_d = (_c = sender.token) == null ? void 0 : _c.symbol) != null ? _d : "Token",
|
|
1994
|
+
badgeAlt: (_f = (_e = receiver.network) == null ? void 0 : _e.name) != null ? _f : "Badge",
|
|
1995
|
+
badgeSrc: (_h = (_g = receiver.network) == null ? void 0 : _g.image) != null ? _h : ""
|
|
1996
|
+
}
|
|
1997
|
+
),
|
|
1998
|
+
/* @__PURE__ */ jsx22("span", { className: "text-[20px] leading-[1] font-medium text-brand-black-100", children: isLoading ? /* @__PURE__ */ jsx22("div", { className: "w-16 h-5 bg-brand-black-200 animate-pulse rounded" }) : `${receiver.amount} ${((_i = sender.token) == null ? void 0 : _i.symbol) || ""}` })
|
|
1999
|
+
] }),
|
|
2000
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between pt-1", children: [
|
|
2001
|
+
/* @__PURE__ */ jsxs14(
|
|
2002
|
+
"div",
|
|
2003
|
+
{
|
|
2004
|
+
"data-testid": "receiver-usd-value",
|
|
2005
|
+
className: "flex items-center text-caption text-brand-black-100 font-medium",
|
|
2006
|
+
children: [
|
|
2007
|
+
"$",
|
|
2008
|
+
isLoading ? /* @__PURE__ */ jsx22("div", { className: "w-8 h-3 bg-brand-black-200 animate-pulse rounded ml-1" }) : receiver.usdValue
|
|
2009
|
+
]
|
|
2010
|
+
}
|
|
2011
|
+
),
|
|
2012
|
+
isConnected && /* @__PURE__ */ jsx22("div", { className: "text-brand-black-100 text-caption font-medium", children: isLoading ? /* @__PURE__ */ jsx22("div", { className: "w-12 h-3 bg-brand-black-200 animate-pulse rounded" }) : receiver.estimatedTime })
|
|
2013
|
+
] })
|
|
2014
|
+
] })
|
|
2015
|
+
}
|
|
2016
|
+
)
|
|
2017
|
+
] }) })
|
|
2018
|
+
}
|
|
2019
|
+
)
|
|
2020
|
+
]
|
|
2021
|
+
}
|
|
2022
|
+
);
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
// src/@/ui/dialog.tsx
|
|
2026
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2027
|
+
import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2028
|
+
function Dialog(_a) {
|
|
2029
|
+
var props = __objRest(_a, []);
|
|
2030
|
+
return /* @__PURE__ */ jsx23(DialogPrimitive.Root, __spreadValues({ "data-slot": "dialog" }, props));
|
|
2031
|
+
}
|
|
2032
|
+
function DialogTrigger(_a) {
|
|
2033
|
+
var props = __objRest(_a, []);
|
|
2034
|
+
return /* @__PURE__ */ jsx23(DialogPrimitive.Trigger, __spreadValues({ "data-slot": "dialog-trigger" }, props));
|
|
2035
|
+
}
|
|
2036
|
+
function DialogPortal(_a) {
|
|
2037
|
+
var props = __objRest(_a, []);
|
|
2038
|
+
return /* @__PURE__ */ jsx23(DialogPrimitive.Portal, __spreadValues({ "data-slot": "dialog-portal" }, props));
|
|
2039
|
+
}
|
|
2040
|
+
function DialogClose(_a) {
|
|
2041
|
+
var props = __objRest(_a, []);
|
|
2042
|
+
return /* @__PURE__ */ jsx23(DialogPrimitive.Close, __spreadValues({ "data-slot": "dialog-close" }, props));
|
|
2043
|
+
}
|
|
2044
|
+
function DialogOverlay(_a) {
|
|
2045
|
+
var _b = _a, {
|
|
2046
|
+
className
|
|
2047
|
+
} = _b, props = __objRest(_b, [
|
|
2048
|
+
"className"
|
|
2049
|
+
]);
|
|
2050
|
+
return /* @__PURE__ */ jsx23(
|
|
2051
|
+
DialogPrimitive.Overlay,
|
|
2052
|
+
__spreadValues({
|
|
2053
|
+
"data-slot": "dialog-overlay",
|
|
2054
|
+
className: cn(
|
|
2055
|
+
"data-[state=open]:animate-in backdrop-blur-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 tile-bg",
|
|
2056
|
+
className
|
|
2057
|
+
)
|
|
2058
|
+
}, props)
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
function DialogContent(_a) {
|
|
2062
|
+
var _b = _a, {
|
|
2063
|
+
className,
|
|
2064
|
+
children,
|
|
2065
|
+
showCloseButton = true
|
|
2066
|
+
} = _b, props = __objRest(_b, [
|
|
2067
|
+
"className",
|
|
2068
|
+
"children",
|
|
2069
|
+
"showCloseButton"
|
|
2070
|
+
]);
|
|
2071
|
+
return /* @__PURE__ */ jsxs15(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
2072
|
+
/* @__PURE__ */ jsx23(DialogOverlay, {}),
|
|
2073
|
+
/* @__PURE__ */ jsx23(SmoothCorners, { children: /* @__PURE__ */ jsxs15(
|
|
2074
|
+
DialogPrimitive.Content,
|
|
2075
|
+
__spreadProps(__spreadValues({
|
|
2076
|
+
"data-slot": "dialog-content",
|
|
2077
|
+
className: cn(
|
|
2078
|
+
"bg-brand-black-600 text-brand-black-100 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 pt-4 p-6 shadow-lg duration-200 sm:max-w-[28rem]",
|
|
2079
|
+
className
|
|
2080
|
+
)
|
|
2081
|
+
}, props), {
|
|
2082
|
+
children: [
|
|
2083
|
+
children,
|
|
2084
|
+
showCloseButton && /* @__PURE__ */ jsxs15(
|
|
2085
|
+
DialogPrimitive.Close,
|
|
2086
|
+
{
|
|
2087
|
+
"data-slot": "dialog-close",
|
|
2088
|
+
className: "ring-offset-background w-[calc(32rem/16)] inline-flex items-center justify-center !rounded-full text-brand-black-100 aspect-square focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
2089
|
+
children: [
|
|
2090
|
+
/* @__PURE__ */ jsx23(XIcon_default, { className: "size-4" }),
|
|
2091
|
+
/* @__PURE__ */ jsx23("span", { className: "sr-only", children: "Close" })
|
|
2092
|
+
]
|
|
2093
|
+
}
|
|
2094
|
+
)
|
|
2095
|
+
]
|
|
2096
|
+
})
|
|
2097
|
+
) })
|
|
2098
|
+
] });
|
|
2099
|
+
}
|
|
2100
|
+
function DialogHeader(_a) {
|
|
2101
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2102
|
+
return /* @__PURE__ */ jsx23(
|
|
2103
|
+
"div",
|
|
2104
|
+
__spreadValues({
|
|
2105
|
+
"data-slot": "dialog-header",
|
|
2106
|
+
className: cn(
|
|
2107
|
+
"flex flex-col justify-center px-6 py-[calc(18rem/16)] gap-2 sm:text-left min-h-[calc(64rem/16)] items-start -mt-6 -mx-6",
|
|
2108
|
+
className
|
|
2109
|
+
)
|
|
2110
|
+
}, props)
|
|
2111
|
+
);
|
|
2112
|
+
}
|
|
2113
|
+
function DialogFooter(_a) {
|
|
2114
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2115
|
+
return /* @__PURE__ */ jsx23(
|
|
2116
|
+
"div",
|
|
2117
|
+
__spreadValues({
|
|
2118
|
+
"data-slot": "dialog-footer",
|
|
2119
|
+
className: cn(
|
|
2120
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
2121
|
+
className
|
|
2122
|
+
)
|
|
2123
|
+
}, props)
|
|
2124
|
+
);
|
|
2125
|
+
}
|
|
2126
|
+
function DialogTitle(_a) {
|
|
2127
|
+
var _b = _a, {
|
|
2128
|
+
className
|
|
2129
|
+
} = _b, props = __objRest(_b, [
|
|
2130
|
+
"className"
|
|
2131
|
+
]);
|
|
2132
|
+
return /* @__PURE__ */ jsx23(
|
|
2133
|
+
DialogPrimitive.Title,
|
|
2134
|
+
__spreadValues({
|
|
2135
|
+
"data-slot": "dialog-title",
|
|
2136
|
+
className: cn(
|
|
2137
|
+
"text-[calc(20rem/16)] leading-[calc(28rem/16)] font-medium text-brand-white-500",
|
|
2138
|
+
className
|
|
2139
|
+
)
|
|
2140
|
+
}, props)
|
|
2141
|
+
);
|
|
2142
|
+
}
|
|
2143
|
+
function DialogDescription(_a) {
|
|
2144
|
+
var _b = _a, {
|
|
2145
|
+
className
|
|
2146
|
+
} = _b, props = __objRest(_b, [
|
|
2147
|
+
"className"
|
|
2148
|
+
]);
|
|
2149
|
+
return /* @__PURE__ */ jsx23(
|
|
2150
|
+
DialogPrimitive.Description,
|
|
2151
|
+
__spreadValues({
|
|
2152
|
+
"data-slot": "dialog-description",
|
|
2153
|
+
className: cn("text-muted-foreground text-sm", className)
|
|
2154
|
+
}, props)
|
|
2155
|
+
);
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
// src/components/form/bridge-form.tsx
|
|
2159
|
+
import { Fragment as Fragment4, jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2160
|
+
function BridgeForm({
|
|
2161
|
+
networks,
|
|
2162
|
+
onNetworkInvert,
|
|
2163
|
+
senderAmount = "",
|
|
2164
|
+
onSenderTokenSelect,
|
|
2165
|
+
receiverAddress,
|
|
2166
|
+
onReceiverAddressEdit,
|
|
2167
|
+
senderBalance = "0",
|
|
2168
|
+
senderUsdValue = "0",
|
|
2169
|
+
senderToken = {
|
|
2170
|
+
image: "https://app.hyperbridge.network/networks/polkadot.png",
|
|
2171
|
+
symbol: "DOT"
|
|
2172
|
+
},
|
|
2173
|
+
onSenderAmountChange,
|
|
2174
|
+
receiverAmount = "0",
|
|
2175
|
+
receiverUsdValue = "0",
|
|
2176
|
+
receiverToken = {
|
|
2177
|
+
image: "https://app.hyperbridge.network/networks/polkadot.png",
|
|
2178
|
+
symbol: "DOT"
|
|
2179
|
+
},
|
|
2180
|
+
percentagePresets = [25, 50, 100],
|
|
2181
|
+
activePercentage = null,
|
|
2182
|
+
onPercentageClick,
|
|
2183
|
+
onPercentageReset,
|
|
2184
|
+
estimatedTime = "~ 10 min",
|
|
2185
|
+
className,
|
|
2186
|
+
isLoading = false,
|
|
2187
|
+
senderAddress,
|
|
2188
|
+
error = false,
|
|
2189
|
+
errorMessage,
|
|
2190
|
+
onConnectWallet,
|
|
2191
|
+
onSubmit,
|
|
2192
|
+
onAdjustRelayerFee,
|
|
2193
|
+
bridgeDetails = {
|
|
2194
|
+
bridgeFee: "$1.1",
|
|
2195
|
+
gasFee: "0.0004341 ETH",
|
|
2196
|
+
slippageTolerance: "Auto",
|
|
2197
|
+
routes: 6,
|
|
2198
|
+
estimatedTime: "~ 3 mins"
|
|
2199
|
+
},
|
|
2200
|
+
// Network selector props
|
|
2201
|
+
availableNetworks = [],
|
|
2202
|
+
unavailableNetworks = [],
|
|
2203
|
+
onSourceNetworkSelect,
|
|
2204
|
+
onDestinationNetworkSelect
|
|
2205
|
+
}) {
|
|
2206
|
+
const [showDetails, setShowDetails] = useState3(false);
|
|
2207
|
+
const [isGasHovered, setIsGasHovered] = useState3(false);
|
|
2208
|
+
const [networkSelectorState, setNetworkSelectorState] = useState3(null);
|
|
2209
|
+
const isConnected = !!senderAddress;
|
|
2210
|
+
const handleSubmit = (e) => {
|
|
2211
|
+
e.preventDefault();
|
|
2212
|
+
const buttonState2 = getButtonState();
|
|
2213
|
+
if (buttonState2.onClick && !buttonState2.disabled) {
|
|
2214
|
+
buttonState2.onClick();
|
|
2215
|
+
}
|
|
2216
|
+
};
|
|
2217
|
+
const handleSourceNetworkClick = () => {
|
|
2218
|
+
setNetworkSelectorState("source");
|
|
2219
|
+
};
|
|
2220
|
+
const handleDestinationNetworkClick = () => {
|
|
2221
|
+
setNetworkSelectorState("destination");
|
|
2222
|
+
};
|
|
2223
|
+
const handleCloseNetworkSelector = () => {
|
|
2224
|
+
setNetworkSelectorState(null);
|
|
2225
|
+
};
|
|
2226
|
+
const handleNetworkSelect = (network) => {
|
|
2227
|
+
if (networkSelectorState === "source") {
|
|
2228
|
+
onSourceNetworkSelect == null ? void 0 : onSourceNetworkSelect(network);
|
|
2229
|
+
} else if (networkSelectorState === "destination") {
|
|
2230
|
+
onDestinationNetworkSelect == null ? void 0 : onDestinationNetworkSelect(network);
|
|
2231
|
+
}
|
|
2232
|
+
setNetworkSelectorState(null);
|
|
2233
|
+
};
|
|
2234
|
+
const getSelectedNetwork = () => {
|
|
2235
|
+
if (networkSelectorState === "source") {
|
|
2236
|
+
return availableNetworks.find((n) => n.name === networks.from.name) || null;
|
|
2237
|
+
}
|
|
2238
|
+
return availableNetworks.find((n) => n.name === networks.to.name) || null;
|
|
2239
|
+
};
|
|
2240
|
+
const getButtonState = () => {
|
|
2241
|
+
const numericAmount = Number.parseFloat(senderAmount) || 0;
|
|
2242
|
+
switch (true) {
|
|
2243
|
+
case (error && !!errorMessage):
|
|
2244
|
+
return {
|
|
2245
|
+
text: errorMessage,
|
|
2246
|
+
variant: "destructive",
|
|
2247
|
+
disabled: true,
|
|
2248
|
+
onClick: void 0,
|
|
2249
|
+
animatedGradient: false
|
|
2250
|
+
};
|
|
2251
|
+
case isLoading:
|
|
2252
|
+
return {
|
|
2253
|
+
text: "Loading...",
|
|
2254
|
+
variant: "primary",
|
|
2255
|
+
disabled: true,
|
|
2256
|
+
onClick: void 0,
|
|
2257
|
+
animatedGradient: false
|
|
2258
|
+
};
|
|
2259
|
+
case !isConnected:
|
|
2260
|
+
return {
|
|
2261
|
+
text: "Connect your wallet",
|
|
2262
|
+
variant: "primary",
|
|
2263
|
+
disabled: false,
|
|
2264
|
+
onClick: onConnectWallet,
|
|
2265
|
+
animatedGradient: true
|
|
2266
|
+
};
|
|
2267
|
+
case numericAmount <= 0:
|
|
2268
|
+
return {
|
|
2269
|
+
text: "Enter an amount",
|
|
2270
|
+
variant: "primary",
|
|
2271
|
+
disabled: true,
|
|
2272
|
+
onClick: void 0,
|
|
2273
|
+
animatedGradient: false
|
|
2274
|
+
};
|
|
2275
|
+
default:
|
|
2276
|
+
return {
|
|
2277
|
+
text: "Continue",
|
|
2278
|
+
variant: "primary",
|
|
2279
|
+
disabled: false,
|
|
2280
|
+
onClick: onSubmit,
|
|
2281
|
+
animatedGradient: false
|
|
2282
|
+
};
|
|
2283
|
+
}
|
|
2284
|
+
};
|
|
2285
|
+
const effectiveReceiverAddress = receiverAddress != null ? receiverAddress : senderAddress;
|
|
2286
|
+
const buttonState = getButtonState();
|
|
2287
|
+
const getNetworkSelectorTitle = () => {
|
|
2288
|
+
switch (networkSelectorState) {
|
|
2289
|
+
case "source":
|
|
2290
|
+
return "Select Source Network";
|
|
2291
|
+
case "destination":
|
|
2292
|
+
return "Select Destination Network";
|
|
2293
|
+
default:
|
|
2294
|
+
return "Select Network";
|
|
2295
|
+
}
|
|
2296
|
+
};
|
|
2297
|
+
return /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
|
|
2298
|
+
/* @__PURE__ */ jsxs16("form", { onSubmit: handleSubmit, children: [
|
|
2299
|
+
/* @__PURE__ */ jsx24(
|
|
2300
|
+
NetworkSwitcher,
|
|
2301
|
+
{
|
|
2302
|
+
from: networks.from,
|
|
2303
|
+
to: networks.to,
|
|
2304
|
+
onNetworkInvert,
|
|
2305
|
+
onSourceClick: handleSourceNetworkClick,
|
|
2306
|
+
onDestinationClick: handleDestinationNetworkClick
|
|
2307
|
+
}
|
|
2308
|
+
),
|
|
2309
|
+
/* @__PURE__ */ jsx24("div", { className: "mt-4", children: /* @__PURE__ */ jsx24(
|
|
2310
|
+
BridgeInput,
|
|
2311
|
+
{
|
|
2312
|
+
hasError: Boolean(error),
|
|
2313
|
+
mode: isConnected ? "ready" : "idle",
|
|
2314
|
+
presentation: isLoading ? "loading" : "default",
|
|
2315
|
+
sender: {
|
|
2316
|
+
token: senderToken,
|
|
2317
|
+
amount: senderAmount,
|
|
2318
|
+
balance: /* @__PURE__ */ jsx24(Fragment4, { children: senderBalance }),
|
|
2319
|
+
usdValue: senderUsdValue,
|
|
2320
|
+
address: senderAddress || ""
|
|
2321
|
+
},
|
|
2322
|
+
receiver: {
|
|
2323
|
+
network: {
|
|
2324
|
+
name: receiverToken.symbol,
|
|
2325
|
+
image: receiverToken.image
|
|
2326
|
+
},
|
|
2327
|
+
amount: receiverAmount,
|
|
2328
|
+
usdValue: receiverUsdValue,
|
|
2329
|
+
address: effectiveReceiverAddress || "",
|
|
2330
|
+
estimatedTime: estimatedTime != null ? estimatedTime : "~ 10 min"
|
|
2331
|
+
},
|
|
2332
|
+
percentage: {
|
|
2333
|
+
value: activePercentage,
|
|
2334
|
+
options: percentagePresets
|
|
2335
|
+
},
|
|
2336
|
+
onValueChange: (v) => onSenderAmountChange == null ? void 0 : onSenderAmountChange(v),
|
|
2337
|
+
onPercentageChange: (percent_value) => {
|
|
2338
|
+
const numericBalance = Number.parseFloat(senderBalance.replace(/[^\d.]/g, "")) || 0;
|
|
2339
|
+
if (percent_value === null) {
|
|
2340
|
+
onSenderAmountChange == null ? void 0 : onSenderAmountChange("0");
|
|
2341
|
+
return onPercentageReset == null ? void 0 : onPercentageReset();
|
|
2342
|
+
}
|
|
2343
|
+
const amount = numericBalance * percent_value / 100;
|
|
2344
|
+
onSenderAmountChange == null ? void 0 : onSenderAmountChange(amount.toString());
|
|
2345
|
+
onPercentageClick == null ? void 0 : onPercentageClick(percent_value);
|
|
2346
|
+
},
|
|
2347
|
+
EditDestAddressTrigger: (props) => {
|
|
2348
|
+
return /* @__PURE__ */ jsx24(
|
|
2349
|
+
Button2,
|
|
2350
|
+
__spreadProps(__spreadValues({}, props), {
|
|
2351
|
+
variant: "unset",
|
|
2352
|
+
size: "unset",
|
|
2353
|
+
onClick: onReceiverAddressEdit,
|
|
2354
|
+
asChild: true,
|
|
2355
|
+
children: props.children
|
|
2356
|
+
})
|
|
2357
|
+
);
|
|
2358
|
+
},
|
|
2359
|
+
TokenChangeButton: /* @__PURE__ */ jsx24(TokenSelectorDialog, { children: /* @__PURE__ */ jsx24(
|
|
2360
|
+
TagButton,
|
|
2361
|
+
{
|
|
2362
|
+
className: "cursor-pointer",
|
|
2363
|
+
src: senderToken.image,
|
|
2364
|
+
symbol: senderToken.symbol,
|
|
2365
|
+
variant: "trigger",
|
|
2366
|
+
disabled: isLoading
|
|
2367
|
+
}
|
|
2368
|
+
) })
|
|
2369
|
+
}
|
|
2370
|
+
) }),
|
|
2371
|
+
/* @__PURE__ */ jsx24(
|
|
2372
|
+
"div",
|
|
2373
|
+
{
|
|
2374
|
+
className: cn(
|
|
2375
|
+
"grid transition-all duration-200 ease-out mt-4",
|
|
2376
|
+
senderAmount && Number.parseFloat(senderAmount) > 0 ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
2377
|
+
),
|
|
2378
|
+
children: /* @__PURE__ */ jsxs16("div", { className: "overflow-hidden min-h-0", children: [
|
|
2379
|
+
!showDetails ? /* @__PURE__ */ jsxs16("div", { className: "flex justify-between items-center text-brand-black-100", children: [
|
|
2380
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-3", children: [
|
|
2381
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1", children: [
|
|
2382
|
+
/* @__PURE__ */ jsx24(Server_default, { className: "size-[14px] mt-[0.5px]" }),
|
|
2383
|
+
/* @__PURE__ */ jsx24("span", { className: "text-caption font-medium", children: bridgeDetails.bridgeFee })
|
|
2384
|
+
] }),
|
|
2385
|
+
/* @__PURE__ */ jsx24(
|
|
2386
|
+
"button",
|
|
2387
|
+
{
|
|
2388
|
+
type: "button",
|
|
2389
|
+
className: "flex items-center gap-1 transition-all duration-200 cursor-pointer",
|
|
2390
|
+
onClick: onAdjustRelayerFee,
|
|
2391
|
+
onMouseEnter: () => setIsGasHovered(true),
|
|
2392
|
+
onMouseLeave: () => setIsGasHovered(false),
|
|
2393
|
+
children: !isGasHovered ? /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
2394
|
+
/* @__PURE__ */ jsx24(Gas_default, { className: "size-[14px] mt-[0.5px]" }),
|
|
2395
|
+
/* @__PURE__ */ jsx24("span", { className: "text-caption font-medium", children: bridgeDetails.gasFee })
|
|
2396
|
+
] }) : /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
2397
|
+
/* @__PURE__ */ jsx24(Gas_default, { className: "size-[14px] mt-[0.5px] text-white" }),
|
|
2398
|
+
/* @__PURE__ */ jsx24("span", { className: "text-caption font-medium text-white", children: "Adjust relayer fee" })
|
|
2399
|
+
] })
|
|
2400
|
+
}
|
|
2401
|
+
)
|
|
2402
|
+
] }),
|
|
2403
|
+
/* @__PURE__ */ jsxs16(
|
|
2404
|
+
"button",
|
|
2405
|
+
{
|
|
2406
|
+
type: "button",
|
|
2407
|
+
onClick: () => setShowDetails(!showDetails),
|
|
2408
|
+
className: "flex items-center gap-[2px] cursor-pointer hover:text-white duration-200 transition-colors",
|
|
2409
|
+
children: [
|
|
2410
|
+
/* @__PURE__ */ jsx24("span", { className: "text-caption font-medium", children: "Details" }),
|
|
2411
|
+
/* @__PURE__ */ jsx24(ChevronBottomDown_default, { className: "rotate-180 size-[14px]" })
|
|
2412
|
+
]
|
|
2413
|
+
}
|
|
2414
|
+
)
|
|
2415
|
+
] }) : /* @__PURE__ */ jsxs16("div", { className: "flex justify-between items-center text-brand-black-100", children: [
|
|
2416
|
+
/* @__PURE__ */ jsx24("span", { className: "text-caption font-medium opacity-50", children: "Bridge summary" }),
|
|
2417
|
+
/* @__PURE__ */ jsxs16(
|
|
2418
|
+
"button",
|
|
2419
|
+
{
|
|
2420
|
+
type: "button",
|
|
2421
|
+
onClick: () => setShowDetails(!showDetails),
|
|
2422
|
+
className: "flex items-center gap-[2px] cursor-pointer hover:text-white duration-200 transition-colors",
|
|
2423
|
+
children: [
|
|
2424
|
+
/* @__PURE__ */ jsx24("span", { className: "text-caption font-medium", children: "Hide" }),
|
|
2425
|
+
/* @__PURE__ */ jsx24(ChevronBottomDown_default, { className: "size-[14px]" })
|
|
2426
|
+
]
|
|
2427
|
+
}
|
|
2428
|
+
)
|
|
2429
|
+
] }),
|
|
2430
|
+
/* @__PURE__ */ jsx24(
|
|
2431
|
+
"div",
|
|
2432
|
+
{
|
|
2433
|
+
className: cn(
|
|
2434
|
+
"grid transition-all duration-200 ease-out",
|
|
2435
|
+
showDetails ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
2436
|
+
),
|
|
2437
|
+
children: /* @__PURE__ */ jsx24("div", { className: "overflow-hidden min-h-0", children: /* @__PURE__ */ jsxs16("div", { className: "pt-4 space-y-3", children: [
|
|
2438
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex justify-between items-center text-brand-black-100", children: [
|
|
2439
|
+
/* @__PURE__ */ jsxs16("span", { className: "text-caption font-medium flex items-center gap-1", children: [
|
|
2440
|
+
/* @__PURE__ */ jsx24(Percent_default, { className: "size-[14px]" }),
|
|
2441
|
+
"Bridge fee"
|
|
2442
|
+
] }),
|
|
2443
|
+
/* @__PURE__ */ jsx24("span", { className: "text-caption font-medium text-white", children: bridgeDetails.bridgeFee })
|
|
2444
|
+
] }),
|
|
2445
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex justify-between items-center text-brand-black-100", children: [
|
|
2446
|
+
/* @__PURE__ */ jsxs16("span", { className: "text-caption font-medium flex items-center gap-1", children: [
|
|
2447
|
+
/* @__PURE__ */ jsx24(Gas_default, { className: "size-[14px]" }),
|
|
2448
|
+
"Gas costs"
|
|
2449
|
+
] }),
|
|
2450
|
+
/* @__PURE__ */ jsx24("span", { className: "text-caption font-medium text-white", children: bridgeDetails.gasFee })
|
|
2451
|
+
] }),
|
|
2452
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex justify-between items-center text-brand-black-100", children: [
|
|
2453
|
+
/* @__PURE__ */ jsxs16("span", { className: "text-caption font-medium flex items-center gap-1", children: [
|
|
2454
|
+
/* @__PURE__ */ jsx24(ArrowBottomTop_default, { className: "size-[14px]" }),
|
|
2455
|
+
"Slippage tolerance"
|
|
2456
|
+
] }),
|
|
2457
|
+
/* @__PURE__ */ jsx24("span", { className: "text-caption font-medium text-white", children: bridgeDetails.slippageTolerance })
|
|
2458
|
+
] }),
|
|
2459
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex justify-between items-center text-brand-black-100", children: [
|
|
2460
|
+
/* @__PURE__ */ jsxs16("span", { className: "text-caption font-medium flex items-center gap-1", children: [
|
|
2461
|
+
/* @__PURE__ */ jsx24(ArrowSplit_default, { className: "size-[14px]" }),
|
|
2462
|
+
"Route"
|
|
2463
|
+
] }),
|
|
2464
|
+
/* @__PURE__ */ jsxs16("span", { className: "text-caption font-medium text-white", children: [
|
|
2465
|
+
bridgeDetails.routes,
|
|
2466
|
+
" stops"
|
|
2467
|
+
] })
|
|
2468
|
+
] }),
|
|
2469
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex justify-between items-center text-brand-black-100", children: [
|
|
2470
|
+
/* @__PURE__ */ jsxs16("span", { className: "text-caption font-medium flex items-center gap-1", children: [
|
|
2471
|
+
/* @__PURE__ */ jsx24(Clock_default, { className: "size-[14px]" }),
|
|
2472
|
+
"Estimated time"
|
|
2473
|
+
] }),
|
|
2474
|
+
/* @__PURE__ */ jsx24("span", { className: "text-caption font-medium text-white", children: bridgeDetails.estimatedTime })
|
|
2475
|
+
] })
|
|
2476
|
+
] }) })
|
|
2477
|
+
}
|
|
2478
|
+
)
|
|
2479
|
+
] })
|
|
2480
|
+
}
|
|
2481
|
+
),
|
|
2482
|
+
/* @__PURE__ */ jsx24("div", { className: "mt-4", children: /* @__PURE__ */ jsx24(
|
|
2483
|
+
Button2,
|
|
2484
|
+
{
|
|
2485
|
+
type: buttonState.onClick ? "submit" : "button",
|
|
2486
|
+
className: "w-full body-2 font-medium",
|
|
2487
|
+
variant: buttonState.variant,
|
|
2488
|
+
disabled: buttonState.disabled,
|
|
2489
|
+
animatedGradient: buttonState.animatedGradient,
|
|
2490
|
+
onClick: buttonState.onClick ? void 0 : buttonState.onClick,
|
|
2491
|
+
children: buttonState.text
|
|
2492
|
+
}
|
|
2493
|
+
) })
|
|
2494
|
+
] }),
|
|
2495
|
+
/* @__PURE__ */ jsx24(
|
|
2496
|
+
NetworkSelector,
|
|
2497
|
+
{
|
|
2498
|
+
isOpen: !!networkSelectorState,
|
|
2499
|
+
title: getNetworkSelectorTitle(),
|
|
2500
|
+
availableNetworks,
|
|
2501
|
+
unavailableNetworks,
|
|
2502
|
+
selectedNetwork: getSelectedNetwork(),
|
|
2503
|
+
onNetworkSelect: handleNetworkSelect,
|
|
2504
|
+
onClose: handleCloseNetworkSelector
|
|
2505
|
+
}
|
|
2506
|
+
)
|
|
2507
|
+
] });
|
|
2508
|
+
}
|
|
2509
|
+
function TokenSelectorDialog(props) {
|
|
2510
|
+
const {
|
|
2511
|
+
// Token selector props
|
|
2512
|
+
allTokens = [],
|
|
2513
|
+
availableTokens = [],
|
|
2514
|
+
selectedToken = null,
|
|
2515
|
+
onTokenSelect,
|
|
2516
|
+
onAddToWallet,
|
|
2517
|
+
children
|
|
2518
|
+
} = props;
|
|
2519
|
+
const [isTokenSelectorOpen, setIsTokenSelectorOpen] = useState3(false);
|
|
2520
|
+
const handleCloseTokenSelector = () => {
|
|
2521
|
+
setIsTokenSelectorOpen(false);
|
|
2522
|
+
};
|
|
2523
|
+
const handleTokenSelect = (token) => {
|
|
2524
|
+
onTokenSelect == null ? void 0 : onTokenSelect(token);
|
|
2525
|
+
setIsTokenSelectorOpen(false);
|
|
2526
|
+
};
|
|
2527
|
+
return /* @__PURE__ */ jsxs16(Dialog, { children: [
|
|
2528
|
+
/* @__PURE__ */ jsx24(DialogTrigger, { asChild: true, children }),
|
|
2529
|
+
/* @__PURE__ */ jsx24(
|
|
2530
|
+
TokenSelector,
|
|
2531
|
+
{
|
|
2532
|
+
isOpen: isTokenSelectorOpen,
|
|
2533
|
+
title: "Select Token",
|
|
2534
|
+
allTokens,
|
|
2535
|
+
availableTokens,
|
|
2536
|
+
selectedToken,
|
|
2537
|
+
onTokenSelect: handleTokenSelect,
|
|
2538
|
+
onAddToWallet,
|
|
2539
|
+
onClose: handleCloseTokenSelector
|
|
2540
|
+
}
|
|
2541
|
+
)
|
|
2542
|
+
] });
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
// src/components/molecules/address-input.tsx
|
|
2546
|
+
import { useId as useId2, forwardRef as forwardRef2 } from "react";
|
|
2547
|
+
import { motion as motion2 } from "motion/react";
|
|
2548
|
+
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
2549
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2550
|
+
var AddressInput = forwardRef2((props, ref) => {
|
|
2551
|
+
const id = useId2();
|
|
2552
|
+
const _a = props, { network, validity } = _a, __props = __objRest(_a, ["network", "validity"]);
|
|
2553
|
+
const input_id = `address${id}`;
|
|
2554
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-[calc(6rem/16)] w-full select-none", children: [
|
|
2555
|
+
/* @__PURE__ */ jsx25(Text, { variant: "caption", className: "text-muted-foreground", asChild: true, children: /* @__PURE__ */ jsx25("label", { htmlFor: input_id, children: "To address" }) }),
|
|
2556
|
+
/* @__PURE__ */ jsxs17("div", { className: "bg-brand-black-350 w-full h-[calc(50rem/16)] justify-start gap-2 flex py-[calc(13rem/16)] px-[calc(12rem/16)] rounded-[1rem]", children: [
|
|
2557
|
+
props.validity.status === "error" ? /* @__PURE__ */ jsx25(IconButton, { variant: "level_2", rounded: "full", size: "xs", asChild: true, children: /* @__PURE__ */ jsx25("span", { className: "w-[calc(24rem/16)]", children: /* @__PURE__ */ jsx25(CirclePlaceholderDashed_default, { width: "1em" }) }) }) : /* @__PURE__ */ jsx25(
|
|
2558
|
+
TokenImage,
|
|
2559
|
+
{
|
|
2560
|
+
className: "w-[calc(24rem/16)]",
|
|
2561
|
+
src: props.network.imageUrl,
|
|
2562
|
+
alt: props.network.name
|
|
2563
|
+
}
|
|
2564
|
+
),
|
|
2565
|
+
/* @__PURE__ */ jsx25(
|
|
2566
|
+
"input",
|
|
2567
|
+
__spreadProps(__spreadValues({
|
|
2568
|
+
ref,
|
|
2569
|
+
id: input_id,
|
|
2570
|
+
type: "text",
|
|
2571
|
+
placeholder: "Paste wallet address"
|
|
2572
|
+
}, __props), {
|
|
2573
|
+
className: "!outline-none placeholder:text-brand-black-100 text-foreground bg-transparent appearance-none w-full"
|
|
2574
|
+
})
|
|
2575
|
+
)
|
|
2576
|
+
] }),
|
|
2577
|
+
/* @__PURE__ */ jsx25(Text, { variant: "caption", asChild: true, children: /* @__PURE__ */ jsxs17(
|
|
2578
|
+
motion2.p,
|
|
2579
|
+
{
|
|
2580
|
+
initial: { opacity: 0, marginTop: -10 },
|
|
2581
|
+
animate: props.value ? { opacity: 1, marginTop: 0 } : { opacity: 0, marginTop: -10 },
|
|
2582
|
+
className: cn("inline-flex select-none gap-1 items-center", {
|
|
2583
|
+
"text-brand-success-400": props.validity.status === "ok",
|
|
2584
|
+
"text-brand-danger-500": props.validity.status === "error"
|
|
2585
|
+
}),
|
|
2586
|
+
children: [
|
|
2587
|
+
props.validity.status === "ok" ? /* @__PURE__ */ jsx25(Check_default, { width: "1em" }) : /* @__PURE__ */ jsx25(XCircle_default, { width: "1em" }),
|
|
2588
|
+
/* @__PURE__ */ jsx25("span", { children: props.validity.message })
|
|
2589
|
+
]
|
|
2590
|
+
}
|
|
2591
|
+
) })
|
|
2592
|
+
] });
|
|
2593
|
+
});
|
|
2594
|
+
function AddressInputFocusBehaviour(props) {
|
|
2595
|
+
return /* @__PURE__ */ jsx25(
|
|
2596
|
+
Slot6,
|
|
2597
|
+
__spreadProps(__spreadValues({}, props), {
|
|
2598
|
+
onFocus: (e) => {
|
|
2599
|
+
const input = e.currentTarget;
|
|
2600
|
+
const alloweElements = /* @__PURE__ */ new Set(["input", "textarea"]);
|
|
2601
|
+
if (!alloweElements.has(input.tagName.toLowerCase())) return;
|
|
2602
|
+
const len = input.value.length;
|
|
2603
|
+
input.setSelectionRange(len, len);
|
|
2604
|
+
},
|
|
2605
|
+
onMouseDown: (evt) => {
|
|
2606
|
+
evt.preventDefault();
|
|
2607
|
+
const { target } = evt;
|
|
2608
|
+
target.setSelectionRange(43, 43);
|
|
2609
|
+
target.focus();
|
|
2610
|
+
},
|
|
2611
|
+
children: props.children
|
|
2612
|
+
})
|
|
2613
|
+
);
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
// src/components/if.tsx
|
|
2617
|
+
import { Fragment as Fragment5, jsx as jsx26 } from "react/jsx-runtime";
|
|
2618
|
+
function If({ cond: condition, children }) {
|
|
2619
|
+
if (!condition) return null;
|
|
2620
|
+
return /* @__PURE__ */ jsx26(Fragment5, { children });
|
|
2621
|
+
}
|
|
2622
|
+
var if_default = If;
|
|
2623
|
+
|
|
2624
|
+
// src/components/molecules/asset-list.tsx
|
|
2625
|
+
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2626
|
+
function AssetListItem(props) {
|
|
2627
|
+
const { caption, tokenImage } = props;
|
|
2628
|
+
return /* @__PURE__ */ jsxs18("li", { className: "flex gap-[0.75rem] select-none items-center text-brand-black-100", children: [
|
|
2629
|
+
/* @__PURE__ */ jsx27(BadgeIcon, __spreadValues({}, tokenImage)),
|
|
2630
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-grow flex-col text-start gap-[0.125rem]", children: [
|
|
2631
|
+
/* @__PURE__ */ jsx27("span", { className: "text-brand-white-500 text-[0.875rem] h-[1.25rem]", children: caption }),
|
|
2632
|
+
/* @__PURE__ */ jsxs18("span", { className: "text-xs h-[1rem] flex items-center gap-[0.125rem]", children: [
|
|
2633
|
+
props.amount,
|
|
2634
|
+
" ",
|
|
2635
|
+
/* @__PURE__ */ jsxs18(if_default, { cond: Boolean(props.address), children: [
|
|
2636
|
+
"\u2022 ",
|
|
2637
|
+
props.address
|
|
2638
|
+
] })
|
|
2639
|
+
] })
|
|
2640
|
+
] }),
|
|
2641
|
+
/* @__PURE__ */ jsx27("div", { className: "flex-col shrink-0 text-end", children: /* @__PURE__ */ jsx27("span", { className: "text-brand-white-500 text-[1rem] h-[1.25rem]", children: props.amountInUSD }) })
|
|
2642
|
+
] });
|
|
2643
|
+
}
|
|
2644
|
+
function AssetList(props) {
|
|
2645
|
+
return /* @__PURE__ */ jsx27("ul", __spreadProps(__spreadValues({}, props), { className: cn("flex flex-col gap-[1rem]", props.className), children: props.children }));
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
// src/components/atoms/gradient-line.tsx
|
|
2649
|
+
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
2650
|
+
import React9 from "react";
|
|
2651
|
+
import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2652
|
+
function GradientContainer(props) {
|
|
2653
|
+
return /* @__PURE__ */ jsx28(Slot7, { className: "relative overflow-hidden", children: props.children });
|
|
2654
|
+
}
|
|
2655
|
+
function GradientLine(props) {
|
|
2656
|
+
const ref = React9.useRef(null);
|
|
2657
|
+
const { behaviour, value, mode = "default" } = props;
|
|
2658
|
+
React9.useEffect(() => {
|
|
2659
|
+
const el = ref.current;
|
|
2660
|
+
if (!el) return;
|
|
2661
|
+
const parent = el.parentElement;
|
|
2662
|
+
if (!parent) return;
|
|
2663
|
+
const updateWidth = () => {
|
|
2664
|
+
const dim = parent.getBoundingClientRect();
|
|
2665
|
+
parent.style.setProperty("--grad-container-w", `${dim.width}px`);
|
|
2666
|
+
parent.style.setProperty("--grad-container-h", `${dim.height}px`);
|
|
2667
|
+
};
|
|
2668
|
+
updateWidth();
|
|
2669
|
+
window.addEventListener("resize", updateWidth);
|
|
2670
|
+
return () => {
|
|
2671
|
+
window.removeEventListener("resize", updateWidth);
|
|
2672
|
+
};
|
|
2673
|
+
}, []);
|
|
2674
|
+
React9.useEffect(() => {
|
|
2675
|
+
const el = ref.current;
|
|
2676
|
+
if (!el) return;
|
|
2677
|
+
if (behaviour !== "duration") return;
|
|
2678
|
+
el.style.transition = `width ${value}ms linear`;
|
|
2679
|
+
el.style.width = "100%";
|
|
2680
|
+
}, [behaviour, value]);
|
|
2681
|
+
React9.useEffect(() => {
|
|
2682
|
+
if (behaviour !== "progress") return;
|
|
2683
|
+
const el = ref.current;
|
|
2684
|
+
if (!el) return;
|
|
2685
|
+
el.style.width = `${value}%`;
|
|
2686
|
+
}, [behaviour, value]);
|
|
2687
|
+
return /* @__PURE__ */ jsx28("div", { className: "inset-0 flex flex-col absolute z-[0] justify-end", children: /* @__PURE__ */ jsx28(
|
|
2688
|
+
"div",
|
|
2689
|
+
{
|
|
2690
|
+
ref,
|
|
2691
|
+
className: "relative flex flex-col overflow-hidden w-0 h-[var(--grad-container-h)]",
|
|
2692
|
+
children: /* @__PURE__ */ jsxs19("div", { className: "flex flex-col flex-1 z-[-1] w-[var(--grad-container-w)]", children: [
|
|
2693
|
+
/* @__PURE__ */ jsx28(
|
|
2694
|
+
"div",
|
|
2695
|
+
{
|
|
2696
|
+
className: cn("flex-1 w-full", {
|
|
2697
|
+
"bg-[#2F1A28]": mode === "error",
|
|
2698
|
+
"bg-brand-black-300/50": mode === "default"
|
|
2699
|
+
})
|
|
2700
|
+
}
|
|
2701
|
+
),
|
|
2702
|
+
/* @__PURE__ */ jsx28(
|
|
2703
|
+
"div",
|
|
2704
|
+
{
|
|
2705
|
+
className: "w-full h-px",
|
|
2706
|
+
style: {
|
|
2707
|
+
background: mode === "error" ? "var(--color-brand-danger-500)" : "linear-gradient(90deg, #FFFFFF 0%, #FFFFFF 10%, #4ADEFF 29.71%, #FF35EB 78.68%, #FFED4A 100%)"
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
)
|
|
2711
|
+
] })
|
|
2712
|
+
}
|
|
2713
|
+
) });
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
// src/components/molecules/connect-wallet.tsx
|
|
2717
|
+
import { Fragment as Fragment6, jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2718
|
+
function WalletAccountItem(props) {
|
|
2719
|
+
const { network, wallet, address, isActive } = props;
|
|
2720
|
+
return /* @__PURE__ */ jsxs20("li", { className: "p-[0.75rem] select-none h-[3.75rem] rounded-[1rem] bg-brand-black-350 items-center flex gap-[0.625rem] w-full", children: [
|
|
2721
|
+
/* @__PURE__ */ jsx29(
|
|
2722
|
+
BadgeIcon,
|
|
2723
|
+
{
|
|
2724
|
+
src: wallet.image,
|
|
2725
|
+
alt: wallet.name,
|
|
2726
|
+
badgeSrc: network.image,
|
|
2727
|
+
badgeAlt: network.name
|
|
2728
|
+
}
|
|
2729
|
+
),
|
|
2730
|
+
/* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
2731
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex grow-1 flex-col font-medium text-brand-white-500", children: [
|
|
2732
|
+
/* @__PURE__ */ jsx29("span", { className: "text-body", children: address != null ? address : "{{Address}}" }),
|
|
2733
|
+
isActive && /* @__PURE__ */ jsxs20("span", { className: "text-caption-2 h-[1rem] text-brand-white-500 inline-flex items-center gap-0.5", children: [
|
|
2734
|
+
/* @__PURE__ */ jsx29(Check_default, { className: "text-brand-success-400" }),
|
|
2735
|
+
" Connected"
|
|
2736
|
+
] })
|
|
2737
|
+
] }),
|
|
2738
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex grow-0 gap-[0.375rem] h-[2rem] items-stretch shrink-0 *:shrink-0", children: [
|
|
2739
|
+
/* @__PURE__ */ jsx29(
|
|
2740
|
+
IconButton,
|
|
2741
|
+
{
|
|
2742
|
+
size: "sm",
|
|
2743
|
+
variant: "level_2",
|
|
2744
|
+
rounded: "default",
|
|
2745
|
+
className: "cursor-pointer",
|
|
2746
|
+
onClick: () => {
|
|
2747
|
+
var _a;
|
|
2748
|
+
(_a = props == null ? void 0 : props.onCopy) == null ? void 0 : _a.call(props);
|
|
2749
|
+
},
|
|
2750
|
+
children: /* @__PURE__ */ jsx29(Copy_default, { className: "size-4 text-brand-black-100" })
|
|
2751
|
+
}
|
|
2752
|
+
),
|
|
2753
|
+
/* @__PURE__ */ jsxs20(
|
|
2754
|
+
Button,
|
|
2755
|
+
{
|
|
2756
|
+
size: "sm",
|
|
2757
|
+
variant: "level_2",
|
|
2758
|
+
className: "h-[auto] !gap-0 group cursor-pointer",
|
|
2759
|
+
onClick: () => {
|
|
2760
|
+
var _a;
|
|
2761
|
+
return (_a = props == null ? void 0 : props.onDisconnect) == null ? void 0 : _a.call(props);
|
|
2762
|
+
},
|
|
2763
|
+
children: [
|
|
2764
|
+
/* @__PURE__ */ jsx29(Power_default, { className: "size-4 text-brand-black-100" }),
|
|
2765
|
+
/* @__PURE__ */ jsx29("span", { className: "w-0 transition-all overflow-hidden group-hover:w-[10ch]", children: "Disconnect" })
|
|
2766
|
+
]
|
|
2767
|
+
}
|
|
2768
|
+
)
|
|
2769
|
+
] })
|
|
2770
|
+
] })
|
|
2771
|
+
] });
|
|
2772
|
+
}
|
|
2773
|
+
function WalletProviderItem(props) {
|
|
2774
|
+
const {
|
|
2775
|
+
status,
|
|
2776
|
+
image: wallet,
|
|
2777
|
+
installed = true,
|
|
2778
|
+
unsupported = "supported",
|
|
2779
|
+
transition = { progress_duration: 5e3 }
|
|
2780
|
+
} = props;
|
|
2781
|
+
const is_supported = unsupported === "supported";
|
|
2782
|
+
return /* @__PURE__ */ jsx29(GradientContainer, { children: /* @__PURE__ */ jsxs20("li", { className: "p-[0.75rem] select-none w-full flex h-[3.75rem] rounded-[1rem] bg-brand-black-350 items-center", children: [
|
|
2783
|
+
status === "connecting" ? /* @__PURE__ */ jsx29(
|
|
2784
|
+
GradientLine,
|
|
2785
|
+
{
|
|
2786
|
+
behaviour: "duration",
|
|
2787
|
+
value: transition.progress_duration
|
|
2788
|
+
}
|
|
2789
|
+
) : null,
|
|
2790
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex z-10 gap-[0.625rem] w-full items-center", children: [
|
|
2791
|
+
/* @__PURE__ */ jsx29(TokenImage, { src: wallet.src, alt: wallet.name, className: "w-[2rem]" }),
|
|
2792
|
+
/* @__PURE__ */ jsx29("div", { className: "flex grow-1 flex-col font-medium text-brand-white-500", children: /* @__PURE__ */ jsx29("span", { className: "text-base leading-[1.6]", children: wallet.name }) }),
|
|
2793
|
+
!is_supported ? /* @__PURE__ */ jsx29("span", { className: "text-brand-black-100 text-xs font-medium", children: unsupported }) : null,
|
|
2794
|
+
!installed && is_supported ? /* @__PURE__ */ jsx29(Button, { variant: "level_2", size: "sm", onClick: props.onConnect, children: "Install" }) : null,
|
|
2795
|
+
installed && is_supported && /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
2796
|
+
status === "failed" && /* @__PURE__ */ jsxs20("div", { className: "flex grow-0 gap-[0.375rem] h-[2rem] items-stretch shrink-0 *:shrink-0", children: [
|
|
2797
|
+
/* @__PURE__ */ jsxs20(
|
|
2798
|
+
Button,
|
|
2799
|
+
{
|
|
2800
|
+
size: "sm",
|
|
2801
|
+
variant: "level_2",
|
|
2802
|
+
className: "h-[auto]",
|
|
2803
|
+
onClick: props.onRetry,
|
|
2804
|
+
children: [
|
|
2805
|
+
/* @__PURE__ */ jsx29(RotateCcw_default, { className: "size-4 text-brand-black-100" }),
|
|
2806
|
+
"Try again"
|
|
2807
|
+
]
|
|
2808
|
+
}
|
|
2809
|
+
),
|
|
2810
|
+
/* @__PURE__ */ jsx29(
|
|
2811
|
+
IconButton,
|
|
2812
|
+
{
|
|
2813
|
+
className: "cursor-pointer",
|
|
2814
|
+
variant: "level_2",
|
|
2815
|
+
size: "sm",
|
|
2816
|
+
onClick: props.onCancel,
|
|
2817
|
+
rounded: "default",
|
|
2818
|
+
children: /* @__PURE__ */ jsx29(XIcon_default, { className: "text-brand-black-100 size-[1em]" })
|
|
2819
|
+
}
|
|
2820
|
+
)
|
|
2821
|
+
] }),
|
|
2822
|
+
(status === "connecting" || status === "idle") && /* @__PURE__ */ jsx29(
|
|
2823
|
+
Button,
|
|
2824
|
+
{
|
|
2825
|
+
variant: "level_2",
|
|
2826
|
+
size: "sm",
|
|
2827
|
+
onClick: props.onConnect,
|
|
2828
|
+
disabled: status === "connecting",
|
|
2829
|
+
children: status === "connecting" ? "Connecting" : "Connect"
|
|
2830
|
+
}
|
|
2831
|
+
),
|
|
2832
|
+
status === "connected" && /* @__PURE__ */ jsx29("span", { className: "text-brand-success-400 text-xs font-medium", children: "Connected" })
|
|
2833
|
+
] })
|
|
2834
|
+
] })
|
|
2835
|
+
] }) });
|
|
2836
|
+
}
|
|
2837
|
+
function NetworkGroupItem(props) {
|
|
2838
|
+
const { image: wallet } = props;
|
|
2839
|
+
return /* @__PURE__ */ jsx29("li", { className: "p-[0.75rem] select-none flex h-[3.75rem] rounded-[1rem] bg-brand-black-350 w-full", children: /* @__PURE__ */ jsxs20("div", { className: "flex gap-[0.625rem] w-full z-20 relative items-center", children: [
|
|
2840
|
+
/* @__PURE__ */ jsx29(TokenImage, { className: "w-[2rem]", src: wallet.src, alt: wallet.name }),
|
|
2841
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex grow-1 flex-col font-medium text-brand-white-500", children: [
|
|
2842
|
+
/* @__PURE__ */ jsx29("span", { className: "text-body", children: wallet.name }),
|
|
2843
|
+
/* @__PURE__ */ jsx29("span", { className: "text-caption-2 text-brand-black-100", children: props.description })
|
|
2844
|
+
] }),
|
|
2845
|
+
/* @__PURE__ */ jsx29(Button, { variant: "level_2", size: "sm", onClick: props.onConnect, children: "Connect" })
|
|
2846
|
+
] }) });
|
|
2847
|
+
}
|
|
2848
|
+
function AccountItem(props) {
|
|
2849
|
+
const { network, wallet, address, isActive } = props;
|
|
2850
|
+
const handleSelect = () => {
|
|
2851
|
+
var _a;
|
|
2852
|
+
if (!isActive) {
|
|
2853
|
+
(_a = props == null ? void 0 : props.onConnect) == null ? void 0 : _a.call(props);
|
|
2854
|
+
}
|
|
2855
|
+
};
|
|
2856
|
+
return /* @__PURE__ */ jsxs20("li", { className: "select-none h-[3.75rem] items-center flex gap-[0.625rem] w-full", children: [
|
|
2857
|
+
/* @__PURE__ */ jsx29(
|
|
2858
|
+
IconButton,
|
|
2859
|
+
{
|
|
2860
|
+
className: `group ${isActive ? "cursor-default" : "cursor-pointer"}`,
|
|
2861
|
+
variant: "secondary",
|
|
2862
|
+
onClick: handleSelect,
|
|
2863
|
+
title: isActive ? "Already active" : "Activate this account",
|
|
2864
|
+
children: isActive ? /* @__PURE__ */ jsx29(Check_default, { className: "size-4 text-brand-success-400" }) : /* @__PURE__ */ jsx29(CirclePlaceholder_default, { className: "size-4 text-brand-black-100 group-hover:text-white duration-200 transition-colors" })
|
|
2865
|
+
}
|
|
2866
|
+
),
|
|
2867
|
+
/* @__PURE__ */ jsx29(
|
|
2868
|
+
BadgeIcon,
|
|
2869
|
+
{
|
|
2870
|
+
src: wallet.image,
|
|
2871
|
+
alt: wallet.name,
|
|
2872
|
+
badgeSrc: network.image,
|
|
2873
|
+
badgeAlt: network.name
|
|
2874
|
+
}
|
|
2875
|
+
),
|
|
2876
|
+
/* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
2877
|
+
/* @__PURE__ */ jsx29("div", { className: "flex grow-1 flex-col font-medium text-brand-white-500", children: /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-[6px]", children: [
|
|
2878
|
+
/* @__PURE__ */ jsx29("span", { className: "text-body", children: address != null ? address : "{{Address}}" }),
|
|
2879
|
+
isActive && /* @__PURE__ */ jsx29("span", { className: "bg-brand-success-400/10 text-brand-success-400 px-[6px] py-[3px] rounded-[60px]", children: /* @__PURE__ */ jsx29(Text, { variant: "caption2", className: "font-semibold", children: "Active" }) })
|
|
2880
|
+
] }) }),
|
|
2881
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex gap-[6px] grow-0 h-[2rem] items-stretch shrink-0 *:shrink-0", children: [
|
|
2882
|
+
/* @__PURE__ */ jsx29(
|
|
2883
|
+
IconButton,
|
|
2884
|
+
{
|
|
2885
|
+
size: "sm",
|
|
2886
|
+
variant: "level_2",
|
|
2887
|
+
rounded: "default",
|
|
2888
|
+
className: "cursor-pointer",
|
|
2889
|
+
onClick: () => {
|
|
2890
|
+
var _a;
|
|
2891
|
+
(_a = props == null ? void 0 : props.onCopy) == null ? void 0 : _a.call(props);
|
|
2892
|
+
},
|
|
2893
|
+
children: /* @__PURE__ */ jsx29(Copy_default, { className: "size-4 text-brand-black-100" })
|
|
2894
|
+
}
|
|
2895
|
+
),
|
|
2896
|
+
/* @__PURE__ */ jsxs20(
|
|
2897
|
+
Button,
|
|
2898
|
+
{
|
|
2899
|
+
size: "sm",
|
|
2900
|
+
variant: "level_2",
|
|
2901
|
+
className: "h-[auto] !gap-0 group cursor-pointer",
|
|
2902
|
+
onClick: () => {
|
|
2903
|
+
var _a;
|
|
2904
|
+
return (_a = props == null ? void 0 : props.onDisconnect) == null ? void 0 : _a.call(props);
|
|
2905
|
+
},
|
|
2906
|
+
children: [
|
|
2907
|
+
/* @__PURE__ */ jsx29(Power_default, { className: "size-4 text-brand-black-100" }),
|
|
2908
|
+
/* @__PURE__ */ jsx29("span", { className: "w-0 transition-all overflow-hidden group-hover:w-[10ch]", children: "Disconnect" })
|
|
2909
|
+
]
|
|
2910
|
+
}
|
|
2911
|
+
)
|
|
2912
|
+
] })
|
|
2913
|
+
] })
|
|
2914
|
+
] });
|
|
2915
|
+
}
|
|
2916
|
+
|
|
2917
|
+
// src/components/molecules/review-item.tsx
|
|
2918
|
+
import React10 from "react";
|
|
2919
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2920
|
+
function ReviewItem(props) {
|
|
2921
|
+
const Btn = props.AddressInfo ? props.AddressInfo : ReviewItemCopyAddressButton;
|
|
2922
|
+
return /* @__PURE__ */ jsxs21("li", { className: "bg-brand-black-500 font-medium items-center w-full h-[calc(64rem/16)] flex gap-[1rem] p-[calc(12rem/16)]", children: [
|
|
2923
|
+
/* @__PURE__ */ jsx30(BadgeIcon, __spreadValues({}, props.badge)),
|
|
2924
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex-1 text-start flex flex-col", children: [
|
|
2925
|
+
/* @__PURE__ */ jsxs21("span", { className: "text-[1rem] leading-[1.25] text-brand-white-500", children: [
|
|
2926
|
+
props.asset.amount,
|
|
2927
|
+
" ",
|
|
2928
|
+
props.asset.symbol
|
|
2929
|
+
] }),
|
|
2930
|
+
/* @__PURE__ */ jsx30("span", { className: "text-[calc(12rem/16)] leading-[1rem]", children: props.asset.secondaryValue })
|
|
2931
|
+
] }),
|
|
2932
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex flex-col items-end gap-[2px] text-end shrink-0", children: [
|
|
2933
|
+
/* @__PURE__ */ jsx30(Btn, { address: props.address, tag: props.tag }),
|
|
2934
|
+
/* @__PURE__ */ jsx30("span", { className: "text-[calc(12rem/16)] leading-[1rem]", children: props.networkName })
|
|
2935
|
+
] })
|
|
2936
|
+
] });
|
|
2937
|
+
}
|
|
2938
|
+
var ReviewItemCopyAddressButton = React10.forwardRef((props, ref) => {
|
|
2939
|
+
const _a = props, { address, tag } = _a, PROPS = __objRest(_a, ["address", "tag"]);
|
|
2940
|
+
return /* @__PURE__ */ jsxs21(
|
|
2941
|
+
"button",
|
|
2942
|
+
__spreadProps(__spreadValues({}, PROPS), {
|
|
2943
|
+
ref,
|
|
2944
|
+
type: "button",
|
|
2945
|
+
className: cn(
|
|
2946
|
+
"rounded-full px-[6px] py-[3px] text-[calc(14rem/16)] inline-flex items-center gap-[calc(4rem/16)] bg-brand-black-300",
|
|
2947
|
+
props.className
|
|
2948
|
+
),
|
|
2949
|
+
children: [
|
|
2950
|
+
/* @__PURE__ */ jsxs21("span", { className: "sr-only", children: [
|
|
2951
|
+
"Copy ",
|
|
2952
|
+
tag,
|
|
2953
|
+
" address"
|
|
2954
|
+
] }),
|
|
2955
|
+
/* @__PURE__ */ jsx30("span", { className: "text-[calc(12rem/16)] not-sr-only leading-[1rem] text-brand-white-500", children: address }),
|
|
2956
|
+
/* @__PURE__ */ jsx30(Copy_default, { className: "size-4" })
|
|
2957
|
+
]
|
|
2958
|
+
})
|
|
2959
|
+
);
|
|
2960
|
+
});
|
|
2961
|
+
|
|
2962
|
+
// src/components/molecules/dialog.tsx
|
|
2963
|
+
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
2964
|
+
import React11 from "react";
|
|
2965
|
+
import { Fragment as Fragment7, jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2966
|
+
function DialogMorphContent(_a) {
|
|
2967
|
+
var _b = _a, {
|
|
2968
|
+
className,
|
|
2969
|
+
children,
|
|
2970
|
+
showCloseButton = true
|
|
2971
|
+
} = _b, props = __objRest(_b, [
|
|
2972
|
+
"className",
|
|
2973
|
+
"children",
|
|
2974
|
+
"showCloseButton"
|
|
2975
|
+
]);
|
|
2976
|
+
const [mode, setViewMode] = React11.useState("card");
|
|
2977
|
+
React11.useEffect(() => {
|
|
2978
|
+
const controller = new AbortController();
|
|
2979
|
+
const signal = controller.signal;
|
|
2980
|
+
const checkOrientation = () => {
|
|
2981
|
+
const mode2 = window.innerHeight > window.innerWidth ? "portrait" : "landscape";
|
|
2982
|
+
const viewMode = {
|
|
2983
|
+
portrait: "fullscreen",
|
|
2984
|
+
landscape: "card"
|
|
2985
|
+
};
|
|
2986
|
+
if (mode2 === "portrait" && window.innerWidth >= 600) {
|
|
2987
|
+
return setViewMode("card");
|
|
2988
|
+
}
|
|
2989
|
+
setViewMode(viewMode[mode2]);
|
|
2990
|
+
};
|
|
2991
|
+
checkOrientation();
|
|
2992
|
+
window.addEventListener("resize", checkOrientation, { signal });
|
|
2993
|
+
return () => {
|
|
2994
|
+
controller.abort();
|
|
2995
|
+
};
|
|
2996
|
+
}, []);
|
|
2997
|
+
const Content7 = /* @__PURE__ */ jsxs22(
|
|
2998
|
+
DialogPrimitive2.Content,
|
|
2999
|
+
__spreadProps(__spreadValues({
|
|
3000
|
+
"data-slot": "dialog-content",
|
|
3001
|
+
className: cn(
|
|
3002
|
+
"bg-brand-black-600 text-brand-black-100 data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 grid w-full gap-4 pt-4 p-6 duration-200",
|
|
3003
|
+
{
|
|
3004
|
+
"responsive-fullscren-dialog": mode === "fullscreen",
|
|
3005
|
+
"responsive-card-dialog": mode === "card"
|
|
3006
|
+
},
|
|
3007
|
+
className
|
|
3008
|
+
)
|
|
3009
|
+
}, props), {
|
|
3010
|
+
children: [
|
|
3011
|
+
children,
|
|
3012
|
+
showCloseButton && /* @__PURE__ */ jsxs22(
|
|
3013
|
+
DialogPrimitive2.Close,
|
|
3014
|
+
{
|
|
3015
|
+
"data-slot": "dialog-close",
|
|
3016
|
+
className: "ring-offset-background w-[calc(32rem/16)] inline-flex items-center justify-center rounded-full text-brand-black-100 aspect-square focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
3017
|
+
children: [
|
|
3018
|
+
/* @__PURE__ */ jsx31(XIcon_default, { width: "1rem", height: "1rem" }),
|
|
3019
|
+
/* @__PURE__ */ jsx31("span", { className: "sr-only", children: "Close" })
|
|
3020
|
+
]
|
|
3021
|
+
}
|
|
3022
|
+
)
|
|
3023
|
+
]
|
|
3024
|
+
})
|
|
3025
|
+
);
|
|
3026
|
+
return /* @__PURE__ */ jsxs22(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
3027
|
+
/* @__PURE__ */ jsx31(DialogOverlay, {}),
|
|
3028
|
+
mode === "card" ? /* @__PURE__ */ jsx31(SmoothCorners, { children: Content7 }) : /* @__PURE__ */ jsx31(Fragment7, { children: Content7 })
|
|
3029
|
+
] });
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
// src/components/molecules/manage-wallet.tsx
|
|
3033
|
+
import React12 from "react";
|
|
3034
|
+
import { motion as motion3 } from "motion/react";
|
|
3035
|
+
|
|
3036
|
+
// src/@/ui/sheet.tsx
|
|
3037
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3038
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3039
|
+
function Sheet(_a) {
|
|
3040
|
+
var props = __objRest(_a, []);
|
|
3041
|
+
return /* @__PURE__ */ jsx32(SheetPrimitive.Root, __spreadValues({ "data-slot": "sheet" }, props));
|
|
3042
|
+
}
|
|
3043
|
+
function SheetTrigger(_a) {
|
|
3044
|
+
var props = __objRest(_a, []);
|
|
3045
|
+
return /* @__PURE__ */ jsx32(SheetPrimitive.Trigger, __spreadValues({ "data-slot": "sheet-trigger" }, props));
|
|
3046
|
+
}
|
|
3047
|
+
function SheetPortal(_a) {
|
|
3048
|
+
var props = __objRest(_a, []);
|
|
3049
|
+
return /* @__PURE__ */ jsx32(SheetPrimitive.Portal, __spreadValues({ "data-slot": "sheet-portal" }, props));
|
|
3050
|
+
}
|
|
3051
|
+
function SheetOverlay(_a) {
|
|
3052
|
+
var _b = _a, {
|
|
3053
|
+
className
|
|
3054
|
+
} = _b, props = __objRest(_b, [
|
|
3055
|
+
"className"
|
|
3056
|
+
]);
|
|
3057
|
+
return /* @__PURE__ */ jsx32(
|
|
3058
|
+
SheetPrimitive.Overlay,
|
|
3059
|
+
__spreadValues({
|
|
3060
|
+
"data-slot": "sheet-overlay",
|
|
3061
|
+
className: cn(
|
|
3062
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
3063
|
+
className
|
|
3064
|
+
)
|
|
3065
|
+
}, props)
|
|
3066
|
+
);
|
|
3067
|
+
}
|
|
3068
|
+
function SheetContent(_a) {
|
|
3069
|
+
var _b = _a, {
|
|
3070
|
+
className,
|
|
3071
|
+
children,
|
|
3072
|
+
side = "right"
|
|
3073
|
+
} = _b, props = __objRest(_b, [
|
|
3074
|
+
"className",
|
|
3075
|
+
"children",
|
|
3076
|
+
"side"
|
|
3077
|
+
]);
|
|
3078
|
+
return /* @__PURE__ */ jsxs23(SheetPortal, { children: [
|
|
3079
|
+
/* @__PURE__ */ jsx32(SheetOverlay, {}),
|
|
3080
|
+
/* @__PURE__ */ jsxs23(
|
|
3081
|
+
SheetPrimitive.Content,
|
|
3082
|
+
__spreadProps(__spreadValues({
|
|
3083
|
+
"data-slot": "sheet-content",
|
|
3084
|
+
className: cn(
|
|
3085
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
3086
|
+
side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-sm",
|
|
3087
|
+
side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
3088
|
+
side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
3089
|
+
side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
3090
|
+
className
|
|
3091
|
+
)
|
|
3092
|
+
}, props), {
|
|
3093
|
+
children: [
|
|
3094
|
+
children,
|
|
3095
|
+
/* @__PURE__ */ jsx32(
|
|
3096
|
+
SheetPrimitive.Close,
|
|
3097
|
+
{
|
|
3098
|
+
asChild: true,
|
|
3099
|
+
className: "absolute top-[1.625rem] -left-10",
|
|
3100
|
+
children: /* @__PURE__ */ jsxs23(
|
|
3101
|
+
IconButton,
|
|
3102
|
+
{
|
|
3103
|
+
className: "cursor-pointer",
|
|
3104
|
+
variant: "secondary",
|
|
3105
|
+
rounded: "full",
|
|
3106
|
+
size: "sm",
|
|
3107
|
+
children: [
|
|
3108
|
+
/* @__PURE__ */ jsx32(ChevronDoubleRight_default, { className: "size-4 text-brand-black-100" }),
|
|
3109
|
+
/* @__PURE__ */ jsx32("span", { className: "sr-only", children: "Close" })
|
|
3110
|
+
]
|
|
3111
|
+
}
|
|
3112
|
+
)
|
|
3113
|
+
}
|
|
3114
|
+
)
|
|
3115
|
+
]
|
|
3116
|
+
})
|
|
3117
|
+
)
|
|
3118
|
+
] });
|
|
3119
|
+
}
|
|
3120
|
+
function SheetHeader(_a) {
|
|
3121
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3122
|
+
return /* @__PURE__ */ jsx32(
|
|
3123
|
+
"div",
|
|
3124
|
+
__spreadValues({
|
|
3125
|
+
"data-slot": "sheet-header",
|
|
3126
|
+
className: cn("flex flex-col gap-1.5 p-4", className)
|
|
3127
|
+
}, props)
|
|
3128
|
+
);
|
|
3129
|
+
}
|
|
3130
|
+
function SheetTitle(_a) {
|
|
3131
|
+
var _b = _a, {
|
|
3132
|
+
className
|
|
3133
|
+
} = _b, props = __objRest(_b, [
|
|
3134
|
+
"className"
|
|
3135
|
+
]);
|
|
3136
|
+
return /* @__PURE__ */ jsx32(
|
|
3137
|
+
SheetPrimitive.Title,
|
|
3138
|
+
__spreadValues({
|
|
3139
|
+
"data-slot": "sheet-title",
|
|
3140
|
+
className: cn("text-foreground font-semibold", className)
|
|
3141
|
+
}, props)
|
|
3142
|
+
);
|
|
3143
|
+
}
|
|
3144
|
+
function SheetDescription(_a) {
|
|
3145
|
+
var _b = _a, {
|
|
3146
|
+
className
|
|
3147
|
+
} = _b, props = __objRest(_b, [
|
|
3148
|
+
"className"
|
|
3149
|
+
]);
|
|
3150
|
+
return /* @__PURE__ */ jsx32(
|
|
3151
|
+
SheetPrimitive.Description,
|
|
3152
|
+
__spreadValues({
|
|
3153
|
+
"data-slot": "sheet-description",
|
|
3154
|
+
className: cn("text-muted-foreground text-sm", className)
|
|
3155
|
+
}, props)
|
|
3156
|
+
);
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
// src/components/organisms/manage-account.tsx
|
|
3160
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3161
|
+
function ManageAccounts() {
|
|
3162
|
+
return /* @__PURE__ */ jsxs24(SheetHeader, { className: "p-[1rem] -mx-[1rem]", children: [
|
|
3163
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-[0.625rem] select-none", children: [
|
|
3164
|
+
/* @__PURE__ */ jsx33(
|
|
3165
|
+
IconButton,
|
|
3166
|
+
{
|
|
3167
|
+
disabled: true,
|
|
3168
|
+
className: "pointer-events-none !text-brand-white-500",
|
|
3169
|
+
variant: "level_2",
|
|
3170
|
+
rounded: "full",
|
|
3171
|
+
size: "sm",
|
|
3172
|
+
children: /* @__PURE__ */ jsx33(Wallet_default, { className: "size-5" })
|
|
3173
|
+
}
|
|
3174
|
+
),
|
|
3175
|
+
/* @__PURE__ */ jsx33(SheetTitle, { className: "text-brand-white-100", children: /* @__PURE__ */ jsx33("span", { className: "text-base font-medium", children: "Connect Your Wallet" }) })
|
|
3176
|
+
] }),
|
|
3177
|
+
/* @__PURE__ */ jsx33(SheetDescription, { className: "sr-only", children: "Choose a wallet provider to connect to our application." })
|
|
3178
|
+
] });
|
|
3179
|
+
}
|
|
3180
|
+
function HeaderNested(props) {
|
|
3181
|
+
var _a;
|
|
3182
|
+
const { heading, image, onBack, hideBackButton } = props;
|
|
3183
|
+
return /* @__PURE__ */ jsxs24("div", { className: "p-[1rem] -mx-[1rem]", children: [
|
|
3184
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-[0.625rem] select-none", children: [
|
|
3185
|
+
/* @__PURE__ */ jsx33(
|
|
3186
|
+
TokenImage,
|
|
3187
|
+
{
|
|
3188
|
+
src: image.src,
|
|
3189
|
+
className: "w-[2rem]",
|
|
3190
|
+
alt: (_a = image.alt) != null ? _a : heading
|
|
3191
|
+
}
|
|
3192
|
+
),
|
|
3193
|
+
/* @__PURE__ */ jsx33(SheetTitle, { className: "text-brand-white-100 flex-1", children: /* @__PURE__ */ jsx33("span", { className: "text-base font-medium", children: heading }) }),
|
|
3194
|
+
!hideBackButton && /* @__PURE__ */ jsx33(
|
|
3195
|
+
IconButton,
|
|
3196
|
+
{
|
|
3197
|
+
variant: "level_1",
|
|
3198
|
+
rounded: "full",
|
|
3199
|
+
size: "sm",
|
|
3200
|
+
onClick: onBack,
|
|
3201
|
+
children: /* @__PURE__ */ jsx33(
|
|
3202
|
+
StepBack_default,
|
|
3203
|
+
{
|
|
3204
|
+
width: "1rem",
|
|
3205
|
+
height: "1rem",
|
|
3206
|
+
className: "text-brand-black-100"
|
|
3207
|
+
}
|
|
3208
|
+
)
|
|
3209
|
+
}
|
|
3210
|
+
)
|
|
3211
|
+
] }),
|
|
3212
|
+
/* @__PURE__ */ jsx33(SheetDescription, { className: "sr-only", children: "Choose a wallet provider to connect to our application." })
|
|
3213
|
+
] });
|
|
3214
|
+
}
|
|
3215
|
+
function ListSection({
|
|
3216
|
+
children,
|
|
3217
|
+
caption = "Heading"
|
|
3218
|
+
}) {
|
|
3219
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-y-[0.375rem]", children: [
|
|
3220
|
+
/* @__PURE__ */ jsx33("div", { className: "text-caption text-brand-black-100 select-none font-normal", children: caption }),
|
|
3221
|
+
/* @__PURE__ */ jsx33("div", { className: "grid gap-2", children })
|
|
3222
|
+
] });
|
|
3223
|
+
}
|
|
3224
|
+
function CWDrawerContent(_a) {
|
|
3225
|
+
var _b = _a, {
|
|
3226
|
+
children
|
|
3227
|
+
} = _b, props = __objRest(_b, [
|
|
3228
|
+
"children"
|
|
3229
|
+
]);
|
|
3230
|
+
return /* @__PURE__ */ jsx33(
|
|
3231
|
+
SheetContent,
|
|
3232
|
+
__spreadProps(__spreadValues({}, props), {
|
|
3233
|
+
side: "right",
|
|
3234
|
+
className: "max-w-[calc(29.75rem_+_1.25rem)] select-none border-none shadow-none text-brand-white-500 sm:w-[540px] bg-transparent p-[0.625rem]",
|
|
3235
|
+
children: /* @__PURE__ */ jsx33("div", { className: "bg-brand-black-550 flex-1 flex flex-col rounded-[1rem] w-[29.75rem] px-[1rem]", children })
|
|
3236
|
+
})
|
|
3237
|
+
);
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
// src/components/molecules/manage-wallet.tsx
|
|
3241
|
+
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
3242
|
+
import { isHex } from "viem";
|
|
3243
|
+
import { Fragment as Fragment8, jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3244
|
+
var slideDown = {
|
|
3245
|
+
show: {
|
|
3246
|
+
opacity: [0, 0.8, 1]
|
|
3247
|
+
},
|
|
3248
|
+
hide: {
|
|
3249
|
+
opacity: [1, 0.25, 0]
|
|
3250
|
+
}
|
|
3251
|
+
};
|
|
3252
|
+
function ConnectedHeader(props) {
|
|
3253
|
+
const { show: open, setShow } = useManager();
|
|
3254
|
+
const { accounts, onCopy, onDisconnect, onConnect, polkadotImage, evmImage } = props;
|
|
3255
|
+
const containerRef = React12.useRef(null);
|
|
3256
|
+
const parent = React12.useRef(null);
|
|
3257
|
+
const hasEVM = accounts.some((account) => isHex(account.address));
|
|
3258
|
+
const hasPolkadot = accounts.some((account) => !isHex(account.address));
|
|
3259
|
+
const shouldShowPolkadotOption = hasEVM && !hasPolkadot;
|
|
3260
|
+
const shouldShowEVMOption = hasPolkadot && !hasEVM;
|
|
3261
|
+
const shouldShowNetworkGroup = shouldShowPolkadotOption || shouldShowEVMOption;
|
|
3262
|
+
React12.useEffect(() => {
|
|
3263
|
+
const updateHeight = () => {
|
|
3264
|
+
if (containerRef.current && parent.current) {
|
|
3265
|
+
const height = containerRef.current.offsetHeight;
|
|
3266
|
+
parent.current.style.setProperty("--container-height", `${height}px`);
|
|
3267
|
+
}
|
|
3268
|
+
};
|
|
3269
|
+
updateHeight();
|
|
3270
|
+
const resizeObserver = new ResizeObserver(updateHeight);
|
|
3271
|
+
if (containerRef.current) {
|
|
3272
|
+
resizeObserver.observe(containerRef.current);
|
|
3273
|
+
}
|
|
3274
|
+
return () => {
|
|
3275
|
+
if (containerRef.current) {
|
|
3276
|
+
resizeObserver.unobserve(containerRef.current);
|
|
3277
|
+
}
|
|
3278
|
+
resizeObserver.disconnect();
|
|
3279
|
+
};
|
|
3280
|
+
}, []);
|
|
3281
|
+
return /* @__PURE__ */ jsx34(Fragment8, { children: /* @__PURE__ */ jsxs25(
|
|
3282
|
+
"div",
|
|
3283
|
+
{
|
|
3284
|
+
ref: parent,
|
|
3285
|
+
className: "bg-brand-black-550 z-50 relative rounded-t-[1rem] overflow-hidden -mx-[1rem]",
|
|
3286
|
+
style: { "--container-height": "auto" },
|
|
3287
|
+
children: [
|
|
3288
|
+
/* @__PURE__ */ jsx34(
|
|
3289
|
+
"button",
|
|
3290
|
+
{
|
|
3291
|
+
type: "button",
|
|
3292
|
+
className: cn(
|
|
3293
|
+
"p-[1rem] w-full cursor-pointer text-start appearance-none z-20 relative bg-gradient-to-b from-brand-black-550 to-transparent rounded-t-[1rem] border-b border-brand-black-350",
|
|
3294
|
+
{
|
|
3295
|
+
"hover:bg-brand-black-500 border-transparent": !open
|
|
3296
|
+
}
|
|
3297
|
+
),
|
|
3298
|
+
onClick: () => setShow((e) => !e),
|
|
3299
|
+
children: /* @__PURE__ */ jsxs25("div", { className: "flex w-full gap-2 justify-between items-center", children: [
|
|
3300
|
+
/* @__PURE__ */ jsx34(AccountStack, { items: accounts }),
|
|
3301
|
+
/* @__PURE__ */ jsx34(
|
|
3302
|
+
IconButton,
|
|
3303
|
+
{
|
|
3304
|
+
variant: "level_1",
|
|
3305
|
+
"data-open": open,
|
|
3306
|
+
className: "data-[open=false]:rotate-180 shrink-0 transform transition-all",
|
|
3307
|
+
rounded: "full",
|
|
3308
|
+
size: "sm",
|
|
3309
|
+
asChild: true,
|
|
3310
|
+
children: /* @__PURE__ */ jsx34("span", { children: /* @__PURE__ */ jsx34(ChevronBottomDown_default, {}) })
|
|
3311
|
+
}
|
|
3312
|
+
)
|
|
3313
|
+
] })
|
|
3314
|
+
}
|
|
3315
|
+
),
|
|
3316
|
+
/* @__PURE__ */ jsx34(
|
|
3317
|
+
motion3.div,
|
|
3318
|
+
{
|
|
3319
|
+
initial: { height: 0 },
|
|
3320
|
+
animate: { height: open ? "var(--container-height)" : 0 },
|
|
3321
|
+
className: cn("z-10 relative", {
|
|
3322
|
+
"pointer-events-none": !open
|
|
3323
|
+
}),
|
|
3324
|
+
children: /* @__PURE__ */ jsx34(
|
|
3325
|
+
motion3.div,
|
|
3326
|
+
{
|
|
3327
|
+
ref: containerRef,
|
|
3328
|
+
initial: { opacity: 0 },
|
|
3329
|
+
variants: slideDown,
|
|
3330
|
+
transition: { duration: 0.4 },
|
|
3331
|
+
animate: open ? "show" : "hide",
|
|
3332
|
+
className: "border-brand-black-350 px-[1rem] border-b pb-[1rem]",
|
|
3333
|
+
children: /* @__PURE__ */ jsxs25(ListSection, { caption: "Networks", children: [
|
|
3334
|
+
accounts.map((account, index) => /* @__PURE__ */ jsx34(
|
|
3335
|
+
WalletAccountItem,
|
|
3336
|
+
{
|
|
3337
|
+
address: shortenAccountAddress(account.address),
|
|
3338
|
+
network: account.network,
|
|
3339
|
+
wallet: account.wallet,
|
|
3340
|
+
onCopy: () => onCopy == null ? void 0 : onCopy(account.address),
|
|
3341
|
+
onDisconnect: () => onDisconnect == null ? void 0 : onDisconnect(account, index),
|
|
3342
|
+
isActive: true
|
|
3343
|
+
},
|
|
3344
|
+
`${account.address}-${index}`
|
|
3345
|
+
)),
|
|
3346
|
+
shouldShowNetworkGroup && /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
3347
|
+
shouldShowPolkadotOption && /* @__PURE__ */ jsx34(
|
|
3348
|
+
NetworkGroupItem,
|
|
3349
|
+
{
|
|
3350
|
+
image: polkadotImage || defaultPolkadotImage,
|
|
3351
|
+
description: "Use Polkadot-compatible wallets",
|
|
3352
|
+
onConnect: () => onConnect == null ? void 0 : onConnect("polkadot")
|
|
3353
|
+
}
|
|
3354
|
+
),
|
|
3355
|
+
shouldShowEVMOption && /* @__PURE__ */ jsx34(
|
|
3356
|
+
NetworkGroupItem,
|
|
3357
|
+
{
|
|
3358
|
+
image: evmImage || defaultEvmImage,
|
|
3359
|
+
description: "Use Ethereum-compatible wallets",
|
|
3360
|
+
onConnect: () => onConnect == null ? void 0 : onConnect("evm")
|
|
3361
|
+
}
|
|
3362
|
+
)
|
|
3363
|
+
] })
|
|
3364
|
+
] })
|
|
3365
|
+
}
|
|
3366
|
+
)
|
|
3367
|
+
}
|
|
3368
|
+
)
|
|
3369
|
+
]
|
|
3370
|
+
}
|
|
3371
|
+
) });
|
|
3372
|
+
}
|
|
3373
|
+
function AccountStack({ items = [] }) {
|
|
3374
|
+
var _a, _b, _c;
|
|
3375
|
+
return /* @__PURE__ */ jsxs25("div", { className: "flex gap-[0.625rem] items-center", children: [
|
|
3376
|
+
/* @__PURE__ */ jsx34("div", { className: "inline-flex -space-x-[0.3125rem]", children: items.map((item, index) => /* @__PURE__ */ jsx34(
|
|
3377
|
+
"div",
|
|
3378
|
+
{
|
|
3379
|
+
style: { zIndex: items.length - index, position: "relative" },
|
|
3380
|
+
children: /* @__PURE__ */ jsx34(
|
|
3381
|
+
BadgeIcon,
|
|
3382
|
+
{
|
|
3383
|
+
outline: true,
|
|
3384
|
+
src: item.wallet.image,
|
|
3385
|
+
alt: item.wallet.name,
|
|
3386
|
+
badgeSrc: item.network.image,
|
|
3387
|
+
badgeAlt: item.network.name
|
|
3388
|
+
}
|
|
3389
|
+
)
|
|
3390
|
+
},
|
|
3391
|
+
item.address
|
|
3392
|
+
)) }),
|
|
3393
|
+
/* @__PURE__ */ jsxs25("span", { className: "flex flex-col whitespace-nowrap", children: [
|
|
3394
|
+
/* @__PURE__ */ jsx34("span", { className: "text-base font-medium h-[1.25rem] text-brand-white-500", children: items.length > 1 ? /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
3395
|
+
items.length,
|
|
3396
|
+
" wallets"
|
|
3397
|
+
] }) : /* @__PURE__ */ jsx34(Fragment8, { children: (_c = shortenAccountAddress((_b = (_a = items[0]) == null ? void 0 : _a.address) != null ? _b : "")) != null ? _c : "--" }) }),
|
|
3398
|
+
/* @__PURE__ */ jsx34("span", { className: "text-xs text-start h-[1rem] font-medium inline-flex items-center gap-[0.125rem] text-brand-black-100", children: "Connected" })
|
|
3399
|
+
] })
|
|
3400
|
+
] });
|
|
3401
|
+
}
|
|
3402
|
+
function WalletManagerUIProvider(props) {
|
|
3403
|
+
const { expand: open = false, children } = props;
|
|
3404
|
+
const [show, setShow] = React12.useState(open);
|
|
3405
|
+
return /* @__PURE__ */ jsx34(WalletManagerContext.Provider, { value: { show, setShow }, children });
|
|
3406
|
+
}
|
|
3407
|
+
var WalletManagerContext = React12.createContext({
|
|
3408
|
+
show: false,
|
|
3409
|
+
// @ts-expect-error
|
|
3410
|
+
setShow: React12.Dispatch
|
|
3411
|
+
});
|
|
3412
|
+
function useManager() {
|
|
3413
|
+
return React12.useContext(WalletManagerContext);
|
|
3414
|
+
}
|
|
3415
|
+
function WalletManagerUIContent({
|
|
3416
|
+
children
|
|
3417
|
+
}) {
|
|
3418
|
+
const { show } = useManager();
|
|
3419
|
+
return /* @__PURE__ */ jsx34(
|
|
3420
|
+
Slot8,
|
|
3421
|
+
{
|
|
3422
|
+
className: cn("transition-all pt-[1rem] flex-1", {
|
|
3423
|
+
"opacity-15 pointer-events-none filter blur-[2px]": show
|
|
3424
|
+
}),
|
|
3425
|
+
children
|
|
3426
|
+
}
|
|
3427
|
+
);
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
// src/components/molecules/summary.tsx
|
|
3431
|
+
import { jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3432
|
+
function BridgeSummary(props) {
|
|
3433
|
+
return /* @__PURE__ */ jsx35("div", { className: "flex flex-col gap-2 text-brand-black-100", children: props.children });
|
|
3434
|
+
}
|
|
3435
|
+
function SummaryEntry(props) {
|
|
3436
|
+
const Icon = props.icon;
|
|
3437
|
+
return /* @__PURE__ */ jsxs26("div", { className: "flex select-none items-center text-[calc(12rem/16)] font-medium", children: [
|
|
3438
|
+
/* @__PURE__ */ jsxs26("dt", { className: "flex-1 gap-1 flex items-center", children: [
|
|
3439
|
+
/* @__PURE__ */ jsx35(Icon, { size: "1.16em" }),
|
|
3440
|
+
/* @__PURE__ */ jsx35("span", { className: "text-[1em] leading-[1rem]", children: props.name })
|
|
3441
|
+
] }),
|
|
3442
|
+
/* @__PURE__ */ jsx35("dd", { children: props.children })
|
|
3443
|
+
] });
|
|
3444
|
+
}
|
|
3445
|
+
function makeEntry({
|
|
3446
|
+
name,
|
|
3447
|
+
icon
|
|
3448
|
+
}) {
|
|
3449
|
+
return function Entry({ children }) {
|
|
3450
|
+
return /* @__PURE__ */ jsx35(SummaryEntry, { icon, name, children }, name);
|
|
3451
|
+
};
|
|
3452
|
+
}
|
|
3453
|
+
var Bridge = makeEntry({
|
|
3454
|
+
icon: ({ size }) => /* @__PURE__ */ jsx35(Percent_default, { width: size }),
|
|
3455
|
+
name: "Bridge fee"
|
|
3456
|
+
});
|
|
3457
|
+
var GasEntry = makeEntry({
|
|
3458
|
+
icon: ({ size }) => /* @__PURE__ */ jsx35(Gas_default, { width: size }),
|
|
3459
|
+
name: "Gas costs"
|
|
3460
|
+
});
|
|
3461
|
+
var SpillageTolerance = makeEntry({
|
|
3462
|
+
icon: ({ size }) => /* @__PURE__ */ jsx35(ArrowBottomTop_default, { width: size }),
|
|
3463
|
+
name: "Spillage tolerance"
|
|
3464
|
+
});
|
|
3465
|
+
var Route = makeEntry({
|
|
3466
|
+
icon: ({ size }) => /* @__PURE__ */ jsx35(ArrowSplit_default, { width: size }),
|
|
3467
|
+
name: "Route"
|
|
3468
|
+
});
|
|
3469
|
+
var ETA = makeEntry({
|
|
3470
|
+
icon: ({ size }) => /* @__PURE__ */ jsx35(Clock_default, { width: size }),
|
|
3471
|
+
name: "Estimated time"
|
|
3472
|
+
});
|
|
3473
|
+
var SummaryValues = {
|
|
3474
|
+
Key: {
|
|
3475
|
+
Bridge,
|
|
3476
|
+
GasEntry,
|
|
3477
|
+
SpillageTolerance,
|
|
3478
|
+
Route,
|
|
3479
|
+
ETA
|
|
3480
|
+
},
|
|
3481
|
+
Values: {
|
|
3482
|
+
Highlight: ({ children }) => {
|
|
3483
|
+
return /* @__PURE__ */ jsx35("span", { className: "text-[inherit] text-brand-white-500", children });
|
|
3484
|
+
},
|
|
3485
|
+
Soft: ({ children }) => {
|
|
3486
|
+
return /* @__PURE__ */ jsx35("span", { className: "text-[inherit]text-brand-black-50", children });
|
|
3487
|
+
}
|
|
3488
|
+
}
|
|
3489
|
+
};
|
|
3490
|
+
|
|
3491
|
+
// src/components/molecules/timeline.tsx
|
|
3492
|
+
import React13 from "react";
|
|
3493
|
+
import { Loader2 } from "lucide-react";
|
|
3494
|
+
import { AnimatePresence as AnimatePresence2, motion as motion4 } from "motion/react";
|
|
3495
|
+
|
|
3496
|
+
// src/@/ui/progress.tsx
|
|
3497
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3498
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3499
|
+
function Progress(_a) {
|
|
3500
|
+
var _b = _a, {
|
|
3501
|
+
className,
|
|
3502
|
+
value
|
|
3503
|
+
} = _b, props = __objRest(_b, [
|
|
3504
|
+
"className",
|
|
3505
|
+
"value"
|
|
3506
|
+
]);
|
|
3507
|
+
return /* @__PURE__ */ jsx36(
|
|
3508
|
+
ProgressPrimitive.Root,
|
|
3509
|
+
__spreadProps(__spreadValues({
|
|
3510
|
+
"data-slot": "progress",
|
|
3511
|
+
className: cn(
|
|
3512
|
+
"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
|
|
3513
|
+
className
|
|
3514
|
+
)
|
|
3515
|
+
}, props), {
|
|
3516
|
+
children: /* @__PURE__ */ jsx36(
|
|
3517
|
+
ProgressPrimitive.Indicator,
|
|
3518
|
+
{
|
|
3519
|
+
"data-slot": "progress-indicator",
|
|
3520
|
+
className: "bg-[var(--track-color)] h-full w-full flex-1 transition-all",
|
|
3521
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
3522
|
+
}
|
|
3523
|
+
)
|
|
3524
|
+
})
|
|
3525
|
+
);
|
|
3526
|
+
}
|
|
3527
|
+
|
|
3528
|
+
// src/components/molecules/timeline.tsx
|
|
3529
|
+
import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
3530
|
+
import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3531
|
+
function TimelineList(props) {
|
|
3532
|
+
return /* @__PURE__ */ jsx37("ul", { className: "flex flex-col", children: props.children });
|
|
3533
|
+
}
|
|
3534
|
+
var StatusTextMap = {
|
|
3535
|
+
processing: "Processing",
|
|
3536
|
+
upcoming: "Upcoming",
|
|
3537
|
+
error: "Failed"
|
|
3538
|
+
};
|
|
3539
|
+
function TimelineItem(props) {
|
|
3540
|
+
var _a, _b, _c, _d;
|
|
3541
|
+
const { processingStatus, caption } = props;
|
|
3542
|
+
const is_visually_active = processingStatus !== "upcoming";
|
|
3543
|
+
const id = React13.useId();
|
|
3544
|
+
const layoutId = `${id}/${caption}/content-2`;
|
|
3545
|
+
return /* @__PURE__ */ jsx37(
|
|
3546
|
+
motion4.li,
|
|
3547
|
+
{
|
|
3548
|
+
"data-process-status": processingStatus,
|
|
3549
|
+
className: "block bg-brand-black-350 cursor-default select-none font-medium text-brand-white-500",
|
|
3550
|
+
children: /* @__PURE__ */ jsxs27(
|
|
3551
|
+
motion4.div,
|
|
3552
|
+
{
|
|
3553
|
+
initial: { opacity: 0.5 },
|
|
3554
|
+
animate: {
|
|
3555
|
+
opacity: is_visually_active ? 1 : 0.5
|
|
3556
|
+
},
|
|
3557
|
+
className: "flex h-[3.5rem] items-center gap-[0.86rem] py-[0.5625rem] px-[0.75rem] ",
|
|
3558
|
+
children: [
|
|
3559
|
+
props.level === 0 ? /* @__PURE__ */ jsx37(BadgeIcon, __spreadValues({}, props.badge)) : /* @__PURE__ */ jsx37(
|
|
3560
|
+
IconButton,
|
|
3561
|
+
{
|
|
3562
|
+
variant: "level_2",
|
|
3563
|
+
size: "sm",
|
|
3564
|
+
rounded: "full",
|
|
3565
|
+
className: "pointer-events-none !bg-transparent backdrop-blur-[34px]",
|
|
3566
|
+
style: {
|
|
3567
|
+
boxShadow: "0 4px 24px 0 rgba(255, 255, 255, 0.05) inset"
|
|
3568
|
+
},
|
|
3569
|
+
children: /* @__PURE__ */ jsx37(
|
|
3570
|
+
"span",
|
|
3571
|
+
{
|
|
3572
|
+
className: cn(
|
|
3573
|
+
"w-[0.5rem] inline-block aspect-square rounded-lg bg-brand-white-500",
|
|
3574
|
+
{
|
|
3575
|
+
"bg-brand-success-400": processingStatus === "completed",
|
|
3576
|
+
"bg-brand-danger-500": processingStatus === "error"
|
|
3577
|
+
}
|
|
3578
|
+
)
|
|
3579
|
+
}
|
|
3580
|
+
)
|
|
3581
|
+
}
|
|
3582
|
+
),
|
|
3583
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex flex-col flex-1 gap-[calc(4/16rem)]", children: [
|
|
3584
|
+
/* @__PURE__ */ jsx37("div", { className: "text-brand-white-500 text-[1rem] h-[1.25rem]", children: caption }),
|
|
3585
|
+
/* @__PURE__ */ jsxs27("div", { className: "text-xs h-[1rem] text-brand-black-100", children: [
|
|
3586
|
+
processingStatus === "completed" ? /* @__PURE__ */ jsx37("span", { children: /* @__PURE__ */ jsxs27(
|
|
3587
|
+
"a",
|
|
3588
|
+
{
|
|
3589
|
+
href: (_a = props == null ? void 0 : props.data) == null ? void 0 : _a.transactionUrl,
|
|
3590
|
+
className: "flex cursor-pointer gap-[calc(2rem/16)] items-center",
|
|
3591
|
+
children: [
|
|
3592
|
+
/* @__PURE__ */ jsx37("span", { children: "View in explorer " }),
|
|
3593
|
+
/* @__PURE__ */ jsx37(ArrowUpRight_default, { width: "0.75rem", height: "0.75rem" })
|
|
3594
|
+
]
|
|
3595
|
+
}
|
|
3596
|
+
) }) : null,
|
|
3597
|
+
processingStatus === "completed" ? null : /* @__PURE__ */ jsx37("span", { children: /* @__PURE__ */ jsx37("span", { children: (_b = props == null ? void 0 : props.secondary) != null ? _b : StatusTextMap[processingStatus] }) })
|
|
3598
|
+
] })
|
|
3599
|
+
] }),
|
|
3600
|
+
/* @__PURE__ */ jsxs27(AnimatePresence2, { children: [
|
|
3601
|
+
processingStatus === "completed" ? /* @__PURE__ */ jsxs27(
|
|
3602
|
+
motion4.div,
|
|
3603
|
+
{
|
|
3604
|
+
layoutId,
|
|
3605
|
+
initial: { x: 10, opacity: 0 },
|
|
3606
|
+
animate: { x: 0, opacity: 1 },
|
|
3607
|
+
exit: { x: 10, opacity: 0 },
|
|
3608
|
+
className: "flex gap-[calc(8rem/16)] items-center",
|
|
3609
|
+
children: [
|
|
3610
|
+
/* @__PURE__ */ jsx37("span", { className: "text-[calc(13rem/16)] text-brand-black-100", children: (_c = props == null ? void 0 : props.data) == null ? void 0 : _c.completedIn }),
|
|
3611
|
+
/* @__PURE__ */ jsx37(
|
|
3612
|
+
Check_default,
|
|
3613
|
+
{
|
|
3614
|
+
height: "1rem",
|
|
3615
|
+
width: "1rem",
|
|
3616
|
+
className: "text-brand-success-400"
|
|
3617
|
+
}
|
|
3618
|
+
)
|
|
3619
|
+
]
|
|
3620
|
+
}
|
|
3621
|
+
) : null,
|
|
3622
|
+
processingStatus === "processing" ? /* @__PURE__ */ jsxs27(
|
|
3623
|
+
motion4.div,
|
|
3624
|
+
{
|
|
3625
|
+
initial: { x: 10, opacity: 0 },
|
|
3626
|
+
animate: { x: 0, opacity: 1 },
|
|
3627
|
+
exit: { x: 10, opacity: 0 },
|
|
3628
|
+
layoutId,
|
|
3629
|
+
className: "flex gap-[calc(10rem/16)] items-center",
|
|
3630
|
+
children: [
|
|
3631
|
+
/* @__PURE__ */ jsx37("span", { className: "text-[calc(13rem/16)]", children: (_d = props == null ? void 0 : props.data) == null ? void 0 : _d.eta }),
|
|
3632
|
+
/* @__PURE__ */ jsx37(
|
|
3633
|
+
Loader2,
|
|
3634
|
+
{
|
|
3635
|
+
size: "1rem",
|
|
3636
|
+
className: "animate text-brand-black-100 animate-spin"
|
|
3637
|
+
}
|
|
3638
|
+
)
|
|
3639
|
+
]
|
|
3640
|
+
}
|
|
3641
|
+
) : null
|
|
3642
|
+
] })
|
|
3643
|
+
]
|
|
3644
|
+
}
|
|
3645
|
+
)
|
|
3646
|
+
}
|
|
3647
|
+
);
|
|
3648
|
+
}
|
|
3649
|
+
function TimelineListGroup(props) {
|
|
3650
|
+
return /* @__PURE__ */ jsx37("ul", { className: cn("flex flex-col"), children: props.children });
|
|
3651
|
+
}
|
|
3652
|
+
var TimelineRoot = React13.forwardRef((props, ref) => {
|
|
3653
|
+
return /* @__PURE__ */ jsx37(
|
|
3654
|
+
"ul",
|
|
3655
|
+
__spreadProps(__spreadValues({
|
|
3656
|
+
ref
|
|
3657
|
+
}, props), {
|
|
3658
|
+
className: cn(
|
|
3659
|
+
"flex flex-col gap-y-[calc(2rem/16)] *:first:rounded-t-[1rem] *:last:rounded-b-[1rem]",
|
|
3660
|
+
props.className
|
|
3661
|
+
),
|
|
3662
|
+
children: props.children
|
|
3663
|
+
})
|
|
3664
|
+
);
|
|
3665
|
+
});
|
|
3666
|
+
TimelineRoot.displayName = "TimelineRoot";
|
|
3667
|
+
var trackColorMap = {
|
|
3668
|
+
warning: "var(--color-brand-warning-500)",
|
|
3669
|
+
default: "var(--color-brand-black-100)"
|
|
3670
|
+
};
|
|
3671
|
+
function TransactionTimer(props) {
|
|
3672
|
+
const { mins, hours, seconds, severity = "warning" } = props;
|
|
3673
|
+
return /* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-[calc(6rem/16)]", children: [
|
|
3674
|
+
/* @__PURE__ */ jsxs27(
|
|
3675
|
+
"div",
|
|
3676
|
+
{
|
|
3677
|
+
className: cn(
|
|
3678
|
+
"flex gap-[calc(4rem/16)] font-medium h-[1rem] text-xs items-center",
|
|
3679
|
+
{
|
|
3680
|
+
"text-[#7A775F]": severity === "warning",
|
|
3681
|
+
"text-brand-black-100": severity === "default"
|
|
3682
|
+
}
|
|
3683
|
+
),
|
|
3684
|
+
children: [
|
|
3685
|
+
/* @__PURE__ */ jsx37("span", { children: "Transaction will timeout in" }),
|
|
3686
|
+
/* @__PURE__ */ jsxs27("span", { className: "text-brand-white-500", children: [
|
|
3687
|
+
String(hours).padStart(2, "0"),
|
|
3688
|
+
":",
|
|
3689
|
+
String(mins).padStart(2, "0"),
|
|
3690
|
+
":",
|
|
3691
|
+
String(seconds).padStart(2, "0")
|
|
3692
|
+
] }),
|
|
3693
|
+
/* @__PURE__ */ jsx37("span", { children: /* @__PURE__ */ jsx37(CircleInfo_default, { width: "1em", height: "1em" }) })
|
|
3694
|
+
]
|
|
3695
|
+
}
|
|
3696
|
+
),
|
|
3697
|
+
/* @__PURE__ */ jsx37(
|
|
3698
|
+
Progress,
|
|
3699
|
+
{
|
|
3700
|
+
value: props.progress,
|
|
3701
|
+
className: "bg-white/[0.04] h-[calc(3rem/16)]",
|
|
3702
|
+
style: {
|
|
3703
|
+
"--track-color": trackColorMap[severity]
|
|
3704
|
+
}
|
|
3705
|
+
}
|
|
3706
|
+
)
|
|
3707
|
+
] });
|
|
3708
|
+
}
|
|
3709
|
+
function TimerWrap(props) {
|
|
3710
|
+
const show = props.reveal;
|
|
3711
|
+
return /* @__PURE__ */ jsxs27(
|
|
3712
|
+
motion4.div,
|
|
3713
|
+
{
|
|
3714
|
+
initial: { paddingTop: 0 },
|
|
3715
|
+
animate: !show ? { paddingBlockStart: 0 } : { paddingBlockStart: "var(--timer-top)" },
|
|
3716
|
+
style: {
|
|
3717
|
+
"--timer-top": "calc(calc(44 / 16) * 1rem)"
|
|
3718
|
+
},
|
|
3719
|
+
className: "flex flex-col items-stretch justify-start relative",
|
|
3720
|
+
children: [
|
|
3721
|
+
/* @__PURE__ */ jsx37(
|
|
3722
|
+
"div",
|
|
3723
|
+
{
|
|
3724
|
+
className: cn(
|
|
3725
|
+
"flex overflow-hidden transition-all select-none absolute top-0 inset-x-0 z-10 flex-col bg-[#30261c] border border-white/[0.05] !rounded-t-[1rem] pb-[calc(12rem/16)] items-center justify-center text-brand-white-500",
|
|
3726
|
+
!show ? "h-[calc(40rem/16)]" : "h-[calc(56rem/16)]"
|
|
3727
|
+
),
|
|
3728
|
+
children: props.Timer
|
|
3729
|
+
}
|
|
3730
|
+
),
|
|
3731
|
+
/* @__PURE__ */ jsx37(
|
|
3732
|
+
Slot9,
|
|
3733
|
+
{
|
|
3734
|
+
className: cn("min-h-[calc(56rem/11)] z-20 relative !rounded-[1rem]", {
|
|
3735
|
+
"!shadow-[0px_-1px_0_0_#55553E66]": show
|
|
3736
|
+
}),
|
|
3737
|
+
children: props.children
|
|
3738
|
+
}
|
|
3739
|
+
)
|
|
3740
|
+
]
|
|
3741
|
+
}
|
|
3742
|
+
);
|
|
3743
|
+
}
|
|
3744
|
+
|
|
3745
|
+
// src/components/molecules/toast.tsx
|
|
3746
|
+
import { Fragment as Fragment9, jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3747
|
+
var SeverityConfig = {
|
|
3748
|
+
error: {
|
|
3749
|
+
icon: Alert_default,
|
|
3750
|
+
color: "text-brand-danger-500"
|
|
3751
|
+
},
|
|
3752
|
+
warning: {
|
|
3753
|
+
icon: Alert_default,
|
|
3754
|
+
color: "text-brand-warning-500"
|
|
3755
|
+
},
|
|
3756
|
+
info: {
|
|
3757
|
+
icon: CircleInfo_default,
|
|
3758
|
+
color: "text-brand-black-100"
|
|
3759
|
+
},
|
|
3760
|
+
success: {
|
|
3761
|
+
icon: Check_default,
|
|
3762
|
+
color: "text-brand-success-400"
|
|
3763
|
+
}
|
|
3764
|
+
};
|
|
3765
|
+
function ToastBox(props) {
|
|
3766
|
+
const { actions, onDismiss } = props;
|
|
3767
|
+
const { icon: Icon, color } = SeverityConfig[props.severity];
|
|
3768
|
+
const handleDismiss = (event) => {
|
|
3769
|
+
event.stopPropagation();
|
|
3770
|
+
onDismiss == null ? void 0 : onDismiss(event);
|
|
3771
|
+
};
|
|
3772
|
+
return /* @__PURE__ */ jsx38(SmoothCorners, { size: "sm", children: /* @__PURE__ */ jsxs28("div", { className: "bg-brand-black-500 flex flex-col md:flex-row gap-[0.75rem] items-start py-[calc(10rem/16)] px-[calc(12rem/16)] text-muted-foreground", children: [
|
|
3773
|
+
/* @__PURE__ */ jsx38(
|
|
3774
|
+
"div",
|
|
3775
|
+
{
|
|
3776
|
+
className: cn("items-center justify-center shrink-0 grow-0", color),
|
|
3777
|
+
style: { fontSize: "calc(calc(24/16) * 1rem)" },
|
|
3778
|
+
children: /* @__PURE__ */ jsx38(Icon, { width: "1em", height: "1em" })
|
|
3779
|
+
}
|
|
3780
|
+
),
|
|
3781
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex flex-col flex-1", children: [
|
|
3782
|
+
/* @__PURE__ */ jsx38(Text, { variant: "body1", className: "text-foreground", children: props.heading }),
|
|
3783
|
+
/* @__PURE__ */ jsx38(
|
|
3784
|
+
Text,
|
|
3785
|
+
{
|
|
3786
|
+
variant: "caption2",
|
|
3787
|
+
className: "text-muted-foreground text-balance",
|
|
3788
|
+
children: props.children
|
|
3789
|
+
}
|
|
3790
|
+
)
|
|
3791
|
+
] }),
|
|
3792
|
+
/* @__PURE__ */ jsx38("div", { className: "flex gap-[calc(6rem/16)] items-center self-center w-full md:w-auto", children: actions ? /* @__PURE__ */ jsxs28(Fragment9, { children: [
|
|
3793
|
+
/* @__PURE__ */ jsx38("div", { className: "flex gap-[calc(6rem/16)] flex-1 items-center *:flex-1", children: actions }),
|
|
3794
|
+
/* @__PURE__ */ jsx38(
|
|
3795
|
+
IconButton,
|
|
3796
|
+
{
|
|
3797
|
+
className: "cursor-pointer",
|
|
3798
|
+
onClick: handleDismiss,
|
|
3799
|
+
size: "smx",
|
|
3800
|
+
variant: "level_2",
|
|
3801
|
+
rounded: "default",
|
|
3802
|
+
children: /* @__PURE__ */ jsx38(XIcon_default, { width: "1rem" })
|
|
3803
|
+
}
|
|
3804
|
+
)
|
|
3805
|
+
] }) : /* @__PURE__ */ jsx38(
|
|
3806
|
+
Button2,
|
|
3807
|
+
{
|
|
3808
|
+
size: "sm",
|
|
3809
|
+
variant: "level_2",
|
|
3810
|
+
className: "w-full cursor-pointer",
|
|
3811
|
+
onClick: handleDismiss,
|
|
3812
|
+
children: "Close"
|
|
3813
|
+
}
|
|
3814
|
+
) })
|
|
3815
|
+
] }) });
|
|
3816
|
+
}
|
|
3817
|
+
|
|
3818
|
+
// src/components/molecules/transaction-list.tsx
|
|
3819
|
+
import { motion as motion5 } from "motion/react";
|
|
3820
|
+
import { Fragment as Fragment10, jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3821
|
+
function TxListItemProcessing(props) {
|
|
3822
|
+
return /* @__PURE__ */ jsx39(GradientContainer, { children: /* @__PURE__ */ jsxs29("div", { className: "rounded-[1rem] bg-brand-black-350 px-[0.75rem] h-[3.75rem] flex items-center", children: [
|
|
3823
|
+
/* @__PURE__ */ jsx39(
|
|
3824
|
+
GradientLine,
|
|
3825
|
+
{
|
|
3826
|
+
behaviour: "progress",
|
|
3827
|
+
value: props.percentage,
|
|
3828
|
+
mode: props.status === "failed" ? "error" : "default"
|
|
3829
|
+
}
|
|
3830
|
+
),
|
|
3831
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex gap-[1rem] flex-1 z-20 text-brand-black-100 font-medium", children: [
|
|
3832
|
+
/* @__PURE__ */ jsx39(
|
|
3833
|
+
TokenTransferPair,
|
|
3834
|
+
{
|
|
3835
|
+
fromToken: props.from,
|
|
3836
|
+
toToken: props.to,
|
|
3837
|
+
size: "2rem"
|
|
3838
|
+
}
|
|
3839
|
+
),
|
|
3840
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-grow flex-col text-start", children: [
|
|
3841
|
+
/* @__PURE__ */ jsx39("span", { className: "text-brand-white-500 text-[0.875rem] h-[1.25rem]", children: props.caption }),
|
|
3842
|
+
/* @__PURE__ */ jsxs29(StatusBadge, { variant: props.status === "failed" ? "error" : "none", children: [
|
|
3843
|
+
"~ ",
|
|
3844
|
+
props.eta
|
|
3845
|
+
] })
|
|
3846
|
+
] }),
|
|
3847
|
+
/* @__PURE__ */ jsx39("div", { className: "basis-4/12 max-w-xs shrink-0 flex justify-end h-[2.25rem] whitespace-nowrap", children: /* @__PURE__ */ jsxs29(
|
|
3848
|
+
motion5.div,
|
|
3849
|
+
{
|
|
3850
|
+
initial: { y: 0 },
|
|
3851
|
+
animate: { y: props.status === "failed" ? "-100%" : 0 },
|
|
3852
|
+
className: "grid",
|
|
3853
|
+
children: [
|
|
3854
|
+
/* @__PURE__ */ jsxs29(
|
|
3855
|
+
motion5.div,
|
|
3856
|
+
{
|
|
3857
|
+
animate: { opacity: props.status === "processing" ? 1 : 0 },
|
|
3858
|
+
className: "flex flex-col text-end h-[2.25rem]",
|
|
3859
|
+
children: [
|
|
3860
|
+
/* @__PURE__ */ jsx39("span", { className: "text-base text-brand-white-500 h-[1.25rem]", children: props.amount }),
|
|
3861
|
+
/* @__PURE__ */ jsxs29("span", { className: "text-xs h-[1rem]", children: [
|
|
3862
|
+
props.percentage,
|
|
3863
|
+
"%"
|
|
3864
|
+
] })
|
|
3865
|
+
]
|
|
3866
|
+
}
|
|
3867
|
+
),
|
|
3868
|
+
/* @__PURE__ */ jsxs29(
|
|
3869
|
+
motion5.div,
|
|
3870
|
+
{
|
|
3871
|
+
animate: { opacity: props.status === "failed" ? 1 : 0 },
|
|
3872
|
+
className: "flex gap-[0.75rem] items-center h-[2.25rem] justify-end",
|
|
3873
|
+
children: [
|
|
3874
|
+
/* @__PURE__ */ jsx39("span", { className: "text-base text-brand-white-500 h-[1.25rem]", children: props.amount }),
|
|
3875
|
+
/* @__PURE__ */ jsx39(
|
|
3876
|
+
IconButton,
|
|
3877
|
+
{
|
|
3878
|
+
variant: "destructive",
|
|
3879
|
+
rounded: "default",
|
|
3880
|
+
size: "smx",
|
|
3881
|
+
children: /* @__PURE__ */ jsx39(RotateCcw_default, { className: "size-4 text-[currentColor]" })
|
|
3882
|
+
}
|
|
3883
|
+
)
|
|
3884
|
+
]
|
|
3885
|
+
}
|
|
3886
|
+
)
|
|
3887
|
+
]
|
|
3888
|
+
}
|
|
3889
|
+
) })
|
|
3890
|
+
] })
|
|
3891
|
+
] }) });
|
|
3892
|
+
}
|
|
3893
|
+
var TxListItem = function TxListItem2(props) {
|
|
3894
|
+
const _a = props, { caption, completedAt, from, to, amount } = _a, rest = __objRest(_a, ["caption", "completedAt", "from", "to", "amount"]);
|
|
3895
|
+
return /* @__PURE__ */ jsx39(
|
|
3896
|
+
"button",
|
|
3897
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
3898
|
+
type: "button",
|
|
3899
|
+
className: "apperance-none rounded-[1rem] bg-brand-black-350 px-[0.75rem] h-[3.75rem] flex items-center",
|
|
3900
|
+
children: /* @__PURE__ */ jsxs29("div", { className: "flex gap-[1rem] flex-1 z-20 text-brand-black-100 font-medium", children: [
|
|
3901
|
+
/* @__PURE__ */ jsx39(TokenTransferPair, { fromToken: from, toToken: to, size: "2rem" }),
|
|
3902
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-grow flex-col text-start", children: [
|
|
3903
|
+
/* @__PURE__ */ jsx39("span", { className: "text-brand-white-500 text-[0.875rem] h-[1.25rem]", children: caption }),
|
|
3904
|
+
/* @__PURE__ */ jsx39(StatusBadge, { variant: "success" })
|
|
3905
|
+
] }),
|
|
3906
|
+
/* @__PURE__ */ jsxs29("div", { className: "shrink-0 flex flex-col text-end", children: [
|
|
3907
|
+
/* @__PURE__ */ jsx39("span", { className: "text-base text-brand-white-500 h-[1.25rem]", children: amount }),
|
|
3908
|
+
/* @__PURE__ */ jsx39("span", { className: "text-xs h-[1rem]", children: completedAt })
|
|
3909
|
+
] })
|
|
3910
|
+
] })
|
|
3911
|
+
})
|
|
3912
|
+
);
|
|
3913
|
+
};
|
|
3914
|
+
function StatusBadge({
|
|
3915
|
+
variant,
|
|
3916
|
+
children
|
|
3917
|
+
}) {
|
|
3918
|
+
return /* @__PURE__ */ jsxs29("span", { className: "text-xs h-[1rem] flex items-center gap-[0.125rem]", children: [
|
|
3919
|
+
variant === "success" ? /* @__PURE__ */ jsxs29(Fragment10, { children: [
|
|
3920
|
+
/* @__PURE__ */ jsx39(Check_default, { width: "0.75rem", height: "0.75rem" }),
|
|
3921
|
+
" ",
|
|
3922
|
+
/* @__PURE__ */ jsx39("span", { children: "Success" })
|
|
3923
|
+
] }) : null,
|
|
3924
|
+
variant === "error" ? /* @__PURE__ */ jsxs29(Fragment10, { children: [
|
|
3925
|
+
/* @__PURE__ */ jsx39(
|
|
3926
|
+
Alert_default,
|
|
3927
|
+
{
|
|
3928
|
+
width: "0.75rem",
|
|
3929
|
+
height: "0.75rem",
|
|
3930
|
+
className: "text-brand-danger-500"
|
|
3931
|
+
}
|
|
3932
|
+
),
|
|
3933
|
+
/* @__PURE__ */ jsx39("span", { className: "text-brand-danger-500", children: "Order expired" })
|
|
3934
|
+
] }) : null,
|
|
3935
|
+
variant === "none" ? children : null
|
|
3936
|
+
] });
|
|
3937
|
+
}
|
|
3938
|
+
function TxList({ children }) {
|
|
3939
|
+
return /* @__PURE__ */ jsx39("ul", { className: "flex flex-col gap-[0.5rem]", children });
|
|
3940
|
+
}
|
|
3941
|
+
|
|
3942
|
+
// src/components/molecules/wallet-header.tsx
|
|
3943
|
+
import * as React14 from "react";
|
|
3944
|
+
import { motion as motion6 } from "motion/react";
|
|
3945
|
+
import { cva as cva6 } from "class-variance-authority";
|
|
3946
|
+
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
3947
|
+
|
|
3948
|
+
// src/components/organisms/assets-collection.tsx
|
|
3949
|
+
import * as Tab_ from "@radix-ui/react-tabs";
|
|
3950
|
+
|
|
3951
|
+
// src/@/ui/tabs.tsx
|
|
3952
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3953
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3954
|
+
function Tabs(_a) {
|
|
3955
|
+
var _b = _a, {
|
|
3956
|
+
className
|
|
3957
|
+
} = _b, props = __objRest(_b, [
|
|
3958
|
+
"className"
|
|
3959
|
+
]);
|
|
3960
|
+
return /* @__PURE__ */ jsx40(
|
|
3961
|
+
TabsPrimitive.Root,
|
|
3962
|
+
__spreadValues({
|
|
3963
|
+
"data-slot": "tabs",
|
|
3964
|
+
className: cn("flex flex-col gap-2", className)
|
|
3965
|
+
}, props)
|
|
3966
|
+
);
|
|
3967
|
+
}
|
|
3968
|
+
function TabsContent(_a) {
|
|
3969
|
+
var _b = _a, {
|
|
3970
|
+
className
|
|
3971
|
+
} = _b, props = __objRest(_b, [
|
|
3972
|
+
"className"
|
|
3973
|
+
]);
|
|
3974
|
+
return /* @__PURE__ */ jsx40(
|
|
3975
|
+
TabsPrimitive.Content,
|
|
3976
|
+
__spreadValues({
|
|
3977
|
+
"data-slot": "tabs-content",
|
|
3978
|
+
className: cn("flex-1 outline-none", className)
|
|
3979
|
+
}, props)
|
|
3980
|
+
);
|
|
3981
|
+
}
|
|
3982
|
+
|
|
3983
|
+
// src/components/organisms/assets-collection.tsx
|
|
3984
|
+
import { jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3985
|
+
function TabsList2(props) {
|
|
3986
|
+
return /* @__PURE__ */ jsx41("nav", { className: "flex flex-col", children: /* @__PURE__ */ jsx41(Tab_.TabsList, { asChild: true, children: /* @__PURE__ */ jsx41("ul", { className: "flex p-0 bg-transparent gap-[0.5rem]", children: props.children }) }) });
|
|
3987
|
+
}
|
|
3988
|
+
function TabItem(props) {
|
|
3989
|
+
return /* @__PURE__ */ jsx41(
|
|
3990
|
+
Tab_.TabsTrigger,
|
|
3991
|
+
{
|
|
3992
|
+
value: props.value,
|
|
3993
|
+
className: "apperance-none !text-brand-white-500 cursor-pointer text-[0.875rem] font-medium data-[state=inactive]:!text-brand-black-100 data-[state=active]:!text-brand-white-500 !p-[0rem] whitespace-nowrap",
|
|
3994
|
+
children: props.children
|
|
3995
|
+
}
|
|
3996
|
+
);
|
|
3997
|
+
}
|
|
3998
|
+
function AssetValueTrend(props) {
|
|
3999
|
+
const { percentage = 0, direction: dir, dollarValue = 0 } = props;
|
|
4000
|
+
const isZero = dollarValue === 0;
|
|
4001
|
+
const isUp = isZero ? "up" : dir === "up";
|
|
4002
|
+
return /* @__PURE__ */ jsxs30(
|
|
4003
|
+
"div",
|
|
4004
|
+
{
|
|
4005
|
+
className: "inline-flex select-none gap-[0.125rem] text-brand-black-100 h-[1rem] text-[0.7rem] font-medium items-center",
|
|
4006
|
+
style: {
|
|
4007
|
+
"--trend-base": isZero ? "inherit" : "var(--color-brand-white-500)",
|
|
4008
|
+
"--trend-color": isZero ? "inherit" : !isUp ? "var(--color-brand-danger-500, indigo)" : "var(--color-brand-success-400, cyan)"
|
|
4009
|
+
},
|
|
4010
|
+
children: [
|
|
4011
|
+
/* @__PURE__ */ jsx41("span", { className: "text-[var(--trend-color)]", children: /* @__PURE__ */ jsx41(
|
|
4012
|
+
ArrowTriangleBottom_default,
|
|
4013
|
+
{
|
|
4014
|
+
width: "0.75rem",
|
|
4015
|
+
height: "0.75rem",
|
|
4016
|
+
className: cn(
|
|
4017
|
+
"transform transition-all",
|
|
4018
|
+
isUp ? "rotate-180" : "rotate-0"
|
|
4019
|
+
)
|
|
4020
|
+
}
|
|
4021
|
+
) }),
|
|
4022
|
+
/* @__PURE__ */ jsxs30("span", { className: "flex items-center", children: [
|
|
4023
|
+
/* @__PURE__ */ jsxs30("span", { className: "text-[var(--trend-color)]", children: [
|
|
4024
|
+
"$",
|
|
4025
|
+
dollarValue
|
|
4026
|
+
] }),
|
|
4027
|
+
"\xA0",
|
|
4028
|
+
/* @__PURE__ */ jsxs30("span", { className: "text-[var(--trend-base)]", children: [
|
|
4029
|
+
"(",
|
|
4030
|
+
percentage,
|
|
4031
|
+
"%)"
|
|
4032
|
+
] })
|
|
4033
|
+
] })
|
|
4034
|
+
]
|
|
4035
|
+
}
|
|
4036
|
+
);
|
|
4037
|
+
}
|
|
4038
|
+
var currencyFormat = new Intl.NumberFormat("en-US", {
|
|
4039
|
+
currency: "USD"
|
|
4040
|
+
});
|
|
4041
|
+
function Balance(props) {
|
|
4042
|
+
const { prefix = "$", suffix = "", formatter = currencyFormat } = props;
|
|
4043
|
+
const [int_, decimal] = String(props.amount).split(".");
|
|
4044
|
+
const int = Number.isNaN(+int_) ? 0 : int_;
|
|
4045
|
+
const is_zero = props.amount === 0;
|
|
4046
|
+
return /* @__PURE__ */ jsx41("div", { className: "select-none", children: /* @__PURE__ */ jsxs30("span", { className: "text-[2.375rem] font-medium leading-[2.875rem] whitespace-nowrap", children: [
|
|
4047
|
+
/* @__PURE__ */ jsxs30(
|
|
4048
|
+
"span",
|
|
4049
|
+
{
|
|
4050
|
+
className: cn(
|
|
4051
|
+
is_zero ? "text-brand-black-100" : "text-brand-white-500"
|
|
4052
|
+
),
|
|
4053
|
+
children: [
|
|
4054
|
+
prefix,
|
|
4055
|
+
formatter.format(+int)
|
|
4056
|
+
]
|
|
4057
|
+
}
|
|
4058
|
+
),
|
|
4059
|
+
/* @__PURE__ */ jsxs30("span", { className: "text-brand-black-100", children: [
|
|
4060
|
+
".",
|
|
4061
|
+
decimal != null ? decimal : "00"
|
|
4062
|
+
] }),
|
|
4063
|
+
/* @__PURE__ */ jsxs30("span", { className: "text-brand-white-500", children: [
|
|
4064
|
+
"\xA0",
|
|
4065
|
+
suffix
|
|
4066
|
+
] })
|
|
4067
|
+
] }) });
|
|
4068
|
+
}
|
|
4069
|
+
|
|
4070
|
+
// src/components/molecules/wallet-header.tsx
|
|
4071
|
+
import { Fragment as Fragment12, jsx as jsx42, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4072
|
+
var WalletHeaderContext = React14.createContext(null);
|
|
4073
|
+
function useWalletHeader() {
|
|
4074
|
+
const context = React14.useContext(WalletHeaderContext);
|
|
4075
|
+
if (!context) {
|
|
4076
|
+
throw new Error("useWalletHeader must be used within a WalletHeader");
|
|
4077
|
+
}
|
|
4078
|
+
return context;
|
|
4079
|
+
}
|
|
4080
|
+
var walletHeaderVariants = cva6(
|
|
4081
|
+
"bg-brand-black-550 z-50 relative rounded-t-[1rem] overflow-hidden",
|
|
4082
|
+
{
|
|
4083
|
+
variants: {
|
|
4084
|
+
variant: {
|
|
4085
|
+
default: "-mx-[1rem]",
|
|
4086
|
+
contained: "mx-0"
|
|
4087
|
+
}
|
|
4088
|
+
},
|
|
4089
|
+
defaultVariants: {
|
|
4090
|
+
variant: "default"
|
|
4091
|
+
}
|
|
4092
|
+
}
|
|
4093
|
+
);
|
|
4094
|
+
var globalWalletHeaderState = null;
|
|
4095
|
+
var WalletHeader = React14.forwardRef(
|
|
4096
|
+
(_a, ref) => {
|
|
4097
|
+
var _b = _a, {
|
|
4098
|
+
className,
|
|
4099
|
+
variant,
|
|
4100
|
+
asChild = false,
|
|
4101
|
+
defaultOpen = false,
|
|
4102
|
+
children
|
|
4103
|
+
} = _b, props = __objRest(_b, [
|
|
4104
|
+
"className",
|
|
4105
|
+
"variant",
|
|
4106
|
+
"asChild",
|
|
4107
|
+
"defaultOpen",
|
|
4108
|
+
"children"
|
|
4109
|
+
]);
|
|
4110
|
+
const Comp = asChild ? Slot10 : "div";
|
|
4111
|
+
const [show, setShow] = React14.useState(() => {
|
|
4112
|
+
return globalWalletHeaderState !== null ? globalWalletHeaderState : defaultOpen;
|
|
4113
|
+
});
|
|
4114
|
+
React14.useEffect(() => {
|
|
4115
|
+
globalWalletHeaderState = show;
|
|
4116
|
+
}, [show]);
|
|
4117
|
+
return /* @__PURE__ */ jsx42(WalletHeaderContext.Provider, { value: { show, setShow }, children: /* @__PURE__ */ jsx42(
|
|
4118
|
+
Comp,
|
|
4119
|
+
__spreadProps(__spreadValues({
|
|
4120
|
+
ref,
|
|
4121
|
+
className: cn(walletHeaderVariants({ variant }), className),
|
|
4122
|
+
style: { "--container-height": "auto" }
|
|
4123
|
+
}, props), {
|
|
4124
|
+
children
|
|
4125
|
+
})
|
|
4126
|
+
) });
|
|
4127
|
+
}
|
|
4128
|
+
);
|
|
4129
|
+
WalletHeader.displayName = "WalletHeader";
|
|
4130
|
+
var WalletConnectedHeader = React14.forwardRef((_a, ref) => {
|
|
4131
|
+
var _b = _a, { className, accounts, children } = _b, props = __objRest(_b, ["className", "accounts", "children"]);
|
|
4132
|
+
const { show: open, setShow } = useWalletHeader();
|
|
4133
|
+
return /* @__PURE__ */ jsx42(
|
|
4134
|
+
"button",
|
|
4135
|
+
__spreadProps(__spreadValues({
|
|
4136
|
+
ref,
|
|
4137
|
+
type: "button",
|
|
4138
|
+
className: cn(
|
|
4139
|
+
"p-[1rem] w-full cursor-pointer text-start appearance-none z-20 relative bg-gradient-to-b from-brand-black-550 to-transparent rounded-t-[1rem] border-b border-brand-black-350",
|
|
4140
|
+
{
|
|
4141
|
+
"hover:bg-brand-black-500 border-transparent": !open
|
|
4142
|
+
},
|
|
4143
|
+
className
|
|
4144
|
+
),
|
|
4145
|
+
onClick: () => setShow((e) => !e)
|
|
4146
|
+
}, props), {
|
|
4147
|
+
children: /* @__PURE__ */ jsxs31("div", { className: "flex w-full gap-2 justify-between items-center", children: [
|
|
4148
|
+
children || /* @__PURE__ */ jsx42(AccountStack2, { accounts }),
|
|
4149
|
+
/* @__PURE__ */ jsx42(
|
|
4150
|
+
IconButton,
|
|
4151
|
+
{
|
|
4152
|
+
variant: "level_1",
|
|
4153
|
+
"data-open": open,
|
|
4154
|
+
className: "data-[open=false]:rotate-180 shrink-0 transform transition-all",
|
|
4155
|
+
rounded: "full",
|
|
4156
|
+
size: "sm",
|
|
4157
|
+
asChild: true,
|
|
4158
|
+
children: /* @__PURE__ */ jsx42("span", { children: /* @__PURE__ */ jsx42(ChevronBottomDown_default, {}) })
|
|
4159
|
+
}
|
|
4160
|
+
)
|
|
4161
|
+
] })
|
|
4162
|
+
})
|
|
4163
|
+
);
|
|
4164
|
+
});
|
|
4165
|
+
WalletConnectedHeader.displayName = "WalletConnectedHeader";
|
|
4166
|
+
var WalletHeaderContent = React14.forwardRef((_a, _ref) => {
|
|
4167
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
4168
|
+
const { show: open } = useWalletHeader();
|
|
4169
|
+
const containerRef = React14.useRef(null);
|
|
4170
|
+
const parentRef = React14.useRef(null);
|
|
4171
|
+
const slideDown2 = {
|
|
4172
|
+
show: { opacity: [0, 0.8, 1] },
|
|
4173
|
+
hide: { opacity: [1, 0.25, 0] }
|
|
4174
|
+
};
|
|
4175
|
+
React14.useEffect(() => {
|
|
4176
|
+
const updateHeight = () => {
|
|
4177
|
+
if (containerRef.current && parentRef.current) {
|
|
4178
|
+
const height = containerRef.current.offsetHeight;
|
|
4179
|
+
parentRef.current.style.setProperty(
|
|
4180
|
+
"--container-height",
|
|
4181
|
+
`${height}px`
|
|
4182
|
+
);
|
|
4183
|
+
}
|
|
4184
|
+
};
|
|
4185
|
+
updateHeight();
|
|
4186
|
+
const resizeObserver = new ResizeObserver(updateHeight);
|
|
4187
|
+
if (containerRef.current) {
|
|
4188
|
+
resizeObserver.observe(containerRef.current);
|
|
4189
|
+
}
|
|
4190
|
+
return () => {
|
|
4191
|
+
resizeObserver.disconnect();
|
|
4192
|
+
};
|
|
4193
|
+
}, []);
|
|
4194
|
+
const _a2 = props, {
|
|
4195
|
+
onDrag: onDrag,
|
|
4196
|
+
onDragEnd,
|
|
4197
|
+
onDragStart,
|
|
4198
|
+
onDragEnter,
|
|
4199
|
+
onDragExit,
|
|
4200
|
+
onDragLeave,
|
|
4201
|
+
onDragOver,
|
|
4202
|
+
onDrop,
|
|
4203
|
+
onAnimationStart: onAnimationStart,
|
|
4204
|
+
onAnimationEnd,
|
|
4205
|
+
onAnimationIteration,
|
|
4206
|
+
onTransitionEnd: onTransitionEnd,
|
|
4207
|
+
onTransitionStart,
|
|
4208
|
+
onTransitionRun,
|
|
4209
|
+
onTransitionCancel
|
|
4210
|
+
} = _a2, restProps = __objRest(_a2, [
|
|
4211
|
+
// Drag events
|
|
4212
|
+
"onDrag",
|
|
4213
|
+
"onDragEnd",
|
|
4214
|
+
"onDragStart",
|
|
4215
|
+
"onDragEnter",
|
|
4216
|
+
"onDragExit",
|
|
4217
|
+
"onDragLeave",
|
|
4218
|
+
"onDragOver",
|
|
4219
|
+
"onDrop",
|
|
4220
|
+
// Animation events
|
|
4221
|
+
"onAnimationStart",
|
|
4222
|
+
"onAnimationEnd",
|
|
4223
|
+
"onAnimationIteration",
|
|
4224
|
+
// Transition events
|
|
4225
|
+
"onTransitionEnd",
|
|
4226
|
+
"onTransitionStart",
|
|
4227
|
+
"onTransitionRun",
|
|
4228
|
+
"onTransitionCancel"
|
|
4229
|
+
]);
|
|
4230
|
+
return /* @__PURE__ */ jsx42(
|
|
4231
|
+
motion6.div,
|
|
4232
|
+
{
|
|
4233
|
+
ref: parentRef,
|
|
4234
|
+
initial: { height: 0 },
|
|
4235
|
+
animate: { height: open ? "var(--container-height)" : 0 },
|
|
4236
|
+
className: cn("z-10 relative", {
|
|
4237
|
+
"pointer-events-none": !open
|
|
4238
|
+
}),
|
|
4239
|
+
children: /* @__PURE__ */ jsx42(
|
|
4240
|
+
motion6.div,
|
|
4241
|
+
__spreadProps(__spreadValues({
|
|
4242
|
+
ref: containerRef,
|
|
4243
|
+
initial: { opacity: 0 },
|
|
4244
|
+
variants: slideDown2,
|
|
4245
|
+
transition: { duration: 0.4 },
|
|
4246
|
+
animate: open ? "show" : "hide",
|
|
4247
|
+
className: cn(
|
|
4248
|
+
"border-brand-black-350 px-[1rem] border-b pb-[1rem]",
|
|
4249
|
+
className
|
|
4250
|
+
)
|
|
4251
|
+
}, restProps), {
|
|
4252
|
+
children
|
|
4253
|
+
})
|
|
4254
|
+
)
|
|
4255
|
+
}
|
|
4256
|
+
);
|
|
4257
|
+
});
|
|
4258
|
+
WalletHeaderContent.displayName = "WalletHeaderContent";
|
|
4259
|
+
var AccountStack2 = React14.forwardRef(
|
|
4260
|
+
({ accounts = [] }, ref) => {
|
|
4261
|
+
var _a, _b;
|
|
4262
|
+
return /* @__PURE__ */ jsx42("div", { ref, className: "flex gap-[0.625rem] items-center", children: accounts.length > 0 ? /* @__PURE__ */ jsxs31(React14.Fragment, { children: [
|
|
4263
|
+
/* @__PURE__ */ jsx42("div", { className: "inline-flex -space-x-[0.3125rem]", children: accounts.map((account, index) => /* @__PURE__ */ jsx42(
|
|
4264
|
+
"div",
|
|
4265
|
+
{
|
|
4266
|
+
style: {
|
|
4267
|
+
zIndex: accounts.length - index,
|
|
4268
|
+
position: "relative"
|
|
4269
|
+
},
|
|
4270
|
+
children: /* @__PURE__ */ jsx42(
|
|
4271
|
+
BadgeIcon,
|
|
4272
|
+
{
|
|
4273
|
+
outline: true,
|
|
4274
|
+
src: account.wallet.image,
|
|
4275
|
+
alt: account.wallet.name,
|
|
4276
|
+
badgeSrc: account.network.image,
|
|
4277
|
+
badgeAlt: account.network.name
|
|
4278
|
+
}
|
|
4279
|
+
)
|
|
4280
|
+
},
|
|
4281
|
+
account.address
|
|
4282
|
+
)) }),
|
|
4283
|
+
/* @__PURE__ */ jsxs31("span", { className: "flex flex-col whitespace-nowrap", children: [
|
|
4284
|
+
/* @__PURE__ */ jsx42("span", { className: "text-base font-medium h-[1.25rem] text-brand-white-500", children: accounts.length > 1 ? /* @__PURE__ */ jsxs31(Fragment12, { children: [
|
|
4285
|
+
accounts.length,
|
|
4286
|
+
" wallets"
|
|
4287
|
+
] }) : /* @__PURE__ */ jsx42(Fragment12, { children: shortenAccountAddress((_b = (_a = accounts[0]) == null ? void 0 : _a.address) != null ? _b : "") || "--" }) }),
|
|
4288
|
+
/* @__PURE__ */ jsx42("span", { className: "text-xs text-start h-[1rem] font-medium inline-flex items-center gap-[0.125rem] text-brand-black-100", children: "Connected" })
|
|
4289
|
+
] })
|
|
4290
|
+
] }) : /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-[0.625rem] select-none", children: [
|
|
4291
|
+
/* @__PURE__ */ jsx42(
|
|
4292
|
+
IconButton,
|
|
4293
|
+
{
|
|
4294
|
+
disabled: true,
|
|
4295
|
+
className: "pointer-events-none !text-brand-white-500",
|
|
4296
|
+
variant: "level_2",
|
|
4297
|
+
rounded: "full",
|
|
4298
|
+
size: "sm",
|
|
4299
|
+
children: /* @__PURE__ */ jsx42(Wallet_default, { className: "size-5" })
|
|
4300
|
+
}
|
|
4301
|
+
),
|
|
4302
|
+
/* @__PURE__ */ jsx42("p", { className: "text-base font-medium text-brand-white-100", children: "Connect Your Wallet" })
|
|
4303
|
+
] }) });
|
|
4304
|
+
}
|
|
4305
|
+
);
|
|
4306
|
+
AccountStack2.displayName = "AccountStack";
|
|
4307
|
+
var WalletHeaderTabs = React14.forwardRef((_a, ref) => {
|
|
4308
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
4309
|
+
return /* @__PURE__ */ jsx42(Tabs, __spreadProps(__spreadValues({ ref, className: cn("gap-0 pt-3", className) }, props), { children }));
|
|
4310
|
+
});
|
|
4311
|
+
WalletHeaderTabs.displayName = "WalletHeaderTabs";
|
|
4312
|
+
var WalletHeaderTabsList = React14.forwardRef((_a, ref) => {
|
|
4313
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
4314
|
+
return /* @__PURE__ */ jsx42(
|
|
4315
|
+
TabsList2,
|
|
4316
|
+
__spreadProps(__spreadValues({
|
|
4317
|
+
ref,
|
|
4318
|
+
className: cn("flex p-0 bg-transparent gap-[0.5rem] h-auto", className)
|
|
4319
|
+
}, props), {
|
|
4320
|
+
children
|
|
4321
|
+
})
|
|
4322
|
+
);
|
|
4323
|
+
});
|
|
4324
|
+
WalletHeaderTabsList.displayName = "WalletHeaderTabsList";
|
|
4325
|
+
var WalletHeaderTabItem = React14.forwardRef((_a, ref) => {
|
|
4326
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
4327
|
+
return /* @__PURE__ */ jsx42(
|
|
4328
|
+
TabItem,
|
|
4329
|
+
__spreadProps(__spreadValues({
|
|
4330
|
+
ref,
|
|
4331
|
+
className: cn(
|
|
4332
|
+
"appearance-none !text-brand-white-500 cursor-pointer text-[0.875rem] font-medium data-[state=inactive]:!text-brand-black-100 data-[state=active]:!text-brand-white-500 !p-[0rem] whitespace-nowrap h-auto bg-transparent border-0 shadow-none",
|
|
4333
|
+
className
|
|
4334
|
+
)
|
|
4335
|
+
}, props), {
|
|
4336
|
+
children
|
|
4337
|
+
})
|
|
4338
|
+
);
|
|
4339
|
+
});
|
|
4340
|
+
WalletHeaderTabItem.displayName = "WalletHeaderTabItem";
|
|
4341
|
+
var WalletHeaderTabsContent = React14.forwardRef((_a, ref) => {
|
|
4342
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
4343
|
+
return /* @__PURE__ */ jsx42(
|
|
4344
|
+
TabsContent,
|
|
4345
|
+
__spreadProps(__spreadValues({
|
|
4346
|
+
ref,
|
|
4347
|
+
className: cn("gap-[1.5rem] flex flex-col mt-[6px]", className)
|
|
4348
|
+
}, props), {
|
|
4349
|
+
children
|
|
4350
|
+
})
|
|
4351
|
+
);
|
|
4352
|
+
});
|
|
4353
|
+
WalletHeaderTabsContent.displayName = "WalletHeaderTabsContent";
|
|
4354
|
+
var WalletHeaderContentBlur = React14.forwardRef((_a, ref) => {
|
|
4355
|
+
var _b = _a, { className, children, asChild = false } = _b, props = __objRest(_b, ["className", "children", "asChild"]);
|
|
4356
|
+
const { show: open } = useWalletHeader();
|
|
4357
|
+
const Comp = asChild ? Slot10 : "div";
|
|
4358
|
+
return /* @__PURE__ */ jsx42(
|
|
4359
|
+
Comp,
|
|
4360
|
+
__spreadProps(__spreadValues({
|
|
4361
|
+
ref,
|
|
4362
|
+
className: cn(
|
|
4363
|
+
"transition-all pt-[1rem]",
|
|
4364
|
+
{
|
|
4365
|
+
"opacity-15 pointer-events-none filter blur-[2px]": open
|
|
4366
|
+
},
|
|
4367
|
+
className
|
|
4368
|
+
)
|
|
4369
|
+
}, props), {
|
|
4370
|
+
children
|
|
4371
|
+
})
|
|
4372
|
+
);
|
|
4373
|
+
});
|
|
4374
|
+
WalletHeaderContentBlur.displayName = "WalletHeaderContentBlur";
|
|
4375
|
+
|
|
4376
|
+
// src/components/navigation/header.tsx
|
|
4377
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
4378
|
+
function HeaderGradient() {
|
|
4379
|
+
return /* @__PURE__ */ jsx43("div", { className: "absolute inset-0 h-[3px] bg-gradient-brand-animated" });
|
|
4380
|
+
}
|
|
4381
|
+
function HeaderContent({
|
|
4382
|
+
children,
|
|
4383
|
+
className
|
|
4384
|
+
}) {
|
|
4385
|
+
return /* @__PURE__ */ jsx43(
|
|
4386
|
+
"div",
|
|
4387
|
+
{
|
|
4388
|
+
className: cn(
|
|
4389
|
+
"header-container w-full h-full px-4 md:px-6 flex items-center justify-between mx-auto",
|
|
4390
|
+
className
|
|
4391
|
+
),
|
|
4392
|
+
children
|
|
4393
|
+
}
|
|
4394
|
+
);
|
|
4395
|
+
}
|
|
4396
|
+
function Header({
|
|
4397
|
+
children,
|
|
4398
|
+
className
|
|
4399
|
+
}) {
|
|
4400
|
+
return /* @__PURE__ */ jsx43(
|
|
4401
|
+
"header",
|
|
4402
|
+
{
|
|
4403
|
+
className: cn(
|
|
4404
|
+
"fixed top-0 left-0 z-50 h-20 backdrop-blur-sm w-full",
|
|
4405
|
+
className
|
|
4406
|
+
),
|
|
4407
|
+
children
|
|
4408
|
+
}
|
|
4409
|
+
);
|
|
4410
|
+
}
|
|
4411
|
+
|
|
4412
|
+
// src/components/navigation/tabs.tsx
|
|
4413
|
+
import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4414
|
+
function TabAltHeader({
|
|
4415
|
+
label,
|
|
4416
|
+
isNew,
|
|
4417
|
+
isActive,
|
|
4418
|
+
onClick,
|
|
4419
|
+
className = ""
|
|
4420
|
+
}) {
|
|
4421
|
+
return /* @__PURE__ */ jsx44(
|
|
4422
|
+
"button",
|
|
4423
|
+
{
|
|
4424
|
+
type: "button",
|
|
4425
|
+
onClick,
|
|
4426
|
+
className: cn(
|
|
4427
|
+
"relative cursor-pointer w-max duration-200 transition-colors",
|
|
4428
|
+
isActive ? "text-white" : "text-brand-black-100 hover:text-white",
|
|
4429
|
+
className
|
|
4430
|
+
),
|
|
4431
|
+
children: /* @__PURE__ */ jsxs32("span", { className: "relative z-10 flex items-center gap-2", children: [
|
|
4432
|
+
/* @__PURE__ */ jsx44("span", { className: "font-medium", children: label }),
|
|
4433
|
+
isNew && /* @__PURE__ */ jsx44("span", { className: "text-brand-warning-500 caption-text absolute top-0 left-[100%] w-max", children: "New" })
|
|
4434
|
+
] })
|
|
4435
|
+
}
|
|
4436
|
+
);
|
|
4437
|
+
}
|
|
4438
|
+
function TabAltHeaders({
|
|
4439
|
+
children,
|
|
4440
|
+
className = ""
|
|
4441
|
+
}) {
|
|
4442
|
+
return /* @__PURE__ */ jsx44("div", { className: cn("flex space-x-3 mb-6", className), children });
|
|
4443
|
+
}
|
|
4444
|
+
function TabAltContent({
|
|
4445
|
+
children,
|
|
4446
|
+
className = ""
|
|
4447
|
+
}) {
|
|
4448
|
+
return /* @__PURE__ */ jsx44("div", { className, children });
|
|
4449
|
+
}
|
|
4450
|
+
function TabAltPanel({
|
|
4451
|
+
id,
|
|
4452
|
+
activeTab,
|
|
4453
|
+
children,
|
|
4454
|
+
className = ""
|
|
4455
|
+
}) {
|
|
4456
|
+
if (activeTab !== id) return null;
|
|
4457
|
+
return /* @__PURE__ */ jsx44("div", { className, children }, id);
|
|
4458
|
+
}
|
|
4459
|
+
function TabAlt({
|
|
4460
|
+
children,
|
|
4461
|
+
className = ""
|
|
4462
|
+
}) {
|
|
4463
|
+
return /* @__PURE__ */ jsx44("div", { className: cn("w-full", className), children });
|
|
4464
|
+
}
|
|
4465
|
+
|
|
4466
|
+
// src/@/ui/tooltip.tsx
|
|
4467
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4468
|
+
import { jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4469
|
+
function TooltipProvider(_a) {
|
|
4470
|
+
var _b = _a, {
|
|
4471
|
+
delayDuration = 0
|
|
4472
|
+
} = _b, props = __objRest(_b, [
|
|
4473
|
+
"delayDuration"
|
|
4474
|
+
]);
|
|
4475
|
+
return /* @__PURE__ */ jsx45(
|
|
4476
|
+
TooltipPrimitive.Provider,
|
|
4477
|
+
__spreadValues({
|
|
4478
|
+
"data-slot": "tooltip-provider",
|
|
4479
|
+
delayDuration
|
|
4480
|
+
}, props)
|
|
4481
|
+
);
|
|
4482
|
+
}
|
|
4483
|
+
function Tooltip(_a) {
|
|
4484
|
+
var props = __objRest(_a, []);
|
|
4485
|
+
return /* @__PURE__ */ jsx45(TooltipProvider, { children: /* @__PURE__ */ jsx45(TooltipPrimitive.Root, __spreadValues({ "data-slot": "tooltip" }, props)) });
|
|
4486
|
+
}
|
|
4487
|
+
function TooltipTrigger(_a) {
|
|
4488
|
+
var props = __objRest(_a, []);
|
|
4489
|
+
return /* @__PURE__ */ jsx45(TooltipPrimitive.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
|
|
4490
|
+
}
|
|
4491
|
+
function TooltipContent(_a) {
|
|
4492
|
+
var _b = _a, {
|
|
4493
|
+
className,
|
|
4494
|
+
sideOffset = 0,
|
|
4495
|
+
children
|
|
4496
|
+
} = _b, props = __objRest(_b, [
|
|
4497
|
+
"className",
|
|
4498
|
+
"sideOffset",
|
|
4499
|
+
"children"
|
|
4500
|
+
]);
|
|
4501
|
+
return /* @__PURE__ */ jsx45(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs33(
|
|
4502
|
+
TooltipPrimitive.Content,
|
|
4503
|
+
__spreadProps(__spreadValues({
|
|
4504
|
+
"data-slot": "tooltip-content",
|
|
4505
|
+
sideOffset,
|
|
4506
|
+
className: cn(
|
|
4507
|
+
"bg-brand-black-600 text-brand-black-100 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
4508
|
+
className
|
|
4509
|
+
)
|
|
4510
|
+
}, props), {
|
|
4511
|
+
children: [
|
|
4512
|
+
children,
|
|
4513
|
+
/* @__PURE__ */ jsx45(TooltipPrimitive.Arrow, { className: "bg-brand-black-600 fill-brand-black-600 z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
4514
|
+
]
|
|
4515
|
+
})
|
|
4516
|
+
) });
|
|
4517
|
+
}
|
|
4518
|
+
|
|
4519
|
+
// src/components/organisms/settings.tsx
|
|
4520
|
+
import { useState as useState5 } from "react";
|
|
4521
|
+
import { jsx as jsx46, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4522
|
+
var PRESET_SLIPPAGES = ["Auto", "0.25%", "0.5%", "0.75%", "1%"];
|
|
4523
|
+
var DEFAULT_TOOLTIP_TEXTS = {
|
|
4524
|
+
bridge: {
|
|
4525
|
+
slippage: "Bridge slippage tolerance helps protect against price changes during cross-chain transaction processing",
|
|
4526
|
+
deadline: "Bridge deadline is the maximum time allowed before the transaction times out and is cancelled"
|
|
4527
|
+
},
|
|
4528
|
+
swap: {
|
|
4529
|
+
slippage: "Swap slippage tolerance helps protect against price changes during token exchange",
|
|
4530
|
+
deadline: "Swap deadline is the maximum time allowed before the transaction times out and is cancelled"
|
|
4531
|
+
}
|
|
4532
|
+
};
|
|
4533
|
+
var Settings = ({
|
|
4534
|
+
isOpen,
|
|
4535
|
+
onClose,
|
|
4536
|
+
slippage = "Auto",
|
|
4537
|
+
deadline,
|
|
4538
|
+
onSlippageChange,
|
|
4539
|
+
onDeadlineChange,
|
|
4540
|
+
type,
|
|
4541
|
+
slippageTooltipText,
|
|
4542
|
+
deadlineTooltipText
|
|
4543
|
+
}) => {
|
|
4544
|
+
const [customSlippage, setCustomSlippage] = useState5("");
|
|
4545
|
+
const [customDeadline, setCustomDeadline] = useState5(deadline);
|
|
4546
|
+
const handleKeyDown = createKeyDownHandler();
|
|
4547
|
+
const handleSlippageSelect = (selectedSlippage) => {
|
|
4548
|
+
onSlippageChange == null ? void 0 : onSlippageChange(selectedSlippage);
|
|
4549
|
+
if (selectedSlippage !== "Custom") {
|
|
4550
|
+
setCustomSlippage("");
|
|
4551
|
+
}
|
|
4552
|
+
};
|
|
4553
|
+
const handleCustomSlippageChange = (e) => {
|
|
4554
|
+
const value = e.target.value;
|
|
4555
|
+
setCustomSlippage(value);
|
|
4556
|
+
if (value) {
|
|
4557
|
+
onSlippageChange == null ? void 0 : onSlippageChange(`${value}%`);
|
|
4558
|
+
}
|
|
4559
|
+
};
|
|
4560
|
+
const handleCustomSlippageBlur = (e) => {
|
|
4561
|
+
const value = Number.parseFloat(e.target.value);
|
|
4562
|
+
if (value > 100) {
|
|
4563
|
+
e.target.value = "100";
|
|
4564
|
+
setCustomSlippage("100");
|
|
4565
|
+
onSlippageChange == null ? void 0 : onSlippageChange("100%");
|
|
4566
|
+
} else if (value < 0) {
|
|
4567
|
+
e.target.value = "0";
|
|
4568
|
+
setCustomSlippage("0");
|
|
4569
|
+
onSlippageChange == null ? void 0 : onSlippageChange("0%");
|
|
4570
|
+
}
|
|
4571
|
+
};
|
|
4572
|
+
const handleDeadlineChange = (e) => {
|
|
4573
|
+
const value = e.target.value;
|
|
4574
|
+
setCustomDeadline(value);
|
|
4575
|
+
onDeadlineChange == null ? void 0 : onDeadlineChange(value);
|
|
4576
|
+
};
|
|
4577
|
+
const handleDeadlineBlur = (e) => {
|
|
4578
|
+
const value = Number.parseFloat(e.target.value);
|
|
4579
|
+
if (value < 0) {
|
|
4580
|
+
e.target.value = "0";
|
|
4581
|
+
setCustomDeadline("0");
|
|
4582
|
+
onDeadlineChange == null ? void 0 : onDeadlineChange("0");
|
|
4583
|
+
}
|
|
4584
|
+
};
|
|
4585
|
+
const isSlippageSelected = (option) => {
|
|
4586
|
+
if (option === "Custom") {
|
|
4587
|
+
return slippage !== "Auto" && !PRESET_SLIPPAGES.includes(slippage);
|
|
4588
|
+
}
|
|
4589
|
+
return slippage === option;
|
|
4590
|
+
};
|
|
4591
|
+
const isCustomSlippageActive = isSlippageSelected("Custom");
|
|
4592
|
+
const title = type === "bridge" ? "Bridge" : "Swap";
|
|
4593
|
+
const effectiveSlippageTooltip = slippageTooltipText || DEFAULT_TOOLTIP_TEXTS[type].slippage;
|
|
4594
|
+
const effectiveDeadlineTooltip = deadlineTooltipText || DEFAULT_TOOLTIP_TEXTS[type].deadline;
|
|
4595
|
+
return /* @__PURE__ */ jsxs34(Modal, { className: "p-4 !h-max", isOpen, onClose, children: [
|
|
4596
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center justify-between", children: [
|
|
4597
|
+
/* @__PURE__ */ jsxs34("div", { className: "body-1 font-medium text-white max-w-[200px] break-words", children: [
|
|
4598
|
+
title,
|
|
4599
|
+
" settings"
|
|
4600
|
+
] }),
|
|
4601
|
+
/* @__PURE__ */ jsx46(
|
|
4602
|
+
XIcon_default,
|
|
4603
|
+
{
|
|
4604
|
+
className: "size-4 cursor-pointer text-brand-black-100 hover:text-white duration-200 transition-colors",
|
|
4605
|
+
onClick: onClose
|
|
4606
|
+
}
|
|
4607
|
+
)
|
|
4608
|
+
] }),
|
|
4609
|
+
/* @__PURE__ */ jsxs34("div", { className: "mt-4", children: [
|
|
4610
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-1 text-brand-black-100", children: [
|
|
4611
|
+
/* @__PURE__ */ jsxs34("p", { className: "text-caption", children: [
|
|
4612
|
+
title,
|
|
4613
|
+
" Slippage"
|
|
4614
|
+
] }),
|
|
4615
|
+
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4616
|
+
/* @__PURE__ */ jsx46(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx46(CircleInfo_default, { className: "size-[14px] cursor-pointer hover:text-white duration-200 transition-colors" }) }),
|
|
4617
|
+
/* @__PURE__ */ jsx46(TooltipContent, { children: /* @__PURE__ */ jsx46("p", { className: "text-caption", children: effectiveSlippageTooltip }) })
|
|
4618
|
+
] })
|
|
4619
|
+
] }),
|
|
4620
|
+
/* @__PURE__ */ jsxs34("div", { className: "grid grid-cols-3 gap-2 mt-3", children: [
|
|
4621
|
+
PRESET_SLIPPAGES.map((option) => /* @__PURE__ */ jsx46(
|
|
4622
|
+
"div",
|
|
4623
|
+
{
|
|
4624
|
+
className: cn(
|
|
4625
|
+
"relative rounded-2xl p-[1.5px]",
|
|
4626
|
+
isSlippageSelected(option) ? "animated-gradient-border" : "bg-transparent"
|
|
4627
|
+
),
|
|
4628
|
+
children: /* @__PURE__ */ jsx46(
|
|
4629
|
+
"button",
|
|
4630
|
+
{
|
|
4631
|
+
type: "button",
|
|
4632
|
+
onClick: () => handleSlippageSelect(option),
|
|
4633
|
+
className: "cursor-pointer w-full rounded-[16px] bg-brand-card-100 hover:bg-brand-card-100/80 transition-colors duration-200 p-[14px] flex items-center justify-center min-h-12",
|
|
4634
|
+
children: /* @__PURE__ */ jsx46("p", { className: "body-1 font-medium", children: option })
|
|
4635
|
+
}
|
|
4636
|
+
)
|
|
4637
|
+
},
|
|
4638
|
+
option
|
|
4639
|
+
)),
|
|
4640
|
+
/* @__PURE__ */ jsx46(
|
|
4641
|
+
"div",
|
|
4642
|
+
{
|
|
4643
|
+
className: cn(
|
|
4644
|
+
"relative rounded-2xl p-[1.5px]",
|
|
4645
|
+
isCustomSlippageActive ? "animated-gradient-border" : "bg-transparent"
|
|
4646
|
+
),
|
|
4647
|
+
children: /* @__PURE__ */ jsxs34("div", { className: "relative bg-brand-card-100 rounded-[16px]", children: [
|
|
4648
|
+
/* @__PURE__ */ jsx46(
|
|
4649
|
+
Input,
|
|
4650
|
+
{
|
|
4651
|
+
min: 0,
|
|
4652
|
+
max: 100,
|
|
4653
|
+
value: customSlippage,
|
|
4654
|
+
onChange: handleCustomSlippageChange,
|
|
4655
|
+
onBlur: handleCustomSlippageBlur,
|
|
4656
|
+
onFocus: () => handleSlippageSelect("Custom"),
|
|
4657
|
+
className: "bg-transparent focus-visible:ring-1 focus-visible:ring-brand-black-100 h-12 border-none rounded-[16px] w-full p-4 body-1 pr-8",
|
|
4658
|
+
placeholder: "Custom",
|
|
4659
|
+
type: "number",
|
|
4660
|
+
onKeyDown: handleKeyDown
|
|
4661
|
+
}
|
|
4662
|
+
),
|
|
4663
|
+
/* @__PURE__ */ jsx46("span", { className: "body-1 absolute right-4 top-1/2 -translate-y-1/2 text-brand-black-100", children: "%" })
|
|
4664
|
+
] })
|
|
4665
|
+
}
|
|
4666
|
+
)
|
|
4667
|
+
] })
|
|
4668
|
+
] }),
|
|
4669
|
+
/* @__PURE__ */ jsxs34("div", { className: "mt-6", children: [
|
|
4670
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-1 text-brand-black-100", children: [
|
|
4671
|
+
/* @__PURE__ */ jsxs34("p", { className: "text-caption", children: [
|
|
4672
|
+
title,
|
|
4673
|
+
" deadline"
|
|
4674
|
+
] }),
|
|
4675
|
+
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4676
|
+
/* @__PURE__ */ jsx46(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx46(CircleInfo_default, { className: "size-[14px] cursor-pointer hover:text-white duration-200 transition-colors" }) }),
|
|
4677
|
+
/* @__PURE__ */ jsx46(TooltipContent, { children: /* @__PURE__ */ jsx46("p", { className: "text-caption", children: effectiveDeadlineTooltip }) })
|
|
4678
|
+
] })
|
|
4679
|
+
] }),
|
|
4680
|
+
/* @__PURE__ */ jsxs34("div", { className: "relative mt-3", children: [
|
|
4681
|
+
/* @__PURE__ */ jsx46(
|
|
4682
|
+
Input,
|
|
4683
|
+
{
|
|
4684
|
+
value: customDeadline,
|
|
4685
|
+
onChange: handleDeadlineChange,
|
|
4686
|
+
onBlur: handleDeadlineBlur,
|
|
4687
|
+
onKeyDown: handleKeyDown,
|
|
4688
|
+
className: "bg-brand-card-100 focus-visible:ring-1 focus-visible:ring-brand-black-100 h-12 border-none rounded-[16px] w-full p-4 body-1 pr-18",
|
|
4689
|
+
placeholder: "Enter deadline",
|
|
4690
|
+
type: "number",
|
|
4691
|
+
min: 0
|
|
4692
|
+
}
|
|
4693
|
+
),
|
|
4694
|
+
/* @__PURE__ */ jsx46("span", { className: "body-1 absolute right-4 top-1/2 -translate-y-1/2 text-brand-black-100", children: "minutes" })
|
|
4695
|
+
] })
|
|
4696
|
+
] })
|
|
4697
|
+
] });
|
|
4698
|
+
};
|
|
4699
|
+
|
|
4700
|
+
// src/components/organisms/bridge-settings.tsx
|
|
4701
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4702
|
+
var BridgeSettings = (props) => {
|
|
4703
|
+
return /* @__PURE__ */ jsx47(Settings, __spreadProps(__spreadValues({}, props), { type: "bridge" }));
|
|
4704
|
+
};
|
|
4705
|
+
export {
|
|
4706
|
+
AccessoryButton,
|
|
4707
|
+
AccountItem,
|
|
4708
|
+
AccountStack2 as AccountStack,
|
|
4709
|
+
AddressInput,
|
|
4710
|
+
AddressInputFocusBehaviour,
|
|
4711
|
+
AssetList,
|
|
4712
|
+
AssetListItem,
|
|
4713
|
+
AssetValueTrend,
|
|
4714
|
+
BadgeIcon,
|
|
4715
|
+
Balance,
|
|
4716
|
+
BridgeForm,
|
|
4717
|
+
BridgeInput,
|
|
4718
|
+
BridgeSettings,
|
|
4719
|
+
BridgeSummary,
|
|
4720
|
+
BridgeTokenButton,
|
|
4721
|
+
Button2 as Button,
|
|
4722
|
+
CWDrawerContent,
|
|
4723
|
+
ConnectedHeader,
|
|
4724
|
+
Dialog,
|
|
4725
|
+
DialogClose,
|
|
4726
|
+
DialogContent,
|
|
4727
|
+
DialogDescription,
|
|
4728
|
+
DialogFooter,
|
|
4729
|
+
DialogHeader,
|
|
4730
|
+
DialogMorphContent,
|
|
4731
|
+
DialogOverlay,
|
|
4732
|
+
DialogPortal,
|
|
4733
|
+
DialogTitle,
|
|
4734
|
+
DialogTrigger,
|
|
4735
|
+
Drawer,
|
|
4736
|
+
DrawerContent,
|
|
4737
|
+
EmptyState,
|
|
4738
|
+
EmptyStateConceal,
|
|
4739
|
+
EmptyStateContent,
|
|
4740
|
+
EmptyStateDescription,
|
|
4741
|
+
EmptyStateTitle,
|
|
4742
|
+
GradientButton,
|
|
4743
|
+
Header,
|
|
4744
|
+
HeaderContent,
|
|
4745
|
+
HeaderGradient,
|
|
4746
|
+
HeaderNested,
|
|
4747
|
+
IconButton,
|
|
4748
|
+
Input2 as Input,
|
|
4749
|
+
LabelledSeperator,
|
|
4750
|
+
ListHeading,
|
|
4751
|
+
ListSection,
|
|
4752
|
+
ManageAccounts,
|
|
4753
|
+
Modal,
|
|
4754
|
+
NetworkGroupItem,
|
|
4755
|
+
NetworkSelectionItem,
|
|
4756
|
+
NetworkSelector,
|
|
4757
|
+
NetworkSwitcher,
|
|
4758
|
+
NetworkSwitcherButton,
|
|
4759
|
+
ReviewItem,
|
|
4760
|
+
ReviewItemCopyAddressButton,
|
|
4761
|
+
ScrollAwareSeparator,
|
|
4762
|
+
SearchInput,
|
|
4763
|
+
Settings,
|
|
4764
|
+
Sheet,
|
|
4765
|
+
SheetContent,
|
|
4766
|
+
SheetTrigger,
|
|
4767
|
+
SummaryValues,
|
|
4768
|
+
SwapForm,
|
|
4769
|
+
SwapTokenButton,
|
|
4770
|
+
TabAlt,
|
|
4771
|
+
TabAltContent,
|
|
4772
|
+
TabAltHeader,
|
|
4773
|
+
TabAltHeaders,
|
|
4774
|
+
TabAltPanel,
|
|
4775
|
+
TabItem,
|
|
4776
|
+
Tabs,
|
|
4777
|
+
TabsContent,
|
|
4778
|
+
TabsList2 as TabsList,
|
|
4779
|
+
TagButton,
|
|
4780
|
+
Text,
|
|
4781
|
+
TimelineItem,
|
|
4782
|
+
TimelineList,
|
|
4783
|
+
TimelineListGroup,
|
|
4784
|
+
TimelineRoot,
|
|
4785
|
+
TimerWrap,
|
|
4786
|
+
ToastBox,
|
|
4787
|
+
TokenImage,
|
|
4788
|
+
TokenSelectionItem,
|
|
4789
|
+
TokenSelector,
|
|
4790
|
+
TokenTransferPair,
|
|
4791
|
+
Tooltip,
|
|
4792
|
+
TooltipContent,
|
|
4793
|
+
TooltipProvider,
|
|
4794
|
+
TooltipTrigger,
|
|
4795
|
+
TransactionTimer,
|
|
4796
|
+
TxList,
|
|
4797
|
+
TxListItem,
|
|
4798
|
+
TxListItemProcessing,
|
|
4799
|
+
WalletAccountItem,
|
|
4800
|
+
WalletConnectedHeader,
|
|
4801
|
+
WalletHeader,
|
|
4802
|
+
WalletHeaderContent,
|
|
4803
|
+
WalletHeaderContentBlur,
|
|
4804
|
+
WalletHeaderTabItem,
|
|
4805
|
+
WalletHeaderTabs,
|
|
4806
|
+
WalletHeaderTabsContent,
|
|
4807
|
+
WalletHeaderTabsList,
|
|
4808
|
+
WalletManagerUIContent,
|
|
4809
|
+
WalletManagerUIProvider,
|
|
4810
|
+
WalletProviderItem,
|
|
4811
|
+
makeEntry
|
|
4812
|
+
};
|