@medialane/ui 0.378.0 → 0.379.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/account/device-approval-dialog.cjs +1 -1
- package/dist/components/account/device-approval-dialog.cjs.map +1 -1
- package/dist/components/account/device-approval-dialog.js +1 -1
- package/dist/components/account/device-approval-dialog.js.map +1 -1
- package/dist/components/account/devices-section.cjs +1 -1
- package/dist/components/account/devices-section.cjs.map +1 -1
- package/dist/components/account/devices-section.js +1 -1
- package/dist/components/account/devices-section.js.map +1 -1
- package/dist/components/account/guardian-recovery-section.cjs +2 -2
- package/dist/components/account/guardian-recovery-section.cjs.map +1 -1
- package/dist/components/account/guardian-recovery-section.js +2 -2
- package/dist/components/account/guardian-recovery-section.js.map +1 -1
- package/dist/components/action-button.cjs +21 -37
- package/dist/components/action-button.cjs.map +1 -1
- package/dist/components/action-button.d.cts +7 -3
- package/dist/components/action-button.d.ts +7 -3
- package/dist/components/action-button.js +20 -37
- package/dist/components/action-button.js.map +1 -1
- package/dist/components/activity-card.cjs +1 -1
- package/dist/components/activity-card.cjs.map +1 -1
- package/dist/components/activity-card.js +1 -1
- package/dist/components/activity-card.js.map +1 -1
- package/dist/components/activity-row.cjs +1 -1
- package/dist/components/activity-row.cjs.map +1 -1
- package/dist/components/activity-row.js +1 -1
- package/dist/components/activity-row.js.map +1 -1
- package/dist/components/approve-mint-dialog.cjs +7 -14
- package/dist/components/approve-mint-dialog.cjs.map +1 -1
- package/dist/components/approve-mint-dialog.js +7 -14
- package/dist/components/approve-mint-dialog.js.map +1 -1
- package/dist/components/asset-picker.cjs +2 -9
- package/dist/components/asset-picker.cjs.map +1 -1
- package/dist/components/asset-picker.js +2 -9
- package/dist/components/asset-picker.js.map +1 -1
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/club-owner-actions.cjs +5 -11
- package/dist/components/club-owner-actions.cjs.map +1 -1
- package/dist/components/club-owner-actions.js +5 -11
- package/dist/components/club-owner-actions.js.map +1 -1
- package/dist/components/collection-filters-dialog.cjs +2 -8
- package/dist/components/collection-filters-dialog.cjs.map +1 -1
- package/dist/components/collection-filters-dialog.js +2 -8
- package/dist/components/collection-filters-dialog.js.map +1 -1
- package/dist/components/collection-name-claim.cjs +1 -1
- package/dist/components/collection-name-claim.cjs.map +1 -1
- package/dist/components/collection-name-claim.js +1 -1
- package/dist/components/collection-name-claim.js.map +1 -1
- package/dist/components/collection-page.cjs +3 -2
- package/dist/components/collection-page.cjs.map +1 -1
- package/dist/components/collection-page.js +3 -2
- package/dist/components/collection-page.js.map +1 -1
- package/dist/components/collection-settings.cjs +4 -4
- package/dist/components/collection-settings.cjs.map +1 -1
- package/dist/components/collection-settings.js +4 -4
- package/dist/components/collection-settings.js.map +1 -1
- package/dist/components/collection-slug-claim.cjs +3 -3
- package/dist/components/collection-slug-claim.cjs.map +1 -1
- package/dist/components/collection-slug-claim.js +3 -3
- package/dist/components/collection-slug-claim.js.map +1 -1
- package/dist/components/collections-page.cjs +1 -1
- package/dist/components/collections-page.cjs.map +1 -1
- package/dist/components/collections-page.js +1 -1
- package/dist/components/collections-page.js.map +1 -1
- package/dist/components/creator-page.cjs +1 -1
- package/dist/components/creator-page.cjs.map +1 -1
- package/dist/components/creator-page.js +1 -1
- package/dist/components/creator-page.js.map +1 -1
- package/dist/components/drop/create/drop-create.cjs +2 -2
- package/dist/components/drop/create/drop-create.cjs.map +1 -1
- package/dist/components/drop/create/drop-create.js +2 -2
- package/dist/components/drop/create/drop-create.js.map +1 -1
- package/dist/components/drop/create/launch-dialog.cjs +5 -5
- package/dist/components/drop/create/launch-dialog.cjs.map +1 -1
- package/dist/components/drop/create/launch-dialog.js +5 -5
- package/dist/components/drop/create/launch-dialog.js.map +1 -1
- package/dist/components/drop/drop-listing.cjs +2 -1
- package/dist/components/drop/drop-listing.cjs.map +1 -1
- package/dist/components/drop/drop-listing.js +2 -1
- package/dist/components/drop/drop-listing.js.map +1 -1
- package/dist/components/drop/page/drop-action-box.cjs +2 -2
- package/dist/components/drop/page/drop-action-box.cjs.map +1 -1
- package/dist/components/drop/page/drop-action-box.js +2 -2
- package/dist/components/drop/page/drop-action-box.js.map +1 -1
- package/dist/components/drop/page/drop-manage.cjs +6 -6
- package/dist/components/drop/page/drop-manage.cjs.map +1 -1
- package/dist/components/drop/page/drop-manage.js +6 -6
- package/dist/components/drop/page/drop-manage.js.map +1 -1
- package/dist/components/drop/page/drop-mint-dialog.cjs +2 -2
- package/dist/components/drop/page/drop-mint-dialog.cjs.map +1 -1
- package/dist/components/drop/page/drop-mint-dialog.js +2 -2
- package/dist/components/drop/page/drop-mint-dialog.js.map +1 -1
- package/dist/components/drop/page/drop-page.cjs +3 -3
- package/dist/components/drop/page/drop-page.cjs.map +1 -1
- package/dist/components/drop/page/drop-page.js +3 -3
- package/dist/components/drop/page/drop-page.js.map +1 -1
- package/dist/components/drop-item-list.cjs +1 -1
- package/dist/components/drop-item-list.cjs.map +1 -1
- package/dist/components/drop-item-list.js +1 -1
- package/dist/components/drop-item-list.js.map +1 -1
- package/dist/components/editions-page.cjs +15 -35
- package/dist/components/editions-page.cjs.map +1 -1
- package/dist/components/editions-page.js +15 -35
- package/dist/components/editions-page.js.map +1 -1
- package/dist/components/empty-or-error.cjs +2 -2
- package/dist/components/empty-or-error.cjs.map +1 -1
- package/dist/components/empty-or-error.js +2 -2
- package/dist/components/empty-or-error.js.map +1 -1
- package/dist/components/fast-mint/dropzone.cjs +1 -1
- package/dist/components/fast-mint/dropzone.cjs.map +1 -1
- package/dist/components/fast-mint/dropzone.js +1 -1
- package/dist/components/fast-mint/dropzone.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.cjs +5 -17
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.js +5 -17
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/fast-mint/success-view.cjs +1 -1
- package/dist/components/fast-mint/success-view.cjs.map +1 -1
- package/dist/components/fast-mint/success-view.js +1 -1
- package/dist/components/fast-mint/success-view.js.map +1 -1
- package/dist/components/gated-content.cjs +10 -16
- package/dist/components/gated-content.cjs.map +1 -1
- package/dist/components/gated-content.js +10 -16
- package/dist/components/gated-content.js.map +1 -1
- package/dist/components/ip-type-fields.cjs +2 -2
- package/dist/components/ip-type-fields.cjs.map +1 -1
- package/dist/components/ip-type-fields.js +2 -2
- package/dist/components/ip-type-fields.js.map +1 -1
- package/dist/components/ip-type-page.cjs +1 -1
- package/dist/components/ip-type-page.cjs.map +1 -1
- package/dist/components/ip-type-page.js +1 -1
- package/dist/components/ip-type-page.js.map +1 -1
- package/dist/components/launchpad/coin-create.cjs +4 -3
- package/dist/components/launchpad/coin-create.cjs.map +1 -1
- package/dist/components/launchpad/coin-create.js +4 -3
- package/dist/components/launchpad/coin-create.js.map +1 -1
- package/dist/components/launchpad/collection-create-form.cjs +7 -13
- package/dist/components/launchpad/collection-create-form.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-form.js +7 -13
- package/dist/components/launchpad/collection-create-form.js.map +1 -1
- package/dist/components/launchpad/collection-create-presets.cjs +0 -4
- package/dist/components/launchpad/collection-create-presets.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-presets.d.cts +0 -1
- package/dist/components/launchpad/collection-create-presets.d.ts +0 -1
- package/dist/components/launchpad/collection-create-presets.js +0 -4
- package/dist/components/launchpad/collection-create-presets.js.map +1 -1
- package/dist/components/launchpad/collection-picker.cjs +5 -11
- package/dist/components/launchpad/collection-picker.cjs.map +1 -1
- package/dist/components/launchpad/collection-picker.js +5 -11
- package/dist/components/launchpad/collection-picker.js.map +1 -1
- package/dist/components/launchpad/edition-mint-fields.cjs +1 -1
- package/dist/components/launchpad/edition-mint-fields.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint-fields.js +1 -1
- package/dist/components/launchpad/edition-mint-fields.js.map +1 -1
- package/dist/components/launchpad/edition-mint.cjs +1 -1
- package/dist/components/launchpad/edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint.js +1 -1
- package/dist/components/launchpad/edition-mint.js.map +1 -1
- package/dist/components/launchpad/pop-create-fields.cjs +1 -1
- package/dist/components/launchpad/pop-create-fields.cjs.map +1 -1
- package/dist/components/launchpad/pop-create-fields.js +1 -1
- package/dist/components/launchpad/pop-create-fields.js.map +1 -1
- package/dist/components/launchpad/remix-mint.cjs +4 -15
- package/dist/components/launchpad/remix-mint.cjs.map +1 -1
- package/dist/components/launchpad/remix-mint.js +4 -15
- package/dist/components/launchpad/remix-mint.js.map +1 -1
- package/dist/components/launchpad/single-edition-mint.cjs +2 -9
- package/dist/components/launchpad/single-edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/single-edition-mint.js +2 -9
- package/dist/components/launchpad/single-edition-mint.js.map +1 -1
- package/dist/components/launchpad/sponsorship-create.cjs +4 -15
- package/dist/components/launchpad/sponsorship-create.cjs.map +1 -1
- package/dist/components/launchpad/sponsorship-create.js +4 -15
- package/dist/components/launchpad/sponsorship-create.js.map +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs +9 -15
- package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-form.js +9 -15
- package/dist/components/launchpad/tier-mint-form.js.map +1 -1
- package/dist/components/launchpad/tier-mint-presets.cjs +0 -2
- package/dist/components/launchpad/tier-mint-presets.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-presets.d.cts +0 -1
- package/dist/components/launchpad/tier-mint-presets.d.ts +0 -1
- package/dist/components/launchpad/tier-mint-presets.js +0 -2
- package/dist/components/launchpad/tier-mint-presets.js.map +1 -1
- package/dist/components/license-request-page.cjs +7 -14
- package/dist/components/license-request-page.cjs.map +1 -1
- package/dist/components/license-request-page.js +7 -14
- package/dist/components/license-request-page.js.map +1 -1
- package/dist/components/listing-card-menu.cjs +1 -1
- package/dist/components/listing-card-menu.cjs.map +1 -1
- package/dist/components/listing-card-menu.js +1 -1
- package/dist/components/listing-card-menu.js.map +1 -1
- package/dist/components/listing-card.cjs +8 -17
- package/dist/components/listing-card.cjs.map +1 -1
- package/dist/components/listing-card.js +8 -17
- package/dist/components/listing-card.js.map +1 -1
- package/dist/components/listings-grid.cjs +1 -1
- package/dist/components/listings-grid.cjs.map +1 -1
- package/dist/components/listings-grid.js +1 -1
- package/dist/components/listings-grid.js.map +1 -1
- package/dist/components/make-offer-picker.cjs +1 -1
- package/dist/components/make-offer-picker.cjs.map +1 -1
- package/dist/components/make-offer-picker.js +1 -1
- package/dist/components/make-offer-picker.js.map +1 -1
- package/dist/components/marketplace-dialog-primitives.cjs +7 -33
- package/dist/components/marketplace-dialog-primitives.cjs.map +1 -1
- package/dist/components/marketplace-dialog-primitives.js +7 -33
- package/dist/components/marketplace-dialog-primitives.js.map +1 -1
- package/dist/components/media-wallet/quick-action.cjs +3 -3
- package/dist/components/media-wallet/quick-action.cjs.map +1 -1
- package/dist/components/media-wallet/quick-action.d.cts +2 -2
- package/dist/components/media-wallet/quick-action.d.ts +2 -2
- package/dist/components/media-wallet/quick-action.js +4 -4
- package/dist/components/media-wallet/quick-action.js.map +1 -1
- package/dist/components/pop-burn-button.cjs +1 -1
- package/dist/components/pop-burn-button.cjs.map +1 -1
- package/dist/components/pop-burn-button.js +1 -1
- package/dist/components/pop-burn-button.js.map +1 -1
- package/dist/components/pop-manage-page.cjs +4 -4
- package/dist/components/pop-manage-page.cjs.map +1 -1
- package/dist/components/pop-manage-page.js +4 -4
- package/dist/components/pop-manage-page.js.map +1 -1
- package/dist/components/pop-my-events-page.cjs +1 -1
- package/dist/components/pop-my-events-page.cjs.map +1 -1
- package/dist/components/pop-my-events-page.js +1 -1
- package/dist/components/pop-my-events-page.js.map +1 -1
- package/dist/components/portfolio-orders.cjs +2 -2
- package/dist/components/portfolio-orders.cjs.map +1 -1
- package/dist/components/portfolio-orders.js +2 -2
- package/dist/components/portfolio-orders.js.map +1 -1
- package/dist/components/portfolio-sponsorships.cjs +8 -6
- package/dist/components/portfolio-sponsorships.cjs.map +1 -1
- package/dist/components/portfolio-sponsorships.js +8 -6
- package/dist/components/portfolio-sponsorships.js.map +1 -1
- package/dist/components/remix-browse-page.cjs +2 -2
- package/dist/components/remix-browse-page.cjs.map +1 -1
- package/dist/components/remix-browse-page.js +2 -2
- package/dist/components/remix-browse-page.js.map +1 -1
- package/dist/components/report-dialog.cjs +2 -2
- package/dist/components/report-dialog.cjs.map +1 -1
- package/dist/components/report-dialog.js +2 -2
- package/dist/components/report-dialog.js.map +1 -1
- package/dist/components/share-button.cjs +4 -21
- package/dist/components/share-button.cjs.map +1 -1
- package/dist/components/share-button.d.cts +1 -1
- package/dist/components/share-button.d.ts +1 -1
- package/dist/components/share-button.js +4 -21
- package/dist/components/share-button.js.map +1 -1
- package/dist/components/sponsorship-offer-page.cjs +3 -3
- package/dist/components/sponsorship-offer-page.cjs.map +1 -1
- package/dist/components/sponsorship-offer-page.js +3 -3
- package/dist/components/sponsorship-offer-page.js.map +1 -1
- package/dist/components/sponsorship-offers-page.cjs +2 -2
- package/dist/components/sponsorship-offers-page.cjs.map +1 -1
- package/dist/components/sponsorship-offers-page.js +2 -2
- package/dist/components/sponsorship-offers-page.js.map +1 -1
- package/dist/components/token-card.cjs +10 -39
- package/dist/components/token-card.cjs.map +1 -1
- package/dist/components/token-card.js +10 -39
- package/dist/components/token-card.js.map +1 -1
- package/dist/components/transaction-dialog.cjs +1 -1
- package/dist/components/transaction-dialog.cjs.map +1 -1
- package/dist/components/transaction-dialog.js +1 -1
- package/dist/components/transaction-dialog.js.map +1 -1
- package/dist/components/transaction-success.cjs +1 -1
- package/dist/components/transaction-success.cjs.map +1 -1
- package/dist/components/transaction-success.js +1 -1
- package/dist/components/transaction-success.js.map +1 -1
- package/dist/components/transfer-collection-ownership.cjs +1 -1
- package/dist/components/transfer-collection-ownership.cjs.map +1 -1
- package/dist/components/transfer-collection-ownership.js +1 -1
- package/dist/components/transfer-collection-ownership.js.map +1 -1
- package/dist/components/transfer-dialog.cjs +2 -12
- package/dist/components/transfer-dialog.cjs.map +1 -1
- package/dist/components/transfer-dialog.js +2 -12
- package/dist/components/transfer-dialog.js.map +1 -1
- package/dist/components/wallet/export-key-section.cjs +2 -2
- package/dist/components/wallet/export-key-section.cjs.map +1 -1
- package/dist/components/wallet/export-key-section.js +2 -2
- package/dist/components/wallet/export-key-section.js.map +1 -1
- package/dist/components/wallet-required.cjs +2 -12
- package/dist/components/wallet-required.cjs.map +1 -1
- package/dist/components/wallet-required.js +2 -12
- package/dist/components/wallet-required.js.map +1 -1
- package/dist/data/activity.cjs +2 -2
- package/dist/data/activity.cjs.map +1 -1
- package/dist/data/activity.d.cts +1 -1
- package/dist/data/activity.d.ts +1 -1
- package/dist/data/activity.js +2 -2
- package/dist/data/activity.js.map +1 -1
- package/dist/data/brand.cjs +0 -8
- package/dist/data/brand.cjs.map +1 -1
- package/dist/data/brand.d.cts +1 -3
- package/dist/data/brand.d.ts +1 -3
- package/dist/data/brand.js +0 -6
- package/dist/data/brand.js.map +1 -1
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/medialane.css +0 -40
- package/package.json +1 -1
- package/dist/components/gradient-button.cjs +0 -61
- package/dist/components/gradient-button.cjs.map +0 -1
- package/dist/components/gradient-button.d.cts +0 -10
- package/dist/components/gradient-button.d.ts +0 -10
- package/dist/components/gradient-button.js +0 -37
- package/dist/components/gradient-button.js.map +0 -1
|
@@ -8,6 +8,7 @@ import { CurrencyIcon } from "./currency-icon.js";
|
|
|
8
8
|
import { cn } from "../utils/cn.js";
|
|
9
9
|
import { formatDisplayPrice, isStableCurrency } from "../utils/format.js";
|
|
10
10
|
import { useT } from "../i18n/provider.js";
|
|
11
|
+
import { ActionButton } from "./action-button.js";
|
|
11
12
|
function MarketplaceTxLink({ txHash, explorerUrl, className }) {
|
|
12
13
|
return /* @__PURE__ */ jsxs(
|
|
13
14
|
"a",
|
|
@@ -57,14 +58,7 @@ function MarketplaceSignInGate({ title, description, href, ctaLabel = "Set up ac
|
|
|
57
58
|
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: title }),
|
|
58
59
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: description })
|
|
59
60
|
] }),
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
61
|
-
Button,
|
|
62
|
-
{
|
|
63
|
-
asChild: true,
|
|
64
|
-
className: "w-full bg-transparent text-white rounded-[7px] hover:bg-transparent hover:brightness-110 active:scale-[0.98] transition-all",
|
|
65
|
-
children: /* @__PURE__ */ jsx("a", { href, children: ctaLabel })
|
|
66
|
-
}
|
|
67
|
-
) })
|
|
61
|
+
/* @__PURE__ */ jsx(ActionButton, { solid: true, asChild: true, className: "w-full", children: /* @__PURE__ */ jsx("a", { href, children: ctaLabel }) })
|
|
68
62
|
] });
|
|
69
63
|
}
|
|
70
64
|
function MarketplaceErrorState({
|
|
@@ -95,7 +89,7 @@ function MarketplaceErrorState({
|
|
|
95
89
|
] }) : null,
|
|
96
90
|
txHash && /* @__PURE__ */ jsx(MarketplaceTxLink, { txHash, explorerUrl }),
|
|
97
91
|
/* @__PURE__ */ jsxs("div", { className: "flex w-full gap-2", children: [
|
|
98
|
-
onRetry ? /* @__PURE__ */ jsx(Button, { variant: "
|
|
92
|
+
onRetry ? /* @__PURE__ */ jsx(Button, { variant: "soft", className: "flex-1 h-11", onClick: onRetry, children: t("Try again") }) : null,
|
|
99
93
|
/* @__PURE__ */ jsx(Button, { className: "flex-1 h-11", onClick: onDone, children: doneLabel })
|
|
100
94
|
] })
|
|
101
95
|
] });
|
|
@@ -168,7 +162,7 @@ function CurrencyPicker({ currencies, value, onChange, disabled }) {
|
|
|
168
162
|
Button,
|
|
169
163
|
{
|
|
170
164
|
type: "button",
|
|
171
|
-
variant: value === c ? "default" : "
|
|
165
|
+
variant: value === c ? "default" : "soft",
|
|
172
166
|
size: "sm",
|
|
173
167
|
onClick: () => onChange(c),
|
|
174
168
|
disabled,
|
|
@@ -186,7 +180,7 @@ function DurationPicker({ options, value, onChange, disabled }) {
|
|
|
186
180
|
Button,
|
|
187
181
|
{
|
|
188
182
|
type: "button",
|
|
189
|
-
variant: value === opt.seconds ? "default" : "
|
|
183
|
+
variant: value === opt.seconds ? "default" : "soft",
|
|
190
184
|
size: "sm",
|
|
191
185
|
onClick: () => onChange(opt.seconds),
|
|
192
186
|
disabled,
|
|
@@ -227,27 +221,7 @@ function MarketplaceConfirmStep({
|
|
|
227
221
|
onClick: onPrimary,
|
|
228
222
|
children: primaryLabel
|
|
229
223
|
}
|
|
230
|
-
) : /* @__PURE__ */ jsx(
|
|
231
|
-
"div",
|
|
232
|
-
{
|
|
233
|
-
className: cn(
|
|
234
|
-
"btn-border-animated p-[1px] rounded-xl flex-1",
|
|
235
|
-
primaryDisabled && "pointer-events-none"
|
|
236
|
-
),
|
|
237
|
-
children: /* @__PURE__ */ jsxs(
|
|
238
|
-
"button",
|
|
239
|
-
{
|
|
240
|
-
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",
|
|
241
|
-
disabled: primaryDisabled,
|
|
242
|
-
onClick: onPrimary,
|
|
243
|
-
children: [
|
|
244
|
-
primaryIcon,
|
|
245
|
-
primaryLabel
|
|
246
|
-
]
|
|
247
|
-
}
|
|
248
|
-
)
|
|
249
|
-
}
|
|
250
|
-
);
|
|
224
|
+
) : /* @__PURE__ */ jsx(ActionButton, { solid: true, disabled: primaryDisabled, onClick: onPrimary, icon: primaryIcon, className: "flex-1", children: primaryLabel });
|
|
251
225
|
return /* @__PURE__ */ jsxs("div", { className: "px-6 pb-6 pt-3 space-y-4", children: [
|
|
252
226
|
summary,
|
|
253
227
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }),
|
|
@@ -259,7 +233,7 @@ function MarketplaceConfirmStep({
|
|
|
259
233
|
/* @__PURE__ */ jsx(
|
|
260
234
|
Button,
|
|
261
235
|
{
|
|
262
|
-
variant: "
|
|
236
|
+
variant: "soft",
|
|
263
237
|
className: "h-11 flex-1 gap-1.5",
|
|
264
238
|
onClick: onSecondary,
|
|
265
239
|
children: secondaryLabel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/marketplace-dialog-primitives.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport Image from \"./image.js\";\nimport { AlertCircle, ExternalLink, Loader2, Wallet } from \"lucide-react\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { Button } from \"./button.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice, isStableCurrency } from \"../utils/format.js\";\nimport { useT } from \"../i18n/provider.js\";\n\ninterface MarketplaceTxLinkProps {\n txHash: string;\n explorerUrl: string;\n className?: string;\n}\n\nexport function MarketplaceTxLink({ txHash, explorerUrl, className }: MarketplaceTxLinkProps) {\n return (\n <a\n href={`${explorerUrl}/tx/${txHash}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(\n \"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors\",\n className\n )}\n >\n <span className=\"tabular-nums\">{txHash.slice(0, 10)}…{txHash.slice(-8)}</span>\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n );\n}\n\ninterface MarketplaceProcessingStateProps {\n title: string;\n description?: string;\n imageUrl?: string | null;\n imageAlt?: string;\n txHash?: string | null;\n explorerUrl?: string;\n}\n\nexport function MarketplaceProcessingState({\n title,\n description = \"Keep this window open until it finishes.\",\n imageUrl,\n imageAlt = \"Token preview\",\n txHash,\n explorerUrl,\n}: MarketplaceProcessingStateProps) {\n return (\n <div className=\"flex flex-col items-center gap-5 p-6 py-8\">\n {imageUrl ? (\n <div className=\"relative h-20 w-20 rounded-2xl overflow-hidden border border-border\">\n <Image src={imageUrl} alt={imageAlt} fill sizes=\"80px\" className=\"object-cover\" unoptimized />\n <div className=\"absolute inset-0 bg-background/50 flex items-center justify-center\">\n <Loader2 className=\"h-7 w-7 animate-spin text-primary\" />\n </div>\n </div>\n ) : (\n <Loader2 className=\"h-10 w-10 animate-spin text-primary\" />\n )}\n <div className=\"text-center space-y-1\">\n <p className=\"font-semibold\">{title}</p>\n {txHash && explorerUrl ? (\n <MarketplaceTxLink txHash={txHash} explorerUrl={explorerUrl} className=\"mt-1\" />\n ) : null}\n </div>\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n </div>\n );\n}\n\ninterface MarketplaceSignInGateProps {\n title: string;\n description: string;\n href: string;\n ctaLabel?: string;\n}\n\nexport function MarketplaceSignInGate({ title, description, href, ctaLabel = \"Set up account\" }: MarketplaceSignInGateProps) {\n return (\n <div className=\"flex flex-col items-center gap-4 p-6 py-10 text-center\">\n <Wallet className=\"h-10 w-10 text-muted-foreground\" />\n <div>\n <p className=\"font-semibold\">{title}</p>\n <p className=\"text-sm text-muted-foreground mt-1\">{description}</p>\n </div>\n <div className=\"btn-border-animated w-full p-[1px] rounded-lg\">\n <Button\n asChild\n className=\"w-full bg-transparent text-white rounded-[7px] hover:bg-transparent hover:brightness-110 active:scale-[0.98] transition-all\"\n >\n <a href={href}>{ctaLabel}</a>\n </Button>\n </div>\n </div>\n );\n}\n\ninterface MarketplaceErrorStateProps {\n tokenImage?: string | null;\n name: string;\n title: string;\n description: ReactNode;\n error?: string | null;\n txHash?: string | null;\n explorerUrl: string;\n onRetry?: () => void;\n onDone: () => void;\n doneLabel?: string;\n}\n\nexport function MarketplaceErrorState({\n tokenImage,\n name,\n title,\n description,\n error,\n txHash,\n explorerUrl,\n onRetry,\n onDone,\n doneLabel = \"Done\",\n}: MarketplaceErrorStateProps) {\n const t = useT();\n return (\n <div className=\"flex flex-col items-center gap-5 p-6 py-8\">\n {tokenImage ? (\n <div className=\"relative\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden\">\n <Image src={tokenImage} alt={name} fill sizes=\"128px\" className=\"object-cover\" unoptimized />\n </div>\n <div className=\"absolute -bottom-2 -right-2 h-9 w-9 rounded-full bg-destructive flex items-center justify-center border-2 border-background\">\n <AlertCircle className=\"h-5 w-5 text-white\" />\n </div>\n </div>\n ) : (\n <div className=\"h-16 w-16 rounded-full bg-destructive/15 flex items-center justify-center\">\n <AlertCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n )}\n <div className=\"text-center space-y-1 max-w-full\">\n <p className=\"font-bold text-xl break-words\">{title}</p>\n <p className=\"text-sm text-muted-foreground break-words\">{description}</p>\n </div>\n {error ? (\n <Alert variant=\"destructive\" className=\"text-left\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n ) : null}\n {txHash && <MarketplaceTxLink txHash={txHash} explorerUrl={explorerUrl} />}\n <div className=\"flex w-full gap-2\">\n {onRetry ? (\n <Button variant=\"outline\" className=\"flex-1 h-11\" onClick={onRetry}>\n {t(\"Try again\")}\n </Button>\n ) : null}\n <Button className=\"flex-1 h-11\" onClick={onDone}>{doneLabel}</Button>\n </div>\n </div>\n );\n}\n\ninterface MarketplaceDialogHeroProps {\n tokenImage?: string | null;\n tokenName?: string;\n tokenId: string;\n fallbackIcon: ReactNode;\n badge?: ReactNode;\n}\n\nexport function MarketplaceDialogHero({\n tokenImage,\n tokenName,\n tokenId,\n fallbackIcon,\n badge,\n}: MarketplaceDialogHeroProps) {\n const name = tokenName || `Token #${tokenId}`;\n\n return (\n <div className=\"relative flex justify-center pt-6 shrink-0\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden bg-muted\">\n {tokenImage ? (\n <Image src={tokenImage} alt={name} fill sizes=\"128px\" className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"h-full w-full bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent flex items-center justify-center\">\n {fallbackIcon}\n </div>\n )}\n </div>\n {badge}\n </div>\n );\n}\n\ninterface OrderSummaryHeroProps {\n name: string;\n image?: string | null;\n subtitle?: ReactNode;\n tone?: \"default\" | \"destructive\";\n price?: { formatted: string | null; currency: string | null; decimals: number } | null;\n quantity?: number;\n usdTotal?: string | null;\n}\n\nexport function OrderSummaryHero({\n name,\n image,\n subtitle,\n tone = \"default\",\n price: rawPrice,\n quantity = 1,\n usdTotal,\n}: OrderSummaryHeroProps) {\n const price = rawPrice?.formatted && rawPrice.currency\n ? { formatted: rawPrice.formatted, currency: rawPrice.currency, decimals: rawPrice.decimals }\n : null;\n const unit = price ? parseFloat(price.formatted) : null;\n const showTotal = unit !== null && quantity > 1;\n const crypto = price\n ? formatDisplayPrice(showTotal ? (unit! * quantity).toFixed(price.decimals <= 6 ? 2 : 4) : price.formatted)\n : \"\";\n const stable = price ? isStableCurrency(price.currency) : false;\n const face = \"font-[family-name:var(--font-display)] font-extrabold tracking-tight tabular-nums\";\n\n return (\n <div>\n <div className=\"flex justify-center pt-6 shrink-0\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden bg-muted\">\n {image ? (\n <Image src={image} alt={name} fill sizes=\"128px\" className=\"object-cover\" unoptimized />\n ) : (\n <div\n className={cn(\n \"h-full w-full bg-gradient-to-br to-transparent\",\n tone === \"destructive\"\n ? \"from-destructive/20 via-brand-rose/10\"\n : \"from-primary/20 via-brand-purple/10\",\n )}\n />\n )}\n </div>\n </div>\n\n <div className=\"flex items-center justify-between gap-4 px-5 pt-4 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{name}</p>\n {subtitle ? <div className=\"mt-1 text-2xs font-medium text-muted-foreground\">{subtitle}</div> : null}\n </div>\n {price ? (\n <div className=\"shrink-0 text-right\">\n {usdTotal ? (\n <p className={cn(face, \"text-2xl\")}>{usdTotal}</p>\n ) : (\n <p className={cn(\"flex items-center gap-2 justify-end text-2xl\", face)}>\n <span className=\"grid h-6 w-6 shrink-0 place-items-center rounded-full bg-foreground/[0.06]\">\n <CurrencyIcon symbol={price.currency} size={13} />\n </span>\n {crypto}\n </p>\n )}\n <p className=\"mt-0.5 inline-flex items-center justify-end gap-1.5 text-sm font-semibold text-muted-foreground\">\n {usdTotal ? (\n <span className=\"grid h-4 w-4 shrink-0 place-items-center rounded-full bg-foreground/[0.06]\">\n <CurrencyIcon symbol={price.currency} size={10} />\n </span>\n ) : null}\n {usdTotal ? (stable ? price.currency : `${crypto} ${price.currency}`) : price.currency}\n </p>\n {showTotal ? (\n <p className=\"mt-0.5 text-2xs text-muted-foreground/60\">\n {formatDisplayPrice(price.formatted)} × {quantity} {price.currency}\n </p>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n\ninterface CurrencyPickerProps {\n currencies: string[];\n value: string;\n onChange: (value: string) => void;\n disabled?: boolean;\n}\n\nexport function CurrencyPicker({ currencies, value, onChange, disabled }: CurrencyPickerProps) {\n return (\n <div className=\"grid grid-cols-5 gap-1.5\">\n {currencies.map((c) => (\n <Button\n key={c}\n type=\"button\"\n variant={value === c ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => onChange(c)}\n disabled={disabled}\n className=\"gap-1 px-2 text-xs w-full\"\n >\n <CurrencyIcon symbol={c} size={13} className=\"shrink-0\" />\n <span className=\"truncate\">{c}</span>\n </Button>\n ))}\n </div>\n );\n}\n\ninterface DurationPickerProps {\n options: ReadonlyArray<{ label: string; seconds: number }>;\n value: number;\n onChange: (value: number) => void;\n disabled?: boolean;\n}\n\nexport function DurationPicker({ options, value, onChange, disabled }: DurationPickerProps) {\n return (\n <div className=\"grid grid-cols-3 gap-2\">\n {options.map((opt) => (\n <Button\n key={opt.label}\n type=\"button\"\n variant={value === opt.seconds ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => onChange(opt.seconds)}\n disabled={disabled}\n className=\"text-xs\"\n >\n {opt.label}\n </Button>\n ))}\n </div>\n );\n}\n\ninterface ListingAssetSummaryProps {\n name: string;\n image?: string | null;\n fallbackIcon: ReactNode;\n badge?: ReactNode;\n}\n\nexport function ListingAssetSummary({ name, image, fallbackIcon, badge }: ListingAssetSummaryProps) {\n return (\n <div className=\"flex shrink-0 items-center gap-3.5 px-5 pb-1 pt-5 pr-12\">\n <div className=\"relative h-16 w-16 shrink-0 overflow-hidden rounded-xl bg-muted\">\n {image ? (\n <Image src={image} alt={name} fill sizes=\"64px\" className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent\">\n {fallbackIcon}\n </div>\n )}\n </div>\n <div className=\"min-w-0 space-y-1.5\">\n <p className=\"truncate text-base font-semibold leading-tight\">{name}</p>\n {badge}\n </div>\n </div>\n );\n}\n\ninterface MarketplaceConfirmStepProps {\n summary?: ReactNode;\n description: string;\n error?: string | null;\n secondaryLabel: string;\n onSecondary: () => void;\n primaryLabel: string;\n onPrimary: () => void;\n primaryDisabled?: boolean;\n primaryIcon?: ReactNode;\n primaryVariant?: \"default\" | \"destructive\";\n footer?: ReactNode;\n}\n\nexport function MarketplaceConfirmStep({\n summary,\n description,\n error,\n secondaryLabel,\n onSecondary,\n primaryLabel,\n onPrimary,\n primaryDisabled,\n primaryIcon,\n primaryVariant = \"default\",\n footer,\n}: MarketplaceConfirmStepProps) {\n const primaryButton = primaryVariant === \"destructive\" ? (\n <Button\n variant=\"destructive\"\n className=\"flex-1 h-11\"\n disabled={primaryDisabled}\n onClick={onPrimary}\n >\n {primaryLabel}\n </Button>\n ) : (\n <div\n className={cn(\n \"btn-border-animated p-[1px] rounded-xl flex-1\",\n primaryDisabled && \"pointer-events-none\"\n )}\n >\n <button\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 disabled={primaryDisabled}\n onClick={onPrimary}\n >\n {primaryIcon}\n {primaryLabel}\n </button>\n </div>\n );\n\n return (\n <div className=\"px-6 pb-6 pt-3 space-y-4\">\n {summary}\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n {error ? (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n ) : null}\n <div className=\"flex gap-2 pt-1\">\n <Button\n variant=\"outline\"\n className=\"h-11 flex-1 gap-1.5\"\n onClick={onSecondary}\n >\n {secondaryLabel}\n </Button>\n {primaryButton}\n </div>\n {footer}\n </div>\n );\n}\n"],"mappings":";AA6BM,SACA,KADA;AA1BN,OAAO,WAAW;AAClB,SAAS,aAAa,cAAc,SAAS,cAAc;AAC3D,SAAS,OAAO,wBAAwB;AACxC,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,oBAAoB,wBAAwB;AACrD,SAAS,YAAY;AAQd,SAAS,kBAAkB,EAAE,QAAQ,aAAa,UAAU,GAA2B;AAC5F,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,GAAG,WAAW,OAAO,MAAM;AAAA,MACjC,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MAEA;AAAA,6BAAC,UAAK,WAAU,gBAAgB;AAAA,iBAAO,MAAM,GAAG,EAAE;AAAA,UAAE;AAAA,UAAE,OAAO,MAAM,EAAE;AAAA,WAAE;AAAA,QACvE,oBAAC,gBAAa,WAAU,WAAU;AAAA;AAAA;AAAA,EACpC;AAEJ;AAWO,SAAS,2BAA2B;AAAA,EACzC;AAAA,E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AAA,MACC;AAAA,OACH;AAAA,IACC;AAAA,KACH;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/marketplace-dialog-primitives.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport Image from \"./image.js\";\nimport { AlertCircle, ExternalLink, Loader2, Wallet } from \"lucide-react\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { Button } from \"./button.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice, isStableCurrency } from \"../utils/format.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { ActionButton } from \"./action-button.js\";\n\ninterface MarketplaceTxLinkProps {\n txHash: string;\n explorerUrl: string;\n className?: string;\n}\n\nexport function MarketplaceTxLink({ txHash, explorerUrl, className }: MarketplaceTxLinkProps) {\n return (\n <a\n href={`${explorerUrl}/tx/${txHash}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(\n \"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors\",\n className\n )}\n >\n <span className=\"tabular-nums\">{txHash.slice(0, 10)}…{txHash.slice(-8)}</span>\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n );\n}\n\ninterface MarketplaceProcessingStateProps {\n title: string;\n description?: string;\n imageUrl?: string | null;\n imageAlt?: string;\n txHash?: string | null;\n explorerUrl?: string;\n}\n\nexport function MarketplaceProcessingState({\n title,\n description = \"Keep this window open until it finishes.\",\n imageUrl,\n imageAlt = \"Token preview\",\n txHash,\n explorerUrl,\n}: MarketplaceProcessingStateProps) {\n return (\n <div className=\"flex flex-col items-center gap-5 p-6 py-8\">\n {imageUrl ? (\n <div className=\"relative h-20 w-20 rounded-2xl overflow-hidden border border-border\">\n <Image src={imageUrl} alt={imageAlt} fill sizes=\"80px\" className=\"object-cover\" unoptimized />\n <div className=\"absolute inset-0 bg-background/50 flex items-center justify-center\">\n <Loader2 className=\"h-7 w-7 animate-spin text-primary\" />\n </div>\n </div>\n ) : (\n <Loader2 className=\"h-10 w-10 animate-spin text-primary\" />\n )}\n <div className=\"text-center space-y-1\">\n <p className=\"font-semibold\">{title}</p>\n {txHash && explorerUrl ? (\n <MarketplaceTxLink txHash={txHash} explorerUrl={explorerUrl} className=\"mt-1\" />\n ) : null}\n </div>\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n </div>\n );\n}\n\ninterface MarketplaceSignInGateProps {\n title: string;\n description: string;\n href: string;\n ctaLabel?: string;\n}\n\nexport function MarketplaceSignInGate({ title, description, href, ctaLabel = \"Set up account\" }: MarketplaceSignInGateProps) {\n return (\n <div className=\"flex flex-col items-center gap-4 p-6 py-10 text-center\">\n <Wallet className=\"h-10 w-10 text-muted-foreground\" />\n <div>\n <p className=\"font-semibold\">{title}</p>\n <p className=\"text-sm text-muted-foreground mt-1\">{description}</p>\n </div>\n <ActionButton solid asChild className=\"w-full\">\n <a href={href}>{ctaLabel}</a>\n </ActionButton>\n </div>\n );\n}\n\ninterface MarketplaceErrorStateProps {\n tokenImage?: string | null;\n name: string;\n title: string;\n description: ReactNode;\n error?: string | null;\n txHash?: string | null;\n explorerUrl: string;\n onRetry?: () => void;\n onDone: () => void;\n doneLabel?: string;\n}\n\nexport function MarketplaceErrorState({\n tokenImage,\n name,\n title,\n description,\n error,\n txHash,\n explorerUrl,\n onRetry,\n onDone,\n doneLabel = \"Done\",\n}: MarketplaceErrorStateProps) {\n const t = useT();\n return (\n <div className=\"flex flex-col items-center gap-5 p-6 py-8\">\n {tokenImage ? (\n <div className=\"relative\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden\">\n <Image src={tokenImage} alt={name} fill sizes=\"128px\" className=\"object-cover\" unoptimized />\n </div>\n <div className=\"absolute -bottom-2 -right-2 h-9 w-9 rounded-full bg-destructive flex items-center justify-center border-2 border-background\">\n <AlertCircle className=\"h-5 w-5 text-white\" />\n </div>\n </div>\n ) : (\n <div className=\"h-16 w-16 rounded-full bg-destructive/15 flex items-center justify-center\">\n <AlertCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n )}\n <div className=\"text-center space-y-1 max-w-full\">\n <p className=\"font-bold text-xl break-words\">{title}</p>\n <p className=\"text-sm text-muted-foreground break-words\">{description}</p>\n </div>\n {error ? (\n <Alert variant=\"destructive\" className=\"text-left\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n ) : null}\n {txHash && <MarketplaceTxLink txHash={txHash} explorerUrl={explorerUrl} />}\n <div className=\"flex w-full gap-2\">\n {onRetry ? (\n <Button variant=\"soft\" className=\"flex-1 h-11\" onClick={onRetry}>\n {t(\"Try again\")}\n </Button>\n ) : null}\n <Button className=\"flex-1 h-11\" onClick={onDone}>{doneLabel}</Button>\n </div>\n </div>\n );\n}\n\ninterface MarketplaceDialogHeroProps {\n tokenImage?: string | null;\n tokenName?: string;\n tokenId: string;\n fallbackIcon: ReactNode;\n badge?: ReactNode;\n}\n\nexport function MarketplaceDialogHero({\n tokenImage,\n tokenName,\n tokenId,\n fallbackIcon,\n badge,\n}: MarketplaceDialogHeroProps) {\n const name = tokenName || `Token #${tokenId}`;\n\n return (\n <div className=\"relative flex justify-center pt-6 shrink-0\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden bg-muted\">\n {tokenImage ? (\n <Image src={tokenImage} alt={name} fill sizes=\"128px\" className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"h-full w-full bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent flex items-center justify-center\">\n {fallbackIcon}\n </div>\n )}\n </div>\n {badge}\n </div>\n );\n}\n\ninterface OrderSummaryHeroProps {\n name: string;\n image?: string | null;\n subtitle?: ReactNode;\n tone?: \"default\" | \"destructive\";\n price?: { formatted: string | null; currency: string | null; decimals: number } | null;\n quantity?: number;\n usdTotal?: string | null;\n}\n\nexport function OrderSummaryHero({\n name,\n image,\n subtitle,\n tone = \"default\",\n price: rawPrice,\n quantity = 1,\n usdTotal,\n}: OrderSummaryHeroProps) {\n const price = rawPrice?.formatted && rawPrice.currency\n ? { formatted: rawPrice.formatted, currency: rawPrice.currency, decimals: rawPrice.decimals }\n : null;\n const unit = price ? parseFloat(price.formatted) : null;\n const showTotal = unit !== null && quantity > 1;\n const crypto = price\n ? formatDisplayPrice(showTotal ? (unit! * quantity).toFixed(price.decimals <= 6 ? 2 : 4) : price.formatted)\n : \"\";\n const stable = price ? isStableCurrency(price.currency) : false;\n const face = \"font-[family-name:var(--font-display)] font-extrabold tracking-tight tabular-nums\";\n\n return (\n <div>\n <div className=\"flex justify-center pt-6 shrink-0\">\n <div className=\"relative h-32 w-32 rounded-2xl overflow-hidden bg-muted\">\n {image ? (\n <Image src={image} alt={name} fill sizes=\"128px\" className=\"object-cover\" unoptimized />\n ) : (\n <div\n className={cn(\n \"h-full w-full bg-gradient-to-br to-transparent\",\n tone === \"destructive\"\n ? \"from-destructive/20 via-brand-rose/10\"\n : \"from-primary/20 via-brand-purple/10\",\n )}\n />\n )}\n </div>\n </div>\n\n <div className=\"flex items-center justify-between gap-4 px-5 pt-4 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{name}</p>\n {subtitle ? <div className=\"mt-1 text-2xs font-medium text-muted-foreground\">{subtitle}</div> : null}\n </div>\n {price ? (\n <div className=\"shrink-0 text-right\">\n {usdTotal ? (\n <p className={cn(face, \"text-2xl\")}>{usdTotal}</p>\n ) : (\n <p className={cn(\"flex items-center gap-2 justify-end text-2xl\", face)}>\n <span className=\"grid h-6 w-6 shrink-0 place-items-center rounded-full bg-foreground/[0.06]\">\n <CurrencyIcon symbol={price.currency} size={13} />\n </span>\n {crypto}\n </p>\n )}\n <p className=\"mt-0.5 inline-flex items-center justify-end gap-1.5 text-sm font-semibold text-muted-foreground\">\n {usdTotal ? (\n <span className=\"grid h-4 w-4 shrink-0 place-items-center rounded-full bg-foreground/[0.06]\">\n <CurrencyIcon symbol={price.currency} size={10} />\n </span>\n ) : null}\n {usdTotal ? (stable ? price.currency : `${crypto} ${price.currency}`) : price.currency}\n </p>\n {showTotal ? (\n <p className=\"mt-0.5 text-2xs text-muted-foreground/60\">\n {formatDisplayPrice(price.formatted)} × {quantity} {price.currency}\n </p>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n\ninterface CurrencyPickerProps {\n currencies: string[];\n value: string;\n onChange: (value: string) => void;\n disabled?: boolean;\n}\n\nexport function CurrencyPicker({ currencies, value, onChange, disabled }: CurrencyPickerProps) {\n return (\n <div className=\"grid grid-cols-5 gap-1.5\">\n {currencies.map((c) => (\n <Button\n key={c}\n type=\"button\"\n variant={value === c ? \"default\" : \"soft\"}\n size=\"sm\"\n onClick={() => onChange(c)}\n disabled={disabled}\n className=\"gap-1 px-2 text-xs w-full\"\n >\n <CurrencyIcon symbol={c} size={13} className=\"shrink-0\" />\n <span className=\"truncate\">{c}</span>\n </Button>\n ))}\n </div>\n );\n}\n\ninterface DurationPickerProps {\n options: ReadonlyArray<{ label: string; seconds: number }>;\n value: number;\n onChange: (value: number) => void;\n disabled?: boolean;\n}\n\nexport function DurationPicker({ options, value, onChange, disabled }: DurationPickerProps) {\n return (\n <div className=\"grid grid-cols-3 gap-2\">\n {options.map((opt) => (\n <Button\n key={opt.label}\n type=\"button\"\n variant={value === opt.seconds ? \"default\" : \"soft\"}\n size=\"sm\"\n onClick={() => onChange(opt.seconds)}\n disabled={disabled}\n className=\"text-xs\"\n >\n {opt.label}\n </Button>\n ))}\n </div>\n );\n}\n\ninterface ListingAssetSummaryProps {\n name: string;\n image?: string | null;\n fallbackIcon: ReactNode;\n badge?: ReactNode;\n}\n\nexport function ListingAssetSummary({ name, image, fallbackIcon, badge }: ListingAssetSummaryProps) {\n return (\n <div className=\"flex shrink-0 items-center gap-3.5 px-5 pb-1 pt-5 pr-12\">\n <div className=\"relative h-16 w-16 shrink-0 overflow-hidden rounded-xl bg-muted\">\n {image ? (\n <Image src={image} alt={name} fill sizes=\"64px\" className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center bg-gradient-to-br from-brand-blue/20 via-brand-purple/10 to-transparent\">\n {fallbackIcon}\n </div>\n )}\n </div>\n <div className=\"min-w-0 space-y-1.5\">\n <p className=\"truncate text-base font-semibold leading-tight\">{name}</p>\n {badge}\n </div>\n </div>\n );\n}\n\ninterface MarketplaceConfirmStepProps {\n summary?: ReactNode;\n description: string;\n error?: string | null;\n secondaryLabel: string;\n onSecondary: () => void;\n primaryLabel: string;\n onPrimary: () => void;\n primaryDisabled?: boolean;\n primaryIcon?: ReactNode;\n primaryVariant?: \"default\" | \"destructive\";\n footer?: ReactNode;\n}\n\nexport function MarketplaceConfirmStep({\n summary,\n description,\n error,\n secondaryLabel,\n onSecondary,\n primaryLabel,\n onPrimary,\n primaryDisabled,\n primaryIcon,\n primaryVariant = \"default\",\n footer,\n}: MarketplaceConfirmStepProps) {\n const primaryButton = primaryVariant === \"destructive\" ? (\n <Button\n variant=\"destructive\"\n className=\"flex-1 h-11\"\n disabled={primaryDisabled}\n onClick={onPrimary}\n >\n {primaryLabel}\n </Button>\n ) : (\n <ActionButton solid disabled={primaryDisabled} onClick={onPrimary} icon={primaryIcon} className=\"flex-1\">\n {primaryLabel}\n </ActionButton>\n );\n\n return (\n <div className=\"px-6 pb-6 pt-3 space-y-4\">\n {summary}\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n {error ? (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n ) : null}\n <div className=\"flex gap-2 pt-1\">\n <Button\n variant=\"soft\"\n className=\"h-11 flex-1 gap-1.5\"\n onClick={onSecondary}\n >\n {secondaryLabel}\n </Button>\n {primaryButton}\n </div>\n {footer}\n </div>\n );\n}\n"],"mappings":";AA8BM,SACA,KADA;AA3BN,OAAO,WAAW;AAClB,SAAS,aAAa,cAAc,SAAS,cAAc;AAC3D,SAA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S,WAAW,MAAM,aAAa,WAAU,UAC7F,wBACH;AAGF,SACE,qBAAC,SAAI,WAAU,4BACZ;AAAA;AAAA,IACD,oBAAC,OAAE,WAAU,iCAAiC,uBAAY;AAAA,IACzD,QACC,qBAAC,SAAM,SAAQ,eACb;AAAA,0BAAC,eAAY,WAAU,WAAU;AAAA,MACjC,oBAAC,oBAAkB,iBAAM;AAAA,OAC3B,IACE;AAAA,IACJ,qBAAC,SAAI,WAAU,mBACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,SAAS;AAAA,UAER;AAAA;AAAA,MACH;AAAA,MACC;AAAA,OACH;AAAA,IACC;AAAA,KACH;AAEJ;","names":[]}
|
|
@@ -24,6 +24,7 @@ __export(quick_action_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(quick_action_exports);
|
|
25
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
26
|
var import_brand = require("../../data/brand.js");
|
|
27
|
+
var import_action_button = require("../action-button.js");
|
|
27
28
|
function QuickAction({
|
|
28
29
|
label,
|
|
29
30
|
icon,
|
|
@@ -31,7 +32,6 @@ function QuickAction({
|
|
|
31
32
|
onClick,
|
|
32
33
|
disabled
|
|
33
34
|
}) {
|
|
34
|
-
const grad = `linear-gradient(115deg, ${import_brand.ACTION_GRADIENTS[action].join(",")})`;
|
|
35
35
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
36
36
|
"button",
|
|
37
37
|
{
|
|
@@ -42,8 +42,8 @@ function QuickAction({
|
|
|
42
42
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
43
|
"span",
|
|
44
44
|
{
|
|
45
|
-
className: "
|
|
46
|
-
style: {
|
|
45
|
+
className: "grid h-12 w-12 place-items-center rounded-[15px] transition-transform group-active:scale-95",
|
|
46
|
+
style: { backgroundImage: (0, import_action_button.actionFill)(import_brand.ACTION_PAIRS[action]), color: import_brand.ACTION_FOREGROUNDS[action] },
|
|
47
47
|
children: icon
|
|
48
48
|
}
|
|
49
49
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/media-wallet/quick-action.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/media-wallet/quick-action.tsx"],"sourcesContent":["\"use client\";\n\nimport { ACTION_FOREGROUNDS, ACTION_PAIRS } from \"../../data/brand.js\";\nimport { actionFill } from \"../action-button.js\";\n\nexport function QuickAction({\n label,\n icon,\n action,\n onClick,\n disabled,\n}: {\n label: string;\n icon: React.ReactNode;\n action: keyof typeof ACTION_PAIRS;\n onClick?: () => void;\n disabled?: boolean;\n}) {\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n className={`group flex flex-col items-center gap-1.5 ${disabled ? \"pointer-events-none opacity-40\" : \"\"}`}\n >\n <span\n className=\"grid h-12 w-12 place-items-center rounded-[15px] transition-transform group-active:scale-95\"\n style={{ backgroundImage: actionFill(ACTION_PAIRS[action]), color: ACTION_FOREGROUNDS[action] }}\n >\n {icon}\n </span>\n <span className=\"text-2xs font-medium text-muted-foreground\">{label}</span>\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBI;AAjBJ,mBAAiD;AACjD,2BAA2B;AAEpB,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMG;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW,4CAA4C,WAAW,mCAAmC,EAAE;AAAA,MAEvG;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO,EAAE,qBAAiB,iCAAW,0BAAa,MAAM,CAAC,GAAG,OAAO,gCAAmB,MAAM,EAAE;AAAA,YAE7F;AAAA;AAAA,QACH;AAAA,QACA,4CAAC,UAAK,WAAU,8CAA8C,iBAAM;AAAA;AAAA;AAAA,EACtE;AAEJ;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { ACTION_PAIRS } from '../../data/brand.cjs';
|
|
3
3
|
|
|
4
4
|
declare function QuickAction({ label, icon, action, onClick, disabled, }: {
|
|
5
5
|
label: string;
|
|
6
6
|
icon: React.ReactNode;
|
|
7
|
-
action: keyof typeof
|
|
7
|
+
action: keyof typeof ACTION_PAIRS;
|
|
8
8
|
onClick?: () => void;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { ACTION_PAIRS } from '../../data/brand.js';
|
|
3
3
|
|
|
4
4
|
declare function QuickAction({ label, icon, action, onClick, disabled, }: {
|
|
5
5
|
label: string;
|
|
6
6
|
icon: React.ReactNode;
|
|
7
|
-
action: keyof typeof
|
|
7
|
+
action: keyof typeof ACTION_PAIRS;
|
|
8
8
|
onClick?: () => void;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { ACTION_FOREGROUNDS, ACTION_PAIRS } from "../../data/brand.js";
|
|
4
|
+
import { actionFill } from "../action-button.js";
|
|
4
5
|
function QuickAction({
|
|
5
6
|
label,
|
|
6
7
|
icon,
|
|
@@ -8,7 +9,6 @@ function QuickAction({
|
|
|
8
9
|
onClick,
|
|
9
10
|
disabled
|
|
10
11
|
}) {
|
|
11
|
-
const grad = `linear-gradient(115deg, ${ACTION_GRADIENTS[action].join(",")})`;
|
|
12
12
|
return /* @__PURE__ */ jsxs(
|
|
13
13
|
"button",
|
|
14
14
|
{
|
|
@@ -19,8 +19,8 @@ function QuickAction({
|
|
|
19
19
|
/* @__PURE__ */ jsx(
|
|
20
20
|
"span",
|
|
21
21
|
{
|
|
22
|
-
className: "
|
|
23
|
-
style: {
|
|
22
|
+
className: "grid h-12 w-12 place-items-center rounded-[15px] transition-transform group-active:scale-95",
|
|
23
|
+
style: { backgroundImage: actionFill(ACTION_PAIRS[action]), color: ACTION_FOREGROUNDS[action] },
|
|
24
24
|
children: icon
|
|
25
25
|
}
|
|
26
26
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/media-wallet/quick-action.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/media-wallet/quick-action.tsx"],"sourcesContent":["\"use client\";\n\nimport { ACTION_FOREGROUNDS, ACTION_PAIRS } from \"../../data/brand.js\";\nimport { actionFill } from \"../action-button.js\";\n\nexport function QuickAction({\n label,\n icon,\n action,\n onClick,\n disabled,\n}: {\n label: string;\n icon: React.ReactNode;\n action: keyof typeof ACTION_PAIRS;\n onClick?: () => void;\n disabled?: boolean;\n}) {\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n className={`group flex flex-col items-center gap-1.5 ${disabled ? \"pointer-events-none opacity-40\" : \"\"}`}\n >\n <span\n className=\"grid h-12 w-12 place-items-center rounded-[15px] transition-transform group-active:scale-95\"\n style={{ backgroundImage: actionFill(ACTION_PAIRS[action]), color: ACTION_FOREGROUNDS[action] }}\n >\n {icon}\n </span>\n <span className=\"text-2xs font-medium text-muted-foreground\">{label}</span>\n </button>\n );\n}\n"],"mappings":";AAmBI,SAKE,KALF;AAjBJ,SAAS,oBAAoB,oBAAoB;AACjD,SAAS,kBAAkB;AAEpB,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMG;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW,4CAA4C,WAAW,mCAAmC,EAAE;AAAA,MAEvG;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO,EAAE,iBAAiB,WAAW,aAAa,MAAM,CAAC,GAAG,OAAO,mBAAmB,MAAM,EAAE;AAAA,YAE7F;AAAA;AAAA,QACH;AAAA,QACA,oBAAC,UAAK,WAAU,8CAA8C,iBAAM;AAAA;AAAA;AAAA,EACtE;AAEJ;","names":[]}
|
|
@@ -55,7 +55,7 @@ function PopBurnButton({ collectionAddress, tokenId, onBurned }) {
|
|
|
55
55
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: t("Burning removes this certificate permanently.") }),
|
|
56
56
|
tx.phase === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: tx.error }),
|
|
57
57
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-2", children: [
|
|
58
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "soft", size: "sm", className: "flex-1", disabled: busy, onClick: () => setConfirming(false), children: t("Keep it") }),
|
|
59
59
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "destructive", size: "sm", className: "flex-1", disabled: busy, onClick: remove, children: busy ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : t("Remove") })
|
|
60
60
|
] })
|
|
61
61
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/pop-burn-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Loader2, Trash2 } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface PopBurnButtonProps {\n collectionAddress: string;\n tokenId: string;\n onBurned?: () => void;\n}\n\nexport function PopBurnButton({ collectionAddress, tokenId, onBurned }: PopBurnButtonProps) {\n const t = useT();\n const app = useMedialaneApp();\n const [confirming, setConfirming] = useState(false);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n if (tx.phase === \"success\") onBurned?.();\n }, [tx.phase, onBurned]);\n\n if (tx.phase === \"success\") {\n return <p className=\"text-xs text-muted-foreground\">{t(\"Removed from your wallet.\")}</p>;\n }\n\n if (!confirming) {\n return (\n <Button variant=\"ghost\" size=\"sm\" className=\"text-muted-foreground\" onClick={() => setConfirming(true)}>\n <Trash2 className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Remove from my wallet\")}\n </Button>\n );\n }\n\n const remove = () =>\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-burn\", { owner: signer.address, collection: collectionAddress, tokenId: String(tokenId) }));\n });\n\n return (\n <div className=\"space-y-2 rounded-xl border border-border p-3\">\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Burning removes this certificate permanently.\")}\n </p>\n {tx.phase === \"error\" && <p className=\"text-xs text-destructive\">{tx.error}</p>}\n <div className=\"flex gap-2\">\n <Button variant=\"
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-burn-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Loader2, Trash2 } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface PopBurnButtonProps {\n collectionAddress: string;\n tokenId: string;\n onBurned?: () => void;\n}\n\nexport function PopBurnButton({ collectionAddress, tokenId, onBurned }: PopBurnButtonProps) {\n const t = useT();\n const app = useMedialaneApp();\n const [confirming, setConfirming] = useState(false);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n if (tx.phase === \"success\") onBurned?.();\n }, [tx.phase, onBurned]);\n\n if (tx.phase === \"success\") {\n return <p className=\"text-xs text-muted-foreground\">{t(\"Removed from your wallet.\")}</p>;\n }\n\n if (!confirming) {\n return (\n <Button variant=\"ghost\" size=\"sm\" className=\"text-muted-foreground\" onClick={() => setConfirming(true)}>\n <Trash2 className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Remove from my wallet\")}\n </Button>\n );\n }\n\n const remove = () =>\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-burn\", { owner: signer.address, collection: collectionAddress, tokenId: String(tokenId) }));\n });\n\n return (\n <div className=\"space-y-2 rounded-xl border border-border p-3\">\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Burning removes this certificate permanently.\")}\n </p>\n {tx.phase === \"error\" && <p className=\"text-xs text-destructive\">{tx.error}</p>}\n <div className=\"flex gap-2\">\n <Button variant=\"soft\" size=\"sm\" className=\"flex-1\" disabled={busy} onClick={() => setConfirming(false)}>\n {t(\"Keep it\")}\n </Button>\n <Button variant=\"destructive\" size=\"sm\" className=\"flex-1\" disabled={busy} onClick={remove}>\n {busy ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : t(\"Remove\")}\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BW;AA1BX,mBAAoC;AACpC,0BAAgC;AAChC,oBAAuB;AACvB,2BAAgC;AAChC,8BAA+B;AAC/B,6BAA+B;AAC/B,sBAAqB;AAQd,SA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K,MAAK,WAAU,UAAS,UAAU,MAAM,SAAS,QACjF,iBAAO,4CAAC,+BAAQ,WAAU,4BAA2B,IAAK,EAAE,QAAQ,GACvE;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -32,7 +32,7 @@ function PopBurnButton({ collectionAddress, tokenId, onBurned }) {
|
|
|
32
32
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("Burning removes this certificate permanently.") }),
|
|
33
33
|
tx.phase === "error" && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: tx.error }),
|
|
34
34
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
35
|
-
/* @__PURE__ */ jsx(Button, { variant: "
|
|
35
|
+
/* @__PURE__ */ jsx(Button, { variant: "soft", size: "sm", className: "flex-1", disabled: busy, onClick: () => setConfirming(false), children: t("Keep it") }),
|
|
36
36
|
/* @__PURE__ */ jsx(Button, { variant: "destructive", size: "sm", className: "flex-1", disabled: busy, onClick: remove, children: busy ? /* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : t("Remove") })
|
|
37
37
|
] })
|
|
38
38
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/pop-burn-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Loader2, Trash2 } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface PopBurnButtonProps {\n collectionAddress: string;\n tokenId: string;\n onBurned?: () => void;\n}\n\nexport function PopBurnButton({ collectionAddress, tokenId, onBurned }: PopBurnButtonProps) {\n const t = useT();\n const app = useMedialaneApp();\n const [confirming, setConfirming] = useState(false);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n if (tx.phase === \"success\") onBurned?.();\n }, [tx.phase, onBurned]);\n\n if (tx.phase === \"success\") {\n return <p className=\"text-xs text-muted-foreground\">{t(\"Removed from your wallet.\")}</p>;\n }\n\n if (!confirming) {\n return (\n <Button variant=\"ghost\" size=\"sm\" className=\"text-muted-foreground\" onClick={() => setConfirming(true)}>\n <Trash2 className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Remove from my wallet\")}\n </Button>\n );\n }\n\n const remove = () =>\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-burn\", { owner: signer.address, collection: collectionAddress, tokenId: String(tokenId) }));\n });\n\n return (\n <div className=\"space-y-2 rounded-xl border border-border p-3\">\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Burning removes this certificate permanently.\")}\n </p>\n {tx.phase === \"error\" && <p className=\"text-xs text-destructive\">{tx.error}</p>}\n <div className=\"flex gap-2\">\n <Button variant=\"
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-burn-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Loader2, Trash2 } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface PopBurnButtonProps {\n collectionAddress: string;\n tokenId: string;\n onBurned?: () => void;\n}\n\nexport function PopBurnButton({ collectionAddress, tokenId, onBurned }: PopBurnButtonProps) {\n const t = useT();\n const app = useMedialaneApp();\n const [confirming, setConfirming] = useState(false);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n if (tx.phase === \"success\") onBurned?.();\n }, [tx.phase, onBurned]);\n\n if (tx.phase === \"success\") {\n return <p className=\"text-xs text-muted-foreground\">{t(\"Removed from your wallet.\")}</p>;\n }\n\n if (!confirming) {\n return (\n <Button variant=\"ghost\" size=\"sm\" className=\"text-muted-foreground\" onClick={() => setConfirming(true)}>\n <Trash2 className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Remove from my wallet\")}\n </Button>\n );\n }\n\n const remove = () =>\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-burn\", { owner: signer.address, collection: collectionAddress, tokenId: String(tokenId) }));\n });\n\n return (\n <div className=\"space-y-2 rounded-xl border border-border p-3\">\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Burning removes this certificate permanently.\")}\n </p>\n {tx.phase === \"error\" && <p className=\"text-xs text-destructive\">{tx.error}</p>}\n <div className=\"flex gap-2\">\n <Button variant=\"soft\" size=\"sm\" className=\"flex-1\" disabled={busy} onClick={() => setConfirming(false)}>\n {t(\"Keep it\")}\n </Button>\n <Button variant=\"destructive\" size=\"sm\" className=\"flex-1\" disabled={busy} onClick={remove}>\n {busy ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : t(\"Remove\")}\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";AA4BW,cAKL,YALK;AA1BX,SAAS,WAAW,gBAAgB;AACpC,SAAS,SAAS,cAAc;AAChC,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AAQd,SAAS,cAAc,EAAE,mBAAmB,SAAS,SAAS,GAAuB;AAC1F,QAAM,IAAI,KAAK;AACf,QAAM,MAAM,gBAAgB;AAC5B,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAClD,QAAM,KAAK,eAAe;AAC1B,QAAM,OAAO,GAAG,UAAU,eAAe,GAAG,UAAU,gBAAgB,GAAG,UAAU;AAEnF,YAAU,MAAM;AACd,QAAI,GAAG,UAAU,UAAW,YAAW;AAAA,E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disabled: !valid || isSubmitting,
|
|
94
94
|
onClick: () => {
|
|
@@ -147,7 +147,7 @@ function AllowlistSection({
|
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
149
|
links && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2 pt-2", children: [
|
|
150
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { variant: "
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { variant: "soft", size: "sm", className: "w-full", onClick: () => downloadCsv(links), children: [
|
|
151
151
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Download, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
152
152
|
t("Download claim links (CSV)")
|
|
153
153
|
] }),
|
|
@@ -188,11 +188,11 @@ function PopManagePage({ contract }) {
|
|
|
188
188
|
] }) : !collection ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
|
|
189
189
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
190
190
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: t("Collection not found.") }),
|
|
191
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "soft", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/launchpad/pop", children: t("\u2190 Back") }) })
|
|
192
192
|
] }) : !isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
|
|
193
193
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
194
194
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: t("You are not the organizer of this event.") }),
|
|
195
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "soft", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/launchpad/pop", children: t("\u2190 Back to events") }) })
|
|
196
196
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6", children: [
|
|
197
197
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: t("Manage event"), workingLabel: "Updating your event\u2026", firstStepLabel: "Prepare", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_success.TransactionSuccess, { name: collection.name ?? "Event", title: done.title, description: done.description, txHash: tx.txHash, actions: [{ label: t("Done"), onClick: tx.reset }] }) }),
|
|
198
198
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "ghost", size: "sm", className: "-ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: "/launchpad/pop", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">{t(\"Issue directly\")}</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Send the certificate straight to one wallet — for a late participant, without republishing the list or changing anyone's claim link.\")}\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Issue certificate\")}\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">{t(\"Participants\")}</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {t.plural(\"{count} address\", \"{count} addresses\", parsed.length)}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Paste every participant's wallet address. Publishing replaces the previous list and every link sent before it — send the new links to everyone who hasn't claimed yet. The list stays in this browser: download the claim links and send each participant theirs.\")}\n </p>\n <Textarea\n placeholder={t(\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\")}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-green-600 hover:bg-green-700 text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n {t(\"Publishing…\")}\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Publish\")} {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : t(\"participants\")}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"outline\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Download claim links (CSV)\")}\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const t = useT();\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone(successMessages.certificateIssued(t));\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone(successMessages.participantsPublished({ count }, t));\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title={t(\"Connect your wallet\")} description={t(\"Connect to manage your event.\")}>\n {isLoading ? (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4\">\n <Skeleton className=\"h-6 w-24\" />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </div>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"Collection not found.\")}</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back\")}</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"You are not the organizer of this event.\")}</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back to events\")}</Link>\n </Button>\n </div>\n ) : (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6\">\n <TransactionDialog tx={tx} title={t(\"Manage event\")} workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionSuccess name={collection.name ?? \"Event\"} title={done.title} description={done.description} txHash={tx.txHash} actions={[{ label: t(\"Done\"), onClick: tx.reset }]} />\n </TransactionDialog>\n\n <FadeIn>\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"All events\")}\n </Link>\n </Button>\n </FadeIn>\n\n <FadeIn delay={0.04}>\n <div>\n <span className=\"pill-badge inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n {t(\"Organizer\")}\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">{t(\"Manage event\")}</h1>\n <p className=\"text-sm text-muted-foreground\">{collection.name ?? contract}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.08}>\n <div className=\"bento-cell p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-green-500 shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">{t.rich(\"Only participants on your {strong} can claim, with the link you send them.\", { strong: <strong className=\"text-foreground\">{t(\"published list\")}</strong> })}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </div>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiDM;AA/CN,mBAAyB;AACzB,iBAAiC;AACjC,sBAAsF;AACtF,0BAA4F;AAC5F,oBAAuB;AACvB,kBAAiB;AACjB,2BAAgC;AAChC,+BAAuB;AACvB,sBAAyB;AACzB,sBAAyB;AACzB,gCAAkC;AAClC,iCAAmC;AACnC,6BAA+B;AAC/B,8BAA+B;AAC/B,8BAAgC;AAChC,6BAA8B;AAC9B,6BAA+B;AAC/B,sBAAqB;AAErB,SAAS,eAAe,KAAuB;AAC7C,SAAO,IACJ,MAAM,UAAU,EAChB,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,CAAC,MAAM,mBAAmB,KAAK,CAAC,CAAC;AAC7C;AAEA,SAAS,YAAY,OAAuB;AAC1C,QAAM,OAAO,IAAI,gBAAgB,IAAI,KAAK,KAAC,kCAAiB,KAAK,CAAC,GAAG,EAAE,MAAM,WAAW,CAAC,CAAC;AAC1F,QAAM,SAAS,OAAO,OAAO,SAAS,cAAc,GAAG,GAAG,EAAE,MAAM,UAAU,kBAAkB,CAAC;AAC/F,SAAO,MAAM;AACb,MAAI,gBAAgB,IAAI;AAC1B;AAEA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AACF,GAGG;AACD,QAAM,QAAI,sBAAK;AACf,QAAM,CAAC,KAAK,MAAM,QAAI,uBAAS,EAAE;AACjC,QAAM,UAAU,IAAI,KAAK;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AU,WAAU;AAAA,QAC1B,EAAE,WAAW;AAAA,SAChB;AAAA,MACA,4CAAC,QAAG,WAAU,2BAA2B,YAAE,cAAc,GAAE;AAAA,MAC3D,4CAAC,OAAE,WAAU,iCAAiC,qBAAW,QAAQ,UAAS;AAAA,OAC5E,GACF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,uDAAC,SAAI,WAAU,0CACb;AAAA,kDAAC,6BAAM,WAAU,mCAAkC;AAAA,MACnD,4CAAC,OAAE,WAAU,iCAAiC,YAAE,KAAK,8EAA8E,EAAE,QAAQ,4CAAC,YAAO,WAAU,mBAAmB,YAAE,gBAAgB,GAAE,EAAU,CAAC,GAAE;AAAA,OACrN,GACF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,sDAAC,oBAAiB,WAAW,SAAS,cAA4B,OAAc,GAClF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,sDAAC,gBAAa,SAAS,OAAO,cAA4B,GAC5D;AAAA,KACF,GAEJ;AAEJ;","names":["Link"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">{t(\"Issue directly\")}</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Send the certificate straight to one wallet — for a late participant, without republishing the list or changing anyone's claim link.\")}\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"soft\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Issue certificate\")}\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const t = useT();\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">{t(\"Participants\")}</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {t.plural(\"{count} address\", \"{count} addresses\", parsed.length)}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Paste every participant's wallet address. Publishing replaces the previous list and every link sent before it — send the new links to everyone who hasn't claimed yet. The list stays in this browser: download the claim links and send each participant theirs.\")}\n </p>\n <Textarea\n placeholder={t(\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\")}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-green-600 hover:bg-green-700 text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n {t(\"Publishing…\")}\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Publish\")} {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : t(\"participants\")}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"soft\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"Download claim links (CSV)\")}\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const t = useT();\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone(successMessages.certificateIssued(t));\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone(successMessages.participantsPublished({ count }, t));\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title={t(\"Connect your wallet\")} description={t(\"Connect to manage your event.\")}>\n {isLoading ? (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4\">\n <Skeleton className=\"h-6 w-24\" />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </div>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"Collection not found.\")}</p>\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back\")}</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">{t(\"You are not the organizer of this event.\")}</p>\n <Button asChild variant=\"soft\" size=\"sm\">\n <Link href=\"/launchpad/pop\">{t(\"← Back to events\")}</Link>\n </Button>\n </div>\n ) : (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6\">\n <TransactionDialog tx={tx} title={t(\"Manage event\")} workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionSuccess name={collection.name ?? \"Event\"} title={done.title} description={done.description} txHash={tx.txHash} actions={[{ label: t(\"Done\"), onClick: tx.reset }]} />\n </TransactionDialog>\n\n <FadeIn>\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n {t(\"All events\")}\n </Link>\n </Button>\n </FadeIn>\n\n <FadeIn delay={0.04}>\n <div>\n <span className=\"pill-badge inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n {t(\"Organizer\")}\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">{t(\"Manage event\")}</h1>\n <p className=\"text-sm text-muted-foreground\">{collection.name ?? contract}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.08}>\n <div className=\"bento-cell p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-green-500 shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">{t.rich(\"Only participants on your {strong} can claim, with the link you send them.\", { strong: <strong className=\"text-foreground\">{t(\"published list\")}</strong> })}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </div>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";;;;;;;;;;;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AE,KAAK,8EAA8E,EAAE,QAAQ,4CAAC,YAAO,WAAU,mBAAmB,YAAE,gBAAgB,GAAE,EAAU,CAAC,GAAE;AAAA,OACrN,GACF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,sDAAC,oBAAiB,WAAW,SAAS,cAA4B,OAAc,GAClF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,sDAAC,gBAAa,SAAS,OAAO,cAA4B,GAC5D;AAAA,KACF,GAEJ;AAEJ;","names":["Link"]}
|
|
@@ -55,7 +55,7 @@ function IssueSection({
|
|
|
55
55
|
Button,
|
|
56
56
|
{
|
|
57
57
|
size: "sm",
|
|
58
|
-
variant: "
|
|
58
|
+
variant: "soft",
|
|
59
59
|
className: "w-full",
|
|
60
60
|
disabled: !valid || isSubmitting,
|
|
61
61
|
onClick: () => {
|
|
@@ -114,7 +114,7 @@ function AllowlistSection({
|
|
|
114
114
|
}
|
|
115
115
|
),
|
|
116
116
|
links && /* @__PURE__ */ jsxs("div", { className: "space-y-2 pt-2", children: [
|
|
117
|
-
/* @__PURE__ */ jsxs(Button, { variant: "
|
|
117
|
+
/* @__PURE__ */ jsxs(Button, { variant: "soft", size: "sm", className: "w-full", onClick: () => downloadCsv(links), children: [
|
|
118
118
|
/* @__PURE__ */ jsx(Download, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
119
119
|
t("Download claim links (CSV)")
|
|
120
120
|
] }),
|
|
@@ -155,11 +155,11 @@ function PopManagePage({ contract }) {
|
|
|
155
155
|
] }) : !collection ? /* @__PURE__ */ jsxs("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
|
|
156
156
|
/* @__PURE__ */ jsx(AlertCircle, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
157
157
|
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: t("Collection not found.") }),
|
|
158
|
-
/* @__PURE__ */ jsx(Button, { asChild: true, variant: "
|
|
158
|
+
/* @__PURE__ */ jsx(Button, { asChild: true, variant: "soft", size: "sm", children: /* @__PURE__ */ jsx(Link, { href: "/launchpad/pop", children: t("\u2190 Back") }) })
|
|
159
159
|
] }) : !isOwner ? /* @__PURE__ */ jsxs("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
|
|
160
160
|
/* @__PURE__ */ jsx(Award, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
|
|
161
161
|
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: t("You are not the organizer of this event.") }),
|
|
162
|
-
/* @__PURE__ */ jsx(Button, { asChild: true, variant: "
|
|
162
|
+
/* @__PURE__ */ jsx(Button, { asChild: true, variant: "soft", size: "sm", children: /* @__PURE__ */ jsx(Link, { href: "/launchpad/pop", children: t("\u2190 Back to events") }) })
|
|
163
163
|
] }) : /* @__PURE__ */ jsxs("div", { className: "max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6", children: [
|
|
164
164
|
/* @__PURE__ */ jsx(TransactionDialog, { tx, title: t("Manage event"), workingLabel: "Updating your event\u2026", firstStepLabel: "Prepare", children: /* @__PURE__ */ jsx(TransactionSuccess, { name: collection.name ?? "Event", title: done.title, description: done.description, txHash: tx.txHash, actions: [{ label: t("Done"), onClick: tx.reset }] }) }),
|
|
165
165
|
/* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx(Button, { asChild: true, variant: "ghost", size: "sm", className: "-ml-2", children: /* @__PURE__ */ jsxs(Link, { href: "/launchpad/pop", children: [
|