@medialane/ui 0.354.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/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/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- 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/package.json +1 -1
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as input_otp from 'input-otp';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "maxLength" | "value" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (newValue: string) => unknown;
|
|
7
7
|
maxLength: number;
|
|
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
14
14
|
} & {
|
|
15
15
|
render: (props: input_otp.RenderProps) => React.ReactNode;
|
|
16
16
|
children?: never;
|
|
17
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "maxLength" | "value" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as input_otp from 'input-otp';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "maxLength" | "value" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (newValue: string) => unknown;
|
|
7
7
|
maxLength: number;
|
|
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
14
14
|
} & {
|
|
15
15
|
render: (props: input_otp.RenderProps) => React.ReactNode;
|
|
16
16
|
children?: never;
|
|
17
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "maxLength" | "value" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
7
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
7
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -0,0 +1,192 @@
|
|
|
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 collection_showcase_exports = {};
|
|
31
|
+
__export(collection_showcase_exports, {
|
|
32
|
+
CollectionShowcase: () => CollectionShowcase
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(collection_showcase_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_framer_motion = require("framer-motion");
|
|
38
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
39
|
+
var import_image = __toESM(require("./image.js"), 1);
|
|
40
|
+
var import_skeleton = require("./skeleton.js");
|
|
41
|
+
var import_cn = require("../utils/cn.js");
|
|
42
|
+
var import_use_image_url = require("../utils/use-image-url.js");
|
|
43
|
+
const AUTOPLAY_MS = 6e3;
|
|
44
|
+
const SWIPE_PX = 50;
|
|
45
|
+
const CARD_SIZE = "aspect-[4/5] w-[58vw] max-w-[260px] sm:max-w-[300px] lg:max-w-[340px]";
|
|
46
|
+
function offsetFrom(index, current, count) {
|
|
47
|
+
const distance = (index - current + count) % count;
|
|
48
|
+
return distance > count / 2 ? distance - count : distance;
|
|
49
|
+
}
|
|
50
|
+
function ShowcaseSkeleton() {
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "px-4 pb-8 pt-10 sm:pt-14", children: [
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: (0, import_cn.cn)("mx-auto rounded-2xl", CARD_SIZE) }),
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "mx-auto mt-6 h-9 w-56" })
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
function CollectionShowcase({ collections, isLoading, getHref }) {
|
|
57
|
+
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
58
|
+
const reduceMotion = (0, import_framer_motion.useReducedMotion)();
|
|
59
|
+
const [current, setCurrent] = (0, import_react.useState)(0);
|
|
60
|
+
const [paused, setPaused] = (0, import_react.useState)(false);
|
|
61
|
+
const dragged = (0, import_react.useRef)(false);
|
|
62
|
+
const count = collections.length;
|
|
63
|
+
const go = (step) => setCurrent((index) => (index + step + count) % count);
|
|
64
|
+
(0, import_react.useEffect)(() => {
|
|
65
|
+
if (count <= 1 || paused || reduceMotion) return;
|
|
66
|
+
const id = setInterval(() => setCurrent((index) => (index + 1) % count), AUTOPLAY_MS);
|
|
67
|
+
return () => clearInterval(id);
|
|
68
|
+
}, [count, paused, reduceMotion]);
|
|
69
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShowcaseSkeleton, {});
|
|
70
|
+
if (count === 0) return null;
|
|
71
|
+
const active = collections[current % count];
|
|
72
|
+
const activeImage = resolveImage(active.image, { width: 960 });
|
|
73
|
+
const supply = active.totalSupply;
|
|
74
|
+
const transition = reduceMotion ? { duration: 0 } : { type: "spring", stiffness: 220, damping: 26 };
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
76
|
+
"section",
|
|
77
|
+
{
|
|
78
|
+
className: "relative overflow-hidden px-4 pb-8 pt-10 sm:pt-14",
|
|
79
|
+
onPointerEnter: () => setPaused(true),
|
|
80
|
+
onPointerLeave: () => setPaused(false),
|
|
81
|
+
onFocus: () => setPaused(true),
|
|
82
|
+
onBlur: () => setPaused(false),
|
|
83
|
+
children: [
|
|
84
|
+
activeImage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
+
import_framer_motion.motion.div,
|
|
86
|
+
{
|
|
87
|
+
"aria-hidden": true,
|
|
88
|
+
className: "pointer-events-none absolute inset-0 scale-125 opacity-30 blur-3xl dark:opacity-40",
|
|
89
|
+
initial: reduceMotion ? false : { opacity: 0 },
|
|
90
|
+
animate: { opacity: 1 },
|
|
91
|
+
transition: { duration: 0.6 },
|
|
92
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: activeImage, alt: "", fill: true, className: "object-cover", unoptimized: true })
|
|
93
|
+
},
|
|
94
|
+
active.contractAddress
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-b from-transparent to-background" }),
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
98
|
+
import_framer_motion.motion.div,
|
|
99
|
+
{
|
|
100
|
+
className: (0, import_cn.cn)("relative mx-auto touch-pan-y", CARD_SIZE),
|
|
101
|
+
drag: count > 1 ? "x" : false,
|
|
102
|
+
dragConstraints: { left: 0, right: 0 },
|
|
103
|
+
dragElastic: 0.2,
|
|
104
|
+
onDragStart: () => {
|
|
105
|
+
dragged.current = true;
|
|
106
|
+
},
|
|
107
|
+
onDragEnd: (_, info) => {
|
|
108
|
+
if (info.offset.x < -SWIPE_PX) go(1);
|
|
109
|
+
else if (info.offset.x > SWIPE_PX) go(-1);
|
|
110
|
+
setTimeout(() => {
|
|
111
|
+
dragged.current = false;
|
|
112
|
+
}, 0);
|
|
113
|
+
},
|
|
114
|
+
children: collections.map((collection, index) => {
|
|
115
|
+
const offset = offsetFrom(index, current, count);
|
|
116
|
+
const distance = Math.abs(offset);
|
|
117
|
+
const image = resolveImage(collection.image, { width: 640 });
|
|
118
|
+
const name = collection.name ?? "Collection";
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
120
|
+
import_framer_motion.motion.div,
|
|
121
|
+
{
|
|
122
|
+
className: (0, import_cn.cn)("absolute inset-0", distance > 2 && "pointer-events-none"),
|
|
123
|
+
initial: false,
|
|
124
|
+
animate: {
|
|
125
|
+
x: `${offset * 58}%`,
|
|
126
|
+
rotate: offset * 9,
|
|
127
|
+
scale: 1 - distance * 0.12,
|
|
128
|
+
opacity: distance > 2 ? 0 : 1,
|
|
129
|
+
zIndex: 10 - distance
|
|
130
|
+
},
|
|
131
|
+
transition,
|
|
132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
133
|
+
import_link.default,
|
|
134
|
+
{
|
|
135
|
+
href: getHref(collection),
|
|
136
|
+
"aria-label": name,
|
|
137
|
+
draggable: false,
|
|
138
|
+
onClick: (event) => {
|
|
139
|
+
if (dragged.current) event.preventDefault();
|
|
140
|
+
},
|
|
141
|
+
className: "relative block h-full w-full overflow-hidden rounded-2xl bg-muted shadow-2xl shadow-black/20 ring-1 ring-border dark:shadow-black/50",
|
|
142
|
+
children: [
|
|
143
|
+
image ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: image, alt: "", fill: true, sizes: "(min-width: 1024px) 340px, 58vw", className: "object-cover", priority: index === 0, 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" }),
|
|
144
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)("absolute inset-0 bg-background/40 transition-opacity duration-500", offset === 0 ? "opacity-0" : "opacity-100") })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
},
|
|
149
|
+
collection.contractAddress
|
|
150
|
+
);
|
|
151
|
+
})
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
155
|
+
import_framer_motion.motion.div,
|
|
156
|
+
{
|
|
157
|
+
className: "relative mt-8 flex flex-col items-center gap-1 text-center",
|
|
158
|
+
initial: reduceMotion ? false : { opacity: 0, y: 8 },
|
|
159
|
+
animate: { opacity: 1, y: 0 },
|
|
160
|
+
transition: { duration: 0.4 },
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: getHref(active), className: "transition-opacity hover:opacity-80", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-3xl font-semibold leading-tight tracking-tight text-foreground sm:text-4xl lg:text-5xl", children: active.name ?? "Collection" }) }),
|
|
163
|
+
supply != null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
|
|
164
|
+
supply.toLocaleString(),
|
|
165
|
+
" ",
|
|
166
|
+
supply === 1 ? "item" : "items"
|
|
167
|
+
] })
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
active.contractAddress
|
|
171
|
+
),
|
|
172
|
+
count > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative mt-3 flex justify-center", children: collections.map((collection, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
173
|
+
"button",
|
|
174
|
+
{
|
|
175
|
+
type: "button",
|
|
176
|
+
"aria-label": `Show ${collection.name ?? "collection"}`,
|
|
177
|
+
"aria-current": index === current ? "true" : void 0,
|
|
178
|
+
onClick: () => setCurrent(index),
|
|
179
|
+
className: "flex h-8 items-center px-0.5",
|
|
180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)("h-1.5 rounded-full transition-all", index === current ? "w-6 bg-foreground" : "w-1.5 bg-foreground/30") })
|
|
181
|
+
},
|
|
182
|
+
collection.contractAddress
|
|
183
|
+
)) })
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
189
|
+
0 && (module.exports = {
|
|
190
|
+
CollectionShowcase
|
|
191
|
+
});
|
|
192
|
+
//# sourceMappingURL=collection-showcase.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/collection-showcase.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nexport interface CollectionShowcaseProps {\n collections: ApiCollection[];\n isLoading: boolean;\n getHref: (collection: ApiCollection) => string;\n}\n\nconst AUTOPLAY_MS = 6000;\nconst SWIPE_PX = 50;\nconst CARD_SIZE = \"aspect-[4/5] w-[58vw] max-w-[260px] sm:max-w-[300px] lg:max-w-[340px]\";\n\nfunction offsetFrom(index: number, current: number, count: number) {\n const distance = (index - current + count) % count;\n return distance > count / 2 ? distance - count : distance;\n}\n\nfunction ShowcaseSkeleton() {\n return (\n <section className=\"px-4 pb-8 pt-10 sm:pt-14\">\n <Skeleton className={cn(\"mx-auto rounded-2xl\", CARD_SIZE)} />\n <Skeleton className=\"mx-auto mt-6 h-9 w-56\" />\n </section>\n );\n}\n\nexport function CollectionShowcase({ collections, isLoading, getHref }: CollectionShowcaseProps) {\n const resolveImage = useImageUrl();\n const reduceMotion = useReducedMotion();\n const [current, setCurrent] = useState(0);\n const [paused, setPaused] = useState(false);\n const dragged = useRef(false);\n const count = collections.length;\n\n const go = (step: number) => setCurrent((index) => (index + step + count) % count);\n\n useEffect(() => {\n if (count <= 1 || paused || reduceMotion) return;\n const id = setInterval(() => setCurrent((index) => (index + 1) % count), AUTOPLAY_MS);\n return () => clearInterval(id);\n }, [count, paused, reduceMotion]);\n\n if (isLoading) return <ShowcaseSkeleton />;\n if (count === 0) return null;\n\n const active = collections[current % count]!;\n const activeImage = resolveImage(active.image, { width: 960 });\n const supply = active.totalSupply;\n const transition = reduceMotion ? { duration: 0 } : { type: \"spring\" as const, stiffness: 220, damping: 26 };\n\n return (\n <section\n className=\"relative overflow-hidden px-4 pb-8 pt-10 sm:pt-14\"\n onPointerEnter={() => setPaused(true)}\n onPointerLeave={() => setPaused(false)}\n onFocus={() => setPaused(true)}\n onBlur={() => setPaused(false)}\n >\n {activeImage && (\n <motion.div\n key={active.contractAddress}\n aria-hidden\n className=\"pointer-events-none absolute inset-0 scale-125 opacity-30 blur-3xl dark:opacity-40\"\n initial={reduceMotion ? false : { opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.6 }}\n >\n <Image src={activeImage} alt=\"\" fill className=\"object-cover\" unoptimized />\n </motion.div>\n )}\n <div aria-hidden className=\"pointer-events-none absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-b from-transparent to-background\" />\n\n <motion.div\n className={cn(\"relative mx-auto touch-pan-y\", CARD_SIZE)}\n drag={count > 1 ? \"x\" : false}\n dragConstraints={{ left: 0, right: 0 }}\n dragElastic={0.2}\n onDragStart={() => { dragged.current = true; }}\n onDragEnd={(_, info) => {\n if (info.offset.x < -SWIPE_PX) go(1);\n else if (info.offset.x > SWIPE_PX) go(-1);\n setTimeout(() => { dragged.current = false; }, 0);\n }}\n >\n {collections.map((collection, index) => {\n const offset = offsetFrom(index, current, count);\n const distance = Math.abs(offset);\n const image = resolveImage(collection.image, { width: 640 });\n const name = collection.name ?? \"Collection\";\n return (\n <motion.div\n key={collection.contractAddress}\n className={cn(\"absolute inset-0\", distance > 2 && \"pointer-events-none\")}\n initial={false}\n animate={{\n x: `${offset * 58}%`,\n rotate: offset * 9,\n scale: 1 - distance * 0.12,\n opacity: distance > 2 ? 0 : 1,\n zIndex: 10 - distance,\n }}\n transition={transition}\n >\n <Link\n href={getHref(collection)}\n aria-label={name}\n draggable={false}\n onClick={(event) => { if (dragged.current) event.preventDefault(); }}\n className=\"relative block h-full w-full overflow-hidden rounded-2xl bg-muted shadow-2xl shadow-black/20 ring-1 ring-border dark:shadow-black/50\"\n >\n {image ? (\n <Image src={image} alt=\"\" fill sizes=\"(min-width: 1024px) 340px, 58vw\" className=\"object-cover\" priority={index === 0} unoptimized />\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 <span className={cn(\"absolute inset-0 bg-background/40 transition-opacity duration-500\", offset === 0 ? \"opacity-0\" : \"opacity-100\")} />\n </Link>\n </motion.div>\n );\n })}\n </motion.div>\n\n <motion.div\n key={active.contractAddress}\n className=\"relative mt-8 flex flex-col items-center gap-1 text-center\"\n initial={reduceMotion ? false : { opacity: 0, y: 8 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ duration: 0.4 }}\n >\n <Link href={getHref(active)} className=\"transition-opacity hover:opacity-80\">\n <h2 className=\"text-3xl font-semibold leading-tight tracking-tight text-foreground sm:text-4xl lg:text-5xl\">\n {active.name ?? \"Collection\"}\n </h2>\n </Link>\n {supply != null && (\n <p className=\"text-sm text-muted-foreground\">\n {supply.toLocaleString()} {supply === 1 ? \"item\" : \"items\"}\n </p>\n )}\n </motion.div>\n\n {count > 1 && (\n <div className=\"relative mt-3 flex justify-center\">\n {collections.map((collection, index) => (\n <button\n key={collection.contractAddress}\n type=\"button\"\n aria-label={`Show ${collection.name ?? \"collection\"}`}\n aria-current={index === current ? \"true\" : undefined}\n onClick={() => setCurrent(index)}\n className=\"flex h-8 items-center px-0.5\"\n >\n <span className={cn(\"h-1.5 rounded-full transition-all\", index === current ? \"w-6 bg-foreground\" : \"w-1.5 bg-foreground/30\")} />\n </button>\n ))}\n </div>\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BI;AA1BJ,mBAA4C;AAC5C,2BAAyC;AAEzC,kBAAiB;AACjB,mBAAkB;AAClB,sBAAyB;AACzB,gBAAmB;AACnB,2BAA4B;AAQ5B,MAAM,cAAc;AACpB,MAAM,WAAW;AACjB,MAAM,YAAY;AAElB,SAAS,WAAW,OAAe,SAAiB,OAAe;AACjE,QAAM,YAAY,QAAQ,UAAU,SAAS;AAC7C,SAAO,WAAW,QAAQ,IAAI,WAAW,QAAQ;AACnD;AAEA,SAAS,mBAAmB;AAC1B,SACE,6CAAC,aAAQ,WAAU,4BACjB;AAAA,gDAAC,4BAAS,eAAW,cAAG,uBAAuB,SAAS,GAAG;AAAA,IAC3D,4CAAC,4BAAS,WAAU,yBAAwB;AAAA,KAC9C;AAEJ;AAEO,SAAS,mBAAmB,EAAE,aAA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U,SAAS;AAAA,YAC3C,SAAS,MAAM,WAAW,KAAK;AAAA,YAC/B,WAAU;AAAA,YAEV,sDAAC,UAAK,eAAW,cAAG,qCAAqC,UAAU,UAAU,sBAAsB,wBAAwB,GAAG;AAAA;AAAA,UAPzH,WAAW;AAAA,QAQlB,CACD,GACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["Image","Link"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ApiCollection } from '@medialane/sdk';
|
|
3
|
+
|
|
4
|
+
interface CollectionShowcaseProps {
|
|
5
|
+
collections: ApiCollection[];
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
getHref: (collection: ApiCollection) => string;
|
|
8
|
+
}
|
|
9
|
+
declare function CollectionShowcase({ collections, isLoading, getHref }: CollectionShowcaseProps): react_jsx_runtime.JSX.Element | null;
|
|
10
|
+
|
|
11
|
+
export { CollectionShowcase, type CollectionShowcaseProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ApiCollection } from '@medialane/sdk';
|
|
3
|
+
|
|
4
|
+
interface CollectionShowcaseProps {
|
|
5
|
+
collections: ApiCollection[];
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
getHref: (collection: ApiCollection) => string;
|
|
8
|
+
}
|
|
9
|
+
declare function CollectionShowcase({ collections, isLoading, getHref }: CollectionShowcaseProps): react_jsx_runtime.JSX.Element | null;
|
|
10
|
+
|
|
11
|
+
export { CollectionShowcase, type CollectionShowcaseProps };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { motion, useReducedMotion } from "framer-motion";
|
|
5
|
+
import Link from "./link.js";
|
|
6
|
+
import Image from "./image.js";
|
|
7
|
+
import { Skeleton } from "./skeleton.js";
|
|
8
|
+
import { cn } from "../utils/cn.js";
|
|
9
|
+
import { useImageUrl } from "../utils/use-image-url.js";
|
|
10
|
+
const AUTOPLAY_MS = 6e3;
|
|
11
|
+
const SWIPE_PX = 50;
|
|
12
|
+
const CARD_SIZE = "aspect-[4/5] w-[58vw] max-w-[260px] sm:max-w-[300px] lg:max-w-[340px]";
|
|
13
|
+
function offsetFrom(index, current, count) {
|
|
14
|
+
const distance = (index - current + count) % count;
|
|
15
|
+
return distance > count / 2 ? distance - count : distance;
|
|
16
|
+
}
|
|
17
|
+
function ShowcaseSkeleton() {
|
|
18
|
+
return /* @__PURE__ */ jsxs("section", { className: "px-4 pb-8 pt-10 sm:pt-14", children: [
|
|
19
|
+
/* @__PURE__ */ jsx(Skeleton, { className: cn("mx-auto rounded-2xl", CARD_SIZE) }),
|
|
20
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto mt-6 h-9 w-56" })
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
function CollectionShowcase({ collections, isLoading, getHref }) {
|
|
24
|
+
const resolveImage = useImageUrl();
|
|
25
|
+
const reduceMotion = useReducedMotion();
|
|
26
|
+
const [current, setCurrent] = useState(0);
|
|
27
|
+
const [paused, setPaused] = useState(false);
|
|
28
|
+
const dragged = useRef(false);
|
|
29
|
+
const count = collections.length;
|
|
30
|
+
const go = (step) => setCurrent((index) => (index + step + count) % count);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (count <= 1 || paused || reduceMotion) return;
|
|
33
|
+
const id = setInterval(() => setCurrent((index) => (index + 1) % count), AUTOPLAY_MS);
|
|
34
|
+
return () => clearInterval(id);
|
|
35
|
+
}, [count, paused, reduceMotion]);
|
|
36
|
+
if (isLoading) return /* @__PURE__ */ jsx(ShowcaseSkeleton, {});
|
|
37
|
+
if (count === 0) return null;
|
|
38
|
+
const active = collections[current % count];
|
|
39
|
+
const activeImage = resolveImage(active.image, { width: 960 });
|
|
40
|
+
const supply = active.totalSupply;
|
|
41
|
+
const transition = reduceMotion ? { duration: 0 } : { type: "spring", stiffness: 220, damping: 26 };
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
"section",
|
|
44
|
+
{
|
|
45
|
+
className: "relative overflow-hidden px-4 pb-8 pt-10 sm:pt-14",
|
|
46
|
+
onPointerEnter: () => setPaused(true),
|
|
47
|
+
onPointerLeave: () => setPaused(false),
|
|
48
|
+
onFocus: () => setPaused(true),
|
|
49
|
+
onBlur: () => setPaused(false),
|
|
50
|
+
children: [
|
|
51
|
+
activeImage && /* @__PURE__ */ jsx(
|
|
52
|
+
motion.div,
|
|
53
|
+
{
|
|
54
|
+
"aria-hidden": true,
|
|
55
|
+
className: "pointer-events-none absolute inset-0 scale-125 opacity-30 blur-3xl dark:opacity-40",
|
|
56
|
+
initial: reduceMotion ? false : { opacity: 0 },
|
|
57
|
+
animate: { opacity: 1 },
|
|
58
|
+
transition: { duration: 0.6 },
|
|
59
|
+
children: /* @__PURE__ */ jsx(Image, { src: activeImage, alt: "", fill: true, className: "object-cover", unoptimized: true })
|
|
60
|
+
},
|
|
61
|
+
active.contractAddress
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-b from-transparent to-background" }),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
motion.div,
|
|
66
|
+
{
|
|
67
|
+
className: cn("relative mx-auto touch-pan-y", CARD_SIZE),
|
|
68
|
+
drag: count > 1 ? "x" : false,
|
|
69
|
+
dragConstraints: { left: 0, right: 0 },
|
|
70
|
+
dragElastic: 0.2,
|
|
71
|
+
onDragStart: () => {
|
|
72
|
+
dragged.current = true;
|
|
73
|
+
},
|
|
74
|
+
onDragEnd: (_, info) => {
|
|
75
|
+
if (info.offset.x < -SWIPE_PX) go(1);
|
|
76
|
+
else if (info.offset.x > SWIPE_PX) go(-1);
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
dragged.current = false;
|
|
79
|
+
}, 0);
|
|
80
|
+
},
|
|
81
|
+
children: collections.map((collection, index) => {
|
|
82
|
+
const offset = offsetFrom(index, current, count);
|
|
83
|
+
const distance = Math.abs(offset);
|
|
84
|
+
const image = resolveImage(collection.image, { width: 640 });
|
|
85
|
+
const name = collection.name ?? "Collection";
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
motion.div,
|
|
88
|
+
{
|
|
89
|
+
className: cn("absolute inset-0", distance > 2 && "pointer-events-none"),
|
|
90
|
+
initial: false,
|
|
91
|
+
animate: {
|
|
92
|
+
x: `${offset * 58}%`,
|
|
93
|
+
rotate: offset * 9,
|
|
94
|
+
scale: 1 - distance * 0.12,
|
|
95
|
+
opacity: distance > 2 ? 0 : 1,
|
|
96
|
+
zIndex: 10 - distance
|
|
97
|
+
},
|
|
98
|
+
transition,
|
|
99
|
+
children: /* @__PURE__ */ jsxs(
|
|
100
|
+
Link,
|
|
101
|
+
{
|
|
102
|
+
href: getHref(collection),
|
|
103
|
+
"aria-label": name,
|
|
104
|
+
draggable: false,
|
|
105
|
+
onClick: (event) => {
|
|
106
|
+
if (dragged.current) event.preventDefault();
|
|
107
|
+
},
|
|
108
|
+
className: "relative block h-full w-full overflow-hidden rounded-2xl bg-muted shadow-2xl shadow-black/20 ring-1 ring-border dark:shadow-black/50",
|
|
109
|
+
children: [
|
|
110
|
+
image ? /* @__PURE__ */ jsx(Image, { src: image, alt: "", fill: true, sizes: "(min-width: 1024px) 340px, 58vw", className: "object-cover", priority: index === 0, 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" }),
|
|
111
|
+
/* @__PURE__ */ jsx("span", { className: cn("absolute inset-0 bg-background/40 transition-opacity duration-500", offset === 0 ? "opacity-0" : "opacity-100") })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
},
|
|
116
|
+
collection.contractAddress
|
|
117
|
+
);
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsxs(
|
|
122
|
+
motion.div,
|
|
123
|
+
{
|
|
124
|
+
className: "relative mt-8 flex flex-col items-center gap-1 text-center",
|
|
125
|
+
initial: reduceMotion ? false : { opacity: 0, y: 8 },
|
|
126
|
+
animate: { opacity: 1, y: 0 },
|
|
127
|
+
transition: { duration: 0.4 },
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ jsx(Link, { href: getHref(active), className: "transition-opacity hover:opacity-80", children: /* @__PURE__ */ jsx("h2", { className: "text-3xl font-semibold leading-tight tracking-tight text-foreground sm:text-4xl lg:text-5xl", children: active.name ?? "Collection" }) }),
|
|
130
|
+
supply != null && /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
131
|
+
supply.toLocaleString(),
|
|
132
|
+
" ",
|
|
133
|
+
supply === 1 ? "item" : "items"
|
|
134
|
+
] })
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
active.contractAddress
|
|
138
|
+
),
|
|
139
|
+
count > 1 && /* @__PURE__ */ jsx("div", { className: "relative mt-3 flex justify-center", children: collections.map((collection, index) => /* @__PURE__ */ jsx(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
type: "button",
|
|
143
|
+
"aria-label": `Show ${collection.name ?? "collection"}`,
|
|
144
|
+
"aria-current": index === current ? "true" : void 0,
|
|
145
|
+
onClick: () => setCurrent(index),
|
|
146
|
+
className: "flex h-8 items-center px-0.5",
|
|
147
|
+
children: /* @__PURE__ */ jsx("span", { className: cn("h-1.5 rounded-full transition-all", index === current ? "w-6 bg-foreground" : "w-1.5 bg-foreground/30") })
|
|
148
|
+
},
|
|
149
|
+
collection.contractAddress
|
|
150
|
+
)) })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
export {
|
|
156
|
+
CollectionShowcase
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=collection-showcase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/collection-showcase.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nexport interface CollectionShowcaseProps {\n collections: ApiCollection[];\n isLoading: boolean;\n getHref: (collection: ApiCollection) => string;\n}\n\nconst AUTOPLAY_MS = 6000;\nconst SWIPE_PX = 50;\nconst CARD_SIZE = \"aspect-[4/5] w-[58vw] max-w-[260px] sm:max-w-[300px] lg:max-w-[340px]\";\n\nfunction offsetFrom(index: number, current: number, count: number) {\n const distance = (index - current + count) % count;\n return distance > count / 2 ? distance - count : distance;\n}\n\nfunction ShowcaseSkeleton() {\n return (\n <section className=\"px-4 pb-8 pt-10 sm:pt-14\">\n <Skeleton className={cn(\"mx-auto rounded-2xl\", CARD_SIZE)} />\n <Skeleton className=\"mx-auto mt-6 h-9 w-56\" />\n </section>\n );\n}\n\nexport function CollectionShowcase({ collections, isLoading, getHref }: CollectionShowcaseProps) {\n const resolveImage = useImageUrl();\n const reduceMotion = useReducedMotion();\n const [current, setCurrent] = useState(0);\n const [paused, setPaused] = useState(false);\n const dragged = useRef(false);\n const count = collections.length;\n\n const go = (step: number) => setCurrent((index) => (index + step + count) % count);\n\n useEffect(() => {\n if (count <= 1 || paused || reduceMotion) return;\n const id = setInterval(() => setCurrent((index) => (index + 1) % count), AUTOPLAY_MS);\n return () => clearInterval(id);\n }, [count, paused, reduceMotion]);\n\n if (isLoading) return <ShowcaseSkeleton />;\n if (count === 0) return null;\n\n const active = collections[current % count]!;\n const activeImage = resolveImage(active.image, { width: 960 });\n const supply = active.totalSupply;\n const transition = reduceMotion ? { duration: 0 } : { type: \"spring\" as const, stiffness: 220, damping: 26 };\n\n return (\n <section\n className=\"relative overflow-hidden px-4 pb-8 pt-10 sm:pt-14\"\n onPointerEnter={() => setPaused(true)}\n onPointerLeave={() => setPaused(false)}\n onFocus={() => setPaused(true)}\n onBlur={() => setPaused(false)}\n >\n {activeImage && (\n <motion.div\n key={active.contractAddress}\n aria-hidden\n className=\"pointer-events-none absolute inset-0 scale-125 opacity-30 blur-3xl dark:opacity-40\"\n initial={reduceMotion ? false : { opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.6 }}\n >\n <Image src={activeImage} alt=\"\" fill className=\"object-cover\" unoptimized />\n </motion.div>\n )}\n <div aria-hidden className=\"pointer-events-none absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-b from-transparent to-background\" />\n\n <motion.div\n className={cn(\"relative mx-auto touch-pan-y\", CARD_SIZE)}\n drag={count > 1 ? \"x\" : false}\n dragConstraints={{ left: 0, right: 0 }}\n dragElastic={0.2}\n onDragStart={() => { dragged.current = true; }}\n onDragEnd={(_, info) => {\n if (info.offset.x < -SWIPE_PX) go(1);\n else if (info.offset.x > SWIPE_PX) go(-1);\n setTimeout(() => { dragged.current = false; }, 0);\n }}\n >\n {collections.map((collection, index) => {\n const offset = offsetFrom(index, current, count);\n const distance = Math.abs(offset);\n const image = resolveImage(collection.image, { width: 640 });\n const name = collection.name ?? \"Collection\";\n return (\n <motion.div\n key={collection.contractAddress}\n className={cn(\"absolute inset-0\", distance > 2 && \"pointer-events-none\")}\n initial={false}\n animate={{\n x: `${offset * 58}%`,\n rotate: offset * 9,\n scale: 1 - distance * 0.12,\n opacity: distance > 2 ? 0 : 1,\n zIndex: 10 - distance,\n }}\n transition={transition}\n >\n <Link\n href={getHref(collection)}\n aria-label={name}\n draggable={false}\n onClick={(event) => { if (dragged.current) event.preventDefault(); }}\n className=\"relative block h-full w-full overflow-hidden rounded-2xl bg-muted shadow-2xl shadow-black/20 ring-1 ring-border dark:shadow-black/50\"\n >\n {image ? (\n <Image src={image} alt=\"\" fill sizes=\"(min-width: 1024px) 340px, 58vw\" className=\"object-cover\" priority={index === 0} unoptimized />\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 <span className={cn(\"absolute inset-0 bg-background/40 transition-opacity duration-500\", offset === 0 ? \"opacity-0\" : \"opacity-100\")} />\n </Link>\n </motion.div>\n );\n })}\n </motion.div>\n\n <motion.div\n key={active.contractAddress}\n className=\"relative mt-8 flex flex-col items-center gap-1 text-center\"\n initial={reduceMotion ? false : { opacity: 0, y: 8 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ duration: 0.4 }}\n >\n <Link href={getHref(active)} className=\"transition-opacity hover:opacity-80\">\n <h2 className=\"text-3xl font-semibold leading-tight tracking-tight text-foreground sm:text-4xl lg:text-5xl\">\n {active.name ?? \"Collection\"}\n </h2>\n </Link>\n {supply != null && (\n <p className=\"text-sm text-muted-foreground\">\n {supply.toLocaleString()} {supply === 1 ? \"item\" : \"items\"}\n </p>\n )}\n </motion.div>\n\n {count > 1 && (\n <div className=\"relative mt-3 flex justify-center\">\n {collections.map((collection, index) => (\n <button\n key={collection.contractAddress}\n type=\"button\"\n aria-label={`Show ${collection.name ?? \"collection\"}`}\n aria-current={index === current ? \"true\" : undefined}\n onClick={() => setCurrent(index)}\n className=\"flex h-8 items-center px-0.5\"\n >\n <span className={cn(\"h-1.5 rounded-full transition-all\", index === current ? \"w-6 bg-foreground\" : \"w-1.5 bg-foreground/30\")} />\n </button>\n ))}\n </div>\n )}\n </section>\n );\n}\n"],"mappings":";AA4BI,SACE,KADF;AA1BJ,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,QAAQ,wBAAwB;AAEzC,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,gBAAgB;A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AA,cACC,UAAU,QACT,qBAAC,OAAE,WAAU,iCACV;AAAA,uBAAO,eAAe;AAAA,gBAAE;AAAA,gBAAE,WAAW,IAAI,SAAS;AAAA,iBACrD;AAAA;AAAA;AAAA,UAdG,OAAO;AAAA,QAgBd;AAAA,QAEC,QAAQ,KACP,oBAAC,SAAI,WAAU,qCACZ,sBAAY,IAAI,CAAC,YAAY,UAC5B;AAAA,UAAC;AAAA;AAAA,YAEC,MAAK;AAAA,YACL,cAAY,QAAQ,WAAW,QAAQ,YAAY;AAAA,YACnD,gBAAc,UAAU,UAAU,SAAS;AAAA,YAC3C,SAAS,MAAM,WAAW,KAAK;AAAA,YAC/B,WAAU;AAAA,YAEV,8BAAC,UAAK,WAAW,GAAG,qCAAqC,UAAU,UAAU,sBAAsB,wBAAwB,GAAG;AAAA;AAAA,UAPzH,WAAW;AAAA,QAQlB,CACD,GACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { FastMintProps } from './types.cjs';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '@medialane/sdk/starknet';
|
|
7
7
|
|
|
8
|
-
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> |
|
|
8
|
+
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { FastMintProps } from './types.js';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '@medialane/sdk/starknet';
|
|
7
7
|
|
|
8
|
-
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> |
|
|
8
|
+
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -38,7 +38,7 @@ var import_sdk = require("@medialane/sdk");
|
|
|
38
38
|
var import_lucide_react = require("lucide-react");
|
|
39
39
|
var import_link = __toESM(require("./link.js"), 1);
|
|
40
40
|
var import_page_container = require("./page-container.js");
|
|
41
|
-
var
|
|
41
|
+
var import_collection_showcase = require("./collection-showcase.js");
|
|
42
42
|
var import_activity_ticker = require("./activity-ticker.js");
|
|
43
43
|
var import_scroll_section = require("./scroll-section.js");
|
|
44
44
|
var import_listing_card = require("./listing-card.js");
|
|
@@ -128,7 +128,7 @@ function HomePage({ useMarketActions, initialFeatured }) {
|
|
|
128
128
|
const { collections: featured, isLoading: featuredLoading } = (0, import_use_collections.useCollections)(1, 3, true, "recent", true, void 0, void 0, initialFeatured);
|
|
129
129
|
const { orders: tickerOrders } = (0, import_use_orders.useOrders)({ status: "ACTIVE", sort: "recent", limit: 14 });
|
|
130
130
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pb-20", children: [
|
|
131
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collection_showcase.CollectionShowcase, { collections: featured, isLoading: featuredLoading, getHref: (c) => (0, import_sdk.collectionHref)("STARKNET", c.contractAddress) }),
|
|
132
132
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_page_container.PageContainer, { className: "box-border max-w-full pt-6 pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_ticker.ActivityTicker, { orders: tickerOrders, minItems: 3, getHref: (o) => (0, import_sdk.assetHref)("STARKNET", o.nftContract, o.nftTokenId) }) }),
|
|
133
133
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_page_container.PageContainer, { className: "mt-16 box-border max-w-full space-y-10 pt-0 pb-0 sm:space-y-16 lg:space-y-20", children: [
|
|
134
134
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NewListings, { market }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection, type ApiOrdersQuery } from \"@medialane/sdk\";\nimport type { ReactNode } from \"react\";\nimport { Sparkles, Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection, type ApiOrdersQuery } from \"@medialane/sdk\";\nimport type { ReactNode } from \"react\";\nimport { Sparkles, Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { CollectionShowcase } from \"./collection-showcase.js\";\nimport { ActivityTicker } from \"./activity-ticker.js\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { ListingCard, ListingCardSkeleton } from \"./listing-card.js\";\nimport { ListingCardMenu } from \"./listing-card-menu.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport { RewardsSection } from \"./rewards-section.js\";\nimport { LaunchpadStrip } from \"./launchpad-strip.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport type { CollectionMarketActions } from \"./collection-page.js\";\nimport { useOrders } from \"../utils/use-orders.js\";\nimport { useCollections } from \"../utils/use-collections.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\n\nconst LAUNCHPAD_HREFS = {\n nfts: \"/launchpad/single-editions\",\n \"limited-editions\": \"/launchpad/nfteditions\",\n \"collection-drop\": \"/launchpad/drop\",\n \"pop-protocol\": \"/launchpad/pop\",\n \"ip-tickets\": \"/launchpad/tickets\",\n \"creator-coins\": \"/launchpad/coin/create\",\n};\n\nfunction ListingsStrip({\n market, icon, title, query, href, empty,\n}: {\n market: CollectionMarketActions;\n icon: ReactNode;\n title: string;\n query: ApiOrdersQuery;\n href: string;\n empty?: ReactNode;\n}) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders(query);\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n if (!isLoading && listings.length === 0 && !empty) return null;\n return (\n <ScrollSection icon={icon} title={title} href={href}>\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-56 shrink-0 snap-start sm:w-64\"><ListingCardSkeleton /></div>\n ))\n : listings.length === 0\n ? empty\n : listings.map((order) => {\n const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);\n return (\n <div key={order.orderHash} className=\"w-56 shrink-0 snap-start sm:w-64\">\n <ListingCard\n order={order}\n onBuy={own ? undefined : () => market.buy(order)}\n overflowMenu={<ListingCardMenu order={order} />}\n usdValue={orderUsd(order.price, prices)}\n />\n </div>\n );\n })}\n </ScrollSection>\n );\n}\n\nfunction NewListings({ market }: { market: CollectionMarketActions }) {\n return (\n <ListingsStrip\n market={market}\n icon={<Tag />}\n title=\"Marketplace\"\n query={{ status: \"ACTIVE\", limit: 10, page: 1 }}\n href=\"/marketplace\"\n empty={\n <p className=\"py-4 text-sm text-muted-foreground\">\n <Link href=\"/launchpad/single-editions\" className=\"text-primary hover:underline\">Sell the first asset</Link>\n </p>\n }\n />\n );\n}\n\nexport function FeaturedListings({ market }: { market: CollectionMarketActions }) {\n return (\n <ListingsStrip\n market={market}\n icon={<Sparkles />}\n title=\"Featured\"\n query={{ status: \"ACTIVE\", isFeatured: true, limit: 20, page: 1 }}\n href=\"/marketplace\"\n />\n );\n}\n\nfunction CollectionsStrip() {\n const { collections, isLoading } = useCollections(1, 10, undefined, \"recent\");\n return (\n <ScrollSection\n icon={<TrendingUp className=\"h-4 w-4\" />}\n title=\"Collections\"\n href=\"/collections\"\n >\n {isLoading\n ? Array.from({ length: 5 }).map((_, i) => (\n <div key={i} className=\"w-56 shrink-0 snap-start sm:w-64\"><CollectionCardSkeleton /></div>\n ))\n : collections.map((col) => (\n <div key={col.contractAddress} className=\"w-56 shrink-0 snap-start sm:w-64\"><CollectionCard collection={col} /></div>\n ))}\n </ScrollSection>\n );\n}\n\nexport interface HomePageProps {\n useMarketActions: () => CollectionMarketActions;\n initialFeatured?: ApiCollection[];\n}\n\nexport function HomePage({ useMarketActions, initialFeatured }: HomePageProps) {\n const market = useMarketActions();\n const { collections: featured, isLoading: featuredLoading } = useCollections(1, 3, true, \"recent\", true, undefined, undefined, initialFeatured);\n const { orders: tickerOrders } = useOrders({ status: \"ACTIVE\", sort: \"recent\", limit: 14 });\n return (\n <div className=\"pb-20\">\n <CollectionShowcase collections={featured} isLoading={featuredLoading} getHref={(c) => collectionHref(\"STARKNET\", c.contractAddress)} />\n <PageContainer className=\"box-border max-w-full pt-6 pb-0\">\n <ActivityTicker orders={tickerOrders} minItems={3} getHref={(o) => assetHref(\"STARKNET\", o.nftContract, o.nftTokenId)} />\n </PageContainer>\n <PageContainer className=\"mt-16 box-border max-w-full space-y-10 pt-0 pb-0 sm:space-y-16 lg:space-y-20\">\n <NewListings market={market} />\n <FeaturedListings market={market} />\n <CollectionsStrip />\n <RewardsSection rewardsHref=\"/rewards\" />\n <LaunchpadStrip hrefs={LAUNCHPAD_HREFS} marketplaceHref=\"/marketplace\" launchpadHref=\"/launchpad\" />\n </PageContainer>\n {market.dialogs}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDsE;AAjDtE,iBAAmF;AAEnF,0BAA0C;AAC1C,kBAAiB;AACjB,4BAA8B;AAC9B,iCAAmC;AACnC,6BAA+B;AAC/B,4BAA8B;AAC9B,0BAAiD;AACjD,+BAAgC;AAChC,6BAAuD;AACvD,6BAA+B;AAC/B,6BAA+B;AAC/B,2BAAgC;AAEhC,wBAA0B;AAC1B,6BAA+B;AAC/B,4BAA6B;AAC7B,uBAAyB;AACzB,0BAA8B;AAE9B,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,iBAAiB;AACnB;AAEA,SAAS,cAAc;AAAA,EACrB;AAAA,EAAQ;AAAA,EAAM;AAAA,EAAO;AAAA,EAAO;AAAA,EAAM;AACpC,GAOG;AACD,QAAM,EAAE,cAAc,QAAI,sCAAgB;AAC1C,QAAM,EAAE,QAAQ,UAAU,QAAI,6BAAU,KAAK;AAC7C,QAAM,aAAS,oCAAa;AAC5B,QAAM,WAAW,OAAO,OAAO,CAAC,MAAM,EAAE,MAAM,aAAa,YAAY,EAAE,MAAM,aAAa,SAAS,EAAE,MAAM,GAAG,EAAE;AAClH,MAAI,CAAC,aAAa,SAAS,WAAW,KAAK,CAAC,MAAO,QAAO;AAC1D,SAC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J;","names":["Link"]}
|
|
@@ -4,7 +4,7 @@ import { assetHref, collectionHref } from "@medialane/sdk";
|
|
|
4
4
|
import { Sparkles, Tag, TrendingUp } from "lucide-react";
|
|
5
5
|
import Link from "./link.js";
|
|
6
6
|
import { PageContainer } from "./page-container.js";
|
|
7
|
-
import {
|
|
7
|
+
import { CollectionShowcase } from "./collection-showcase.js";
|
|
8
8
|
import { ActivityTicker } from "./activity-ticker.js";
|
|
9
9
|
import { ScrollSection } from "./scroll-section.js";
|
|
10
10
|
import { ListingCard, ListingCardSkeleton } from "./listing-card.js";
|
|
@@ -94,7 +94,7 @@ function HomePage({ useMarketActions, initialFeatured }) {
|
|
|
94
94
|
const { collections: featured, isLoading: featuredLoading } = useCollections(1, 3, true, "recent", true, void 0, void 0, initialFeatured);
|
|
95
95
|
const { orders: tickerOrders } = useOrders({ status: "ACTIVE", sort: "recent", limit: 14 });
|
|
96
96
|
return /* @__PURE__ */ jsxs("div", { className: "pb-20", children: [
|
|
97
|
-
/* @__PURE__ */ jsx(
|
|
97
|
+
/* @__PURE__ */ jsx(CollectionShowcase, { collections: featured, isLoading: featuredLoading, getHref: (c) => collectionHref("STARKNET", c.contractAddress) }),
|
|
98
98
|
/* @__PURE__ */ jsx(PageContainer, { className: "box-border max-w-full pt-6 pb-0", children: /* @__PURE__ */ jsx(ActivityTicker, { orders: tickerOrders, minItems: 3, getHref: (o) => assetHref("STARKNET", o.nftContract, o.nftTokenId) }) }),
|
|
99
99
|
/* @__PURE__ */ jsxs(PageContainer, { className: "mt-16 box-border max-w-full space-y-10 pt-0 pb-0 sm:space-y-16 lg:space-y-20", children: [
|
|
100
100
|
/* @__PURE__ */ jsx(NewListings, { market }),
|