@medialane/ui 0.315.0 → 0.317.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/discover-collections-strip.cjs +1 -2
- package/dist/components/discover-collections-strip.cjs.map +1 -1
- package/dist/components/discover-collections-strip.js +1 -2
- package/dist/components/discover-collections-strip.js.map +1 -1
- package/dist/components/discover-community-section.cjs +6 -37
- package/dist/components/discover-community-section.cjs.map +1 -1
- package/dist/components/discover-community-section.js +6 -37
- package/dist/components/discover-community-section.js.map +1 -1
- package/dist/components/discover-feed-section.cjs +6 -33
- package/dist/components/discover-feed-section.cjs.map +1 -1
- package/dist/components/discover-feed-section.js +7 -34
- package/dist/components/discover-feed-section.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/home-page.cjs +2 -4
- package/dist/components/home-page.cjs.map +1 -1
- package/dist/components/home-page.js +2 -4
- package/dist/components/home-page.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +4 -4
- package/dist/components/launchpad/edition-mint-schema.d.ts +4 -4
- package/dist/components/launchpad-strip.cjs +1 -2
- package/dist/components/launchpad-strip.cjs.map +1 -1
- package/dist/components/launchpad-strip.js +1 -2
- package/dist/components/launchpad-strip.js.map +1 -1
- package/dist/components/listing-card.cjs +24 -32
- package/dist/components/listing-card.cjs.map +1 -1
- package/dist/components/listing-card.js +25 -33
- package/dist/components/listing-card.js.map +1 -1
- package/dist/components/scroll-section.cjs +3 -42
- package/dist/components/scroll-section.cjs.map +1 -1
- package/dist/components/scroll-section.d.cts +1 -2
- package/dist/components/scroll-section.d.ts +1 -2
- package/dist/components/scroll-section.js +3 -32
- package/dist/components/scroll-section.js.map +1 -1
- package/dist/components/section-heading.cjs +65 -0
- package/dist/components/section-heading.cjs.map +1 -0
- package/dist/components/section-heading.d.cts +12 -0
- package/dist/components/section-heading.d.ts +12 -0
- package/dist/components/section-heading.js +31 -0
- package/dist/components/section-heading.js.map +1 -0
- package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { FastMintProps } from './types.js';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '@medialane/sdk/starknet';
|
|
7
7
|
|
|
8
|
-
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> |
|
|
8
|
+
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -67,8 +67,7 @@ function NewListings({ market }) {
|
|
|
67
67
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
68
|
import_scroll_section.ScrollSection,
|
|
69
69
|
{
|
|
70
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Tag, { className: "h-
|
|
71
|
-
iconBg: "bg-gradient-to-br from-brand-rose to-brand-rose shadow-md shadow-brand-rose/20",
|
|
70
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Tag, { className: "h-4 w-4" }),
|
|
72
71
|
title: "New listings",
|
|
73
72
|
href: "/marketplace",
|
|
74
73
|
linkLabel: "Marketplace",
|
|
@@ -92,8 +91,7 @@ function CollectionsStrip() {
|
|
|
92
91
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
92
|
import_scroll_section.ScrollSection,
|
|
94
93
|
{
|
|
95
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.TrendingUp, { className: "h-
|
|
96
|
-
iconBg: "bg-gradient-to-br from-brand-purple to-brand-maeve shadow-md shadow-brand-purple/20",
|
|
94
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.TrendingUp, { className: "h-4 w-4" }),
|
|
97
95
|
title: "Collections",
|
|
98
96
|
href: "/collections",
|
|
99
97
|
linkLabel: "See all",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection } from \"@medialane/sdk\";\nimport { Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { HeroSlider } from \"./hero-slider.js\";\nimport { ActivityTicker } from \"./activity-ticker.js\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { ListingCard, ListingCardSkeleton } from \"./listing-card.js\";\nimport { ListingCardMenu } from \"./listing-card-menu.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport { RewardsSection } from \"./rewards-section.js\";\nimport { LaunchpadStrip } from \"./launchpad-strip.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport type { CollectionMarketActions } from \"./collection-page.js\";\nimport { useOrders } from \"../utils/use-orders.js\";\nimport { useCollections } from \"../utils/use-collections.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\n\nconst LAUNCHPAD_HREFS = {\n nfts: \"/launchpad/single-editions\",\n \"limited-editions\": \"/launchpad/nfteditions\",\n \"collection-drop\": \"/launchpad/drop\",\n \"pop-protocol\": \"/launchpad/pop\",\n \"ip-tickets\": \"/launchpad/tickets\",\n \"creator-coins\": \"/launchpad/coin/create\",\n};\n\nfunction NewListings({ market }: { market: CollectionMarketActions }) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders({ status: \"ACTIVE\", limit: 10, page: 1 });\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n return (\n <ScrollSection\n icon={<Tag className=\"h-
|
|
1
|
+
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection } from \"@medialane/sdk\";\nimport { Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { HeroSlider } from \"./hero-slider.js\";\nimport { ActivityTicker } from \"./activity-ticker.js\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { ListingCard, ListingCardSkeleton } from \"./listing-card.js\";\nimport { ListingCardMenu } from \"./listing-card-menu.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport { RewardsSection } from \"./rewards-section.js\";\nimport { LaunchpadStrip } from \"./launchpad-strip.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport type { CollectionMarketActions } from \"./collection-page.js\";\nimport { useOrders } from \"../utils/use-orders.js\";\nimport { useCollections } from \"../utils/use-collections.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\n\nconst LAUNCHPAD_HREFS = {\n nfts: \"/launchpad/single-editions\",\n \"limited-editions\": \"/launchpad/nfteditions\",\n \"collection-drop\": \"/launchpad/drop\",\n \"pop-protocol\": \"/launchpad/pop\",\n \"ip-tickets\": \"/launchpad/tickets\",\n \"creator-coins\": \"/launchpad/coin/create\",\n};\n\nfunction NewListings({ market }: { market: CollectionMarketActions }) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders({ status: \"ACTIVE\", limit: 10, page: 1 });\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n return (\n <ScrollSection\n icon={<Tag className=\"h-4 w-4\" />}\n title=\"New listings\"\n href=\"/marketplace\"\n linkLabel=\"Marketplace\"\n >\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-72 shrink-0 snap-start\"><ListingCardSkeleton /></div>\n ))\n : listings.length === 0\n ? (\n <p className=\"py-4 text-sm text-muted-foreground\">\n <Link href=\"/launchpad/single-editions\" className=\"text-primary hover:underline\">Sell the first asset</Link>\n </p>\n )\n : listings.map((order) => {\n const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);\n return (\n <div key={order.orderHash} className=\"w-72 shrink-0 snap-start\">\n <ListingCard\n order={order}\n onBuy={own ? undefined : () => market.buy(order)}\n overflowMenu={<ListingCardMenu order={order} />}\n usdValue={orderUsd(order.price, prices)}\n />\n </div>\n );\n })}\n </ScrollSection>\n );\n}\n\nfunction CollectionsStrip() {\n const { collections, isLoading } = useCollections(1, 10, undefined, \"recent\");\n return (\n <ScrollSection\n icon={<TrendingUp className=\"h-4 w-4\" />}\n title=\"Collections\"\n href=\"/collections\"\n linkLabel=\"See all\"\n >\n {isLoading\n ? Array.from({ length: 5 }).map((_, i) => (\n <div key={i} className=\"w-56 shrink-0 snap-start sm:w-64\"><CollectionCardSkeleton /></div>\n ))\n : collections.map((col) => (\n <div key={col.contractAddress} className=\"w-64 shrink-0 snap-start\"><CollectionCard collection={col} /></div>\n ))}\n </ScrollSection>\n );\n}\n\nexport interface HomePageProps {\n useMarketActions: () => CollectionMarketActions;\n initialFeatured?: ApiCollection[];\n}\n\nexport function HomePage({ useMarketActions, initialFeatured }: HomePageProps) {\n const market = useMarketActions();\n const { collections: featured, isLoading: featuredLoading } = useCollections(1, 3, true, \"recent\", true, undefined, undefined, initialFeatured);\n const { orders: tickerOrders } = useOrders({ status: \"ACTIVE\", sort: \"recent\", limit: 14 });\n return (\n <div className=\"pb-20\">\n <HeroSlider collections={featured} isLoading={featuredLoading} getHref={(c) => collectionHref(\"STARKNET\", c.contractAddress)} />\n <PageContainer className=\"box-border max-w-full pt-6 pb-0\">\n <ActivityTicker orders={tickerOrders} minItems={3} getHref={(o) => assetHref(\"STARKNET\", o.nftContract, o.nftTokenId)} />\n </PageContainer>\n <PageContainer className=\"mt-16 box-border max-w-full space-y-10 pt-0 pb-0 sm:space-y-16 lg:space-y-20\">\n <NewListings market={market} />\n <CollectionsStrip />\n <RewardsSection rewardsHref=\"/rewards\" />\n <LaunchpadStrip hrefs={LAUNCHPAD_HREFS} marketplaceHref=\"/marketplace\" launchpadHref=\"/launchpad\" />\n </PageContainer>\n {market.dialogs}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsCY;AApCZ,iBAA8D;AAC9D,0BAAgC;AAChC,kBAAiB;AACjB,4BAA8B;AAC9B,yBAA2B;AAC3B,6BAA+B;AAC/B,4BAA8B;AAC9B,0BAAiD;AACjD,+BAAgC;AAChC,6BAAuD;AACvD,6BAA+B;AAC/B,6BAA+B;AAC/B,2BAAgC;AAEhC,wBAA0B;AAC1B,6BAA+B;AAC/B,4BAA6B;AAC7B,uBAAyB;AACzB,0BAA8B;AAE9B,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,iBA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* @__PURE__ */ jsx(
|
|
35
35
|
ScrollSection,
|
|
36
36
|
{
|
|
37
|
-
icon: /* @__PURE__ */ jsx(Tag, { className: "h-
|
|
38
|
-
iconBg: "bg-gradient-to-br from-brand-rose to-brand-rose shadow-md shadow-brand-rose/20",
|
|
37
|
+
icon: /* @__PURE__ */ jsx(Tag, { className: "h-4 w-4" }),
|
|
39
38
|
title: "New listings",
|
|
40
39
|
href: "/marketplace",
|
|
41
40
|
linkLabel: "Marketplace",
|
|
@@ -59,8 +58,7 @@ function CollectionsStrip() {
|
|
|
59
58
|
return /* @__PURE__ */ jsx(
|
|
60
59
|
ScrollSection,
|
|
61
60
|
{
|
|
62
|
-
icon: /* @__PURE__ */ jsx(TrendingUp, { className: "h-
|
|
63
|
-
iconBg: "bg-gradient-to-br from-brand-purple to-brand-maeve shadow-md shadow-brand-purple/20",
|
|
61
|
+
icon: /* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4" }),
|
|
64
62
|
title: "Collections",
|
|
65
63
|
href: "/collections",
|
|
66
64
|
linkLabel: "See all",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection } from \"@medialane/sdk\";\nimport { Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { HeroSlider } from \"./hero-slider.js\";\nimport { ActivityTicker } from \"./activity-ticker.js\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { ListingCard, ListingCardSkeleton } from \"./listing-card.js\";\nimport { ListingCardMenu } from \"./listing-card-menu.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport { RewardsSection } from \"./rewards-section.js\";\nimport { LaunchpadStrip } from \"./launchpad-strip.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport type { CollectionMarketActions } from \"./collection-page.js\";\nimport { useOrders } from \"../utils/use-orders.js\";\nimport { useCollections } from \"../utils/use-collections.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\n\nconst LAUNCHPAD_HREFS = {\n nfts: \"/launchpad/single-editions\",\n \"limited-editions\": \"/launchpad/nfteditions\",\n \"collection-drop\": \"/launchpad/drop\",\n \"pop-protocol\": \"/launchpad/pop\",\n \"ip-tickets\": \"/launchpad/tickets\",\n \"creator-coins\": \"/launchpad/coin/create\",\n};\n\nfunction NewListings({ market }: { market: CollectionMarketActions }) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders({ status: \"ACTIVE\", limit: 10, page: 1 });\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n return (\n <ScrollSection\n icon={<Tag className=\"h-
|
|
1
|
+
{"version":3,"sources":["../../src/components/home-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, collectionHref, type ApiCollection } from \"@medialane/sdk\";\nimport { Tag, TrendingUp } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { HeroSlider } from \"./hero-slider.js\";\nimport { ActivityTicker } from \"./activity-ticker.js\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { ListingCard, ListingCardSkeleton } from \"./listing-card.js\";\nimport { ListingCardMenu } from \"./listing-card-menu.js\";\nimport { CollectionCard, CollectionCardSkeleton } from \"./collection-card.js\";\nimport { RewardsSection } from \"./rewards-section.js\";\nimport { LaunchpadStrip } from \"./launchpad-strip.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport type { CollectionMarketActions } from \"./collection-page.js\";\nimport { useOrders } from \"../utils/use-orders.js\";\nimport { useCollections } from \"../utils/use-collections.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\n\nconst LAUNCHPAD_HREFS = {\n nfts: \"/launchpad/single-editions\",\n \"limited-editions\": \"/launchpad/nfteditions\",\n \"collection-drop\": \"/launchpad/drop\",\n \"pop-protocol\": \"/launchpad/pop\",\n \"ip-tickets\": \"/launchpad/tickets\",\n \"creator-coins\": \"/launchpad/coin/create\",\n};\n\nfunction NewListings({ market }: { market: CollectionMarketActions }) {\n const { walletAddress } = useMedialaneApp();\n const { orders, isLoading } = useOrders({ status: \"ACTIVE\", limit: 10, page: 1 });\n const prices = useUsdPrices();\n const listings = orders.filter((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\").slice(0, 10);\n return (\n <ScrollSection\n icon={<Tag className=\"h-4 w-4\" />}\n title=\"New listings\"\n href=\"/marketplace\"\n linkLabel=\"Marketplace\"\n >\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-72 shrink-0 snap-start\"><ListingCardSkeleton /></div>\n ))\n : listings.length === 0\n ? (\n <p className=\"py-4 text-sm text-muted-foreground\">\n <Link href=\"/launchpad/single-editions\" className=\"text-primary hover:underline\">Sell the first asset</Link>\n </p>\n )\n : listings.map((order) => {\n const own = !!walletAddress && isSameAddress(order.offerer, walletAddress);\n return (\n <div key={order.orderHash} className=\"w-72 shrink-0 snap-start\">\n <ListingCard\n order={order}\n onBuy={own ? undefined : () => market.buy(order)}\n overflowMenu={<ListingCardMenu order={order} />}\n usdValue={orderUsd(order.price, prices)}\n />\n </div>\n );\n })}\n </ScrollSection>\n );\n}\n\nfunction CollectionsStrip() {\n const { collections, isLoading } = useCollections(1, 10, undefined, \"recent\");\n return (\n <ScrollSection\n icon={<TrendingUp className=\"h-4 w-4\" />}\n title=\"Collections\"\n href=\"/collections\"\n linkLabel=\"See all\"\n >\n {isLoading\n ? Array.from({ length: 5 }).map((_, i) => (\n <div key={i} className=\"w-56 shrink-0 snap-start sm:w-64\"><CollectionCardSkeleton /></div>\n ))\n : collections.map((col) => (\n <div key={col.contractAddress} className=\"w-64 shrink-0 snap-start\"><CollectionCard collection={col} /></div>\n ))}\n </ScrollSection>\n );\n}\n\nexport interface HomePageProps {\n useMarketActions: () => CollectionMarketActions;\n initialFeatured?: ApiCollection[];\n}\n\nexport function HomePage({ useMarketActions, initialFeatured }: HomePageProps) {\n const market = useMarketActions();\n const { collections: featured, isLoading: featuredLoading } = useCollections(1, 3, true, \"recent\", true, undefined, undefined, initialFeatured);\n const { orders: tickerOrders } = useOrders({ status: \"ACTIVE\", sort: \"recent\", limit: 14 });\n return (\n <div className=\"pb-20\">\n <HeroSlider collections={featured} isLoading={featuredLoading} getHref={(c) => collectionHref(\"STARKNET\", c.contractAddress)} />\n <PageContainer className=\"box-border max-w-full pt-6 pb-0\">\n <ActivityTicker orders={tickerOrders} minItems={3} getHref={(o) => assetHref(\"STARKNET\", o.nftContract, o.nftTokenId)} />\n </PageContainer>\n <PageContainer className=\"mt-16 box-border max-w-full space-y-10 pt-0 pb-0 sm:space-y-16 lg:space-y-20\">\n <NewListings market={market} />\n <CollectionsStrip />\n <RewardsSection rewardsHref=\"/rewards\" />\n <LaunchpadStrip hrefs={LAUNCHPAD_HREFS} marketplaceHref=\"/marketplace\" launchpadHref=\"/launchpad\" />\n </PageContainer>\n {market.dialogs}\n </div>\n );\n}\n"],"mappings":";AAsCY,cAmEN,YAnEM;AApCZ,SAAS,WAAW,sBAA0C;AAC9D,SAAS,KAAK,kBAAkB;AAChC,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,aAAa,2BAA2B;AACjD,SAAS,uBAAuB;AAChC,SAAS,gBAAgB,8BAA8B;AACvD,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAEhC,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7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iBAAgB,gBAAe,eAAc,cAAa;AAAA,OACpG;AAAA,IACC,OAAO;AAAA,KACV;AAEJ;","names":[]}
|
|
@@ -19,13 +19,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
19
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
20
20
|
licenseType: string;
|
|
21
21
|
commercialUse: "Yes" | "No";
|
|
22
|
+
value: string;
|
|
23
|
+
recipient: string;
|
|
22
24
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
23
25
|
attribution: "Required" | "Not Required";
|
|
24
26
|
geographicScope: string;
|
|
25
27
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
26
28
|
royalty: number;
|
|
27
|
-
value: string;
|
|
28
|
-
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
@@ -33,13 +33,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
33
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
34
34
|
licenseType: string;
|
|
35
35
|
commercialUse: "Yes" | "No";
|
|
36
|
+
value: string;
|
|
37
|
+
recipient: string;
|
|
36
38
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
37
39
|
attribution: "Required" | "Not Required";
|
|
38
40
|
geographicScope: string;
|
|
39
41
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
40
42
|
royalty: number;
|
|
41
|
-
value: string;
|
|
42
|
-
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
45
45
|
}>;
|
|
@@ -19,13 +19,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
19
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
20
20
|
licenseType: string;
|
|
21
21
|
commercialUse: "Yes" | "No";
|
|
22
|
+
value: string;
|
|
23
|
+
recipient: string;
|
|
22
24
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
23
25
|
attribution: "Required" | "Not Required";
|
|
24
26
|
geographicScope: string;
|
|
25
27
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
26
28
|
royalty: number;
|
|
27
|
-
value: string;
|
|
28
|
-
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
@@ -33,13 +33,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
33
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
34
34
|
licenseType: string;
|
|
35
35
|
commercialUse: "Yes" | "No";
|
|
36
|
+
value: string;
|
|
37
|
+
recipient: string;
|
|
36
38
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
37
39
|
attribution: "Required" | "Not Required";
|
|
38
40
|
geographicScope: string;
|
|
39
41
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
40
42
|
royalty: number;
|
|
41
|
-
value: string;
|
|
42
|
-
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
45
45
|
}>;
|
|
@@ -128,8 +128,7 @@ function LaunchpadStrip({
|
|
|
128
128
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
129
129
|
import_scroll_section.ScrollSection,
|
|
130
130
|
{
|
|
131
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Rocket, { className: "h-
|
|
132
|
-
iconBg: "bg-gradient-to-br from-primary to-blue-600 shadow-md shadow-primary/20",
|
|
131
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Rocket, { className: "h-4 w-4" }),
|
|
133
132
|
title: "Launchpad",
|
|
134
133
|
href: launchpadHref,
|
|
135
134
|
linkLabel: "Explore",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/launchpad-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ShoppingBag, ArrowRight, Rocket } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { SERVICE_HUES } from \"./launchpad-services.js\";\nimport { LAUNCHPAD_SERVICE_DEFINITIONS } from \"../data/launchpad-services.js\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface LaunchpadStripProps {\n\n hrefs: Record<string, string>;\n\n marketplaceHref?: string;\n\n launchpadHref?: string;\n}\n\ninterface StripCard {\n key: string;\n href: string;\n icon: LucideIcon;\n title: string;\n blurb: string;\n example?: string;\n cta: string;\n hue: { text: string; solid: string; border: string; tint: string };\n}\n\nconst DEF_BY_KEY = Object.fromEntries(LAUNCHPAD_SERVICE_DEFINITIONS.map((d) => [d.key, d]));\n\nconst STRIP_ORDER = [\n \"nfts\",\n \"limited-editions\",\n \"collection-drop\",\n \"pop-protocol\",\n \"ip-tickets\",\n \"creator-coins\",\n];\n\nconst MARKETPLACE_HUE = {\n text: \"text-brand-maeve\",\n solid: \"bg-brand-maeve\",\n border: \"border-brand-maeve/30\",\n tint: \"bg-brand-maeve/10\",\n};\n\nfunction ServiceCard({ card }: { card: StripCard }) {\n const { icon: Icon, title, blurb, example, cta, hue, href } = card;\n return (\n <Link\n href={href}\n className={cn(\n \"relative rounded-2xl border bg-card overflow-hidden flex flex-col h-full min-h-[280px]\",\n \"transition-transform active:scale-[0.99]\",\n hue.border,\n )}\n >\n <div className=\"relative flex flex-col flex-1 p-6 gap-3.5\">\n <span className={cn(\"flex h-11 w-11 items-center justify-center rounded-xl\", hue.tint)}>\n <Icon className={cn(\"h-6 w-6\", hue.text)} />\n </span>\n\n <div className=\"space-y-1.5\">\n <h3 className=\"text-xl font-black tracking-tight leading-snug\">{title}</h3>\n <p className=\"text-sm text-muted-foreground leading-relaxed\">{blurb}</p>\n {example && (\n <p className=\"text-xs text-muted-foreground/70 italic leading-relaxed\">e.g. {example}</p>\n )}\n </div>\n\n <div className=\"mt-auto pt-1 flex justify-end\">\n <span\n className={cn(\n \"inline-flex items-center gap-2 h-9 px-4 rounded-full\",\n \"text-sm font-semibold text-white\",\n hue.solid,\n )}\n >\n {cta}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </span>\n </div>\n </div>\n </Link>\n );\n}\n\nexport function LaunchpadStrip({\n hrefs,\n marketplaceHref,\n launchpadHref = \"/launchpad\",\n}: LaunchpadStripProps) {\n const cards: StripCard[] = [\n ...STRIP_ORDER.flatMap((key) => {\n const def = DEF_BY_KEY[key];\n const href = hrefs[key];\n if (!def || !href) return [];\n return [{\n key,\n href,\n icon: def.icon,\n title: def.title,\n blurb: def.blurb,\n example: def.example,\n cta: def.cta,\n hue: SERVICE_HUES[key] ?? MARKETPLACE_HUE,\n }];\n }),\n ...(marketplaceHref\n ? [{\n key: \"marketplace\",\n href: marketplaceHref,\n icon: ShoppingBag,\n title: \"Marketplace\",\n blurb: \"Discover and trade works from creators — gasless, instantly settled.\",\n example: \"Buy an art print, make an offer on a music track\",\n cta: \"Browse\",\n hue: MARKETPLACE_HUE,\n }]\n : []),\n ];\n\n return (\n <ScrollSection\n icon={<Rocket className=\"h-
|
|
1
|
+
{"version":3,"sources":["../../src/components/launchpad-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ShoppingBag, ArrowRight, Rocket } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { SERVICE_HUES } from \"./launchpad-services.js\";\nimport { LAUNCHPAD_SERVICE_DEFINITIONS } from \"../data/launchpad-services.js\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface LaunchpadStripProps {\n\n hrefs: Record<string, string>;\n\n marketplaceHref?: string;\n\n launchpadHref?: string;\n}\n\ninterface StripCard {\n key: string;\n href: string;\n icon: LucideIcon;\n title: string;\n blurb: string;\n example?: string;\n cta: string;\n hue: { text: string; solid: string; border: string; tint: string };\n}\n\nconst DEF_BY_KEY = Object.fromEntries(LAUNCHPAD_SERVICE_DEFINITIONS.map((d) => [d.key, d]));\n\nconst STRIP_ORDER = [\n \"nfts\",\n \"limited-editions\",\n \"collection-drop\",\n \"pop-protocol\",\n \"ip-tickets\",\n \"creator-coins\",\n];\n\nconst MARKETPLACE_HUE = {\n text: \"text-brand-maeve\",\n solid: \"bg-brand-maeve\",\n border: \"border-brand-maeve/30\",\n tint: \"bg-brand-maeve/10\",\n};\n\nfunction ServiceCard({ card }: { card: StripCard }) {\n const { icon: Icon, title, blurb, example, cta, hue, href } = card;\n return (\n <Link\n href={href}\n className={cn(\n \"relative rounded-2xl border bg-card overflow-hidden flex flex-col h-full min-h-[280px]\",\n \"transition-transform active:scale-[0.99]\",\n hue.border,\n )}\n >\n <div className=\"relative flex flex-col flex-1 p-6 gap-3.5\">\n <span className={cn(\"flex h-11 w-11 items-center justify-center rounded-xl\", hue.tint)}>\n <Icon className={cn(\"h-6 w-6\", hue.text)} />\n </span>\n\n <div className=\"space-y-1.5\">\n <h3 className=\"text-xl font-black tracking-tight leading-snug\">{title}</h3>\n <p className=\"text-sm text-muted-foreground leading-relaxed\">{blurb}</p>\n {example && (\n <p className=\"text-xs text-muted-foreground/70 italic leading-relaxed\">e.g. {example}</p>\n )}\n </div>\n\n <div className=\"mt-auto pt-1 flex justify-end\">\n <span\n className={cn(\n \"inline-flex items-center gap-2 h-9 px-4 rounded-full\",\n \"text-sm font-semibold text-white\",\n hue.solid,\n )}\n >\n {cta}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </span>\n </div>\n </div>\n </Link>\n );\n}\n\nexport function LaunchpadStrip({\n hrefs,\n marketplaceHref,\n launchpadHref = \"/launchpad\",\n}: LaunchpadStripProps) {\n const cards: StripCard[] = [\n ...STRIP_ORDER.flatMap((key) => {\n const def = DEF_BY_KEY[key];\n const href = hrefs[key];\n if (!def || !href) return [];\n return [{\n key,\n href,\n icon: def.icon,\n title: def.title,\n blurb: def.blurb,\n example: def.example,\n cta: def.cta,\n hue: SERVICE_HUES[key] ?? MARKETPLACE_HUE,\n }];\n }),\n ...(marketplaceHref\n ? [{\n key: \"marketplace\",\n href: marketplaceHref,\n icon: ShoppingBag,\n title: \"Marketplace\",\n blurb: \"Discover and trade works from creators — gasless, instantly settled.\",\n example: \"Buy an art print, make an offer on a music track\",\n cta: \"Browse\",\n hue: MARKETPLACE_HUE,\n }]\n : []),\n ];\n\n return (\n <ScrollSection\n icon={<Rocket className=\"h-4 w-4\" />}\n title=\"Launchpad\"\n href={launchpadHref}\n linkLabel=\"Explore\"\n >\n {cards.map((card) => (\n <div key={card.key} className=\"w-64 sm:w-72 snap-start shrink-0 flex\">\n <ServiceCard card={card} />\n </div>\n ))}\n </ScrollSection>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6DU;AA3DV,kBAAiB;AACjB,0BAAgD;AAEhD,4BAA8B;AAC9B,gCAA6B;AAC7B,IAAAA,6BAA8C;AAC9C,gBAAmB;AAsBnB,MAAM,aAAa,OAAO,YAAY,yDAA8B,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAE1F,MAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AACR;AAEA,SAAS,YAAY,EAAE,KAAK,GAAwB;AAClD,QAAM,EAAE,MAAM,MAAM,OAAO,OAAO,SA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AA,IACD,GAAI,kBACA,CAAC;AAAA,MACC,KAAK;AAAA,MACL,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,MACP,SAAS;AAAA,MACT,KAAK;AAAA,MACL,KAAK;AAAA,IACP,CAAC,IACD,CAAC;AAAA,EACP;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,4CAAC,8BAAO,WAAU,WAAU;AAAA,MAClC,OAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAU;AAAA,MAET,gBAAM,IAAI,CAAC,SACV,4CAAC,SAAmB,WAAU,yCAC5B,sDAAC,eAAY,MAAY,KADjB,KAAK,GAEf,CACD;AAAA;AAAA,EACH;AAEJ;","names":["import_launchpad_services","Link"]}
|
|
@@ -95,8 +95,7 @@ function LaunchpadStrip({
|
|
|
95
95
|
return /* @__PURE__ */ jsx(
|
|
96
96
|
ScrollSection,
|
|
97
97
|
{
|
|
98
|
-
icon: /* @__PURE__ */ jsx(Rocket, { className: "h-
|
|
99
|
-
iconBg: "bg-gradient-to-br from-primary to-blue-600 shadow-md shadow-primary/20",
|
|
98
|
+
icon: /* @__PURE__ */ jsx(Rocket, { className: "h-4 w-4" }),
|
|
100
99
|
title: "Launchpad",
|
|
101
100
|
href: launchpadHref,
|
|
102
101
|
linkLabel: "Explore",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/launchpad-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ShoppingBag, ArrowRight, Rocket } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { SERVICE_HUES } from \"./launchpad-services.js\";\nimport { LAUNCHPAD_SERVICE_DEFINITIONS } from \"../data/launchpad-services.js\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface LaunchpadStripProps {\n\n hrefs: Record<string, string>;\n\n marketplaceHref?: string;\n\n launchpadHref?: string;\n}\n\ninterface StripCard {\n key: string;\n href: string;\n icon: LucideIcon;\n title: string;\n blurb: string;\n example?: string;\n cta: string;\n hue: { text: string; solid: string; border: string; tint: string };\n}\n\nconst DEF_BY_KEY = Object.fromEntries(LAUNCHPAD_SERVICE_DEFINITIONS.map((d) => [d.key, d]));\n\nconst STRIP_ORDER = [\n \"nfts\",\n \"limited-editions\",\n \"collection-drop\",\n \"pop-protocol\",\n \"ip-tickets\",\n \"creator-coins\",\n];\n\nconst MARKETPLACE_HUE = {\n text: \"text-brand-maeve\",\n solid: \"bg-brand-maeve\",\n border: \"border-brand-maeve/30\",\n tint: \"bg-brand-maeve/10\",\n};\n\nfunction ServiceCard({ card }: { card: StripCard }) {\n const { icon: Icon, title, blurb, example, cta, hue, href } = card;\n return (\n <Link\n href={href}\n className={cn(\n \"relative rounded-2xl border bg-card overflow-hidden flex flex-col h-full min-h-[280px]\",\n \"transition-transform active:scale-[0.99]\",\n hue.border,\n )}\n >\n <div className=\"relative flex flex-col flex-1 p-6 gap-3.5\">\n <span className={cn(\"flex h-11 w-11 items-center justify-center rounded-xl\", hue.tint)}>\n <Icon className={cn(\"h-6 w-6\", hue.text)} />\n </span>\n\n <div className=\"space-y-1.5\">\n <h3 className=\"text-xl font-black tracking-tight leading-snug\">{title}</h3>\n <p className=\"text-sm text-muted-foreground leading-relaxed\">{blurb}</p>\n {example && (\n <p className=\"text-xs text-muted-foreground/70 italic leading-relaxed\">e.g. {example}</p>\n )}\n </div>\n\n <div className=\"mt-auto pt-1 flex justify-end\">\n <span\n className={cn(\n \"inline-flex items-center gap-2 h-9 px-4 rounded-full\",\n \"text-sm font-semibold text-white\",\n hue.solid,\n )}\n >\n {cta}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </span>\n </div>\n </div>\n </Link>\n );\n}\n\nexport function LaunchpadStrip({\n hrefs,\n marketplaceHref,\n launchpadHref = \"/launchpad\",\n}: LaunchpadStripProps) {\n const cards: StripCard[] = [\n ...STRIP_ORDER.flatMap((key) => {\n const def = DEF_BY_KEY[key];\n const href = hrefs[key];\n if (!def || !href) return [];\n return [{\n key,\n href,\n icon: def.icon,\n title: def.title,\n blurb: def.blurb,\n example: def.example,\n cta: def.cta,\n hue: SERVICE_HUES[key] ?? MARKETPLACE_HUE,\n }];\n }),\n ...(marketplaceHref\n ? [{\n key: \"marketplace\",\n href: marketplaceHref,\n icon: ShoppingBag,\n title: \"Marketplace\",\n blurb: \"Discover and trade works from creators — gasless, instantly settled.\",\n example: \"Buy an art print, make an offer on a music track\",\n cta: \"Browse\",\n hue: MARKETPLACE_HUE,\n }]\n : []),\n ];\n\n return (\n <ScrollSection\n icon={<Rocket className=\"h-
|
|
1
|
+
{"version":3,"sources":["../../src/components/launchpad-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ShoppingBag, ArrowRight, Rocket } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { SERVICE_HUES } from \"./launchpad-services.js\";\nimport { LAUNCHPAD_SERVICE_DEFINITIONS } from \"../data/launchpad-services.js\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface LaunchpadStripProps {\n\n hrefs: Record<string, string>;\n\n marketplaceHref?: string;\n\n launchpadHref?: string;\n}\n\ninterface StripCard {\n key: string;\n href: string;\n icon: LucideIcon;\n title: string;\n blurb: string;\n example?: string;\n cta: string;\n hue: { text: string; solid: string; border: string; tint: string };\n}\n\nconst DEF_BY_KEY = Object.fromEntries(LAUNCHPAD_SERVICE_DEFINITIONS.map((d) => [d.key, d]));\n\nconst STRIP_ORDER = [\n \"nfts\",\n \"limited-editions\",\n \"collection-drop\",\n \"pop-protocol\",\n \"ip-tickets\",\n \"creator-coins\",\n];\n\nconst MARKETPLACE_HUE = {\n text: \"text-brand-maeve\",\n solid: \"bg-brand-maeve\",\n border: \"border-brand-maeve/30\",\n tint: \"bg-brand-maeve/10\",\n};\n\nfunction ServiceCard({ card }: { card: StripCard }) {\n const { icon: Icon, title, blurb, example, cta, hue, href } = card;\n return (\n <Link\n href={href}\n className={cn(\n \"relative rounded-2xl border bg-card overflow-hidden flex flex-col h-full min-h-[280px]\",\n \"transition-transform active:scale-[0.99]\",\n hue.border,\n )}\n >\n <div className=\"relative flex flex-col flex-1 p-6 gap-3.5\">\n <span className={cn(\"flex h-11 w-11 items-center justify-center rounded-xl\", hue.tint)}>\n <Icon className={cn(\"h-6 w-6\", hue.text)} />\n </span>\n\n <div className=\"space-y-1.5\">\n <h3 className=\"text-xl font-black tracking-tight leading-snug\">{title}</h3>\n <p className=\"text-sm text-muted-foreground leading-relaxed\">{blurb}</p>\n {example && (\n <p className=\"text-xs text-muted-foreground/70 italic leading-relaxed\">e.g. {example}</p>\n )}\n </div>\n\n <div className=\"mt-auto pt-1 flex justify-end\">\n <span\n className={cn(\n \"inline-flex items-center gap-2 h-9 px-4 rounded-full\",\n \"text-sm font-semibold text-white\",\n hue.solid,\n )}\n >\n {cta}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </span>\n </div>\n </div>\n </Link>\n );\n}\n\nexport function LaunchpadStrip({\n hrefs,\n marketplaceHref,\n launchpadHref = \"/launchpad\",\n}: LaunchpadStripProps) {\n const cards: StripCard[] = [\n ...STRIP_ORDER.flatMap((key) => {\n const def = DEF_BY_KEY[key];\n const href = hrefs[key];\n if (!def || !href) return [];\n return [{\n key,\n href,\n icon: def.icon,\n title: def.title,\n blurb: def.blurb,\n example: def.example,\n cta: def.cta,\n hue: SERVICE_HUES[key] ?? MARKETPLACE_HUE,\n }];\n }),\n ...(marketplaceHref\n ? [{\n key: \"marketplace\",\n href: marketplaceHref,\n icon: ShoppingBag,\n title: \"Marketplace\",\n blurb: \"Discover and trade works from creators — gasless, instantly settled.\",\n example: \"Buy an art print, make an offer on a music track\",\n cta: \"Browse\",\n hue: MARKETPLACE_HUE,\n }]\n : []),\n ];\n\n return (\n <ScrollSection\n icon={<Rocket className=\"h-4 w-4\" />}\n title=\"Launchpad\"\n href={launchpadHref}\n linkLabel=\"Explore\"\n >\n {cards.map((card) => (\n <div key={card.key} className=\"w-64 sm:w-72 snap-start shrink-0 flex\">\n <ServiceCard card={card} />\n </div>\n ))}\n </ScrollSection>\n );\n}\n"],"mappings":";AA6DU,cAOE,YAPF;AA3DV,OAAO,UAAU;AACjB,SAAS,aAAa,YAAY,cAAc;AAEhD,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,qCAAqC;AAC9C,SAAS,UAAU;AAsBnB,MAAM,aAAa,OAAO,YAAY,8BAA8B,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAE1F,MAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AACR;AAEA,SAAS,YAAY,EAAE,KAAK,GAAwB;AAClD,QAAM,EAAE,MAAM,MAAM,OAAO,OAAO,SAAS,KAAK,KAAK,KAAK,IAAI;AAC9D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,IAAI;AAAA,MACN;AAAA,MAEA,+BAAC,SAAI,WAAU,6CACb;AAAA,4BAAC,UAAK,WAAW,GAAG,yDAAyD,IAAI,IAAI,GACnF,8BAAC,QAAK,WAAW,GAAG,WAAW,IAAI,IAAI,GAAG,GAC5C;AAAA,QAEA,qBAAC,SAAI,WAAU,eACb;AAAA,8BAAC,QAAG,WAAU,kDAAkD,iBAAM;AAAA,UACtE,oBAAC,OAAE,WAAU,iDAAiD,iBAAM;AAAA,UACnE,WACC,qBAAC,OAAE,WAAU,2DAA0D;AAAA;AAAA,YAAM;AAAA,aAAQ;AAAA,WAEzF;AAAA,QAEA,oBAAC,SAAI,WAAU,iCACb;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA;AAAA,cACA,IAAI;AAAA,YACN;AAAA,YAEC;AAAA;AAAA,cACD,oBAAC,cAAW,WAAU,eAAc;AAAA;AAAA;AAAA,QACtC,GACF;AAAA,SACF;AAAA;AAAA,EACF;AAEJ;AAEO,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,gBAAgB;AAClB,GAAwB;AACtB,QAAM,QAAqB;AAAA,IACzB,GAAG,YAAY,QAAQ,CAAC,QAAQ;AAC9B,YAAM,MAAM,WAAW,GAAG;AAC1B,YAAM,OAAO,MAAM,GAAG;AACtB,UAAI,CAAC,OAAO,CAAC,KAAM,QAAO,CAAC;AAC3B,aAAO,CAAC;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM,IAAI;AAAA,QACV,OAAO,IAAI;AAAA,QACX,OAAO,IAAI;AAAA,QACX,SAAS,IAAI;AAAA,QACb,KAAK,IAAI;AAAA,QACT,KAAK,aAAa,GAAG,KAAK;AAAA,MAC5B,CAAC;AAAA,IACH,CAAC;AAAA,IACD,GAAI,kBACA,CAAC;AAAA,MACC,KAAK;AAAA,MACL,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,MACP,SAAS;AAAA,MACT,KAAK;AAAA,MACL,KAAK;AAAA,IACP,CAAC,IACD,CAAC;AAAA,EACP;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,oBAAC,UAAO,WAAU,WAAU;AAAA,MAClC,OAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAU;AAAA,MAET,gBAAM,IAAI,CAAC,SACV,oBAAC,SAAmB,WAAU,yCAC5B,8BAAC,eAAY,MAAY,KADjB,KAAK,GAEf,CACD;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -38,34 +38,25 @@ var import_react = require("react");
|
|
|
38
38
|
var import_link = __toESM(require("./link.js"), 1);
|
|
39
39
|
var import_lucide_react = require("lucide-react");
|
|
40
40
|
var import_motion_primitives = require("./motion-primitives.js");
|
|
41
|
-
var import_currency_icon = require("./currency-icon.js");
|
|
42
41
|
var import_animated_token_media = require("./animated-token-media.js");
|
|
43
42
|
var import_cn = require("../utils/cn.js");
|
|
44
43
|
var import_format = require("../utils/format.js");
|
|
45
|
-
var import_dual_price = require("./dual-price.js");
|
|
46
44
|
var import_time = require("../utils/time.js");
|
|
47
45
|
var import_living_render_collections = require("../data/living-render-collections.js");
|
|
48
46
|
var import_sdk = require("@medialane/sdk");
|
|
49
47
|
var import_use_image_url = require("../utils/use-image-url.js");
|
|
50
|
-
function
|
|
48
|
+
function CardPrice({
|
|
51
49
|
amountFormatted,
|
|
52
50
|
currency,
|
|
53
51
|
usdValue
|
|
54
52
|
}) {
|
|
55
53
|
if (!amountFormatted) return null;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const stable = (0, import_format.isStableCurrency)(currency);
|
|
63
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
64
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs font-bold price-value", children: usdValue }),
|
|
65
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-2xs text-muted-foreground/70 inline-flex items-center gap-1", children: [
|
|
66
|
-
currency && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: currency, size: 10 }),
|
|
67
|
-
stable ? currency : `${(0, import_format.formatDisplayPrice)(amountFormatted)} ${currency}`
|
|
68
|
-
] })
|
|
54
|
+
const amount = (0, import_format.formatDisplayPrice)(amountFormatted);
|
|
55
|
+
const primary = usdValue ?? amount;
|
|
56
|
+
const secondary = !usdValue ? currency : (0, import_format.isStableCurrency)(currency) ? currency : `${amount} ${currency}`;
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "flex items-baseline gap-1.5 tabular-nums", children: [
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-base font-bold tracking-tight", children: primary }),
|
|
59
|
+
secondary && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-muted-foreground", children: secondary })
|
|
69
60
|
] });
|
|
70
61
|
}
|
|
71
62
|
function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowMenu, primaryAction, compact = false, imageUrl, usdValue }) {
|
|
@@ -80,8 +71,8 @@ function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowM
|
|
|
80
71
|
const assetHref = (0, import_sdk.assetHref)("STARKNET", order.nftContract ?? "", order.nftTokenId ?? "");
|
|
81
72
|
const showActionBar = !!(onBuy || onCart || overflowMenu || primaryAction);
|
|
82
73
|
if (compact) {
|
|
83
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.MotionCard, { className: "
|
|
84
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative aspect-square bg-muted overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.MotionCard, { className: "group", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: assetHref, className: "block", children: [
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative aspect-square bg-muted overflow-hidden rounded-xl", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
76
|
import_animated_token_media.AnimatedTokenMedia,
|
|
86
77
|
{
|
|
87
78
|
image,
|
|
@@ -96,15 +87,15 @@ function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowM
|
|
|
96
87
|
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-gradient-to-br from-brand-purple/15 to-brand-blue/15" })
|
|
97
88
|
}
|
|
98
89
|
) }),
|
|
99
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "
|
|
100
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-
|
|
101
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-0.5 pt-2.5 space-y-0.5", children: [
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-medium truncate", children: name }),
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardPrice, { amountFormatted: order.price?.formatted, currency: order.price?.currency, usdValue }),
|
|
102
93
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-muted-foreground", children: (0, import_time.timeAgo)(order.createdAt) })
|
|
103
94
|
] })
|
|
104
95
|
] }) });
|
|
105
96
|
}
|
|
106
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.MotionCard, { className: "
|
|
107
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative aspect-square bg-muted overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
97
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.MotionCard, { className: "group", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: assetHref, className: "block", children: [
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative aspect-square bg-muted overflow-hidden rounded-xl", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
108
99
|
import_animated_token_media.AnimatedTokenMedia,
|
|
109
100
|
{
|
|
110
101
|
image,
|
|
@@ -119,9 +110,11 @@ function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowM
|
|
|
119
110
|
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-gradient-to-br from-brand-purple/15 to-brand-blue/15" })
|
|
120
111
|
}
|
|
121
112
|
) }),
|
|
122
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "
|
|
123
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
124
|
-
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-0.5 pt-3 space-y-2.5", children: [
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 space-y-1", children: [
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium truncate", children: name }),
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardPrice, { amountFormatted: order.price?.formatted, currency: order.price?.currency, usdValue })
|
|
117
|
+
] }),
|
|
125
118
|
showActionBar && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
126
119
|
isListing ? primaryAction ? primaryAction : onBuy ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btn-border-animated p-[1.5px] rounded-[10px] flex-1 h-9", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
127
120
|
"button",
|
|
@@ -179,15 +172,14 @@ function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowM
|
|
|
179
172
|
] }) });
|
|
180
173
|
}
|
|
181
174
|
function ListingCardSkeleton() {
|
|
182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
183
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "aspect-square w-full bg-muted animate-pulse" }),
|
|
184
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "
|
|
175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
176
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "aspect-square w-full rounded-xl bg-muted animate-pulse" }),
|
|
177
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-0.5 pt-3 space-y-2.5", children: [
|
|
185
178
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
|
|
186
179
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4 w-3/4 bg-muted animate-pulse rounded" }),
|
|
187
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-5 w-1/2 bg-muted animate-pulse rounded" })
|
|
188
181
|
] }),
|
|
189
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-
|
|
190
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-3 w-2/3 bg-muted animate-pulse rounded" })
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-9 w-full bg-muted animate-pulse rounded-[9px]" })
|
|
191
183
|
] })
|
|
192
184
|
] });
|
|
193
185
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/listing-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"./link.js\";\nimport { ShoppingCart, Check, Zap, ArrowUpRight } from \"lucide-react\";\nimport { MotionCard } from \"./motion-primitives.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { AnimatedTokenMedia } from \"./animated-token-media.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice, isStableCurrency } from \"../utils/format.js\";\nimport { DualPrice } from \"./dual-price.js\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { isLivingRenderCollection } from \"../data/living-render-collections.js\";\nimport { assetHref as buildAssetHref, type ApiOrder, type Chain } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\ntype OrderWithAnimation = ApiOrder & { token: (ApiOrder[\"token\"] & { animationUrl?: string | null }) | null };\n\nfunction PriceLine({\n amountFormatted, currency, usdValue,\n}: {\n amountFormatted: string | null | undefined;\n currency: string | null | undefined;\n usdValue?: string | null;\n}) {\n if (!amountFormatted) return null;\n if (!usdValue) {\n return (\n <p className=\"text-2xs font-bold price-value inline-flex items-center gap-1\">\n {currency && <CurrencyIcon symbol={currency} size={11} />}\n {formatDisplayPrice(amountFormatted)}\n </p>\n );\n }\n const stable = isStableCurrency(currency);\n return (\n <>\n <p className=\"text-2xs font-bold price-value\">\n {usdValue}\n </p>\n <p className=\"text-2xs text-muted-foreground/70 inline-flex items-center gap-1\">\n {currency && <CurrencyIcon symbol={currency} size={10} />}\n {stable ? currency : `${formatDisplayPrice(amountFormatted)} ${currency}`}\n </p>\n </>\n );\n}\n\nexport interface ListingCardProps {\n order: ApiOrder;\n inCart?: boolean;\n onBuy?: (order: ApiOrder) => void;\n onCart?: (order: ApiOrder) => void;\n\n overflowMenu?: React.ReactNode;\n\n primaryAction?: React.ReactNode;\n compact?: boolean;\n\n imageUrl?: string | null;\n\n usdValue?: string | null;\n}\n\nexport function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowMenu, primaryAction, compact = false, imageUrl, usdValue }: ListingCardProps) {\n const resolveImage = useImageUrl();\n const order = rawOrder as OrderWithAnimation;\n const [imgError, setImgError] = useState(false);\n const isListing = order.offer.itemType === \"ERC721\" || order.offer.itemType === \"ERC1155\";\n const name = order.token?.name ?? `Token #${order.nftTokenId}`;\n const image = imageUrl !== undefined ? imageUrl : (order.token?.image ? resolveImage(order.token.image, { width: 480 }) : null);\n\n const animationUrl = order.token?.animationUrl ?? null;\n const live = !!(order.chain && order.nftContract) && isLivingRenderCollection(order.chain.toUpperCase() as Chain, order.nftContract!);\n const assetHref = buildAssetHref(\"STARKNET\", order.nftContract ?? \"\", order.nftTokenId ?? \"\");\n\n const showActionBar = !!(onBuy || onCart || overflowMenu || primaryAction);\n\n if (compact) {\n return (\n <MotionCard className=\"card-base group\">\n <Link href={assetHref} className=\"block\">\n <div className=\"relative aspect-square bg-muted overflow-hidden\">\n <AnimatedTokenMedia\n image={image}\n animationUrl={animationUrl}\n live={live}\n alt={name}\n mode=\"fill\"\n sizes=\"(max-width: 640px) 33vw, 20vw\"\n className=\"object-cover\"\n imgError={imgError}\n onImageError={() => setImgError(true)}\n fallback={\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/15 to-brand-blue/15\" />\n }\n />\n </div>\n <div className=\"p-2.5 space-y-0.5\">\n <p className=\"text-xs font-semibold line-clamp-2 break-words\">{name}</p>\n <PriceLine amountFormatted={order.price?.formatted} currency={order.price?.currency} usdValue={usdValue} />\n <p className=\"text-2xs text-muted-foreground\">{timeAgo(order.createdAt)}</p>\n </div>\n </Link>\n </MotionCard>\n );\n }\n\n return (\n <MotionCard className=\"card-base group\">\n <Link href={assetHref} className=\"block\">\n <div className=\"relative aspect-square bg-muted overflow-hidden\">\n <AnimatedTokenMedia\n image={image}\n animationUrl={animationUrl}\n live={live}\n alt={name}\n mode=\"fill\"\n sizes=\"(max-width: 640px) 50vw, (max-width: 1024px) 33vw, 25vw\"\n className=\"object-cover\"\n imgError={imgError}\n onImageError={() => setImgError(true)}\n fallback={\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/15 to-brand-blue/15\" />\n }\n />\n </div>\n\n <div className=\"p-3.5 space-y-3\">\n <div className=\"min-w-0\">\n <p className=\"text-base font-semibold tracking-tight line-clamp-2 break-words leading-snug\">{name}</p>\n </div>\n\n {order.price?.formatted && (\n <DualPrice amountFormatted={order.price.formatted} currency={order.price.currency} usdValue={usdValue} scale=\"card\" />\n )}\n\n {showActionBar && (\n <div className=\"flex items-center gap-1.5\">\n {isListing ? (\n primaryAction ? (\n primaryAction\n ) : onBuy ? (\n <div className=\"btn-border-animated p-[1.5px] rounded-[10px] flex-1 h-9\">\n <button\n className=\"w-full h-full rounded-[9px] bg-background flex items-center justify-center gap-1.5 text-xs font-semibold text-foreground hover:bg-muted/60 transition-all active:scale-[0.98]\"\n onClick={(e) => { e.preventDefault(); onBuy(order); }}\n >\n <Zap className=\"h-3.5 w-3.5 shrink-0\" /> Buy\n </button>\n </div>\n ) : (\n <Link\n href={assetHref}\n className=\"flex-1 h-9 inline-flex items-center justify-center gap-1.5 rounded-[9px] border border-border bg-background text-xs font-semibold text-foreground hover:bg-muted/60 transition-all active:scale-[0.98]\"\n >\n <ArrowUpRight className=\"h-3.5 w-3.5 shrink-0\" /> View\n </Link>\n )\n ) : (\n <Link\n href={assetHref}\n className=\"flex-1 h-9 inline-flex items-center justify-center gap-1.5 rounded-[9px] border border-border bg-background text-xs font-semibold text-foreground hover:bg-muted/60 transition-all active:scale-[0.98]\"\n >\n <ArrowUpRight className=\"h-3.5 w-3.5 shrink-0\" /> View asset\n </Link>\n )}\n {onCart && (\n <button\n className={cn(\n \"min-h-11 min-w-11 shrink-0 rounded-[9px] border flex items-center justify-center transition-colors\",\n inCart\n ? \"border-brand-orange/50 bg-brand-orange/10 text-brand-orange\"\n : \"border-border bg-background hover:bg-muted text-foreground\"\n )}\n onClick={(e) => { e.preventDefault(); if (!inCart) onCart(order); }}\n disabled={inCart}\n aria-label={inCart ? \"Added to cart\" : \"Add to cart\"}\n >\n {inCart ? <Check className=\"h-3.5 w-3.5\" /> : <ShoppingCart className=\"h-3.5 w-3.5\" />}\n </button>\n )}\n {overflowMenu}\n </div>\n )}\n </div>\n </Link>\n </MotionCard>\n );\n}\n\nexport function ListingCardSkeleton() {\n return (\n <div className=\"card-base\">\n <div className=\"aspect-square w-full bg-muted animate-pulse\" />\n <div className=\"p-3 space-y-2.5\">\n <div className=\"space-y-1\">\n <div className=\"h-4 w-3/4 bg-muted animate-pulse rounded\" />\n <div className=\"h-3 w-1/2 bg-muted animate-pulse rounded\" />\n </div>\n <div className=\"h-6 w-1/2 bg-muted animate-pulse rounded\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IAAK,4CAAC,oCAAa,WAAU,eAAc;AAAA;AAAA,QACtF;AAAA,QAED;AAAA,SACH;AAAA,OAEJ;AAAA,KACF,GACF;AAEJ;AAEO,SAAS,sBAAsB;AACpC,SACE,6CAAC,SAAI,WAAU,aACb;AAAA,gDAAC,SAAI,WAAU,+CAA8C;AAAA,IAC7D,6CAAC,SAAI,WAAU,mBACb;AAAA,mDAAC,SAAI,WAAU,aACb;AAAA,oDAAC,SAAI,WAAU,4CAA2C;AAAA,QAC1D,4CAAC,SAAI,WAAU,4CAA2C;AAAA,SAC5D;AAAA,MACA,4CAAC,SAAI,WAAU,4CAA2C;AAAA,MAC1D,4CAAC,SAAI,WAAU,4CAA2C;AAAA,OAC5D;AAAA,KACF;AAEJ;","names":["buildAssetHref","Link"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/listing-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"./link.js\";\nimport { ShoppingCart, Check, Zap, ArrowUpRight } from \"lucide-react\";\nimport { MotionCard } from \"./motion-primitives.js\";\nimport { AnimatedTokenMedia } from \"./animated-token-media.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice, isStableCurrency } from \"../utils/format.js\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { isLivingRenderCollection } from \"../data/living-render-collections.js\";\nimport { assetHref as buildAssetHref, type ApiOrder, type Chain } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\ntype OrderWithAnimation = ApiOrder & { token: (ApiOrder[\"token\"] & { animationUrl?: string | null }) | null };\n\nfunction CardPrice({\n amountFormatted, currency, usdValue,\n}: {\n amountFormatted: string | null | undefined;\n currency: string | null | undefined;\n usdValue?: string | null;\n}) {\n if (!amountFormatted) return null;\n const amount = formatDisplayPrice(amountFormatted);\n const primary = usdValue ?? amount;\n const secondary = !usdValue ? currency : isStableCurrency(currency) ? currency : `${amount} ${currency}`;\n return (\n <p className=\"flex items-baseline gap-1.5 tabular-nums\">\n <span className=\"text-base font-bold tracking-tight\">{primary}</span>\n {secondary && <span className=\"text-xs text-muted-foreground\">{secondary}</span>}\n </p>\n );\n}\n\nexport interface ListingCardProps {\n order: ApiOrder;\n inCart?: boolean;\n onBuy?: (order: ApiOrder) => void;\n onCart?: (order: ApiOrder) => void;\n\n overflowMenu?: React.ReactNode;\n\n primaryAction?: React.ReactNode;\n compact?: boolean;\n\n imageUrl?: string | null;\n\n usdValue?: string | null;\n}\n\nexport function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowMenu, primaryAction, compact = false, imageUrl, usdValue }: ListingCardProps) {\n const resolveImage = useImageUrl();\n const order = rawOrder as OrderWithAnimation;\n const [imgError, setImgError] = useState(false);\n const isListing = order.offer.itemType === \"ERC721\" || order.offer.itemType === \"ERC1155\";\n const name = order.token?.name ?? `Token #${order.nftTokenId}`;\n const image = imageUrl !== undefined ? imageUrl : (order.token?.image ? resolveImage(order.token.image, { width: 480 }) : null);\n\n const animationUrl = order.token?.animationUrl ?? null;\n const live = !!(order.chain && order.nftContract) && isLivingRenderCollection(order.chain.toUpperCase() as Chain, order.nftContract!);\n const assetHref = buildAssetHref(\"STARKNET\", order.nftContract ?? \"\", order.nftTokenId ?? \"\");\n\n const showActionBar = !!(onBuy || onCart || overflowMenu || primaryAction);\n\n if (compact) {\n return (\n <MotionCard className=\"group\">\n <Link href={assetHref} className=\"block\">\n <div className=\"relative aspect-square bg-muted overflow-hidden rounded-xl\">\n <AnimatedTokenMedia\n image={image}\n animationUrl={animationUrl}\n live={live}\n alt={name}\n mode=\"fill\"\n sizes=\"(max-width: 640px) 33vw, 20vw\"\n className=\"object-cover\"\n imgError={imgError}\n onImageError={() => setImgError(true)}\n fallback={\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/15 to-brand-blue/15\" />\n }\n />\n </div>\n <div className=\"px-0.5 pt-2.5 space-y-0.5\">\n <p className=\"text-xs font-medium truncate\">{name}</p>\n <CardPrice amountFormatted={order.price?.formatted} currency={order.price?.currency} usdValue={usdValue} />\n <p className=\"text-2xs text-muted-foreground\">{timeAgo(order.createdAt)}</p>\n </div>\n </Link>\n </MotionCard>\n );\n }\n\n return (\n <MotionCard className=\"group\">\n <Link href={assetHref} className=\"block\">\n <div className=\"relative aspect-square bg-muted overflow-hidden rounded-xl\">\n <AnimatedTokenMedia\n image={image}\n animationUrl={animationUrl}\n live={live}\n alt={name}\n mode=\"fill\"\n sizes=\"(max-width: 640px) 50vw, (max-width: 1024px) 33vw, 25vw\"\n className=\"object-cover\"\n imgError={imgError}\n onImageError={() => setImgError(true)}\n fallback={\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/15 to-brand-blue/15\" />\n }\n />\n </div>\n\n <div className=\"px-0.5 pt-3 space-y-2.5\">\n <div className=\"min-w-0 space-y-1\">\n <p className=\"text-sm font-medium truncate\">{name}</p>\n <CardPrice amountFormatted={order.price?.formatted} currency={order.price?.currency} usdValue={usdValue} />\n </div>\n\n {showActionBar && (\n <div className=\"flex items-center gap-1.5\">\n {isListing ? (\n primaryAction ? (\n primaryAction\n ) : onBuy ? (\n <div className=\"btn-border-animated p-[1.5px] rounded-[10px] flex-1 h-9\">\n <button\n className=\"w-full h-full rounded-[9px] bg-background flex items-center justify-center gap-1.5 text-xs font-semibold text-foreground hover:bg-muted/60 transition-all active:scale-[0.98]\"\n onClick={(e) => { e.preventDefault(); onBuy(order); }}\n >\n <Zap className=\"h-3.5 w-3.5 shrink-0\" /> Buy\n </button>\n </div>\n ) : (\n <Link\n href={assetHref}\n className=\"flex-1 h-9 inline-flex items-center justify-center gap-1.5 rounded-[9px] border border-border bg-background text-xs font-semibold text-foreground hover:bg-muted/60 transition-all active:scale-[0.98]\"\n >\n <ArrowUpRight className=\"h-3.5 w-3.5 shrink-0\" /> View\n </Link>\n )\n ) : (\n <Link\n href={assetHref}\n className=\"flex-1 h-9 inline-flex items-center justify-center gap-1.5 rounded-[9px] border border-border bg-background text-xs font-semibold text-foreground hover:bg-muted/60 transition-all active:scale-[0.98]\"\n >\n <ArrowUpRight className=\"h-3.5 w-3.5 shrink-0\" /> View asset\n </Link>\n )}\n {onCart && (\n <button\n className={cn(\n \"min-h-11 min-w-11 shrink-0 rounded-[9px] border flex items-center justify-center transition-colors\",\n inCart\n ? \"border-brand-orange/50 bg-brand-orange/10 text-brand-orange\"\n : \"border-border bg-background hover:bg-muted text-foreground\"\n )}\n onClick={(e) => { e.preventDefault(); if (!inCart) onCart(order); }}\n disabled={inCart}\n aria-label={inCart ? \"Added to cart\" : \"Add to cart\"}\n >\n {inCart ? <Check className=\"h-3.5 w-3.5\" /> : <ShoppingCart className=\"h-3.5 w-3.5\" />}\n </button>\n )}\n {overflowMenu}\n </div>\n )}\n </div>\n </Link>\n </MotionCard>\n );\n}\n\nexport function ListingCardSkeleton() {\n return (\n <div>\n <div className=\"aspect-square w-full rounded-xl bg-muted animate-pulse\" />\n <div className=\"px-0.5 pt-3 space-y-2.5\">\n <div className=\"space-y-1\">\n <div className=\"h-4 w-3/4 bg-muted animate-pulse rounded\" />\n <div className=\"h-5 w-1/2 bg-muted animate-pulse rounded\" />\n </div>\n <div className=\"h-9 w-full bg-muted animate-pulse rounded-[9px]\" />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BI;AA1BJ,mBAAyB;AACzB,kBAAiB;AACjB,0BAAuD;AACvD,+BAA2B;AAC3B,kCAAmC;AACnC,gBAAmB;AACnB,oBAAqD;AACrD,kBAAwB;AACxB,uCAAyC;AACzC,iBAAuE;AACvE,2BAA4B;AAI5B,SAAS,UAAU;AAAA,EACjB;AAAA,EAAiB;AAAA,EAAU;AAC7B,GAIG;AACD,MAAI,CAAC,gBAAiB,QAAO;AAC7B,QAAM,aAAS,kCAAmB,eAAe;AACjD,QAAM,UAAU,YAAY;AAC5B,QAAM,YAAY,CAAC,WAAW,eAAW,gCAAi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AAU;AAAA,YAEV;AAAA,0DAAC,oCAAa,WAAU,wBAAuB;AAAA,cAAE;AAAA;AAAA;AAAA,QACnD,IAGF;AAAA,UAAC,YAAAA;AAAA,UAAA;AAAA,YACC,MAAM;AAAA,YACN,WAAU;AAAA,YAEV;AAAA,0DAAC,oCAAa,WAAU,wBAAuB;AAAA,cAAE;AAAA;AAAA;AAAA,QACnD;AAAA,QAED,UACC;AAAA,UAAC;AAAA;AAAA,YACC,eAAW;AAAA,cACT;AAAA,cACA,SACI,gEACA;AAAA,YACN;AAAA,YACA,SAAS,CAAC,MAAM;AAAE,gBAAE,eAAe;AAAG,kBAAI,CAAC,OAAQ,QAAO,KAAK;AAAA,YAAG;AAAA,YAClE,UAAU;AAAA,YACV,cAAY,SAAS,kBAAkB;AAAA,YAEtC,mBAAS,4CAAC,6BAAM,WAAU,eAAc,IAAK,4CAAC,oCAAa,WAAU,eAAc;AAAA;AAAA,QACtF;AAAA,QAED;AAAA,SACH;AAAA,OAEJ;AAAA,KACF,GACF;AAEJ;AAEO,SAAS,sBAAsB;AACpC,SACE,6CAAC,SACC;AAAA,gDAAC,SAAI,WAAU,0DAAyD;AAAA,IACxE,6CAAC,SAAI,WAAU,2BACb;AAAA,mDAAC,SAAI,WAAU,aACb;AAAA,oDAAC,SAAI,WAAU,4CAA2C;AAAA,QAC1D,4CAAC,SAAI,WAAU,4CAA2C;AAAA,SAC5D;AAAA,MACA,4CAAC,SAAI,WAAU,mDAAkD;AAAA,OACnE;AAAA,KACF;AAEJ;","names":["buildAssetHref","Link"]}
|
|
@@ -1,37 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import Link from "./link.js";
|
|
5
5
|
import { ShoppingCart, Check, Zap, ArrowUpRight } from "lucide-react";
|
|
6
6
|
import { MotionCard } from "./motion-primitives.js";
|
|
7
|
-
import { CurrencyIcon } from "./currency-icon.js";
|
|
8
7
|
import { AnimatedTokenMedia } from "./animated-token-media.js";
|
|
9
8
|
import { cn } from "../utils/cn.js";
|
|
10
9
|
import { formatDisplayPrice, isStableCurrency } from "../utils/format.js";
|
|
11
|
-
import { DualPrice } from "./dual-price.js";
|
|
12
10
|
import { timeAgo } from "../utils/time.js";
|
|
13
11
|
import { isLivingRenderCollection } from "../data/living-render-collections.js";
|
|
14
12
|
import { assetHref as buildAssetHref } from "@medialane/sdk";
|
|
15
13
|
import { useImageUrl } from "../utils/use-image-url.js";
|
|
16
|
-
function
|
|
14
|
+
function CardPrice({
|
|
17
15
|
amountFormatted,
|
|
18
16
|
currency,
|
|
19
17
|
usdValue
|
|
20
18
|
}) {
|
|
21
19
|
if (!amountFormatted) return null;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const stable = isStableCurrency(currency);
|
|
29
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
|
-
/* @__PURE__ */ jsx("p", { className: "text-2xs font-bold price-value", children: usdValue }),
|
|
31
|
-
/* @__PURE__ */ jsxs("p", { className: "text-2xs text-muted-foreground/70 inline-flex items-center gap-1", children: [
|
|
32
|
-
currency && /* @__PURE__ */ jsx(CurrencyIcon, { symbol: currency, size: 10 }),
|
|
33
|
-
stable ? currency : `${formatDisplayPrice(amountFormatted)} ${currency}`
|
|
34
|
-
] })
|
|
20
|
+
const amount = formatDisplayPrice(amountFormatted);
|
|
21
|
+
const primary = usdValue ?? amount;
|
|
22
|
+
const secondary = !usdValue ? currency : isStableCurrency(currency) ? currency : `${amount} ${currency}`;
|
|
23
|
+
return /* @__PURE__ */ jsxs("p", { className: "flex items-baseline gap-1.5 tabular-nums", children: [
|
|
24
|
+
/* @__PURE__ */ jsx("span", { className: "text-base font-bold tracking-tight", children: primary }),
|
|
25
|
+
secondary && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: secondary })
|
|
35
26
|
] });
|
|
36
27
|
}
|
|
37
28
|
function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowMenu, primaryAction, compact = false, imageUrl, usdValue }) {
|
|
@@ -46,8 +37,8 @@ function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowM
|
|
|
46
37
|
const assetHref = buildAssetHref("STARKNET", order.nftContract ?? "", order.nftTokenId ?? "");
|
|
47
38
|
const showActionBar = !!(onBuy || onCart || overflowMenu || primaryAction);
|
|
48
39
|
if (compact) {
|
|
49
|
-
return /* @__PURE__ */ jsx(MotionCard, { className: "
|
|
50
|
-
/* @__PURE__ */ jsx("div", { className: "relative aspect-square bg-muted overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
40
|
+
return /* @__PURE__ */ jsx(MotionCard, { className: "group", children: /* @__PURE__ */ jsxs(Link, { href: assetHref, className: "block", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("div", { className: "relative aspect-square bg-muted overflow-hidden rounded-xl", children: /* @__PURE__ */ jsx(
|
|
51
42
|
AnimatedTokenMedia,
|
|
52
43
|
{
|
|
53
44
|
image,
|
|
@@ -62,15 +53,15 @@ function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowM
|
|
|
62
53
|
fallback: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-br from-brand-purple/15 to-brand-blue/15" })
|
|
63
54
|
}
|
|
64
55
|
) }),
|
|
65
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
66
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-
|
|
67
|
-
/* @__PURE__ */ jsx(
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: "px-0.5 pt-2.5 space-y-0.5", children: [
|
|
57
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium truncate", children: name }),
|
|
58
|
+
/* @__PURE__ */ jsx(CardPrice, { amountFormatted: order.price?.formatted, currency: order.price?.currency, usdValue }),
|
|
68
59
|
/* @__PURE__ */ jsx("p", { className: "text-2xs text-muted-foreground", children: timeAgo(order.createdAt) })
|
|
69
60
|
] })
|
|
70
61
|
] }) });
|
|
71
62
|
}
|
|
72
|
-
return /* @__PURE__ */ jsx(MotionCard, { className: "
|
|
73
|
-
/* @__PURE__ */ jsx("div", { className: "relative aspect-square bg-muted overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
63
|
+
return /* @__PURE__ */ jsx(MotionCard, { className: "group", children: /* @__PURE__ */ jsxs(Link, { href: assetHref, className: "block", children: [
|
|
64
|
+
/* @__PURE__ */ jsx("div", { className: "relative aspect-square bg-muted overflow-hidden rounded-xl", children: /* @__PURE__ */ jsx(
|
|
74
65
|
AnimatedTokenMedia,
|
|
75
66
|
{
|
|
76
67
|
image,
|
|
@@ -85,9 +76,11 @@ function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowM
|
|
|
85
76
|
fallback: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-br from-brand-purple/15 to-brand-blue/15" })
|
|
86
77
|
}
|
|
87
78
|
) }),
|
|
88
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
79
|
+
/* @__PURE__ */ jsxs("div", { className: "px-0.5 pt-3 space-y-2.5", children: [
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
81
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: name }),
|
|
82
|
+
/* @__PURE__ */ jsx(CardPrice, { amountFormatted: order.price?.formatted, currency: order.price?.currency, usdValue })
|
|
83
|
+
] }),
|
|
91
84
|
showActionBar && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
92
85
|
isListing ? primaryAction ? primaryAction : onBuy ? /* @__PURE__ */ jsx("div", { className: "btn-border-animated p-[1.5px] rounded-[10px] flex-1 h-9", children: /* @__PURE__ */ jsxs(
|
|
93
86
|
"button",
|
|
@@ -145,15 +138,14 @@ function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowM
|
|
|
145
138
|
] }) });
|
|
146
139
|
}
|
|
147
140
|
function ListingCardSkeleton() {
|
|
148
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
149
|
-
/* @__PURE__ */ jsx("div", { className: "aspect-square w-full bg-muted animate-pulse" }),
|
|
150
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
141
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
142
|
+
/* @__PURE__ */ jsx("div", { className: "aspect-square w-full rounded-xl bg-muted animate-pulse" }),
|
|
143
|
+
/* @__PURE__ */ jsxs("div", { className: "px-0.5 pt-3 space-y-2.5", children: [
|
|
151
144
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
152
145
|
/* @__PURE__ */ jsx("div", { className: "h-4 w-3/4 bg-muted animate-pulse rounded" }),
|
|
153
|
-
/* @__PURE__ */ jsx("div", { className: "h-
|
|
146
|
+
/* @__PURE__ */ jsx("div", { className: "h-5 w-1/2 bg-muted animate-pulse rounded" })
|
|
154
147
|
] }),
|
|
155
|
-
/* @__PURE__ */ jsx("div", { className: "h-
|
|
156
|
-
/* @__PURE__ */ jsx("div", { className: "h-3 w-2/3 bg-muted animate-pulse rounded" })
|
|
148
|
+
/* @__PURE__ */ jsx("div", { className: "h-9 w-full bg-muted animate-pulse rounded-[9px]" })
|
|
157
149
|
] })
|
|
158
150
|
] });
|
|
159
151
|
}
|