@medialane/ui 0.361.0 → 0.362.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.
@@ -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?: "ghost" | "link" | "default" | "destructive" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
6
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
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> {
@@ -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?: "ghost" | "link" | "default" | "destructive" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
6
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
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> {
@@ -75,7 +75,6 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
75
75
  if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShowcaseSkeleton, {});
76
76
  if (count === 0) return null;
77
77
  const active = collections[current % count];
78
- const activeImage = resolveImage(active.image, { width: 960 });
79
78
  const transition = reduceMotion ? { duration: 0 } : { type: "spring", stiffness: 220, damping: 26 };
80
79
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
81
80
  "section",
@@ -86,18 +85,22 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
86
85
  onFocus: () => setPaused(true),
87
86
  onBlur: () => setPaused(false),
88
87
  children: [
89
- activeImage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
- import_framer_motion.motion.div,
91
- {
92
- "aria-hidden": true,
93
- className: "pointer-events-none absolute inset-0 scale-125 opacity-30 blur-3xl dark:opacity-40",
94
- initial: reduceMotion ? false : { opacity: 0 },
95
- animate: { opacity: 1 },
96
- transition: { duration: 0.6 },
97
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: activeImage, alt: "", fill: true, className: "object-cover", unoptimized: true })
98
- },
99
- active.contractAddress
100
- ),
88
+ collections.map((collection, index) => {
89
+ const haloImage = resolveImage(collection.image, { width: 960 });
90
+ if (!haloImage) return null;
91
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
+ import_framer_motion.motion.div,
93
+ {
94
+ "aria-hidden": true,
95
+ className: "pointer-events-none absolute inset-0 scale-125 blur-3xl",
96
+ initial: false,
97
+ animate: { opacity: index === current ? 1 : 0 },
98
+ transition: { duration: reduceMotion ? 0 : 0.8 },
99
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: haloImage, alt: "", fill: true, className: "object-cover", unoptimized: true })
100
+ },
101
+ collection.contractAddress
102
+ );
103
+ }),
101
104
  /* @__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" }),
102
105
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
103
106
  import_framer_motion.motion.div,
@@ -157,7 +160,7 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
157
160
  onClick: (event) => {
158
161
  if (dragged.current) event.preventDefault();
159
162
  },
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",
163
+ className: "relative block h-full w-full overflow-hidden rounded-2xl bg-muted shadow-2xl shadow-black/20 dark:shadow-black/50",
161
164
  children: [
162
165
  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" }),
163
166
  /* @__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") }),
@@ -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 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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W;AAAA,cAoClB;AAAA,YAEJ,CAAC;AAAA;AAAA,QACH;AAAA,QAEA,4CAAC,QAAG,aAAW,SAAS,WAAW,OAAO,WAAU,WACjD,iBAAO,QAAQ,cAClB;AAAA,QAEC,QAAQ,KACP,4CAAC,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,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 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 {collections.map((collection, index) => {\n const haloImage = resolveImage(collection.image, { width: 960 });\n if (!haloImage) return null;\n return (\n <motion.div\n key={collection.contractAddress}\n aria-hidden\n className=\"pointer-events-none absolute inset-0 scale-125 blur-3xl\"\n initial={false}\n animate={{ opacity: index === current ? 1 : 0 }}\n transition={{ duration: reduceMotion ? 0 : 0.8 }}\n >\n <Image src={haloImage} alt=\"\" fill className=\"object-cover\" unoptimized />\n </motion.div>\n );\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 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,4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CAAC,UAAK,WAAU,mGACb;AAAA,uCAAW,YAAY,eAAe;AAAA,4BAAE;AAAA,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,4CAAC,QAAG,aAAW,SAAS,WAAW,OAAO,WAAU,WACjD,iBAAO,QAAQ,cAClB;AAAA,QAEC,QAAQ,KACP,4CAAC,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,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"]}
@@ -42,7 +42,6 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
42
42
  if (isLoading) return /* @__PURE__ */ jsx(ShowcaseSkeleton, {});
