@medialane/ui 0.410.0 → 0.411.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.
Files changed (61) hide show
  1. package/dist/components/activity-ticker.cjs +5 -4
  2. package/dist/components/activity-ticker.cjs.map +1 -1
  3. package/dist/components/activity-ticker.d.cts +1 -2
  4. package/dist/components/activity-ticker.d.ts +1 -2
  5. package/dist/components/activity-ticker.js +5 -4
  6. package/dist/components/activity-ticker.js.map +1 -1
  7. package/dist/components/asset-page.cjs +1 -2
  8. package/dist/components/asset-page.cjs.map +1 -1
  9. package/dist/components/asset-page.js +1 -2
  10. package/dist/components/asset-page.js.map +1 -1
  11. package/dist/components/asset-top-sections.cjs +6 -6
  12. package/dist/components/asset-top-sections.cjs.map +1 -1
  13. package/dist/components/asset-top-sections.d.cts +7 -3
  14. package/dist/components/asset-top-sections.d.ts +7 -3
  15. package/dist/components/asset-top-sections.js +6 -6
  16. package/dist/components/asset-top-sections.js.map +1 -1
  17. package/dist/components/collection-card.cjs +3 -2
  18. package/dist/components/collection-card.cjs.map +1 -1
  19. package/dist/components/collection-card.d.cts +1 -2
  20. package/dist/components/collection-card.d.ts +1 -2
  21. package/dist/components/collection-card.js +3 -2
  22. package/dist/components/collection-card.js.map +1 -1
  23. package/dist/components/collection-showcase.cjs +3 -2
  24. package/dist/components/collection-showcase.cjs.map +1 -1
  25. package/dist/components/collection-showcase.d.cts +1 -2
  26. package/dist/components/collection-showcase.d.ts +1 -2
  27. package/dist/components/collection-showcase.js +3 -2
  28. package/dist/components/collection-showcase.js.map +1 -1
  29. package/dist/components/discover-collections-strip.cjs.map +1 -1
  30. package/dist/components/discover-collections-strip.d.cts +0 -1
  31. package/dist/components/discover-collections-strip.d.ts +0 -1
  32. package/dist/components/discover-collections-strip.js.map +1 -1
  33. package/dist/components/discover-hero.cjs +2 -3
  34. package/dist/components/discover-hero.cjs.map +1 -1
  35. package/dist/components/discover-hero.d.cts +1 -2
  36. package/dist/components/discover-hero.d.ts +1 -2
  37. package/dist/components/discover-hero.js +2 -3
  38. package/dist/components/discover-hero.js.map +1 -1
  39. package/dist/components/discover-page.cjs +1 -5
  40. package/dist/components/discover-page.cjs.map +1 -1
  41. package/dist/components/discover-page.js +1 -5
  42. package/dist/components/discover-page.js.map +1 -1
  43. package/dist/components/home-page.cjs +2 -3
  44. package/dist/components/home-page.cjs.map +1 -1
  45. package/dist/components/home-page.js +2 -3
  46. package/dist/components/home-page.js.map +1 -1
  47. package/dist/components/launchpad/edition-mint.cjs +1 -1
  48. package/dist/components/launchpad/edition-mint.cjs.map +1 -1
  49. package/dist/components/launchpad/edition-mint.js +2 -2
  50. package/dist/components/launchpad/edition-mint.js.map +1 -1
  51. package/dist/components/parent-attribution-banner.cjs +3 -2
  52. package/dist/components/parent-attribution-banner.cjs.map +1 -1
  53. package/dist/components/parent-attribution-banner.d.cts +3 -1
  54. package/dist/components/parent-attribution-banner.d.ts +3 -1
  55. package/dist/components/parent-attribution-banner.js +3 -2
  56. package/dist/components/parent-attribution-banner.js.map +1 -1
  57. package/dist/components/service-collections-page.cjs +1 -2
  58. package/dist/components/service-collections-page.cjs.map +1 -1
  59. package/dist/components/service-collections-page.js +1 -2
  60. package/dist/components/service-collections-page.js.map +1 -1
  61. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Chain } from '@medialane/sdk';
2
3
 
