@deframe-sdk/components 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1678 @@
1
+ 'use strict';
2
+
3
+ var tailwindMerge = require('tailwind-merge');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var React6 = require('react');
6
+ var framerMotion = require('framer-motion');
7
+ var md = require('react-icons/md');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
28
+
29
+ var __defProp = Object.defineProperty;
30
+ var __defProps = Object.defineProperties;
31
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
32
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
33
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
34
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
35
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36
+ var __spreadValues = (a, b) => {
37
+ for (var prop in b || (b = {}))
38
+ if (__hasOwnProp.call(b, prop))
39
+ __defNormalProp(a, prop, b[prop]);
40
+ if (__getOwnPropSymbols)
41
+ for (var prop of __getOwnPropSymbols(b)) {
42
+ if (__propIsEnum.call(b, prop))
43
+ __defNormalProp(a, prop, b[prop]);
44
+ }
45
+ return a;
46
+ };
47
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
48
+ var __objRest = (source, exclude) => {
49
+ var target = {};
50
+ for (var prop in source)
51
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
52
+ target[prop] = source[prop];
53
+ if (source != null && __getOwnPropSymbols)
54
+ for (var prop of __getOwnPropSymbols(source)) {
55
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
56
+ target[prop] = source[prop];
57
+ }
58
+ return target;
59
+ };
60
+ function ActionButton(_a) {
61
+ var _b = _a, {
62
+ children,
63
+ disabled = false,
64
+ className = "",
65
+ type = "button"
66
+ } = _b, props = __objRest(_b, [
67
+ "children",
68
+ "disabled",
69
+ "className",
70
+ "type"
71
+ ]);
72
+ const getStyles = () => {
73
+ if (disabled) {
74
+ return {
75
+ container: "flex-1 h-12 rounded inline-flex flex-col justify-center items-center gap-2 overflow-hidden bg-bg-muted dark:bg-bg-muted-dark",
76
+ inner: "self-stretch flex-1 pl-4 pr-6 py-2.5 inline-flex justify-center items-center gap-2",
77
+ text: "opacity-state-disabled-content text-center justify-center text-text-disabled dark:text-text-disabled-dark text-sm font-semibold font-poppins leading-5"
78
+ };
79
+ }
80
+ return {
81
+ container: "flex-1 h-12 bg-brand-primary rounded inline-flex flex-col justify-center items-center gap-2 overflow-hidden hover:shadow-md transition-shadow duration-200",
82
+ inner: "self-stretch flex-1 pl-4 pr-6 py-2.5 inline-flex justify-center items-center gap-2 hover:opacity-90 focus:opacity-85 active:opacity-85 transition-opacity duration-200",
83
+ text: "text-center justify-center text-text-inverse text-sm font-semibold font-poppins leading-5"
84
+ };
85
+ };
86
+ const styles = getStyles();
87
+ const containerClasses = tailwindMerge.twMerge(
88
+ "flex-1 px-2 py-1 rounded border border-border-subtle dark:border-border-subtle-dark bg-bg-muted dark:bg-bg-muted-dark text-text-secondary dark:text-text-secondary-dark text-sm font-semibold font-poppins leading-5 hover:border-border-default dark:hover:border-border-default-dark focus:outline-none focus:ring-2 focus:ring-brand-primary",
89
+ disabled && "cursor-not-allowed",
90
+ className
91
+ );
92
+ return /* @__PURE__ */ jsxRuntime.jsx(
93
+ "button",
94
+ __spreadProps(__spreadValues({
95
+ type,
96
+ className: containerClasses,
97
+ disabled
98
+ }, props), {
99
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.inner, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.text, children }) })
100
+ })
101
+ );
102
+ }
103
+ function PercentageButton(_a) {
104
+ var _b = _a, {
105
+ children,
106
+ disabled = false,
107
+ className = "",
108
+ type = "button"
109
+ } = _b, props = __objRest(_b, [
110
+ "children",
111
+ "disabled",
112
+ "className",
113
+ "type"
114
+ ]);
115
+ const containerClasses = tailwindMerge.twMerge(
116
+ "flex-1 px-2 py-1 rounded border border-border-subtle dark:border-border-subtle-dark bg-bg-muted dark:bg-bg-muted-dark text-text-secondary dark:text-text-secondary-dark text-sm font-semibold font-poppins leading-5 hover:border-border-default dark:hover:border-border-default-dark focus:outline-none focus:ring-2 focus:ring-brand-primary",
117
+ disabled && "cursor-not-allowed",
118
+ className
119
+ );
120
+ return /* @__PURE__ */ jsxRuntime.jsx(
121
+ "button",
122
+ __spreadProps(__spreadValues({
123
+ type,
124
+ className: containerClasses,
125
+ disabled
126
+ }, props), {
127
+ children
128
+ })
129
+ );
130
+ }
131
+ function PrimaryButton(_a) {
132
+ var _b = _a, {
133
+ children,
134
+ disabled = false,
135
+ className = "",
136
+ type = "button"
137
+ } = _b, props = __objRest(_b, [
138
+ "children",
139
+ "disabled",
140
+ "className",
141
+ "type"
142
+ ]);
143
+ const baseStyles = disabled ? "h-12 w-full rounded px-6 py-2.5 inline-flex justify-center items-center gap-2 overflow-hidden cursor-not-allowed bg-bg-muted dark:bg-bg-muted-dark text-text-disabled dark:text-text-disabled-dark opacity-50 text-center text-sm font-semibold font-poppins leading-5" : "h-12 w-full rounded px-6 py-2.5 inline-flex justify-center items-center gap-2 overflow-hidden bg-brand-primary text-text-inverse hover:shadow-md hover:opacity-90 focus:opacity-85 active:opacity-85 transition-all duration-200 text-center text-sm font-semibold font-poppins leading-5 cursor-pointer";
144
+ const buttonClasses = tailwindMerge.twMerge(baseStyles, className);
145
+ return /* @__PURE__ */ jsxRuntime.jsx(
146
+ "button",
147
+ __spreadProps(__spreadValues({
148
+ type,
149
+ className: buttonClasses,
150
+ disabled
151
+ }, props), {
152
+ children
153
+ })
154
+ );
155
+ }
156
+ function SecondaryButton(_a) {
157
+ var _b = _a, {
158
+ children,
159
+ disabled = false,
160
+ className = "",
161
+ type = "button"
162
+ } = _b, props = __objRest(_b, [
163
+ "children",
164
+ "disabled",
165
+ "className",
166
+ "type"
167
+ ]);
168
+ const getStyles = () => {
169
+ if (disabled) {
170
+ return {
171
+ container: "h-12 rounded outline outline-1 outline-offset-[-1px] outline-border-default dark:outline-border-default-dark inline-flex flex-col justify-center items-center gap-2 overflow-hidden",
172
+ inner: "self-stretch flex-1 px-6 py-2.5 inline-flex justify-center items-center gap-2",
173
+ text: "opacity-state-disabled-content text-center justify-center text-text-disabled dark:text-text-disabled-dark text-sm font-semibold font-poppins leading-5"
174
+ };
175
+ }
176
+ return {
177
+ container: "h-12 rounded outline outline-1 outline-offset-[-1px] outline-border-subtle dark:outline-border-subtle-dark inline-flex flex-col justify-center items-center gap-2 overflow-hidden hover:outline-brand-primary focus:outline-brand-primary active:outline-border-default transition-colors duration-200 cursor-pointer",
178
+ inner: "self-stretch flex-1 px-6 py-2.5 inline-flex justify-center items-center gap-2 hover:bg-brand-secondary-20 focus:bg-brand-secondary-20 active:bg-transparent transition-colors duration-200",
179
+ text: "text-center justify-center text-brand-primary text-sm font-semibold font-poppins leading-5"
180
+ };
181
+ };
182
+ const styles = getStyles();
183
+ const containerClasses = tailwindMerge.twMerge(
184
+ styles.container,
185
+ disabled && "cursor-not-allowed",
186
+ className
187
+ );
188
+ return /* @__PURE__ */ jsxRuntime.jsx(
189
+ "button",
190
+ __spreadProps(__spreadValues({
191
+ type,
192
+ className: containerClasses,
193
+ disabled
194
+ }, props), {
195
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.inner, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.text, children }) })
196
+ })
197
+ );
198
+ }
199
+ function TertiaryButton(_a) {
200
+ var _b = _a, {
201
+ children,
202
+ disabled = false,
203
+ className = "",
204
+ type = "button"
205
+ } = _b, props = __objRest(_b, [
206
+ "children",
207
+ "disabled",
208
+ "className",
209
+ "type"
210
+ ]);
211
+ const getStyles = () => {
212
+ if (disabled) {
213
+ return {
214
+ container: "h-12 rounded inline-flex flex-col justify-center items-center gap-2 overflow-hidden",
215
+ inner: "self-stretch flex-1 px-6 py-2.5 inline-flex justify-center items-center gap-2",
216
+ text: "opacity-state-disabled-content text-center justify-center text-text-disabled dark:text-text-disabled-dark text-sm font-semibold font-poppins leading-5"
217
+ };
218
+ }
219
+ return {
220
+ container: "h-12 rounded inline-flex flex-col justify-center items-center gap-2 overflow-hidden hover:shadow-md transition-colors duration-200 cursor-pointer",
221
+ inner: "self-stretch flex-1 px-6 py-2.5 inline-flex justify-center items-center gap-2 hover:bg-brand-tint dark:hover:bg-brand-tint-dark focus:bg-brand-tint-75 dark:focus:bg-brand-tint-75-dark active:bg-brand-tint-60 dark:active:bg-brand-tint-60-dark transition-colors duration-200",
222
+ text: "text-center justify-center text-brand-primary text-sm font-semibold font-poppins leading-5"
223
+ };
224
+ };
225
+ const styles = getStyles();
226
+ const containerClasses = tailwindMerge.twMerge(
227
+ styles.container,
228
+ disabled && "cursor-not-allowed",
229
+ className
230
+ );
231
+ return /* @__PURE__ */ jsxRuntime.jsx(
232
+ "button",
233
+ __spreadProps(__spreadValues({
234
+ type,
235
+ className: containerClasses,
236
+ disabled
237
+ }, props), {
238
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.inner, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.text, children }) })
239
+ })
240
+ );
241
+ }
242
+ function Link(_a) {
243
+ var _b = _a, {
244
+ children,
245
+ href,
246
+ className = "",
247
+ target = "_self"
248
+ } = _b, props = __objRest(_b, [
249
+ "children",
250
+ "href",
251
+ "className",
252
+ "target"
253
+ ]);
254
+ const styles = {
255
+ link: "text-sm font-medium font-poppins leading-5 cursor-pointer"
256
+ };
257
+ const linkClasses = tailwindMerge.twMerge(styles.link, className);
258
+ return /* @__PURE__ */ jsxRuntime.jsx(
259
+ "a",
260
+ __spreadProps(__spreadValues({
261
+ href,
262
+ target,
263
+ className: linkClasses,
264
+ rel: target === "_blank" ? "noopener noreferrer" : void 0
265
+ }, props), {
266
+ children
267
+ })
268
+ );
269
+ }
270
+ function Input(_a) {
271
+ var _b = _a, {
272
+ label,
273
+ error,
274
+ placeholder,
275
+ type = "text",
276
+ repassword = "Forgot password?",
277
+ disabled,
278
+ className
279
+ } = _b, props = __objRest(_b, [
280
+ "label",
281
+ "error",
282
+ "placeholder",
283
+ "type",
284
+ "repassword",
285
+ "disabled",
286
+ "className"
287
+ ]);
288
+ const hasError = !!error;
289
+ const inputClasses = tailwindMerge.twMerge(
290
+ "w-full px-4 py-2 rounded",
291
+ "text-white placeholder-gray-400 text-base font-poppins",
292
+ hasError ? "border-red-500" : disabled ? "border-gray-600 opacity-60" : "border-gray-500",
293
+ className
294
+ );
295
+ const labelClasses = "block mb-1 text-xs text-white font-poppins";
296
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
297
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: labelClasses, children: label }),
298
+ /* @__PURE__ */ jsxRuntime.jsx(
299
+ "input",
300
+ __spreadValues({
301
+ type,
302
+ placeholder,
303
+ disabled,
304
+ className: inputClasses
305
+ }, props)
306
+ ),
307
+ type === "password" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-right", children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: "#", children: repassword }) }),
308
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-red-500", children: error })
309
+ ] });
310
+ }
311
+ var ListItem = ({
312
+ children,
313
+ className,
314
+ containerClassName,
315
+ onClick
316
+ }) => {
317
+ const containerClasses = tailwindMerge.twMerge(
318
+ "self-stretch min-h-16 relative rounded border border-border-default text-white dark:border-border-default-dark flex flex-col justify-center items-center hover:border-border-strong dark:hover:border-border-strong-dark transition-colors bg-bg-subtle dark:bg-bg-subtle-dark",
319
+ onClick && "cursor-pointer",
320
+ containerClassName
321
+ );
322
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: containerClasses, onClick, children: /* @__PURE__ */ jsxRuntime.jsx(
323
+ "div",
324
+ {
325
+ className: tailwindMerge.twMerge(
326
+ "self-stretch inline-flex justify-between items-center gap-md px-4 py-2 text-white",
327
+ className
328
+ ),
329
+ children
330
+ }
331
+ ) });
332
+ };
333
+ var ListItemLeftSide = ({ children, className }) => {
334
+ return /* @__PURE__ */ jsxRuntime.jsx(
335
+ "div",
336
+ {
337
+ className: tailwindMerge.twMerge("flex justify-center items-center text-white", className),
338
+ children
339
+ }
340
+ );
341
+ };
342
+ var ListItemContent = ({ children, className }) => {
343
+ return /* @__PURE__ */ jsxRuntime.jsx(
344
+ "div",
345
+ {
346
+ className: tailwindMerge.twMerge(
347
+ "flex-1 self-stretch inline-flex flex-col justify-center items-start overflow-hidden text-white",
348
+ className
349
+ ),
350
+ children
351
+ }
352
+ );
353
+ };
354
+ var ListItemRightSide = ({ children, className }) => {
355
+ return /* @__PURE__ */ jsxRuntime.jsx(
356
+ "div",
357
+ {
358
+ className: tailwindMerge.twMerge(
359
+ "flex flex-col justify-start items-end text-white",
360
+ className
361
+ ),
362
+ children
363
+ }
364
+ );
365
+ };
366
+ function WalletListContainer({
367
+ children,
368
+ className
369
+ }) {
370
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("flex flex-col gap-4", className), children });
371
+ }
372
+ var Text = React6__namespace.forwardRef(
373
+ (_a, ref) => {
374
+ var _b = _a, { as: Component = "p", variantClass, className, children } = _b, props = __objRest(_b, ["as", "variantClass", "className", "children"]);
375
+ return React6__namespace.createElement(
376
+ Component,
377
+ __spreadValues({
378
+ ref,
379
+ className: tailwindMerge.twMerge("font-poppins", variantClass, className)
380
+ }, props),
381
+ children
382
+ );
383
+ }
384
+ );
385
+ Text.displayName = "Text";
386
+ var Text_default = Text;
387
+ var accentVariants = {
388
+ "accent-large": "text-[15px] leading-[140%] font-semibold",
389
+ "accent-medium": "text-[14px] leading-[140%] font-semibold",
390
+ "accent-small": "text-[12px] leading-[140%] font-semibold"
391
+ };
392
+ var TextAccent = React6__namespace.forwardRef(
393
+ (_a, ref) => {
394
+ var _b = _a, { variant = "accent-medium", as = "span" } = _b, props = __objRest(_b, ["variant", "as"]);
395
+ const variantClass = accentVariants[variant];
396
+ return /* @__PURE__ */ jsxRuntime.jsx(Text_default, __spreadValues({ ref, as, variantClass }, props));
397
+ }
398
+ );
399
+ TextAccent.displayName = "TextAccent";
400
+ var TextAccent_default = TextAccent;
401
+ var bodyVariants = {
402
+ "text-large": "text-[15px] leading-[140%] font-normal",
403
+ "text-medium": "text-[14px] leading-[140%] font-normal",
404
+ "text-small": "text-[12px] leading-[140%] font-normal"
405
+ };
406
+ var TextBody = React6__namespace.forwardRef(
407
+ (_a, ref) => {
408
+ var _b = _a, { variant = "text-medium", as = "p" } = _b, props = __objRest(_b, ["variant", "as"]);
409
+ const variantClass = bodyVariants[variant];
410
+ return /* @__PURE__ */ jsxRuntime.jsx(Text_default, __spreadValues({ ref, as, variantClass }, props));
411
+ }
412
+ );
413
+ TextBody.displayName = "TextBody";
414
+ var TextBody_default = TextBody;
415
+ var headingVariants = {
416
+ "h-large": "text-[56px] leading-[100%] tracking-[0] font-extrabold",
417
+ h1: "text-[40px] leading-[110%] font-extrabold",
418
+ h2: "text-[28px] leading-[130%] font-extrabold",
419
+ h3: "text-[22px] leading-[120%] font-extrabold",
420
+ h4: "text-[18px] leading-[120%] font-extrabold",
421
+ h5: "text-[16px] leading-[120%] font-bold"
422
+ };
423
+ var TextHeading = React6__namespace.forwardRef(
424
+ (_a, ref) => {
425
+ var _b = _a, { variant = "h2", as } = _b, props = __objRest(_b, ["variant", "as"]);
426
+ const variantClass = headingVariants[variant];
427
+ return /* @__PURE__ */ jsxRuntime.jsx(
428
+ Text_default,
429
+ __spreadValues({
430
+ ref,
431
+ as: variant === "h-large" ? "h1" : variant,
432
+ variantClass
433
+ }, props)
434
+ );
435
+ }
436
+ );
437
+ TextHeading.displayName = "TextHeading";
438
+ var TextHeading_default = TextHeading;
439
+ function Title(_a) {
440
+ var _b = _a, {
441
+ variant = "h1"
442
+ } = _b, props = __objRest(_b, [
443
+ "variant"
444
+ ]);
445
+ return /* @__PURE__ */ jsxRuntime.jsx(TextHeading_default, __spreadValues({ variant }, props));
446
+ }
447
+ function ConnectWalletList({
448
+ wallets,
449
+ className
450
+ }) {
451
+ const handleWalletClick = (wallet) => {
452
+ var _a;
453
+ (_a = wallet.onClick) == null ? void 0 : _a.call(wallet);
454
+ };
455
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("w-full", className), children: /* @__PURE__ */ jsxRuntime.jsx(WalletListContainer, { children: wallets.map((wallet) => /* @__PURE__ */ jsxRuntime.jsxs(ListItem, { onClick: () => handleWalletClick(wallet), children: [
456
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: typeof wallet.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
457
+ "img",
458
+ {
459
+ src: wallet.icon,
460
+ alt: wallet.name,
461
+ className: "w-10 h-10 rounded-full"
462
+ }
463
+ ) : wallet.icon }),
464
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemContent, { children: /* @__PURE__ */ jsxRuntime.jsx(Text_default, { children: wallet.name }) }),
465
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemRightSide, { children: /* @__PURE__ */ jsxRuntime.jsx(
466
+ "svg",
467
+ {
468
+ className: "flex-shrink-0 w-5 h-5 text-gray-400",
469
+ fill: "none",
470
+ viewBox: "0 0 24 24",
471
+ stroke: "currentColor",
472
+ children: /* @__PURE__ */ jsxRuntime.jsx(
473
+ "path",
474
+ {
475
+ strokeLinecap: "round",
476
+ strokeLinejoin: "round",
477
+ strokeWidth: 2,
478
+ d: "M9 5l7 7-7 7"
479
+ }
480
+ )
481
+ }
482
+ ) })
483
+ ] }, wallet.id)) }) });
484
+ }
485
+ function WalletItem({
486
+ id,
487
+ name,
488
+ icon,
489
+ onClick,
490
+ className
491
+ }) {
492
+ return /* @__PURE__ */ jsxRuntime.jsxs(
493
+ "button",
494
+ {
495
+ onClick,
496
+ className: tailwindMerge.twMerge(
497
+ "w-full flex items-center gap-4 p-5",
498
+ "bg-[#1E1E1E] rounded-2xl",
499
+ "transition-all duration-200",
500
+ "hover:bg-[#2C2C2C] active:scale-[0.98]",
501
+ "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50",
502
+ className
503
+ ),
504
+ children: [
505
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 w-12 h-12 rounded-full overflow-hidden bg-white flex items-center justify-center", children: typeof icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
506
+ "img",
507
+ {
508
+ src: icon,
509
+ alt: name,
510
+ className: "w-full h-full object-cover"
511
+ }
512
+ ) : icon }),
513
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-left text-[15px] md:text-[17px] font-medium text-white", children: name }),
514
+ /* @__PURE__ */ jsxRuntime.jsx(
515
+ "svg",
516
+ {
517
+ className: "flex-shrink-0 w-5 h-5 text-gray-400",
518
+ fill: "none",
519
+ viewBox: "0 0 24 24",
520
+ stroke: "currentColor",
521
+ children: /* @__PURE__ */ jsxRuntime.jsx(
522
+ "path",
523
+ {
524
+ strokeLinecap: "round",
525
+ strokeLinejoin: "round",
526
+ strokeWidth: 2,
527
+ d: "M9 5l7 7-7 7"
528
+ }
529
+ )
530
+ }
531
+ )
532
+ ]
533
+ },
534
+ id
535
+ );
536
+ }
537
+ var CURRENCY_CONFIG = {
538
+ symbols: {
539
+ USD: "$",
540
+ BRL: "R$",
541
+ EUR: "\u20AC",
542
+ BTC: "\u20BF",
543
+ ETH: "\u039E",
544
+ USDC: "$",
545
+ USDT: "$"
546
+ },
547
+ labels: {
548
+ USD: "USD",
549
+ BRL: "BRL",
550
+ EUR: "EUR",
551
+ BTC: "BTC",
552
+ ETH: "ETH",
553
+ USDC: "USDC",
554
+ USDT: "USDT"
555
+ }
556
+ };
557
+ var STYLE_CONFIG = {
558
+ alignment: {
559
+ left: "items-start",
560
+ center: "items-center",
561
+ right: "items-end"
562
+ },
563
+ size: {
564
+ sm: { primary: "text-3xl", secondary: "text-sm", gap: "gap-0.5" },
565
+ md: { primary: "text-5xl", secondary: "text-base", gap: "gap-1" },
566
+ lg: { primary: "text-6xl", secondary: "text-lg", gap: "gap-1" }
567
+ }
568
+ };
569
+ function Currency(props) {
570
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
571
+ const normalizedProps = "usdValue" in props ? {
572
+ amount: props.amount,
573
+ currency: "USD",
574
+ secondaryAmount: props.usdValue,
575
+ secondaryCurrency: void 0,
576
+ align: (_a = props.align) != null ? _a : "right",
577
+ size: (_b = props.size) != null ? _b : "lg",
578
+ showSymbol: false,
579
+ showLabel: false,
580
+ className: (_c = props.className) != null ? _c : ""
581
+ } : {
582
+ amount: props.amount,
583
+ currency: (_d = props.currency) != null ? _d : "USD",
584
+ secondaryAmount: props.secondaryAmount,
585
+ secondaryCurrency: props.secondaryCurrency,
586
+ align: (_e = props.align) != null ? _e : "right",
587
+ size: (_f = props.size) != null ? _f : "lg",
588
+ showSymbol: (_g = props.showSymbol) != null ? _g : true,
589
+ showLabel: (_h = props.showLabel) != null ? _h : false,
590
+ className: (_i = props.className) != null ? _i : ""
591
+ };
592
+ const {
593
+ amount,
594
+ currency,
595
+ secondaryAmount,
596
+ secondaryCurrency,
597
+ align,
598
+ size,
599
+ showSymbol,
600
+ showLabel,
601
+ className
602
+ } = normalizedProps;
603
+ const formatAmount = (value, curr, displaySymbol) => {
604
+ if (!displaySymbol && !showLabel) return value;
605
+ const symbol = displaySymbol ? CURRENCY_CONFIG.symbols[curr] : "";
606
+ const label = showLabel ? ` ${CURRENCY_CONFIG.labels[curr]}` : "";
607
+ if (["BTC", "ETH"].includes(curr) && !value.includes(".") && !value.includes(",")) {
608
+ return `${symbol}${value}${label}`;
609
+ }
610
+ return `${symbol} ${value}${label}`.trim();
611
+ };
612
+ return /* @__PURE__ */ jsxRuntime.jsxs(
613
+ "div",
614
+ {
615
+ className: tailwindMerge.twMerge(
616
+ "flex flex-col",
617
+ STYLE_CONFIG.alignment[align],
618
+ STYLE_CONFIG.size[size].gap,
619
+ className
620
+ ),
621
+ children: [
622
+ /* @__PURE__ */ jsxRuntime.jsx(
623
+ "div",
624
+ {
625
+ className: tailwindMerge.twMerge(
626
+ "font-bold text-text-primary dark:text-text-primary-dark font-poppins",
627
+ STYLE_CONFIG.size[size].primary
628
+ ),
629
+ children: formatAmount(amount, currency, showSymbol)
630
+ }
631
+ ),
632
+ secondaryAmount && /* @__PURE__ */ jsxRuntime.jsx(
633
+ "div",
634
+ {
635
+ className: tailwindMerge.twMerge(
636
+ "text-text-secondary dark:text-text-secondary-dark font-poppins",
637
+ STYLE_CONFIG.size[size].secondary
638
+ ),
639
+ children: secondaryCurrency ? formatAmount(secondaryAmount, secondaryCurrency, true) : secondaryAmount
640
+ }
641
+ )
642
+ ]
643
+ }
644
+ );
645
+ }
646
+ var TabsContext = React6__namespace.createContext(
647
+ void 0
648
+ );
649
+ var useTabs = () => {
650
+ const ctx = React6__namespace.useContext(TabsContext);
651
+ if (!ctx) {
652
+ throw new Error("Tabs compound components must be used within <Tabs />");
653
+ }
654
+ return ctx;
655
+ };
656
+ var Tabs = React6__namespace.forwardRef(
657
+ (_a, ref) => {
658
+ var _b = _a, {
659
+ value: controlledValue,
660
+ defaultValue = "",
661
+ onValueChange,
662
+ variant = "secondary",
663
+ className,
664
+ children
665
+ } = _b, props = __objRest(_b, [
666
+ "value",
667
+ "defaultValue",
668
+ "onValueChange",
669
+ "variant",
670
+ "className",
671
+ "children"
672
+ ]);
673
+ const [internal, setInternal] = React6__namespace.useState(defaultValue);
674
+ const isControlled = controlledValue !== void 0;
675
+ const activeValue = isControlled ? controlledValue : internal;
676
+ const handleChange = (v) => {
677
+ if (!isControlled) setInternal(v);
678
+ onValueChange == null ? void 0 : onValueChange(v);
679
+ };
680
+ return /* @__PURE__ */ jsxRuntime.jsx(
681
+ TabsContext.Provider,
682
+ {
683
+ value: {
684
+ value: activeValue,
685
+ onValueChange: handleChange,
686
+ variant
687
+ },
688
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({ ref, className: tailwindMerge.twMerge("w-full", className) }, props), { children }))
689
+ }
690
+ );
691
+ }
692
+ );
693
+ Tabs.displayName = "Tabs";
694
+ var TabsList = React6__namespace.forwardRef(
695
+ (_a, ref) => {
696
+ var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
697
+ const { variant } = useTabs();
698
+ if (variant === "header") {
699
+ return /* @__PURE__ */ jsxRuntime.jsx(
700
+ "div",
701
+ __spreadProps(__spreadValues({
702
+ ref,
703
+ role: "tablist",
704
+ className: tailwindMerge.twMerge(
705
+ "relative w-full flex items-center justify-between pt-2",
706
+ className
707
+ ),
708
+ style: {
709
+ paddingLeft: "var(--spacing-md, 16px)",
710
+ paddingRight: "var(--spacing-md, 16px)",
711
+ backgroundColor: "var(--color-bg-default, transparent)"
712
+ }
713
+ }, props), {
714
+ children
715
+ })
716
+ );
717
+ }
718
+ return /* @__PURE__ */ jsxRuntime.jsx(
719
+ "div",
720
+ __spreadProps(__spreadValues({
721
+ ref,
722
+ role: "tablist",
723
+ className: tailwindMerge.twMerge(
724
+ "relative w-full flex items-center bg-transparent border-b border-border-default dark:border-border-default-dark",
725
+ variant === "primary" ? "h-[72px] gap-6" : "h-12",
726
+ className
727
+ )
728
+ }, props), {
729
+ children
730
+ })
731
+ );
732
+ }
733
+ );
734
+ TabsList.displayName = "TabsList";
735
+ var TabsTrigger = React6__namespace.forwardRef(
736
+ (_a, ref) => {
737
+ var _b = _a, {
738
+ value,
739
+ className,
740
+ children,
741
+ style
742
+ } = _b, props = __objRest(_b, [
743
+ "value",
744
+ "className",
745
+ "children",
746
+ "style"
747
+ ]);
748
+ const { value: activeValue, onValueChange, variant } = useTabs();
749
+ const isActive = activeValue === value;
750
+ const headerStyle = variant === "header" ? __spreadValues({
751
+ color: isActive ? "var(--color-brand-primary)" : "var(--color-text-secondary)"
752
+ }, style) : style;
753
+ return /* @__PURE__ */ jsxRuntime.jsxs(
754
+ "button",
755
+ __spreadProps(__spreadValues({
756
+ ref,
757
+ role: "tab",
758
+ "aria-selected": isActive,
759
+ onClick: () => onValueChange(value),
760
+ className: tailwindMerge.twMerge(
761
+ "relative inline-flex flex-col items-center justify-center whitespace-nowrap font-poppins transition-colors cursor-pointer disabled:pointer-events-none disabled:opacity-50 outline-none",
762
+ variant === "header" ? "flex-1 text-sm font-semibold py-3" : variant === "primary" ? "h-[72px] text-base font-medium px-0 pb-3 pt-2 flex-none" : "h-12 text-[12px] font-semibold px-4 flex-none",
763
+ variant !== "header" && (isActive ? "text-brand-primary" : "text-text-secondary dark:text-text-secondary-dark hover:text-text-primary dark:hover:text-text-primary-dark"),
764
+ className
765
+ ),
766
+ style: headerStyle
767
+ }, props), {
768
+ children: [
769
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
770
+ isActive && variant === "header" && /* @__PURE__ */ jsxRuntime.jsx(
771
+ framerMotion.motion.span,
772
+ {
773
+ layoutId: "header-tab-indicator",
774
+ className: "absolute rounded-t-full",
775
+ style: {
776
+ bottom: 0,
777
+ left: 0,
778
+ right: 0,
779
+ marginLeft: "auto",
780
+ marginRight: "auto",
781
+ width: "3.5rem",
782
+ height: "3px",
783
+ backgroundColor: "var(--color-brand-primary)"
784
+ },
785
+ transition: { type: "spring", bounce: 0.2, duration: 0.6 }
786
+ }
787
+ ),
788
+ isActive && variant !== "header" && /* @__PURE__ */ jsxRuntime.jsx(
789
+ framerMotion.motion.span,
790
+ {
791
+ layoutId: "tab-indicator",
792
+ className: "absolute bottom-0 left-0 right-0 h-0.5 bg-brand-primary z-10",
793
+ transition: { type: "spring", bounce: 0.2, duration: 0.6 }
794
+ }
795
+ )
796
+ ]
797
+ })
798
+ );
799
+ }
800
+ );
801
+ TabsTrigger.displayName = "TabsTrigger";
802
+ var TabsContent = React6__namespace.forwardRef(
803
+ (_a, ref) => {
804
+ var _b = _a, { value, className, children } = _b, props = __objRest(_b, ["value", "className", "children"]);
805
+ const { value: activeValue, variant } = useTabs();
806
+ if (activeValue !== value) return null;
807
+ return /* @__PURE__ */ jsxRuntime.jsx(
808
+ "div",
809
+ __spreadProps(__spreadValues({
810
+ ref,
811
+ role: "tabpanel",
812
+ className: tailwindMerge.twMerge(
813
+ "focus-visible:outline-none",
814
+ variant === "primary" || variant === "header" ? "mt-0" : "mt-6",
815
+ className
816
+ )
817
+ }, props), {
818
+ children
819
+ })
820
+ );
821
+ }
822
+ );
823
+ TabsContent.displayName = "TabsContent";
824
+ var ChevronDownIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
825
+ "svg",
826
+ {
827
+ className,
828
+ viewBox: "0 0 20 20",
829
+ fill: "currentColor",
830
+ "aria-hidden": "true",
831
+ children: /* @__PURE__ */ jsxRuntime.jsx(
832
+ "path",
833
+ {
834
+ fillRule: "evenodd",
835
+ d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",
836
+ clipRule: "evenodd"
837
+ }
838
+ )
839
+ }
840
+ );
841
+ var Select = ({
842
+ value,
843
+ onValueChange,
844
+ disabled = false,
845
+ children,
846
+ className
847
+ }) => {
848
+ const [isOpen, setIsOpen] = React6__namespace.useState(false);
849
+ const [highlightedIndex, setHighlightedIndex] = React6__namespace.useState(-1);
850
+ const containerRef = React6__namespace.useRef(null);
851
+ const handleToggle = React6__namespace.useCallback(() => {
852
+ if (!disabled) {
853
+ setIsOpen((prev) => !prev);
854
+ if (!isOpen) setHighlightedIndex(0);
855
+ }
856
+ }, [disabled, isOpen]);
857
+ const handleSelect = React6__namespace.useCallback(
858
+ (newValue) => {
859
+ onValueChange(newValue);
860
+ setIsOpen(false);
861
+ setHighlightedIndex(-1);
862
+ },
863
+ [onValueChange]
864
+ );
865
+ React6__namespace.useEffect(() => {
866
+ const handleClickOutside = (event) => {
867
+ if (containerRef.current && !containerRef.current.contains(event.target)) {
868
+ setIsOpen(false);
869
+ setHighlightedIndex(-1);
870
+ }
871
+ };
872
+ if (isOpen) {
873
+ document.addEventListener("mousedown", handleClickOutside);
874
+ return () => document.removeEventListener("mousedown", handleClickOutside);
875
+ }
876
+ }, [isOpen]);
877
+ React6__namespace.useEffect(() => {
878
+ const handleEscape = (event) => {
879
+ if (event.key === "Escape" && isOpen) {
880
+ setIsOpen(false);
881
+ setHighlightedIndex(-1);
882
+ }
883
+ };
884
+ document.addEventListener("keydown", handleEscape);
885
+ return () => document.removeEventListener("keydown", handleEscape);
886
+ }, [isOpen]);
887
+ const enhancedChildren = React6__namespace.Children.map(children, (child) => {
888
+ if (!React6__namespace.isValidElement(child)) return child;
889
+ if (child.type === SelectTrigger) {
890
+ return React6__namespace.cloneElement(child, {
891
+ _isOpen: isOpen,
892
+ _disabled: disabled,
893
+ _onToggle: handleToggle
894
+ });
895
+ }
896
+ if (child.type === SelectContent) {
897
+ return React6__namespace.cloneElement(child, {
898
+ _isOpen: isOpen,
899
+ _value: value,
900
+ _onSelect: handleSelect,
901
+ _highlightedIndex: highlightedIndex,
902
+ _setHighlightedIndex: setHighlightedIndex
903
+ });
904
+ }
905
+ return child;
906
+ });
907
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className: tailwindMerge.twMerge("relative", className), children: enhancedChildren });
908
+ };
909
+ Select.displayName = "Select";
910
+ var SelectTrigger = React6__namespace.forwardRef(
911
+ ({
912
+ placeholder = "Select...",
913
+ className,
914
+ children,
915
+ _isOpen,
916
+ _disabled,
917
+ _onToggle
918
+ }, ref) => {
919
+ const hasChildren = React6__namespace.Children.count(children) > 0;
920
+ return /* @__PURE__ */ jsxRuntime.jsxs(
921
+ "button",
922
+ {
923
+ ref,
924
+ type: "button",
925
+ onClick: _onToggle,
926
+ disabled: _disabled,
927
+ "aria-haspopup": "listbox",
928
+ "aria-expanded": _isOpen,
929
+ className: tailwindMerge.twMerge(
930
+ "w-full flex items-center justify-between gap-2",
931
+ "bg-[var(--color-bg-subtle,#1a1a1a)] border border-[var(--color-border-default,#333)] rounded px-3 py-1.5",
932
+ "text-sm text-[var(--color-text-primary,#fff)] text-left",
933
+ "transition-colors cursor-pointer",
934
+ "hover:border-[var(--color-border-strong,#555)]",
935
+ "focus:outline-none focus:ring-2 focus:ring-[var(--color-brand-primary,#7C3AED)]/50 focus:border-[var(--color-brand-primary,#7C3AED)]",
936
+ _disabled && "opacity-50 cursor-not-allowed",
937
+ className
938
+ ),
939
+ children: [
940
+ /* @__PURE__ */ jsxRuntime.jsx(
941
+ "span",
942
+ {
943
+ className: !hasChildren ? "text-[var(--color-text-tertiary,#888)]" : void 0,
944
+ children: hasChildren ? children : placeholder
945
+ }
946
+ ),
947
+ /* @__PURE__ */ jsxRuntime.jsx(
948
+ ChevronDownIcon,
949
+ {
950
+ className: tailwindMerge.twMerge(
951
+ "w-4 h-4 text-[var(--color-text-secondary,#999)] transition-transform",
952
+ _isOpen && "rotate-180"
953
+ )
954
+ }
955
+ )
956
+ ]
957
+ }
958
+ );
959
+ }
960
+ );
961
+ SelectTrigger.displayName = "SelectTrigger";
962
+ var SelectContent = React6__namespace.forwardRef(
963
+ ({
964
+ className,
965
+ children,
966
+ _isOpen,
967
+ _value,
968
+ _onSelect,
969
+ _highlightedIndex,
970
+ _setHighlightedIndex
971
+ }, ref) => {
972
+ const listRef = React6__namespace.useRef(null);
973
+ const mergedRef = React6__namespace.useCallback(
974
+ (node) => {
975
+ if (typeof ref === "function") {
976
+ ref(node);
977
+ } else if (ref) {
978
+ ref.current = node;
979
+ }
980
+ listRef.current = node;
981
+ },
982
+ [ref]
983
+ );
984
+ React6__namespace.useEffect(() => {
985
+ if (_isOpen && _highlightedIndex !== void 0 && _highlightedIndex >= 0 && listRef.current) {
986
+ const highlightedElement = listRef.current.children[_highlightedIndex];
987
+ if (highlightedElement) {
988
+ highlightedElement.scrollIntoView({ block: "nearest" });
989
+ }
990
+ }
991
+ }, [_isOpen, _highlightedIndex]);
992
+ let itemIndex = 0;
993
+ const enhancedChildren = React6__namespace.Children.map(children, (child) => {
994
+ if (!React6__namespace.isValidElement(child)) return child;
995
+ if (child.type === SelectItem) {
996
+ const currentIndex = itemIndex++;
997
+ const itemProps = child.props;
998
+ return React6__namespace.cloneElement(child, {
999
+ _index: currentIndex,
1000
+ _isSelected: _value === itemProps.value,
1001
+ _isHighlighted: _highlightedIndex === currentIndex,
1002
+ _onSelect,
1003
+ _onHighlight: _setHighlightedIndex
1004
+ });
1005
+ }
1006
+ return child;
1007
+ });
1008
+ const contentVariants = {
1009
+ hidden: { opacity: 0, y: -8 },
1010
+ visible: {
1011
+ opacity: 1,
1012
+ y: 0,
1013
+ transition: { type: "spring", damping: 25, stiffness: 400 }
1014
+ },
1015
+ exit: { opacity: 0, y: -8, transition: { duration: 0.1 } }
1016
+ };
1017
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: _isOpen && /* @__PURE__ */ jsxRuntime.jsx(
1018
+ framerMotion.motion.ul,
1019
+ {
1020
+ ref: mergedRef,
1021
+ role: "listbox",
1022
+ variants: contentVariants,
1023
+ initial: "hidden",
1024
+ animate: "visible",
1025
+ exit: "exit",
1026
+ className: tailwindMerge.twMerge(
1027
+ "absolute z-50 w-full mt-1",
1028
+ "bg-[var(--color-bg-raised,#1f1f1f)] border border-[var(--color-border-default,#333)] rounded shadow-lg",
1029
+ "max-h-60 overflow-auto",
1030
+ "py-1",
1031
+ className
1032
+ ),
1033
+ children: enhancedChildren
1034
+ }
1035
+ ) });
1036
+ }
1037
+ );
1038
+ SelectContent.displayName = "SelectContent";
1039
+ var SelectItem = React6__namespace.forwardRef(
1040
+ ({
1041
+ value,
1042
+ disabled = false,
1043
+ className,
1044
+ children,
1045
+ _index,
1046
+ _isSelected,
1047
+ _isHighlighted,
1048
+ _onSelect,
1049
+ _onHighlight
1050
+ }, ref) => {
1051
+ const handleClick = () => {
1052
+ if (!disabled && _onSelect) {
1053
+ _onSelect(value);
1054
+ }
1055
+ };
1056
+ const handleMouseEnter = () => {
1057
+ if (!disabled && _onHighlight && _index !== void 0) {
1058
+ _onHighlight(_index);
1059
+ }
1060
+ };
1061
+ return /* @__PURE__ */ jsxRuntime.jsx(
1062
+ "li",
1063
+ {
1064
+ ref,
1065
+ role: "option",
1066
+ "aria-selected": _isSelected,
1067
+ "aria-disabled": disabled,
1068
+ onClick: handleClick,
1069
+ onMouseEnter: handleMouseEnter,
1070
+ className: tailwindMerge.twMerge(
1071
+ "px-3 py-2 text-sm cursor-pointer transition-colors",
1072
+ "text-[var(--color-text-primary,#fff)]",
1073
+ _isSelected && "text-[var(--color-text-highlight,#7C3AED)]",
1074
+ _isHighlighted && "bg-[var(--color-bg-muted,#2a2a2a)]",
1075
+ disabled && "opacity-50 cursor-not-allowed",
1076
+ className
1077
+ ),
1078
+ children
1079
+ }
1080
+ );
1081
+ }
1082
+ );
1083
+ SelectItem.displayName = "SelectItem";
1084
+ var Skeleton = (_a) => {
1085
+ var _b = _a, {
1086
+ width = "100%",
1087
+ height = "1rem",
1088
+ variant = "text",
1089
+ shimmer = true,
1090
+ className,
1091
+ style
1092
+ } = _b, props = __objRest(_b, [
1093
+ "width",
1094
+ "height",
1095
+ "variant",
1096
+ "shimmer",
1097
+ "className",
1098
+ "style"
1099
+ ]);
1100
+ const defaultGradient = "linear-gradient(25deg, #2C2C2C 0%, #2C2C2C 60%, #121212 100%)";
1101
+ return /* @__PURE__ */ jsxRuntime.jsx(
1102
+ "div",
1103
+ __spreadProps(__spreadValues({
1104
+ className: tailwindMerge.twMerge(
1105
+ "relative overflow-hidden animate-fade-in",
1106
+ variant === "circle" ? "rounded-full" : "rounded",
1107
+ className
1108
+ ),
1109
+ style: __spreadValues({
1110
+ width: typeof width === "number" ? `${width}px` : width,
1111
+ height: typeof height === "number" ? `${height}px` : height,
1112
+ background: defaultGradient
1113
+ }, style)
1114
+ }, props), {
1115
+ children: shimmer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 animate-shimmer bg-gradient-to-r from-transparent via-white/20 to-transparent dark:via-gray-600/30" })
1116
+ })
1117
+ );
1118
+ };
1119
+ Skeleton.displayName = "Skeleton";
1120
+ var variantConfig = {
1121
+ info: { color: "#1890FF", icon: md.MdInfoOutline },
1122
+ warning: { color: "#F6A700", icon: md.MdWarningAmber },
1123
+ error: { color: "#FF4D4F", icon: md.MdErrorOutline },
1124
+ success: { color: "#2BA176", icon: md.MdCheckCircleOutline }
1125
+ };
1126
+ var positionStyles = {
1127
+ "top-right": "top-4 right-4",
1128
+ "top-left": "top-4 left-4",
1129
+ "top-center": "top-4 left-1/2 -translate-x-1/2",
1130
+ "bottom-right": "bottom-4 right-4",
1131
+ "bottom-left": "bottom-4 left-4",
1132
+ "bottom-center": "bottom-4 left-1/2 -translate-x-1/2"
1133
+ };
1134
+ var BannerNotification = (_a) => {
1135
+ var _b = _a, {
1136
+ type = "inline",
1137
+ variant = "info",
1138
+ title,
1139
+ message,
1140
+ position = "top-right",
1141
+ autoHideDuration = 5e3,
1142
+ show = true,
1143
+ onClose,
1144
+ className
1145
+ } = _b, props = __objRest(_b, [
1146
+ "type",
1147
+ "variant",
1148
+ "title",
1149
+ "message",
1150
+ "position",
1151
+ "autoHideDuration",
1152
+ "show",
1153
+ "onClose",
1154
+ "className"
1155
+ ]);
1156
+ const [isExiting, setIsExiting] = React6__namespace.useState(false);
1157
+ const timerRef = React6__namespace.useRef(null);
1158
+ const config = variantConfig[variant];
1159
+ const IconComponent = config.icon;
1160
+ const handleClose = () => {
1161
+ setIsExiting(true);
1162
+ setTimeout(() => {
1163
+ if (timerRef.current) {
1164
+ clearTimeout(timerRef.current);
1165
+ timerRef.current = null;
1166
+ }
1167
+ onClose == null ? void 0 : onClose();
1168
+ }, 300);
1169
+ };
1170
+ if (type === "toast" && show && autoHideDuration > 0 && !timerRef.current && !isExiting) {
1171
+ timerRef.current = setTimeout(() => {
1172
+ handleClose();
1173
+ }, autoHideDuration);
1174
+ }
1175
+ React6__namespace.useEffect(() => {
1176
+ return () => {
1177
+ if (timerRef.current) {
1178
+ clearTimeout(timerRef.current);
1179
+ timerRef.current = null;
1180
+ }
1181
+ };
1182
+ }, []);
1183
+ if (!show) return null;
1184
+ const backgroundColor = type === "inline" ? `${config.color}33` : config.color;
1185
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1186
+ "div",
1187
+ __spreadProps(__spreadValues({
1188
+ className: tailwindMerge.twMerge(
1189
+ "flex items-start gap-3 p-3 rounded border transition-all duration-300",
1190
+ isExiting && "opacity-0 -translate-y-2",
1191
+ className,
1192
+ type === "toast" && "fixed z-50 w-[clamp(18rem,40vw,30rem)] shadow-lg",
1193
+ type === "toast" && positionStyles[position]
1194
+ ),
1195
+ style: {
1196
+ backgroundColor,
1197
+ borderColor: config.color
1198
+ },
1199
+ role: "alert"
1200
+ }, props), {
1201
+ children: [
1202
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 text-2xl", children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {}) }),
1203
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
1204
+ title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-semibold text-sm mb-1", children: title }),
1205
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm", children: message })
1206
+ ] }),
1207
+ /* @__PURE__ */ jsxRuntime.jsx(
1208
+ "button",
1209
+ {
1210
+ onClick: handleClose,
1211
+ className: "flex-shrink-0 text-xl transition-opacity hover:opacity-70 cursor-pointer",
1212
+ "aria-label": "Close notification",
1213
+ children: /* @__PURE__ */ jsxRuntime.jsx(md.MdClose, {})
1214
+ }
1215
+ )
1216
+ ]
1217
+ })
1218
+ );
1219
+ };
1220
+ BannerNotification.displayName = "BannerNotification";
1221
+ var AddressDisplay = ({
1222
+ address,
1223
+ onCopy,
1224
+ className = "",
1225
+ textClassName = "",
1226
+ showCopyButton = true
1227
+ }) => {
1228
+ const [copied, setCopied] = React6__namespace.useState(false);
1229
+ const handleCopy = async () => {
1230
+ try {
1231
+ await navigator.clipboard.writeText(address);
1232
+ setCopied(true);
1233
+ onCopy == null ? void 0 : onCopy(address);
1234
+ setTimeout(() => setCopied(false), 2e3);
1235
+ } catch (err) {
1236
+ console.error("Failed to copy address:", err);
1237
+ }
1238
+ };
1239
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1240
+ "div",
1241
+ {
1242
+ className: tailwindMerge.twMerge(
1243
+ "bg-[#121212] rounded p-3 flex items-center justify-between gap-2 border border-gray-700",
1244
+ className
1245
+ ),
1246
+ children: [
1247
+ /* @__PURE__ */ jsxRuntime.jsx(
1248
+ TextBody_default,
1249
+ {
1250
+ className: tailwindMerge.twMerge(
1251
+ "block w-full whitespace-nowrap overflow-hidden",
1252
+ textClassName
1253
+ ),
1254
+ children: address
1255
+ }
1256
+ ),
1257
+ showCopyButton && /* @__PURE__ */ jsxRuntime.jsx(
1258
+ "button",
1259
+ {
1260
+ onClick: handleCopy,
1261
+ className: "text-gray-400 hover:text-white transition-colors flex-shrink-0 cursor-pointer",
1262
+ "aria-label": "Copy address",
1263
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(
1264
+ "svg",
1265
+ {
1266
+ className: "w-5 h-5 text-green-500",
1267
+ fill: "none",
1268
+ stroke: "currentColor",
1269
+ viewBox: "0 0 24 24",
1270
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1271
+ "path",
1272
+ {
1273
+ strokeLinecap: "round",
1274
+ strokeLinejoin: "round",
1275
+ strokeWidth: 2,
1276
+ d: "M5 13l4 4L19 7"
1277
+ }
1278
+ )
1279
+ }
1280
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1281
+ "svg",
1282
+ {
1283
+ className: "w-5 h-5",
1284
+ fill: "none",
1285
+ stroke: "currentColor",
1286
+ viewBox: "0 0 24 24",
1287
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1288
+ "path",
1289
+ {
1290
+ strokeLinecap: "round",
1291
+ strokeLinejoin: "round",
1292
+ strokeWidth: 2,
1293
+ d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"
1294
+ }
1295
+ )
1296
+ }
1297
+ )
1298
+ }
1299
+ )
1300
+ ]
1301
+ }
1302
+ );
1303
+ };
1304
+ AddressDisplay.displayName = "AddressDisplay";
1305
+ var SummaryDetails = ({
1306
+ title,
1307
+ items,
1308
+ defaultOpen = false,
1309
+ className = "",
1310
+ summaryClassName = "",
1311
+ contentClassName = "",
1312
+ showDividers = true
1313
+ }) => {
1314
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1315
+ "details",
1316
+ {
1317
+ className: tailwindMerge.twMerge("bg-[#1A1A1A] rounded p-4 group", className),
1318
+ open: defaultOpen,
1319
+ children: [
1320
+ /* @__PURE__ */ jsxRuntime.jsx("summary", { className: tailwindMerge.twMerge("cursor-pointer block ", summaryClassName), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
1321
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { className: "text-white font-medium", children: title }),
1322
+ /* @__PURE__ */ jsxRuntime.jsx(
1323
+ "svg",
1324
+ {
1325
+ className: "w-5 h-5 text-gray-400 transition-transform duration-300 group-open:rotate-180",
1326
+ fill: "none",
1327
+ stroke: "currentColor",
1328
+ viewBox: "0 0 24 24",
1329
+ "aria-hidden": "true",
1330
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1331
+ "path",
1332
+ {
1333
+ strokeLinecap: "round",
1334
+ strokeLinejoin: "round",
1335
+ strokeWidth: 2,
1336
+ d: "M5 9l7 7 7-7"
1337
+ }
1338
+ )
1339
+ }
1340
+ )
1341
+ ] }) }),
1342
+ /* @__PURE__ */ jsxRuntime.jsx(
1343
+ "div",
1344
+ {
1345
+ className: tailwindMerge.twMerge(
1346
+ "mt-4",
1347
+ showDividers && "divide-y divide-[#2A2A2A]",
1348
+ contentClassName
1349
+ ),
1350
+ children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between py-2", children: [
1351
+ /* @__PURE__ */ jsxRuntime.jsx(
1352
+ TextBody_default,
1353
+ {
1354
+ variant: "text-small",
1355
+ className: tailwindMerge.twMerge("text-text-tertiary dark:text-text-tertiary-dark", item.labelClassName),
1356
+ children: item.label
1357
+ }
1358
+ ),
1359
+ typeof item.value === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1360
+ TextBody_default,
1361
+ {
1362
+ variant: "text-small",
1363
+ className: tailwindMerge.twMerge("text-text-primary dark:text-text-primary-dark font-medium", item.valueClassName),
1364
+ children: item.value
1365
+ }
1366
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: item.valueClassName, children: item.value })
1367
+ ] }, index))
1368
+ }
1369
+ )
1370
+ ]
1371
+ }
1372
+ );
1373
+ };
1374
+ var ActionSheet = ({
1375
+ id,
1376
+ currentActionSheetId,
1377
+ isOpen,
1378
+ onClose,
1379
+ children,
1380
+ className = "",
1381
+ contentClassName = "",
1382
+ position = "bottom",
1383
+ height = "auto",
1384
+ closeOnBackdropClick = true
1385
+ }) => {
1386
+ const isThisSheetActive = isOpen && currentActionSheetId === id;
1387
+ React6__namespace.useEffect(() => {
1388
+ if (isThisSheetActive) {
1389
+ document.body.style.overflow = "hidden";
1390
+ } else {
1391
+ document.body.style.overflow = "";
1392
+ }
1393
+ return () => {
1394
+ document.body.style.overflow = "";
1395
+ };
1396
+ }, [isThisSheetActive]);
1397
+ React6__namespace.useEffect(() => {
1398
+ if (!isThisSheetActive) return;
1399
+ const handleEscape = (e) => {
1400
+ if (e.key === "Escape") {
1401
+ onClose();
1402
+ }
1403
+ };
1404
+ document.addEventListener("keydown", handleEscape);
1405
+ return () => document.removeEventListener("keydown", handleEscape);
1406
+ }, [isThisSheetActive, onClose]);
1407
+ const handleBackdropClick = (e) => {
1408
+ if (closeOnBackdropClick && e.target === e.currentTarget) {
1409
+ onClose();
1410
+ }
1411
+ };
1412
+ const backdropVariants = {
1413
+ hidden: { opacity: 0 },
1414
+ visible: { opacity: 1 },
1415
+ exit: { opacity: 0 }
1416
+ };
1417
+ const sheetVariants = {
1418
+ hidden: position === "bottom" ? { y: "100%" } : { opacity: 0, scale: 0.95 },
1419
+ visible: position === "bottom" ? {
1420
+ y: "0%",
1421
+ transition: {
1422
+ type: "spring",
1423
+ damping: 25,
1424
+ stiffness: 300
1425
+ }
1426
+ } : {
1427
+ opacity: 1,
1428
+ scale: 1,
1429
+ transition: {
1430
+ type: "spring",
1431
+ damping: 25,
1432
+ stiffness: 300
1433
+ }
1434
+ },
1435
+ exit: position === "bottom" ? {
1436
+ y: "100%",
1437
+ transition: {
1438
+ type: "spring",
1439
+ damping: 25,
1440
+ stiffness: 300
1441
+ }
1442
+ } : {
1443
+ opacity: 0,
1444
+ scale: 0.95,
1445
+ transition: {
1446
+ type: "spring",
1447
+ damping: 25,
1448
+ stiffness: 300
1449
+ }
1450
+ }
1451
+ };
1452
+ const getHeightClass = () => {
1453
+ switch (height) {
1454
+ case "full":
1455
+ return "h-full";
1456
+ case "half":
1457
+ return "h-[50vh]";
1458
+ case "auto":
1459
+ default:
1460
+ return "h-auto";
1461
+ }
1462
+ };
1463
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isThisSheetActive && /* @__PURE__ */ jsxRuntime.jsxs(
1464
+ framerMotion.motion.div,
1465
+ {
1466
+ className: tailwindMerge.twMerge(
1467
+ "fixed inset-0 z-50 flex justify-center",
1468
+ position === "bottom" ? "items-end" : "items-center",
1469
+ className
1470
+ ),
1471
+ role: "dialog",
1472
+ "aria-modal": "true",
1473
+ onClick: handleBackdropClick,
1474
+ variants: backdropVariants,
1475
+ initial: "hidden",
1476
+ animate: "visible",
1477
+ exit: "exit",
1478
+ transition: { duration: 0.2 },
1479
+ children: [
1480
+ /* @__PURE__ */ jsxRuntime.jsx(
1481
+ "div",
1482
+ {
1483
+ className: "absolute inset-0 bg-black/50 backdrop-blur-sm",
1484
+ "aria-hidden": "true"
1485
+ }
1486
+ ),
1487
+ /* @__PURE__ */ jsxRuntime.jsx(
1488
+ framerMotion.motion.div,
1489
+ {
1490
+ className: tailwindMerge.twMerge(
1491
+ "relative w-full bg-[var(--sheet-bg,#0A0A0A)] shadow-2xl overflow-hidden",
1492
+ position === "bottom" ? "max-w-full rounded-t-[32px]" : "max-w-lg rounded-2xl mx-4",
1493
+ getHeightClass(),
1494
+ contentClassName
1495
+ ),
1496
+ variants: sheetVariants,
1497
+ initial: "hidden",
1498
+ animate: "visible",
1499
+ exit: "exit",
1500
+ children
1501
+ }
1502
+ )
1503
+ ]
1504
+ }
1505
+ ) });
1506
+ };
1507
+
1508
+ // src/stories/providers/types.ts
1509
+ var defaultThemeColors = {
1510
+ // Brand
1511
+ brandPrimary: "#405EFF",
1512
+ brandSecondary: "#A9ABF7",
1513
+ // Backgrounds
1514
+ bgDefault: "#FFFFFF",
1515
+ bgSubtle: "#F8F9FA",
1516
+ bgMuted: "#E3E4E8",
1517
+ // Text
1518
+ textPrimary: "#252050",
1519
+ textSecondary: "#5C5F66",
1520
+ textDisabled: "#C6C8CC",
1521
+ textInverse: "#FFFFFF",
1522
+ // States
1523
+ stateSuccess: "#2BA176",
1524
+ stateError: "#FF4D4F",
1525
+ stateWarning: "#F6A700"
1526
+ };
1527
+ var darkThemeColors = {
1528
+ // Brand
1529
+ brandPrimary: "#405EFF",
1530
+ brandSecondary: "#A9ABF7",
1531
+ // Backgrounds
1532
+ bgDefault: "#121212",
1533
+ bgSubtle: "#1E1E1E",
1534
+ bgMuted: "#2C2C2C",
1535
+ // Text
1536
+ textPrimary: "#FFFFFF",
1537
+ textSecondary: "#E3E4E8",
1538
+ textDisabled: "#898D95",
1539
+ textInverse: "#252050",
1540
+ // States
1541
+ stateSuccess: "#2BA176",
1542
+ stateError: "#FF4D4F",
1543
+ stateWarning: "#F6A700"
1544
+ };
1545
+ var cryptocontrolThemeColors = {
1546
+ // Brand - green primary for cryptocontrol
1547
+ brandPrimary: "#1FC16B",
1548
+ brandSecondary: "#A9ABF7",
1549
+ // Backgrounds (same as dark)
1550
+ bgDefault: "#121212",
1551
+ bgSubtle: "#1E1E1E",
1552
+ bgMuted: "#2C2C2C",
1553
+ // Text (same as dark)
1554
+ textPrimary: "#FFFFFF",
1555
+ textSecondary: "#E3E4E8",
1556
+ textDisabled: "#898D95",
1557
+ textInverse: "#252050",
1558
+ // States
1559
+ stateSuccess: "#2BA176",
1560
+ stateError: "#FF4D4F",
1561
+ stateWarning: "#F6A700"
1562
+ };
1563
+ function themeToCSS(theme) {
1564
+ if (!(theme == null ? void 0 : theme.colors)) return {};
1565
+ const vars = {};
1566
+ const colors = theme.colors;
1567
+ if (colors.brandPrimary) vars["--deframe-brand-primary"] = colors.brandPrimary;
1568
+ if (colors.brandSecondary) vars["--deframe-brand-secondary"] = colors.brandSecondary;
1569
+ if (colors.bgDefault) vars["--deframe-bg-default"] = colors.bgDefault;
1570
+ if (colors.bgSubtle) vars["--deframe-bg-subtle"] = colors.bgSubtle;
1571
+ if (colors.bgMuted) vars["--deframe-bg-muted"] = colors.bgMuted;
1572
+ if (colors.textPrimary) vars["--deframe-text-primary"] = colors.textPrimary;
1573
+ if (colors.textSecondary) vars["--deframe-text-secondary"] = colors.textSecondary;
1574
+ if (colors.textDisabled) vars["--deframe-text-disabled"] = colors.textDisabled;
1575
+ if (colors.textInverse) vars["--deframe-text-inverse"] = colors.textInverse;
1576
+ if (colors.stateSuccess) vars["--deframe-state-success"] = colors.stateSuccess;
1577
+ if (colors.stateError) vars["--deframe-state-error"] = colors.stateError;
1578
+ if (colors.stateWarning) vars["--deframe-state-warning"] = colors.stateWarning;
1579
+ return vars;
1580
+ }
1581
+ function getSystemColorMode() {
1582
+ if (typeof window === "undefined" || !window.matchMedia) return "light";
1583
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1584
+ }
1585
+ function resolveThemeConfig(config, systemMode) {
1586
+ var _a, _b, _c, _d, _e, _f;
1587
+ const mode = (config == null ? void 0 : config.mode) === "auto" ? systemMode : (_a = config == null ? void 0 : config.mode) != null ? _a : "light";
1588
+ const preset = (_b = config == null ? void 0 : config.preset) != null ? _b : "default";
1589
+ const providerTheme = preset === "cryptocontrol" ? "cryptocontrol" : mode === "dark" ? "dark" : "light";
1590
+ const overrideColors = mode === "dark" ? (_d = (_c = config == null ? void 0 : config.overrides) == null ? void 0 : _c.dark) == null ? void 0 : _d.colors : (_f = (_e = config == null ? void 0 : config.overrides) == null ? void 0 : _e.light) == null ? void 0 : _f.colors;
1591
+ const customTheme = overrideColors ? { colors: overrideColors } : void 0;
1592
+ return { providerTheme, customTheme };
1593
+ }
1594
+ function DeframeComponentsProvider({
1595
+ theme = "light",
1596
+ themeConfig,
1597
+ customTheme,
1598
+ className,
1599
+ children
1600
+ }) {
1601
+ const [systemMode, setSystemMode] = React6.useState(() => getSystemColorMode());
1602
+ React6.useEffect(() => {
1603
+ var _a;
1604
+ const needsSystem = (themeConfig == null ? void 0 : themeConfig.mode) === "auto";
1605
+ if (!needsSystem || typeof window === "undefined" || !window.matchMedia) return;
1606
+ const mq = window.matchMedia("(prefers-color-scheme: dark)");
1607
+ const handler = () => setSystemMode(mq.matches ? "dark" : "light");
1608
+ handler();
1609
+ (_a = mq.addEventListener) == null ? void 0 : _a.call(mq, "change", handler);
1610
+ return () => {
1611
+ var _a2;
1612
+ return (_a2 = mq.removeEventListener) == null ? void 0 : _a2.call(mq, "change", handler);
1613
+ };
1614
+ }, [themeConfig == null ? void 0 : themeConfig.mode]);
1615
+ const resolvedTheme = React6.useMemo(() => {
1616
+ if (themeConfig) {
1617
+ return resolveThemeConfig(themeConfig, systemMode);
1618
+ }
1619
+ return {
1620
+ providerTheme: theme,
1621
+ customTheme
1622
+ };
1623
+ }, [themeConfig, theme, customTheme, systemMode]);
1624
+ const themeClass = resolvedTheme.providerTheme === "light" ? "" : resolvedTheme.providerTheme;
1625
+ const colorScheme = resolvedTheme.providerTheme === "light" ? "light" : "dark";
1626
+ const customCSSVars = themeToCSS(resolvedTheme.customTheme);
1627
+ return /* @__PURE__ */ jsxRuntime.jsx(
1628
+ "div",
1629
+ {
1630
+ className: tailwindMerge.twMerge("deframe-widget", themeClass, className),
1631
+ style: __spreadValues({ colorScheme }, customCSSVars),
1632
+ children
1633
+ }
1634
+ );
1635
+ }
1636
+
1637
+ exports.ActionButton = ActionButton;
1638
+ exports.ActionSheet = ActionSheet;
1639
+ exports.AddressDisplay = AddressDisplay;
1640
+ exports.BannerNotification = BannerNotification;
1641
+ exports.ConnectWalletList = ConnectWalletList;
1642
+ exports.Currency = Currency;
1643
+ exports.DeframeComponentsProvider = DeframeComponentsProvider;
1644
+ exports.Fiat = Currency;
1645
+ exports.Input = Input;
1646
+ exports.Link = Link;
1647
+ exports.ListItem = ListItem;
1648
+ exports.ListItemContent = ListItemContent;
1649
+ exports.ListItemLeftSide = ListItemLeftSide;
1650
+ exports.ListItemRightSide = ListItemRightSide;
1651
+ exports.PercentageButton = PercentageButton;
1652
+ exports.PrimaryButton = PrimaryButton;
1653
+ exports.SecondaryButton = SecondaryButton;
1654
+ exports.Select = Select;
1655
+ exports.SelectContent = SelectContent;
1656
+ exports.SelectItem = SelectItem;
1657
+ exports.SelectTrigger = SelectTrigger;
1658
+ exports.Skeleton = Skeleton;
1659
+ exports.SummaryDetails = SummaryDetails;
1660
+ exports.Tabs = Tabs;
1661
+ exports.TabsContent = TabsContent;
1662
+ exports.TabsList = TabsList;
1663
+ exports.TabsTrigger = TabsTrigger;
1664
+ exports.TertiaryButton = TertiaryButton;
1665
+ exports.Text = Text_default;
1666
+ exports.TextAccent = TextAccent_default;
1667
+ exports.TextBody = TextBody_default;
1668
+ exports.TextHeading = TextHeading_default;
1669
+ exports.Title = Title;
1670
+ exports.WalletItem = WalletItem;
1671
+ exports.WalletList = ConnectWalletList;
1672
+ exports.WalletListContainer = WalletListContainer;
1673
+ exports.cryptocontrolThemeColors = cryptocontrolThemeColors;
1674
+ exports.darkThemeColors = darkThemeColors;
1675
+ exports.defaultThemeColors = defaultThemeColors;
1676
+ exports.themeToCSS = themeToCSS;
1677
+ //# sourceMappingURL=index.js.map
1678
+ //# sourceMappingURL=index.js.map