43
43
  if (count === 0) return null;
44
44
  const active = collections[current % count];
45
- const activeImage = resolveImage(active.image, { width: 960 });
46
45
  const transition = reduceMotion ? { duration: 0 } : { type: "spring", stiffness: 220, damping: 26 };
47
46
  return /* @__PURE__ */ jsxs(
48
47
  "section",
@@ -53,18 +52,22 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
53
52
  onFocus: () => setPaused(true),
54
53
  onBlur: () => setPaused(false),
55
54
  children: [
56
- activeImage && /* @__PURE__ */ jsx(
57
- motion.div,
58
- {
59
- "aria-hidden": true,
60
- className: "pointer-events-none absolute inset-0 scale-125 opacity-30 blur-3xl dark:opacity-40",
61
- initial: reduceMotion ? false : { opacity: 0 },
62
- animate: { opacity: 1 },
63
- transition: { duration: 0.6 },
64
- children: /* @__PURE__ */ jsx(Image, { src: activeImage, alt: "", fill: true, className: "object-cover", unoptimized: true })
65
- },
66
- active.contractAddress
67
- ),
55
+ collections.map((collection, index) => {
56
+ const haloImage = resolveImage(collection.image, { width: 960 });
57
+ if (!haloImage) return null;
58
+ return /* @__PURE__ */ jsx(
59
+ motion.div,
60
+ {
61
+ "aria-hidden": true,
62
+ className: "pointer-events-none absolute inset-0 scale-125 blur-3xl",
63
+ initial: false,
64
+ animate: { opacity: index === current ? 1 : 0 },
65
+ transition: { duration: reduceMotion ? 0 : 0.8 },
66
+ children: /* @__PURE__ */ jsx(Image, { src: haloImage, alt: "", fill: true, className: "object-cover", unoptimized: true })
67
+ },
68
+ collection.contractAddress
69
+ );
70
+ }),
68
71
  /* @__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" }),
69
72
  /* @__PURE__ */ jsx(
70
73
  motion.div,
@@ -124,7 +127,7 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
124
127
  onClick: (event) => {
125
128
  if (dragged.current) event.preventDefault();
126
129
  },
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",
130
+ className: "relative block h-full w-full overflow-hidden rounded-2xl bg-muted shadow-2xl shadow-black/20 dark:shadow-black/50",
128
131
  children: [
129
132
  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" }),
130
133
  /* @__PURE__ */ jsx("span", { className: cn("absolute inset-0 bg-black/30 transition-opacity duration-500", offset === 0 ? "opacity-0" : "opacity-100") }),
@@ -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 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,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,IAAI,SAAS,CAAC;AACxC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,UAAU,OAAO,KAAK;AAC5B,QAAM,QAAQ,YAAY;AAE1B,QAAM,KAAK,CAAC,SAAiB,WAAW,CAAC,WAAW,QAAQ,OAAO,SAAS,KAAK;AAEjF,YAAU,MAAM;AACd,UAAM,eAAe,MAAM,UAAU,SAAS,MAAM;AACpD,aAAS,iBAAiB,oBAAoB,YAAY;AAC1D,WA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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 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 {collections.map((collection, index) => {\n const haloImage = resolveImage(collection.image, { width: 960 });\n if (!haloImage) return null;\n return (\n <motion.div\n key={collection.contractAddress}\n aria-hidden\n className=\"pointer-events-none absolute inset-0 scale-125 blur-3xl\"\n initial={false}\n animate={{ opacity: index === current ? 1 : 0 }}\n transition={{ duration: reduceMotion ? 0 : 0.8 }}\n >\n <Image src={haloImage} alt=\"\" fill className=\"object-cover\" unoptimized />\n </motion.div>\n );\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 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,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,IAAI,SAAS,CAAC;AACxC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,UAAU,OAAO,KAAK;AAC5B,QAAM,QAAQ,YAAY;AAE1B,QAAM,KAAK,CAAC,SAAiB,WAAW,CAAC,WAAW,QAAQ,OAAO,SAAS,KAAK;AAEjF,YAAU,MAAM;AACd,UAAM,eAAe,MAAM,UAAU,SAAS,MAAM;AACpD,aAAS,iBA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U;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> | react_jsx_runtime.JSX.Element | 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> | react_jsx_runtime.JSX.Element | 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 };
@@ -16,30 +16,30 @@ declare const editionMintSchema: z.ZodObject<{
16
16
  royalty: z.ZodNumber;
17
17
  }, "strip", z.ZodTypeAny, {
18
18
  name: string;
19
- value: string;
20
19
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
21
20
  licenseType: string;
22
21
  commercialUse: "Yes" | "No";
22
+ value: string;
23
+ recipient: string;
23
24
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
24
25
  attribution: "Required" | "Not Required";
25
26
  geographicScope: string;
26
27
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
27
28
  royalty: number;
28
- recipient: string;
29
29
  description?: string | undefined;
30
30
  external_url?: string | undefined;
31
31
  }, {
32
32
  name: string;
33
- value: string;
34
33
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
35
34
  licenseType: string;
36
35
  commercialUse: "Yes" | "No";
36
+ value: string;
37
+ recipient: string;
37
38
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
38
39
  attribution: "Required" | "Not Required";
39
40
  geographicScope: string;
40
41
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
41
42
  royalty: number;
42
- recipient: string;
43
43
  description?: string | undefined;
44
44
  external_url?: string | undefined;
45
45
  }>;
@@ -16,30 +16,30 @@ declare const editionMintSchema: z.ZodObject<{
16
16
  royalty: z.ZodNumber;
17
17
  }, "strip", z.ZodTypeAny, {
18
18
  name: string;
19
- value: string;
20
19
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
21
20
  licenseType: string;
22
21
  commercialUse: "Yes" | "No";
22
+ value: string;
23
+ recipient: string;
23
24
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
24
25
  attribution: "Required" | "Not Required";
25
26
  geographicScope: string;
26
27
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
27
28
  royalty: number;
28
- recipient: string;
29
29
  description?: string | undefined;
30
30
  external_url?: string | undefined;
31
31
  }, {
32
32
  name: string;
33
- value: string;
34
33
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
35
34
  licenseType: string;
36
35
  commercialUse: "Yes" | "No";
36
+ value: string;
37
+ recipient: string;
37
38
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
38
39
  attribution: "Required" | "Not Required";
39
40
  geographicScope: string;
40
41
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
41
42
  royalty: number;
42
- recipient: string;
43
43
  description?: string | undefined;
44
44
  external_url?: string | undefined;
45
45
  }>;
@@ -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?: "left" | "right" | "bottom" | "top" | null | undefined;
13
+ side?: "top" | "right" | "bottom" | "left" | 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?: "left" | "right" | "bottom" | "top" | null | undefined;
13
+ side?: "top" | "right" | "bottom" | "left" | 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;
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
7
7
  rawBalance: bigint | null;
8
8
  isLoading: boolean;
9
9
  error: any;
10
- decimals: 8 | 6 | 18;
10
+ decimals: 6 | 8 | 18;
11
11
  };
12
12
  declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
13
13
 
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
7
7
  rawBalance: bigint | null;
8
8
  isLoading: boolean;
9
9
  error: any;
10
- decimals: 8 | 6 | 18;
10
+ decimals: 6 | 8 | 18;
11
11
  };
12
12
  declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
13
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medialane/ui",
3
- "version": "0.361.0",
3
+ "version": "0.362.0",
4
4
  "description": "Shared UI components for Medialane apps",
5
5
  "type": "module",
6
6
  "sideEffects": false,