@medialane/ui 0.353.0 → 0.355.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/accounts-page.cjs +40 -48
- package/dist/components/accounts-page.cjs.map +1 -1
- package/dist/components/accounts-page.js +40 -38
- package/dist/components/accounts-page.js.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/collection-showcase.cjs +192 -0
- package/dist/components/collection-showcase.cjs.map +1 -0
- package/dist/components/collection-showcase.d.cts +11 -0
- package/dist/components/collection-showcase.d.ts +11 -0
- package/dist/components/collection-showcase.js +158 -0
- package/dist/components/collection-showcase.js.map +1 -0
- package/dist/components/home-page.cjs +2 -2
- package/dist/components/home-page.cjs.map +1 -1
- package/dist/components/home-page.js +2 -2
- package/dist/components/home-page.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +4 -4
- package/dist/components/launchpad/edition-mint-schema.d.ts +4 -4
- package/dist/index.cjs +3 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/medialane.css +1 -6
- package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
- package/dist/utils/use-accounts.cjs +3 -3
- package/dist/utils/use-accounts.cjs.map +1 -1
- package/dist/utils/use-accounts.d.cts +1 -1
- package/dist/utils/use-accounts.d.ts +1 -1
- package/dist/utils/use-accounts.js +3 -3
- package/dist/utils/use-accounts.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/hero-slider.cjs +0 -103
- package/dist/components/hero-slider.cjs.map +0 -1
- package/dist/components/hero-slider.d.cts +0 -16
- package/dist/components/hero-slider.d.ts +0 -16
- package/dist/components/hero-slider.js +0 -68
- package/dist/components/hero-slider.js.map +0 -1
package/dist/medialane.css
CHANGED
|
@@ -210,10 +210,6 @@ h1 {
|
|
|
210
210
|
0% { transform: translateX(0); }
|
|
211
211
|
100% { transform: translateX(-50%); }
|
|
212
212
|
}
|
|
213
|
-
@keyframes kenburns {
|
|
214
|
-
0% { transform: scale(1.0); }
|
|
215
|
-
100% { transform: scale(1.03); }
|
|
216
|
-
}
|
|
217
213
|
@keyframes border-flow {
|
|
218
214
|
0%, 100% { background-position: 0% 50%; }
|
|
219
215
|
50% { background-position: 100% 50%; }
|
|
@@ -223,11 +219,10 @@ h1 {
|
|
|
223
219
|
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
|
|
224
220
|
.animate-spin-slow { animation: spin-slow 24s linear infinite; }
|
|
225
221
|
.animate-sparkle { animation: pulse-glow 2.5s ease-in-out infinite; }
|
|
226
|
-
.animate-kenburns { animation: kenburns 8s ease-in-out infinite alternate; transform-origin: center center; }
|
|
227
222
|
|
|
228
223
|
@media (prefers-reduced-motion: reduce) {
|
|
229
224
|
.animate-float, .animate-pulse-glow, .animate-spin-slow,
|
|
230
|
-
.animate-sparkle
|
|
225
|
+
.animate-sparkle { animation: none; }
|
|
231
226
|
}
|
|
232
227
|
|
|
233
228
|
input[type="number"]::-webkit-outer-spin-button,
|
|
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
|
|
|
7
7
|
rawBalance: bigint | null;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
error: any;
|
|
10
|
-
decimals:
|
|
10
|
+
decimals: 6 | 8 | 18;
|
|
11
11
|
};
|
|
12
12
|
declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
|
|
|
7
7
|
rawBalance: bigint | null;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
error: any;
|
|
10
|
-
decimals:
|
|
10
|
+
decimals: 6 | 8 | 18;
|
|
11
11
|
};
|
|
12
12
|
declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
|
|
13
13
|
|
|
@@ -36,11 +36,11 @@ var import_infinite = __toESM(require("swr/infinite"), 1);
|
|
|
36
36
|
var import_use_medialane_client = require("./use-medialane-client.js");
|
|
37
37
|
var import_query_keys = require("./query-keys.js");
|
|
38
38
|
const EMPTY_ACCOUNTS = [];
|
|
39
|
-
function useAccounts(search = "", limit = 24) {
|
|
39
|
+
function useAccounts(search = "", ipType = "", limit = 24) {
|
|
40
40
|
const client = (0, import_use_medialane_client.useMedialaneClient)();
|
|
41
41
|
const { data, error, isLoading, isValidating, setSize } = (0, import_infinite.default)(
|
|
42
|
-
(index) => [import_query_keys.QUERY_PREFIX.accountsPages, search, limit, index + 1],
|
|
43
|
-
([, query, pageSize, page]) => client.api.accounts.list({ search: query || void 0, page, limit: pageSize }),
|
|
42
|
+
(index) => [import_query_keys.QUERY_PREFIX.accountsPages, search, ipType, limit, index + 1],
|
|
43
|
+
([, query, type, pageSize, page]) => client.api.accounts.list({ search: query || void 0, ipType: type || void 0, page, limit: pageSize }),
|
|
44
44
|
{ revalidateOnFocus: false, revalidateFirstPage: false }
|
|
45
45
|
);
|
|
46
46
|
const accounts = data ? data.flatMap((page) => page.data) : EMPTY_ACCOUNTS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-accounts.ts"],"sourcesContent":["\"use client\";\n\nimport useSWRInfinite from \"swr/infinite\";\nimport type { ApiAccount } from \"@medialane/sdk\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\nimport { QUERY_PREFIX } from \"./query-keys.js\";\n\nconst EMPTY_ACCOUNTS: ApiAccount[] = [];\n\nexport function useAccounts(search = \"\", limit = 24) {\n const client = useMedialaneClient();\n\n const { data, error, isLoading, isValidating, setSize } = useSWRInfinite(\n (index) => [QUERY_PREFIX.accountsPages, search, limit, index + 1] as const,\n ([, query, pageSize, page])
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-accounts.ts"],"sourcesContent":["\"use client\";\n\nimport useSWRInfinite from \"swr/infinite\";\nimport type { ApiAccount } from \"@medialane/sdk\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\nimport { QUERY_PREFIX } from \"./query-keys.js\";\n\nconst EMPTY_ACCOUNTS: ApiAccount[] = [];\n\nexport function useAccounts(search = \"\", ipType = \"\", limit = 24) {\n const client = useMedialaneClient();\n\n const { data, error, isLoading, isValidating, setSize } = useSWRInfinite(\n (index) => [QUERY_PREFIX.accountsPages, search, ipType, limit, index + 1] as const,\n ([, query, type, pageSize, page]) =>\n client.api.accounts.list({ search: query || undefined, ipType: type || undefined, page, limit: pageSize }),\n { revalidateOnFocus: false, revalidateFirstPage: false },\n );\n\n const accounts = data ? data.flatMap((page) => page.data) : EMPTY_ACCOUNTS;\n const total = data?.[0]?.meta?.total ?? 0;\n\n return {\n accounts,\n total,\n isLoading,\n isLoadingMore: isValidating,\n hasMore: accounts.length < total,\n loadMore: () => void setSize((size) => size + 1),\n error,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sBAA2B;AAE3B,kCAAmC;AACnC,wBAA6B;AAE7B,MAAM,iBAA+B,CAAC;AAE/B,SAAS,YAAY,SAAS,IAAI,SAAS,IAAI,QAAQ,IAAI;AAChE,QAAM,aAAS,gDAAmB;AAElC,QAAM,EAAE,MAAM,OAAO,WAAW,cAAc,QAAQ,QAAI,gBAAAA;AAAA,IACxD,CAAC,UAAU,CAAC,+BAAa,eAAe,QAAQ,QAAQ,OAAO,QAAQ,CAAC;AAAA,IACxE,CAAC,CAAC,EAAE,OAAO,MAAM,UAAU,IAAI,MAC7B,OAAO,IAAI,SAAS,KAAK,EAAE,QAAQ,SAAS,QAAW,QAAQ,QAAQ,QAAW,MAAM,OAAO,SAAS,CAAC;AAAA,IAC3G,EAAE,mBAAmB,OAAO,qBAAqB,MAAM;AAAA,EACzD;AAEA,QAAM,WAAW,OAAO,KAAK,QAAQ,CAAC,SAAS,KAAK,IAAI,IAAI;AAC5D,QAAM,QAAQ,OAAO,CAAC,GAAG,MAAM,SAAS;AAExC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,SAAS,SAAS,SAAS;AAAA,IAC3B,UAAU,MAAM,KAAK,QAAQ,CAAC,SAAS,OAAO,CAAC;AAAA,IAC/C;AAAA,EACF;AACF;","names":["useSWRInfinite"]}
|
|
@@ -3,11 +3,11 @@ import useSWRInfinite from "swr/infinite";
|
|
|
3
3
|
import { useMedialaneClient } from "./use-medialane-client.js";
|
|
4
4
|
import { QUERY_PREFIX } from "./query-keys.js";
|
|
5
5
|
const EMPTY_ACCOUNTS = [];
|
|
6
|
-
function useAccounts(search = "", limit = 24) {
|
|
6
|
+
function useAccounts(search = "", ipType = "", limit = 24) {
|
|
7
7
|
const client = useMedialaneClient();
|
|
8
8
|
const { data, error, isLoading, isValidating, setSize } = useSWRInfinite(
|
|
9
|
-
(index) => [QUERY_PREFIX.accountsPages, search, limit, index + 1],
|
|
10
|
-
([, query, pageSize, page]) => client.api.accounts.list({ search: query || void 0, page, limit: pageSize }),
|
|
9
|
+
(index) => [QUERY_PREFIX.accountsPages, search, ipType, limit, index + 1],
|
|
10
|
+
([, query, type, pageSize, page]) => client.api.accounts.list({ search: query || void 0, ipType: type || void 0, page, limit: pageSize }),
|
|
11
11
|
{ revalidateOnFocus: false, revalidateFirstPage: false }
|
|
12
12
|
);
|
|
13
13
|
const accounts = data ? data.flatMap((page) => page.data) : EMPTY_ACCOUNTS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-accounts.ts"],"sourcesContent":["\"use client\";\n\nimport useSWRInfinite from \"swr/infinite\";\nimport type { ApiAccount } from \"@medialane/sdk\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\nimport { QUERY_PREFIX } from \"./query-keys.js\";\n\nconst EMPTY_ACCOUNTS: ApiAccount[] = [];\n\nexport function useAccounts(search = \"\", limit = 24) {\n const client = useMedialaneClient();\n\n const { data, error, isLoading, isValidating, setSize } = useSWRInfinite(\n (index) => [QUERY_PREFIX.accountsPages, search, limit, index + 1] as const,\n ([, query, pageSize, page])
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-accounts.ts"],"sourcesContent":["\"use client\";\n\nimport useSWRInfinite from \"swr/infinite\";\nimport type { ApiAccount } from \"@medialane/sdk\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\nimport { QUERY_PREFIX } from \"./query-keys.js\";\n\nconst EMPTY_ACCOUNTS: ApiAccount[] = [];\n\nexport function useAccounts(search = \"\", ipType = \"\", limit = 24) {\n const client = useMedialaneClient();\n\n const { data, error, isLoading, isValidating, setSize } = useSWRInfinite(\n (index) => [QUERY_PREFIX.accountsPages, search, ipType, limit, index + 1] as const,\n ([, query, type, pageSize, page]) =>\n client.api.accounts.list({ search: query || undefined, ipType: type || undefined, page, limit: pageSize }),\n { revalidateOnFocus: false, revalidateFirstPage: false },\n );\n\n const accounts = data ? data.flatMap((page) => page.data) : EMPTY_ACCOUNTS;\n const total = data?.[0]?.meta?.total ?? 0;\n\n return {\n accounts,\n total,\n isLoading,\n isLoadingMore: isValidating,\n hasMore: accounts.length < total,\n loadMore: () => void setSize((size) => size + 1),\n error,\n };\n}\n"],"mappings":";AAEA,OAAO,oBAAoB;AAE3B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAE7B,MAAM,iBAA+B,CAAC;AAE/B,SAAS,YAAY,SAAS,IAAI,SAAS,IAAI,QAAQ,IAAI;AAChE,QAAM,SAAS,mBAAmB;AAElC,QAAM,EAAE,MAAM,OAAO,WAAW,cAAc,QAAQ,IAAI;AAAA,IACxD,CAAC,UAAU,CAAC,aAAa,eAAe,QAAQ,QAAQ,OAAO,QAAQ,CAAC;AAAA,IACxE,CAAC,CAAC,EAAE,OAAO,MAAM,UAAU,IAAI,MAC7B,OAAO,IAAI,SAAS,KAAK,EAAE,QAAQ,SAAS,QAAW,QAAQ,QAAQ,QAAW,MAAM,OAAO,SAAS,CAAC;AAAA,IAC3G,EAAE,mBAAmB,OAAO,qBAAqB,MAAM;AAAA,EACzD;AAEA,QAAM,WAAW,OAAO,KAAK,QAAQ,CAAC,SAAS,KAAK,IAAI,IAAI;AAC5D,QAAM,QAAQ,OAAO,CAAC,GAAG,MAAM,SAAS;AAExC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,SAAS,SAAS,SAAS;AAAA,IAC3B,UAAU,MAAM,KAAK,QAAQ,CAAC,SAAS,OAAO,CAAC;AAAA,IAC/C;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medialane/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.355.0",
|
|
4
4
|
"description": "Shared UI components for Medialane apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"preview": "vite --config preview/vite.config.ts"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@medialane/sdk": ">=0.
|
|
54
|
+
"@medialane/sdk": ">=0.230.0 <1.0.0",
|
|
55
55
|
"@radix-ui/react-checkbox": ">=1.1.0",
|
|
56
56
|
"@radix-ui/react-collapsible": ">=1.1.0",
|
|
57
57
|
"@radix-ui/react-dialog": ">=1.1.0",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@happy-dom/global-registrator": "^20.14.5",
|
|
89
89
|
"@hookform/resolvers": "^3.10.0",
|
|
90
|
-
"@medialane/sdk": "0.
|
|
90
|
+
"@medialane/sdk": "0.230.0",
|
|
91
91
|
"@radix-ui/react-checkbox": "^1.3.8",
|
|
92
92
|
"@radix-ui/react-collapsible": "^1.1.17",
|
|
93
93
|
"@radix-ui/react-dialog": "^1.1.20",
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
var hero_slider_exports = {};
|
|
31
|
-
__export(hero_slider_exports, {
|
|
32
|
-
HeroSlider: () => HeroSlider,
|
|
33
|
-
HeroSliderSkeleton: () => HeroSliderSkeleton
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(hero_slider_exports);
|
|
36
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
-
var import_react = require("react");
|
|
38
|
-
var import_link = __toESM(require("./link.js"), 1);
|
|
39
|
-
var import_image = __toESM(require("./image.js"), 1);
|
|
40
|
-
var import_lucide_react = require("lucide-react");
|
|
41
|
-
var import_cn = require("../utils/cn.js");
|
|
42
|
-
var import_use_image_url = require("../utils/use-image-url.js");
|
|
43
|
-
function HeroPlaceholder({ hrefs }) {
|
|
44
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "absolute inset-0 bg-gradient-to-br from-brand-purple/30 via-brand-blue/20 to-brand-navy/50 flex flex-col items-center justify-center gap-4 text-center px-6 overflow-hidden", children: [
|
|
45
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-4xl sm:text-6xl font-black gradient-text relative z-10", children: "Medialane" }),
|
|
46
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground text-lg relative z-10 max-w-md", children: "New monetization revenues for creative works" }),
|
|
47
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-3 relative z-10", children: [
|
|
48
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: hrefs.markets, className: "inline-flex items-center justify-center rounded-[11px] bg-brand-blue px-4 py-2 text-sm font-semibold text-white hover:brightness-110 active:scale-[0.98] transition-all", children: "Markets" }),
|
|
49
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: hrefs.create, className: "inline-flex items-center justify-center rounded-[11px] border border-white/20 bg-background/20 backdrop-blur-sm px-4 py-2 text-sm font-semibold text-white hover:bg-white/10 transition-all", children: "Create" })
|
|
50
|
-
] })
|
|
51
|
-
] });
|
|
52
|
-
}
|
|
53
|
-
function HeroSlide({ collection, active, getHref }) {
|
|
54
|
-
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
55
|
-
const imageUrl = resolveImage(collection.image);
|
|
56
|
-
const name = collection.name ?? "Collection";
|
|
57
|
-
const supply = collection.totalSupply;
|
|
58
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("absolute inset-0 transition-opacity duration-700", active ? "opacity-100" : "opacity-0 pointer-events-none"), children: [
|
|
59
|
-
imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "animate-kenburns absolute inset-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: imageUrl, alt: name, fill: true, className: "object-cover", priority: active, unoptimized: true }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-gradient-to-br from-brand-purple/40 via-brand-blue/20 to-brand-navy/60" }),
|
|
60
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "absolute bottom-0 left-0 right-0 p-6 sm:p-10 flex flex-col gap-3", children: [
|
|
61
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: getHref(collection), className: "hover:opacity-90 transition-opacity", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-4xl lg:text-5xl font-semibold text-white leading-tight", children: name }) }),
|
|
62
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center gap-4 text-sm text-white/70", children: supply != null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
63
|
-
supply.toLocaleString(),
|
|
64
|
-
" ",
|
|
65
|
-
supply === 1 ? "item" : "items"
|
|
66
|
-
] }) })
|
|
67
|
-
] })
|
|
68
|
-
] });
|
|
69
|
-
}
|
|
70
|
-
function HeroSliderSkeleton() {
|
|
71
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "relative w-full h-[78vw] min-h-[420px] max-h-[768px] sm:h-[72vh] sm:max-h-[816px] bg-muted animate-pulse" });
|
|
72
|
-
}
|
|
73
|
-
function HeroSlider({ collections, isLoading, getHref, placeholderHrefs = {} }) {
|
|
74
|
-
const hrefs = { markets: "/marketplace", create: "/create/asset", ...placeholderHrefs };
|
|
75
|
-
const [current, setCurrent] = (0, import_react.useState)(0);
|
|
76
|
-
const count = collections.length;
|
|
77
|
-
const next = (0, import_react.useCallback)(() => {
|
|
78
|
-
if (count > 1) setCurrent((c) => (c + 1) % count);
|
|
79
|
-
}, [count]);
|
|
80
|
-
const prev = (0, import_react.useCallback)(() => {
|
|
81
|
-
if (count > 1) setCurrent((c) => (c - 1 + count) % count);
|
|
82
|
-
}, [count]);
|
|
83
|
-
(0, import_react.useEffect)(() => {
|
|
84
|
-
if (count <= 1) return;
|
|
85
|
-
const id = setInterval(next, 7e3);
|
|
86
|
-
return () => clearInterval(id);
|
|
87
|
-
}, [count, next]);
|
|
88
|
-
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeroSliderSkeleton, {});
|
|
89
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "relative w-full h-[78vw] min-h-[420px] max-h-[768px] sm:h-[72vh] sm:max-h-[816px] overflow-hidden bg-muted", children: count === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeroPlaceholder, { hrefs }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
90
|
-
collections.map((col, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeroSlide, { collection: col, active: i === current, getHref }, col.contractAddress)),
|
|
91
|
-
count > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
92
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: prev, "aria-label": "Previous slide", className: "absolute left-3 top-1/2 -translate-y-1/2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex h-9 w-9 items-center justify-center rounded-full bg-white/10 backdrop-blur-md hover:bg-white/20", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronLeft, { className: "h-5 w-5 text-white" }) }) }),
|
|
93
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: next, "aria-label": "Next slide", className: "absolute right-3 top-1/2 -translate-y-1/2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex h-9 w-9 items-center justify-center rounded-full bg-white/10 backdrop-blur-md hover:bg-white/20", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronRight, { className: "h-5 w-5 text-white" }) }) }),
|
|
94
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-1.5 z-10", children: collections.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: () => setCurrent(i), "aria-label": `Go to slide ${i + 1}`, className: (0, import_cn.cn)("h-1.5 rounded-full transition-all", i === current ? "w-6 bg-white" : "w-1.5 bg-white/40") }, i)) })
|
|
95
|
-
] })
|
|
96
|
-
] }) });
|
|
97
|
-
}
|
|
98
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
-
0 && (module.exports = {
|
|
100
|
-
HeroSlider,
|
|
101
|
-
HeroSliderSkeleton
|
|
102
|
-
});
|
|
103
|
-
//# sourceMappingURL=hero-slider.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/hero-slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useCallback } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nexport interface HeroSliderProps {\n collections: ApiCollection[];\n isLoading: boolean;\n getHref: (collection: ApiCollection) => string;\n\n placeholderHrefs?: { markets?: string; create?: string };\n}\n\nfunction HeroPlaceholder({ hrefs }: { hrefs: Required<HeroSliderProps>[\"placeholderHrefs\"] }) {\n return (\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/30 via-brand-blue/20 to-brand-navy/50 flex flex-col items-center justify-center gap-4 text-center px-6 overflow-hidden\">\n\n <h2 className=\"text-4xl sm:text-6xl font-black gradient-text relative z-10\">Medialane</h2>\n <p className=\"text-muted-foreground text-lg relative z-10 max-w-md\">\n New monetization revenues for creative works\n </p>\n <div className=\"flex gap-3 relative z-10\">\n <Link href={hrefs.markets!} className=\"inline-flex items-center justify-center rounded-[11px] bg-brand-blue px-4 py-2 text-sm font-semibold text-white hover:brightness-110 active:scale-[0.98] transition-all\">\n Markets\n </Link>\n <Link href={hrefs.create!} className=\"inline-flex items-center justify-center rounded-[11px] border border-white/20 bg-background/20 backdrop-blur-sm px-4 py-2 text-sm font-semibold text-white hover:bg-white/10 transition-all\">\n Create\n </Link>\n </div>\n </div>\n );\n}\n\nfunction HeroSlide({ collection, active, getHref }: { collection: ApiCollection; active: boolean; getHref: (col: ApiCollection) => string }) {\n const resolveImage = useImageUrl();\n const imageUrl = resolveImage(collection.image);\n const name = collection.name ?? \"Collection\";\n const supply = collection.totalSupply;\n\n return (\n <div className={cn(\"absolute inset-0 transition-opacity duration-700\", active ? \"opacity-100\" : \"opacity-0 pointer-events-none\")}>\n {imageUrl ? (\n <div className=\"absolute inset-0 overflow-hidden\">\n <div className=\"animate-kenburns absolute inset-0\">\n <Image src={imageUrl} alt={name} fill className=\"object-cover\" priority={active} unoptimized />\n </div>\n </div>\n ) : (\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/40 via-brand-blue/20 to-brand-navy/60\" />\n )}\n <div className=\"absolute bottom-0 left-0 right-0 p-6 sm:p-10 flex flex-col gap-3\">\n <Link href={getHref(collection)} className=\"hover:opacity-90 transition-opacity\">\n <h2 className=\"text-4xl lg:text-5xl font-semibold text-white leading-tight\">{name}</h2>\n </Link>\n <div className=\"flex items-center gap-4 text-sm text-white/70\">\n {supply != null && <span>{supply.toLocaleString()} {supply === 1 ? \"item\" : \"items\"}</span>}\n </div>\n </div>\n </div>\n );\n}\n\nexport function HeroSliderSkeleton() {\n return <section className=\"relative w-full h-[78vw] min-h-[420px] max-h-[768px] sm:h-[72vh] sm:max-h-[816px] bg-muted animate-pulse\" />;\n}\n\nexport function HeroSlider({ collections, isLoading, getHref, placeholderHrefs = {} }: HeroSliderProps) {\n const hrefs = { markets: \"/marketplace\", create: \"/create/asset\", ...placeholderHrefs };\n const [current, setCurrent] = useState(0);\n const count = collections.length;\n\n const next = useCallback(() => { if (count > 1) setCurrent((c) => (c + 1) % count); }, [count]);\n const prev = useCallback(() => { if (count > 1) setCurrent((c) => (c - 1 + count) % count); }, [count]);\n\n useEffect(() => {\n if (count <= 1) return;\n const id = setInterval(next, 7000);\n return () => clearInterval(id);\n }, [count, next]);\n\n if (isLoading) return <HeroSliderSkeleton />;\n\n return (\n <section className=\"relative w-full h-[78vw] min-h-[420px] max-h-[768px] sm:h-[72vh] sm:max-h-[816px] overflow-hidden bg-muted\">\n {count === 0 ? (\n <HeroPlaceholder hrefs={hrefs} />\n ) : (\n <>\n {collections.map((col, i) => (\n <HeroSlide key={col.contractAddress} collection={col} active={i === current} getHref={getHref} />\n ))}\n {count > 1 && (\n <>\n <button onClick={prev} aria-label=\"Previous slide\" className=\"absolute left-3 top-1/2 -translate-y-1/2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center transition-colors\">\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-white/10 backdrop-blur-md hover:bg-white/20\">\n <ChevronLeft className=\"h-5 w-5 text-white\" />\n </span>\n </button>\n <button onClick={next} aria-label=\"Next slide\" className=\"absolute right-3 top-1/2 -translate-y-1/2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center transition-colors\">\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-white/10 backdrop-blur-md hover:bg-white/20\">\n <ChevronRight className=\"h-5 w-5 text-white\" />\n </span>\n </button>\n <div className=\"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-1.5 z-10\">\n {collections.map((_, i) => (\n <button key={i} onClick={() => setCurrent(i)} aria-label={`Go to slide ${i + 1}`} className={cn(\"h-1.5 rounded-full transition-all\", i === current ? \"w-6 bg-white\" : \"w-1.5 bg-white/40\")} />\n ))}\n </div>\n </>\n )}\n </>\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBM;AApBN,mBAAiD;AACjD,kBAAiB;AACjB,mBAAkB;AAClB,0BAA0C;AAC1C,gBAAmB;AAEnB,2BAA4B;AAU5B,SAAS,gBAAgB,EAAE,MAAM,GAA6D;AAC5F,SACE,6CAAC,SAAI,WAAU,+KAEb;AAAA,gDAAC,QAAG,WAAU,+DAA8D,uBAAS;AAAA,IACrF,4CAAC,OAAE,WAAU,wDAAuD,0DAEpE;AAAA,IACA,6CAAC,SAAI,WAAU,4BACb;AAAA,kDAAC,YAAAA,SAAA,EAAK,MAAM,MAAM,SAAU,WAAU,2KAA0K,qBAEhN;AAAA,MACA,4CAAC,YAAAA,SAAA,EAAK,MAAM,MAAM,QAAS,WAAU,+LAA8L,oBAEnO;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,SAAS,UAAU,EAAE,YAAY,QAAQ,QAAQ,GAA4F;AAC3I,QAAM,mBAAe,kCAAY;AACjC,QAAM,WAAW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AEtG,8BAAU,MAAM;AACd,QAAI,SAAS,EAAG;AAChB,UAAM,KAAK,YAAY,MAAM,GAAI;AACjC,WAAO,MAAM,cAAc,EAAE;AAAA,EAC/B,GAAG,CAAC,OAAO,IAAI,CAAC;AAEhB,MAAI,UAAW,QAAO,4CAAC,sBAAmB;AAE1C,SACE,4CAAC,aAAQ,WAAU,8GAChB,oBAAU,IACT,4CAAC,mBAAgB,OAAc,IAE/B,4EACG;AAAA,gBAAY,IAAI,CAAC,KAAK,MACrB,4CAAC,aAAoC,YAAY,KAAK,QAAQ,MAAM,SAAS,WAA7D,IAAI,eAA2E,CAChG;AAAA,IACA,QAAQ,KACP,4EACE;AAAA,kDAAC,YAAO,SAAS,MAAM,cAAW,kBAAiB,WAAU,mIAC3D,sDAAC,UAAK,WAAU,wGACd,sDAAC,mCAAY,WAAU,sBAAqB,GAC9C,GACF;AAAA,MACA,4CAAC,YAAO,SAAS,MAAM,cAAW,cAAa,WAAU,oIACvD,sDAAC,UAAK,WAAU,wGACd,sDAAC,oCAAa,WAAU,sBAAqB,GAC/C,GACF;AAAA,MACA,4CAAC,SAAI,WAAU,iEACZ,sBAAY,IAAI,CAAC,GAAG,MACnB,4CAAC,YAAe,SAAS,MAAM,WAAW,CAAC,GAAG,cAAY,eAAe,IAAI,CAAC,IAAI,eAAW,cAAG,qCAAqC,MAAM,UAAU,iBAAiB,mBAAmB,KAA5K,CAA+K,CAC7L,GACH;AAAA,OACF;AAAA,KAEJ,GAEJ;AAEJ;","names":["Link","Image"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ApiCollection } from '@medialane/sdk';
|
|
3
|
-
|
|
4
|
-
interface HeroSliderProps {
|
|
5
|
-
collections: ApiCollection[];
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
getHref: (collection: ApiCollection) => string;
|
|
8
|
-
placeholderHrefs?: {
|
|
9
|
-
markets?: string;
|
|
10
|
-
create?: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
declare function HeroSliderSkeleton(): react_jsx_runtime.JSX.Element;
|
|
14
|
-
declare function HeroSlider({ collections, isLoading, getHref, placeholderHrefs }: HeroSliderProps): react_jsx_runtime.JSX.Element;
|
|
15
|
-
|
|
16
|
-
export { HeroSlider, type HeroSliderProps, HeroSliderSkeleton };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ApiCollection } from '@medialane/sdk';
|
|
3
|
-
|
|
4
|
-
interface HeroSliderProps {
|
|
5
|
-
collections: ApiCollection[];
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
getHref: (collection: ApiCollection) => string;
|
|
8
|
-
placeholderHrefs?: {
|
|
9
|
-
markets?: string;
|
|
10
|
-
create?: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
declare function HeroSliderSkeleton(): react_jsx_runtime.JSX.Element;
|
|
14
|
-
declare function HeroSlider({ collections, isLoading, getHref, placeholderHrefs }: HeroSliderProps): react_jsx_runtime.JSX.Element;
|
|
15
|
-
|
|
16
|
-
export { HeroSlider, type HeroSliderProps, HeroSliderSkeleton };
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useEffect, useCallback } from "react";
|
|
4
|
-
import Link from "./link.js";
|
|
5
|
-
import Image from "./image.js";
|
|
6
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
7
|
-
import { cn } from "../utils/cn.js";
|
|
8
|
-
import { useImageUrl } from "../utils/use-image-url.js";
|
|
9
|
-
function HeroPlaceholder({ hrefs }) {
|
|
10
|
-
return /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 bg-gradient-to-br from-brand-purple/30 via-brand-blue/20 to-brand-navy/50 flex flex-col items-center justify-center gap-4 text-center px-6 overflow-hidden", children: [
|
|
11
|
-
/* @__PURE__ */ jsx("h2", { className: "text-4xl sm:text-6xl font-black gradient-text relative z-10", children: "Medialane" }),
|
|
12
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-lg relative z-10 max-w-md", children: "New monetization revenues for creative works" }),
|
|
13
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-3 relative z-10", children: [
|
|
14
|
-
/* @__PURE__ */ jsx(Link, { href: hrefs.markets, className: "inline-flex items-center justify-center rounded-[11px] bg-brand-blue px-4 py-2 text-sm font-semibold text-white hover:brightness-110 active:scale-[0.98] transition-all", children: "Markets" }),
|
|
15
|
-
/* @__PURE__ */ jsx(Link, { href: hrefs.create, className: "inline-flex items-center justify-center rounded-[11px] border border-white/20 bg-background/20 backdrop-blur-sm px-4 py-2 text-sm font-semibold text-white hover:bg-white/10 transition-all", children: "Create" })
|
|
16
|
-
] })
|
|
17
|
-
] });
|
|
18
|
-
}
|
|
19
|
-
function HeroSlide({ collection, active, getHref }) {
|
|
20
|
-
const resolveImage = useImageUrl();
|
|
21
|
-
const imageUrl = resolveImage(collection.image);
|
|
22
|
-
const name = collection.name ?? "Collection";
|
|
23
|
-
const supply = collection.totalSupply;
|
|
24
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("absolute inset-0 transition-opacity duration-700", active ? "opacity-100" : "opacity-0 pointer-events-none"), children: [
|
|
25
|
-
imageUrl ? /* @__PURE__ */ jsx("div", { className: "absolute inset-0 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "animate-kenburns absolute inset-0", children: /* @__PURE__ */ jsx(Image, { src: imageUrl, alt: name, fill: true, className: "object-cover", priority: active, unoptimized: true }) }) }) : /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-br from-brand-purple/40 via-brand-blue/20 to-brand-navy/60" }),
|
|
26
|
-
/* @__PURE__ */ jsxs("div", { className: "absolute bottom-0 left-0 right-0 p-6 sm:p-10 flex flex-col gap-3", children: [
|
|
27
|
-
/* @__PURE__ */ jsx(Link, { href: getHref(collection), className: "hover:opacity-90 transition-opacity", children: /* @__PURE__ */ jsx("h2", { className: "text-4xl lg:text-5xl font-semibold text-white leading-tight", children: name }) }),
|
|
28
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-4 text-sm text-white/70", children: supply != null && /* @__PURE__ */ jsxs("span", { children: [
|
|
29
|
-
supply.toLocaleString(),
|
|
30
|
-
" ",
|
|
31
|
-
supply === 1 ? "item" : "items"
|
|
32
|
-
] }) })
|
|
33
|
-
] })
|
|
34
|
-
] });
|
|
35
|
-
}
|
|
36
|
-
function HeroSliderSkeleton() {
|
|
37
|
-
return /* @__PURE__ */ jsx("section", { className: "relative w-full h-[78vw] min-h-[420px] max-h-[768px] sm:h-[72vh] sm:max-h-[816px] bg-muted animate-pulse" });
|
|
38
|
-
}
|
|
39
|
-
function HeroSlider({ collections, isLoading, getHref, placeholderHrefs = {} }) {
|
|
40
|
-
const hrefs = { markets: "/marketplace", create: "/create/asset", ...placeholderHrefs };
|
|
41
|
-
const [current, setCurrent] = useState(0);
|
|
42
|
-
const count = collections.length;
|
|
43
|
-
const next = useCallback(() => {
|
|
44
|
-
if (count > 1) setCurrent((c) => (c + 1) % count);
|
|
45
|
-
}, [count]);
|
|
46
|
-
const prev = useCallback(() => {
|
|
47
|
-
if (count > 1) setCurrent((c) => (c - 1 + count) % count);
|
|
48
|
-
}, [count]);
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if (count <= 1) return;
|
|
51
|
-
const id = setInterval(next, 7e3);
|
|
52
|
-
return () => clearInterval(id);
|
|
53
|
-
}, [count, next]);
|
|
54
|
-
if (isLoading) return /* @__PURE__ */ jsx(HeroSliderSkeleton, {});
|
|
55
|
-
return /* @__PURE__ */ jsx("section", { className: "relative w-full h-[78vw] min-h-[420px] max-h-[768px] sm:h-[72vh] sm:max-h-[816px] overflow-hidden bg-muted", children: count === 0 ? /* @__PURE__ */ jsx(HeroPlaceholder, { hrefs }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
-
collections.map((col, i) => /* @__PURE__ */ jsx(HeroSlide, { collection: col, active: i === current, getHref }, col.contractAddress)),
|
|
57
|
-
count > 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
-
/* @__PURE__ */ jsx("button", { onClick: prev, "aria-label": "Previous slide", className: "absolute left-3 top-1/2 -translate-y-1/2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center transition-colors", children: /* @__PURE__ */ jsx("span", { className: "flex h-9 w-9 items-center justify-center rounded-full bg-white/10 backdrop-blur-md hover:bg-white/20", children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-5 w-5 text-white" }) }) }),
|
|
59
|
-
/* @__PURE__ */ jsx("button", { onClick: next, "aria-label": "Next slide", className: "absolute right-3 top-1/2 -translate-y-1/2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center transition-colors", children: /* @__PURE__ */ jsx("span", { className: "flex h-9 w-9 items-center justify-center rounded-full bg-white/10 backdrop-blur-md hover:bg-white/20", children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-5 w-5 text-white" }) }) }),
|
|
60
|
-
/* @__PURE__ */ jsx("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-1.5 z-10", children: collections.map((_, i) => /* @__PURE__ */ jsx("button", { onClick: () => setCurrent(i), "aria-label": `Go to slide ${i + 1}`, className: cn("h-1.5 rounded-full transition-all", i === current ? "w-6 bg-white" : "w-1.5 bg-white/40") }, i)) })
|
|
61
|
-
] })
|
|
62
|
-
] }) });
|
|
63
|
-
}
|
|
64
|
-
export {
|
|
65
|
-
HeroSlider,
|
|
66
|
-
HeroSliderSkeleton
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=hero-slider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/hero-slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useCallback } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nexport interface HeroSliderProps {\n collections: ApiCollection[];\n isLoading: boolean;\n getHref: (collection: ApiCollection) => string;\n\n placeholderHrefs?: { markets?: string; create?: string };\n}\n\nfunction HeroPlaceholder({ hrefs }: { hrefs: Required<HeroSliderProps>[\"placeholderHrefs\"] }) {\n return (\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/30 via-brand-blue/20 to-brand-navy/50 flex flex-col items-center justify-center gap-4 text-center px-6 overflow-hidden\">\n\n <h2 className=\"text-4xl sm:text-6xl font-black gradient-text relative z-10\">Medialane</h2>\n <p className=\"text-muted-foreground text-lg relative z-10 max-w-md\">\n New monetization revenues for creative works\n </p>\n <div className=\"flex gap-3 relative z-10\">\n <Link href={hrefs.markets!} className=\"inline-flex items-center justify-center rounded-[11px] bg-brand-blue px-4 py-2 text-sm font-semibold text-white hover:brightness-110 active:scale-[0.98] transition-all\">\n Markets\n </Link>\n <Link href={hrefs.create!} className=\"inline-flex items-center justify-center rounded-[11px] border border-white/20 bg-background/20 backdrop-blur-sm px-4 py-2 text-sm font-semibold text-white hover:bg-white/10 transition-all\">\n Create\n </Link>\n </div>\n </div>\n );\n}\n\nfunction HeroSlide({ collection, active, getHref }: { collection: ApiCollection; active: boolean; getHref: (col: ApiCollection) => string }) {\n const resolveImage = useImageUrl();\n const imageUrl = resolveImage(collection.image);\n const name = collection.name ?? \"Collection\";\n const supply = collection.totalSupply;\n\n return (\n <div className={cn(\"absolute inset-0 transition-opacity duration-700\", active ? \"opacity-100\" : \"opacity-0 pointer-events-none\")}>\n {imageUrl ? (\n <div className=\"absolute inset-0 overflow-hidden\">\n <div className=\"animate-kenburns absolute inset-0\">\n <Image src={imageUrl} alt={name} fill className=\"object-cover\" priority={active} unoptimized />\n </div>\n </div>\n ) : (\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/40 via-brand-blue/20 to-brand-navy/60\" />\n )}\n <div className=\"absolute bottom-0 left-0 right-0 p-6 sm:p-10 flex flex-col gap-3\">\n <Link href={getHref(collection)} className=\"hover:opacity-90 transition-opacity\">\n <h2 className=\"text-4xl lg:text-5xl font-semibold text-white leading-tight\">{name}</h2>\n </Link>\n <div className=\"flex items-center gap-4 text-sm text-white/70\">\n {supply != null && <span>{supply.toLocaleString()} {supply === 1 ? \"item\" : \"items\"}</span>}\n </div>\n </div>\n </div>\n );\n}\n\nexport function HeroSliderSkeleton() {\n return <section className=\"relative w-full h-[78vw] min-h-[420px] max-h-[768px] sm:h-[72vh] sm:max-h-[816px] bg-muted animate-pulse\" />;\n}\n\nexport function HeroSlider({ collections, isLoading, getHref, placeholderHrefs = {} }: HeroSliderProps) {\n const hrefs = { markets: \"/marketplace\", create: \"/create/asset\", ...placeholderHrefs };\n const [current, setCurrent] = useState(0);\n const count = collections.length;\n\n const next = useCallback(() => { if (count > 1) setCurrent((c) => (c + 1) % count); }, [count]);\n const prev = useCallback(() => { if (count > 1) setCurrent((c) => (c - 1 + count) % count); }, [count]);\n\n useEffect(() => {\n if (count <= 1) return;\n const id = setInterval(next, 7000);\n return () => clearInterval(id);\n }, [count, next]);\n\n if (isLoading) return <HeroSliderSkeleton />;\n\n return (\n <section className=\"relative w-full h-[78vw] min-h-[420px] max-h-[768px] sm:h-[72vh] sm:max-h-[816px] overflow-hidden bg-muted\">\n {count === 0 ? (\n <HeroPlaceholder hrefs={hrefs} />\n ) : (\n <>\n {collections.map((col, i) => (\n <HeroSlide key={col.contractAddress} collection={col} active={i === current} getHref={getHref} />\n ))}\n {count > 1 && (\n <>\n <button onClick={prev} aria-label=\"Previous slide\" className=\"absolute left-3 top-1/2 -translate-y-1/2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center transition-colors\">\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-white/10 backdrop-blur-md hover:bg-white/20\">\n <ChevronLeft className=\"h-5 w-5 text-white\" />\n </span>\n </button>\n <button onClick={next} aria-label=\"Next slide\" className=\"absolute right-3 top-1/2 -translate-y-1/2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center transition-colors\">\n <span className=\"flex h-9 w-9 items-center justify-center rounded-full bg-white/10 backdrop-blur-md hover:bg-white/20\">\n <ChevronRight className=\"h-5 w-5 text-white\" />\n </span>\n </button>\n <div className=\"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-1.5 z-10\">\n {collections.map((_, i) => (\n <button key={i} onClick={() => setCurrent(i)} aria-label={`Go to slide ${i + 1}`} className={cn(\"h-1.5 rounded-full transition-all\", i === current ? \"w-6 bg-white\" : \"w-1.5 bg-white/40\")} />\n ))}\n </div>\n </>\n )}\n </>\n )}\n </section>\n );\n}\n"],"mappings":";AAsBM,SA2EM,UA3EN,KAIA,YAJA;AApBN,SAAS,UAAU,WAAW,mBAAmB;AACjD,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,aAAa,oBAAoB;AAC1C,SAAS,UAAU;AAEnB,SAAS,mBAAmB;AAU5B,SAAS,gBAAgB,EAAE,MAAM,GAA6D;AAC5F,SACE,qBAAC,SAAI,WAAU,+KAEb;AAAA,wBAAC,QAAG,WAAU,+DAA8D,uBAAS;AAAA,IACrF,oBAAC,OAAE,WAAU,wDAAuD,0DAEpE;AAAA,IACA,qBAAC,SAAI,WAAU,4BACb;AAAA,0BAAC,QAAK,MAAM,MAAM,SAAU,WAAU,2KAA0K,qBAEhN;AAAA,MACA,oBAAC,QAAK,MAAM,MAAM,QAAS,WAAU,+LAA8L,oBAEnO;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,SAAS,UAAU,EAAE,YAAY,QAAQ,QAAQ,GAA4F;AAC3I,QAAM,eAAe,YAAY;AACjC,QAAM,WAAW,aAAa,WAAW,KAAK;AAC9C,QAAM,OAAO,WAAW,QAAQ;AAChC,QAAM,SAAS,WA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