3
4
  interface AssetMediaColumnProps {
4
5
  image: string | null;
@@ -16,10 +17,13 @@ interface AssetHeaderBlockProps {
16
17
  badges?: React.ReactNode;
17
18
  utilities?: React.ReactNode;
18
19
  description?: string | null;
19
- parentContract?: string | null;
20
- parentTokenId?: string | null;
20
+ parent?: {
21
+ chain: Chain;
22
+ contract: string;
23
+ tokenId: string;
24
+ } | null;
21
25
  }
22
- declare function AssetHeaderBlock({ name, badges, utilities, description, parentContract, parentTokenId, }: AssetHeaderBlockProps): react_jsx_runtime.JSX.Element;
26
+ declare function AssetHeaderBlock({ name, badges, utilities, description, parent, }: AssetHeaderBlockProps): react_jsx_runtime.JSX.Element;
23
27
  interface AssetOwnerRowProps {
24
28
  ownerAddress?: string | null;
25
29
  ownerHref?: string;
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Chain } from '@medialane/sdk';
2
3
 
3
4
  interface AssetMediaColumnProps {
4
5
  image: string | null;
@@ -16,10 +17,13 @@ interface AssetHeaderBlockProps {
16
17
  badges?: React.ReactNode;
17
18
  utilities?: React.ReactNode;
18
19
  description?: string | null;
19
- parentContract?: string | null;
20
- parentTokenId?: string | null;
20
+ parent?: {
21
+ chain: Chain;
22
+ contract: string;
23
+ tokenId: string;
24
+ } | null;
21
25
  }
22
- declare function AssetHeaderBlock({ name, badges, utilities, description, parentContract, parentTokenId, }: AssetHeaderBlockProps): react_jsx_runtime.JSX.Element;
26
+ declare function AssetHeaderBlock({ name, badges, utilities, description, parent, }: AssetHeaderBlockProps): react_jsx_runtime.JSX.Element;
23
27
  interface AssetOwnerRowProps {
24
28
  ownerAddress?: string | null;
25
29
  ownerHref?: string;
@@ -70,20 +70,20 @@ function AssetHeaderBlock({
70
70
  badges,
71
71
  utilities,
72
72
  description,
73
- parentContract,
74
- parentTokenId
73
+ parent
75
74
  }) {
76
75
  return /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
77
76
  badges || utilities ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 mb-2", children: [
78
77
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-wrap", children: badges }),
79
78
  utilities
80
79
  ] }) : null,
81
- parentContract && parentTokenId ? /* @__PURE__ */ jsx("div", { className: "mb-3", children: /* @__PURE__ */ jsx(
80
+ parent ? /* @__PURE__ */ jsx("div", { className: "mb-3", children: /* @__PURE__ */ jsx(
82
81
  ParentAttributionBanner,
83
82
  {
84
- parentContract,
85
- parentTokenId,
86
- parentName: `Token #${parentTokenId}`
83
+ chain: parent.chain,
84
+ parentContract: parent.contract,
85
+ parentTokenId: parent.tokenId,
86
+ parentName: `Token #${parent.tokenId}`
87
87
  }
88
88
  ) }) : null,
89
89
  /* @__PURE__ */ jsx("h1", { className: "text-2xl lg:text-4xl font-bold break-words", children: name }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/asset-top-sections.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { useEffect, useState } from \"react\";\nimport { useIntersectionActive } from \"../utils/use-intersection-active.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ParentAttributionBanner } from \"./parent-attribution-banner.js\";\nimport { IpTypeBadge } from \"./ip-type-badge.js\";\nimport { ExpandableText } from \"./expandable-text.js\";\nimport { useT } from \"../i18n/provider.js\";\n\ninterface AssetMediaColumnProps {\n image: string | null;\n imageAlt: string;\n imgError: boolean;\n onImageError: () => void;\n onImageLoad?: () => void;\n fallback: React.ReactNode;\n\n\n animationUrl?: string | null;\n\n live?: boolean;\n}\n\nexport function AssetMediaColumn({\n image,\n imageAlt,\n imgError,\n onImageError,\n onImageLoad,\n fallback,\n animationUrl,\n live = false,\n}: AssetMediaColumnProps) {\n const [ref, isVisible] = useIntersectionActive<HTMLDivElement>();\n const [loaded, setLoaded] = useState(false);\n useEffect(() => setLoaded(false), [image]);\n const showLive = live && !!animationUrl && isVisible;\n\n const markLoaded = () => {\n setLoaded(true);\n onImageLoad?.();\n };\n\n const shimmer = !loaded && (\n <div\n className=\"absolute inset-0 animate-[shimmer_1.6s_ease-in-out_infinite] bg-foreground/[0.06]\"\n style={{\n backgroundImage:\n \"linear-gradient(90deg, transparent, color-mix(in srgb, var(--foreground) 8%, transparent), transparent)\",\n backgroundSize: \"200% 100%\",\n }}\n />\n );\n\n return (\n <div ref={ref} className=\"w-full lg:sticky lg:top-16\">\n {showLive ? (\n <div className=\"w-full overflow-hidden rounded-2xl aspect-square\">\n <iframe\n src={animationUrl!}\n title={imageAlt}\n sandbox=\"allow-scripts\"\n loading=\"lazy\"\n className=\"w-full h-full border-0\"\n />\n </div>\n ) : !image || imgError ? (\n <div className=\"w-full overflow-hidden rounded-2xl\">{fallback}</div>\n ) : (\n <div className={cn(\"relative block w-full overflow-hidden rounded-2xl\", !loaded && \"aspect-square\")}>\n {shimmer}\n <img\n ref={(el) => {\n if (!loaded && el?.complete && el.naturalWidth > 0) markLoaded();\n }}\n src={image}\n alt={imageAlt}\n fetchPriority=\"high\"\n decoding=\"async\"\n onLoad={markLoaded}\n onError={onImageError}\n className=\"relative w-full h-auto max-h-[80vh] object-contain\"\n />\n </div>\n )}\n\n </div>\n );\n}\n\ninterface AssetHeaderBlockProps {\n name: string;\n badges?: React.ReactNode;\n utilities?: React.ReactNode;\n description?: string | null;\n parentContract?: string | null;\n parentTokenId?: string | null;\n}\n\nexport function AssetHeaderBlock({\n name,\n badges,\n utilities,\n description,\n parentContract,\n parentTokenId,\n}: AssetHeaderBlockProps) {\n return (\n <div className=\"min-w-0 flex-1\">\n {badges || utilities ? (\n <div className=\"flex items-center justify-between gap-2 mb-2\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n {badges}\n </div>\n {utilities}\n </div>\n ) : null}\n {parentContract && parentTokenId ? (\n <div className=\"mb-3\">\n <ParentAttributionBanner\n parentContract={parentContract}\n parentTokenId={parentTokenId}\n parentName={`Token #${parentTokenId}`}\n />\n </div>\n ) : null}\n <h1 className=\"text-2xl lg:text-4xl font-bold break-words\">{name}</h1>\n {description ? <ExpandableText text={description} className=\"mt-1\" /> : null}\n </div>\n );\n}\n\nexport interface AssetOwnerRowProps {\n ownerAddress?: string | null;\n ownerHref?: string;\n ipType?: string | null;\n}\n\nexport function AssetOwnerRow({ ownerAddress, ownerHref, ipType }: AssetOwnerRowProps) {\n const t = useT();\n if (!ownerAddress && !ipType) return null;\n return (\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs text-muted-foreground\">\n {ipType ? <IpTypeBadge ipType={ipType} size=\"md\" showLabel /> : null}\n {ownerAddress && ownerHref ? (\n <div className=\"flex items-center gap-1.5\">\n <span>{t(\"Owner\")}</span>\n <Link href={ownerHref} className=\"hover:text-primary transition-colors font-medium\">\n <AddressDisplay address={ownerAddress} />\n </Link>\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AA+CI,cAyBI,YAzBJ;AA7CJ,OAAO,UAAU;AACjB,SAAS,WAAW,gBAAgB;AACpC,SAAS,6BAA6B;AACtC,SAAS,UAAU;AACnB,SAAS,sBAAsB;AAC/B,SAAS,+BAA+B;AACxC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AAgBd,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AACT,GAA0B;AACxB,QAAM,CAAC,KAAK,SAAS,IAAI,sBAAsC;AAC/D,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,YAAU,MAAM,UAAU,KAAK,GAAG,CAAC,KAAK,CAAC;AACzC,QAAM,WAAW,QAAQ,CAAC,CAAC,gBAAgB;AAE3C,QAAM,aAAa,MAAM;AACvB,cAAU,IAAI;AACd,kBAAc;AAAA,EAChB;AAEA,QAAM,UAAU,CAAC,UACf;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO;AAAA,QACL,iBACE;AAAA,QACF,gBAAgB;AAAA,MAClB;AAAA;AAAA,EACF;AAGF,SACE,oBAAC,SAAI,KAAU,WAAU,8BACtB,qBACC,oBAAC,SAAI,WAAU,oDACb;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,OAAO;AAAA,MACP,SAAQ;AAAA,MACR,SAAQ;AAAA,MACR,WAAU;AAAA;AAAA,EACZ,GACF,IACE,CAAC,SAAS,WACZ,oBAAC,SAAI,WAAU,sCAAsC,oBA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WAAU,oDAC/B,8BAAC,kBAAe,SAAS,cAAc,GACzC;AAAA,OACF,IACE;AAAA,KACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/asset-top-sections.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { useEffect, useState } from \"react\";\nimport { useIntersectionActive } from \"../utils/use-intersection-active.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport type { Chain } from \"@medialane/sdk\";\nimport { ParentAttributionBanner } from \"./parent-attribution-banner.js\";\nimport { IpTypeBadge } from \"./ip-type-badge.js\";\nimport { ExpandableText } from \"./expandable-text.js\";\nimport { useT } from \"../i18n/provider.js\";\n\ninterface AssetMediaColumnProps {\n image: string | null;\n imageAlt: string;\n imgError: boolean;\n onImageError: () => void;\n onImageLoad?: () => void;\n fallback: React.ReactNode;\n\n\n animationUrl?: string | null;\n\n live?: boolean;\n}\n\nexport function AssetMediaColumn({\n image,\n imageAlt,\n imgError,\n onImageError,\n onImageLoad,\n fallback,\n animationUrl,\n live = false,\n}: AssetMediaColumnProps) {\n const [ref, isVisible] = useIntersectionActive<HTMLDivElement>();\n const [loaded, setLoaded] = useState(false);\n useEffect(() => setLoaded(false), [image]);\n const showLive = live && !!animationUrl && isVisible;\n\n const markLoaded = () => {\n setLoaded(true);\n onImageLoad?.();\n };\n\n const shimmer = !loaded && (\n <div\n className=\"absolute inset-0 animate-[shimmer_1.6s_ease-in-out_infinite] bg-foreground/[0.06]\"\n style={{\n backgroundImage:\n \"linear-gradient(90deg, transparent, color-mix(in srgb, var(--foreground) 8%, transparent), transparent)\",\n backgroundSize: \"200% 100%\",\n }}\n />\n );\n\n return (\n <div ref={ref} className=\"w-full lg:sticky lg:top-16\">\n {showLive ? (\n <div className=\"w-full overflow-hidden rounded-2xl aspect-square\">\n <iframe\n src={animationUrl!}\n title={imageAlt}\n sandbox=\"allow-scripts\"\n loading=\"lazy\"\n className=\"w-full h-full border-0\"\n />\n </div>\n ) : !image || imgError ? (\n <div className=\"w-full overflow-hidden rounded-2xl\">{fallback}</div>\n ) : (\n <div className={cn(\"relative block w-full overflow-hidden rounded-2xl\", !loaded && \"aspect-square\")}>\n {shimmer}\n <img\n ref={(el) => {\n if (!loaded && el?.complete && el.naturalWidth > 0) markLoaded();\n }}\n src={image}\n alt={imageAlt}\n fetchPriority=\"high\"\n decoding=\"async\"\n onLoad={markLoaded}\n onError={onImageError}\n className=\"relative w-full h-auto max-h-[80vh] object-contain\"\n />\n </div>\n )}\n\n </div>\n );\n}\n\ninterface AssetHeaderBlockProps {\n name: string;\n badges?: React.ReactNode;\n utilities?: React.ReactNode;\n description?: string | null;\n parent?: { chain: Chain; contract: string; tokenId: string } | null;\n}\n\nexport function AssetHeaderBlock({\n name,\n badges,\n utilities,\n description,\n parent,\n}: AssetHeaderBlockProps) {\n return (\n <div className=\"min-w-0 flex-1\">\n {badges || utilities ? (\n <div className=\"flex items-center justify-between gap-2 mb-2\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n {badges}\n </div>\n {utilities}\n </div>\n ) : null}\n {parent ? (\n <div className=\"mb-3\">\n <ParentAttributionBanner\n chain={parent.chain}\n parentContract={parent.contract}\n parentTokenId={parent.tokenId}\n parentName={`Token #${parent.tokenId}`}\n />\n </div>\n ) : null}\n <h1 className=\"text-2xl lg:text-4xl font-bold break-words\">{name}</h1>\n {description ? <ExpandableText text={description} className=\"mt-1\" /> : null}\n </div>\n );\n}\n\nexport interface AssetOwnerRowProps {\n ownerAddress?: string | null;\n ownerHref?: string;\n ipType?: string | null;\n}\n\nexport function AssetOwnerRow({ ownerAddress, ownerHref, ipType }: AssetOwnerRowProps) {\n const t = useT();\n if (!ownerAddress && !ipType) return null;\n return (\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs text-muted-foreground\">\n {ipType ? <IpTypeBadge ipType={ipType} size=\"md\" showLabel /> : null}\n {ownerAddress && ownerHref ? (\n <div className=\"flex items-center gap-1.5\">\n <span>{t(\"Owner\")}</span>\n <Link href={ownerHref} className=\"hover:text-primary transition-colors font-medium\">\n <AddressDisplay address={ownerAddress} />\n </Link>\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AAgDI,cAyBI,YAzBJ;AA9CJ,OAAO,UAAU;AACjB,SAAS,WAAW,gBAAgB;AACpC,SAAS,6BAA6B;AACtC,SAAS,UAAU;AACnB,SAAS,sBAAsB;AAE/B,SAAS,+BAA+B;AACxC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AAgBd,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AACT,GAA0B;AACxB,QAAM,CAAC,KAAK,SAAS,IAAI,sBAAsC;AAC/D,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,YAAU,MAAM,UAAU,KAAK,GAAG,CAAC,KAAK,CAAC;AACzC,QAAM,WAAW,QAAQ,CAAC,CAAC,gBAAgB;AAE3C,QAAM,aAAa,MAAM;AACvB,cAAU,IAAI;AACd,kBAAc;AAAA,EAChB;AAEA,QAAM,UAAU,CAAC,UACf;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO;AAAA,QACL,iBACE;AAAA,QACF,gBAAgB;AAAA,MAClB;AAAA;AAAA,EACF;AAGF,SACE,oBAAC,SAAI,KAAU,WAAU,8BACtB,qBACC,oBAAC,SAAI,WAAU,oDACb;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,OAAO;AAAA,MACP,SAAQ;AAAA,MACR,SAAQ;AAAA,MACR,WAAU;AAAA;AAAA,EACZ,GACF,IACE,CAAC,SAAS,WACZ,oBAAC,SAAI,WAAU,sCAAsC,oBAAS,IAE9D,qBAAC,SAAI,WAAW,GAAG,qDAAqD,CAAC,UAAU,eAAe,GAC/F;AAAA;AAAA,IACD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AA,OACF,IACE;AAAA,KACN;AAEJ;","names":[]}
@@ -42,6 +42,7 @@ var import_cn = require("../utils/cn.js");
42
42
  var import_format = require("../utils/format.js");
43
43
  var import_motion_primitives = require("./motion-primitives.js");
44
44
  var import_currency_icon = require("./currency-icon.js");
45
+ var import_sdk = require("@medialane/sdk");
45
46
  var import_use_image_url = require("../utils/use-image-url.js");
46
47
  var import_provider = require("../i18n/provider.js");
47
48
  var import_use_format = require("../i18n/use-format.js");
@@ -54,7 +55,7 @@ function parseFloorPrice(floor) {
54
55
  const amount = parts.slice(0, -1).join(" ");
55
56
  return { amount, symbol };
56
57
  }
57
- function CollectionCard({ collection, href, settingsHref, className }) {
58
+ function CollectionCard({ collection, settingsHref, className }) {
58
59
  const intl = (0, import_use_format.useFormat)();
59
60
  const t = (0, import_provider.useT)();
60
61
  const resolveImage = (0, import_use_image_url.useImageUrl)();
@@ -73,7 +74,7 @@ function CollectionCard({ collection, href, settingsHref, className }) {
73
74
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex h-7 w-7 items-center justify-center rounded-full bg-black/40 backdrop-blur-sm text-white/70 hover:text-white hover:bg-black/60 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Settings2, { className: "h-3.5 w-3.5" }) })
74
75
  }
75
76
  ),
76
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: href ?? `/collections/${collection.contractAddress}`, className: "block relative h-full", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative aspect-square w-full overflow-hidden bg-foreground/[0.04]", children: [
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_sdk.collectionHref)(collection.chain, collection.contractAddress), className: "block relative h-full", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative aspect-square w-full overflow-hidden bg-foreground/[0.04]", children: [
77
78
  showImage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
78
79
  import_image.default,
79
80
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/collection-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Loader2, Settings2 } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { MotionCard } from \"./motion-primitives.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nfunction parseFloorPrice(floor: string | null | undefined): { amount: string; symbol: string } | null {\n if (!floor) return null;\n const formatted = formatDisplayPrice(floor);\n const parts = formatted.trim().split(/\\s+/);\n if (parts.length < 2) return null;\n const symbol = parts[parts.length - 1];\n const amount = parts.slice(0, -1).join(\" \");\n return { amount, symbol };\n}\n\nexport interface CollectionCardProps {\n collection: ApiCollection;\n\n href?: string;\n\n settingsHref?: string;\n className?: string;\n}\n\nexport function CollectionCard({ collection, href, settingsHref, className }: CollectionCardProps) {\n const intl = useFormat();\n const t = useT();\n const resolveImage = useImageUrl();\n const [imgError, setImgError] = useState(false);\n const imageUrl = resolveImage(collection.image, { width: 480 });\n const showImage = imageUrl && !imgError;\n const floor = parseFloorPrice(collection.floorPrice);\n\n return (\n <MotionCard className={cn(\"group relative overflow-hidden rounded-2xl\", className)}>\n {settingsHref && (\n <Link\n href={settingsHref}\n onClick={(e) => e.stopPropagation()}\n className=\"absolute top-2 right-2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center\"\n aria-label={t(\"Collection settings\")}\n >\n <span className=\"flex h-7 w-7 items-center justify-center rounded-full bg-black/40 backdrop-blur-sm text-white/70 hover:text-white hover:bg-black/60 transition-colors\">\n <Settings2 className=\"h-3.5 w-3.5\" />\n </span>\n </Link>\n )}\n\n <Link href={href ?? `/collections/${collection.contractAddress}`} className=\"block relative h-full\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-foreground/[0.04]\">\n {showImage ? (\n <Image\n src={imageUrl}\n alt={collection.name ?? t(\"Collection\")}\n fill\n className=\"object-cover card-media\"\n onError={() => setImgError(true)}\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 bg-muted\" />\n )}\n\n <div className=\"absolute inset-x-2 bottom-2 flex flex-col items-start gap-1\">\n {!collection.name && collection.metadataStatus === \"PENDING\" ? (\n <span className=\"flex items-center gap-1 rounded-full px-2.5 py-1 text-2xs text-white bg-black/30 backdrop-blur-md\">\n <Loader2 className=\"h-2.5 w-2.5 animate-spin\" />\n {t(\"Indexing…\")}\n </span>\n ) : (\n <p className=\"max-w-full truncate rounded-full px-3 py-1 text-sm font-bold leading-tight text-white bg-black/30 backdrop-blur-md\">\n {collection.name ?? t(\"Unnamed collection\")}\n </p>\n )}\n\n {(collection.totalSupply != null || floor) && (\n <div className=\"flex flex-wrap items-center gap-1\">\n {collection.totalSupply != null && (\n <span className=\"rounded-full px-2.5 py-1 text-2xs font-medium text-white bg-black/30 backdrop-blur-md\">\n {intl.number(collection.totalSupply)}\n </span>\n )}\n {floor && (\n <span className=\"inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-2xs font-bold text-white bg-black/30 backdrop-blur-md\">\n <CurrencyIcon symbol={floor.symbol} size={10} />\n {floor.amount}\n </span>\n )}\n </div>\n )}\n </div>\n </div>\n </Link>\n </MotionCard>\n );\n}\n\nexport function CollectionCardSkeleton() {\n return (\n <div className=\"overflow-hidden rounded-2xl\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-foreground/[0.04]\">\n <div className=\"absolute inset-0 animate-pulse bg-foreground/[0.04]\" />\n <div className=\"absolute inset-x-2 bottom-2 flex flex-col items-start gap-1\">\n <div className=\"h-7 w-2/3 rounded-full bg-muted-foreground/20 animate-pulse\" />\n <div className=\"h-6 w-10 rounded-full bg-muted-foreground/20 animate-pul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../src/components/collection-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Loader2, Settings2 } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { MotionCard } from \"./motion-primitives.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { collectionHref, type ApiCollection, type Chain } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nfunction parseFloorPrice(floor: string | null | undefined): { amount: string; symbol: string } | null {\n if (!floor) return null;\n const formatted = formatDisplayPrice(floor);\n const parts = formatted.trim().split(/\\s+/);\n if (parts.length < 2) return null;\n const symbol = parts[parts.length - 1];\n const amount = parts.slice(0, -1).join(\" \");\n return { amount, symbol };\n}\n\nexport interface CollectionCardProps {\n collection: ApiCollection;\n\n settingsHref?: string;\n className?: string;\n}\n\nexport function CollectionCard({ collection, settingsHref, className }: CollectionCardProps) {\n const intl = useFormat();\n const t = useT();\n const resolveImage = useImageUrl();\n const [imgError, setImgError] = useState(false);\n const imageUrl = resolveImage(collection.image, { width: 480 });\n const showImage = imageUrl && !imgError;\n const floor = parseFloorPrice(collection.floorPrice);\n\n return (\n <MotionCard className={cn(\"group relative overflow-hidden rounded-2xl\", className)}>\n {settingsHref && (\n <Link\n href={settingsHref}\n onClick={(e) => e.stopPropagation()}\n className=\"absolute top-2 right-2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center\"\n aria-label={t(\"Collection settings\")}\n >\n <span className=\"flex h-7 w-7 items-center justify-center rounded-full bg-black/40 backdrop-blur-sm text-white/70 hover:text-white hover:bg-black/60 transition-colors\">\n <Settings2 className=\"h-3.5 w-3.5\" />\n </span>\n </Link>\n )}\n\n <Link href={collectionHref(collection.chain as Chain, collection.contractAddress)} className=\"block relative h-full\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-foreground/[0.04]\">\n {showImage ? (\n <Image\n src={imageUrl}\n alt={collection.name ?? t(\"Collection\")}\n fill\n className=\"object-cover card-media\"\n onError={() => setImgError(true)}\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 bg-muted\" />\n )}\n\n <div className=\"absolute inset-x-2 bottom-2 flex flex-col items-start gap-1\">\n {!collection.name && collection.metadataStatus === \"PENDING\" ? (\n <span className=\"flex items-center gap-1 rounded-full px-2.5 py-1 text-2xs text-white bg-black/30 backdrop-blur-md\">\n <Loader2 className=\"h-2.5 w-2.5 animate-spin\" />\n {t(\"Indexing…\")}\n </span>\n ) : (\n <p className=\"max-w-full truncate rounded-full px-3 py-1 text-sm font-bold leading-tight text-white bg-black/30 backdrop-blur-md\">\n {collection.name ?? t(\"Unnamed collection\")}\n </p>\n )}\n\n {(collection.totalSupply != null || floor) && (\n <div className=\"flex flex-wrap items-center gap-1\">\n {collection.totalSupply != null && (\n <span className=\"rounded-full px-2.5 py-1 text-2xs font-medium text-white bg-black/30 backdrop-blur-md\">\n {intl.number(collection.totalSupply)}\n </span>\n )}\n {floor && (\n <span className=\"inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-2xs font-bold text-white bg-black/30 backdrop-blur-md\">\n <CurrencyIcon symbol={floor.symbol} size={10} />\n {floor.amount}\n </span>\n )}\n </div>\n )}\n </div>\n </div>\n </Link>\n </MotionCard>\n );\n}\n\nexport function CollectionCardSkeleton() {\n return (\n <div className=\"overflow-hidden rounded-2xl\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-foreground/[0.04]\">\n <div className=\"absolute inset-0 animate-pulse bg-foreground/[0.04]\" />\n <div className=\"absolute inset-x-2 bottom-2 flex flex-col items-start gap-1\">\n <div className=\"h-7 w-2/3 rounded-full bg-muted-foreground/20 animate-pulse\" />\n <div className=\"h-6 w-10 rounded-full bg-muted-foreground/20 animate-pulse\" />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;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4
  interface CollectionCardProps {
5
5
  collection: ApiCollection;
6
- href?: string;
7
6
  settingsHref?: string;
8
7
  className?: string;
9
8
  }
