@medialane/ui 0.374.0 → 0.374.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/accounts-page.cjs +1 -1
- package/dist/components/accounts-page.cjs.map +1 -1
- package/dist/components/accounts-page.js +1 -1
- package/dist/components/accounts-page.js.map +1 -1
- package/dist/components/activity-row.cjs +8 -7
- package/dist/components/activity-row.cjs.map +1 -1
- package/dist/components/activity-row.js +8 -7
- package/dist/components/activity-row.js.map +1 -1
- package/dist/components/asset-access-cards.cjs +3 -1
- package/dist/components/asset-access-cards.cjs.map +1 -1
- package/dist/components/asset-access-cards.js +3 -1
- package/dist/components/asset-access-cards.js.map +1 -1
- package/dist/components/asset-type-panels.cjs +1 -1
- package/dist/components/asset-type-panels.cjs.map +1 -1
- package/dist/components/asset-type-panels.js +1 -1
- package/dist/components/asset-type-panels.js.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/claim-route-shell.cjs +4 -2
- package/dist/components/claim-route-shell.cjs.map +1 -1
- package/dist/components/claim-route-shell.d.cts +1 -1
- package/dist/components/claim-route-shell.d.ts +1 -1
- package/dist/components/claim-route-shell.js +4 -2
- package/dist/components/claim-route-shell.js.map +1 -1
- package/dist/components/coin-guarantees.cjs +2 -2
- package/dist/components/coin-guarantees.cjs.map +1 -1
- package/dist/components/coin-guarantees.js +2 -2
- package/dist/components/coin-guarantees.js.map +1 -1
- package/dist/components/coins-explorer.cjs +1 -1
- package/dist/components/coins-explorer.cjs.map +1 -1
- package/dist/components/coins-explorer.js +1 -1
- package/dist/components/coins-explorer.js.map +1 -1
- package/dist/components/collection-filters.cjs +1 -1
- package/dist/components/collection-filters.cjs.map +1 -1
- package/dist/components/collection-filters.js +1 -1
- package/dist/components/collection-filters.js.map +1 -1
- package/dist/components/collection-provenance-tab.cjs +4 -3
- package/dist/components/collection-provenance-tab.cjs.map +1 -1
- package/dist/components/collection-provenance-tab.js +4 -3
- package/dist/components/collection-provenance-tab.js.map +1 -1
- package/dist/components/collection-settings.cjs +3 -3
- package/dist/components/collection-settings.cjs.map +1 -1
- package/dist/components/collection-settings.js +3 -3
- package/dist/components/collection-settings.js.map +1 -1
- package/dist/components/collection-showcase.cjs +1 -1
- package/dist/components/collection-showcase.cjs.map +1 -1
- package/dist/components/collection-showcase.js +1 -1
- package/dist/components/collection-showcase.js.map +1 -1
- package/dist/components/collections-page.cjs +2 -2
- package/dist/components/collections-page.cjs.map +1 -1
- package/dist/components/collections-page.js +2 -2
- package/dist/components/collections-page.js.map +1 -1
- package/dist/components/create-form-primitives.cjs +20 -1
- package/dist/components/create-form-primitives.cjs.map +1 -1
- package/dist/components/create-form-primitives.js +20 -1
- package/dist/components/create-form-primitives.js.map +1 -1
- package/dist/components/create-sponsorship-aside.cjs +6 -6
- package/dist/components/create-sponsorship-aside.cjs.map +1 -1
- package/dist/components/create-sponsorship-aside.js +6 -6
- package/dist/components/create-sponsorship-aside.js.map +1 -1
- package/dist/components/creator-header.cjs +5 -2
- package/dist/components/creator-header.cjs.map +1 -1
- package/dist/components/creator-header.js +5 -2
- package/dist/components/creator-header.js.map +1 -1
- package/dist/components/discover-collections-strip.cjs +6 -3
- package/dist/components/discover-collections-strip.cjs.map +1 -1
- package/dist/components/discover-collections-strip.js +6 -3
- package/dist/components/discover-collections-strip.js.map +1 -1
- package/dist/components/discover-community-section.cjs +5 -3
- package/dist/components/discover-community-section.cjs.map +1 -1
- package/dist/components/discover-community-section.js +5 -3
- package/dist/components/discover-community-section.js.map +1 -1
- package/dist/components/discover-features.cjs +2 -2
- package/dist/components/discover-features.cjs.map +1 -1
- package/dist/components/discover-features.js +2 -2
- package/dist/components/discover-features.js.map +1 -1
- package/dist/components/discover-feed-section.cjs +3 -2
- package/dist/components/discover-feed-section.cjs.map +1 -1
- package/dist/components/discover-feed-section.js +3 -2
- package/dist/components/discover-feed-section.js.map +1 -1
- package/dist/components/drop/create/artwork-section.d.cts +2 -0
- package/dist/components/drop/create/artwork-section.d.ts +2 -0
- package/dist/components/drop/create/details-section.d.cts +2 -0
- package/dist/components/drop/create/details-section.d.ts +2 -0
- package/dist/components/drop/create/drop-create.cjs +1 -1
- package/dist/components/drop/create/drop-create.cjs.map +1 -1
- package/dist/components/drop/create/drop-create.d.cts +2 -0
- package/dist/components/drop/create/drop-create.d.ts +2 -0
- 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 +1 -1
- package/dist/components/drop/create/launch-dialog.cjs.map +1 -1
- package/dist/components/drop/create/launch-dialog.d.cts +2 -0
- package/dist/components/drop/create/launch-dialog.d.ts +2 -0
- package/dist/components/drop/create/launch-dialog.js +2 -2
- package/dist/components/drop/create/launch-dialog.js.map +1 -1
- package/dist/components/drop/create/list-section.d.cts +2 -0
- package/dist/components/drop/create/list-section.d.ts +2 -0
- package/dist/components/drop/create/sale-section.d.cts +2 -0
- package/dist/components/drop/create/sale-section.d.ts +2 -0
- package/dist/components/drop/drop-features.cjs +8 -6
- package/dist/components/drop/drop-features.cjs.map +1 -1
- package/dist/components/drop/drop-features.js +8 -6
- package/dist/components/drop/drop-features.js.map +1 -1
- package/dist/components/drop/drop-listing.cjs +3 -3
- package/dist/components/drop/drop-listing.cjs.map +1 -1
- package/dist/components/drop/drop-listing.js +3 -3
- package/dist/components/drop/drop-listing.js.map +1 -1
- package/dist/components/drop/my-drops.cjs +1 -1
- package/dist/components/drop/my-drops.cjs.map +1 -1
- package/dist/components/drop/my-drops.js +1 -1
- package/dist/components/drop/my-drops.js.map +1 -1
- package/dist/components/drop/page/drop-manage.cjs +3 -3
- package/dist/components/drop/page/drop-manage.cjs.map +1 -1
- package/dist/components/drop/page/drop-manage.js +3 -3
- package/dist/components/drop/page/drop-manage.js.map +1 -1
- package/dist/components/drop-item-list.cjs +2 -2
- package/dist/components/drop-item-list.cjs.map +1 -1
- package/dist/components/drop-item-list.js +2 -2
- package/dist/components/drop-item-list.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 +2 -2
- package/dist/components/fast-mint/dropzone.cjs.map +1 -1
- package/dist/components/fast-mint/dropzone.js +2 -2
- package/dist/components/fast-mint/dropzone.js.map +1 -1
- package/dist/components/fast-mint/formats/nft.cjs +3 -3
- package/dist/components/fast-mint/formats/nft.cjs.map +1 -1
- package/dist/components/fast-mint/formats/nft.js +3 -3
- package/dist/components/fast-mint/formats/nft.js.map +1 -1
- package/dist/components/fast-mint/formats/pop.cjs +3 -3
- package/dist/components/fast-mint/formats/pop.cjs.map +1 -1
- package/dist/components/fast-mint/formats/pop.js +3 -3
- package/dist/components/fast-mint/formats/pop.js.map +1 -1
- package/dist/components/fast-mint/formats/tiers.cjs +5 -5
- package/dist/components/fast-mint/formats/tiers.cjs.map +1 -1
- package/dist/components/fast-mint/formats/tiers.js +5 -5
- package/dist/components/fast-mint/formats/tiers.js.map +1 -1
- package/dist/components/fast-mint/licensing-section.cjs +6 -27
- package/dist/components/fast-mint/licensing-section.cjs.map +1 -1
- package/dist/components/fast-mint/licensing-section.d.cts +1 -6
- package/dist/components/fast-mint/licensing-section.d.ts +1 -6
- package/dist/components/fast-mint/licensing-section.js +2 -22
- package/dist/components/fast-mint/licensing-section.js.map +1 -1
- package/dist/components/featured-carousel.cjs +3 -2
- package/dist/components/featured-carousel.cjs.map +1 -1
- package/dist/components/featured-carousel.js +3 -2
- package/dist/components/featured-carousel.js.map +1 -1
- package/dist/components/gated-content.cjs +1 -1
- package/dist/components/gated-content.cjs.map +1 -1
- package/dist/components/gated-content.js +1 -1
- package/dist/components/gated-content.js.map +1 -1
- package/dist/components/ip-type-badge.cjs +4 -2
- package/dist/components/ip-type-badge.cjs.map +1 -1
- package/dist/components/ip-type-badge.js +4 -2
- package/dist/components/ip-type-badge.js.map +1 -1
- package/dist/components/ip-type-nav.cjs +3 -2
- package/dist/components/ip-type-nav.cjs.map +1 -1
- package/dist/components/ip-type-nav.js +3 -2
- package/dist/components/ip-type-nav.js.map +1 -1
- package/dist/components/ip-type-page.cjs +2 -2
- package/dist/components/ip-type-page.cjs.map +1 -1
- package/dist/components/ip-type-page.js +2 -2
- package/dist/components/ip-type-page.js.map +1 -1
- package/dist/components/journey-content.cjs +1 -1
- package/dist/components/journey-content.cjs.map +1 -1
- package/dist/components/journey-content.js +1 -1
- package/dist/components/journey-content.js.map +1 -1
- package/dist/components/launchpad/coin-create.cjs +1 -1
- package/dist/components/launchpad/coin-create.cjs.map +1 -1
- package/dist/components/launchpad/coin-create.js +1 -1
- package/dist/components/launchpad/coin-create.js.map +1 -1
- package/dist/components/launchpad/collection-create-form.cjs +1 -1
- package/dist/components/launchpad/collection-create-form.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-form.js +1 -1
- package/dist/components/launchpad/collection-create-form.js.map +1 -1
- package/dist/components/launchpad/collection-create-presets.cjs +1 -1
- package/dist/components/launchpad/collection-create-presets.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-presets.js +1 -1
- package/dist/components/launchpad/collection-create-presets.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +6 -6
- package/dist/components/launchpad/edition-mint-schema.d.ts +6 -6
- 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/pop-create.cjs +1 -1
- package/dist/components/launchpad/pop-create.cjs.map +1 -1
- package/dist/components/launchpad/pop-create.js +1 -1
- package/dist/components/launchpad/pop-create.js.map +1 -1
- package/dist/components/launchpad-strip.cjs +3 -2
- package/dist/components/launchpad-strip.cjs.map +1 -1
- package/dist/components/launchpad-strip.js +3 -2
- package/dist/components/launchpad-strip.js.map +1 -1
- package/dist/components/marketplace-filters.cjs +2 -1
- package/dist/components/marketplace-filters.cjs.map +1 -1
- package/dist/components/marketplace-filters.js +2 -1
- package/dist/components/marketplace-filters.js.map +1 -1
- package/dist/components/nav-command-menu.cjs +11 -14
- package/dist/components/nav-command-menu.cjs.map +1 -1
- package/dist/components/nav-command-menu.d.cts +0 -1
- package/dist/components/nav-command-menu.d.ts +0 -1
- package/dist/components/nav-command-menu.js +11 -14
- package/dist/components/nav-command-menu.js.map +1 -1
- package/dist/components/nav-language-switch.cjs +16 -10
- package/dist/components/nav-language-switch.cjs.map +1 -1
- package/dist/components/nav-language-switch.js +17 -11
- package/dist/components/nav-language-switch.js.map +1 -1
- package/dist/components/nav-theme-toggle.cjs +7 -23
- package/dist/components/nav-theme-toggle.cjs.map +1 -1
- package/dist/components/nav-theme-toggle.js +7 -23
- package/dist/components/nav-theme-toggle.js.map +1 -1
- package/dist/components/new-collection-menu.cjs +5 -4
- package/dist/components/new-collection-menu.cjs.map +1 -1
- package/dist/components/new-collection-menu.js +5 -4
- package/dist/components/new-collection-menu.js.map +1 -1
- package/dist/components/order-sort-control.cjs +7 -4
- package/dist/components/order-sort-control.cjs.map +1 -1
- package/dist/components/order-sort-control.js +7 -4
- package/dist/components/order-sort-control.js.map +1 -1
- package/dist/components/portfolio-orders.cjs +16 -16
- package/dist/components/portfolio-orders.cjs.map +1 -1
- package/dist/components/portfolio-orders.js +16 -16
- package/dist/components/portfolio-orders.js.map +1 -1
- package/dist/components/price-history-chart.cjs +1 -1
- package/dist/components/price-history-chart.cjs.map +1 -1
- package/dist/components/price-history-chart.js +1 -1
- package/dist/components/price-history-chart.js.map +1 -1
- package/dist/components/report-dialog.cjs +1 -1
- package/dist/components/report-dialog.cjs.map +1 -1
- package/dist/components/report-dialog.js +1 -1
- package/dist/components/report-dialog.js.map +1 -1
- package/dist/components/rewards/level-badge.cjs +3 -1
- package/dist/components/rewards/level-badge.cjs.map +1 -1
- package/dist/components/rewards/level-badge.js +3 -1
- package/dist/components/rewards/level-badge.js.map +1 -1
- package/dist/components/rewards/rewards-dashboard.cjs +24 -24
- package/dist/components/rewards/rewards-dashboard.cjs.map +1 -1
- package/dist/components/rewards/rewards-dashboard.js +24 -24
- package/dist/components/rewards/rewards-dashboard.js.map +1 -1
- package/dist/components/rewards-section.cjs +5 -5
- package/dist/components/rewards-section.cjs.map +1 -1
- package/dist/components/rewards-section.js +5 -5
- package/dist/components/rewards-section.js.map +1 -1
- package/dist/components/section-heading.cjs +5 -2
- package/dist/components/section-heading.cjs.map +1 -1
- package/dist/components/section-heading.js +5 -2
- package/dist/components/section-heading.js.map +1 -1
- package/dist/components/sponsorship-offers-page.cjs +5 -4
- package/dist/components/sponsorship-offers-page.cjs.map +1 -1
- package/dist/components/sponsorship-offers-page.js +5 -4
- package/dist/components/sponsorship-offers-page.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/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/wallet/self-fund-consent-dialog.cjs +1 -1
- package/dist/components/wallet/self-fund-consent-dialog.cjs.map +1 -1
- package/dist/components/wallet/self-fund-consent-dialog.js +1 -1
- package/dist/components/wallet/self-fund-consent-dialog.js.map +1 -1
- package/dist/data/launchpad-services.cjs +1 -1
- package/dist/data/launchpad-services.cjs.map +1 -1
- package/dist/data/launchpad-services.js +1 -1
- package/dist/data/launchpad-services.js.map +1 -1
- package/dist/data/nav-commands.cjs +6 -6
- package/dist/data/nav-commands.cjs.map +1 -1
- package/dist/data/nav-commands.d.cts +0 -5
- package/dist/data/nav-commands.d.ts +0 -5
- package/dist/data/nav-commands.js +6 -6
- package/dist/data/nav-commands.js.map +1 -1
- package/dist/i18n/catalog/pt.cjs +111 -7
- package/dist/i18n/catalog/pt.cjs.map +1 -1
- package/dist/i18n/catalog/pt.js +111 -7
- package/dist/i18n/catalog/pt.js.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/utils/drop/draft.cjs +5 -0
- package/dist/utils/drop/draft.cjs.map +1 -1
- package/dist/utils/drop/draft.d.cts +4 -1
- package/dist/utils/drop/draft.d.ts +4 -1
- package/dist/utils/drop/draft.js +4 -0
- package/dist/utils/drop/draft.js.map +1 -1
- package/package.json +1 -1
|
@@ -19,8 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var licensing_section_exports = {};
|
|
21
21
|
__export(licensing_section_exports, {
|
|
22
|
-
LicensingSection: () => LicensingSection
|
|
23
|
-
ToggleGroup: () => ToggleGroup
|
|
22
|
+
LicensingSection: () => LicensingSection
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(licensing_section_exports);
|
|
26
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -32,26 +31,7 @@ var import_collapsible = require("../collapsible.js");
|
|
|
32
31
|
var import_ip = require("../../data/ip.js");
|
|
33
32
|
var import_cn = require("../../utils/cn.js");
|
|
34
33
|
var import_provider = require("../../i18n/provider.js");
|
|
35
|
-
|
|
36
|
-
value,
|
|
37
|
-
options,
|
|
38
|
-
onChange
|
|
39
|
-
}) {
|
|
40
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex rounded-lg border border-border overflow-hidden w-full", children: options.map((opt, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
-
"button",
|
|
42
|
-
{
|
|
43
|
-
type: "button",
|
|
44
|
-
onClick: () => onChange(opt),
|
|
45
|
-
className: (0, import_cn.cn)(
|
|
46
|
-
"flex-1 px-3 py-2 text-sm transition-colors",
|
|
47
|
-
i > 0 && "border-l border-border",
|
|
48
|
-
value === opt ? "bg-primary text-primary-foreground font-medium" : "bg-background hover:bg-muted text-muted-foreground"
|
|
49
|
-
),
|
|
50
|
-
children: opt
|
|
51
|
-
},
|
|
52
|
-
opt
|
|
53
|
-
)) });
|
|
54
|
-
}
|
|
34
|
+
var import_create_form_primitives = require("../create-form-primitives.js");
|
|
55
35
|
function LicensingSection({ form }) {
|
|
56
36
|
const t = (0, import_provider.useT)();
|
|
57
37
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
@@ -83,11 +63,11 @@ function LicensingSection({ form }) {
|
|
|
83
63
|
] }),
|
|
84
64
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
85
65
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("Commercial use") }),
|
|
86
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup, { value: form.watch("commercialUse"), options: ["Yes", "No"], onChange: (v) => form.setValue("commercialUse", v) })
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: form.watch("commercialUse"), options: ["Yes", "No"], onChange: (v) => form.setValue("commercialUse", v) })
|
|
87
67
|
] }),
|
|
88
68
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
89
69
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("Derivatives") }),
|
|
90
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup, { value: form.watch("derivatives"), options: import_ip.DERIVATIVES_OPTIONS, onChange: (v) => form.setValue("derivatives", v) })
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: form.watch("derivatives"), options: import_ip.DERIVATIVES_OPTIONS, onChange: (v) => form.setValue("derivatives", v) })
|
|
91
71
|
] }),
|
|
92
72
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
93
73
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("Territory") }),
|
|
@@ -98,7 +78,7 @@ function LicensingSection({ form }) {
|
|
|
98
78
|
] }),
|
|
99
79
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
100
80
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("AI & data mining") }),
|
|
101
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup, { value: form.watch("aiPolicy"), options: import_ip.AI_POLICIES, onChange: (v) => form.setValue("aiPolicy", v) })
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: form.watch("aiPolicy"), options: import_ip.AI_POLICIES, onChange: (v) => form.setValue("aiPolicy", v) })
|
|
102
82
|
] }),
|
|
103
83
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
104
84
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("Royalty % (0\u201350)") }),
|
|
@@ -120,7 +100,6 @@ function LicensingSection({ form }) {
|
|
|
120
100
|
}
|
|
121
101
|
// Annotate the CommonJS export names for ESM import in node:
|
|
122
102
|
0 && (module.exports = {
|
|
123
|
-
LicensingSection
|
|
124
|
-
ToggleGroup
|
|
103
|
+
LicensingSection
|
|
125
104
|
});
|
|
126
105
|
//# sourceMappingURL=licensing-section.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/licensing-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport type { UseFormReturn } from \"react-hook-form\";\nimport { ChevronDown, ShieldCheck } from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES, DERIVATIVES_OPTIONS } from \"../../data/ip.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport type { FormValues } from \"./form.js\";\nimport { useT } from \"../../i18n/provider.js\";\
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/licensing-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport type { UseFormReturn } from \"react-hook-form\";\nimport { ChevronDown, ShieldCheck } from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES, DERIVATIVES_OPTIONS } from \"../../data/ip.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport type { FormValues } from \"./form.js\";\nimport { useT } from \"../../i18n/provider.js\";\nimport { ToggleGroup } from \"../create-form-primitives.js\";\n\nexport function LicensingSection({ form }: { form: UseFormReturn<FormValues> }) {\n const t = useT();\n const [open, setOpen] = useState(false);\n\n const handleLicenseChange = (value: string) => {\n form.setValue(\"licenseType\", value);\n const def = LICENSE_TYPES.find((l) => l.value === value);\n if (def) {\n form.setValue(\"commercialUse\", def.commercialUse);\n form.setValue(\"derivatives\", def.derivatives);\n form.setValue(\"attribution\", def.attribution);\n }\n };\n\n return (\n <Collapsible open={open} onOpenChange={setOpen}>\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <ShieldCheck className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">{t(\"License terms\")}</span>\n <span className=\"text-xs text-muted-foreground font-normal\">{t(\"Optional · Berne Convention\")}</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", open && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"License\")}</label>\n <Select value={form.watch(\"licenseType\")} onValueChange={handleLicenseChange}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {LICENSE_TYPES.map((l) => <SelectItem key={l.value} value={l.value}>{t(l.label)}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"Commercial use\")}</label>\n <ToggleGroup value={form.watch(\"commercialUse\")} options={[\"Yes\", \"No\"]} onChange={(v) => form.setValue(\"commercialUse\", v as \"Yes\" | \"No\")} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"Derivatives\")}</label>\n <ToggleGroup value={form.watch(\"derivatives\")} options={DERIVATIVES_OPTIONS} onChange={(v) => form.setValue(\"derivatives\", v as FormValues[\"derivatives\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"Territory\")}</label>\n <Select value={form.watch(\"geographicScope\")} onValueChange={(v) => form.setValue(\"geographicScope\", v)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {GEOGRAPHIC_SCOPES.map((s) => <SelectItem key={s} value={s}>{s}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"AI & data mining\")}</label>\n <ToggleGroup value={form.watch(\"aiPolicy\")} options={AI_POLICIES} onChange={(v) => form.setValue(\"aiPolicy\", v as FormValues[\"aiPolicy\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"Royalty % (0–50)\")}</label>\n <Input\n type=\"number\" min={0} max={50} step={0.5}\n value={form.watch(\"royalty\")}\n onChange={(e) => form.setValue(\"royalty\", parseFloat(e.target.value) || 0)}\n className=\"max-w-[120px]\"\n />\n </div>\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCc;AA/Bd,mBAAyB;AAEzB,0BAAyC;AACzC,mBAAsB;AACtB,oBAA8E;AAC9E,yBAAoE;AACpE,gBAAmF;AACnF,gBAAmB;AAEnB,sBAAqB;AACrB,oCAA4B;AAErB,SAAS,iBAAiB,EAAE,KAAK,GAAwC;AAC9E,QAAM,QAAI,sBAAK;AACf,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,KAAK;AAEtC,QAAM,sBAAsB,CAAC,UAAkB;AAC7C,SAAK,SAAS,eAAe,KAAK;AAClC,UAAM,MAAM,wBAAc,KAAK,CAAC,MAAM,EAAE,UAAU,KAAK;AACvD,QAAI,KAAK;AACP,WAAK,SAAS,iBAAiB,IAAI,aAAa;AAChD,WAAK,SAAS,eAAe,IAAI,WAAW;AAC5C,WAAK,SAAS,eAAe,IAAI,WAAW;AAAA,IAC9C;AAAA,EACF;AAEA,SACI,4CAAC,kCAAY,MAAY,cAAc,SACrC,uDAAC,SAAI,WAAU,mD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A,6CAAC,SAAI,WAAU,eACb;AAAA,oDAAC,WAAM,WAAU,6CAA6C,YAAE,WAAW,GAAE;AAAA,QAC7E,6CAAC,wBAAO,OAAO,KAAK,MAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,KAAK,SAAS,mBAAmB,CAAC,GACpG;AAAA,sDAAC,+BAAc,sDAAC,6BAAY,GAAE;AAAA,UAC9B,4CAAC,+BACE,sCAAkB,IAAI,CAAC,MAAM,4CAAC,4BAAmB,OAAO,GAAI,eAAd,CAAgB,CAAa,GAC9E;AAAA,WACF;AAAA,SACF;AAAA,MACA,6CAAC,SAAI,WAAU,eACb;AAAA,oDAAC,WAAM,WAAU,6CAA6C,YAAE,kBAAkB,GAAE;AAAA,QACpF,4CAAC,6CAAY,OAAO,KAAK,MAAM,UAAU,GAAG,SAAS,uBAAa,UAAU,CAAC,MAAM,KAAK,SAAS,YAAY,CAA2B,GAAG;AAAA,SAC7I;AAAA,MACA,6CAAC,SAAI,WAAU,eACb;AAAA,oDAAC,WAAM,WAAU,6CAA6C,YAAE,uBAAkB,GAAE;AAAA,QACpF;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YAAS,KAAK;AAAA,YAAG,KAAK;AAAA,YAAI,MAAM;AAAA,YACrC,OAAO,KAAK,MAAM,SAAS;AAAA,YAC3B,UAAU,CAAC,MAAM,KAAK,SAAS,WAAW,WAAW,EAAE,OAAO,KAAK,KAAK,CAAC;AAAA,YACzE,WAAU;AAAA;AAAA,QACZ;AAAA,SACF;AAAA,OACF,GACF;AAAA,KACF,GACF;AAEN;","names":[]}
|
|
@@ -2,13 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { UseFormReturn } from 'react-hook-form';
|
|
3
3
|
import { FormValues } from './form.cjs';
|
|
4
4
|
|
|
5
|
-
declare function ToggleGroup({ value, options, onChange, }: {
|
|
6
|
-
value: string;
|
|
7
|
-
options: readonly string[];
|
|
8
|
-
onChange: (v: string) => void;
|
|
9
|
-
}): react_jsx_runtime.JSX.Element;
|
|
10
5
|
declare function LicensingSection({ form }: {
|
|
11
6
|
form: UseFormReturn<FormValues>;
|
|
12
7
|
}): react_jsx_runtime.JSX.Element;
|
|
13
8
|
|
|
14
|
-
export { LicensingSection
|
|
9
|
+
export { LicensingSection };
|
|
@@ -2,13 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { UseFormReturn } from 'react-hook-form';
|
|
3
3
|
import { FormValues } from './form.js';
|
|
4
4
|
|
|
5
|
-
declare function ToggleGroup({ value, options, onChange, }: {
|
|
6
|
-
value: string;
|
|
7
|
-
options: readonly string[];
|
|
8
|
-
onChange: (v: string) => void;
|
|
9
|
-
}): react_jsx_runtime.JSX.Element;
|
|
10
5
|
declare function LicensingSection({ form }: {
|
|
11
6
|
form: UseFormReturn<FormValues>;
|
|
12
7
|
}): react_jsx_runtime.JSX.Element;
|
|
13
8
|
|
|
14
|
-
export { LicensingSection
|
|
9
|
+
export { LicensingSection };
|
|
@@ -8,26 +8,7 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../collapsi
|
|
|
8
8
|
import { LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES, DERIVATIVES_OPTIONS } from "../../data/ip.js";
|
|
9
9
|
import { cn } from "../../utils/cn.js";
|
|
10
10
|
import { useT } from "../../i18n/provider.js";
|
|
11
|
-
|
|
12
|
-
value,
|
|
13
|
-
options,
|
|
14
|
-
onChange
|
|
15
|
-
}) {
|
|
16
|
-
return /* @__PURE__ */ jsx("div", { className: "flex rounded-lg border border-border overflow-hidden w-full", children: options.map((opt, i) => /* @__PURE__ */ jsx(
|
|
17
|
-
"button",
|
|
18
|
-
{
|
|
19
|
-
type: "button",
|
|
20
|
-
onClick: () => onChange(opt),
|
|
21
|
-
className: cn(
|
|
22
|
-
"flex-1 px-3 py-2 text-sm transition-colors",
|
|
23
|
-
i > 0 && "border-l border-border",
|
|
24
|
-
value === opt ? "bg-primary text-primary-foreground font-medium" : "bg-background hover:bg-muted text-muted-foreground"
|
|
25
|
-
),
|
|
26
|
-
children: opt
|
|
27
|
-
},
|
|
28
|
-
opt
|
|
29
|
-
)) });
|
|
30
|
-
}
|
|
11
|
+
import { ToggleGroup } from "../create-form-primitives.js";
|
|
31
12
|
function LicensingSection({ form }) {
|
|
32
13
|
const t = useT();
|
|
33
14
|
const [open, setOpen] = useState(false);
|
|
@@ -95,7 +76,6 @@ function LicensingSection({ form }) {
|
|
|
95
76
|
] }) });
|
|
96
77
|
}
|
|
97
78
|
export {
|
|
98
|
-
LicensingSection
|
|
99
|
-
ToggleGroup
|
|
79
|
+
LicensingSection
|
|
100
80
|
};
|
|
101
81
|
//# sourceMappingURL=licensing-section.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/licensing-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport type { UseFormReturn } from \"react-hook-form\";\nimport { ChevronDown, ShieldCheck } from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES, DERIVATIVES_OPTIONS } from \"../../data/ip.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport type { FormValues } from \"./form.js\";\nimport { useT } from \"../../i18n/provider.js\";\
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/licensing-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport type { UseFormReturn } from \"react-hook-form\";\nimport { ChevronDown, ShieldCheck } from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES, DERIVATIVES_OPTIONS } from \"../../data/ip.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport type { FormValues } from \"./form.js\";\nimport { useT } from \"../../i18n/provider.js\";\nimport { ToggleGroup } from \"../create-form-primitives.js\";\n\nexport function LicensingSection({ form }: { form: UseFormReturn<FormValues> }) {\n const t = useT();\n const [open, setOpen] = useState(false);\n\n const handleLicenseChange = (value: string) => {\n form.setValue(\"licenseType\", value);\n const def = LICENSE_TYPES.find((l) => l.value === value);\n if (def) {\n form.setValue(\"commercialUse\", def.commercialUse);\n form.setValue(\"derivatives\", def.derivatives);\n form.setValue(\"attribution\", def.attribution);\n }\n };\n\n return (\n <Collapsible open={open} onOpenChange={setOpen}>\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <ShieldCheck className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">{t(\"License terms\")}</span>\n <span className=\"text-xs text-muted-foreground font-normal\">{t(\"Optional · Berne Convention\")}</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", open && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"License\")}</label>\n <Select value={form.watch(\"licenseType\")} onValueChange={handleLicenseChange}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {LICENSE_TYPES.map((l) => <SelectItem key={l.value} value={l.value}>{t(l.label)}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"Commercial use\")}</label>\n <ToggleGroup value={form.watch(\"commercialUse\")} options={[\"Yes\", \"No\"]} onChange={(v) => form.setValue(\"commercialUse\", v as \"Yes\" | \"No\")} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"Derivatives\")}</label>\n <ToggleGroup value={form.watch(\"derivatives\")} options={DERIVATIVES_OPTIONS} onChange={(v) => form.setValue(\"derivatives\", v as FormValues[\"derivatives\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"Territory\")}</label>\n <Select value={form.watch(\"geographicScope\")} onValueChange={(v) => form.setValue(\"geographicScope\", v)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {GEOGRAPHIC_SCOPES.map((s) => <SelectItem key={s} value={s}>{s}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"AI & data mining\")}</label>\n <ToggleGroup value={form.watch(\"aiPolicy\")} options={AI_POLICIES} onChange={(v) => form.setValue(\"aiPolicy\", v as FormValues[\"aiPolicy\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">{t(\"Royalty % (0–50)\")}</label>\n <Input\n type=\"number\" min={0} max={50} step={0.5}\n value={form.watch(\"royalty\")}\n onChange={(e) => form.setValue(\"royalty\", parseFloat(e.target.value) || 0)}\n className=\"max-w-[120px]\"\n />\n </div>\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n );\n}\n"],"mappings":";AAiCc,SACE,KADF;AA/Bd,SAAS,gBAAgB;AAEzB,SAAS,aAAa,mBAAmB;AACzC,SAAS,aAAa;AACtB,SAAS,QAAQ,eAAe,YAAY,eAAe,mBAAmB;AAC9E,SAAS,aAAa,oBAAoB,0BAA0B;AACpE,SAAS,eAAe,mBAAmB,aAAa,2BAA2B;AACnF,SAAS,UAAU;AAEnB,SAAS,YAAY;AACrB,SAAS,m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AO,KAAK,MAAM,SAAS;AAAA,YAC3B,UAAU,CAAC,MAAM,KAAK,SAAS,WAAW,WAAW,EAAE,OAAO,KAAK,KAAK,CAAC;AAAA,YACzE,WAAU;AAAA;AAAA,QACZ;AAAA,SACF;AAAA,OACF,GACF;AAAA,KACF,GACF;AAEN;","names":[]}
|
|
@@ -32,6 +32,7 @@ var import_section_heading = require("./section-heading.js");
|
|
|
32
32
|
var import_format = require("../utils/format.js");
|
|
33
33
|
var import_use_image_url = require("../utils/use-image-url.js");
|
|
34
34
|
var import_provider = require("../i18n/provider.js");
|
|
35
|
+
var import_translate = require("../i18n/translate.js");
|
|
35
36
|
function Slide({ collection, href }) {
|
|
36
37
|
const t = (0, import_provider.useT)();
|
|
37
38
|
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
@@ -81,7 +82,7 @@ function Slide({ collection, href }) {
|
|
|
81
82
|
function FeaturedCarouselSkeleton() {
|
|
82
83
|
const t = (0, import_provider.useT)();
|
|
83
84
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-4", children: [
|
|
84
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section_heading.SectionHeading, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Sparkles, {}), title: t("Featured collections"), href: "/collections", linkLabel: "View all" }),
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section_heading.SectionHeading, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Sparkles, {}), title: t("Featured collections"), href: "/collections", linkLabel: (0, import_translate.msg)("View all") }),
|
|
85
86
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "-mx-4 sm:-mx-6 lg:-mx-8 aspect-[16/7] sm:aspect-[21/9] bg-muted animate-pulse" })
|
|
86
87
|
] }) });
|
|
87
88
|
}
|
|
@@ -108,7 +109,7 @@ function FeaturedCarousel({
|
|
|
108
109
|
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FeaturedCarouselSkeleton, {});
|
|
109
110
|
if (total === 0) return null;
|
|
110
111
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-4", children: [
|
|
111
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section_heading.SectionHeading, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Sparkles, {}), title: t("Featured collections"), href: allCollectionsHref, linkLabel: "View all" }),
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section_heading.SectionHeading, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Sparkles, {}), title: t("Featured collections"), href: allCollectionsHref, linkLabel: (0, import_translate.msg)("View all") }),
|
|
112
113
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
113
114
|
"div",
|
|
114
115
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/featured-carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useCallback } from \"react\";\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport { ChevronLeft, ChevronRight, ArrowRight, Sparkles } from \"lucide-react\";\nimport { FadeIn, EASE_OUT } from \"./motion-primitives.js\";\nimport { SectionHeading } from \"./section-heading.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface FeaturedCarouselProps {\n collections: ApiCollection[];\n isLoading: boolean;\n getHref: (collection: ApiCollection) => string;\n allCollectionsHref?: string;\n}\n\nfunction Slide({ collection, href }: { collection: ApiCollection; href: string }) {\n const t = useT();\n const resolveImage = useImageUrl();\n const name = collection.name ?? \"Featured Collection\";\n const image = resolveImage(collection.image);\n\n return (\n <div className=\"relative w-full h-full\">\n {image ? (\n <img\n src={image}\n alt={name}\n loading=\"lazy\"\n className=\"absolute inset-0 w-full h-full object-cover\"\n />\n ) : (\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/30 via-brand-blue/20 to-brand-navy/40\" />\n )}\n <div className=\"absolute inset-0 bg-gradient-to-t from-black/85 via-black/30 to-black/10\" />\n <div className=\"absolute inset-0 bg-gradient-to-r from-black/50 via-transparent to-transparent\" />\n <div className=\"absolute bottom-0 left-0 right-0 p-5 sm:p-8 lg:p-10\">\n <h2 className=\"text-2xl sm:text-3xl lg:text-4xl font-black text-white leading-tight mb-3 max-w-lg\">\n {name}\n </h2>\n <div className=\"flex items-center gap-4 mb-5\">\n {collection.totalSupply != null && (\n <span className=\"text-sm text-white/70\">\n <span className=\"font-bold text-white\">{collection.totalSupply}</span> {t(\"items\")}\n </span>\n )}\n {collection.floorPrice && (\n <span className=\"text-sm text-white/70\">\n {t(\"Floor\")}{\" \"}\n <span className=\"font-bold text-brand-orange\">\n {formatDisplayPrice(collection.floorPrice)}\n </span>\n </span>\n )}\n </div>\n <a\n href={href}\n className=\"inline-flex items-center gap-2 text-sm font-semibold px-4 py-2 rounded-lg bg-white/15 hover:bg-white/25 text-white border border-white/20 backdrop-blur-sm transition-colors\"\n >\n {t(\"View collection\")} <ArrowRight className=\"h-3.5 w-3.5\" />\n </a>\n </div>\n </div>\n );\n}\n\nexport function FeaturedCarouselSkeleton() {\n const t = useT();\n return (\n <FadeIn>\n <section className=\"space-y-4\">\n <SectionHeading icon={<Sparkles />} title={t(\"Featured collections\")} href=\"/collections\" linkLabel=\"View all\" />\n <div className=\"-mx-4 sm:-mx-6 lg:-mx-8 aspect-[16/7] sm:aspect-[21/9] bg-muted animate-pulse\" />\n </section>\n </FadeIn>\n );\n}\n\nexport function FeaturedCarousel({\n collections,\n isLoading,\n getHref,\n allCollectionsHref = \"/collections\",\n}: FeaturedCarouselProps) {\n const t = useT();\n const [active, setActive] = useState(0);\n const [paused, setPaused] = useState(false);\n const total = collections.length;\n\n const next = useCallback(() => setActive((p) => (p + 1) % total), [total]);\n const prev = useCallback(() => setActive((p) => (p - 1 + total) % total), [total]);\n\n useEffect(() => { setActive(0); }, [total]);\n\n useEffect(() => {\n if (paused || total <= 1) return;\n const id = setInterval(next, 6000);\n return () => clearInterval(id);\n }, [next, paused, total]);\n\n if (isLoading) return <FeaturedCarouselSkeleton />;\n if (total === 0) return null;\n\n return (\n <FadeIn>\n <section className=\"space-y-4\">\n <SectionHeading icon={<Sparkles />} title={t(\"Featured collections\")} href={allCollectionsHref} linkLabel=\"View all\" />\n\n <div\n className=\"-mx-4 sm:-mx-6 lg:-mx-8 relative overflow-hidden aspect-[16/7] sm:aspect-[21/9] bg-muted\"\n onMouseEnter={() => setPaused(true)}\n onMouseLeave={() => setPaused(false)}\n >\n <AnimatePresence mode=\"wait\">\n <motion.div\n key={active}\n className=\"absolute inset-0\"\n initial={{ opacity: 0, x: 40 }}\n animate={{ opacity: 1, x: 0 }}\n exit={{ opacity: 0, x: -40 }}\n transition={{ duration: 0.45, ease: EASE_OUT }}\n >\n <Slide collection={collections[active]} href={getHref(collections[active])} />\n </motion.div>\n </AnimatePresence>\n\n {total > 1 && (\n <>\n <button\n onClick={prev}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 min-h-11 min-w-11 rounded-full flex items-center justify-center z-10\"\n aria-label={t(\"Previous\")}\n >\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-black/40 border border-white/10 backdrop-blur-sm text-white hover:bg-black/60 transition-colors\">\n <ChevronLeft className=\"h-4 w-4\" />\n </span>\n </button>\n <button\n onClick={next}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 min-h-11 min-w-11 rounded-full flex items-center justify-center z-10\"\n aria-label={t(\"Next\")}\n >\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-black/40 border border-white/10 backdrop-blur-sm text-white hover:bg-black/60 transition-colors\">\n <ChevronRight className=\"h-4 w-4\" />\n </span>\n </button>\n </>\n )}\n\n {total > 1 && (\n <div className=\"absolute bottom-4 left-1/2 -translate-x-1/2 flex items-center gap-1.5 z-10\">\n {collections.map((_, i) => (\n <button\n key={i}\n onClick={() => setActive(i)}\n className={`h-1.5 rounded-full transition-all duration-300 ${\n i === active ? \"w-6 bg-white\" : \"w-1.5 bg-white/40 hover:bg-white/70\"\n }`}\n aria-label={`Go to slide ${i + 1}`}\n />\n ))}\n </div>\n )}\n </div>\n </section>\n </FadeIn>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BQ;AA1BR,mBAAiD;AACjD,2BAAwC;AACxC,0BAAgE;AAChE,+BAAiC;AACjC,6BAA+B;AAC/B,oBAAmC;AAEnC,2BAA4B;AAC5B,sBAAqB;AASrB,SAAS,MAAM,EAAE,YAAY,KAAK,GAAgD;AAChF,QAAM,QAAI,sBAAK;AACf,QAAM,mBAAe,kCAAY;AACjC,QAAM,OAAO,WAAW,QAAQ;AAChC,QAAM,QAAQ,aAAa,WAAW,KAAK;AAE3C,SACE,6CAAC,SAAI,WAAU,0BACZ;AAAA,YACC;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,KAAK;AAAA,QACL,SAAQ;AAAA,QACR,WAAU;AAAA;AAAA,IACZ,IAEA,4CAAC,SAAI,WAAU,8FAA6F;AAAA,IAE9G,4CAAC,SAAI,WAAU,4EAA2E;AAAA,IAC1F,4CAAC,SAAI,WAAU,kFAAiF;AAAA,IAChG,6CAAC,SAAI,WAAU,uDACb;AAAA,kDAAC,QAAG,WAAU,sFACX,gBACH;AAAA,MACA,6CAAC,SAAI,WAAU,gCACZ;AAAA,mBAAW,eAAe,QACzB,6CAAC,UAAK,WAAU,yBACd;AAAA,sDAAC,UAAK,WAAU,wBAAwB,qBAAW,aAAY;AA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AAA;AAAA,YACF;AAAA,aACF;AAAA,UAGD,QAAQ,KACP,4CAAC,SAAI,WAAU,8EACZ,sBAAY,IAAI,CAAC,GAAG,MACnB;AAAA,YAAC;AAAA;AAAA,cAEC,SAAS,MAAM,UAAU,CAAC;AAAA,cAC1B,WAAW,kDACT,MAAM,SAAS,iBAAiB,qCAClC;AAAA,cACA,cAAY,eAAe,IAAI,CAAC;AAAA;AAAA,YAL3B;AAAA,UAMP,CACD,GACH;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/featured-carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useCallback } from \"react\";\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport { ChevronLeft, ChevronRight, ArrowRight, Sparkles } from \"lucide-react\";\nimport { FadeIn, EASE_OUT } from \"./motion-primitives.js\";\nimport { SectionHeading } from \"./section-heading.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nimport { msg } from \"../i18n/translate.js\";\nexport interface FeaturedCarouselProps {\n collections: ApiCollection[];\n isLoading: boolean;\n getHref: (collection: ApiCollection) => string;\n allCollectionsHref?: string;\n}\n\nfunction Slide({ collection, href }: { collection: ApiCollection; href: string }) {\n const t = useT();\n const resolveImage = useImageUrl();\n const name = collection.name ?? \"Featured Collection\";\n const image = resolveImage(collection.image);\n\n return (\n <div className=\"relative w-full h-full\">\n {image ? (\n <img\n src={image}\n alt={name}\n loading=\"lazy\"\n className=\"absolute inset-0 w-full h-full object-cover\"\n />\n ) : (\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/30 via-brand-blue/20 to-brand-navy/40\" />\n )}\n <div className=\"absolute inset-0 bg-gradient-to-t from-black/85 via-black/30 to-black/10\" />\n <div className=\"absolute inset-0 bg-gradient-to-r from-black/50 via-transparent to-transparent\" />\n <div className=\"absolute bottom-0 left-0 right-0 p-5 sm:p-8 lg:p-10\">\n <h2 className=\"text-2xl sm:text-3xl lg:text-4xl font-black text-white leading-tight mb-3 max-w-lg\">\n {name}\n </h2>\n <div className=\"flex items-center gap-4 mb-5\">\n {collection.totalSupply != null && (\n <span className=\"text-sm text-white/70\">\n <span className=\"font-bold text-white\">{collection.totalSupply}</span> {t(\"items\")}\n </span>\n )}\n {collection.floorPrice && (\n <span className=\"text-sm text-white/70\">\n {t(\"Floor\")}{\" \"}\n <span className=\"font-bold text-brand-orange\">\n {formatDisplayPrice(collection.floorPrice)}\n </span>\n </span>\n )}\n </div>\n <a\n href={href}\n className=\"inline-flex items-center gap-2 text-sm font-semibold px-4 py-2 rounded-lg bg-white/15 hover:bg-white/25 text-white border border-white/20 backdrop-blur-sm transition-colors\"\n >\n {t(\"View collection\")} <ArrowRight className=\"h-3.5 w-3.5\" />\n </a>\n </div>\n </div>\n );\n}\n\nexport function FeaturedCarouselSkeleton() {\n const t = useT();\n return (\n <FadeIn>\n <section className=\"space-y-4\">\n <SectionHeading icon={<Sparkles />} title={t(\"Featured collections\")} href=\"/collections\" linkLabel={msg(\"View all\")} />\n <div className=\"-mx-4 sm:-mx-6 lg:-mx-8 aspect-[16/7] sm:aspect-[21/9] bg-muted animate-pulse\" />\n </section>\n </FadeIn>\n );\n}\n\nexport function FeaturedCarousel({\n collections,\n isLoading,\n getHref,\n allCollectionsHref = \"/collections\",\n}: FeaturedCarouselProps) {\n const t = useT();\n const [active, setActive] = useState(0);\n const [paused, setPaused] = useState(false);\n const total = collections.length;\n\n const next = useCallback(() => setActive((p) => (p + 1) % total), [total]);\n const prev = useCallback(() => setActive((p) => (p - 1 + total) % total), [total]);\n\n useEffect(() => { setActive(0); }, [total]);\n\n useEffect(() => {\n if (paused || total <= 1) return;\n const id = setInterval(next, 6000);\n return () => clearInterval(id);\n }, [next, paused, total]);\n\n if (isLoading) return <FeaturedCarouselSkeleton />;\n if (total === 0) return null;\n\n return (\n <FadeIn>\n <section className=\"space-y-4\">\n <SectionHeading icon={<Sparkles />} title={t(\"Featured collections\")} href={allCollectionsHref} linkLabel={msg(\"View all\")} />\n\n <div\n className=\"-mx-4 sm:-mx-6 lg:-mx-8 relative overflow-hidden aspect-[16/7] sm:aspect-[21/9] bg-muted\"\n onMouseEnter={() => setPaused(true)}\n onMouseLeave={() => setPaused(false)}\n >\n <AnimatePresence mode=\"wait\">\n <motion.div\n key={active}\n className=\"absolute inset-0\"\n initial={{ opacity: 0, x: 40 }}\n animate={{ opacity: 1, x: 0 }}\n exit={{ opacity: 0, x: -40 }}\n transition={{ duration: 0.45, ease: EASE_OUT }}\n >\n <Slide collection={collections[active]} href={getHref(collections[active])} />\n </motion.div>\n </AnimatePresence>\n\n {total > 1 && (\n <>\n <button\n onClick={prev}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 min-h-11 min-w-11 rounded-full flex items-center justify-center z-10\"\n aria-label={t(\"Previous\")}\n >\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-black/40 border border-white/10 backdrop-blur-sm text-white hover:bg-black/60 transition-colors\">\n <ChevronLeft className=\"h-4 w-4\" />\n </span>\n </button>\n <button\n onClick={next}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 min-h-11 min-w-11 rounded-full flex items-center justify-center z-10\"\n aria-label={t(\"Next\")}\n >\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-black/40 border border-white/10 backdrop-blur-sm text-white hover:bg-black/60 transition-colors\">\n <ChevronRight className=\"h-4 w-4\" />\n </span>\n </button>\n </>\n )}\n\n {total > 1 && (\n <div className=\"absolute bottom-4 left-1/2 -translate-x-1/2 flex items-center gap-1.5 z-10\">\n {collections.map((_, i) => (\n <button\n key={i}\n onClick={() => setActive(i)}\n className={`h-1.5 rounded-full transition-all duration-300 ${\n i === active ? \"w-6 bg-white\" : \"w-1.5 bg-white/40 hover:bg-white/70\"\n }`}\n aria-label={`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CACD,GACH;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -8,6 +8,7 @@ import { SectionHeading } from "./section-heading.js";
|
|
|
8
8
|
import { formatDisplayPrice } from "../utils/format.js";
|
|
9
9
|
import { useImageUrl } from "../utils/use-image-url.js";
|
|
10
10
|
import { useT } from "../i18n/provider.js";
|
|
11
|
+
import { msg } from "../i18n/translate.js";
|
|
11
12
|
function Slide({ collection, href }) {
|
|
12
13
|
const t = useT();
|
|
13
14
|
const resolveImage = useImageUrl();
|
|
@@ -57,7 +58,7 @@ function Slide({ collection, href }) {
|
|
|
57
58
|
function FeaturedCarouselSkeleton() {
|
|
58
59
|
const t = useT();
|
|
59
60
|
return /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("section", { className: "space-y-4", children: [
|
|
60
|
-
/* @__PURE__ */ jsx(SectionHeading, { icon: /* @__PURE__ */ jsx(Sparkles, {}), title: t("Featured collections"), href: "/collections", linkLabel: "View all" }),
|
|
61
|
+
/* @__PURE__ */ jsx(SectionHeading, { icon: /* @__PURE__ */ jsx(Sparkles, {}), title: t("Featured collections"), href: "/collections", linkLabel: msg("View all") }),
|
|
61
62
|
/* @__PURE__ */ jsx("div", { className: "-mx-4 sm:-mx-6 lg:-mx-8 aspect-[16/7] sm:aspect-[21/9] bg-muted animate-pulse" })
|
|
62
63
|
] }) });
|
|
63
64
|
}
|
|
@@ -84,7 +85,7 @@ function FeaturedCarousel({
|
|
|
84
85
|
if (isLoading) return /* @__PURE__ */ jsx(FeaturedCarouselSkeleton, {});
|
|
85
86
|
if (total === 0) return null;
|
|
86
87
|
return /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("section", { className: "space-y-4", children: [
|
|
87
|
-
/* @__PURE__ */ jsx(SectionHeading, { icon: /* @__PURE__ */ jsx(Sparkles, {}), title: t("Featured collections"), href: allCollectionsHref, linkLabel: "View all" }),
|
|
88
|
+
/* @__PURE__ */ jsx(SectionHeading, { icon: /* @__PURE__ */ jsx(Sparkles, {}), title: t("Featured collections"), href: allCollectionsHref, linkLabel: msg("View all") }),
|
|
88
89
|
/* @__PURE__ */ jsxs(
|
|
89
90
|
"div",
|
|
90
91
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/featured-carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useCallback } from \"react\";\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport { ChevronLeft, ChevronRight, ArrowRight, Sparkles } from \"lucide-react\";\nimport { FadeIn, EASE_OUT } from \"./motion-primitives.js\";\nimport { SectionHeading } from \"./section-heading.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface FeaturedCarouselProps {\n collections: ApiCollection[];\n isLoading: boolean;\n getHref: (collection: ApiCollection) => string;\n allCollectionsHref?: string;\n}\n\nfunction Slide({ collection, href }: { collection: ApiCollection; href: string }) {\n const t = useT();\n const resolveImage = useImageUrl();\n const name = collection.name ?? \"Featured Collection\";\n const image = resolveImage(collection.image);\n\n return (\n <div className=\"relative w-full h-full\">\n {image ? (\n <img\n src={image}\n alt={name}\n loading=\"lazy\"\n className=\"absolute inset-0 w-full h-full object-cover\"\n />\n ) : (\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/30 via-brand-blue/20 to-brand-navy/40\" />\n )}\n <div className=\"absolute inset-0 bg-gradient-to-t from-black/85 via-black/30 to-black/10\" />\n <div className=\"absolute inset-0 bg-gradient-to-r from-black/50 via-transparent to-transparent\" />\n <div className=\"absolute bottom-0 left-0 right-0 p-5 sm:p-8 lg:p-10\">\n <h2 className=\"text-2xl sm:text-3xl lg:text-4xl font-black text-white leading-tight mb-3 max-w-lg\">\n {name}\n </h2>\n <div className=\"flex items-center gap-4 mb-5\">\n {collection.totalSupply != null && (\n <span className=\"text-sm text-white/70\">\n <span className=\"font-bold text-white\">{collection.totalSupply}</span> {t(\"items\")}\n </span>\n )}\n {collection.floorPrice && (\n <span className=\"text-sm text-white/70\">\n {t(\"Floor\")}{\" \"}\n <span className=\"font-bold text-brand-orange\">\n {formatDisplayPrice(collection.floorPrice)}\n </span>\n </span>\n )}\n </div>\n <a\n href={href}\n className=\"inline-flex items-center gap-2 text-sm font-semibold px-4 py-2 rounded-lg bg-white/15 hover:bg-white/25 text-white border border-white/20 backdrop-blur-sm transition-colors\"\n >\n {t(\"View collection\")} <ArrowRight className=\"h-3.5 w-3.5\" />\n </a>\n </div>\n </div>\n );\n}\n\nexport function FeaturedCarouselSkeleton() {\n const t = useT();\n return (\n <FadeIn>\n <section className=\"space-y-4\">\n <SectionHeading icon={<Sparkles />} title={t(\"Featured collections\")} href=\"/collections\" linkLabel=\"View all\" />\n <div className=\"-mx-4 sm:-mx-6 lg:-mx-8 aspect-[16/7] sm:aspect-[21/9] bg-muted animate-pulse\" />\n </section>\n </FadeIn>\n );\n}\n\nexport function FeaturedCarousel({\n collections,\n isLoading,\n getHref,\n allCollectionsHref = \"/collections\",\n}: FeaturedCarouselProps) {\n const t = useT();\n const [active, setActive] = useState(0);\n const [paused, setPaused] = useState(false);\n const total = collections.length;\n\n const next = useCallback(() => setActive((p) => (p + 1) % total), [total]);\n const prev = useCallback(() => setActive((p) => (p - 1 + total) % total), [total]);\n\n useEffect(() => { setActive(0); }, [total]);\n\n useEffect(() => {\n if (paused || total <= 1) return;\n const id = setInterval(next, 6000);\n return () => clearInterval(id);\n }, [next, paused, total]);\n\n if (isLoading) return <FeaturedCarouselSkeleton />;\n if (total === 0) return null;\n\n return (\n <FadeIn>\n <section className=\"space-y-4\">\n <SectionHeading icon={<Sparkles />} title={t(\"Featured collections\")} href={allCollectionsHref} linkLabel=\"View all\" />\n\n <div\n className=\"-mx-4 sm:-mx-6 lg:-mx-8 relative overflow-hidden aspect-[16/7] sm:aspect-[21/9] bg-muted\"\n onMouseEnter={() => setPaused(true)}\n onMouseLeave={() => setPaused(false)}\n >\n <AnimatePresence mode=\"wait\">\n <motion.div\n key={active}\n className=\"absolute inset-0\"\n initial={{ opacity: 0, x: 40 }}\n animate={{ opacity: 1, x: 0 }}\n exit={{ opacity: 0, x: -40 }}\n transition={{ duration: 0.45, ease: EASE_OUT }}\n >\n <Slide collection={collections[active]} href={getHref(collections[active])} />\n </motion.div>\n </AnimatePresence>\n\n {total > 1 && (\n <>\n <button\n onClick={prev}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 min-h-11 min-w-11 rounded-full flex items-center justify-center z-10\"\n aria-label={t(\"Previous\")}\n >\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-black/40 border border-white/10 backdrop-blur-sm text-white hover:bg-black/60 transition-colors\">\n <ChevronLeft className=\"h-4 w-4\" />\n </span>\n </button>\n <button\n onClick={next}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 min-h-11 min-w-11 rounded-full flex items-center justify-center z-10\"\n aria-label={t(\"Next\")}\n >\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-black/40 border border-white/10 backdrop-blur-sm text-white hover:bg-black/60 transition-colors\">\n <ChevronRight className=\"h-4 w-4\" />\n </span>\n </button>\n </>\n )}\n\n {total > 1 && (\n <div className=\"absolute bottom-4 left-1/2 -translate-x-1/2 flex items-center gap-1.5 z-10\">\n {collections.map((_, i) => (\n <button\n key={i}\n onClick={() => setActive(i)}\n className={`h-1.5 rounded-full transition-all duration-300 ${\n i === active ? \"w-6 bg-white\" : \"w-1.5 bg-white/40 hover:bg-white/70\"\n }`}\n aria-label={`Go to slide ${i + 1}`}\n />\n ))}\n </div>\n )}\n </div>\n </section>\n </FadeIn>\n );\n}\n"],"mappings":";AA4BQ,SAsGI,UAtGJ,KAiBI,YAjBJ;AA1BR,SAAS,UAAU,WAAW,mBAAmB;AACjD,SAAS,QAAQ,uBAAuB;AACxC,SAAS,aAAa,cAAc,YAA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AAAA,YAAC,OAAO;AAAA,YAAP;AAAA,cAEC,WAAU;AAAA,cACV,SAAS,EAAE,SAAS,GAAG,GAAG,GAAG;AAAA,cAC7B,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE;AAAA,cAC5B,MAAM,EAAE,SAAS,GAAG,GAAG,IAAI;AAAA,cAC3B,YAAY,EAAE,UAAU,MAAM,MAAM,SAAS;AAAA,cAE7C,8BAAC,SAAM,YAAY,YAAY,MAAM,GAAG,MAAM,QAAQ,YAAY,MAAM,CAAC,GAAG;AAAA;AAAA,YAPvE;AAAA,UAQP,GACF;AAAA,UAEC,QAAQ,KACP,iCACE;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,SAAS;AAAA,gBACT,WAAU;AAAA,gBACV,cAAY,EAAE,UAAU;AAAA,gBAExB,8BAAC,UAAK,WAAU,4JACd,8BAAC,eAAY,WAAU,WAAU,GACnC;AAAA;AAAA,YACF;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,SAAS;AAAA,gBACT,WAAU;AAAA,gBACV,cAAY,EAAE,MAAM;AAAA,gBAEpB,8BAAC,UAAK,WAAU,4JACd,8BAAC,gBAAa,WAAU,WAAU,GACpC;AAAA;AAAA,YACF;AAAA,aACF;AAAA,UAGD,QAAQ,KACP,oBAAC,SAAI,WAAU,8EACZ,sBAAY,IAAI,CAAC,GAAG,MACnB;AAAA,YAAC;AAAA;AAAA,cAEC,SAAS,MAAM,UAAU,CAAC;AAAA,cAC1B,WAAW,kDACT,MAAM,SAAS,iBAAiB,qCAClC;AAAA,cACA,cAAY,eAAe,IAAI,CAAC;AAAA;AAAA,YAL3B;AAAA,UAMP,CACD,GACH;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/featured-carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useCallback } from \"react\";\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport { ChevronLeft, ChevronRight, ArrowRight, Sparkles } from \"lucide-react\";\nimport { FadeIn, EASE_OUT } from \"./motion-primitives.js\";\nimport { SectionHeading } from \"./section-heading.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nimport { msg } from \"../i18n/translate.js\";\nexport interface FeaturedCarouselProps {\n collections: ApiCollection[];\n isLoading: boolean;\n getHref: (collection: ApiCollection) => string;\n allCollectionsHref?: string;\n}\n\nfunction Slide({ collection, href }: { collection: ApiCollection; href: string }) {\n const t = useT();\n const resolveImage = useImageUrl();\n const name = collection.name ?? \"Featured Collection\";\n const image = resolveImage(collection.image);\n\n return (\n <div className=\"relative w-full h-full\">\n {image ? (\n <img\n src={image}\n alt={name}\n loading=\"lazy\"\n className=\"absolute inset-0 w-full h-full object-cover\"\n />\n ) : (\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/30 via-brand-blue/20 to-brand-navy/40\" />\n )}\n <div className=\"absolute inset-0 bg-gradient-to-t from-black/85 via-black/30 to-black/10\" />\n <div className=\"absolute inset-0 bg-gradient-to-r from-black/50 via-transparent to-transparent\" />\n <div className=\"absolute bottom-0 left-0 right-0 p-5 sm:p-8 lg:p-10\">\n <h2 className=\"text-2xl sm:text-3xl lg:text-4xl font-black text-white leading-tight mb-3 max-w-lg\">\n {name}\n </h2>\n <div className=\"flex items-center gap-4 mb-5\">\n {collection.totalSupply != null && (\n <span className=\"text-sm text-white/70\">\n <span className=\"font-bold text-white\">{collection.totalSupply}</span> {t(\"items\")}\n </span>\n )}\n {collection.floorPrice && (\n <span className=\"text-sm text-white/70\">\n {t(\"Floor\")}{\" \"}\n <span className=\"font-bold text-brand-orange\">\n {formatDisplayPrice(collection.floorPrice)}\n </span>\n </span>\n )}\n </div>\n <a\n href={href}\n className=\"inline-flex items-center gap-2 text-sm font-semibold px-4 py-2 rounded-lg bg-white/15 hover:bg-white/25 text-white border border-white/20 backdrop-blur-sm transition-colors\"\n >\n {t(\"View collection\")} <ArrowRight className=\"h-3.5 w-3.5\" />\n </a>\n </div>\n </div>\n );\n}\n\nexport function FeaturedCarouselSkeleton() {\n const t = useT();\n return (\n <FadeIn>\n <section className=\"space-y-4\">\n <SectionHeading icon={<Sparkles />} title={t(\"Featured collections\")} href=\"/collections\" linkLabel={msg(\"View all\")} />\n <div className=\"-mx-4 sm:-mx-6 lg:-mx-8 aspect-[16/7] sm:aspect-[21/9] bg-muted animate-pulse\" />\n </section>\n </FadeIn>\n );\n}\n\nexport function FeaturedCarousel({\n collections,\n isLoading,\n getHref,\n allCollectionsHref = \"/collections\",\n}: FeaturedCarouselProps) {\n const t = useT();\n const [active, setActive] = useState(0);\n const [paused, setPaused] = useState(false);\n const total = collections.length;\n\n const next = useCallback(() => setActive((p) => (p + 1) % total), [total]);\n const prev = useCallback(() => setActive((p) => (p - 1 + total) % total), [total]);\n\n useEffect(() => { setActive(0); }, [total]);\n\n useEffect(() => {\n if (paused || total <= 1) return;\n const id = setInterval(next, 6000);\n return () => clearInterval(id);\n }, [next, paused, total]);\n\n if (isLoading) return <FeaturedCarouselSkeleton />;\n if (total === 0) return null;\n\n return (\n <FadeIn>\n <section className=\"space-y-4\">\n <SectionHeading icon={<Sparkles />} title={t(\"Featured collections\")} href={allCollectionsHref} linkLabel={msg(\"View all\")} />\n\n <div\n className=\"-mx-4 sm:-mx-6 lg:-mx-8 relative overflow-hidden aspect-[16/7] sm:aspect-[21/9] bg-muted\"\n onMouseEnter={() => setPaused(true)}\n onMouseLeave={() => setPaused(false)}\n >\n <AnimatePresence mode=\"wait\">\n <motion.div\n key={active}\n className=\"absolute inset-0\"\n initial={{ opacity: 0, x: 40 }}\n animate={{ opacity: 1, x: 0 }}\n exit={{ opacity: 0, x: -40 }}\n transition={{ duration: 0.45, ease: EASE_OUT }}\n >\n <Slide collection={collections[active]} href={getHref(collections[active])} />\n </motion.div>\n </AnimatePresence>\n\n {total > 1 && (\n <>\n <button\n onClick={prev}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 min-h-11 min-w-11 rounded-full flex items-center justify-center z-10\"\n aria-label={t(\"Previous\")}\n >\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-black/40 border border-white/10 backdrop-blur-sm text-white hover:bg-black/60 transition-colors\">\n <ChevronLeft className=\"h-4 w-4\" />\n </span>\n </button>\n <button\n onClick={next}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 min-h-11 min-w-11 rounded-full flex items-center justify-center z-10\"\n aria-label={t(\"Next\")}\n >\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-black/40 border border-white/10 backdrop-blur-sm text-white hover:bg-black/60 transition-colors\">\n <ChevronRight className=\"h-4 w-4\" />\n </span>\n </button>\n </>\n )}\n\n {total > 1 && (\n <div className=\"absolute bottom-4 left-1/2 -translate-x-1/2 flex items-center gap-1.5 z-10\">\n {collections.map((_, i) => (\n <button\n key={i}\n onClick={() => setActive(i)}\n className={`h-1.5 rounded-full transition-all duration-300 ${\n i === active ? \"w-6 bg-white\" : \"w-1.5 bg-white/40 hover:bg-white/70\"\n }`}\n aria-label={`Go to slide ${i + 1}`}\n />\n ))}\n </div>\n )}\n </div>\n </section>\n </FadeIn>\n );\n}\n"],"mappings":";AA6BQ,SAsGI,UAtGJ,KAiBI,YAjBJ;AA3BR,SAAS,UAAU,WAAW,mBAAmB;AACjD,SAAS,QAAQ,uBAAuB;AACxC,SAAS,aAAa,cAAc,YAAY,gBAAgB;AAChE,SAAS,QAAQ,gBAAgB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AAEnC,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AAErB,SAAS,WAAW;AAQpB,SAAS,MAAM,EAAE,YAAY,KAAK,GAAgD;AAChF,QAAM,IAAI,KAAK;AACf,QAAM,eAAe,YAAY;AACjC,QAAM,OAAO,WAAW,QAAQ;AAChC,QAAM,QAAQ,a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AS;AAAA,cAE7C,8BAAC,SAAM,YAAY,YAAY,MAAM,GAAG,MAAM,QAAQ,YAAY,MAAM,CAAC,GAAG;AAAA;AAAA,YAPvE;AAAA,UAQP,GACF;AAAA,UAEC,QAAQ,KACP,iCACE;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,SAAS;AAAA,gBACT,WAAU;AAAA,gBACV,cAAY,EAAE,UAAU;AAAA,gBAExB,8BAAC,UAAK,WAAU,4JACd,8BAAC,eAAY,WAAU,WAAU,GACnC;AAAA;AAAA,YACF;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,SAAS;AAAA,gBACT,WAAU;AAAA,gBACV,cAAY,EAAE,MAAM;AAAA,gBAEpB,8BAAC,UAAK,WAAU,4JACd,8BAAC,gBAAa,WAAU,WAAU,GACpC;AAAA;AAAA,YACF;AAAA,aACF;AAAA,UAGD,QAAQ,KACP,oBAAC,SAAI,WAAU,8EACZ,sBAAY,IAAI,CAAC,GAAG,MACnB;AAAA,YAAC;AAAA;AAAA,cAEC,SAAS,MAAM,UAAU,CAAC;AAAA,cAC1B,WAAW,kDACT,MAAM,SAAS,iBAAiB,qCAClC;AAAA,cACA,cAAY,eAAe,IAAI,CAAC;AAAA;AAAA,YAL3B;AAAA,UAMP,CACD,GACH;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -95,7 +95,7 @@ function GatedContentPanel({ state, onBrowseListings }) {
|
|
|
95
95
|
const t = (0, import_provider.useT)();
|
|
96
96
|
const { connectLabel = "Sign in", onRequireWallet } = (0, import_medialane_app.useMedialaneApp)();
|
|
97
97
|
if (state.status === "signed_out") {
|
|
98
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LockedNotice, { title:
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LockedNotice, { title: t("{label} to unlock", { label: t(connectLabel) }), body: t("This collection has exclusive content for holders. Sign in so we can check your holdings."), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: onRequireWallet, className: PRIMARY, children: t(connectLabel) }) });
|
|
99
99
|
}
|
|
100
100
|
if (state.status === "loading") {
|
|
101
101
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-16 flex flex-col items-center gap-3", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/gated-content.tsx"],"sourcesContent":["\"use client\";\n\nimport { Loader2, Lock, ShoppingBag, Sparkles, Unlock } from \"lucide-react\";\nimport type { ApiCollectionProfile } from \"@medialane/sdk\";\nimport { BRAND_COLOR } from \"../data/brand.js\";\nimport { GATED_CONTENT_TYPES, GATED_CONTENT_TYPE_FALLBACK } from \"../data/gated-content-types.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface GatedContent {\n title: string | null;\n url: string;\n type: string | null;\n}\n\nexport type GatedContentState =\n | { status: \"signed_out\" }\n | { status: \"loading\" }\n | { status: \"not_holder\" }\n | { status: \"unlocked\"; content: GatedContent }\n | { status: \"error\" };\n\nconst typeOf = (content: GatedContent) => (content.type ? GATED_CONTENT_TYPES[content.type] ?? GATED_CONTENT_TYPE_FALLBACK : GATED_CONTENT_TYPE_FALLBACK);\n\nexport function GatedContentHero({\n profile,\n state,\n onViewExclusive,\n}: {\n profile: ApiCollectionProfile | null;\n state: GatedContentState;\n onViewExclusive: () => void;\n}) {\n const t = useT();\n if (!profile?.hasGatedContent) return null;\n const title = profile.gatedContentTitle ?? \"Exclusive content for holders\";\n\n if (state.status === \"unlocked\") {\n const { icon: Icon } = typeOf(state.content);\n return (\n <button\n onClick={onViewExclusive}\n className=\"w-full flex items-center gap-4 rounded-2xl border border-emerald-500/40 bg-emerald-500/10 hover:bg-emerald-500/15 px-5 py-4 transition-colors text-left\"\n >\n <div className=\"h-11 w-11 rounded-xl bg-emerald-500/20 border border-emerald-500/30 flex items-center justify-center shrink-0 text-emerald-500\">\n <Icon className=\"h-5 w-5\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-2xs font-bold text-emerald-500 leading-none\">{t(\"✓ You're a holder — unlocked\")}</p>\n <p className=\"text-sm font-bold text-foreground leading-snug mt-1 truncate\">{state.content.title ?? title}</p>\n </div>\n <Unlock className=\"h-4 w-4 text-emerald-500 shrink-0\" />\n </button>\n );\n }\n\n return (\n <div className=\"card-exclusive-wrapper btn-border-animated\">\n <button\n onClick={onViewExclusive}\n className=\"w-full flex items-center gap-4 rounded-[calc(var(--radius)*1.25)] bg-card hover:bg-muted/60 px-5 py-4 transition-colors text-left group\"\n >\n <div className=\"h-11 w-11 rounded-xl bg-muted flex items-center justify-center shrink-0\">\n <Lock className=\"h-5 w-5 text-muted-foreground\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p\n className=\"text-2xs font-bold leading-none mb-1\"\n style={{ background: `linear-gradient(90deg, ${BRAND_COLOR.blue}, ${BRAND_COLOR.purple}, ${BRAND_COLOR.rose})`, WebkitBackgroundClip: \"text\", WebkitTextFillColor: \"transparent\" }}\n >\n {t(\"Holder exclusive\")}\n </p>\n <p className=\"text-sm font-bold text-foreground leading-snug truncate\">{title}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">{t(\"Own a token from this collection to unlock\")}</p>\n </div>\n <Sparkles className=\"h-4 w-4 text-muted-foreground/50 group-hover:text-primary transition-colors shrink-0\" />\n </button>\n </div>\n );\n}\n\nfunction LockedNotice({ title, body, children }: { title: string; body: string; children?: React.ReactNode }) {\n return (\n <div className=\"py-16 flex flex-col items-center gap-5 text-center max-w-sm mx-auto\">\n <div className=\"h-16 w-16 rounded-2xl bg-muted flex items-center justify-center\">\n <Lock className=\"h-8 w-8 text-muted-foreground/50\" />\n </div>\n <div>\n <p className=\"text-base font-semibold\">{title}</p>\n <p className=\"text-sm text-muted-foreground mt-1\">{body}</p>\n </div>\n {children}\n </div>\n );\n}\n\nconst PRIMARY = \"inline-flex items-center gap-2 bg-foreground text-background hover:opacity-90 font-semibold px-5 py-2.5 rounded-xl transition-all text-sm\";\n\nexport function GatedContentPanel({ state, onBrowseListings }: { state: GatedContentState; onBrowseListings: () => void }) {\n const t = useT();\n const { connectLabel = \"Sign in\", onRequireWallet } = useMedialaneApp();\n\n if (state.status === \"signed_out\") {\n return (\n <LockedNotice title={`${connectLabel} to unlock`} body={t(\"This collection has exclusive content for holders. Sign in so we can check your holdings.\")}>\n <button type=\"button\" onClick={onRequireWallet} className={PRIMARY}>{connectLabel}</button>\n </LockedNotice>\n );\n }\n if (state.status === \"loading\") {\n return (\n <div className=\"py-16 flex flex-col items-center gap-3\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground/40\" />\n <p className=\"text-xs text-muted-foreground\">{t(\"Checking your holdings…\")}</p>\n </div>\n );\n }\n if (state.status === \"not_holder\") {\n return (\n <LockedNotice title={t(\"Holders only\")} body={t(\"Hold at least one token from this collection to open the exclusive content.\")}>\n <button type=\"button\" onClick={onBrowseListings} className={PRIMARY}>\n <ShoppingBag className=\"h-4 w-4\" />\n {t(\"Browse listings\")}\n </button>\n </LockedNotice>\n );\n }\n if (state.status === \"error\") {\n return <LockedNotice title={t(\"Couldn't check your holdings\")} body={t(\"Refresh the page to try again.\")} />;\n }\n\n const { icon: Icon, cta } = typeOf(state.content);\n return (\n <div className=\"py-8 flex flex-col items-center gap-6 text-center max-w-md mx-auto\">\n <div className=\"relative\">\n <div className=\"h-20 w-20 rounded-2xl bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-500\">\n <Unlock className=\"h-10 w-10\" />\n </div>\n <div className=\"absolute -bottom-1 -right-1 h-6 w-6 rounded-full bg-emerald-500 flex items-center justify-center\">\n <Sparkles className=\"h-3 w-3 text-white\" />\n </div>\n </div>\n <div className=\"space-y-1.5\">\n <p className=\"text-2xs font-bold text-emerald-500\">{t(\"✓ Verified holder\")}</p>\n <h3 className=\"text-xl font-bold\">{state.content.title ?? t(\"Exclusive content\")}</h3>\n <p className=\"text-sm text-muted-foreground\">{t(\"Your access is verified. Enjoy your exclusive content.\")}</p>\n </div>\n <a\n href={state.content.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-2.5 bg-emerald-500 hover:bg-emerald-600 active:scale-[0.98] text-white font-semibold px-6 py-3 rounded-xl transition-all text-sm shadow-lg shadow-emerald-500/20\"\n >\n <Icon className=\"h-5 w-5\" />\n {cta}\n </a>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6CU;AA3CV,0BAA6D;AAE7D,mBAA4B;AAC5B,iCAAiE;AACjE,2BAAgC;AAChC,sBAAqB;AAerB,MAAM,SAAS,CAAC,YAA2B,QAAQ,OAAO,+CAAoB,QAAQ,IAAI,KAAK,yDAA8B;AAEtH,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,QAAI,sBAAK;AACf,MAAI,CAAC,SAAS,gBAAiB,QAAO;AACtC,QAAM,QAAQ,QAAQ,qBAAqB;AAE3C,MAAI,MAAM,WAAW,YAAY;AAC/B,UAAM,EAAE,MAAM,KAAK,IAAI,OAAO,MAAM,OAAO;AAC3C,WACE;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAU;AAAA,QAEV;AAAA,sDAAC,SAAI,WAAU,kIACb,sDAAC,QAAK,WAAU,WAAU,GAC5B;AAAA,UACA,6CAAC,SAAI,WAAU,kBACb;AAAA,wDAAC,OAAE,WAAU,oDAAoD,YAAE,wCAA8B,GAAE;AAAA,YACnG,4CAAC,OAAE,WAAU,gEAAgE,gBAAM,QAAQ,SAAS,OAAM;AAAA,aAC5G;AAAA,UACA,4CAAC,8BAAO,WAAU,qCAAoC;AAAA;AAAA;AAAA,IACxD;AAAA,EAEJ;AAEA,SACE,4CAAC,SAAI,WAAU,8CACb;AAAA,IAAC;AAAA;AA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F;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/gated-content.tsx"],"sourcesContent":["\"use client\";\n\nimport { Loader2, Lock, ShoppingBag, Sparkles, Unlock } from \"lucide-react\";\nimport type { ApiCollectionProfile } from \"@medialane/sdk\";\nimport { BRAND_COLOR } from \"../data/brand.js\";\nimport { GATED_CONTENT_TYPES, GATED_CONTENT_TYPE_FALLBACK } from \"../data/gated-content-types.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface GatedContent {\n title: string | null;\n url: string;\n type: string | null;\n}\n\nexport type GatedContentState =\n | { status: \"signed_out\" }\n | { status: \"loading\" }\n | { status: \"not_holder\" }\n | { status: \"unlocked\"; content: GatedContent }\n | { status: \"error\" };\n\nconst typeOf = (content: GatedContent) => (content.type ? GATED_CONTENT_TYPES[content.type] ?? GATED_CONTENT_TYPE_FALLBACK : GATED_CONTENT_TYPE_FALLBACK);\n\nexport function GatedContentHero({\n profile,\n state,\n onViewExclusive,\n}: {\n profile: ApiCollectionProfile | null;\n state: GatedContentState;\n onViewExclusive: () => void;\n}) {\n const t = useT();\n if (!profile?.hasGatedContent) return null;\n const title = profile.gatedContentTitle ?? \"Exclusive content for holders\";\n\n if (state.status === \"unlocked\") {\n const { icon: Icon } = typeOf(state.content);\n return (\n <button\n onClick={onViewExclusive}\n className=\"w-full flex items-center gap-4 rounded-2xl border border-emerald-500/40 bg-emerald-500/10 hover:bg-emerald-500/15 px-5 py-4 transition-colors text-left\"\n >\n <div className=\"h-11 w-11 rounded-xl bg-emerald-500/20 border border-emerald-500/30 flex items-center justify-center shrink-0 text-emerald-500\">\n <Icon className=\"h-5 w-5\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-2xs font-bold text-emerald-500 leading-none\">{t(\"✓ You're a holder — unlocked\")}</p>\n <p className=\"text-sm font-bold text-foreground leading-snug mt-1 truncate\">{state.content.title ?? title}</p>\n </div>\n <Unlock className=\"h-4 w-4 text-emerald-500 shrink-0\" />\n </button>\n );\n }\n\n return (\n <div className=\"card-exclusive-wrapper btn-border-animated\">\n <button\n onClick={onViewExclusive}\n className=\"w-full flex items-center gap-4 rounded-[calc(var(--radius)*1.25)] bg-card hover:bg-muted/60 px-5 py-4 transition-colors text-left group\"\n >\n <div className=\"h-11 w-11 rounded-xl bg-muted flex items-center justify-center shrink-0\">\n <Lock className=\"h-5 w-5 text-muted-foreground\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p\n className=\"text-2xs font-bold leading-none mb-1\"\n style={{ background: `linear-gradient(90deg, ${BRAND_COLOR.blue}, ${BRAND_COLOR.purple}, ${BRAND_COLOR.rose})`, WebkitBackgroundClip: \"text\", WebkitTextFillColor: \"transparent\" }}\n >\n {t(\"Holder exclusive\")}\n </p>\n <p className=\"text-sm font-bold text-foreground leading-snug truncate\">{title}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">{t(\"Own a token from this collection to unlock\")}</p>\n </div>\n <Sparkles className=\"h-4 w-4 text-muted-foreground/50 group-hover:text-primary transition-colors shrink-0\" />\n </button>\n </div>\n );\n}\n\nfunction LockedNotice({ title, body, children }: { title: string; body: string; children?: React.ReactNode }) {\n return (\n <div className=\"py-16 flex flex-col items-center gap-5 text-center max-w-sm mx-auto\">\n <div className=\"h-16 w-16 rounded-2xl bg-muted flex items-center justify-center\">\n <Lock className=\"h-8 w-8 text-muted-foreground/50\" />\n </div>\n <div>\n <p className=\"text-base font-semibold\">{title}</p>\n <p className=\"text-sm text-muted-foreground mt-1\">{body}</p>\n </div>\n {children}\n </div>\n );\n}\n\nconst PRIMARY = \"inline-flex items-center gap-2 bg-foreground text-background hover:opacity-90 font-semibold px-5 py-2.5 rounded-xl transition-all text-sm\";\n\nexport function GatedContentPanel({ state, onBrowseListings }: { state: GatedContentState; onBrowseListings: () => void }) {\n const t = useT();\n const { connectLabel = \"Sign in\", onRequireWallet } = useMedialaneApp();\n\n if (state.status === \"signed_out\") {\n return (\n <LockedNotice title={t(\"{label} to unlock\", { label: t(connectLabel) })} body={t(\"This collection has exclusive content for holders. Sign in so we can check your holdings.\")}>\n <button type=\"button\" onClick={onRequireWallet} className={PRIMARY}>{t(connectLabel)}</button>\n </LockedNotice>\n );\n }\n if (state.status === \"loading\") {\n return (\n <div className=\"py-16 flex flex-col items-center gap-3\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground/40\" />\n <p className=\"text-xs text-muted-foreground\">{t(\"Checking your holdings…\")}</p>\n </div>\n );\n }\n if (state.status === \"not_holder\") {\n return (\n <LockedNotice title={t(\"Holders only\")} body={t(\"Hold at least one token from this collection to open the exclusive content.\")}>\n <button type=\"button\" onClick={onBrowseListings} className={PRIMARY}>\n <ShoppingBag className=\"h-4 w-4\" />\n {t(\"Browse listings\")}\n </button>\n </LockedNotice>\n );\n }\n if (state.status === \"error\") {\n return <LockedNotice title={t(\"Couldn't check your holdings\")} body={t(\"Refresh the page to try again.\")} />;\n }\n\n const { icon: Icon, cta } = typeOf(state.content);\n return (\n <div className=\"py-8 flex flex-col items-center gap-6 text-center max-w-md mx-auto\">\n <div className=\"relative\">\n <div className=\"h-20 w-20 rounded-2xl bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-500\">\n <Unlock className=\"h-10 w-10\" />\n </div>\n <div className=\"absolute -bottom-1 -right-1 h-6 w-6 rounded-full bg-emerald-500 flex items-center justify-center\">\n <Sparkles className=\"h-3 w-3 text-white\" />\n </div>\n </div>\n <div className=\"space-y-1.5\">\n <p className=\"text-2xs font-bold text-emerald-500\">{t(\"✓ Verified holder\")}</p>\n <h3 className=\"text-xl font-bold\">{state.content.title ?? t(\"Exclusive content\")}</h3>\n <p className=\"text-sm text-muted-foreground\">{t(\"Your access is verified. Enjoy your exclusive content.\")}</p>\n </div>\n <a\n href={state.content.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-2.5 bg-emerald-500 hover:bg-emerald-600 active:scale-[0.98] text-white font-semibold px-6 py-3 rounded-xl transition-all text-sm shadow-lg shadow-emerald-500/20\"\n >\n <Icon className=\"h-5 w-5\" />\n {cta}\n </a>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6CU;AA3CV,0BAA6D;AAE7D,mBAA4B;AAC5B,iCAAiE;AACjE,2BAAgC;AAChC,sBAAqB;AAerB,MAAM,SAAS,CAAC,YAA2B,QAAQ,OAAO,+CAAoB,QAAQ,IAAI,KAAK,yDAA8B;AAEtH,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,QAAI,sBAAK;AACf,MAAI,CAAC,SAAS,gBAAiB,QAAO;AACtC,QAAM,QAAQ,QAAQ,qBAAqB;AAE3C,MAAI,MAAM,WAAW,YAAY;AAC/B,UAAM,EAAE,MAAM,KAAK,IAAI,OAAO,MAAM,OAAO;AAC3C,WACE;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAU;AAAA,QAEV;AAAA,sDAAC,SAAI,WAAU,kIACb,sDAAC,QAAK,WAAU,WAAU,GAC5B;AAAA,UACA,6CAAC,SAAI,WAAU,kBACb;AAAA,wDAAC,OAAE,WAAU,oDAAoD,YAAE,wCAA8B,GAAE;AAAA,YACnG,4CAAC,OAAE,WAAU,gEAAgE,gBAAM,QAAQ,SAAS,OAAM;AAAA,aAC5G;AAAA,UACA,4CAAC,8BAAO,WAAU,qCAAoC;AAAA;AAAA;AAAA,IACxD;AAAA,EAEJ;AAEA,SACE,4CAAC,SAAI,WAAU,8CACb;AAAA,IAAC;AAAA;AAAA,MACC,SAAS;AAAA,MACT,WAAU;AAAA,MAEV;AAAA,oDAAC,SAAI,WAAU,2EACb,sDAAC,4BAAK,WAAU,iCAAgC,GAClD;AAAA,QACA,6CAAC,SAAI,WAAU,kBACb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,WAAU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A,EAEJ;AACA,MAAI,MAAM,WAAW,cAAc;AACjC,WACE,4CAAC,gBAAa,OAAO,EAAE,cAAc,GAAG,MAAM,EAAE,6EAA6E,GAC3H,uDAAC,YAAO,MAAK,UAAS,SAAS,kBAAkB,WAAW,SAC1D;AAAA,kDAAC,mCAAY,WAAU,WAAU;AAAA,MAChC,EAAE,iBAAiB;AAAA,OACtB,GACF;AAAA,EAEJ;AACA,MAAI,MAAM,WAAW,SAAS;AAC5B,WAAO,4CAAC,gBAAa,OAAO,EAAE,8BAA8B,GAAG,MAAM,EAAE,gCAAgC,GAAG;AAAA,EAC5G;AAEA,QAAM,EAAE,MAAM,MAAM,IAAI,IAAI,OAAO,MAAM,OAAO;AAChD,SACE,6CAAC,SAAI,WAAU,sEACb;AAAA,iDAAC,SAAI,WAAU,YACb;AAAA,kDAAC,SAAI,WAAU,0HACb,sDAAC,8BAAO,WAAU,aAAY,GAChC;AAAA,MACA,4CAAC,SAAI,WAAU,oGACb,sDAAC,gCAAS,WAAU,sBAAqB,GAC3C;AAAA,OACF;AAAA,IACA,6CAAC,SAAI,WAAU,eACb;AAAA,kDAAC,OAAE,WAAU,uCAAuC,YAAE,wBAAmB,GAAE;AAAA,MAC3E,4CAAC,QAAG,WAAU,qBAAqB,gBAAM,QAAQ,SAAS,EAAE,mBAAmB,GAAE;AAAA,MACjF,4CAAC,OAAE,WAAU,iCAAiC,YAAE,wDAAwD,GAAE;AAAA,OAC5G;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,MAAM,QAAQ;AAAA,QACpB,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,WAAU;AAAA,QAEV;AAAA,sDAAC,QAAK,WAAU,WAAU;AAAA,UACzB;AAAA;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -71,7 +71,7 @@ function GatedContentPanel({ state, onBrowseListings }) {
|
|
|
71
71
|
const t = useT();
|
|
72
72
|
const { connectLabel = "Sign in", onRequireWallet } = useMedialaneApp();
|
|
73
73
|
if (state.status === "signed_out") {
|
|
74
|
-
return /* @__PURE__ */ jsx(LockedNotice, { title:
|
|
74
|
+
return /* @__PURE__ */ jsx(LockedNotice, { title: t("{label} to unlock", { label: t(connectLabel) }), body: t("This collection has exclusive content for holders. Sign in so we can check your holdings."), children: /* @__PURE__ */ jsx("button", { type: "button", onClick: onRequireWallet, className: PRIMARY, children: t(connectLabel) }) });
|
|
75
75
|
}
|
|
76
76
|
if (state.status === "loading") {
|
|
77
77
|
return /* @__PURE__ */ jsxs("div", { className: "py-16 flex flex-col items-center gap-3", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/gated-content.tsx"],"sourcesContent":["\"use client\";\n\nimport { Loader2, Lock, ShoppingBag, Sparkles, Unlock } from \"lucide-react\";\nimport type { ApiCollectionProfile } from \"@medialane/sdk\";\nimport { BRAND_COLOR } from \"../data/brand.js\";\nimport { GATED_CONTENT_TYPES, GATED_CONTENT_TYPE_FALLBACK } from \"../data/gated-content-types.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface GatedContent {\n title: string | null;\n url: string;\n type: string | null;\n}\n\nexport type GatedContentState =\n | { status: \"signed_out\" }\n | { status: \"loading\" }\n | { status: \"not_holder\" }\n | { status: \"unlocked\"; content: GatedContent }\n | { status: \"error\" };\n\nconst typeOf = (content: GatedContent) => (content.type ? GATED_CONTENT_TYPES[content.type] ?? GATED_CONTENT_TYPE_FALLBACK : GATED_CONTENT_TYPE_FALLBACK);\n\nexport function GatedContentHero({\n profile,\n state,\n onViewExclusive,\n}: {\n profile: ApiCollectionProfile | null;\n state: GatedContentState;\n onViewExclusive: () => void;\n}) {\n const t = useT();\n if (!profile?.hasGatedContent) return null;\n const title = profile.gatedContentTitle ?? \"Exclusive content for holders\";\n\n if (state.status === \"unlocked\") {\n const { icon: Icon } = typeOf(state.content);\n return (\n <button\n onClick={onViewExclusive}\n className=\"w-full flex items-center gap-4 rounded-2xl border border-emerald-500/40 bg-emerald-500/10 hover:bg-emerald-500/15 px-5 py-4 transition-colors text-left\"\n >\n <div className=\"h-11 w-11 rounded-xl bg-emerald-500/20 border border-emerald-500/30 flex items-center justify-center shrink-0 text-emerald-500\">\n <Icon className=\"h-5 w-5\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-2xs font-bold text-emerald-500 leading-none\">{t(\"✓ You're a holder — unlocked\")}</p>\n <p className=\"text-sm font-bold text-foreground leading-snug mt-1 truncate\">{state.content.title ?? title}</p>\n </div>\n <Unlock className=\"h-4 w-4 text-emerald-500 shrink-0\" />\n </button>\n );\n }\n\n return (\n <div className=\"card-exclusive-wrapper btn-border-animated\">\n <button\n onClick={onViewExclusive}\n className=\"w-full flex items-center gap-4 rounded-[calc(var(--radius)*1.25)] bg-card hover:bg-muted/60 px-5 py-4 transition-colors text-left group\"\n >\n <div className=\"h-11 w-11 rounded-xl bg-muted flex items-center justify-center shrink-0\">\n <Lock className=\"h-5 w-5 text-muted-foreground\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p\n className=\"text-2xs font-bold leading-none mb-1\"\n style={{ background: `linear-gradient(90deg, ${BRAND_COLOR.blue}, ${BRAND_COLOR.purple}, ${BRAND_COLOR.rose})`, WebkitBackgroundClip: \"text\", WebkitTextFillColor: \"transparent\" }}\n >\n {t(\"Holder exclusive\")}\n </p>\n <p className=\"text-sm font-bold text-foreground leading-snug truncate\">{title}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">{t(\"Own a token from this collection to unlock\")}</p>\n </div>\n <Sparkles className=\"h-4 w-4 text-muted-foreground/50 group-hover:text-primary transition-colors shrink-0\" />\n </button>\n </div>\n );\n}\n\nfunction LockedNotice({ title, body, children }: { title: string; body: string; children?: React.ReactNode }) {\n return (\n <div className=\"py-16 flex flex-col items-center gap-5 text-center max-w-sm mx-auto\">\n <div className=\"h-16 w-16 rounded-2xl bg-muted flex items-center justify-center\">\n <Lock className=\"h-8 w-8 text-muted-foreground/50\" />\n </div>\n <div>\n <p className=\"text-base font-semibold\">{title}</p>\n <p className=\"text-sm text-muted-foreground mt-1\">{body}</p>\n </div>\n {children}\n </div>\n );\n}\n\nconst PRIMARY = \"inline-flex items-center gap-2 bg-foreground text-background hover:opacity-90 font-semibold px-5 py-2.5 rounded-xl transition-all text-sm\";\n\nexport function GatedContentPanel({ state, onBrowseListings }: { state: GatedContentState; onBrowseListings: () => void }) {\n const t = useT();\n const { connectLabel = \"Sign in\", onRequireWallet } = useMedialaneApp();\n\n if (state.status === \"signed_out\") {\n return (\n <LockedNotice title={`${connectLabel} to unlock`} body={t(\"This collection has exclusive content for holders. Sign in so we can check your holdings.\")}>\n <button type=\"button\" onClick={onRequireWallet} className={PRIMARY}>{connectLabel}</button>\n </LockedNotice>\n );\n }\n if (state.status === \"loading\") {\n return (\n <div className=\"py-16 flex flex-col items-center gap-3\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground/40\" />\n <p className=\"text-xs text-muted-foreground\">{t(\"Checking your holdings…\")}</p>\n </div>\n );\n }\n if (state.status === \"not_holder\") {\n return (\n <LockedNotice title={t(\"Holders only\")} body={t(\"Hold at least one token from this collection to open the exclusive content.\")}>\n <button type=\"button\" onClick={onBrowseListings} className={PRIMARY}>\n <ShoppingBag className=\"h-4 w-4\" />\n {t(\"Browse listings\")}\n </button>\n </LockedNotice>\n );\n }\n if (state.status === \"error\") {\n return <LockedNotice title={t(\"Couldn't check your holdings\")} body={t(\"Refresh the page to try again.\")} />;\n }\n\n const { icon: Icon, cta } = typeOf(state.content);\n return (\n <div className=\"py-8 flex flex-col items-center gap-6 text-center max-w-md mx-auto\">\n <div className=\"relative\">\n <div className=\"h-20 w-20 rounded-2xl bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-500\">\n <Unlock className=\"h-10 w-10\" />\n </div>\n <div className=\"absolute -bottom-1 -right-1 h-6 w-6 rounded-full bg-emerald-500 flex items-center justify-center\">\n <Sparkles className=\"h-3 w-3 text-white\" />\n </div>\n </div>\n <div className=\"space-y-1.5\">\n <p className=\"text-2xs font-bold text-emerald-500\">{t(\"✓ Verified holder\")}</p>\n <h3 className=\"text-xl font-bold\">{state.content.title ?? t(\"Exclusive content\")}</h3>\n <p className=\"text-sm text-muted-foreground\">{t(\"Your access is verified. Enjoy your exclusive content.\")}</p>\n </div>\n <a\n href={state.content.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-2.5 bg-emerald-500 hover:bg-emerald-600 active:scale-[0.98] text-white font-semibold px-6 py-3 rounded-xl transition-all text-sm shadow-lg shadow-emerald-500/20\"\n >\n <Icon className=\"h-5 w-5\" />\n {cta}\n </a>\n </div>\n );\n}\n"],"mappings":";AA6CU,cAEF,YAFE;AA3CV,SAAS,SAAS,MAAM,aAAa,UAAU,cAAc;AAE7D,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB,mCAAmC;AACjE,SAAS,uBAAuB;AAChC,SAAS,YAAY;AAerB,MAAM,SAAS,CAAC,YAA2B,QAAQ,OAAO,oBAAoB,QAAQ,IAAI,KAAK,8BAA8B;AAEtH,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,IAAI,KAAK;AACf,MAAI,CAAC,SAAS,gBAAiB,QAAO;AACtC,QAAM,QAAQ,QAAQ,qBAAqB;AAE3C,MAAI,MAAM,WAAW,YAAY;AAC/B,UAAM,EAAE,MAAM,KAAK,IAAI,OAAO,MAAM,OAAO;AAC3C,WACE;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAU;AAAA,QAEV;AAAA,8BAAC,SAAI,WAAU,kIACb,8BAAC,QAAK,WAAU,WAAU,GAC5B;AAAA,UACA,qBAAC,SAAI,WAAU,kBACb;AAAA,gCAAC,OAAE,WAAU,oDAAoD,YAAE,wCAA8B,GAAE;AAAA,YACnG,oBAAC,OAAE,WAAU,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AA,QACC,MAAM,MAAM,QAAQ;AAAA,QACpB,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,WAAU;AAAA,QAEV;AAAA,8BAAC,QAAK,WAAU,WAAU;AAAA,UACzB;AAAA;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/gated-content.tsx"],"sourcesContent":["\"use client\";\n\nimport { Loader2, Lock, ShoppingBag, Sparkles, Unlock } from \"lucide-react\";\nimport type { ApiCollectionProfile } from \"@medialane/sdk\";\nimport { BRAND_COLOR } from \"../data/brand.js\";\nimport { GATED_CONTENT_TYPES, GATED_CONTENT_TYPE_FALLBACK } from \"../data/gated-content-types.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface GatedContent {\n title: string | null;\n url: string;\n type: string | null;\n}\n\nexport type GatedContentState =\n | { status: \"signed_out\" }\n | { status: \"loading\" }\n | { status: \"not_holder\" }\n | { status: \"unlocked\"; content: GatedContent }\n | { status: \"error\" };\n\nconst typeOf = (content: GatedContent) => (content.type ? GATED_CONTENT_TYPES[content.type] ?? GATED_CONTENT_TYPE_FALLBACK : GATED_CONTENT_TYPE_FALLBACK);\n\nexport function GatedContentHero({\n profile,\n state,\n onViewExclusive,\n}: {\n profile: ApiCollectionProfile | null;\n state: GatedContentState;\n onViewExclusive: () => void;\n}) {\n const t = useT();\n if (!profile?.hasGatedContent) return null;\n const title = profile.gatedContentTitle ?? \"Exclusive content for holders\";\n\n if (state.status === \"unlocked\") {\n const { icon: Icon } = typeOf(state.content);\n return (\n <button\n onClick={onViewExclusive}\n className=\"w-full flex items-center gap-4 rounded-2xl border border-emerald-500/40 bg-emerald-500/10 hover:bg-emerald-500/15 px-5 py-4 transition-colors text-left\"\n >\n <div className=\"h-11 w-11 rounded-xl bg-emerald-500/20 border border-emerald-500/30 flex items-center justify-center shrink-0 text-emerald-500\">\n <Icon className=\"h-5 w-5\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-2xs font-bold text-emerald-500 leading-none\">{t(\"✓ You're a holder — unlocked\")}</p>\n <p className=\"text-sm font-bold text-foreground leading-snug mt-1 truncate\">{state.content.title ?? title}</p>\n </div>\n <Unlock className=\"h-4 w-4 text-emerald-500 shrink-0\" />\n </button>\n );\n }\n\n return (\n <div className=\"card-exclusive-wrapper btn-border-animated\">\n <button\n onClick={onViewExclusive}\n className=\"w-full flex items-center gap-4 rounded-[calc(var(--radius)*1.25)] bg-card hover:bg-muted/60 px-5 py-4 transition-colors text-left group\"\n >\n <div className=\"h-11 w-11 rounded-xl bg-muted flex items-center justify-center shrink-0\">\n <Lock className=\"h-5 w-5 text-muted-foreground\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p\n className=\"text-2xs font-bold leading-none mb-1\"\n style={{ background: `linear-gradient(90deg, ${BRAND_COLOR.blue}, ${BRAND_COLOR.purple}, ${BRAND_COLOR.rose})`, WebkitBackgroundClip: \"text\", WebkitTextFillColor: \"transparent\" }}\n >\n {t(\"Holder exclusive\")}\n </p>\n <p className=\"text-sm font-bold text-foreground leading-snug truncate\">{title}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">{t(\"Own a token from this collection to unlock\")}</p>\n </div>\n <Sparkles className=\"h-4 w-4 text-muted-foreground/50 group-hover:text-primary transition-colors shrink-0\" />\n </button>\n </div>\n );\n}\n\nfunction LockedNotice({ title, body, children }: { title: string; body: string; children?: React.ReactNode }) {\n return (\n <div className=\"py-16 flex flex-col items-center gap-5 text-center max-w-sm mx-auto\">\n <div className=\"h-16 w-16 rounded-2xl bg-muted flex items-center justify-center\">\n <Lock className=\"h-8 w-8 text-muted-foreground/50\" />\n </div>\n <div>\n <p className=\"text-base font-semibold\">{title}</p>\n <p className=\"text-sm text-muted-foreground mt-1\">{body}</p>\n </div>\n {children}\n </div>\n );\n}\n\nconst PRIMARY = \"inline-flex items-center gap-2 bg-foreground text-background hover:opacity-90 font-semibold px-5 py-2.5 rounded-xl transition-all text-sm\";\n\nexport function GatedContentPanel({ state, onBrowseListings }: { state: GatedContentState; onBrowseListings: () => void }) {\n const t = useT();\n const { connectLabel = \"Sign in\", onRequireWallet } = useMedialaneApp();\n\n if (state.status === \"signed_out\") {\n return (\n <LockedNotice title={t(\"{label} to unlock\", { label: t(connectLabel) })} body={t(\"This collection has exclusive content for holders. Sign in so we can check your holdings.\")}>\n <button type=\"button\" onClick={onRequireWallet} className={PRIMARY}>{t(connectLabel)}</button>\n </LockedNotice>\n );\n }\n if (state.status === \"loading\") {\n return (\n <div className=\"py-16 flex flex-col items-center gap-3\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground/40\" />\n <p className=\"text-xs text-muted-foreground\">{t(\"Checking your holdings…\")}</p>\n </div>\n );\n }\n if (state.status === \"not_holder\") {\n return (\n <LockedNotice title={t(\"Holders only\")} body={t(\"Hold at least one token from this collection to open the exclusive content.\")}>\n <button type=\"button\" onClick={onBrowseListings} className={PRIMARY}>\n <ShoppingBag className=\"h-4 w-4\" />\n {t(\"Browse listings\")}\n </button>\n </LockedNotice>\n );\n }\n if (state.status === \"error\") {\n return <LockedNotice title={t(\"Couldn't check your holdings\")} body={t(\"Refresh the page to try again.\")} />;\n }\n\n const { icon: Icon, cta } = typeOf(state.content);\n return (\n <div className=\"py-8 flex flex-col items-center gap-6 text-center max-w-md mx-auto\">\n <div className=\"relative\">\n <div className=\"h-20 w-20 rounded-2xl bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-500\">\n <Unlock className=\"h-10 w-10\" />\n </div>\n <div className=\"absolute -bottom-1 -right-1 h-6 w-6 rounded-full bg-emerald-500 flex items-center justify-center\">\n <Sparkles className=\"h-3 w-3 text-white\" />\n </div>\n </div>\n <div className=\"space-y-1.5\">\n <p className=\"text-2xs font-bold text-emerald-500\">{t(\"✓ Verified holder\")}</p>\n <h3 className=\"text-xl font-bold\">{state.content.title ?? t(\"Exclusive content\")}</h3>\n <p className=\"text-sm text-muted-foreground\">{t(\"Your access is verified. Enjoy your exclusive content.\")}</p>\n </div>\n <a\n href={state.content.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-2.5 bg-emerald-500 hover:bg-emerald-600 active:scale-[0.98] text-white font-semibold px-6 py-3 rounded-xl transition-all text-sm shadow-lg shadow-emerald-500/20\"\n >\n <Icon className=\"h-5 w-5\" />\n {cta}\n </a>\n </div>\n );\n}\n"],"mappings":";AA6CU,cAEF,YAFE;AA3CV,SAAS,SAAS,MAAM,aAAa,UAAU,cAAc;AAE7D,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB,mCAAmC;AACjE,SAAS,uBAAuB;AAChC,SAAS,YAAY;AAerB,MAAM,SAAS,CAAC,YAA2B,QAAQ,OAAO,oBAAoB,QAAQ,IAAI,KAAK,8BAA8B;AAEtH,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,IAAI,KAAK;AACf,MAAI,CAAC,SAAS,gBAAiB,QAAO;AACtC,QAAM,QAAQ,QAAQ,qBAAqB;AAE3C,MAAI,MAAM,WAAW,YAAY;AAC/B,UAAM,EAAE,MAAM,KAAK,IAAI,OAAO,MAAM,OAAO;AAC3C,WACE;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAU;AAAA,QAEV;AAAA,8BAAC,SAAI,WAAU,kIACb,8BAAC,QAAK,WAAU,WAAU,GAC5B;AAAA,UACA,qBAAC,SAAI,WAAU,kBACb;AAAA,gCAAC,OAAE,WAAU,oDAAoD,YAAE,wCAA8B,GAAE;AAAA,YACnG,oBAAC,OAAE,WAAU,gEAAgE,gBAAM,QAAQ,SAAS,OAAM;AAAA,aAC5G;AAAA,UACA,oBAAC,UAAO,WAAU,qCAAoC;AAAA;AAAA;AAAA,IACxD;AAAA,EAEJ;AAEA,SACE,oBAAC,SAAI,WAAU,8CACb;AAAA,IAAC;AAAA;AAAA,MACC,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A;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -29,6 +29,7 @@ module.exports = __toCommonJS(ip_type_badge_exports);
|
|
|
29
29
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
30
|
var import_lucide_react = require("lucide-react");
|
|
31
31
|
var import_cn = require("../utils/cn.js");
|
|
32
|
+
var import_provider = require("../i18n/provider.js");
|
|
32
33
|
var import_ip_types = require("../data/ip-types.js");
|
|
33
34
|
const IP_TYPE_CONFIG = import_ip_types.IP_TYPE_DATA.map((d) => {
|
|
34
35
|
const icons = {
|
|
@@ -56,6 +57,7 @@ const PILL = {
|
|
|
56
57
|
md: "h-8 gap-2 px-3"
|
|
57
58
|
};
|
|
58
59
|
function IpTypeBadge({ ipType, size = "sm", showLabel = false, className, baseUrl = "" }) {
|
|
60
|
+
const t = (0, import_provider.useT)();
|
|
59
61
|
const config = IP_TYPE_CONFIG.find(
|
|
60
62
|
(c) => c.label === ipType || c.apiValue === ipType
|
|
61
63
|
);
|
|
@@ -66,7 +68,7 @@ function IpTypeBadge({ ipType, size = "sm", showLabel = false, className, baseUr
|
|
|
66
68
|
"a",
|
|
67
69
|
{
|
|
68
70
|
href: `${baseUrl}/${slug}`,
|
|
69
|
-
title: label,
|
|
71
|
+
title: t(label),
|
|
70
72
|
className: (0, import_cn.cn)(
|
|
71
73
|
"inline-flex items-center justify-center rounded-full",
|
|
72
74
|
"transition-opacity hover:opacity-80",
|
|
@@ -77,7 +79,7 @@ function IpTypeBadge({ ipType, size = "sm", showLabel = false, className, baseUr
|
|
|
77
79
|
onClick: (e) => e.stopPropagation(),
|
|
78
80
|
children: [
|
|
79
81
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: (0, import_cn.cn)(colorClass, icon) }),
|
|
80
|
-
showLabel ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)("text-xs font-semibold", colorClass), children: label }) : null
|
|
82
|
+
showLabel ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)("text-xs font-semibold", colorClass), children: t(label) }) : null
|
|
81
83
|
]
|
|
82
84
|
}
|
|
83
85
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/ip-type-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem,\n FileText, BookOpen, File, Building, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"../data/ip-types.js\";\nimport type { IpTypeData } from \"../data/ip-types.js\";\n\nexport interface IpTypeConfig extends IpTypeData {\n icon: React.ElementType;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = IP_TYPE_DATA.map((d) => {\n const icons: Record<string, React.ElementType> = {\n audio: Music,\n video: Film,\n art: Palette,\n photography: Camera,\n nft: Gem,\n rwa: Building,\n posts: FileText,\n publications: BookOpen,\n documents: File,\n };\n return { ...d, icon: icons[d.slug] ?? Layers };\n});\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP };\nexport type { IpTypeData };\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nconst PILL = {\n sm: \"h-6 gap-1.5 px-2.5\",\n md: \"h-8 gap-2 px-3\",\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n showLabel?: boolean;\n className?: string;\n\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", showLabel = false, className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, bgClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={label}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"transition-opacity hover:opacity-80\",\n bgClass,\n showLabel ? PILL[size] : container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n {showLabel ? <span className={cn(\"text-xs font-semibold\", colorClass)}>{label}</span> : null}\n </a>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA
|
|
1
|
+
{"version":3,"sources":["../../src/components/ip-type-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem,\n FileText, BookOpen, File, Building, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"../data/ip-types.js\";\nimport type { IpTypeData } from \"../data/ip-types.js\";\n\nexport interface IpTypeConfig extends IpTypeData {\n icon: React.ElementType;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = IP_TYPE_DATA.map((d) => {\n const icons: Record<string, React.ElementType> = {\n audio: Music,\n video: Film,\n art: Palette,\n photography: Camera,\n nft: Gem,\n rwa: Building,\n posts: FileText,\n publications: BookOpen,\n documents: File,\n };\n return { ...d, icon: icons[d.slug] ?? Layers };\n});\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP };\nexport type { IpTypeData };\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nconst PILL = {\n sm: \"h-6 gap-1.5 px-2.5\",\n md: \"h-8 gap-2 px-3\",\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n showLabel?: boolean;\n className?: string;\n\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", showLabel = false, className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const t = useT();\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, bgClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={t(label)}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"transition-opacity hover:opacity-80\",\n bgClass,\n showLabel ? PILL[size] : container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n {showLabel ? <span className={cn(\"text-xs font-semibold\", colorClass)}>{t(label)}</span> : null}\n </a>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiEI;AA/DJ,0BAGO;AACP,gBAAmB;AACnB,sBAAqB;AACrB,sBAA+C;AAOxC,MAAM,iBAAiC,6BAAa,IAAI,CAAC,MAAM;AACpE,QAAM,QAA2C;AAAA,IAC/C,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,cAAc;AAAA,IACd,WAAW;AAAA,EACb;AACA,SAAO,EAAE,GAAG,GAAG,MAAM,MAAM,EAAE,IAAI,KAAK,2BAAO;AAC/C,CAAC;AAEM,MAAM,cAAc,OAAO;AAAA,EAChC,eAAe,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACvC;AAKA,MAAM,OAAO;AAAA,EACX,IAAI,EAAE,WAAW,WAAW,MAAM,UAAU;AAAA,EAC5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