@medialane/ui 0.283.0 → 0.284.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/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
- package/dist/components/transfer-dialog.cjs +226 -0
- package/dist/components/transfer-dialog.cjs.map +1 -0
- package/dist/components/transfer-dialog.d.cts +32 -0
- package/dist/components/transfer-dialog.d.ts +32 -0
- package/dist/components/transfer-dialog.js +192 -0
- package/dist/components/transfer-dialog.js.map +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "default" | "
|
|
7
|
+
variant?: "default" | "secondary" | "outline" | "destructive" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
10
10
|
}
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "default" | "
|
|
7
|
+
variant?: "default" | "secondary" | "outline" | "destructive" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
10
10
|
}
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "link" | "default" | "secondary" | "outline" | "destructive" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
7
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "link" | "default" | "secondary" | "outline" | "destructive" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
7
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -16,6 +16,7 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
16
16
|
royalty: zod.ZodNumber;
|
|
17
17
|
}, "strip", zod.ZodTypeAny, {
|
|
18
18
|
name: string;
|
|
19
|
+
value: string;
|
|
19
20
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
20
21
|
licenseType: string;
|
|
21
22
|
commercialUse: "Yes" | "No";
|
|
@@ -24,12 +25,12 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
24
25
|
geographicScope: string;
|
|
25
26
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
26
27
|
royalty: number;
|
|
27
|
-
value: string;
|
|
28
28
|
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
32
32
|
name: string;
|
|
33
|
+
value: string;
|
|
33
34
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
34
35
|
licenseType: string;
|
|
35
36
|
commercialUse: "Yes" | "No";
|
|
@@ -38,7 +39,6 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
38
39
|
geographicScope: string;
|
|
39
40
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
40
41
|
royalty: number;
|
|
41
|
-
value: string;
|
|
42
42
|
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
@@ -16,6 +16,7 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
16
16
|
royalty: zod.ZodNumber;
|
|
17
17
|
}, "strip", zod.ZodTypeAny, {
|
|
18
18
|
name: string;
|
|
19
|
+
value: string;
|
|
19
20
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
20
21
|
licenseType: string;
|
|
21
22
|
commercialUse: "Yes" | "No";
|
|
@@ -24,12 +25,12 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
24
25
|
geographicScope: string;
|
|
25
26
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
26
27
|
royalty: number;
|
|
27
|
-
value: string;
|
|
28
28
|
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
32
32
|
name: string;
|
|
33
|
+
value: string;
|
|
33
34
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
34
35
|
licenseType: string;
|
|
35
36
|
commercialUse: "Yes" | "No";
|
|
@@ -38,7 +39,6 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
38
39
|
geographicScope: string;
|
|
39
40
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
40
41
|
royalty: number;
|
|
41
|
-
value: string;
|
|
42
42
|
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var transfer_dialog_exports = {};
|
|
31
|
+
__export(transfer_dialog_exports, {
|
|
32
|
+
TransferDialog: () => TransferDialog
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(transfer_dialog_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_react_hook_form = require("react-hook-form");
|
|
38
|
+
var import_zod = require("@hookform/resolvers/zod");
|
|
39
|
+
var z = __toESM(require("zod"), 1);
|
|
40
|
+
var import_lucide_react = require("lucide-react");
|
|
41
|
+
var import_dialog = require("./dialog.js");
|
|
42
|
+
var import_form = require("./form.js");
|
|
43
|
+
var import_input = require("./input.js");
|
|
44
|
+
var import_alert = require("./alert.js");
|
|
45
|
+
var import_marketplace_dialog_primitives = require("./marketplace-dialog-primitives.js");
|
|
46
|
+
var import_transaction_dialog_states = require("./transaction-dialog-states.js");
|
|
47
|
+
var import_use_transaction = require("../utils/use-transaction.js");
|
|
48
|
+
var import_success_messages = require("../utils/success-messages.js");
|
|
49
|
+
const schema = z.object({
|
|
50
|
+
toAddress: z.string().min(1, "Recipient address is required").regex(/^0x[0-9a-fA-F]{1,64}$/, "Must be a valid Starknet address (0x followed by hex characters)")
|
|
51
|
+
});
|
|
52
|
+
function TransferDialog({
|
|
53
|
+
open,
|
|
54
|
+
onOpenChange,
|
|
55
|
+
tokenId,
|
|
56
|
+
tokenName,
|
|
57
|
+
tokenImage,
|
|
58
|
+
hasActiveListing = false,
|
|
59
|
+
walletAddress,
|
|
60
|
+
canTransfer,
|
|
61
|
+
connectLabel,
|
|
62
|
+
footerNote,
|
|
63
|
+
tx,
|
|
64
|
+
onTransfer,
|
|
65
|
+
onSuccess
|
|
66
|
+
}) {
|
|
67
|
+
const { phase, txHash, error, retryable = true, reset } = tx;
|
|
68
|
+
const busy = (0, import_use_transaction.isBusyPhase)(phase);
|
|
69
|
+
const [step, setStep] = (0, import_react.useState)("form");
|
|
70
|
+
const [pendingAddress, setPendingAddress] = (0, import_react.useState)(null);
|
|
71
|
+
const form = (0, import_react_hook_form.useForm)({
|
|
72
|
+
resolver: (0, import_zod.zodResolver)(schema),
|
|
73
|
+
defaultValues: { toAddress: "" }
|
|
74
|
+
});
|
|
75
|
+
const resetDialog = () => {
|
|
76
|
+
reset();
|
|
77
|
+
form.reset();
|
|
78
|
+
setPendingAddress(null);
|
|
79
|
+
setStep("form");
|
|
80
|
+
};
|
|
81
|
+
(0, import_react.useEffect)(() => {
|
|
82
|
+
if (open) resetDialog();
|
|
83
|
+
}, [open]);
|
|
84
|
+
const close = () => {
|
|
85
|
+
resetDialog();
|
|
86
|
+
onOpenChange(false);
|
|
87
|
+
};
|
|
88
|
+
const handleClose = (value) => {
|
|
89
|
+
if (!value && !busy && phase !== "success") close();
|
|
90
|
+
};
|
|
91
|
+
const onSubmit = (values) => {
|
|
92
|
+
if (walletAddress) {
|
|
93
|
+
try {
|
|
94
|
+
if (BigInt(values.toAddress) === BigInt(walletAddress)) {
|
|
95
|
+
form.setError("toAddress", { message: "Cannot transfer to yourself" });
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
} catch {
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (!canTransfer) return;
|
|
102
|
+
setPendingAddress(values.toAddress);
|
|
103
|
+
setStep("confirm");
|
|
104
|
+
};
|
|
105
|
+
const displayName = tokenName || `Token #${tokenId}`;
|
|
106
|
+
const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}\u2026${pendingAddress.slice(-6)}` : "";
|
|
107
|
+
const footer = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start justify-center gap-1.5", children: [
|
|
108
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ShieldCheck, { className: "h-3 w-3 text-muted-foreground shrink-0 mt-0.5" }),
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-center text-muted-foreground", children: footerNote })
|
|
110
|
+
] });
|
|
111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogContent, { className: "max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]", children: [
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogTitle, { className: "sr-only", children: [
|
|
113
|
+
"Transfer ",
|
|
114
|
+
displayName
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, { className: "sr-only", children: "Enter a recipient Starknet address to transfer this asset onchain." }),
|
|
117
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
118
|
+
import_transaction_dialog_states.TransactionDialogStates,
|
|
119
|
+
{
|
|
120
|
+
phase,
|
|
121
|
+
asset: { name: displayName, image: tokenImage },
|
|
122
|
+
statusMessage: "Confirming on Starknet\u2026",
|
|
123
|
+
txHash,
|
|
124
|
+
error,
|
|
125
|
+
success: import_success_messages.successMessages.transferred({ name: displayName, to: recipientShort }),
|
|
126
|
+
successActions: [{ label: "Done", onClick: () => {
|
|
127
|
+
close();
|
|
128
|
+
onSuccess?.();
|
|
129
|
+
} }],
|
|
130
|
+
errorTitle: "Transfer failed",
|
|
131
|
+
errorDescription: "The transaction was submitted, but the transfer could not be completed.",
|
|
132
|
+
onRetry: retryable ? () => {
|
|
133
|
+
reset();
|
|
134
|
+
setStep("form");
|
|
135
|
+
} : void 0,
|
|
136
|
+
onDone: close,
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
139
|
+
import_marketplace_dialog_primitives.MarketplaceDialogHero,
|
|
140
|
+
{
|
|
141
|
+
tokenImage,
|
|
142
|
+
tokenName,
|
|
143
|
+
tokenId,
|
|
144
|
+
fallbackIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRightLeft, { className: "h-12 w-12 text-brand-blue/30" })
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
step === "confirm" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-end justify-between px-6 pt-3 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-bold text-lg leading-tight truncate", children: displayName }),
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground mt-0.5 tabular-nums truncate", children: [
|
|
151
|
+
"\u2192 ",
|
|
152
|
+
recipientShort
|
|
153
|
+
] })
|
|
154
|
+
] }) }),
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
156
|
+
import_marketplace_dialog_primitives.MarketplaceConfirmStep,
|
|
157
|
+
{
|
|
158
|
+
description: "Transfer this asset? This action cannot be undone.",
|
|
159
|
+
error,
|
|
160
|
+
secondaryLabel: "Back",
|
|
161
|
+
onSecondary: () => {
|
|
162
|
+
reset();
|
|
163
|
+
setStep("form");
|
|
164
|
+
},
|
|
165
|
+
primaryLabel: "Transfer",
|
|
166
|
+
onPrimary: () => {
|
|
167
|
+
if (pendingAddress) onTransfer(pendingAddress);
|
|
168
|
+
},
|
|
169
|
+
primaryIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRightLeft, { className: "h-4 w-4" }),
|
|
170
|
+
footer
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-5 pb-4 pt-3 space-y-3", children: [
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-bold text-base leading-tight truncate", children: displayName }),
|
|
175
|
+
hasActiveListing && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { variant: "destructive", children: [
|
|
176
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-4 w-4" }),
|
|
177
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs", children: "This token has an active listing. A buyer could still complete the purchase after you transfer it \u2014 cancel the listing first, or proceed with caution." })
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { children: [
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-4 w-4" }),
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs", children: "Transfers are permanent and irreversible. Double-check the recipient address before confirming." })
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-3", children: [
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
185
|
+
import_form.FormField,
|
|
186
|
+
{
|
|
187
|
+
control: form.control,
|
|
188
|
+
name: "toAddress",
|
|
189
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Recipient address" }),
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { placeholder: "0x\u2026", autoComplete: "off", spellCheck: false, ...field }) }),
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
|
|
193
|
+
] })
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { variant: "destructive", children: [
|
|
197
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-4 w-4" }),
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { children: error })
|
|
199
|
+
] }),
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pt-1 space-y-2", children: [
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btn-border-animated p-[1px] rounded-xl", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
202
|
+
"button",
|
|
203
|
+
{
|
|
204
|
+
type: "submit",
|
|
205
|
+
disabled: !canTransfer,
|
|
206
|
+
className: "w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent",
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRightLeft, { className: "h-4 w-4" }),
|
|
209
|
+
canTransfer ? "Transfer" : connectLabel
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
) }),
|
|
213
|
+
footer
|
|
214
|
+
] })
|
|
215
|
+
] }) })
|
|
216
|
+
] })
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] }) });
|
|
221
|
+
}
|
|
222
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
223
|
+
0 && (module.exports = {
|
|
224
|
+
TransferDialog
|
|
225
|
+
});
|
|
226
|
+
//# sourceMappingURL=transfer-dialog.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/transfer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { AlertCircle, ArrowRightLeft, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { MarketplaceConfirmStep, MarketplaceDialogHero } from \"./marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"./transaction-dialog-states.js\";\nimport { isBusyPhase, type TransactionPhase } from \"../utils/use-transaction.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\n\nconst schema = z.object({\n toAddress: z\n .string()\n .min(1, \"Recipient address is required\")\n .regex(/^0x[0-9a-fA-F]{1,64}$/, \"Must be a valid Starknet address (0x followed by hex characters)\"),\n});\n\ntype FormValues = z.infer<typeof schema>;\n\ntype Step = \"form\" | \"confirm\";\n\nexport interface TransferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n tokenId: string;\n tokenName?: string;\n tokenImage?: string | null;\n hasActiveListing?: boolean;\n walletAddress?: string | null;\n canTransfer: boolean;\n connectLabel: string;\n footerNote: string;\n tx: {\n phase: TransactionPhase;\n txHash: string | null;\n error: string | null;\n retryable?: boolean;\n reset: () => void;\n };\n onTransfer: (toAddress: string) => void;\n onSuccess?: () => void;\n}\n\nexport function TransferDialog({\n open,\n onOpenChange,\n tokenId,\n tokenName,\n tokenImage,\n hasActiveListing = false,\n walletAddress,\n canTransfer,\n connectLabel,\n footerNote,\n tx,\n onTransfer,\n onSuccess,\n}: TransferDialogProps) {\n const { phase, txHash, error, retryable = true, reset } = tx;\n const busy = isBusyPhase(phase);\n const [step, setStep] = useState<Step>(\"form\");\n const [pendingAddress, setPendingAddress] = useState<string | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { toAddress: \"\" },\n });\n\n const resetDialog = () => {\n reset();\n form.reset();\n setPendingAddress(null);\n setStep(\"form\");\n };\n\n useEffect(() => {\n if (open) resetDialog();\n }, [open]);\n\n const close = () => {\n resetDialog();\n onOpenChange(false);\n };\n\n const handleClose = (value: boolean) => {\n if (!value && !busy && phase !== \"success\") close();\n };\n\n const onSubmit = (values: FormValues) => {\n if (walletAddress) {\n try {\n if (BigInt(values.toAddress) === BigInt(walletAddress)) {\n form.setError(\"toAddress\", { message: \"Cannot transfer to yourself\" });\n return;\n }\n } catch {\n void 0;\n }\n }\n if (!canTransfer) return;\n setPendingAddress(values.toAddress);\n setStep(\"confirm\");\n };\n\n const displayName = tokenName || `Token #${tokenId}`;\n const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}…${pendingAddress.slice(-6)}` : \"\";\n\n const footer = (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{footerNote}</p>\n </div>\n );\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]\">\n <DialogTitle className=\"sr-only\">Transfer {displayName}</DialogTitle>\n <DialogDescription className=\"sr-only\">\n Enter a recipient Starknet address to transfer this asset onchain.\n </DialogDescription>\n\n <TransactionDialogStates\n phase={phase}\n asset={{ name: displayName, image: tokenImage }}\n statusMessage=\"Confirming on Starknet…\"\n txHash={txHash}\n error={error}\n success={successMessages.transferred({ name: displayName, to: recipientShort })}\n successActions={[{ label: \"Done\", onClick: () => { close(); onSuccess?.(); } }]}\n errorTitle=\"Transfer failed\"\n errorDescription=\"The transaction was submitted, but the transfer could not be completed.\"\n onRetry={retryable ? () => { reset(); setStep(\"form\"); } : undefined}\n onDone={close}\n >\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId}\n fallbackIcon={<ArrowRightLeft className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n {step === \"confirm\" ? (\n <>\n <div className=\"flex items-end justify-between px-6 pt-3 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{displayName}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5 tabular-nums truncate\">→ {recipientShort}</p>\n </div>\n </div>\n <MarketplaceConfirmStep\n description=\"Transfer this asset? This action cannot be undone.\"\n error={error}\n secondaryLabel=\"Back\"\n onSecondary={() => { reset(); setStep(\"form\"); }}\n primaryLabel=\"Transfer\"\n onPrimary={() => { if (pendingAddress) onTransfer(pendingAddress); }}\n primaryIcon={<ArrowRightLeft className=\"h-4 w-4\" />}\n footer={footer}\n />\n </>\n ) : (\n <div className=\"px-5 pb-4 pt-3 space-y-3\">\n <p className=\"font-bold text-base leading-tight truncate\">{displayName}</p>\n\n {hasActiveListing && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n This token has an active listing. A buyer could still complete the purchase after you transfer it — cancel the listing first, or proceed with caution.\n </AlertDescription>\n </Alert>\n )}\n\n <Alert>\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n Transfers are permanent and irreversible. Double-check the recipient address before confirming.\n </AlertDescription>\n </Alert>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-3\">\n <FormField\n control={form.control}\n name=\"toAddress\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Recipient address</FormLabel>\n <FormControl>\n <Input placeholder=\"0x…\" autoComplete=\"off\" spellCheck={false} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"pt-1 space-y-2\">\n <div className=\"btn-border-animated p-[1px] rounded-xl\">\n <button\n type=\"submit\"\n disabled={!canTransfer}\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n >\n <ArrowRightLeft className=\"h-4 w-4\" />\n {canTransfer ? \"Transfer\" : connectLabel}\n </button>\n </div>\n {footer}\n </div>\n </form>\n </Form>\n </div>\n )}\n </TransactionDialogStates>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkHI;AAhHJ,mBAAoC;AACpC,6BAAwB;AACxB,iBAA4B;AAC5B,QAAmB;AACnB,0BAAyD;AACzD,oBAAsE;AACtE,kBAA+E;AAC/E,mBAAsB;AACtB,mBAAwC;AACxC,2CAA8D;AAC9D,uCAAwC;AACxC,6BAAmD;AACnD,8BAAgC;AAEhC,MAAM,SAAS,EAAE,OAAO;AAAA,EACtB,WAAW,EACR,OAAO,EACP,IAAI,GAAG,+BAA+B,EACtC,MAAM,yBAAyB,kEAAkE;AACtG,CAAC;AA4BM,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,EAAE,OAAO,QAAQ,OAAO,YAAY,MAAM,MAAM,IAAI;AAC1D,QAAM,WAAO,oCAAY,KAAK;AA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* as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { TransactionPhase } from '../utils/use-transaction.cjs';
|
|
3
|
+
import '@medialane/sdk/starknet';
|
|
4
|
+
import './fast-mint/types.cjs';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'starknet';
|
|
7
|
+
import '@medialane/sdk';
|
|
8
|
+
|
|
9
|
+
interface TransferDialogProps {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onOpenChange: (open: boolean) => void;
|
|
12
|
+
tokenId: string;
|
|
13
|
+
tokenName?: string;
|
|
14
|
+
tokenImage?: string | null;
|
|
15
|
+
hasActiveListing?: boolean;
|
|
16
|
+
walletAddress?: string | null;
|
|
17
|
+
canTransfer: boolean;
|
|
18
|
+
connectLabel: string;
|
|
19
|
+
footerNote: string;
|
|
20
|
+
tx: {
|
|
21
|
+
phase: TransactionPhase;
|
|
22
|
+
txHash: string | null;
|
|
23
|
+
error: string | null;
|
|
24
|
+
retryable?: boolean;
|
|
25
|
+
reset: () => void;
|
|
26
|
+
};
|
|
27
|
+
onTransfer: (toAddress: string) => void;
|
|
28
|
+
onSuccess?: () => void;
|
|
29
|
+
}
|
|
30
|
+
declare function TransferDialog({ open, onOpenChange, tokenId, tokenName, tokenImage, hasActiveListing, walletAddress, canTransfer, connectLabel, footerNote, tx, onTransfer, onSuccess, }: TransferDialogProps): react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { TransferDialog, type TransferDialogProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { TransactionPhase } from '../utils/use-transaction.js';
|
|
3
|
+
import '@medialane/sdk/starknet';
|
|
4
|
+
import './fast-mint/types.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'starknet';
|
|
7
|
+
import '@medialane/sdk';
|
|
8
|
+
|
|
9
|
+
interface TransferDialogProps {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onOpenChange: (open: boolean) => void;
|
|
12
|
+
tokenId: string;
|
|
13
|
+
tokenName?: string;
|
|
14
|
+
tokenImage?: string | null;
|
|
15
|
+
hasActiveListing?: boolean;
|
|
16
|
+
walletAddress?: string | null;
|
|
17
|
+
canTransfer: boolean;
|
|
18
|
+
connectLabel: string;
|
|
19
|
+
footerNote: string;
|
|
20
|
+
tx: {
|
|
21
|
+
phase: TransactionPhase;
|
|
22
|
+
txHash: string | null;
|
|
23
|
+
error: string | null;
|
|
24
|
+
retryable?: boolean;
|
|
25
|
+
reset: () => void;
|
|
26
|
+
};
|
|
27
|
+
onTransfer: (toAddress: string) => void;
|
|
28
|
+
onSuccess?: () => void;
|
|
29
|
+
}
|
|
30
|
+
declare function TransferDialog({ open, onOpenChange, tokenId, tokenName, tokenImage, hasActiveListing, walletAddress, canTransfer, connectLabel, footerNote, tx, onTransfer, onSuccess, }: TransferDialogProps): react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { TransferDialog, type TransferDialogProps };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { useForm } from "react-hook-form";
|
|
5
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import { AlertCircle, ArrowRightLeft, ShieldCheck } from "lucide-react";
|
|
8
|
+
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "./dialog.js";
|
|
9
|
+
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "./form.js";
|
|
10
|
+
import { Input } from "./input.js";
|
|
11
|
+
import { Alert, AlertDescription } from "./alert.js";
|
|
12
|
+
import { MarketplaceConfirmStep, MarketplaceDialogHero } from "./marketplace-dialog-primitives.js";
|
|
13
|
+
import { TransactionDialogStates } from "./transaction-dialog-states.js";
|
|
14
|
+
import { isBusyPhase } from "../utils/use-transaction.js";
|
|
15
|
+
import { successMessages } from "../utils/success-messages.js";
|
|
16
|
+
const schema = z.object({
|
|
17
|
+
toAddress: z.string().min(1, "Recipient address is required").regex(/^0x[0-9a-fA-F]{1,64}$/, "Must be a valid Starknet address (0x followed by hex characters)")
|
|
18
|
+
});
|
|
19
|
+
function TransferDialog({
|
|
20
|
+
open,
|
|
21
|
+
onOpenChange,
|
|
22
|
+
tokenId,
|
|
23
|
+
tokenName,
|
|
24
|
+
tokenImage,
|
|
25
|
+
hasActiveListing = false,
|
|
26
|
+
walletAddress,
|
|
27
|
+
canTransfer,
|
|
28
|
+
connectLabel,
|
|
29
|
+
footerNote,
|
|
30
|
+
tx,
|
|
31
|
+
onTransfer,
|
|
32
|
+
onSuccess
|
|
33
|
+
}) {
|
|
34
|
+
const { phase, txHash, error, retryable = true, reset } = tx;
|
|
35
|
+
const busy = isBusyPhase(phase);
|
|
36
|
+
const [step, setStep] = useState("form");
|
|
37
|
+
const [pendingAddress, setPendingAddress] = useState(null);
|
|
38
|
+
const form = useForm({
|
|
39
|
+
resolver: zodResolver(schema),
|
|
40
|
+
defaultValues: { toAddress: "" }
|
|
41
|
+
});
|
|
42
|
+
const resetDialog = () => {
|
|
43
|
+
reset();
|
|
44
|
+
form.reset();
|
|
45
|
+
setPendingAddress(null);
|
|
46
|
+
setStep("form");
|
|
47
|
+
};
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (open) resetDialog();
|
|
50
|
+
}, [open]);
|
|
51
|
+
const close = () => {
|
|
52
|
+
resetDialog();
|
|
53
|
+
onOpenChange(false);
|
|
54
|
+
};
|
|
55
|
+
const handleClose = (value) => {
|
|
56
|
+
if (!value && !busy && phase !== "success") close();
|
|
57
|
+
};
|
|
58
|
+
const onSubmit = (values) => {
|
|
59
|
+
if (walletAddress) {
|
|
60
|
+
try {
|
|
61
|
+
if (BigInt(values.toAddress) === BigInt(walletAddress)) {
|
|
62
|
+
form.setError("toAddress", { message: "Cannot transfer to yourself" });
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
} catch {
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (!canTransfer) return;
|
|
69
|
+
setPendingAddress(values.toAddress);
|
|
70
|
+
setStep("confirm");
|
|
71
|
+
};
|
|
72
|
+
const displayName = tokenName || `Token #${tokenId}`;
|
|
73
|
+
const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}\u2026${pendingAddress.slice(-6)}` : "";
|
|
74
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-center gap-1.5", children: [
|
|
75
|
+
/* @__PURE__ */ jsx(ShieldCheck, { className: "h-3 w-3 text-muted-foreground shrink-0 mt-0.5" }),
|
|
76
|
+
/* @__PURE__ */ jsx("p", { className: "text-2xs text-center text-muted-foreground", children: footerNote })
|
|
77
|
+
] });
|
|
78
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]", children: [
|
|
79
|
+
/* @__PURE__ */ jsxs(DialogTitle, { className: "sr-only", children: [
|
|
80
|
+
"Transfer ",
|
|
81
|
+
displayName
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ jsx(DialogDescription, { className: "sr-only", children: "Enter a recipient Starknet address to transfer this asset onchain." }),
|
|
84
|
+
/* @__PURE__ */ jsxs(
|
|
85
|
+
TransactionDialogStates,
|
|
86
|
+
{
|
|
87
|
+
phase,
|
|
88
|
+
asset: { name: displayName, image: tokenImage },
|
|
89
|
+
statusMessage: "Confirming on Starknet\u2026",
|
|
90
|
+
txHash,
|
|
91
|
+
error,
|
|
92
|
+
success: successMessages.transferred({ name: displayName, to: recipientShort }),
|
|
93
|
+
successActions: [{ label: "Done", onClick: () => {
|
|
94
|
+
close();
|
|
95
|
+
onSuccess?.();
|
|
96
|
+
} }],
|
|
97
|
+
errorTitle: "Transfer failed",
|
|
98
|
+
errorDescription: "The transaction was submitted, but the transfer could not be completed.",
|
|
99
|
+
onRetry: retryable ? () => {
|
|
100
|
+
reset();
|
|
101
|
+
setStep("form");
|
|
102
|
+
} : void 0,
|
|
103
|
+
onDone: close,
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ jsx(
|
|
106
|
+
MarketplaceDialogHero,
|
|
107
|
+
{
|
|
108
|
+
tokenImage,
|
|
109
|
+
tokenName,
|
|
110
|
+
tokenId,
|
|
111
|
+
fallbackIcon: /* @__PURE__ */ jsx(ArrowRightLeft, { className: "h-12 w-12 text-brand-blue/30" })
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
step === "confirm" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
115
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-end justify-between px-6 pt-3 pb-1", children: /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
116
|
+
/* @__PURE__ */ jsx("p", { className: "font-bold text-lg leading-tight truncate", children: displayName }),
|
|
117
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-0.5 tabular-nums truncate", children: [
|
|
118
|
+
"\u2192 ",
|
|
119
|
+
recipientShort
|
|
120
|
+
] })
|
|
121
|
+
] }) }),
|
|
122
|
+
/* @__PURE__ */ jsx(
|
|
123
|
+
MarketplaceConfirmStep,
|
|
124
|
+
{
|
|
125
|
+
description: "Transfer this asset? This action cannot be undone.",
|
|
126
|
+
error,
|
|
127
|
+
secondaryLabel: "Back",
|
|
128
|
+
onSecondary: () => {
|
|
129
|
+
reset();
|
|
130
|
+
setStep("form");
|
|
131
|
+
},
|
|
132
|
+
primaryLabel: "Transfer",
|
|
133
|
+
onPrimary: () => {
|
|
134
|
+
if (pendingAddress) onTransfer(pendingAddress);
|
|
135
|
+
},
|
|
136
|
+
primaryIcon: /* @__PURE__ */ jsx(ArrowRightLeft, { className: "h-4 w-4" }),
|
|
137
|
+
footer
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "px-5 pb-4 pt-3 space-y-3", children: [
|
|
141
|
+
/* @__PURE__ */ jsx("p", { className: "font-bold text-base leading-tight truncate", children: displayName }),
|
|
142
|
+
hasActiveListing && /* @__PURE__ */ jsxs(Alert, { variant: "destructive", children: [
|
|
143
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
|
|
144
|
+
/* @__PURE__ */ jsx(AlertDescription, { className: "text-xs", children: "This token has an active listing. A buyer could still complete the purchase after you transfer it \u2014 cancel the listing first, or proceed with caution." })
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ jsxs(Alert, { children: [
|
|
147
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
|
|
148
|
+
/* @__PURE__ */ jsx(AlertDescription, { className: "text-xs", children: "Transfers are permanent and irreversible. Double-check the recipient address before confirming." })
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ jsx(Form, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-3", children: [
|
|
151
|
+
/* @__PURE__ */ jsx(
|
|
152
|
+
FormField,
|
|
153
|
+
{
|
|
154
|
+
control: form.control,
|
|
155
|
+
name: "toAddress",
|
|
156
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
|
|
157
|
+
/* @__PURE__ */ jsx(FormLabel, { children: "Recipient address" }),
|
|
158
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, { placeholder: "0x\u2026", autoComplete: "off", spellCheck: false, ...field }) }),
|
|
159
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
160
|
+
] })
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
error && /* @__PURE__ */ jsxs(Alert, { variant: "destructive", children: [
|
|
164
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
|
|
165
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: error })
|
|
166
|
+
] }),
|
|
167
|
+
/* @__PURE__ */ jsxs("div", { className: "pt-1 space-y-2", children: [
|
|
168
|
+
/* @__PURE__ */ jsx("div", { className: "btn-border-animated p-[1px] rounded-xl", children: /* @__PURE__ */ jsxs(
|
|
169
|
+
"button",
|
|
170
|
+
{
|
|
171
|
+
type: "submit",
|
|
172
|
+
disabled: !canTransfer,
|
|
173
|
+
className: "w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent",
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ jsx(ArrowRightLeft, { className: "h-4 w-4" }),
|
|
176
|
+
canTransfer ? "Transfer" : connectLabel
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
) }),
|
|
180
|
+
footer
|
|
181
|
+
] })
|
|
182
|
+
] }) })
|
|
183
|
+
] })
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
] }) });
|
|
188
|
+
}
|
|
189
|
+
export {
|
|
190
|
+
TransferDialog
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=transfer-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/transfer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { AlertCircle, ArrowRightLeft, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { MarketplaceConfirmStep, MarketplaceDialogHero } from \"./marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"./transaction-dialog-states.js\";\nimport { isBusyPhase, type TransactionPhase } from \"../utils/use-transaction.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\n\nconst schema = z.object({\n toAddress: z\n .string()\n .min(1, \"Recipient address is required\")\n .regex(/^0x[0-9a-fA-F]{1,64}$/, \"Must be a valid Starknet address (0x followed by hex characters)\"),\n});\n\ntype FormValues = z.infer<typeof schema>;\n\ntype Step = \"form\" | \"confirm\";\n\nexport interface TransferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n tokenId: string;\n tokenName?: string;\n tokenImage?: string | null;\n hasActiveListing?: boolean;\n walletAddress?: string | null;\n canTransfer: boolean;\n connectLabel: string;\n footerNote: string;\n tx: {\n phase: TransactionPhase;\n txHash: string | null;\n error: string | null;\n retryable?: boolean;\n reset: () => void;\n };\n onTransfer: (toAddress: string) => void;\n onSuccess?: () => void;\n}\n\nexport function TransferDialog({\n open,\n onOpenChange,\n tokenId,\n tokenName,\n tokenImage,\n hasActiveListing = false,\n walletAddress,\n canTransfer,\n connectLabel,\n footerNote,\n tx,\n onTransfer,\n onSuccess,\n}: TransferDialogProps) {\n const { phase, txHash, error, retryable = true, reset } = tx;\n const busy = isBusyPhase(phase);\n const [step, setStep] = useState<Step>(\"form\");\n const [pendingAddress, setPendingAddress] = useState<string | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { toAddress: \"\" },\n });\n\n const resetDialog = () => {\n reset();\n form.reset();\n setPendingAddress(null);\n setStep(\"form\");\n };\n\n useEffect(() => {\n if (open) resetDialog();\n }, [open]);\n\n const close = () => {\n resetDialog();\n onOpenChange(false);\n };\n\n const handleClose = (value: boolean) => {\n if (!value && !busy && phase !== \"success\") close();\n };\n\n const onSubmit = (values: FormValues) => {\n if (walletAddress) {\n try {\n if (BigInt(values.toAddress) === BigInt(walletAddress)) {\n form.setError(\"toAddress\", { message: \"Cannot transfer to yourself\" });\n return;\n }\n } catch {\n void 0;\n }\n }\n if (!canTransfer) return;\n setPendingAddress(values.toAddress);\n setStep(\"confirm\");\n };\n\n const displayName = tokenName || `Token #${tokenId}`;\n const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}…${pendingAddress.slice(-6)}` : \"\";\n\n const footer = (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{footerNote}</p>\n </div>\n );\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]\">\n <DialogTitle className=\"sr-only\">Transfer {displayName}</DialogTitle>\n <DialogDescription className=\"sr-only\">\n Enter a recipient Starknet address to transfer this asset onchain.\n </DialogDescription>\n\n <TransactionDialogStates\n phase={phase}\n asset={{ name: displayName, image: tokenImage }}\n statusMessage=\"Confirming on Starknet…\"\n txHash={txHash}\n error={error}\n success={successMessages.transferred({ name: displayName, to: recipientShort })}\n successActions={[{ label: \"Done\", onClick: () => { close(); onSuccess?.(); } }]}\n errorTitle=\"Transfer failed\"\n errorDescription=\"The transaction was submitted, but the transfer could not be completed.\"\n onRetry={retryable ? () => { reset(); setStep(\"form\"); } : undefined}\n onDone={close}\n >\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId}\n fallbackIcon={<ArrowRightLeft className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n {step === \"confirm\" ? (\n <>\n <div className=\"flex items-end justify-between px-6 pt-3 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{displayName}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5 tabular-nums truncate\">→ {recipientShort}</p>\n </div>\n </div>\n <MarketplaceConfirmStep\n description=\"Transfer this asset? This action cannot be undone.\"\n error={error}\n secondaryLabel=\"Back\"\n onSecondary={() => { reset(); setStep(\"form\"); }}\n primaryLabel=\"Transfer\"\n onPrimary={() => { if (pendingAddress) onTransfer(pendingAddress); }}\n primaryIcon={<ArrowRightLeft className=\"h-4 w-4\" />}\n footer={footer}\n />\n </>\n ) : (\n <div className=\"px-5 pb-4 pt-3 space-y-3\">\n <p className=\"font-bold text-base leading-tight truncate\">{displayName}</p>\n\n {hasActiveListing && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n This token has an active listing. A buyer could still complete the purchase after you transfer it — cancel the listing first, or proceed with caution.\n </AlertDescription>\n </Alert>\n )}\n\n <Alert>\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n Transfers are permanent and irreversible. Double-check the recipient address before confirming.\n </AlertDescription>\n </Alert>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-3\">\n <FormField\n control={form.control}\n name=\"toAddress\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Recipient address</FormLabel>\n <FormControl>\n <Input placeholder=\"0x…\" autoComplete=\"off\" spellCheck={false} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"pt-1 space-y-2\">\n <div className=\"btn-border-animated p-[1px] rounded-xl\">\n <button\n type=\"submit\"\n disabled={!canTransfer}\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n >\n <ArrowRightLeft className=\"h-4 w-4\" />\n {canTransfer ? \"Transfer\" : connectLabel}\n </button>\n </div>\n {footer}\n </div>\n </form>\n </Form>\n </div>\n )}\n </TransactionDialogStates>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkHI,SAkCQ,UAjCN,KAD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