10
- declare function CollectionCard({ collection, href, settingsHref, className }: CollectionCardProps): react_jsx_runtime.JSX.Element;
9
+ declare function CollectionCard({ collection, settingsHref, className }: CollectionCardProps): react_jsx_runtime.JSX.Element;
11
10
  declare function CollectionCardSkeleton(): react_jsx_runtime.JSX.Element;
12
11
 
13
12
  export { CollectionCard, type CollectionCardProps, CollectionCardSkeleton };
@@ -3,11 +3,10 @@ import { ApiCollection } from '@medialane/sdk';
3
3
 
4
4
  interface CollectionCardProps {
5
5
  collection: ApiCollection;
6
- href?: string;
7
6
  settingsHref?: string;
8
7
  className?: string;
9
8
  }
10
- declare function CollectionCard({ collection, href, settingsHref, className }: CollectionCardProps): react_jsx_runtime.JSX.Element;
9
+ declare function CollectionCard({ collection, settingsHref, className }: CollectionCardProps): react_jsx_runtime.JSX.Element;
11
10
  declare function CollectionCardSkeleton(): react_jsx_runtime.JSX.Element;
12
11
 
13
12
  export { CollectionCard, type CollectionCardProps, CollectionCardSkeleton };
@@ -8,6 +8,7 @@ import { cn } from "../utils/cn.js";
8
8
  import { formatDisplayPrice } from "../utils/format.js";
