@medialane/ui 0.360.0 → 0.361.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 +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/collection-showcase.cjs +11 -22
- package/dist/components/collection-showcase.cjs.map +1 -1
- package/dist/components/collection-showcase.js +11 -22
- package/dist/components/collection-showcase.js.map +1 -1
- 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/launchpad/edition-mint-schema.d.cts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/package.json +1 -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>, "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "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>, "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "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>, "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "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>, "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -3,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
7
|
-
size?: "
|
|
6
|
+
variant?: "ghost" | "link" | "default" | "destructive" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
|
+
size?: "icon" | "default" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -3,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
7
|
-
size?: "
|
|
6
|
+
variant?: "ghost" | "link" | "default" | "destructive" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
|
+
size?: "icon" | "default" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -76,7 +76,6 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
|
|
|
76
76
|
if (count === 0) return null;
|
|
77
77
|
const active = collections[current % count];
|
|
78
78
|
const activeImage = resolveImage(active.image, { width: 960 });
|
|
79
|
-
const supply = active.totalSupply;
|
|
80
79
|
const transition = reduceMotion ? { duration: 0 } : { type: "spring", stiffness: 220, damping: 26 };
|
|
81
80
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
82
81
|
"section",
|
|
@@ -161,7 +160,15 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
|
|
|
161
160
|
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",
|
|
162
161
|
children: [
|
|
163
162
|
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" }),
|
|
164
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)("absolute inset-0 bg-black/30 transition-opacity duration-500", offset === 0 ? "opacity-0" : "opacity-100") })
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)("absolute inset-0 bg-black/30 transition-opacity duration-500", offset === 0 ? "opacity-0" : "opacity-100") }),
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "absolute inset-x-3 bottom-3 flex flex-col items-start gap-1.5", children: [
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "max-w-full truncate rounded-full bg-black/30 px-4 py-1.5 text-base font-semibold leading-tight text-white backdrop-blur-md sm:text-lg", children: name }),
|
|
166
|
+
collection.totalSupply != null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "rounded-full bg-black/30 px-3 py-1 text-xs font-medium tabular-nums text-white backdrop-blur-md", children: [
|
|
167
|
+
collection.totalSupply.toLocaleString(),
|
|
168
|
+
" ",
|
|
169
|
+
collection.totalSupply === 1 ? "item" : "items"
|
|
170
|
+
] })
|
|
171
|
+
] })
|
|
165
172
|
]
|
|
166
173
|
}
|
|
167
174
|
)
|
|
@@ -171,26 +178,8 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
|
|
|
171
178
|
})
|
|
172
179
|
}
|
|
173
180
|
),
|
|
174
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
175
|
-
|
|
176
|
-
{
|
|
177
|
-
"aria-live": paused ? "polite" : "off",
|
|
178
|
-
className: "relative mt-8 flex flex-col items-center gap-1 text-center",
|
|
179
|
-
initial: reduceMotion ? false : { opacity: 0, y: 8 },
|
|
180
|
-
animate: { opacity: 1, y: 0 },
|
|
181
|
-
transition: { duration: 0.4 },
|
|
182
|
-
children: [
|
|
183
|
-
/* @__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" }) }),
|
|
184
|
-
supply != null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
|
|
185
|
-
supply.toLocaleString(),
|
|
186
|
-
" ",
|
|
187
|
-
supply === 1 ? "item" : "items"
|
|
188
|
-
] })
|
|
189
|
-
]
|
|
190
|
-
},
|
|
191
|
-
active.contractAddress
|
|
192
|
-
),
|
|
193
|
-
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)(
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { "aria-live": paused ? "polite" : "off", className: "sr-only", children: active.name ?? "Collection" }),
|
|
182
|
+
count > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative mt-4 flex justify-center", children: collections.map((collection, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
194
183
|
"button",
|
|
195
184
|
{
|
|
196
185
|
type: "button",
|
|
@@ -1 +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-[min(440px,60vh)] xl:max-w-[min(500px,62vh)]\";\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-20 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 [hidden, setHidden] = 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 const onVisibility = () => setHidden(document.hidden);\n document.addEventListener(\"visibilitychange\", onVisibility);\n return () => document.removeEventListener(\"visibilitychange\", onVisibility);\n }, []);\n\n useEffect(() => {\n if (count <= 1 || paused || hidden || reduceMotion) return;\n const id = setInterval(() => setCurrent((index) => (index + 1) % count), AUTOPLAY_MS);\n return () => clearInterval(id);\n }, [count, paused, hidden, 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-20 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 role=\"group\"\n aria-roledescription=\"carousel\"\n aria-label=\"Featured collections\"\n tabIndex={count > 1 ? 0 : -1}\n onKeyDown={(event) => {\n if (count <= 1) return;\n if (event.key === \"ArrowLeft\") { event.preventDefault(); go(-1); }\n else if (event.key === \"ArrowRight\") { event.preventDefault(); go(1); }\n }}\n className={cn(\"relative mx-auto touch-pan-y rounded-2xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-background\", 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-black/30 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 aria-live={paused ? \"polite\" : \"off\"}\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 trans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YACnD,gBAAc,UAAU,UAAU,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"]}
|
|
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-[min(440px,60vh)] xl:max-w-[min(500px,62vh)]\";\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-20 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 [hidden, setHidden] = 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 const onVisibility = () => setHidden(document.hidden);\n document.addEventListener(\"visibilitychange\", onVisibility);\n return () => document.removeEventListener(\"visibilitychange\", onVisibility);\n }, []);\n\n useEffect(() => {\n if (count <= 1 || paused || hidden || reduceMotion) return;\n const id = setInterval(() => setCurrent((index) => (index + 1) % count), AUTOPLAY_MS);\n return () => clearInterval(id);\n }, [count, paused, hidden, 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 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-20 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 role=\"group\"\n aria-roledescription=\"carousel\"\n aria-label=\"Featured collections\"\n tabIndex={count > 1 ? 0 : -1}\n onKeyDown={(event) => {\n if (count <= 1) return;\n if (event.key === \"ArrowLeft\") { event.preventDefault(); go(-1); }\n else if (event.key === \"ArrowRight\") { event.preventDefault(); go(1); }\n }}\n className={cn(\"relative mx-auto touch-pan-y rounded-2xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-background\", 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-black/30 transition-opacity duration-500\", offset === 0 ? \"opacity-0\" : \"opacity-100\")} />\n <span className=\"absolute inset-x-3 bottom-3 flex flex-col items-start gap-1.5\">\n <span className=\"max-w-full truncate rounded-full bg-black/30 px-4 py-1.5 text-base font-semibold leading-tight text-white backdrop-blur-md sm:text-lg\">\n {name}\n </span>\n {collection.totalSupply != null && (\n <span className=\"rounded-full bg-black/30 px-3 py-1 text-xs font-medium tabular-nums text-white backdrop-blur-md\">\n {collection.totalSupply.toLocaleString()} {collection.totalSupply === 1 ? \"item\" : \"items\"}\n </span>\n )}\n </span>\n </Link>\n </motion.div>\n );\n })}\n </motion.div>\n\n <h2 aria-live={paused ? \"polite\" : \"off\"} className=\"sr-only\">\n {active.name ?? \"Collection\"}\n </h2>\n\n {count > 1 && (\n <div className=\"relative mt-4 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,aAAa,WAAW,QAAQ,GAA4B;AAC/F,QAAM,mBAAe,kCAAY;AACjC,QAAM,mBAAe,uCAAiB;AACtC,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAS,CAAC;AACxC,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KAAK;AAC1C,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KA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C5B;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,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"]}
|
|
@@ -43,7 +43,6 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
|
|
|
43
43
|
if (count === 0) return null;
|
|
44
44
|
const active = collections[current % count];
|
|
45
45
|
const activeImage = resolveImage(active.image, { width: 960 });
|
|
46
|
-
const supply = active.totalSupply;
|
|
47
46
|
const transition = reduceMotion ? { duration: 0 } : { type: "spring", stiffness: 220, damping: 26 };
|
|
48
47
|
return /* @__PURE__ */ jsxs(
|
|
49
48
|
"section",
|
|
@@ -128,7 +127,15 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
|
|
|
128
127
|
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",
|
|
129
128
|
children: [
|
|
130
129
|
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" }),
|
|
131
|
-
/* @__PURE__ */ jsx("span", { className: cn("absolute inset-0 bg-black/30 transition-opacity duration-500", offset === 0 ? "opacity-0" : "opacity-100") })
|
|
130
|
+
/* @__PURE__ */ jsx("span", { className: cn("absolute inset-0 bg-black/30 transition-opacity duration-500", offset === 0 ? "opacity-0" : "opacity-100") }),
|
|
131
|
+
/* @__PURE__ */ jsxs("span", { className: "absolute inset-x-3 bottom-3 flex flex-col items-start gap-1.5", children: [
|
|
132
|
+
/* @__PURE__ */ jsx("span", { className: "max-w-full truncate rounded-full bg-black/30 px-4 py-1.5 text-base font-semibold leading-tight text-white backdrop-blur-md sm:text-lg", children: name }),
|
|
133
|
+
collection.totalSupply != null && /* @__PURE__ */ jsxs("span", { className: "rounded-full bg-black/30 px-3 py-1 text-xs font-medium tabular-nums text-white backdrop-blur-md", children: [
|
|
134
|
+
collection.totalSupply.toLocaleString(),
|
|
135
|
+
" ",
|
|
136
|
+
collection.totalSupply === 1 ? "item" : "items"
|
|
137
|
+
] })
|
|
138
|
+
] })
|
|
132
139
|
]
|
|
133
140
|
}
|
|
134
141
|
)
|
|
@@ -138,26 +145,8 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
|
|
|
138
145
|
})
|
|
139
146
|
}
|
|
140
147
|
),
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
|
|
143
|
-
{
|
|
144
|
-
"aria-live": paused ? "polite" : "off",
|
|
145
|
-
className: "relative mt-8 flex flex-col items-center gap-1 text-center",
|
|
146
|
-
initial: reduceMotion ? false : { opacity: 0, y: 8 },
|
|
147
|
-
animate: { opacity: 1, y: 0 },
|
|
148
|
-
transition: { duration: 0.4 },
|
|
149
|
-
children: [
|
|
150
|
-
/* @__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" }) }),
|
|
151
|
-
supply != null && /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
152
|
-
supply.toLocaleString(),
|
|
153
|
-
" ",
|
|
154
|
-
supply === 1 ? "item" : "items"
|
|
155
|
-
] })
|
|
156
|
-
]
|
|
157
|
-
},
|
|
158
|
-
active.contractAddress
|
|
159
|
-
),
|
|
160
|
-
count > 1 && /* @__PURE__ */ jsx("div", { className: "relative mt-3 flex justify-center", children: collections.map((collection, index) => /* @__PURE__ */ jsx(
|
|
148
|
+
/* @__PURE__ */ jsx("h2", { "aria-live": paused ? "polite" : "off", className: "sr-only", children: active.name ?? "Collection" }),
|
|
149
|
+
count > 1 && /* @__PURE__ */ jsx("div", { className: "relative mt-4 flex justify-center", children: collections.map((collection, index) => /* @__PURE__ */ jsx(
|
|
161
150
|
"button",
|
|
162
151
|
{
|
|
163
152
|
type: "button",
|
|
@@ -1 +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-[min(440px,60vh)] xl:max-w-[min(500px,62vh)]\";\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-20 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 [hidden, setHidden] = 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 const onVisibility = () => setHidden(document.hidden);\n document.addEventListener(\"visibilitychange\", onVisibility);\n return () => document.removeEventListener(\"visibilitychange\", onVisibility);\n }, []);\n\n useEffect(() => {\n if (count <= 1 || paused || hidden || reduceMotion) return;\n const id = setInterval(() => setCurrent((index) => (index + 1) % count), AUTOPLAY_MS);\n return () => clearInterval(id);\n }, [count, paused, hidden, 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-20 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 role=\"group\"\n aria-roledescription=\"carousel\"\n aria-label=\"Featured collections\"\n tabIndex={count > 1 ? 0 : -1}\n onKeyDown={(event) => {\n if (count <= 1) return;\n if (event.key === \"ArrowLeft\") { event.preventDefault(); go(-1); }\n else if (event.key === \"ArrowRight\") { event.preventDefault(); go(1); }\n }}\n className={cn(\"relative mx-auto touch-pan-y rounded-2xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-background\", 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-black/30 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 aria-live={paused ? \"polite\" : \"off\"}\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;AACzB,SAAS,UAAU;AACnB,SAAS,mBAAmB;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,qBAAC,aAAQ,WAAU,4BACjB;AAAA,wBAAC,YAAS,WAAW,GAAG,uBAAuB,SAAS,GAAG;AAAA,IAC3D,oBAAC,YAAS,WAAU,yBAAwB;AAAA,KAC9C;AAEJ;AAEO,SAAS,mBAAmB,EAAE,aAAa,WAAW,QAAQ,GAA4B;AAC/F,QAAM,eAAe,YAAY;AACjC,QAAM,eAAe,iBAAiB;AACtC,QAAM,CAAC,SAAS,UAAU,I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C,8BAAC,QAAG,WAAU,+FACX,iBAAO,QAAQ,cAClB,GACF;AAAA,cACC,UAAU,QACT,qBAAC,OAAE,WAAU,iCACV;AAAA,uBAAO,eAAe;AAAA,gBAAE;AAAA,gBAAE,WAAW,IAAI,SAAS;AAAA,iBACrD;AAAA;AAAA;AAAA,UAfG,OAAO;AAAA,QAiBd;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
|
+
{"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-[min(440px,60vh)] xl:max-w-[min(500px,62vh)]\";\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-20 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 [hidden, setHidden] = 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 const onVisibility = () => setHidden(document.hidden);\n document.addEventListener(\"visibilitychange\", onVisibility);\n return () => document.removeEventListener(\"visibilitychange\", onVisibility);\n }, []);\n\n useEffect(() => {\n if (count <= 1 || paused || hidden || reduceMotion) return;\n const id = setInterval(() => setCurrent((index) => (index + 1) % count), AUTOPLAY_MS);\n return () => clearInterval(id);\n }, [count, paused, hidden, 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 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-20 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 role=\"group\"\n aria-roledescription=\"carousel\"\n aria-label=\"Featured collections\"\n tabIndex={count > 1 ? 0 : -1}\n onKeyDown={(event) => {\n if (count <= 1) return;\n if (event.key === \"ArrowLeft\") { event.preventDefault(); go(-1); }\n else if (event.key === \"ArrowRight\") { event.preventDefault(); go(1); }\n }}\n className={cn(\"relative mx-auto touch-pan-y rounded-2xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-background\", 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-black/30 transition-opacity duration-500\", offset === 0 ? \"opacity-0\" : \"opacity-100\")} />\n <span className=\"absolute inset-x-3 bottom-3 flex flex-col items-start gap-1.5\">\n <span className=\"max-w-full truncate rounded-full bg-black/30 px-4 py-1.5 text-base font-semibold leading-tight text-white backdrop-blur-md sm:text-lg\">\n {name}\n </span>\n {collection.totalSupply != null && (\n <span className=\"rounded-full bg-black/30 px-3 py-1 text-xs font-medium tabular-nums text-white backdrop-blur-md\">\n {collection.totalSupply.toLocaleString()} {collection.totalSupply === 1 ? \"item\" : \"items\"}\n </span>\n )}\n </span>\n </Link>\n </motion.div>\n );\n })}\n </motion.div>\n\n <h2 aria-live={paused ? \"polite\" : \"off\"} className=\"sr-only\">\n {active.name ?? \"Collection\"}\n </h2>\n\n {count > 1 && (\n <div className=\"relative mt-4 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;AACzB,SAAS,UAAU;AACnB,SAAS,mBAAmB;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,qBAAC,aAAQ,WA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AA,4BAAE,WAAW,gBAAgB,IAAI,SAAS;AAAA,6BACrF;AAAA,2BAEJ;AAAA;AAAA;AAAA,kBACF;AAAA;AAAA,gBAnCK,WAAW;AAAA,cAoClB;AAAA,YAEJ,CAAC;AAAA;AAAA,QACH;AAAA,QAEA,oBAAC,QAAG,aAAW,SAAS,WAAW,OAAO,WAAU,WACjD,iBAAO,QAAQ,cAClB;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 from 'react';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
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 |
|
|
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> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
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 |
|
|
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> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -16,6 +16,7 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
16
16
|
royalty: z.ZodNumber;
|
|
17
17
|
}, "strip", z.ZodTypeAny, {
|
|
18
18
|
name: string;
|
|
19
|
+
value: string;
|
|
19
20
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
|
|
20
21
|
licenseType: string;
|
|
21
22
|
commercialUse: "Yes" | "No";
|
|
@@ -24,12 +25,12 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
24
25
|
geographicScope: string;
|
|
25
26
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
26
27
|
royalty: number;
|
|
27
|
-
value: string;
|
|
28
28
|
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
32
32
|
name: string;
|
|
33
|
+
value: string;
|
|
33
34
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
|
|
34
35
|
licenseType: string;
|
|
35
36
|
commercialUse: "Yes" | "No";
|
|
@@ -38,7 +39,6 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
38
39
|
geographicScope: string;
|
|
39
40
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
40
41
|
royalty: number;
|
|
41
|
-
value: string;
|
|
42
42
|
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
@@ -16,6 +16,7 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
16
16
|
royalty: z.ZodNumber;
|
|
17
17
|
}, "strip", z.ZodTypeAny, {
|
|
18
18
|
name: string;
|
|
19
|
+
value: string;
|
|
19
20
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
|
|
20
21
|
licenseType: string;
|
|
21
22
|
commercialUse: "Yes" | "No";
|
|
@@ -24,12 +25,12 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
24
25
|
geographicScope: string;
|
|
25
26
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
26
27
|
royalty: number;
|
|
27
|
-
value: string;
|
|
28
28
|
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
32
32
|
name: string;
|
|
33
|
+
value: string;
|
|
33
34
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
|
|
34
35
|
licenseType: string;
|
|
35
36
|
commercialUse: "Yes" | "No";
|
|
@@ -38,7 +39,6 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
38
39
|
geographicScope: string;
|
|
39
40
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
40
41
|
royalty: number;
|
|
41
|
-
value: string;
|
|
42
42
|
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
10
10
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
overlayClassName?: string;
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
10
10
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
overlayClassName?: string;
|