@cookill/wallet-adapter 2.5.4 → 3.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/README.md +275 -196
- package/dist/ErrorBoundary.cjs +53 -110
- package/dist/ErrorBoundary.cjs.map +1 -1
- package/dist/ErrorBoundary.d.cts +11 -7
- package/dist/ErrorBoundary.d.ts +11 -7
- package/dist/ErrorBoundary.js +50 -85
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/LoadingStates.cjs +134 -267
- package/dist/LoadingStates.cjs.map +1 -1
- package/dist/LoadingStates.d.cts +11 -15
- package/dist/LoadingStates.d.ts +11 -15
- package/dist/LoadingStates.js +129 -239
- package/dist/LoadingStates.js.map +1 -1
- package/dist/index.cjs +483 -161
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +330 -62
- package/dist/index.d.ts +330 -62
- package/dist/index.js +463 -127
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +438 -1024
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -118
- package/dist/react.d.ts +1 -118
- package/dist/react.js +430 -969
- package/dist/react.js.map +1 -1
- package/dist/standard.cjs +127 -121
- package/dist/standard.cjs.map +1 -1
- package/dist/standard.d.cts +6 -44
- package/dist/standard.d.ts +6 -44
- package/dist/standard.js +118 -91
- package/dist/standard.js.map +1 -1
- package/package.json +42 -36
package/dist/LoadingStates.js
CHANGED
|
@@ -1,264 +1,154 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function LoadingSpinner({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
const
|
|
10
|
-
const radius = (container - stroke) / 2;
|
|
11
|
-
const circumference = radius * 2 * Math.PI;
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function LoadingSpinner({
|
|
4
|
+
size = "md",
|
|
5
|
+
color = "#6EB9A8",
|
|
6
|
+
className
|
|
7
|
+
}) {
|
|
8
|
+
const sizeMap = { sm: 16, md: 24, lg: 32 };
|
|
9
|
+
const px = sizeMap[size];
|
|
12
10
|
return /* @__PURE__ */ jsxs(
|
|
13
11
|
"svg",
|
|
14
12
|
{
|
|
15
|
-
width: container,
|
|
16
|
-
height: container,
|
|
17
|
-
viewBox: `0 0 ${container} ${container}`,
|
|
18
13
|
className,
|
|
19
|
-
|
|
14
|
+
width: px,
|
|
15
|
+
height: px,
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
fill: "none",
|
|
18
|
+
style: { animation: "spin 1s linear infinite" },
|
|
20
19
|
children: [
|
|
21
|
-
/* @__PURE__ */ jsx("style", { children: `
|
|
22
|
-
@keyframes wallet-spin {
|
|
23
|
-
from { transform: rotate(0deg); }
|
|
24
|
-
to { transform: rotate(360deg); }
|
|
25
|
-
}
|
|
26
|
-
` }),
|
|
20
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes spin { to { transform: rotate(360deg); } }` }),
|
|
27
21
|
/* @__PURE__ */ jsx(
|
|
28
22
|
"circle",
|
|
29
23
|
{
|
|
30
|
-
cx:
|
|
31
|
-
cy:
|
|
32
|
-
r:
|
|
33
|
-
fill: "none",
|
|
24
|
+
cx: "12",
|
|
25
|
+
cy: "12",
|
|
26
|
+
r: "10",
|
|
34
27
|
stroke: color,
|
|
35
|
-
strokeWidth:
|
|
36
|
-
strokeOpacity: 0.2
|
|
37
|
-
}
|
|
38
|
-
),
|
|
39
|
-
/* @__PURE__ */ jsx(
|
|
40
|
-
"circle",
|
|
41
|
-
{
|
|
42
|
-
cx: container / 2,
|
|
43
|
-
cy: container / 2,
|
|
44
|
-
r: radius,
|
|
28
|
+
strokeWidth: "2.5",
|
|
45
29
|
fill: "none",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
strokeLinecap: "round",
|
|
49
|
-
strokeDasharray: circumference,
|
|
50
|
-
strokeDashoffset: circumference * 0.75
|
|
30
|
+
strokeDasharray: "50 20",
|
|
31
|
+
strokeLinecap: "round"
|
|
51
32
|
}
|
|
52
33
|
)
|
|
53
34
|
]
|
|
54
35
|
}
|
|
55
36
|
);
|
|
56
37
|
}
|
|
38
|
+
function ConnectionStatus({ status, message, onRetry }) {
|
|
39
|
+
const configs = {
|
|
40
|
+
idle: { color: "#64748b", label: "Ready" },
|
|
41
|
+
connecting: { color: "#6EB9A8", label: "Connecting..." },
|
|
42
|
+
approving: { color: "#f59e0b", label: "Waiting for approval..." },
|
|
43
|
+
signing: { color: "#6EB9A8", label: "Signing..." },
|
|
44
|
+
success: { color: "#22c55e", label: "Connected" },
|
|
45
|
+
error: { color: "#ef4444", label: "Error" }
|
|
46
|
+
};
|
|
47
|
+
const config = configs[status];
|
|
48
|
+
return /* @__PURE__ */ jsxs("div", { style: {
|
|
49
|
+
display: "flex",
|
|
50
|
+
alignItems: "center",
|
|
51
|
+
gap: "12px",
|
|
52
|
+
padding: "12px 16px",
|
|
53
|
+
backgroundColor: `${config.color}15`,
|
|
54
|
+
borderRadius: "10px",
|
|
55
|
+
border: `1px solid ${config.color}30`
|
|
56
|
+
}, children: [
|
|
57
|
+
(status === "connecting" || status === "approving" || status === "signing") && /* @__PURE__ */ jsx(LoadingSpinner, { size: "sm", color: config.color }),
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
|
|
59
|
+
/* @__PURE__ */ jsx("div", { style: { color: config.color, fontWeight: 500, fontSize: "14px" }, children: config.label }),
|
|
60
|
+
message && /* @__PURE__ */ jsx("div", { style: { color: "#94a3b8", fontSize: "12px", marginTop: "2px" }, children: message })
|
|
61
|
+
] }),
|
|
62
|
+
status === "error" && onRetry && /* @__PURE__ */ jsx(
|
|
63
|
+
"button",
|
|
64
|
+
{
|
|
65
|
+
onClick: onRetry,
|
|
66
|
+
style: {
|
|
67
|
+
padding: "6px 12px",
|
|
68
|
+
backgroundColor: config.color,
|
|
69
|
+
color: "#ffffff",
|
|
70
|
+
border: "none",
|
|
71
|
+
borderRadius: "6px",
|
|
72
|
+
cursor: "pointer",
|
|
73
|
+
fontSize: "12px",
|
|
74
|
+
fontWeight: 500
|
|
75
|
+
},
|
|
76
|
+
children: "Retry"
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] });
|
|
80
|
+
}
|
|
57
81
|
function ApprovalPending({
|
|
58
82
|
title = "Waiting for Approval",
|
|
59
83
|
message = "Please approve the request in your wallet",
|
|
60
84
|
walletName = "Sheep Wallet",
|
|
61
85
|
onCancel
|
|
62
86
|
}) {
|
|
63
|
-
return /* @__PURE__ */ jsxs(
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
backgroundColor: "#011B29",
|
|
83
|
-
display: "flex",
|
|
84
|
-
alignItems: "center",
|
|
85
|
-
justifyContent: "center",
|
|
86
|
-
position: "relative"
|
|
87
|
-
},
|
|
88
|
-
children: [
|
|
89
|
-
/* @__PURE__ */ jsx(LoadingSpinner, { size: "lg" }),
|
|
90
|
-
/* @__PURE__ */ jsx(
|
|
91
|
-
"div",
|
|
92
|
-
{
|
|
93
|
-
style: {
|
|
94
|
-
position: "absolute",
|
|
95
|
-
inset: "-4px",
|
|
96
|
-
borderRadius: "50%",
|
|
97
|
-
border: "2px solid transparent",
|
|
98
|
-
borderTopColor: "#6EB9A8",
|
|
99
|
-
animation: "wallet-spin 2s linear infinite"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
)
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
),
|
|
106
|
-
/* @__PURE__ */ jsx(
|
|
107
|
-
"h3",
|
|
108
|
-
{
|
|
109
|
-
style: {
|
|
110
|
-
margin: "0 0 8px",
|
|
111
|
-
fontSize: "18px",
|
|
112
|
-
fontWeight: 600,
|
|
113
|
-
color: "#0f172a"
|
|
114
|
-
},
|
|
115
|
-
children: title
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ jsx(
|
|
119
|
-
"p",
|
|
120
|
-
{
|
|
121
|
-
style: {
|
|
122
|
-
margin: "0 0 8px",
|
|
123
|
-
fontSize: "14px",
|
|
124
|
-
color: "#64748b"
|
|
125
|
-
},
|
|
126
|
-
children: message
|
|
127
|
-
}
|
|
128
|
-
),
|
|
129
|
-
/* @__PURE__ */ jsxs(
|
|
130
|
-
"p",
|
|
131
|
-
{
|
|
132
|
-
style: {
|
|
133
|
-
margin: "0 0 24px",
|
|
134
|
-
fontSize: "12px",
|
|
135
|
-
color: "#94a3b8"
|
|
136
|
-
},
|
|
137
|
-
children: [
|
|
138
|
-
"Open ",
|
|
139
|
-
walletName,
|
|
140
|
-
" extension to continue"
|
|
141
|
-
]
|
|
142
|
-
}
|
|
143
|
-
),
|
|
144
|
-
onCancel && /* @__PURE__ */ jsx(
|
|
145
|
-
"button",
|
|
146
|
-
{
|
|
147
|
-
onClick: onCancel,
|
|
148
|
-
style: {
|
|
149
|
-
padding: "10px 24px",
|
|
150
|
-
borderRadius: "10px",
|
|
151
|
-
border: "1px solid #e2e8f0",
|
|
152
|
-
backgroundColor: "white",
|
|
153
|
-
color: "#64748b",
|
|
154
|
-
cursor: "pointer",
|
|
155
|
-
fontSize: "14px",
|
|
156
|
-
fontWeight: 500,
|
|
157
|
-
transition: "all 0.2s ease"
|
|
158
|
-
},
|
|
159
|
-
onMouseEnter: (e) => {
|
|
160
|
-
e.currentTarget.style.backgroundColor = "#f1f5f9";
|
|
161
|
-
e.currentTarget.style.borderColor = "#cbd5e1";
|
|
162
|
-
},
|
|
163
|
-
onMouseLeave: (e) => {
|
|
164
|
-
e.currentTarget.style.backgroundColor = "white";
|
|
165
|
-
e.currentTarget.style.borderColor = "#e2e8f0";
|
|
166
|
-
},
|
|
167
|
-
children: "Cancel"
|
|
168
|
-
}
|
|
169
|
-
)
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
function ConnectionStatus({ status, message, onRetry }) {
|
|
175
|
-
const statusConfig = {
|
|
176
|
-
connecting: {
|
|
177
|
-
title: "Connecting",
|
|
178
|
-
defaultMessage: "Establishing connection to wallet...",
|
|
179
|
-
color: "#6EB9A8"
|
|
180
|
-
},
|
|
181
|
-
approving: {
|
|
182
|
-
title: "Approval Required",
|
|
183
|
-
defaultMessage: "Please approve the connection in Sheep Wallet",
|
|
184
|
-
color: "#f59e0b"
|
|
185
|
-
},
|
|
186
|
-
signing: {
|
|
187
|
-
title: "Signature Required",
|
|
188
|
-
defaultMessage: "Please sign the transaction in your wallet",
|
|
189
|
-
color: "#6EB9A8"
|
|
190
|
-
},
|
|
191
|
-
success: {
|
|
192
|
-
title: "Connected",
|
|
193
|
-
defaultMessage: "Successfully connected to wallet",
|
|
194
|
-
color: "#22c55e"
|
|
195
|
-
},
|
|
196
|
-
error: {
|
|
197
|
-
title: "Connection Failed",
|
|
198
|
-
defaultMessage: "Unable to connect. Please try again.",
|
|
199
|
-
color: "#ef4444"
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
const config = statusConfig[status];
|
|
203
|
-
return /* @__PURE__ */ jsxs(
|
|
204
|
-
"div",
|
|
205
|
-
{
|
|
206
|
-
style: {
|
|
207
|
-
padding: "20px",
|
|
208
|
-
borderRadius: "12px",
|
|
209
|
-
backgroundColor: `${config.color}10`,
|
|
210
|
-
border: `1px solid ${config.color}30`,
|
|
211
|
-
textAlign: "center"
|
|
212
|
-
},
|
|
213
|
-
children: [
|
|
214
|
-
/* @__PURE__ */ jsx(
|
|
215
|
-
"div",
|
|
216
|
-
{
|
|
217
|
-
style: {
|
|
218
|
-
width: "48px",
|
|
219
|
-
height: "48px",
|
|
220
|
-
margin: "0 auto 12px",
|
|
221
|
-
borderRadius: "50%",
|
|
222
|
-
backgroundColor: `${config.color}20`,
|
|
223
|
-
display: "flex",
|
|
224
|
-
alignItems: "center",
|
|
225
|
-
justifyContent: "center"
|
|
226
|
-
},
|
|
227
|
-
children: status === "success" ? /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: config.color, strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "20,6 9,17 4,12" }) }) : status === "error" ? /* @__PURE__ */ jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: config.color, strokeWidth: "2", children: [
|
|
228
|
-
/* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
229
|
-
/* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
230
|
-
] }) : /* @__PURE__ */ jsx(LoadingSpinner, { size: "sm", color: config.color })
|
|
231
|
-
}
|
|
232
|
-
),
|
|
233
|
-
/* @__PURE__ */ jsx("h4", { style: { margin: "0 0 4px", fontSize: "14px", fontWeight: 600, color: config.color }, children: config.title }),
|
|
234
|
-
/* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: "12px", color: "#64748b" }, children: message || config.defaultMessage }),
|
|
235
|
-
status === "error" && onRetry && /* @__PURE__ */ jsx(
|
|
236
|
-
"button",
|
|
237
|
-
{
|
|
238
|
-
onClick: onRetry,
|
|
239
|
-
style: {
|
|
240
|
-
marginTop: "12px",
|
|
241
|
-
padding: "6px 16px",
|
|
242
|
-
borderRadius: "6px",
|
|
243
|
-
border: "none",
|
|
244
|
-
backgroundColor: config.color,
|
|
245
|
-
color: "white",
|
|
246
|
-
cursor: "pointer",
|
|
247
|
-
fontSize: "12px",
|
|
248
|
-
fontWeight: 500
|
|
249
|
-
},
|
|
250
|
-
children: "Retry"
|
|
87
|
+
return /* @__PURE__ */ jsxs("div", { style: {
|
|
88
|
+
textAlign: "center",
|
|
89
|
+
padding: "32px 24px"
|
|
90
|
+
}, children: [
|
|
91
|
+
/* @__PURE__ */ jsxs("div", { style: {
|
|
92
|
+
width: "64px",
|
|
93
|
+
height: "64px",
|
|
94
|
+
margin: "0 auto 20px",
|
|
95
|
+
borderRadius: "16px",
|
|
96
|
+
backgroundColor: "#6EB9A815",
|
|
97
|
+
display: "flex",
|
|
98
|
+
alignItems: "center",
|
|
99
|
+
justifyContent: "center",
|
|
100
|
+
animation: "pulse 2s ease-in-out infinite"
|
|
101
|
+
}, children: [
|
|
102
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
103
|
+
@keyframes pulse {
|
|
104
|
+
0%, 100% { transform: scale(1); opacity: 1; }
|
|
105
|
+
50% { transform: scale(1.05); opacity: 0.8; }
|
|
251
106
|
}
|
|
252
|
-
)
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
|
|
107
|
+
` }),
|
|
108
|
+
/* @__PURE__ */ jsx(LoadingSpinner, { size: "lg" })
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ jsx("h3", { style: {
|
|
111
|
+
color: "#ffffff",
|
|
112
|
+
margin: "0 0 8px 0",
|
|
113
|
+
fontSize: "18px",
|
|
114
|
+
fontWeight: 600
|
|
115
|
+
}, children: title }),
|
|
116
|
+
/* @__PURE__ */ jsx("p", { style: {
|
|
117
|
+
color: "#94a3b8",
|
|
118
|
+
margin: "0 0 24px 0",
|
|
119
|
+
fontSize: "14px"
|
|
120
|
+
}, children: message }),
|
|
121
|
+
/* @__PURE__ */ jsxs("div", { style: {
|
|
122
|
+
padding: "12px 16px",
|
|
123
|
+
backgroundColor: "#1a3a4d",
|
|
124
|
+
borderRadius: "10px",
|
|
125
|
+
color: "#6EB9A8",
|
|
126
|
+
fontSize: "13px",
|
|
127
|
+
marginBottom: "20px"
|
|
128
|
+
}, children: [
|
|
129
|
+
"Check ",
|
|
130
|
+
walletName,
|
|
131
|
+
" extension"
|
|
132
|
+
] }),
|
|
133
|
+
onCancel && /* @__PURE__ */ jsx(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
onClick: onCancel,
|
|
137
|
+
style: {
|
|
138
|
+
padding: "10px 24px",
|
|
139
|
+
backgroundColor: "transparent",
|
|
140
|
+
border: "1px solid #374151",
|
|
141
|
+
borderRadius: "8px",
|
|
142
|
+
color: "#9ca3af",
|
|
143
|
+
cursor: "pointer",
|
|
144
|
+
fontSize: "14px"
|
|
145
|
+
},
|
|
146
|
+
children: "Cancel"
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
] });
|
|
256
150
|
}
|
|
257
|
-
|
|
258
|
-
export {
|
|
259
|
-
|
|
260
|
-
ConnectionStatus,
|
|
261
|
-
LoadingSpinner,
|
|
262
|
-
LoadingStates_default as default
|
|
263
|
-
};
|
|
151
|
+
|
|
152
|
+
export { ApprovalPending, ConnectionStatus, LoadingSpinner };
|
|
153
|
+
//# sourceMappingURL=LoadingStates.js.map
|
|
264
154
|
//# sourceMappingURL=LoadingStates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/LoadingStates.tsx"],"sourcesContent":["/**\n * @cookill/wallet-adapter - Loading States\n * Loading spinners and approval pending states for dApps\n */\n\nimport React from 'react';\n\ninterface LoadingSpinnerProps {\n size?: 'sm' | 'md' | 'lg';\n color?: string;\n className?: string;\n}\n\nexport function LoadingSpinner({ size = 'md', color = '#6EB9A8', className = '' }: LoadingSpinnerProps) {\n const sizes = {\n sm: { container: 20, stroke: 2 },\n md: { container: 32, stroke: 3 },\n lg: { container: 48, stroke: 4 },\n };\n\n const { container, stroke } = sizes[size];\n const radius = (container - stroke) / 2;\n const circumference = radius * 2 * Math.PI;\n\n return (\n <svg\n width={container}\n height={container}\n viewBox={`0 0 ${container} ${container}`}\n className={className}\n style={{ animation: 'wallet-spin 1s linear infinite' }}\n >\n <style>\n {`\n @keyframes wallet-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n `}\n </style>\n <circle\n cx={container / 2}\n cy={container / 2}\n r={radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={stroke}\n strokeOpacity={0.2}\n />\n <circle\n cx={container / 2}\n cy={container / 2}\n r={radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={circumference * 0.75}\n />\n </svg>\n );\n}\n\ninterface ApprovalPendingProps {\n title?: string;\n message?: string;\n walletName?: string;\n onCancel?: () => void;\n}\n\nexport function ApprovalPending({\n title = 'Waiting for Approval',\n message = 'Please approve the request in your wallet',\n walletName = 'Sheep Wallet',\n onCancel,\n}: ApprovalPendingProps) {\n return (\n <div\n style={{\n padding: '32px 24px',\n textAlign: 'center',\n backgroundColor: '#f8fafc',\n borderRadius: '16px',\n border: '1px solid #e2e8f0',\n }}\n >\n <div\n style={{\n width: '80px',\n height: '80px',\n margin: '0 auto 20px',\n borderRadius: '50%',\n backgroundColor: '#011B29',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n }}\n >\n <LoadingSpinner size=\"lg\" />\n <div\n style={{\n position: 'absolute',\n inset: '-4px',\n borderRadius: '50%',\n border: '2px solid transparent',\n borderTopColor: '#6EB9A8',\n animation: 'wallet-spin 2s linear infinite',\n }}\n />\n </div>\n\n <h3\n style={{\n margin: '0 0 8px',\n fontSize: '18px',\n fontWeight: 600,\n color: '#0f172a',\n }}\n >\n {title}\n </h3>\n\n <p\n style={{\n margin: '0 0 8px',\n fontSize: '14px',\n color: '#64748b',\n }}\n >\n {message}\n </p>\n\n <p\n style={{\n margin: '0 0 24px',\n fontSize: '12px',\n color: '#94a3b8',\n }}\n >\n Open {walletName} extension to continue\n </p>\n\n {onCancel && (\n <button\n onClick={onCancel}\n style={{\n padding: '10px 24px',\n borderRadius: '10px',\n border: '1px solid #e2e8f0',\n backgroundColor: 'white',\n color: '#64748b',\n cursor: 'pointer',\n fontSize: '14px',\n fontWeight: 500,\n transition: 'all 0.2s ease',\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = '#f1f5f9';\n e.currentTarget.style.borderColor = '#cbd5e1';\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = 'white';\n e.currentTarget.style.borderColor = '#e2e8f0';\n }}\n >\n Cancel\n </button>\n )}\n </div>\n );\n}\n\ninterface ConnectionStatusProps {\n status: 'connecting' | 'approving' | 'signing' | 'success' | 'error';\n message?: string;\n onRetry?: () => void;\n}\n\nexport function ConnectionStatus({ status, message, onRetry }: ConnectionStatusProps) {\n const statusConfig = {\n connecting: {\n title: 'Connecting',\n defaultMessage: 'Establishing connection to wallet...',\n color: '#6EB9A8',\n },\n approving: {\n title: 'Approval Required',\n defaultMessage: 'Please approve the connection in Sheep Wallet',\n color: '#f59e0b',\n },\n signing: {\n title: 'Signature Required',\n defaultMessage: 'Please sign the transaction in your wallet',\n color: '#6EB9A8',\n },\n success: {\n title: 'Connected',\n defaultMessage: 'Successfully connected to wallet',\n color: '#22c55e',\n },\n error: {\n title: 'Connection Failed',\n defaultMessage: 'Unable to connect. Please try again.',\n color: '#ef4444',\n },\n };\n\n const config = statusConfig[status];\n\n return (\n <div\n style={{\n padding: '20px',\n borderRadius: '12px',\n backgroundColor: `${config.color}10`,\n border: `1px solid ${config.color}30`,\n textAlign: 'center',\n }}\n >\n <div\n style={{\n width: '48px',\n height: '48px',\n margin: '0 auto 12px',\n borderRadius: '50%',\n backgroundColor: `${config.color}20`,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n {status === 'success' ? (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke={config.color} strokeWidth=\"2\">\n <polyline points=\"20,6 9,17 4,12\" />\n </svg>\n ) : status === 'error' ? (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke={config.color} strokeWidth=\"2\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n ) : (\n <LoadingSpinner size=\"sm\" color={config.color} />\n )}\n </div>\n\n <h4 style={{ margin: '0 0 4px', fontSize: '14px', fontWeight: 600, color: config.color }}>\n {config.title}\n </h4>\n\n <p style={{ margin: 0, fontSize: '12px', color: '#64748b' }}>\n {message || config.defaultMessage}\n </p>\n\n {status === 'error' && onRetry && (\n <button\n onClick={onRetry}\n style={{\n marginTop: '12px',\n padding: '6px 16px',\n borderRadius: '6px',\n border: 'none',\n backgroundColor: config.color,\n color: 'white',\n cursor: 'pointer',\n fontSize: '12px',\n fontWeight: 500,\n }}\n >\n Retry\n </button>\n )}\n </div>\n );\n}\n\nexport default { LoadingSpinner, ApprovalPending, ConnectionStatus };\n"],"mappings":";AAyBI,SAOE,KAPF;AAZG,SAAS,eAAe,EAAE,OAAO,MAAM,QAAQ,WAAW,YAAY,GAAG,GAAwB;AACtG,QAAM,QAAQ;AAAA,IACZ,IAAI,EAAE,WAAW,IAAI,QAAQ,EAAE;AAAA,IAC/B,IAAI,EAAE,WAAW,IAAI,QAAQ,EAAE;AAAA,IAC/B,IAAI,EAAE,WAAW,IAAI,QAAQ,EAAE;AAAA,EACjC;AAEA,QAAM,EAAE,WAAW,OAAO,IAAI,MAAM,IAAI;AACxC,QAAM,UAAU,YAAY,UAAU;AACtC,QAAM,gBAAgB,SAAS,IAAI,KAAK;AAExC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS,OAAO,SAAS,IAAI,SAAS;AAAA,MACtC;AAAA,MACA,OAAO,EAAE,WAAW,iCAAiC;AAAA,MAErD;AAAA,4BAAC,WACE;AAAA;AAAA;AAAA;AAAA;AAAA,WAMH;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,IAAI,YAAY;AAAA,YAChB,IAAI,YAAY;AAAA,YAChB,GAAG;AAAA,YACH,MAAK;AAAA,YACL,QAAQ;AAAA,YACR,aAAa;AA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QACC,OAAA,EAAS,QAAA;AAAA,QACT,KAAA,EAAO;AAAA,UACL,OAAA,EAAS,WAAA;AAAA,UACT,eAAA,EAAiB,aAAA;AAAA,UACjB,MAAA,EAAQ,mBAAA;AAAA,UACR,YAAA,EAAc,KAAA;AAAA,UACd,KAAA,EAAO,SAAA;AAAA,UACP,MAAA,EAAQ,SAAA;AAAA,UACR,QAAA,EAAU;AAAA,SACZ;AAAA,QACD,QAAA,EAAA;AAAA;AAAA;AAED,GAAA,EAEJ,CAAA;AAEJ","file":"LoadingStates.js","sourcesContent":["/**\n * @cookill/wallet-adapter/react v3.0.0\n * Loading and status indicator components\n */\n\nimport React from 'react';\n\n// ============================================================================\n// LoadingSpinner\n// ============================================================================\n\nexport interface LoadingSpinnerProps {\n size?: 'sm' | 'md' | 'lg';\n color?: string;\n className?: string;\n}\n\nexport function LoadingSpinner({ \n size = 'md', \n color = '#6EB9A8',\n className,\n}: LoadingSpinnerProps) {\n const sizeMap = { sm: 16, md: 24, lg: 32 };\n const px = sizeMap[size];\n\n return (\n <svg\n className={className}\n width={px}\n height={px}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{ animation: 'spin 1s linear infinite' }}\n >\n <style>{`@keyframes spin { to { transform: rotate(360deg); } }`}</style>\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke={color}\n strokeWidth=\"2.5\"\n fill=\"none\"\n strokeDasharray=\"50 20\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\n// ============================================================================\n// ConnectionStatus\n// ============================================================================\n\nexport type ConnectionStatusType = \n | 'idle' \n | 'connecting' \n | 'approving' \n | 'signing' \n | 'success' \n | 'error';\n\nexport interface ConnectionStatusProps {\n status: ConnectionStatusType;\n message?: string;\n onRetry?: () => void;\n}\n\nexport function ConnectionStatus({ status, message, onRetry }: ConnectionStatusProps) {\n const configs: Record<ConnectionStatusType, { color: string; label: string }> = {\n idle: { color: '#64748b', label: 'Ready' },\n connecting: { color: '#6EB9A8', label: 'Connecting...' },\n approving: { color: '#f59e0b', label: 'Waiting for approval...' },\n signing: { color: '#6EB9A8', label: 'Signing...' },\n success: { color: '#22c55e', label: 'Connected' },\n error: { color: '#ef4444', label: 'Error' },\n };\n\n const config = configs[status];\n\n return (\n <div style={{\n display: 'flex',\n alignItems: 'center',\n gap: '12px',\n padding: '12px 16px',\n backgroundColor: `${config.color}15`,\n borderRadius: '10px',\n border: `1px solid ${config.color}30`,\n }}>\n {(status === 'connecting' || status === 'approving' || status === 'signing') && (\n <LoadingSpinner size=\"sm\" color={config.color} />\n )}\n \n <div style={{ flex: 1 }}>\n <div style={{ color: config.color, fontWeight: 500, fontSize: '14px' }}>\n {config.label}\n </div>\n {message && (\n <div style={{ color: '#94a3b8', fontSize: '12px', marginTop: '2px' }}>\n {message}\n </div>\n )}\n </div>\n\n {status === 'error' && onRetry && (\n <button\n onClick={onRetry}\n style={{\n padding: '6px 12px',\n backgroundColor: config.color,\n color: '#ffffff',\n border: 'none',\n borderRadius: '6px',\n cursor: 'pointer',\n fontSize: '12px',\n fontWeight: 500,\n }}\n >\n Retry\n </button>\n )}\n </div>\n );\n}\n\n// ============================================================================\n// ApprovalPending\n// ============================================================================\n\nexport interface ApprovalPendingProps {\n title?: string;\n message?: string;\n walletName?: string;\n onCancel?: () => void;\n}\n\nexport function ApprovalPending({\n title = 'Waiting for Approval',\n message = 'Please approve the request in your wallet',\n walletName = 'Sheep Wallet',\n onCancel,\n}: ApprovalPendingProps) {\n return (\n <div style={{\n textAlign: 'center',\n padding: '32px 24px',\n }}>\n {/* Animated wallet icon */}\n <div style={{\n width: '64px',\n height: '64px',\n margin: '0 auto 20px',\n borderRadius: '16px',\n backgroundColor: '#6EB9A815',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n animation: 'pulse 2s ease-in-out infinite',\n }}>\n <style>{`\n @keyframes pulse {\n 0%, 100% { transform: scale(1); opacity: 1; }\n 50% { transform: scale(1.05); opacity: 0.8; }\n }\n `}</style>\n <LoadingSpinner size=\"lg\" />\n </div>\n\n <h3 style={{ \n color: '#ffffff', \n margin: '0 0 8px 0',\n fontSize: '18px',\n fontWeight: 600,\n }}>\n {title}\n </h3>\n \n <p style={{ \n color: '#94a3b8', \n margin: '0 0 24px 0',\n fontSize: '14px',\n }}>\n {message}\n </p>\n\n <div style={{\n padding: '12px 16px',\n backgroundColor: '#1a3a4d',\n borderRadius: '10px',\n color: '#6EB9A8',\n fontSize: '13px',\n marginBottom: '20px',\n }}>\n Check {walletName} extension\n </div>\n\n {onCancel && (\n <button\n onClick={onCancel}\n style={{\n padding: '10px 24px',\n backgroundColor: 'transparent',\n border: '1px solid #374151',\n borderRadius: '8px',\n color: '#9ca3af',\n cursor: 'pointer',\n fontSize: '14px',\n }}\n >\n Cancel\n </button>\n )}\n </div>\n );\n}\n"]}
|