9
9
  import { MotionCard } from "./motion-primitives.js";
10
10
  import { CurrencyIcon } from "./currency-icon.js";
11
+ import { collectionHref } from "@medialane/sdk";
11
12
  import { useImageUrl } from "../utils/use-image-url.js";
12
13
  import { useT } from "../i18n/provider.js";
13
14
  import { useFormat } from "../i18n/use-format.js";
@@ -20,7 +21,7 @@ function parseFloorPrice(floor) {
20
21
  const amount = parts.slice(0, -1).join(" ");
21
22
  return { amount, symbol };
22
23
  }
23
- function CollectionCard({ collection, href, settingsHref, className }) {
24
+ function CollectionCard({ collection, settingsHref, className }) {
24
25
  const intl = useFormat();
25
26
  const t = useT();
26
27
  const resolveImage = useImageUrl();
@@ -39,7 +40,7 @@ function CollectionCard({ collection, href, settingsHref, className }) {
39
40
  children: /* @__PURE__ */ jsx("span", { className: "flex h-7 w-7 items-center justify-center rounded-full bg-black/40 backdrop-blur-sm text-white/70 hover:text-white hover:bg-black/60 transition-colors", children: /* @__PURE__ */ jsx(Settings2, { className: "h-3.5 w-3.5" }) })
40
41
  }
41
42
  ),
42
- /* @__PURE__ */ jsx(Link, { href: href ?? `/collections/${collection.contractAddress}`, className: "block relative h-full", children: /* @__PURE__ */ jsxs("div", { className: "relative aspect-square w-full overflow-hidden bg-foreground/[0.04]", children: [
43
+ /* @__PURE__ */ jsx(Link, { href: collectionHref(collection.chain, collection.contractAddress), className: "block relative h-full", children: /* @__PURE__ */ jsxs("div", { className: "relative aspect-square w-full overflow-hidden bg-foreground/[0.04]", children: [
43
44
  showImage ? /* @__PURE__ */ jsx(
44
45
  Image,
45
46
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/collection-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Loader2, Settings2 } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { MotionCard } from \"./motion-primitives.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nfunction parseFloorPrice(floor: string | null | undefined): { amount: string; symbol: string } | null {\n if (!floor) return null;\n const formatted = formatDisplayPrice(floor);\n const parts = formatted.trim().split(/\\s+/);\n if (parts.length < 2) return null;\n const symbol = parts[parts.length - 1];\n const amount = parts.slice(0, -1).join(\" \");\n return { amount, symbol };\n}\n\nexport interface CollectionCardProps {\n collection: ApiCollection;\n\n href?: string;\n\n settingsHref?: string;\n className?: string;\n}\n\nexport function CollectionCard({ collection, href, settingsHref, className }: CollectionCardProps) {\n const intl = useFormat();\n const t = useT();\n const resolveImage = useImageUrl();\n const [imgError, setImgError] = useState(false);\n const imageUrl = resolveImage(collection.image, { width: 480 });\n const showImage = imageUrl && !imgError;\n const floor = parseFloorPrice(collection.floorPrice);\n\n return (\n <MotionCard className={cn(\"group relative overflow-hidden rounded-2xl\", className)}>\n {settingsHref && (\n <Link\n href={settingsHref}\n onClick={(e) => e.stopPropagation()}\n className=\"absolute top-2 right-2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center\"\n aria-label={t(\"Collection settings\")}\n >\n <span className=\"flex h-7 w-7 items-center justify-center rounded-full bg-black/40 backdrop-blur-sm text-white/70 hover:text-white hover:bg-black/60 transition-colors\">\n <Settings2 className=\"h-3.5 w-3.5\" />\n </span>\n </Link>\n )}\n\n <Link href={href ?? `/collections/${collection.contractAddress}`} className=\"block relative h-full\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-foreground/[0.04]\">\n {showImage ? (\n <Image\n src={imageUrl}\n alt={collection.name ?? t(\"Collection\")}\n fill\n className=\"object-cover card-media\"\n onError={() => setImgError(true)}\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 bg-muted\" />\n )}\n\n <div className=\"absolute inset-x-2 bottom-2 flex flex-col items-start gap-1\">\n {!collection.name && collection.metadataStatus === \"PENDING\" ? (\n <span className=\"flex items-center gap-1 rounded-full px-2.5 py-1 text-2xs text-white bg-black/30 backdrop-blur-md\">\n <Loader2 className=\"h-2.5 w-2.5 animate-spin\" />\n {t(\"Indexing…\")}\n </span>\n ) : (\n <p className=\"max-w-full truncate rounded-full px-3 py-1 text-sm font-bold leading-tight text-white bg-black/30 backdrop-blur-md\">\n {collection.name ?? t(\"Unnamed collection\")}\n </p>\n )}\n\n {(collection.totalSupply != null || floor) && (\n <div className=\"flex flex-wrap items-center gap-1\">\n {collection.totalSupply != null && (\n <span className=\"rounded-full px-2.5 py-1 text-2xs font-medium text-white bg-black/30 backdrop-blur-md\">\n {intl.number(collection.totalSupply)}\n </span>\n )}\n {floor && (\n <span className=\"inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-2xs font-bold text-white bg-black/30 backdrop-blur-md\">\n <CurrencyIcon symbol={floor.symbol} size={10} />\n {floor.amount}\n </span>\n )}\n </div>\n )}\n </div>\n </div>\n </Link>\n </MotionCard>\n );\n}\n\nexport function CollectionCardSkeleton() {\n return (\n <div className=\"overflow-hidden rounded-2xl\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-foreground/[0.04]\">\n <div className=\"absolute inset-0 animate-pulse bg-foreground/[0.04]\" />\n <div className=\"absolute inset-x-2 bottom-2 flex flex-col items-start gap-1\">\n <div className=\"h-7 w-2/3 rounded-full bg-muted-foreground/20 animate-pulse\" />\n <div className=\"h-6 w-10 rounded-full bg-muted-foreground/20 animate-pulse\" />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AAqDY,cAsBE,YAtBF;AAnDZ,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,SAAS,iBAAiB;AACnC,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAE7B,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB,OAA6E;AACpG,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,YAAY,mBAAmB,KAAK;AAC1C,QAAM,QAAQ,UAAU,KAAK,EAAE,MAAM,KAAK;AAC1C,MAAI,MAAM,SAAS,EAAG,QAAO;AAC7B,QAAM,SAAS,MAAM,MAAM,SAAS,CAAC;AACrC,QAAM,SAAS,MAAM,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG;AAC1C,SAAO,EAAE,QAAQ,OAAO;AAC1B;AAWO,SAAS,eAAe,EAAE,YAAY,MAAM,cAAc,UAAU,GAAwB;AACjG,QAAM,OAAO,UAAU;AACvB,QAAM,IAAI,KAAK;AACf,QAAM,eAAe,YAAY;AACjC,QAAM,CAAC,UAAU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AAa,QAAQ,MAAM,QAAQ,MAAM,IAAI;AAAA,YAC7C,MAAM;AAAA,aACT;AAAA,WAEJ;AAAA,SAEJ;AAAA,OACF,GACF;AAAA,KACF;AAEJ;AAEO,SAAS,yBAAyB;AACvC,SACE,oBAAC,SAAI,WAAU,+BACb,+BAAC,SAAI,WAAU,sEACb;AAAA,wBAAC,SAAI,WAAU,uDAAsD;AAAA,IACrE,qBAAC,SAAI,WAAU,+DACb;AAAA,0BAAC,SAAI,WAAU,+DAA8D;AAAA,MAC7E,oBAAC,SAAI,WAAU,8DAA6D;AAAA,OAC9E;AAAA,KACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/collection-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Loader2, Settings2 } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { MotionCard } from \"./motion-primitives.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { collectionHref, type ApiCollection, type Chain } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nfunction parseFloorPrice(floor: string | null | undefined): { amount: string; symbol: string } | null {\n if (!floor) return null;\n const formatted = formatDisplayPrice(floor);\n const parts = formatted.trim().split(/\\s+/);\n if (parts.length < 2) return null;\n const symbol = parts[parts.length - 1];\n const amount = parts.slice(0, -1).join(\" \");\n return { amount, symbol };\n}\n\nexport interface CollectionCardProps {\n collection: ApiCollection;\n\n settingsHref?: string;\n className?: string;\n}\n\nexport function CollectionCard({ collection, settingsHref, className }: CollectionCardProps) {\n const intl = useFormat();\n const t = useT();\n const resolveImage = useImageUrl();\n const [imgError, setImgError] = useState(false);\n const imageUrl = resolveImage(collection.image, { width: 480 });\n const showImage = imageUrl && !imgError;\n const floor = parseFloorPrice(collection.floorPrice);\n\n return (\n <MotionCard className={cn(\"group relative overflow-hidden rounded-2xl\", className)}>\n {settingsHref && (\n <Link\n href={settingsHref}\n onClick={(e) => e.stopPropagation()}\n className=\"absolute top-2 right-2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center\"\n aria-label={t(\"Collection settings\")}\n >\n <span className=\"flex h-7 w-7 items-center justify-center rounded-full bg-black/40 backdrop-blur-sm text-white/70 hover:text-white hover:bg-black/60 transition-colors\">\n <Settings2 className=\"h-3.5 w-3.5\" />\n </span>\n </Link>\n )}\n\n <Link href={collectionHref(collection.chain as Chain, collection.contractAddress)} className=\"block relative h-full\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-foreground/[0.04]\">\n {showImage ? (\n <Image\n src={imageUrl}\n alt={collection.name ?? t(\"Collection\")}\n fill\n className=\"object-cover card-media\"\n onError={() => setImgError(true)}\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 bg-muted\" />\n )}\n\n <div className=\"absolute inset-x-2 bottom-2 flex flex-col items-start gap-1\">\n {!collection.name && collection.metadataStatus === \"PENDING\" ? (\n <span className=\"flex items-center gap-1 rounded-full px-2.5 py-1 text-2xs text-white bg-black/30 backdrop-blur-md\">\n <Loader2 className=\"h-2.5 w-2.5 animate-spin\" />\n {t(\"Indexing…\")}\n </span>\n ) : (\n <p className=\"max-w-full truncate rounded-full px-3 py-1 text-sm font-bold leading-tight text-white bg-black/30 backdrop-blur-md\">\n {collection.name ?? t(\"Unnamed collection\")}\n </p>\n )}\n\n {(collection.totalSupply != null || floor) && (\n <div className=\"flex flex-wrap items-center gap-1\">\n {collection.totalSupply != null && (\n <span className=\"rounded-full px-2.5 py-1 text-2xs font-medium text-white bg-black/30 backdrop-blur-md\">\n {intl.number(collection.totalSupply)}\n </span>\n )}\n {floor && (\n <span className=\"inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-2xs font-bold text-white bg-black/30 backdrop-blur-md\">\n <CurrencyIcon symbol={floor.symbol} size={10} />\n {floor.amount}\n </span>\n )}\n </div>\n )}\n </div>\n </div>\n </Link>\n </MotionCard>\n );\n}\n\nexport function CollectionCardSkeleton() {\n return (\n <div className=\"overflow-hidden rounded-2xl\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-foreground/[0.04]\">\n <div className=\"absolute inset-0 animate-pulse bg-foreground/[0.04]\" />\n <div className=\"absolute inset-x-2 bottom-2 flex flex-col items-start gap-1\">\n <div className=\"h-7 w-2/3 rounded-full bg-muted-foreground/20 animate-pulse\" />\n <div className=\"h-6 w-10 rounded-full bg-muted-foreground/20 animate-pulse\" />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AAmDY,cAsBE,YAtBF;AAjDZ,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,SAAS,iBAAiB;AACnC,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsD;AAC/D,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB,OAA6E;AACpG,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,YAAY,mBAAmB,KAAK;AAC1C,QAAM,QAAQ,UAAU,KAAK,EAAE,MAAM,KAAK;AAC1C,MAAI,MAAM,SAAS,EAAG,QAAO;AAC7B,QAAM,SAAS,MAAM,MAAM,SAAS,CAAC;AACrC,QAAM,SAAS,MAAM,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG;AAC1C,SAAO,EAAE,QAAQ,OAAO;AAC1B;AASO,SAAS,eAAe,EAAE,YAAY,cAAc,UAAU,GAAwB;AAC3F,QAAM,OAAO,UAAU;AACvB,QAAM,IAAI,KAAK;AACf,QAAM,eAAe,YAAY;AACjC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,WAAW,aAAa,WAAW,OAAO,EAAE,OAAO,IAAI,CAA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AAAA,SAEJ;AAAA,OACF,GACF;AAAA,KACF;AAEJ;AAEO,SAAS,yBAAyB;AACvC,SACE,oBAAC,SAAI,WAAU,+BACb,+BAAC,SAAI,WAAU,sEACb;AAAA,wBAAC,SAAI,WAAU,uDAAsD;AAAA,IACrE,qBAAC,SAAI,WAAU,+DACb;AAAA,0BAAC,SAAI,WAAU,+DAA8D;AAAA,MAC7E,oBAAC,SAAI,WAAU,8DAA6D;AAAA,OAC9E;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(collection_showcase_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = require("react");
37
37
  var import_framer_motion = require("framer-motion");
38
+ var import_sdk = require("@medialane/sdk");
38
39
  var import_link = __toESM(require("./link.js"), 1);
39
40
  var import_image = __toESM(require("./image.js"), 1);
40
41
  var import_skeleton = require("./skeleton.js");
@@ -55,7 +56,7 @@ function ShowcaseSkeleton() {
55
56
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "mx-auto mt-6 h-9 w-56" })
56
57
  ] });
57
58
  }
58
- function CollectionShowcase({ collections, isLoading, getHref }) {
59
+ function CollectionShowcase({ collections, isLoading }) {
59
60
  const intl = (0, import_use_format.useFormat)();
60
61
  const t = (0, import_provider.useT)();
61
62
  const resolveImage = (0, import_use_image_url.useImageUrl)();
@@ -158,7 +159,7 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
158
159
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
159
160
  import_link.default,
160
161
  {
161
- href: getHref(collection),
162
+ href: (0, import_sdk.collectionHref)(collection.chain, collection.contractAddress),
162
163
  "aria-label": name,
163
164
  draggable: false,
164
165
  onClick: (event) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/collection-showcase.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { m, 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\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.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 intl = useFormat();\n const t = useT();\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 <m.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 </m.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 <m.div\n role=\"group\"\n aria-roledescription=\"carousel\"\n aria-label={t(\"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 <m.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-muted\" />\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 {intl.number(collection.totalSupply)} {collection.totalSupply === 1 ? t(\"item\") : t(\"items\")}\n </span>\n )}\n </span>\n </Link>\n </m.div>\n );\n })}\n </m.div>\n\n <h2 aria-live={paused ? \"polite\" : \"off\"} className=\"sr-only\">\n {active.name ?? t(\"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={t(\"Show {name}\", { name: collection.name ?? t(\"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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,EAAE,CAAC;AAAA,YACzE,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 { m, useReducedMotion } from \"framer-motion\";\nimport { collectionHref, type ApiCollection, type Chain } 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\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nexport interface CollectionShowcaseProps {\n collections: ApiCollection[];\n isLoading: boolean;\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 }: CollectionShowcaseProps) {\n const intl = useFormat();\n const t = useT();\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 <m.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 </m.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 <m.div\n role=\"group\"\n aria-roledescription=\"carousel\"\n aria-label={t(\"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 <m.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={collectionHref(collection.chain as Chain, collection.contractAddress)}\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-muted\" />\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 {intl.number(collection.totalSupply)} {collection.totalSupply === 1 ? t(\"item\") : t(\"items\")}\n </span>\n )}\n </span>\n </Link>\n </m.div>\n );\n })}\n </m.div>\n\n <h2 aria-live={paused ? \"polite\" : \"off\"} className=\"sr-only\">\n {active.name ?? t(\"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={t(\"Show {name}\", { name: collection.name ?? t(\"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;AA6BI;AA3BJ,mBAA4C;AAC5C,2BAAoC;AACpC,iBAA+D;AAC/D,kBAAiB;AACjB,mBAAkB;AAClB,sBAAyB;AACzB,gBAAmB;AACnB,2BAA4B;AAC5B,sBAAqB;AACrB,wBAA0B;AAO1B,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,UAAU,GAA4B;AACtF,QAAM,WAAO,6BAAU;AACvB,QAAM,QAAI,sBAAK;AACf,QAAM,mBAAe,kCAAY;AACjC,QAAM,m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E,MAAM,IAAI,EAAE,OAAO;AAAA,6BAC7F;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,EAAE,YAAY,GAChC;AAAA,QAEC,QAAQ,KACP,4CAAC,SAAI,WAAU,qCACZ,sBAAY,IAAI,CAAC,YAAY,UAC5B;AAAA,UAAC;AAAA;AAAA,YAEC,MAAK;AAAA,YACL,cAAY,EAAE,eAAe,EAAE,MAAM,WAAW,QAAQ,EAAE,YAAY,EAAE,CAAC;AAAA,YACzE,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"]}
@@ -4,8 +4,7 @@ import { ApiCollection } from '@medialane/sdk';
4
4
  interface CollectionShowcaseProps {
5
5
  collections: ApiCollection[];
6
6
  isLoading: boolean;
7
- getHref: (collection: ApiCollection) => string;
8
7
  }
9
- declare function CollectionShowcase({ collections, isLoading, getHref }: CollectionShowcaseProps): react_jsx_runtime.JSX.Element | null;
8
+ declare function CollectionShowcase({ collections, isLoading }: CollectionShowcaseProps): react_jsx_runtime.JSX.Element | null;
10
9
 
11
10
  export { CollectionShowcase, type CollectionShowcaseProps };
@@ -4,8 +4,7 @@ import { ApiCollection } from '@medialane/sdk';
4
4
  interface CollectionShowcaseProps {
5
5
  collections: ApiCollection[];
6
6
  isLoading: boolean;
7
- getHref: (collection: ApiCollection) => string;
8
7
  }
9
- declare function CollectionShowcase({ collections, isLoading, getHref }: CollectionShowcaseProps): react_jsx_runtime.JSX.Element | null;
8
+ declare function CollectionShowcase({ collections, isLoading }: CollectionShowcaseProps): react_jsx_runtime.JSX.Element | null;
10
9
 
11
10
  export { CollectionShowcase, type CollectionShowcaseProps };
@@ -2,6 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useRef, useState } from "react";
4
4
  import { m, useReducedMotion } from "framer-motion";
5
+ import { collectionHref } from "@medialane/sdk";
5
6
  import Link from "./link.js";
6
7
  import Image from "./image.js";
7
8
  import { Skeleton } from "./skeleton.js";
@@ -22,7 +23,7 @@ function ShowcaseSkeleton() {
22
23
  /* @__PURE__ */ jsx(Skeleton, { className: "mx-auto mt-6 h-9 w-56" })
23
24
  ] });
24
25
  }
25
- function CollectionShowcase({ collections, isLoading, getHref }) {
26
+ function CollectionShowcase({ collections, isLoading }) {
26
27
  const intl = useFormat();
27
28
  const t = useT();
28
29
  const resolveImage = useImageUrl();
@@ -125,7 +126,7 @@ function CollectionShowcase({ collections, isLoading, getHref }) {
125
126
  children: /* @__PURE__ */ jsxs(
126
127
  Link,
127
128
  {
128
- href: getHref(collection),
129
+ href: collectionHref(collection.chain, collection.contractAddress),
129
130
  "aria-label": name,
130
131
  draggable: false,
131
132
  onClick: (event) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/collection-showcase.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { m, 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\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.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 intl = useFormat();\n const t = useT();\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 <m.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 </m.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 <m.div\n role=\"group\"\n aria-roledescription=\"carousel\"\n aria-label={t(\"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 <m.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-muted\" />\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 {intl.number(collection.totalSupply)} {collection.totalSupply === 1 ? t(\"item\") : t(\"items\")}\n </span>\n )}\n </span>\n </Link>\n </m.div>\n );\n })}\n </m.div>\n\n <h2 aria-live={paused ? \"polite\" : \"off\"} className=\"sr-only\">\n {active.name ?? t(\"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={t(\"Show {name}\", { name: collection.name ?? t(\"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":";AA8BI,SACE,KADF;AA5BJ,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,GAAG,wBAAwB;AAEpC,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB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ACC,oBAAC,SAAM,KAAK,OAAO,KAAI,IAAG,MAAI,MAAC,OAAM,mCAAkC,WAAU,gBAAe,UAAU,UAAU,GAAG,aAAW,MAAC,IAEnI,oBAAC,SAAI,WAAU,6BAA4B;AAAA,wBAE7C,oBAAC,UAAK,WAAW,GAAG,gEAAgE,WAAW,IAAI,cAAc,aAAa,GAAG;AAAA,wBACjI,qBAAC,UAAK,WAAU,iEACd;AAAA,8CAAC,UAAK,WAAU,yIACb,gBACH;AAAA,0BACC,WAAW,eAAe,QACzB,qBAAC,UAAK,WAAU,mGACb;AAAA,iCAAK,OAAO,WAAW,WAAW;AAAA,4BAAE;AAAA,4BAAE,WAAW,gBAAgB,IAAI,EAAE,MAAM,IAAI,EAAE,OAAO;AAAA,6BAC7F;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,EAAE,YAAY,GAChC;AAAA,QAEC,QAAQ,KACP,oBAAC,SAAI,WAAU,qCACZ,sBAAY,IAAI,CAAC,YAAY,UAC5B;AAAA,UAAC;AAAA;AAAA,YAEC,MAAK;AAAA,YACL,cAAY,EAAE,eAAe,EAAE,MAAM,WAAW,QAAQ,EAAE,YAAY,EAAE,CAAC;AAAA,YACzE,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 { m, useReducedMotion } from \"framer-motion\";\nimport { collectionHref, type ApiCollection, type Chain } 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\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nexport interface CollectionShowcaseProps {\n collections: ApiCollection[];\n isLoading: boolean;\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 }: CollectionShowcaseProps) {\n const intl = useFormat();\n const t = useT();\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 <m.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 </m.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 <m.div\n role=\"group\"\n aria-roledescription=\"carousel\"\n aria-label={t(\"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 <m.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={collectionHref(collection.chain as Chain, collection.contractAddress)}\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-muted\" />\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 {intl.number(collection.totalSupply)} {collection.totalSupply === 1 ? t(\"item\") : t(\"items\")}\n </span>\n )}\n </span>\n </Link>\n </m.div>\n );\n })}\n </m.div>\n\n <h2 aria-live={paused ? \"polite\" : \"off\"} className=\"sr-only\">\n {active.name ?? t(\"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={t(\"Show {name}\", { name: collection.name ?? t(\"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":";AA6BI,SACE,KADF;AA3BJ,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,GAAG,wBAAwB;AACpC,SAAS,sBAAsD;AAC/D,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAO1B,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,UAAU,GAA4B;AACtF,QAAM,OAAO,UAAU;AACvB,QAAM,IAAI,KAAK;AACf,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,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QAAQ,EAAE,YAAY,EAAE,CAAC;AAAA,YACzE,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 +1 @@
1
- {"version":3,"sources":["../../src/components/discover-collections-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport { useT } from \"../i18n/provider.js\";\nimport { Layers } from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\n\nimport { msg } from \"../i18n/translate.js\";\nexport interface DiscoverCollectionsStripProps {\n collections: ApiCollection[];\n isLoading: boolean;\n\n getHref?: (collection: ApiCollection) => string;\n allCollectionsHref?: string;\n\n sectionLabel?: string;\n title?: string;\n icon?: React.ReactNode;\n}\n\nexport function DiscoverCollectionsStrip({\n collections,\n isLoading,\n allCollectionsHref = \"/collections\",\n title = msg(\"Collections\"),\n icon = <Layers />,\n}: DiscoverCollectionsStripProps) {\n const t = useT();\n return (\n <ScrollSection\n icon={icon}\n title={t(title)}\n href={allCollectionsHref}\n linkLabel={msg(\"View all\")}\n >\n {isLoading\n ? Array.from({ length: 5 }).map((_, i) => (\n <div key={i} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <CollectionCardSkeleton />\n </div>\n ))\n : collections.map((col) => (\n <div key={col.contractAddress} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <CollectionCard collection={col} />\n </div>\n ))}\n </ScrollSection>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BS;AAxBT,sBAAqB;AACrB,0BAAuB;AACvB,4BAA8B;AAC9B,6BAAuD;AAGvD,uBAAoB;AAab,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA;AAAA,EACA,qBAAqB;AAAA,EACrB,YAAQ,sBAAI,aAAa;AAAA,EACzB,OAAO,4CAAC,8BAAO;AACjB,GAAkC;AAChC,QAAM,QAAI,sBAAK;AACf,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAO,EAAE,KAAK;AAAA,MACd,MAAM;AAAA,MACN,eAAW,sBAAI,UAAU;AAAA,MAExB,sBACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAChC,4CAAC,SAAY,WAAU,oCACrB,sDAAC,iDAAuB,KADhB,CAEV,CACD,IACD,YAAY,IAAI,CAAC,QACf,4CAAC,SAA8B,WAAU,oCACvC,sDAAC,yCAAe,YAAY,KAAK,KADzB,IAAI,eAEd,CACD;AAAA;AAAA,EACP;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/discover-collections-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport { useT } from \"../i18n/provider.js\";\nimport { Layers } from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\n\nimport { msg } from \"../i18n/translate.js\";\nexport interface DiscoverCollectionsStripProps {\n collections: ApiCollection[];\n isLoading: boolean;\n\n allCollectionsHref?: string;\n\n sectionLabel?: string;\n title?: string;\n icon?: React.ReactNode;\n}\n\nexport function DiscoverCollectionsStrip({\n collections,\n isLoading,\n allCollectionsHref = \"/collections\",\n title = msg(\"Collections\"),\n icon = <Layers />,\n}: DiscoverCollectionsStripProps) {\n const t = useT();\n return (\n <ScrollSection\n icon={icon}\n title={t(title)}\n href={allCollectionsHref}\n linkLabel={msg(\"View all\")}\n >\n {isLoading\n ? Array.from({ length: 5 }).map((_, i) => (\n <div key={i} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <CollectionCardSkeleton />\n </div>\n ))\n : collections.map((col) => (\n <div key={col.contractAddress} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <CollectionCard collection={col} />\n </div>\n ))}\n </ScrollSection>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBS;AAvBT,sBAAqB;AACrB,0BAAuB;AACvB,4BAA8B;AAC9B,6BAAuD;AAGvD,uBAAoB;AAYb,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA;AAAA,EACA,qBAAqB;AAAA,EACrB,YAAQ,sBAAI,aAAa;AAAA,EACzB,OAAO,4CAAC,8BAAO;AACjB,GAAkC;AAChC,QAAM,QAAI,sBAAK;AACf,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAO,EAAE,KAAK;AAAA,MACd,MAAM;AAAA,MACN,eAAW,sBAAI,UAAU;AAAA,MAExB,sBACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAChC,4CAAC,SAAY,WAAU,oCACrB,sDAAC,iDAAuB,KADhB,CAEV,CACD,IACD,YAAY,IAAI,CAAC,QACf,4CAAC,SAA8B,WAAU,oCACvC,sDAAC,yCAAe,YAAY,KAAK,KADzB,IAAI,eAEd,CACD;AAAA;AAAA,EACP;AAEJ;","names":[]}
@@ -4,7 +4,6 @@ import { ApiCollection } from '@medialane/sdk';
4
4
  interface DiscoverCollectionsStripProps {
5
5
  collections: ApiCollection[];
6
6
  isLoading: boolean;
7
- getHref?: (collection: ApiCollection) => string;
8
7
  allCollectionsHref?: string;
9
8
  sectionLabel?: string;
10
9
  title?: string;
@@ -4,7 +4,6 @@ import { ApiCollection } from '@medialane/sdk';
4
4
  interface DiscoverCollectionsStripProps {
5
5
  collections: ApiCollection[];
6
6
  isLoading: boolean;
7
- getHref?: (collection: ApiCollection) => string;
8
7
  allCollectionsHref?: string;
9
8
  sectionLabel?: string;
10
9
  title?: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/discover-collections-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport { useT } from \"../i18n/provider.js\";\nimport { Layers } from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\n\nimport { msg } from \"../i18n/translate.js\";\nexport interface DiscoverCollectionsStripProps {\n collections: ApiCollection[];\n isLoading: boolean;\n\n getHref?: (collection: ApiCollection) => string;\n allCollectionsHref?: string;\n\n sectionLabel?: string;\n title?: string;\n icon?: React.ReactNode;\n}\n\nexport function DiscoverCollectionsStrip({\n collections,\n isLoading,\n allCollectionsHref = \"/collections\",\n title = msg(\"Collections\"),\n icon = <Layers />,\n}: DiscoverCollectionsStripProps) {\n const t = useT();\n return (\n <ScrollSection\n icon={icon}\n title={t(title)}\n href={allCollectionsHref}\n linkLabel={msg(\"View all\")}\n >\n {isLoading\n ? Array.from({ length: 5 }).map((_, i) => (\n <div key={i} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <CollectionCardSkeleton />\n </div>\n ))\n : collections.map((col) => (\n <div key={col.contractAddress} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <CollectionCard collection={col} />\n </div>\n ))}\n </ScrollSection>\n );\n}\n"],"mappings":";AA0BS;AAxBT,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,8BAA8B;AAGvD,SAAS,WAAW;AAab,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA;AAAA,EACA,qBAAqB;AAAA,EACrB,QAAQ,IAAI,aAAa;AAAA,EACzB,OAAO,oBAAC,UAAO;AACjB,GAAkC;AAChC,QAAM,IAAI,KAAK;AACf,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAO,EAAE,KAAK;AAAA,MACd,MAAM;AAAA,MACN,WAAW,IAAI,UAAU;AAAA,MAExB,sBACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAChC,oBAAC,SAAY,WAAU,oCACrB,8BAAC,0BAAuB,KADhB,CAEV,CACD,IACD,YAAY,IAAI,CAAC,QACf,oBAAC,SAA8B,WAAU,oCACvC,8BAAC,kBAAe,YAAY,KAAK,KADzB,IAAI,eAEd,CACD;AAAA;AAAA,EACP;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/discover-collections-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport { useT } from \"../i18n/provider.js\";\nimport { Layers } from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\n\nimport { msg } from \"../i18n/translate.js\";\nexport interface DiscoverCollectionsStripProps {\n collections: ApiCollection[];\n isLoading: boolean;\n\n allCollectionsHref?: string;\n\n sectionLabel?: string;\n title?: string;\n icon?: React.ReactNode;\n}\n\nexport function DiscoverCollectionsStrip({\n collections,\n isLoading,\n allCollectionsHref = \"/collections\",\n title = msg(\"Collections\"),\n icon = <Layers />,\n}: DiscoverCollectionsStripProps) {\n const t = useT();\n return (\n <ScrollSection\n icon={icon}\n title={t(title)}\n href={allCollectionsHref}\n linkLabel={msg(\"View all\")}\n >\n {isLoading\n ? Array.from({ length: 5 }).map((_, i) => (\n <div key={i} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <CollectionCardSkeleton />\n </div>\n ))\n : collections.map((col) => (\n <div key={col.contractAddress} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <CollectionCard collection={col} />\n </div>\n ))}\n </ScrollSection>\n );\n}\n"],"mappings":";AAyBS;AAvBT,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,8BAA8B;AAGvD,SAAS,WAAW;AAYb,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA;AAAA,EACA,qBAAqB;AAAA,EACrB,QAAQ,IAAI,aAAa;AAAA,EACzB,OAAO,oBAAC,UAAO;AACjB,GAAkC;AAChC,QAAM,IAAI,KAAK;AACf,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAO,EAAE,KAAK;AAAA,MACd,MAAM;AAAA,MACN,WAAW,IAAI,UAAU;AAAA,MAExB,sBACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAChC,oBAAC,SAAY,WAAU,oCACrB,8BAAC,0BAAuB,KADhB,CAEV,CACD,IACD,YAAY,IAAI,CAAC,QACf,oBAAC,SAA8B,WAAU,oCACvC,8BAAC,kBAAe,YAAY,KAAK,KADzB,IAAI,eAEd,CACD;AAAA;AAAA,EACP;AAEJ;","names":[]}
@@ -30,8 +30,7 @@ var import_provider = require("../i18n/provider.js");
30
30
  function DiscoverHero({
31
31
  stats,
32
32
  orders,
33
- headlineText = "Create and explore",
34
- getTickerHref
33
+ headlineText = "Create and explore"
35
34
  }) {
36
35
  const t = (0, import_provider.useT)();
37
36
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-8", children: [
@@ -44,7 +43,7 @@ function DiscoverHero({
44
43
  ]
45
44
  }
46
45
  ) }),
47
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_ticker.ActivityTicker, { orders, getHref: getTickerHref })
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_ticker.ActivityTicker, { orders })
48
47
  ] });
49
48
  }
50
49
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/discover-hero.tsx"],"sourcesContent":["\"use client\";\n\nimport { ActivityTicker } from \"./activity-ticker.js\";\nimport { PageHeader } from \"./page-header.js\";\nimport { StatPillRow } from \"./stat-tile.js\";\nimport type { ApiOrder } from \"@medialane/sdk\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface DiscoverHeroProps {\n stats: { collections: number; tokens: number; sales: number } | null;\n orders: ApiOrder[];\n headlineText?: string;\n getTickerHref?: (order: ApiOrder) => string;\n}\n\nexport function DiscoverHero({\n stats,\n orders,\n headlineText = \"Create and explore\",\n getTickerHref,\n}: DiscoverHeroProps) {\n const t = useT();\n return (\n <div className=\"space-y-8\">\n <PageHeader title={headlineText}>\n {stats && (\n <StatPillRow\n items={[\n { label: t(\"Collections\"), value: stats.collections },\n { label: t(\"Assets\"), value: stats.tokens },\n ]}\n />\n )}\n </PageHeader>\n <ActivityTicker orders={orders} getHref={getTickerHref} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBI;AArBJ,6BAA+B;AAC/B,yBAA2B;AAC3B,uBAA4B;AAE5B,sBAAqB;AASd,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AACF,GAAsB;AACpB,QAAM,QAAI,sBAAK;AACf,SACE,6CAAC,SAAI,WAAU,aACb;AAAA,gDAAC,iCAAW,OAAO,cAChB,mBACC;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,MAAM,YAAY;AAAA,UACpD,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,MAAM,OAAO;AAAA,QAC5C;AAAA;AAAA,IACF,GAEJ;AAAA,IACA,4CAAC,yCAAe,QAAgB,SAAS,eAAe;AAAA,KAC1D;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/discover-hero.tsx"],"sourcesContent":["\"use client\";\n\nimport { ActivityTicker } from \"./activity-ticker.js\";\nimport { PageHeader } from \"./page-header.js\";\nimport { StatPillRow } from \"./stat-tile.js\";\nimport type { ApiOrder } from \"@medialane/sdk\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface DiscoverHeroProps {\n stats: { collections: number; tokens: number; sales: number } | null;\n orders: ApiOrder[];\n headlineText?: string;\n}\n\nexport function DiscoverHero({\n stats,\n orders,\n headlineText = \"Create and explore\",\n}: DiscoverHeroProps) {\n const t = useT();\n return (\n <div className=\"space-y-8\">\n <PageHeader title={headlineText}>\n {stats && (\n <StatPillRow\n items={[\n { label: t(\"Collections\"), value: stats.collections },\n { label: t(\"Assets\"), value: stats.tokens },\n ]}\n />\n )}\n </PageHeader>\n <ActivityTicker orders={orders} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBI;AAnBJ,6BAA+B;AAC/B,yBAA2B;AAC3B,uBAA4B;AAE5B,sBAAqB;AAQd,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,eAAe;AACjB,GAAsB;AACpB,QAAM,QAAI,sBAAK;AACf,SACE,6CAAC,SAAI,WAAU,aACb;AAAA,gDAAC,iCAAW,OAAO,cAChB,mBACC;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,MAAM,YAAY;AAAA,UACpD,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,MAAM,OAAO;AAAA,QAC5C;AAAA;AAAA,IACF,GAEJ;AAAA,IACA,4CAAC,yCAAe,QAAgB;AAAA,KAClC;AAEJ;","names":[]}
@@ -9,8 +9,7 @@ interface DiscoverHeroProps {
9
9
  } | null;
10
10
  orders: ApiOrder[];
11
11
  headlineText?: string;
12
- getTickerHref?: (order: ApiOrder) => string;
13
12
  }
14
- declare function DiscoverHero({ stats, orders, headlineText, getTickerHref, }: DiscoverHeroProps): react_jsx_runtime.JSX.Element;
13
+ declare function DiscoverHero({ stats, orders, headlineText, }: DiscoverHeroProps): react_jsx_runtime.JSX.Element;
15
14
 
16
15
  export { DiscoverHero, type DiscoverHeroProps };
@@ -9,8 +9,7 @@ interface DiscoverHeroProps {
9
9
  } | null;
10
10
  orders: ApiOrder[];
11
11
  headlineText?: string;
12
- getTickerHref?: (order: ApiOrder) => string;
13
12
  }
14
- declare function DiscoverHero({ stats, orders, headlineText, getTickerHref, }: DiscoverHeroProps): react_jsx_runtime.JSX.Element;
13
+ declare function DiscoverHero({ stats, orders, headlineText, }: DiscoverHeroProps): react_jsx_runtime.JSX.Element;
15
14
 
16
15
  export { DiscoverHero, type DiscoverHeroProps };