@medialane/ui 0.382.0 → 0.384.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/account-section.cjs +3 -4
- package/dist/components/account/account-section.cjs.map +1 -1
- package/dist/components/account/account-section.d.cts +3 -3
- package/dist/components/account/account-section.d.ts +3 -3
- package/dist/components/account/account-section.js +3 -4
- package/dist/components/account/account-section.js.map +1 -1
- package/dist/components/account/guardian-recovery-section.cjs +2 -1
- package/dist/components/account/guardian-recovery-section.cjs.map +1 -1
- package/dist/components/account/guardian-recovery-section.js +2 -1
- package/dist/components/account/guardian-recovery-section.js.map +1 -1
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/accounts-page.cjs +2 -1
- package/dist/components/accounts-page.cjs.map +1 -1
- package/dist/components/accounts-page.js +2 -1
- package/dist/components/accounts-page.js.map +1 -1
- package/dist/components/activities-feed.cjs +2 -1
- package/dist/components/activities-feed.cjs.map +1 -1
- package/dist/components/activities-feed.js +2 -1
- package/dist/components/activities-feed.js.map +1 -1
- package/dist/components/activity-timeline-row.cjs +2 -1
- package/dist/components/activity-timeline-row.cjs.map +1 -1
- package/dist/components/activity-timeline-row.js +2 -1
- package/dist/components/activity-timeline-row.js.map +1 -1
- package/dist/components/asset-overview-content.cjs +2 -1
- package/dist/components/asset-overview-content.cjs.map +1 -1
- package/dist/components/asset-overview-content.js +2 -1
- package/dist/components/asset-overview-content.js.map +1 -1
- package/dist/components/asset-picker.cjs +2 -1
- package/dist/components/asset-picker.cjs.map +1 -1
- package/dist/components/asset-picker.js +2 -1
- package/dist/components/asset-picker.js.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/claim-rail.cjs +5 -8
- package/dist/components/claim-rail.cjs.map +1 -1
- package/dist/components/claim-rail.d.cts +1 -4
- package/dist/components/claim-rail.d.ts +1 -4
- package/dist/components/claim-rail.js +5 -8
- package/dist/components/claim-rail.js.map +1 -1
- package/dist/components/collection-settings.cjs +2 -3
- package/dist/components/collection-settings.cjs.map +1 -1
- package/dist/components/collection-settings.js +2 -3
- package/dist/components/collection-settings.js.map +1 -1
- package/dist/components/collection-slug-claim.cjs +1 -7
- package/dist/components/collection-slug-claim.cjs.map +1 -1
- package/dist/components/collection-slug-claim.js +1 -7
- package/dist/components/collection-slug-claim.js.map +1 -1
- package/dist/components/comments-section.cjs +2 -1
- package/dist/components/comments-section.cjs.map +1 -1
- package/dist/components/comments-section.js +2 -1
- package/dist/components/comments-section.js.map +1 -1
- package/dist/components/discover-features.cjs +7 -6
- package/dist/components/discover-features.cjs.map +1 -1
- package/dist/components/discover-features.js +7 -6
- package/dist/components/discover-features.js.map +1 -1
- package/dist/components/empty-or-error.cjs +3 -2
- package/dist/components/empty-or-error.cjs.map +1 -1
- package/dist/components/empty-or-error.js +3 -2
- package/dist/components/empty-or-error.js.map +1 -1
- package/dist/components/gated-content.cjs +5 -4
- package/dist/components/gated-content.cjs.map +1 -1
- package/dist/components/gated-content.js +5 -4
- package/dist/components/gated-content.js.map +1 -1
- package/dist/components/icon-tile.cjs +49 -0
- package/dist/components/icon-tile.cjs.map +1 -0
- package/dist/components/icon-tile.d.cts +17 -0
- package/dist/components/icon-tile.d.ts +17 -0
- package/dist/components/icon-tile.js +25 -0
- package/dist/components/icon-tile.js.map +1 -0
- package/dist/components/ip-type-nav.cjs +3 -3
- package/dist/components/ip-type-nav.cjs.map +1 -1
- package/dist/components/ip-type-nav.js +3 -3
- package/dist/components/ip-type-nav.js.map +1 -1
- package/dist/components/ip-type-page.cjs +3 -2
- package/dist/components/ip-type-page.cjs.map +1 -1
- package/dist/components/ip-type-page.js +3 -2
- package/dist/components/ip-type-page.js.map +1 -1
- package/dist/components/journey-content.cjs +2 -1
- package/dist/components/journey-content.cjs.map +1 -1
- package/dist/components/journey-content.js +2 -1
- package/dist/components/journey-content.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
- package/dist/components/launchpad-services.cjs +27 -22
- package/dist/components/launchpad-services.cjs.map +1 -1
- package/dist/components/launchpad-services.d.cts +2 -0
- package/dist/components/launchpad-services.d.ts +2 -0
- package/dist/components/launchpad-services.js +27 -22
- package/dist/components/launchpad-services.js.map +1 -1
- package/dist/components/launchpad-strip.cjs +6 -1
- package/dist/components/launchpad-strip.cjs.map +1 -1
- package/dist/components/launchpad-strip.js +6 -1
- package/dist/components/launchpad-strip.js.map +1 -1
- package/dist/components/license-request-page.cjs +2 -1
- package/dist/components/license-request-page.cjs.map +1 -1
- package/dist/components/license-request-page.js +2 -1
- package/dist/components/license-request-page.js.map +1 -1
- package/dist/components/marketplace-dialog-primitives.cjs +2 -1
- package/dist/components/marketplace-dialog-primitives.cjs.map +1 -1
- package/dist/components/marketplace-dialog-primitives.js +2 -1
- package/dist/components/marketplace-dialog-primitives.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-home.cjs +3 -2
- package/dist/components/media-wallet/media-wallet-home.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-home.js +3 -2
- package/dist/components/media-wallet/media-wallet-home.js.map +1 -1
- package/dist/components/media-wallet/wallet-activity-icon.cjs +5 -8
- package/dist/components/media-wallet/wallet-activity-icon.cjs.map +1 -1
- package/dist/components/media-wallet/wallet-activity-icon.js +5 -8
- package/dist/components/media-wallet/wallet-activity-icon.js.map +1 -1
- package/dist/components/mint-landing.cjs +7 -10
- package/dist/components/mint-landing.cjs.map +1 -1
- package/dist/components/mint-landing.js +7 -10
- package/dist/components/mint-landing.js.map +1 -1
- package/dist/components/nav-command-menu.cjs +2 -1
- package/dist/components/nav-command-menu.cjs.map +1 -1
- package/dist/components/nav-command-menu.js +2 -1
- package/dist/components/nav-command-menu.js.map +1 -1
- package/dist/components/remixes-tab.cjs +2 -1
- package/dist/components/remixes-tab.cjs.map +1 -1
- package/dist/components/remixes-tab.js +2 -1
- package/dist/components/remixes-tab.js.map +1 -1
- package/dist/components/rewards/badge-catalog.cjs +2 -1
- package/dist/components/rewards/badge-catalog.cjs.map +1 -1
- package/dist/components/rewards/badge-catalog.js +2 -1
- package/dist/components/rewards/badge-catalog.js.map +1 -1
- package/dist/components/rewards/leaderboard-panel.cjs +2 -1
- package/dist/components/rewards/leaderboard-panel.cjs.map +1 -1
- package/dist/components/rewards/leaderboard-panel.js +2 -1
- package/dist/components/rewards/leaderboard-panel.js.map +1 -1
- package/dist/components/rewards/rewards-dashboard.cjs +2 -4
- package/dist/components/rewards/rewards-dashboard.cjs.map +1 -1
- package/dist/components/rewards/rewards-dashboard.js +2 -4
- package/dist/components/rewards/rewards-dashboard.js.map +1 -1
- package/dist/components/rewards-section.cjs +2 -1
- package/dist/components/rewards-section.cjs.map +1 -1
- package/dist/components/rewards-section.js +2 -1
- package/dist/components/rewards-section.js.map +1 -1
- package/dist/components/route-error.cjs +2 -1
- package/dist/components/route-error.cjs.map +1 -1
- package/dist/components/route-error.js +2 -1
- package/dist/components/route-error.js.map +1 -1
- package/dist/components/service-collections-page.cjs +2 -1
- package/dist/components/service-collections-page.cjs.map +1 -1
- package/dist/components/service-collections-page.js +2 -1
- package/dist/components/service-collections-page.js.map +1 -1
- package/dist/components/settings-section.cjs +3 -4
- package/dist/components/settings-section.cjs.map +1 -1
- package/dist/components/settings-section.d.cts +1 -3
- package/dist/components/settings-section.d.ts +1 -3
- package/dist/components/settings-section.js +3 -4
- package/dist/components/settings-section.js.map +1 -1
- package/dist/components/sponsorship-offers-page.cjs +2 -1
- package/dist/components/sponsorship-offers-page.cjs.map +1 -1
- package/dist/components/sponsorship-offers-page.js +2 -1
- package/dist/components/sponsorship-offers-page.js.map +1 -1
- package/dist/components/tab-empty-state.cjs +2 -1
- package/dist/components/tab-empty-state.cjs.map +1 -1
- package/dist/components/tab-empty-state.js +2 -1
- package/dist/components/tab-empty-state.js.map +1 -1
- package/dist/components/transaction-dialog.cjs +2 -1
- package/dist/components/transaction-dialog.cjs.map +1 -1
- package/dist/components/transaction-dialog.js +2 -1
- package/dist/components/transaction-dialog.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/medialane.css +20 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/activity-timeline-row.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport {\n Tag, Handshake, TrendingUp, ArrowRightLeft, Sparkles,\n} from \"lucide-react\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { assetHref, type ApiActivity } from \"@medialane/sdk\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { msg } from \"../i18n/translate.js\";\nimport { ACTIVITY_TYPE_CONFIG } from \"../data/activity.js\";\n\n\nconst ACTIVITY_LABEL: Record<string, string> = {\n mint: msg(\"Minted\"),\n listing: msg(\"Listed\"),\n sale: msg(\"Sold\"),\n offer: msg(\"Offer\"),\n transfer: msg(\"Transfer\"),\n cancelled: msg(\"Cancelled\"),\n};\n\nconst ACTIVITY_ICONS: Record<string, React.ElementType> = {\n mint: Sparkles,\n listing: Tag,\n sale: Handshake,\n offer: TrendingUp,\n transfer: ArrowRightLeft,\n cancelled: ArrowRightLeft,\n};\n\nexport interface ActivityTimelineRowProps {\n event: ApiActivity;\n isLast: boolean;\n}\n\nexport function ActivityTimelineRow({\n event,\n isLast,\n}: ActivityTimelineRowProps) {\n const t = useT();\n const colors = ACTIVITY_TYPE_CONFIG[event.type] ?? ACTIVITY_TYPE_CONFIG.transfer;\n const label = ACTIVITY_LABEL[event.type] ?? ACTIVITY_LABEL.transfer;\n const Icon = ACTIVITY_ICONS[event.type] ?? ArrowRightLeft;\n const tokenId = event.nftTokenId ?? event.tokenId;\n const contract = event.nftContract ?? event.contractAddress;\n\n return (\n <div className=\"flex gap-4 group\">\n <div className=\"flex flex-col items-center shrink-0 w-9\">\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/activity-timeline-row.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport {\n Tag, Handshake, TrendingUp, ArrowRightLeft, Sparkles,\n} from \"lucide-react\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { assetHref, type ApiActivity } from \"@medialane/sdk\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { msg } from \"../i18n/translate.js\";\nimport { ACTIVITY_TYPE_CONFIG } from \"../data/activity.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\n\nconst ACTIVITY_LABEL: Record<string, string> = {\n mint: msg(\"Minted\"),\n listing: msg(\"Listed\"),\n sale: msg(\"Sold\"),\n offer: msg(\"Offer\"),\n transfer: msg(\"Transfer\"),\n cancelled: msg(\"Cancelled\"),\n};\n\nconst ACTIVITY_ICONS: Record<string, React.ElementType> = {\n mint: Sparkles,\n listing: Tag,\n sale: Handshake,\n offer: TrendingUp,\n transfer: ArrowRightLeft,\n cancelled: ArrowRightLeft,\n};\n\nexport interface ActivityTimelineRowProps {\n event: ApiActivity;\n isLast: boolean;\n}\n\nexport function ActivityTimelineRow({\n event,\n isLast,\n}: ActivityTimelineRowProps) {\n const t = useT();\n const colors = ACTIVITY_TYPE_CONFIG[event.type] ?? ACTIVITY_TYPE_CONFIG.transfer;\n const label = ACTIVITY_LABEL[event.type] ?? ACTIVITY_LABEL.transfer;\n const Icon = ACTIVITY_ICONS[event.type] ?? ArrowRightLeft;\n const tokenId = event.nftTokenId ?? event.tokenId;\n const contract = event.nftContract ?? event.contractAddress;\n\n return (\n <div className=\"flex gap-4 group\">\n <div className=\"flex flex-col items-center shrink-0 w-9\">\n <IconTile size=\"sm\">\n <Icon />\n </IconTile>\n {!isLast && <div className=\"flex-1 w-px bg-border/50 mt-1.5 min-h-4\" />}\n </div>\n <div className=\"flex-1 pb-5 min-w-0 pt-1\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className={cn(\"text-2xs font-bold\", colors.colorClass)}>\n {t(label)}\n </span>\n {contract && tokenId && (\n <Link href={assetHref(event.chain ?? \"STARKNET\", contract, tokenId)} className=\"text-xs text-muted-foreground hover:text-foreground transition-colors\">\n {t(\"View asset\")}\n </Link>\n )}\n </div>\n {contract && (\n <p className=\"text-2xs text-muted-foreground/60 tabular-nums mt-0.5 truncate\">\n {contract.slice(0, 10)}…{contract.slice(-6)}\n </p>\n )}\n </div>\n <div className=\"text-right shrink-0\">\n {event.price?.formatted && (\n <p className=\"text-sm font-semibold price-value leading-none\">\n {formatDisplayPrice(event.price.formatted)}\n </p>\n )}\n <p className=\"text-2xs text-muted-foreground mt-1\">{timeAgo(event.timestamp)}</p>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoDM;AAlDN,kBAAiB;AACjB,0BAEO;AACP,kBAAwB;AACxB,oBAAmC;AACnC,iBAA4C;AAC5C,gBAAmB;AACnB,sBAAqB;AACrB,uBAAoB;AACpB,sBAAqC;AACrC,uBAAyB;AAGzB,MAAM,iBAAyC;AAAA,EAC7C,UAAM,sBAAI,QAAQ;AAAA,EAClB,aAAS,sBAAI,QAAQ;AAAA,EACrB,UAAM,sBAAI,MAAM;AAAA,EAChB,WAAO,sBAAI,OAAO;AAAA,EAClB,cAAU,sBAAI,UAAU;AAAA,EACxB,eAAW,sBAAI,WAAW;AAC5B;AAEA,MAAM,iBAAoD;AAAA,EACxD,MAAW;AAAA,EACX,SAAW;AAAA,EACX,MAAW;AAAA,EACX,OAAW;AAAA,EACX,UAAW;AAAA,EACX,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 +15,7 @@ import { cn } from "../utils/cn.js";
|
|
|
15
15
|
import { useT } from "../i18n/provider.js";
|
|
16
16
|
import { msg } from "../i18n/translate.js";
|
|
17
17
|
import { ACTIVITY_TYPE_CONFIG } from "../data/activity.js";
|
|
18
|
+
import { IconTile } from "./icon-tile.js";
|
|
18
19
|
const ACTIVITY_LABEL = {
|
|
19
20
|
mint: msg("Minted"),
|
|
20
21
|
listing: msg("Listed"),
|
|
@@ -43,7 +44,7 @@ function ActivityTimelineRow({
|
|
|
43
44
|
const contract = event.nftContract ?? event.contractAddress;
|
|
44
45
|
return /* @__PURE__ */ jsxs("div", { className: "flex gap-4 group", children: [
|
|
45
46
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center shrink-0 w-9", children: [
|
|
46
|
-
/* @__PURE__ */ jsx(
|
|
47
|
+
/* @__PURE__ */ jsx(IconTile, { size: "sm", children: /* @__PURE__ */ jsx(Icon, {}) }),
|
|
47
48
|
!isLast && /* @__PURE__ */ jsx("div", { className: "flex-1 w-px bg-border/50 mt-1.5 min-h-4" })
|
|
48
49
|
] }),
|
|
49
50
|
/* @__PURE__ */ jsx("div", { className: "flex-1 pb-5 min-w-0 pt-1", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/activity-timeline-row.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport {\n Tag, Handshake, TrendingUp, ArrowRightLeft, Sparkles,\n} from \"lucide-react\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { assetHref, type ApiActivity } from \"@medialane/sdk\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { msg } from \"../i18n/translate.js\";\nimport { ACTIVITY_TYPE_CONFIG } from \"../data/activity.js\";\n\n\nconst ACTIVITY_LABEL: Record<string, string> = {\n mint: msg(\"Minted\"),\n listing: msg(\"Listed\"),\n sale: msg(\"Sold\"),\n offer: msg(\"Offer\"),\n transfer: msg(\"Transfer\"),\n cancelled: msg(\"Cancelled\"),\n};\n\nconst ACTIVITY_ICONS: Record<string, React.ElementType> = {\n mint: Sparkles,\n listing: Tag,\n sale: Handshake,\n offer: TrendingUp,\n transfer: ArrowRightLeft,\n cancelled: ArrowRightLeft,\n};\n\nexport interface ActivityTimelineRowProps {\n event: ApiActivity;\n isLast: boolean;\n}\n\nexport function ActivityTimelineRow({\n event,\n isLast,\n}: ActivityTimelineRowProps) {\n const t = useT();\n const colors = ACTIVITY_TYPE_CONFIG[event.type] ?? ACTIVITY_TYPE_CONFIG.transfer;\n const label = ACTIVITY_LABEL[event.type] ?? ACTIVITY_LABEL.transfer;\n const Icon = ACTIVITY_ICONS[event.type] ?? ArrowRightLeft;\n const tokenId = event.nftTokenId ?? event.tokenId;\n const contract = event.nftContract ?? event.contractAddress;\n\n return (\n <div className=\"flex gap-4 group\">\n <div className=\"flex flex-col items-center shrink-0 w-9\">\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/activity-timeline-row.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport {\n Tag, Handshake, TrendingUp, ArrowRightLeft, Sparkles,\n} from \"lucide-react\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { assetHref, type ApiActivity } from \"@medialane/sdk\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { msg } from \"../i18n/translate.js\";\nimport { ACTIVITY_TYPE_CONFIG } from \"../data/activity.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\n\nconst ACTIVITY_LABEL: Record<string, string> = {\n mint: msg(\"Minted\"),\n listing: msg(\"Listed\"),\n sale: msg(\"Sold\"),\n offer: msg(\"Offer\"),\n transfer: msg(\"Transfer\"),\n cancelled: msg(\"Cancelled\"),\n};\n\nconst ACTIVITY_ICONS: Record<string, React.ElementType> = {\n mint: Sparkles,\n listing: Tag,\n sale: Handshake,\n offer: TrendingUp,\n transfer: ArrowRightLeft,\n cancelled: ArrowRightLeft,\n};\n\nexport interface ActivityTimelineRowProps {\n event: ApiActivity;\n isLast: boolean;\n}\n\nexport function ActivityTimelineRow({\n event,\n isLast,\n}: ActivityTimelineRowProps) {\n const t = useT();\n const colors = ACTIVITY_TYPE_CONFIG[event.type] ?? ACTIVITY_TYPE_CONFIG.transfer;\n const label = ACTIVITY_LABEL[event.type] ?? ACTIVITY_LABEL.transfer;\n const Icon = ACTIVITY_ICONS[event.type] ?? ArrowRightLeft;\n const tokenId = event.nftTokenId ?? event.tokenId;\n const contract = event.nftContract ?? event.contractAddress;\n\n return (\n <div className=\"flex gap-4 group\">\n <div className=\"flex flex-col items-center shrink-0 w-9\">\n <IconTile size=\"sm\">\n <Icon />\n </IconTile>\n {!isLast && <div className=\"flex-1 w-px bg-border/50 mt-1.5 min-h-4\" />}\n </div>\n <div className=\"flex-1 pb-5 min-w-0 pt-1\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className={cn(\"text-2xs font-bold\", colors.colorClass)}>\n {t(label)}\n </span>\n {contract && tokenId && (\n <Link href={assetHref(event.chain ?? \"STARKNET\", contract, tokenId)} className=\"text-xs text-muted-foreground hover:text-foreground transition-colors\">\n {t(\"View asset\")}\n </Link>\n )}\n </div>\n {contract && (\n <p className=\"text-2xs text-muted-foreground/60 tabular-nums mt-0.5 truncate\">\n {contract.slice(0, 10)}…{contract.slice(-6)}\n </p>\n )}\n </div>\n <div className=\"text-right shrink-0\">\n {event.price?.formatted && (\n <p className=\"text-sm font-semibold price-value leading-none\">\n {formatDisplayPrice(event.price.formatted)}\n </p>\n )}\n <p className=\"text-2xs text-muted-foreground mt-1\">{timeAgo(event.timestamp)}</p>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AAoDM,SAEI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,sBAAsB,OAAO,UAAU,GACxD,YAAE,KAAK,GACV;AAAA,UACC,YAAY,WACX,oBAAC,QAAK,MAAM,UAAU,MAAM,SAAS,YAAY,UAAU,OAAO,GAAG,WAAU,yEAC5E,YAAE,YAAY,GACjB;AAAA,WAEJ;AAAA,QACC,YACC,qBAAC,OAAE,WAAU,kEACV;AAAA,mBAAS,MAAM,GAAG,EAAE;AAAA,UAAE;AAAA,UAAE,SAAS,MAAM,EAAE;AAAA,WAC5C;AAAA,SAEJ;AAAA,MACA,qBAAC,SAAI,WAAU,uBACZ;AAAA,cAAM,OAAO,aACZ,oBAAC,OAAE,WAAU,kDACV,6BAAmB,MAAM,MAAM,SAAS,GAC3C;AAAA,QAEF,oBAAC,OAAE,WAAU,uCAAuC,kBAAQ,MAAM,SAAS,GAAE;AAAA,SAC/E;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -31,6 +31,7 @@ var import_license_summary = require("../utils/license-summary.js");
|
|
|
31
31
|
var import_ip = require("../data/ip.js");
|
|
32
32
|
var import_provider = require("../i18n/provider.js");
|
|
33
33
|
var import_panel = require("./panel.js");
|
|
34
|
+
var import_icon_tile = require("./icon-tile.js");
|
|
34
35
|
function licenseLabel(value) {
|
|
35
36
|
const label = import_ip.LICENSE_TYPES.find((license) => license.value === value)?.label ?? value;
|
|
36
37
|
return label.split(" \u2014 ")[1] ?? label;
|
|
@@ -149,7 +150,7 @@ function AssetOverviewContent({
|
|
|
149
150
|
label
|
|
150
151
|
)) }),
|
|
151
152
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_panel.Panel, { tone: "rose", className: "col-span-2 lg:col-span-6 flex items-center gap-4 p-5 sm:p-6", children: [
|
|
152
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Scale, {}) }),
|
|
153
154
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm leading-relaxed text-muted-foreground", children: t("Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries.") })
|
|
154
155
|
] })
|
|
155
156
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, ExternalLink, GitBranch, Globe, Percent, Scale, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { MarkdownText } from \"./markdown-text.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\nimport { LICENSE_TYPES } from \"../data/ip.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel, Pill, type PanelColor } from \"./panel.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n content?: string | null;\n link?: string | null;\n}\n\nfunction licenseLabel(value: string): string {\n const label = LICENSE_TYPES.find((license) => license.value === value)?.label ?? value;\n return label.split(\" — \")[1] ?? label;\n}\n\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\nfunction fillSpans(units: number[], cols: number): number[] {\n const out = units.map((unit) => Math.min(unit, cols));\n const rest = out.reduce((sum, unit) => sum + unit, 0) % cols;\n if (rest && out.length) out[out.length - 1] += cols - rest;\n return out;\n}\n\nfunction bentoSpans(count: number): number[] {\n const out: number[] = [];\n const rows = [[2, 1], [1, 2]];\n for (let row = 0; out.length < count; row++) {\n const left = count - out.length;\n if (left === 1) out.push(3);\n else out.push(...rows[row % 2]);\n }\n return out;\n}\n\nconst SPAN_2: Record<number, string> = { 1: \"col-span-1\", 2: \"col-span-2\" };\nconst SPAN_SM_4: Record<number, string> = {\n 1: \"sm:col-span-1\",\n 2: \"sm:col-span-2\",\n 3: \"sm:col-span-3\",\n 4: \"sm:col-span-4\",\n};\nconst SPAN_LG_3: Record<number, string> = {\n 1: \"lg:col-span-1\",\n 2: \"lg:col-span-2\",\n 3: \"lg:col-span-3\",\n};\n\nfunction detailSpans(count: number): number[] {\n const out: number[] = [];\n while (out.length < count) {\n const left = count - out.length;\n if (left >= 5) out.push(1, 2, 1);\n else if (left === 4 || left === 2) out.push(...Array(left).fill(2));\n else if (left === 3) out.push(1, 2, 1);\n else out.push(4);\n }\n return out.slice(0, count);\n}\n\nfunction Cell({ label, value, className }: { label: string; value: ReactNode; className?: string }) {\n return (\n <Panel className={`flex flex-col justify-end gap-1.5 px-5 py-4 min-h-[5.5rem] ${className ?? \"\"}`}>\n <p className=\"truncate text-xs font-medium text-muted-foreground\" title={label}>{label}</p>\n <div className=\"text-lg font-semibold leading-tight tracking-tight text-foreground break-words\">{value}</div>\n </Panel>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\n const t = useT();\n const attr = (trait: string) => attributes.find((attribute) => attribute.trait_type === trait)?.value;\n const licenseType = attr(\"License\");\n const commercialUse = attr(\"Commercial Use\");\n const derivatives = attr(\"Derivatives\");\n const attribution = attr(\"Attribution\");\n const territory = attr(\"Territory\");\n const aiPolicy = attr(\"AI Policy\");\n const royalty = attr(\"Royalty\");\n const summary = licenseSummary(attributes);\n const hasLicenseData = !!(licenseType || commercialUse || derivatives || attribution);\n const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));\n\n const licenseDescription = LICENSE_TYPES.find((license) => license.value === licenseType)?.description;\n\n const factRows: { icon: typeof Bot; label: string; value?: string; tone: PanelColor }[] = [\n { icon: DollarSign, label: t(\"Commercial use\"), value: commercialUse, tone: \"orange\" },\n { icon: GitBranch, label: t(\"Derivatives\"), value: derivatives, tone: \"rose\" },\n { icon: UserCheck, label: t(\"Attribution\"), value: attribution, tone: \"maeve\" },\n { icon: Globe, label: t(\"Territory\"), value: territory, tone: \"blue\" },\n { icon: Bot, label: t(\"AI & data mining\"), value: aiPolicy, tone: \"purple\" },\n { icon: Percent, label: t(\"Royalty\"), value: royalty, tone: \"orange\" },\n ];\n const facts = factRows.filter((row) => !!row.value);\n\n const factSpans2 = fillSpans(facts.map(() => 1), 2);\n const factSpansLg = bentoSpans(facts.length);\n const detailUnits = displayAttributes.map((attribute) => (isAddressLike(attribute.value) ? 2 : 1));\n const detailSpans2 = fillSpans(detailUnits, 2);\n const detailSpansSm = detailSpans(displayAttributes.length).map((span, index) => Math.max(span, detailUnits[index]));\n\n return (\n <div className=\"mt-4 space-y-7\">\n {content ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Content\")}</h3>\n <MarkdownText text={content} />\n </section>\n ) : null}\n\n {link ? (\n <a href={link} target=\"_blank\" rel=\"noopener noreferrer\" className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\">\n <ExternalLink className=\"h-3.5 w-3.5\" />\n {t(\"Open link\")}\n </a>\n ) : null}\n\n {hasTemplateData ? <IPTypeDisplay attributes={attributes} /> : null}\n\n {hasLicenseData ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Rights\")}</h3>\n <div className=\"grid grid-cols-2 lg:grid-cols-6 gap-3\">\n <Panel tone=\"blue\" className=\"col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end gap-3 p-6 sm:p-8\">\n {licenseType ? (\n <p className=\"text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05] text-foreground\">\n {licenseLabel(licenseType)}\n </p>\n ) : null}\n {licenseDescription ? (\n <p className=\"max-w-md text-sm text-muted-foreground\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"text-base font-semibold leading-snug text-foreground\">{summary}</p>\n ) : null}\n </Panel>\n\n <div className=\"col-span-2 lg:col-span-3 grid grid-cols-2 lg:grid-cols-3 gap-3 auto-rows-[minmax(8.5rem,1fr)]\">\n {facts.map(({ icon: Icon, label, value, tone }, index) => (\n <Panel\n key={label}\n tone={tone}\n className={`flex flex-col justify-between gap-4 p-5 ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`}\n >\n <Pill color={tone}>\n <Icon className=\"h-3.5 w-3.5\" />\n {label}\n </Pill>\n <p className=\"text-xl sm:text-2xl font-semibold leading-none tracking-tight break-words text-foreground\">{value}</p>\n </Panel>\n ))}\n </div>\n\n <Panel tone=\"rose\" className=\"col-span-2 lg:col-span-6 flex items-center gap-4 p-5 sm:p-6\">\n <span className=\"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-background/40 text-brand-rose\">\n <Scale className=\"h-5 w-5\" />\n </span>\n <p className=\"text-sm leading-relaxed text-muted-foreground\">\n {t(\"Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries.\")}\n </p>\n </Panel>\n </div>\n </section>\n ) : null}\n\n {displayAttributes.length > 0 ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Details\")}</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? t(\"Trait\")}\n className={`${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-base font-semibold\" />\n ) : (\n attribute.value ?? \"—\"\n )\n }\n />\n ))}\n </div>\n </section>\n ) : null}\n\n {!hasTemplateData && !hasLicenseData && displayAttributes.length === 0 ? (\n <p className=\"text-sm text-muted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A,kDAAC,QAAG,WAAU,+CAA+C,YAAE,SAAS,GAAE;AAAA,MAC1E,4CAAC,SAAI,WAAU,gEACZ,4BAAkB,IAAI,CAAC,WAAW,UACjC;AAAA,QAAC;AAAA;AAAA,UAEC,OAAO,UAAU,cAAc,EAAE,OAAO;AAAA,UACxC,WAAW,GAAG,OAAO,aAAa,KAAK,CAAC,CAAC,IAAI,UAAU,cAAc,KAAK,CAAC,CAAC;AAAA,UAC5E,OACE,cAAc,UAAU,KAAK,IAC3B,4CAAC,yCAAe,SAAS,UAAU,OAAQ,OAAO,GAAG,WAAU,2BAA0B,IAEzF,UAAU,SAAS;AAAA;AAAA,QAPlB;AAAA,MAUP,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,4CAAC,OAAE,WAAU,iCAAiC,YAAE,kCAAkC,GAAE,IAClF;AAAA,KACN;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, ExternalLink, GitBranch, Globe, Percent, Scale, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { MarkdownText } from \"./markdown-text.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\nimport { LICENSE_TYPES } from \"../data/ip.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel, Pill, type PanelColor } from \"./panel.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n content?: string | null;\n link?: string | null;\n}\n\nfunction licenseLabel(value: string): string {\n const label = LICENSE_TYPES.find((license) => license.value === value)?.label ?? value;\n return label.split(\" — \")[1] ?? label;\n}\n\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\nfunction fillSpans(units: number[], cols: number): number[] {\n const out = units.map((unit) => Math.min(unit, cols));\n const rest = out.reduce((sum, unit) => sum + unit, 0) % cols;\n if (rest && out.length) out[out.length - 1] += cols - rest;\n return out;\n}\n\nfunction bentoSpans(count: number): number[] {\n const out: number[] = [];\n const rows = [[2, 1], [1, 2]];\n for (let row = 0; out.length < count; row++) {\n const left = count - out.length;\n if (left === 1) out.push(3);\n else out.push(...rows[row % 2]);\n }\n return out;\n}\n\nconst SPAN_2: Record<number, string> = { 1: \"col-span-1\", 2: \"col-span-2\" };\nconst SPAN_SM_4: Record<number, string> = {\n 1: \"sm:col-span-1\",\n 2: \"sm:col-span-2\",\n 3: \"sm:col-span-3\",\n 4: \"sm:col-span-4\",\n};\nconst SPAN_LG_3: Record<number, string> = {\n 1: \"lg:col-span-1\",\n 2: \"lg:col-span-2\",\n 3: \"lg:col-span-3\",\n};\n\nfunction detailSpans(count: number): number[] {\n const out: number[] = [];\n while (out.length < count) {\n const left = count - out.length;\n if (left >= 5) out.push(1, 2, 1);\n else if (left === 4 || left === 2) out.push(...Array(left).fill(2));\n else if (left === 3) out.push(1, 2, 1);\n else out.push(4);\n }\n return out.slice(0, count);\n}\n\nfunction Cell({ label, value, className }: { label: string; value: ReactNode; className?: string }) {\n return (\n <Panel className={`flex flex-col justify-end gap-1.5 px-5 py-4 min-h-[5.5rem] ${className ?? \"\"}`}>\n <p className=\"truncate text-xs font-medium text-muted-foreground\" title={label}>{label}</p>\n <div className=\"text-lg font-semibold leading-tight tracking-tight text-foreground break-words\">{value}</div>\n </Panel>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\n const t = useT();\n const attr = (trait: string) => attributes.find((attribute) => attribute.trait_type === trait)?.value;\n const licenseType = attr(\"License\");\n const commercialUse = attr(\"Commercial Use\");\n const derivatives = attr(\"Derivatives\");\n const attribution = attr(\"Attribution\");\n const territory = attr(\"Territory\");\n const aiPolicy = attr(\"AI Policy\");\n const royalty = attr(\"Royalty\");\n const summary = licenseSummary(attributes);\n const hasLicenseData = !!(licenseType || commercialUse || derivatives || attribution);\n const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));\n\n const licenseDescription = LICENSE_TYPES.find((license) => license.value === licenseType)?.description;\n\n const factRows: { icon: typeof Bot; label: string; value?: string; tone: PanelColor }[] = [\n { icon: DollarSign, label: t(\"Commercial use\"), value: commercialUse, tone: \"orange\" },\n { icon: GitBranch, label: t(\"Derivatives\"), value: derivatives, tone: \"rose\" },\n { icon: UserCheck, label: t(\"Attribution\"), value: attribution, tone: \"maeve\" },\n { icon: Globe, label: t(\"Territory\"), value: territory, tone: \"blue\" },\n { icon: Bot, label: t(\"AI & data mining\"), value: aiPolicy, tone: \"purple\" },\n { icon: Percent, label: t(\"Royalty\"), value: royalty, tone: \"orange\" },\n ];\n const facts = factRows.filter((row) => !!row.value);\n\n const factSpans2 = fillSpans(facts.map(() => 1), 2);\n const factSpansLg = bentoSpans(facts.length);\n const detailUnits = displayAttributes.map((attribute) => (isAddressLike(attribute.value) ? 2 : 1));\n const detailSpans2 = fillSpans(detailUnits, 2);\n const detailSpansSm = detailSpans(displayAttributes.length).map((span, index) => Math.max(span, detailUnits[index]));\n\n return (\n <div className=\"mt-4 space-y-7\">\n {content ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Content\")}</h3>\n <MarkdownText text={content} />\n </section>\n ) : null}\n\n {link ? (\n <a href={link} target=\"_blank\" rel=\"noopener noreferrer\" className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\">\n <ExternalLink className=\"h-3.5 w-3.5\" />\n {t(\"Open link\")}\n </a>\n ) : null}\n\n {hasTemplateData ? <IPTypeDisplay attributes={attributes} /> : null}\n\n {hasLicenseData ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Rights\")}</h3>\n <div className=\"grid grid-cols-2 lg:grid-cols-6 gap-3\">\n <Panel tone=\"blue\" className=\"col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end gap-3 p-6 sm:p-8\">\n {licenseType ? (\n <p className=\"text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05] text-foreground\">\n {licenseLabel(licenseType)}\n </p>\n ) : null}\n {licenseDescription ? (\n <p className=\"max-w-md text-sm text-muted-foreground\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"text-base font-semibold leading-snug text-foreground\">{summary}</p>\n ) : null}\n </Panel>\n\n <div className=\"col-span-2 lg:col-span-3 grid grid-cols-2 lg:grid-cols-3 gap-3 auto-rows-[minmax(8.5rem,1fr)]\">\n {facts.map(({ icon: Icon, label, value, tone }, index) => (\n <Panel\n key={label}\n tone={tone}\n className={`flex flex-col justify-between gap-4 p-5 ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`}\n >\n <Pill color={tone}>\n <Icon className=\"h-3.5 w-3.5\" />\n {label}\n </Pill>\n <p className=\"text-xl sm:text-2xl font-semibold leading-none tracking-tight break-words text-foreground\">{value}</p>\n </Panel>\n ))}\n </div>\n\n <Panel tone=\"rose\" className=\"col-span-2 lg:col-span-6 flex items-center gap-4 p-5 sm:p-6\">\n <IconTile>\n <Scale />\n </IconTile>\n <p className=\"text-sm leading-relaxed text-muted-foreground\">\n {t(\"Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries.\")}\n </p>\n </Panel>\n </div>\n </section>\n ) : null}\n\n {displayAttributes.length > 0 ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Details\")}</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? t(\"Trait\")}\n className={`${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-base font-semibold\" />\n ) : (\n attribute.value ?? \"—\"\n )\n }\n />\n ))}\n </div>\n </section>\n ) : null}\n\n {!hasTemplateData && !hasLicenseData && displayAttributes.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">{t(\"No additional details available.\")}</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+EI;AA5EJ,0BAA2F;AAC3F,6BAA8B;AAC9B,6BAA+B;AAC/B,2BAA6B;AAC7B,6BAA+B;AAC/B,gBAA8B;AAC9B,sBAAqB;AACrB,mBAA6C;AAC7C,uBAAyB;AAezB,SAAS,aAAa,OAAuB;AAC3C,QAAM,QAAQ,wBAAc,KAAK,CAAC,YAAY,QAAQ,UAAU,KAAK,GAAG,SAAS;AACjF,SAAO,MAAM,MAAM,UAAK,EAAE,CAAC,KAAK;AAClC;AAEA,MAAM,gBAAgB,CAAC,MACrB,OAAO,MAAM,YAAY,uBAAuB,KAAK,EAAE,KAAK,CAAC;AAE/D,SAAS,UAAU,OAAiB,MAAwB;AAC1D,QAAM,MAAM,MAAM,IAAI,CAAC,SAAS,KAAK,IAAI,MAAM,IAAI,CAAC;AACpD,QAAM,OAAO,IAAI,OAAO,CAAC,KAAK,SAAS,MAAM,MAAM,CAAC,IAAI;AACxD,MAAI,QAAQ,IAAI,OAAQ,KAAI,IAAI,SAAS,CAAC,KAAK,OAAO;AACtD,SAAO;AACT;AAEA,SAAS,WAAW,OAAyB;AAC3C,QAAM,MAAgB,CAAC;AACvB,QAAM,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC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AAC,OAAE,WAAU,6FAA6F,iBAAM;AAAA;AAAA;AAAA,UAR3G;AAAA,QASP,CACD,GACH;AAAA,QAEA,6CAAC,sBAAM,MAAK,QAAO,WAAU,+DAC3B;AAAA,sDAAC,6BACC,sDAAC,6BAAM,GACT;AAAA,UACA,4CAAC,OAAE,WAAU,iDACV,YAAE,8NAA8N,GACnO;AAAA,WACF;AAAA,SACF;AAAA,OACF,IACE;AAAA,IAEH,kBAAkB,SAAS,IAC1B,6CAAC,aAAQ,WAAU,aACjB;AAAA,kDAAC,QAAG,WAAU,+CAA+C,YAAE,SAAS,GAAE;AAAA,MAC1E,4CAAC,SAAI,WAAU,gEACZ,4BAAkB,IAAI,CAAC,WAAW,UACjC;AAAA,QAAC;AAAA;AAAA,UAEC,OAAO,UAAU,cAAc,EAAE,OAAO;AAAA,UACxC,WAAW,GAAG,OAAO,aAAa,KAAK,CAAC,CAAC,IAAI,UAAU,cAAc,KAAK,CAAC,CAAC;AAAA,UAC5E,OACE,cAAc,UAAU,KAAK,IAC3B,4CAAC,yCAAe,SAAS,UAAU,OAAQ,OAAO,GAAG,WAAU,2BAA0B,IAEzF,UAAU,SAAS;AAAA;AAAA,QAPlB;AAAA,MAUP,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,4CAAC,OAAE,WAAU,iCAAiC,YAAE,kCAAkC,GAAE,IAClF;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -8,6 +8,7 @@ import { licenseSummary } from "../utils/license-summary.js";
|
|
|
8
8
|
import { LICENSE_TYPES } from "../data/ip.js";
|
|
9
9
|
import { useT } from "../i18n/provider.js";
|
|
10
10
|
import { Panel, Pill } from "./panel.js";
|
|
11
|
+
import { IconTile } from "./icon-tile.js";
|
|
11
12
|
function licenseLabel(value) {
|
|
12
13
|
const label = LICENSE_TYPES.find((license) => license.value === value)?.label ?? value;
|
|
13
14
|
return label.split(" \u2014 ")[1] ?? label;
|
|
@@ -126,7 +127,7 @@ function AssetOverviewContent({
|
|
|
126
127
|
label
|
|
127
128
|
)) }),
|
|
128
129
|
/* @__PURE__ */ jsxs(Panel, { tone: "rose", className: "col-span-2 lg:col-span-6 flex items-center gap-4 p-5 sm:p-6", children: [
|
|
129
|
-
/* @__PURE__ */ jsx(
|
|
130
|
+
/* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(Scale, {}) }),
|
|
130
131
|
/* @__PURE__ */ jsx("p", { className: "text-sm leading-relaxed text-muted-foreground", children: t("Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries.") })
|
|
131
132
|
] })
|
|
132
133
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, ExternalLink, GitBranch, Globe, Percent, Scale, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { MarkdownText } from \"./markdown-text.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\nimport { LICENSE_TYPES } from \"../data/ip.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel, Pill, type PanelColor } from \"./panel.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n content?: string | null;\n link?: string | null;\n}\n\nfunction licenseLabel(value: string): string {\n const label = LICENSE_TYPES.find((license) => license.value === value)?.label ?? value;\n return label.split(\" — \")[1] ?? label;\n}\n\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\nfunction fillSpans(units: number[], cols: number): number[] {\n const out = units.map((unit) => Math.min(unit, cols));\n const rest = out.reduce((sum, unit) => sum + unit, 0) % cols;\n if (rest && out.length) out[out.length - 1] += cols - rest;\n return out;\n}\n\nfunction bentoSpans(count: number): number[] {\n const out: number[] = [];\n const rows = [[2, 1], [1, 2]];\n for (let row = 0; out.length < count; row++) {\n const left = count - out.length;\n if (left === 1) out.push(3);\n else out.push(...rows[row % 2]);\n }\n return out;\n}\n\nconst SPAN_2: Record<number, string> = { 1: \"col-span-1\", 2: \"col-span-2\" };\nconst SPAN_SM_4: Record<number, string> = {\n 1: \"sm:col-span-1\",\n 2: \"sm:col-span-2\",\n 3: \"sm:col-span-3\",\n 4: \"sm:col-span-4\",\n};\nconst SPAN_LG_3: Record<number, string> = {\n 1: \"lg:col-span-1\",\n 2: \"lg:col-span-2\",\n 3: \"lg:col-span-3\",\n};\n\nfunction detailSpans(count: number): number[] {\n const out: number[] = [];\n while (out.length < count) {\n const left = count - out.length;\n if (left >= 5) out.push(1, 2, 1);\n else if (left === 4 || left === 2) out.push(...Array(left).fill(2));\n else if (left === 3) out.push(1, 2, 1);\n else out.push(4);\n }\n return out.slice(0, count);\n}\n\nfunction Cell({ label, value, className }: { label: string; value: ReactNode; className?: string }) {\n return (\n <Panel className={`flex flex-col justify-end gap-1.5 px-5 py-4 min-h-[5.5rem] ${className ?? \"\"}`}>\n <p className=\"truncate text-xs font-medium text-muted-foreground\" title={label}>{label}</p>\n <div className=\"text-lg font-semibold leading-tight tracking-tight text-foreground break-words\">{value}</div>\n </Panel>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\n const t = useT();\n const attr = (trait: string) => attributes.find((attribute) => attribute.trait_type === trait)?.value;\n const licenseType = attr(\"License\");\n const commercialUse = attr(\"Commercial Use\");\n const derivatives = attr(\"Derivatives\");\n const attribution = attr(\"Attribution\");\n const territory = attr(\"Territory\");\n const aiPolicy = attr(\"AI Policy\");\n const royalty = attr(\"Royalty\");\n const summary = licenseSummary(attributes);\n const hasLicenseData = !!(licenseType || commercialUse || derivatives || attribution);\n const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));\n\n const licenseDescription = LICENSE_TYPES.find((license) => license.value === licenseType)?.description;\n\n const factRows: { icon: typeof Bot; label: string; value?: string; tone: PanelColor }[] = [\n { icon: DollarSign, label: t(\"Commercial use\"), value: commercialUse, tone: \"orange\" },\n { icon: GitBranch, label: t(\"Derivatives\"), value: derivatives, tone: \"rose\" },\n { icon: UserCheck, label: t(\"Attribution\"), value: attribution, tone: \"maeve\" },\n { icon: Globe, label: t(\"Territory\"), value: territory, tone: \"blue\" },\n { icon: Bot, label: t(\"AI & data mining\"), value: aiPolicy, tone: \"purple\" },\n { icon: Percent, label: t(\"Royalty\"), value: royalty, tone: \"orange\" },\n ];\n const facts = factRows.filter((row) => !!row.value);\n\n const factSpans2 = fillSpans(facts.map(() => 1), 2);\n const factSpansLg = bentoSpans(facts.length);\n const detailUnits = displayAttributes.map((attribute) => (isAddressLike(attribute.value) ? 2 : 1));\n const detailSpans2 = fillSpans(detailUnits, 2);\n const detailSpansSm = detailSpans(displayAttributes.length).map((span, index) => Math.max(span, detailUnits[index]));\n\n return (\n <div className=\"mt-4 space-y-7\">\n {content ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Content\")}</h3>\n <MarkdownText text={content} />\n </section>\n ) : null}\n\n {link ? (\n <a href={link} target=\"_blank\" rel=\"noopener noreferrer\" className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\">\n <ExternalLink className=\"h-3.5 w-3.5\" />\n {t(\"Open link\")}\n </a>\n ) : null}\n\n {hasTemplateData ? <IPTypeDisplay attributes={attributes} /> : null}\n\n {hasLicenseData ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Rights\")}</h3>\n <div className=\"grid grid-cols-2 lg:grid-cols-6 gap-3\">\n <Panel tone=\"blue\" className=\"col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end gap-3 p-6 sm:p-8\">\n {licenseType ? (\n <p className=\"text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05] text-foreground\">\n {licenseLabel(licenseType)}\n </p>\n ) : null}\n {licenseDescription ? (\n <p className=\"max-w-md text-sm text-muted-foreground\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"text-base font-semibold leading-snug text-foreground\">{summary}</p>\n ) : null}\n </Panel>\n\n <div className=\"col-span-2 lg:col-span-3 grid grid-cols-2 lg:grid-cols-3 gap-3 auto-rows-[minmax(8.5rem,1fr)]\">\n {facts.map(({ icon: Icon, label, value, tone }, index) => (\n <Panel\n key={label}\n tone={tone}\n className={`flex flex-col justify-between gap-4 p-5 ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`}\n >\n <Pill color={tone}>\n <Icon className=\"h-3.5 w-3.5\" />\n {label}\n </Pill>\n <p className=\"text-xl sm:text-2xl font-semibold leading-none tracking-tight break-words text-foreground\">{value}</p>\n </Panel>\n ))}\n </div>\n\n <Panel tone=\"rose\" className=\"col-span-2 lg:col-span-6 flex items-center gap-4 p-5 sm:p-6\">\n <span className=\"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-background/40 text-brand-rose\">\n <Scale className=\"h-5 w-5\" />\n </span>\n <p className=\"text-sm leading-relaxed text-muted-foreground\">\n {t(\"Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries.\")}\n </p>\n </Panel>\n </div>\n </section>\n ) : null}\n\n {displayAttributes.length > 0 ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Details\")}</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? t(\"Trait\")}\n className={`${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-base font-semibold\" />\n ) : (\n attribute.value ?? \"—\"\n )\n }\n />\n ))}\n </div>\n </section>\n ) : null}\n\n {!hasTemplateData && !hasLicenseData && displayAttributes.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">{t(\"No additional details available.\")}</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AA8EI,SACE,KADF;AA3EJ,SAAS,KAAK,YAAY,cAAc,WAAW,OAAO,SAAS,OAAO,iBAAiB;AAC3F,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB,SAAS,OAAO,YAA6B;AAe7C,SAAS,aAAa,OAAuB;AAC3C,QAAM,QAAQ,cAAc,KAAK,CAAC,YAAY,QAAQ,UAAU,KAAK,GAAG,SAAS;AACjF,SAAO,MAAM,MAAM,UAAK,EAAE,CAAC,KAAK;AAClC;AAEA,MAAM,gBAAgB,CAAC,MACrB,OAAO,MAAM,YAAY,uBAAuB,KAAK,EAAE,KAAK,CAAC;AAE/D,SAAS,UAAU,OAAiB,MAAwB;AAC1D,QAAM,MAAM,MAAM,IAAI,CAAC,SAAS,KAAK,IAAI,MAAM,IAAI,CAAC;AACpD,QAAM,OAAO,IAAI,OAAO,CAAC,KAAK,SAAS,MAAM,MAAM,CAAC,IAAI;AACxD,MAAI,QAAQ,IAAI,OAAQ,KAAI,IAAI,SAAS,CAAC,KAAK,OAAO;AACtD,SAAO;AACT;AAEA,SAAS,WAAW,OAAyB;AAC3C,QAAM,MAAgB,CAAC;AACvB,QAAM,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC5B,WAAS,MAAM,GAAG,IAAI,SAAS,OAAO,OAAO;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AA,QASP,CACD,GACH;AAAA,QAEA,qBAAC,SAAM,MAAK,QAAO,WAAU,+DAC3B;AAAA,8BAAC,UAAK,WAAU,qGACd,8BAAC,SAAM,WAAU,WAAU,GAC7B;AAAA,UACA,oBAAC,OAAE,WAAU,iDACV,YAAE,8NAA8N,GACnO;AAAA,WACF;AAAA,SACF;AAAA,OACF,IACE;AAAA,IAEH,kBAAkB,SAAS,IAC1B,qBAAC,aAAQ,WAAU,aACjB;AAAA,0BAAC,QAAG,WAAU,+CAA+C,YAAE,SAAS,GAAE;AAAA,MAC1E,oBAAC,SAAI,WAAU,gEACZ,4BAAkB,IAAI,CAAC,WAAW,UACjC;AAAA,QAAC;AAAA;AAAA,UAEC,OAAO,UAAU,cAAc,EAAE,OAAO;AAAA,UACxC,WAAW,GAAG,OAAO,aAAa,KAAK,CAAC,CAAC,IAAI,UAAU,cAAc,KAAK,CAAC,CAAC;AAAA,UAC5E,OACE,cAAc,UAAU,KAAK,IAC3B,oBAAC,kBAAe,SAAS,UAAU,OAAQ,OAAO,GAAG,WAAU,2BAA0B,IAEzF,UAAU,SAAS;AAAA;AAAA,QAPlB;AAAA,MAUP,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,oBAAC,OAAE,WAAU,iCAAiC,YAAE,kCAAkC,GAAE,IAClF;AAAA,KACN;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, ExternalLink, GitBranch, Globe, Percent, Scale, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { MarkdownText } from \"./markdown-text.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\nimport { LICENSE_TYPES } from \"../data/ip.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel, Pill, type PanelColor } from \"./panel.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n content?: string | null;\n link?: string | null;\n}\n\nfunction licenseLabel(value: string): string {\n const label = LICENSE_TYPES.find((license) => license.value === value)?.label ?? value;\n return label.split(\" — \")[1] ?? label;\n}\n\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\nfunction fillSpans(units: number[], cols: number): number[] {\n const out = units.map((unit) => Math.min(unit, cols));\n const rest = out.reduce((sum, unit) => sum + unit, 0) % cols;\n if (rest && out.length) out[out.length - 1] += cols - rest;\n return out;\n}\n\nfunction bentoSpans(count: number): number[] {\n const out: number[] = [];\n const rows = [[2, 1], [1, 2]];\n for (let row = 0; out.length < count; row++) {\n const left = count - out.length;\n if (left === 1) out.push(3);\n else out.push(...rows[row % 2]);\n }\n return out;\n}\n\nconst SPAN_2: Record<number, string> = { 1: \"col-span-1\", 2: \"col-span-2\" };\nconst SPAN_SM_4: Record<number, string> = {\n 1: \"sm:col-span-1\",\n 2: \"sm:col-span-2\",\n 3: \"sm:col-span-3\",\n 4: \"sm:col-span-4\",\n};\nconst SPAN_LG_3: Record<number, string> = {\n 1: \"lg:col-span-1\",\n 2: \"lg:col-span-2\",\n 3: \"lg:col-span-3\",\n};\n\nfunction detailSpans(count: number): number[] {\n const out: number[] = [];\n while (out.length < count) {\n const left = count - out.length;\n if (left >= 5) out.push(1, 2, 1);\n else if (left === 4 || left === 2) out.push(...Array(left).fill(2));\n else if (left === 3) out.push(1, 2, 1);\n else out.push(4);\n }\n return out.slice(0, count);\n}\n\nfunction Cell({ label, value, className }: { label: string; value: ReactNode; className?: string }) {\n return (\n <Panel className={`flex flex-col justify-end gap-1.5 px-5 py-4 min-h-[5.5rem] ${className ?? \"\"}`}>\n <p className=\"truncate text-xs font-medium text-muted-foreground\" title={label}>{label}</p>\n <div className=\"text-lg font-semibold leading-tight tracking-tight text-foreground break-words\">{value}</div>\n </Panel>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\n const t = useT();\n const attr = (trait: string) => attributes.find((attribute) => attribute.trait_type === trait)?.value;\n const licenseType = attr(\"License\");\n const commercialUse = attr(\"Commercial Use\");\n const derivatives = attr(\"Derivatives\");\n const attribution = attr(\"Attribution\");\n const territory = attr(\"Territory\");\n const aiPolicy = attr(\"AI Policy\");\n const royalty = attr(\"Royalty\");\n const summary = licenseSummary(attributes);\n const hasLicenseData = !!(licenseType || commercialUse || derivatives || attribution);\n const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));\n\n const licenseDescription = LICENSE_TYPES.find((license) => license.value === licenseType)?.description;\n\n const factRows: { icon: typeof Bot; label: string; value?: string; tone: PanelColor }[] = [\n { icon: DollarSign, label: t(\"Commercial use\"), value: commercialUse, tone: \"orange\" },\n { icon: GitBranch, label: t(\"Derivatives\"), value: derivatives, tone: \"rose\" },\n { icon: UserCheck, label: t(\"Attribution\"), value: attribution, tone: \"maeve\" },\n { icon: Globe, label: t(\"Territory\"), value: territory, tone: \"blue\" },\n { icon: Bot, label: t(\"AI & data mining\"), value: aiPolicy, tone: \"purple\" },\n { icon: Percent, label: t(\"Royalty\"), value: royalty, tone: \"orange\" },\n ];\n const facts = factRows.filter((row) => !!row.value);\n\n const factSpans2 = fillSpans(facts.map(() => 1), 2);\n const factSpansLg = bentoSpans(facts.length);\n const detailUnits = displayAttributes.map((attribute) => (isAddressLike(attribute.value) ? 2 : 1));\n const detailSpans2 = fillSpans(detailUnits, 2);\n const detailSpansSm = detailSpans(displayAttributes.length).map((span, index) => Math.max(span, detailUnits[index]));\n\n return (\n <div className=\"mt-4 space-y-7\">\n {content ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Content\")}</h3>\n <MarkdownText text={content} />\n </section>\n ) : null}\n\n {link ? (\n <a href={link} target=\"_blank\" rel=\"noopener noreferrer\" className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\">\n <ExternalLink className=\"h-3.5 w-3.5\" />\n {t(\"Open link\")}\n </a>\n ) : null}\n\n {hasTemplateData ? <IPTypeDisplay attributes={attributes} /> : null}\n\n {hasLicenseData ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Rights\")}</h3>\n <div className=\"grid grid-cols-2 lg:grid-cols-6 gap-3\">\n <Panel tone=\"blue\" className=\"col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end gap-3 p-6 sm:p-8\">\n {licenseType ? (\n <p className=\"text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05] text-foreground\">\n {licenseLabel(licenseType)}\n </p>\n ) : null}\n {licenseDescription ? (\n <p className=\"max-w-md text-sm text-muted-foreground\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"text-base font-semibold leading-snug text-foreground\">{summary}</p>\n ) : null}\n </Panel>\n\n <div className=\"col-span-2 lg:col-span-3 grid grid-cols-2 lg:grid-cols-3 gap-3 auto-rows-[minmax(8.5rem,1fr)]\">\n {facts.map(({ icon: Icon, label, value, tone }, index) => (\n <Panel\n key={label}\n tone={tone}\n className={`flex flex-col justify-between gap-4 p-5 ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`}\n >\n <Pill color={tone}>\n <Icon className=\"h-3.5 w-3.5\" />\n {label}\n </Pill>\n <p className=\"text-xl sm:text-2xl font-semibold leading-none tracking-tight break-words text-foreground\">{value}</p>\n </Panel>\n ))}\n </div>\n\n <Panel tone=\"rose\" className=\"col-span-2 lg:col-span-6 flex items-center gap-4 p-5 sm:p-6\">\n <IconTile>\n <Scale />\n </IconTile>\n <p className=\"text-sm leading-relaxed text-muted-foreground\">\n {t(\"Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries.\")}\n </p>\n </Panel>\n </div>\n </section>\n ) : null}\n\n {displayAttributes.length > 0 ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">{t(\"Details\")}</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? t(\"Trait\")}\n className={`${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-base font-semibold\" />\n ) : (\n attribute.value ?? \"—\"\n )\n }\n />\n ))}\n </div>\n </section>\n ) : null}\n\n {!hasTemplateData && !hasLicenseData && displayAttributes.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">{t(\"No additional details available.\")}</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AA+EI,SACE,KADF;AA5EJ,SAAS,KAAK,YAAY,cAAc,WAAW,OAAO,SAAS,OAAO,iBAAiB;AAC3F,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB,SAAS,OAAO,YAA6B;AAC7C,SAAS,gBAAgB;AAezB,SAAS,aAAa,OAAuB;AAC3C,QAAM,QAAQ,cAAc,KAAK,CAAC,YAAY,QAAQ,UAAU,KAAK,GAAG,SAAS;AACjF,SAAO,MAAM,MAAM,UAAK,EAAE,CAAC,KAAK;AAClC;AAEA,MAAM,gBAAgB,CAAC,MACrB,OAAO,MAAM,YAAY,uBAAuB,KAAK,EAAE,KAAK,CAAC;AAE/D,SAAS,UAAU,OAAiB,MAAwB;AAC1D,QAAM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AAEJ;","names":[]}
|
|
@@ -29,10 +29,11 @@ var import_cn = require("../utils/cn.js");
|
|
|
29
29
|
var import_asset_picker_cell = require("./asset-picker-cell.js");
|
|
30
30
|
var import_provider = require("../i18n/provider.js");
|
|
31
31
|
var import_action_button = require("./action-button.js");
|
|
32
|
+
var import_icon_tile = require("./icon-tile.js");
|
|
32
33
|
function MintPromoCard({ onMintClick }) {
|
|
33
34
|
const t = (0, import_provider.useT)();
|
|
34
35
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel p-5 flex flex-col sm:flex-row sm:items-center gap-4", children: [
|
|
35
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Sparkles, {}) }),
|
|
36
37
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
37
38
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-bold text-foreground", children: t("Mint your first asset") }),
|
|
38
39
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground mt-0.5", children: t("It becomes your avatar and app theme \u2014 ready in seconds.") })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Search, Plus, Sparkles } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { AssetPickerCell, isSameAsset } from \"./asset-picker-cell.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { ActionButton } from \"./action-button.js\";\n\nexport interface OwnedAsset {\n contractAddress: string;\n tokenId: string;\n name: string;\n image: string | null;\n}\n\nexport interface AssetPickerProps {\n\n assets: OwnedAsset[];\n isLoading: boolean;\n selected: OwnedAsset | null;\n onSelect: (asset: OwnedAsset) => void;\n\n emptyStateHref?: string;\n emptyStateLabel?: string;\n onMintClick?: () => void;\n className?: string;\n}\n\nfunction MintPromoCard({ onMintClick }: { onMintClick: () => void }) {\n const t = useT();\n return (\n <div className=\"panel p-5 flex flex-col sm:flex-row sm:items-center gap-4\">\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Search, Plus, Sparkles } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { AssetPickerCell, isSameAsset } from \"./asset-picker-cell.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nexport interface OwnedAsset {\n contractAddress: string;\n tokenId: string;\n name: string;\n image: string | null;\n}\n\nexport interface AssetPickerProps {\n\n assets: OwnedAsset[];\n isLoading: boolean;\n selected: OwnedAsset | null;\n onSelect: (asset: OwnedAsset) => void;\n\n emptyStateHref?: string;\n emptyStateLabel?: string;\n onMintClick?: () => void;\n className?: string;\n}\n\nfunction MintPromoCard({ onMintClick }: { onMintClick: () => void }) {\n const t = useT();\n return (\n <div className=\"panel p-5 flex flex-col sm:flex-row sm:items-center gap-4\">\n <IconTile>\n <Sparkles />\n </IconTile>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-bold text-foreground\">{t(\"Mint your first asset\")}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">{t(\"It becomes your avatar and app theme — ready in seconds.\")}</p>\n </div>\n <ActionButton type=\"button\" onClick={onMintClick} className=\"shrink-0\">\n {t(\"Mint an asset\")}\n </ActionButton>\n </div>\n );\n}\n\nfunction MintTile({ onMintClick }: { onMintClick: () => void }) {\nconst t = useT();\nreturn (\n <button\n type=\"button\"\n onClick={onMintClick}\n className=\"aspect-square rounded-xl border-2 border-dashed border-brand-purple/40 hover:border-brand-purple/70 hover:bg-brand-purple/5 transition-colors flex flex-col items-center justify-center gap-1 text-brand-purple\"\n >\n <Plus className=\"h-4 w-4\" />\n <span className=\"text-2xs font-semibold\">{t(\"New\")}</span>\n </button>\n);\n}\n\nexport function AssetPicker({\nassets, isLoading, selected, onSelect, emptyStateHref, emptyStateLabel, onMintClick, className,\n}: AssetPickerProps) {\nconst t = useT();\nconst [query, setQuery] = useState(\"\");\nconst filtered = query\n ? assets.filter((a) => a.name.toLowerCase().includes(query.toLowerCase()))\n : assets;\n\nif (isLoading) {\n return (\n <div className={cn(\"grid grid-cols-3 sm:grid-cols-4 gap-2.5\", className)}>\n {Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"aspect-square rounded-xl bg-muted/60 animate-pulse\" />\n ))}\n </div>\n );\n}\n\nif (assets.length === 0) {\n if (onMintClick) return <MintPromoCard onMintClick={onMintClick} />;\n return (\n <div className={cn(\"rounded-xl border border-dashed border-border/60 p-6 text-center text-sm text-muted-foreground\", className)}>\n {t(\"You don't own any assets yet.\")}\n {emptyStateHref ? (\n <a href={emptyStateHref} className=\"ml-1 font-semibold text-foreground underline underline-offset-2\">\n {emptyStateLabel ?? t(\"Create one\")}\n </a>\n ) : null}\n </div>\n );\n}\n\nreturn (\n <div className={cn(\"space-y-3\", className)}>\n {assets.length > 8 ? (\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none\" />\n <input\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={t(\"Search your assets\")}\n className=\"w-full h-10 rounded-full border border-border bg-card pl-9 pr-4 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-brand-purple/40 focus:border-brand-purple/40\"\n />\n </div>\n ) : null}\n\n <div className=\"grid grid-cols-3 sm:grid-cols-4 gap-2.5 max-h-80 overflow-y-auto pr-0.5\">\n {filtered.map((asset) => (\n <AssetPickerCell\n key={`${asset.contractAddress}-${asset.tokenId}`}\n asset={asset}\n active={isSameAsset(asset, selected)}\n onSelect={onSelect}\n />\n ))}\n {onMintClick && !query ? <MintTile onMintClick={onMintClick} /> : null}\n </div>\n\n {query && filtered.length === 0 ? (\n <p className=\"text-xs text-muted-foreground text-center py-4\">{t(\"No assets match \\\"{query}\\\".\", { query })}</p>\n ) : null}\n </div>\n);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCQ;AAjCR,mBAAyB;AACzB,0BAAuC;AACvC,gBAAmB;AACnB,+BAA6C;AAC7C,sBAAqB;AACrB,2BAA6B;AAC7B,uBAAyB;AAsBzB,SAAS,cAAc,EAAE,YAAY,GAAgC;AACnE,QAAM,QAAI,sBAAK;AACf,SACE,6CAAC,SAAI,WAAU,6DACb;AAAA,gDAAC,6BACC,sDAAC,gCAAS,GACZ;AAAA,IACA,6CAAC,SAAI,WAAU,kBACb;AAAA,kDAAC,OAAE,WAAU,qCAAqC,YAAE,uBAAuB,GAAE;AAAA,MAC7E,4CAAC,OAAE,WAAU,wCAAwC,YAAE,+DAA0D,GAAE;AAAA,OACrH;AAAA,IACA,4CAAC,qCAAa,MAAK,UAAS,SAAS,aAAa,WAAU,YACzD,YAAE,eAAe,GACpB;AAAA,KACF;AAEJ;AAEA,SAAS,SAAS,EAAE,YAAY,GAAgC;AAChE,QAAM,QAAI,sBAAK;AACf,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS;AAAA,MACT,WAAU;AAAA,MAEV;AAAA,oDAAC,4BAAK,WAAU,WAAU;AAAA,QAC1B,4CAAC,UAAK,WAAU,0BAA0B,YAAE,KAAK,GAAE;AAAA;AAAA;AAAA,EACrD;AAEF;AAEO,SAAS,YAAY;AAAA,EAC5B;AAAA,EAAQ;AAAA,EAAW;AAAA,EAAU;AAAA,EAAU;AAAA,EAAgB;AAAA,EAAiB;AAAA,EAAa;AACrF,GAAqB;AACrB,QAAM,QAAI,sBAAK;AACf,QAAM,CAAC,OAAO,QAAQ,QAA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,SAAS,SAAS,WAAW,IAC5B,4CAAC,OAAE,WAAU,kDAAkD,YAAE,8BAAgC,EAAE,MAAM,CAAC,GAAE,IAC1G;AAAA,KACN;AAEF;","names":[]}
|
|
@@ -6,10 +6,11 @@ import { cn } from "../utils/cn.js";
|
|
|
6
6
|
import { AssetPickerCell, isSameAsset } from "./asset-picker-cell.js";
|
|
7
7
|
import { useT } from "../i18n/provider.js";
|
|
8
8
|
import { ActionButton } from "./action-button.js";
|
|
9
|
+
import { IconTile } from "./icon-tile.js";
|
|
9
10
|
function MintPromoCard({ onMintClick }) {
|
|
10
11
|
const t = useT();
|
|
11
12
|
return /* @__PURE__ */ jsxs("div", { className: "panel p-5 flex flex-col sm:flex-row sm:items-center gap-4", children: [
|
|
12
|
-
/* @__PURE__ */ jsx(
|
|
13
|
+
/* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(Sparkles, {}) }),
|
|
13
14
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
14
15
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-bold text-foreground", children: t("Mint your first asset") }),
|
|
15
16
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: t("It becomes your avatar and app theme \u2014 ready in seconds.") })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Search, Plus, Sparkles } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { AssetPickerCell, isSameAsset } from \"./asset-picker-cell.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { ActionButton } from \"./action-button.js\";\n\nexport interface OwnedAsset {\n contractAddress: string;\n tokenId: string;\n name: string;\n image: string | null;\n}\n\nexport interface AssetPickerProps {\n\n assets: OwnedAsset[];\n isLoading: boolean;\n selected: OwnedAsset | null;\n onSelect: (asset: OwnedAsset) => void;\n\n emptyStateHref?: string;\n emptyStateLabel?: string;\n onMintClick?: () => void;\n className?: string;\n}\n\nfunction MintPromoCard({ onMintClick }: { onMintClick: () => void }) {\n const t = useT();\n return (\n <div className=\"panel p-5 flex flex-col sm:flex-row sm:items-center gap-4\">\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Search, Plus, Sparkles } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { AssetPickerCell, isSameAsset } from \"./asset-picker-cell.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nexport interface OwnedAsset {\n contractAddress: string;\n tokenId: string;\n name: string;\n image: string | null;\n}\n\nexport interface AssetPickerProps {\n\n assets: OwnedAsset[];\n isLoading: boolean;\n selected: OwnedAsset | null;\n onSelect: (asset: OwnedAsset) => void;\n\n emptyStateHref?: string;\n emptyStateLabel?: string;\n onMintClick?: () => void;\n className?: string;\n}\n\nfunction MintPromoCard({ onMintClick }: { onMintClick: () => void }) {\n const t = useT();\n return (\n <div className=\"panel p-5 flex flex-col sm:flex-row sm:items-center gap-4\">\n <IconTile>\n <Sparkles />\n </IconTile>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-bold text-foreground\">{t(\"Mint your first asset\")}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">{t(\"It becomes your avatar and app theme — ready in seconds.\")}</p>\n </div>\n <ActionButton type=\"button\" onClick={onMintClick} className=\"shrink-0\">\n {t(\"Mint an asset\")}\n </ActionButton>\n </div>\n );\n}\n\nfunction MintTile({ onMintClick }: { onMintClick: () => void }) {\nconst t = useT();\nreturn (\n <button\n type=\"button\"\n onClick={onMintClick}\n className=\"aspect-square rounded-xl border-2 border-dashed border-brand-purple/40 hover:border-brand-purple/70 hover:bg-brand-purple/5 transition-colors flex flex-col items-center justify-center gap-1 text-brand-purple\"\n >\n <Plus className=\"h-4 w-4\" />\n <span className=\"text-2xs font-semibold\">{t(\"New\")}</span>\n </button>\n);\n}\n\nexport function AssetPicker({\nassets, isLoading, selected, onSelect, emptyStateHref, emptyStateLabel, onMintClick, className,\n}: AssetPickerProps) {\nconst t = useT();\nconst [query, setQuery] = useState(\"\");\nconst filtered = query\n ? assets.filter((a) => a.name.toLowerCase().includes(query.toLowerCase()))\n : assets;\n\nif (isLoading) {\n return (\n <div className={cn(\"grid grid-cols-3 sm:grid-cols-4 gap-2.5\", className)}>\n {Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"aspect-square rounded-xl bg-muted/60 animate-pulse\" />\n ))}\n </div>\n );\n}\n\nif (assets.length === 0) {\n if (onMintClick) return <MintPromoCard onMintClick={onMintClick} />;\n return (\n <div className={cn(\"rounded-xl border border-dashed border-border/60 p-6 text-center text-sm text-muted-foreground\", className)}>\n {t(\"You don't own any assets yet.\")}\n {emptyStateHref ? (\n <a href={emptyStateHref} className=\"ml-1 font-semibold text-foreground underline underline-offset-2\">\n {emptyStateLabel ?? t(\"Create one\")}\n </a>\n ) : null}\n </div>\n );\n}\n\nreturn (\n <div className={cn(\"space-y-3\", className)}>\n {assets.length > 8 ? (\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none\" />\n <input\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={t(\"Search your assets\")}\n className=\"w-full h-10 rounded-full border border-border bg-card pl-9 pr-4 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-brand-purple/40 focus:border-brand-purple/40\"\n />\n </div>\n ) : null}\n\n <div className=\"grid grid-cols-3 sm:grid-cols-4 gap-2.5 max-h-80 overflow-y-auto pr-0.5\">\n {filtered.map((asset) => (\n <AssetPickerCell\n key={`${asset.contractAddress}-${asset.tokenId}`}\n asset={asset}\n active={isSameAsset(asset, selected)}\n onSelect={onSelect}\n />\n ))}\n {onMintClick && !query ? <MintTile onMintClick={onMintClick} /> : null}\n </div>\n\n {query && filtered.length === 0 ? (\n <p className=\"text-xs text-muted-foreground text-center py-4\">{t(\"No assets match \\\"{query}\\\".\", { query })}</p>\n ) : null}\n </div>\n);\n}\n"],"mappings":";AAmCQ,cAEF,YAFE;AAjCR,SAAS,gBAAgB;AACzB,SAAS,QAAQ,MAAM,gBAAgB;AACvC,SAAS,UAAU;AACnB,SAAS,iBAAiB,mBAAmB;AAC7C,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AAsBzB,SAAS,cAAc,EAAE,YAAY,GAAgC;AACnE,QAAM,IAAI,KAAK;AACf,SACE,qBAAC,SAAI,WAAU,6DACb;AAAA,wBAAC,YACC,8BAAC,YAAS,GACZ;AAAA,IACA,qBAAC,SAAI,WAAU,kBACb;AAAA,0BAAC,OAAE,WAAU,qCAAqC,YAAE,uBAAuB,GAAE;AAAA,MAC7E,oBAAC,OAAE,WAAU,wCAAwC,YAAE,+DAA0D,GAAE;AAAA,OACrH;AAAA,IACA,oBAAC,gBAAa,MAAK,UAAS,SAAS,aAAa,WAAU,YACzD,YAAE,eAAe,GACpB;AAAA,KACF;AAEJ;AAEA,SAAS,SAAS,EAAE,YAAY,GAAgC;AAChE,QAAM,IAAI,KAAK;AACf,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS;AAAA,MACT,WAAU;AAAA,MAEV;AAAA,4BAAC,QAAK,WAAU,WAAU;AAAA,QAC1B,oBAAC,UAAK,WAAU,0BAA0B,YAAE,KAAK,GAAE;AAAA;AAAA;AAAA,EACrD;AAEF;AAEO,SAAS,YAAY;AAAA,EAC5B;AAAA,EAAQ;AAAA,EAAW;AAAA,EAAU;AAAA,EAAU;AAAA,EAAgB;AAAA,EAAiB;AAAA,EAAa;AACrF,GAAqB;AACrB,QAAM,IAAI,KAAK;AACf,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QA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oBAAC,OAAE,WAAU,kDAAkD,YAAE,8BAAgC,EAAE,MAAM,CAAC,GAAE,IAC1G;AAAA,KACN;AAEF;","names":[]}
|
|
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
6
|
variant?: "link" | "default" | "destructive" | "soft" | "secondary" | "ghost" | "tonal" | null | undefined;
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
6
|
variant?: "link" | "default" | "destructive" | "soft" | "secondary" | "ghost" | "tonal" | null | undefined;
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -24,24 +24,21 @@ __export(claim_rail_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(claim_rail_exports);
|
|
25
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
26
|
var import_lucide_react = require("lucide-react");
|
|
27
|
-
var import_cn = require("../utils/cn.js");
|
|
28
27
|
var import_provider = require("../i18n/provider.js");
|
|
28
|
+
var import_icon_tile = require("./icon-tile.js");
|
|
29
29
|
function ClaimRail({
|
|
30
30
|
included,
|
|
31
31
|
steps,
|
|
32
32
|
trustLead,
|
|
33
33
|
trust,
|
|
34
|
-
trustIcon: TrustIcon = import_lucide_react.ShieldCheck
|
|
35
|
-
includedAccentClass = "bg-brand-blue/10 text-brand-blue",
|
|
36
|
-
stepAccentClass = "bg-brand-purple/10 text-brand-purple",
|
|
37
|
-
trustAccentClass = "text-brand-orange"
|
|
34
|
+
trustIcon: TrustIcon = import_lucide_react.ShieldCheck
|
|
38
35
|
}) {
|
|
39
36
|
const t = (0, import_provider.useT)();
|
|
40
37
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-2xl bg-muted/50 dark:bg-card divide-y divide-border/60 overflow-hidden", children: [
|
|
41
38
|
included && included.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "p-5", children: [
|
|
42
39
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "section-label", children: t("What's included") }),
|
|
43
40
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "mt-4 space-y-4", children: included.map(({ icon: Icon, title, desc }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: "flex items-start gap-3", children: [
|
|
44
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {}) }),
|
|
45
42
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
|
|
46
43
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold text-foreground", children: title }),
|
|
47
44
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground leading-relaxed mt-0.5", children: desc })
|
|
@@ -51,12 +48,12 @@ function ClaimRail({
|
|
|
51
48
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "p-5", children: [
|
|
52
49
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "section-label", children: t("How it works") }),
|
|
53
50
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "mt-4 space-y-3", children: steps.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: "flex items-center gap-3", children: [
|
|
54
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { size: "sm", className: "tabular-nums", children: i + 1 }),
|
|
55
52
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm text-foreground/90", children: label })
|
|
56
53
|
] }, label)) })
|
|
57
54
|
] }),
|
|
58
55
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "p-5 bg-muted/40 flex items-start gap-3", children: [
|
|
59
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TrustIcon, { className:
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TrustIcon, { className: "h-5 w-5 shrink-0 mt-0.5 text-primary" }),
|
|
60
57
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm text-muted-foreground leading-relaxed", children: [
|
|
61
58
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold text-foreground", children: trustLead }),
|
|
62
59
|
" ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/claim-rail.tsx"],"sourcesContent":["\"use client\";\n\nimport { ShieldCheck, type LucideIcon } from \"lucide-react\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/claim-rail.tsx"],"sourcesContent":["\"use client\";\n\nimport { ShieldCheck, type LucideIcon } from \"lucide-react\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nexport interface ClaimRailProps {\n\n included?: { icon: LucideIcon; title: string; desc: string }[];\n\n steps: string[];\n\n trustLead: string;\n trust: string;\n\n trustIcon?: LucideIcon;\n}\n\nexport function ClaimRail({\n included,\n steps,\n trustLead,\n trust,\n trustIcon: TrustIcon = ShieldCheck,\n}: ClaimRailProps) {\n const t = useT();\n return (\n <div className=\"rounded-2xl bg-muted/50 dark:bg-card divide-y divide-border/60 overflow-hidden\">\n {included && included.length > 0 && (\n <section className=\"p-5\">\n <p className=\"section-label\">{t(\"What's included\")}</p>\n <ul className=\"mt-4 space-y-4\">\n {included.map(({ icon: Icon, title, desc }) => (\n <li key={title} className=\"flex items-start gap-3\">\n <IconTile size=\"sm\">\n <Icon />\n </IconTile>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold text-foreground\">{title}</p>\n <p className=\"text-sm text-muted-foreground leading-relaxed mt-0.5\">{desc}</p>\n </div>\n </li>\n ))}\n </ul>\n </section>\n )}\n\n <section className=\"p-5\">\n <p className=\"section-label\">{t(\"How it works\")}</p>\n <ol className=\"mt-4 space-y-3\">\n {steps.map((label, i) => (\n <li key={label} className=\"flex items-center gap-3\">\n <IconTile size=\"sm\" className=\"tabular-nums\">\n {i + 1}\n </IconTile>\n <span className=\"text-sm text-foreground/90\">{label}</span>\n </li>\n ))}\n </ol>\n </section>\n\n <section className=\"p-5 bg-muted/40 flex items-start gap-3\">\n <TrustIcon className=\"h-5 w-5 shrink-0 mt-0.5 text-primary\" />\n <p className=\"text-sm text-muted-foreground leading-relaxed\">\n <span className=\"font-semibold text-foreground\">{trustLead}</span> {trust}\n </p>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BU;AA5BV,0BAA6C;AAC7C,sBAAqB;AACrB,uBAAyB;AAclB,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW,YAAY;AACzB,GAAmB;AACjB,QAAM,QAAI,sBAAK;AACf,SACE,6CAAC,SAAI,WAAU,kFACZ;AAAA,gBAAY,SAAS,SAAS,KAC7B,6CAAC,aAAQ,WAAU,OACjB;AAAA,kDAAC,OAAE,WAAU,iBAAiB,YAAE,iBAAiB,GAAE;AAAA,MACnD,4CAAC,QAAG,WAAU,kBACX,mBAAS,IAAI,CAAC,EAAE,MAAM,MAAM,OAAO,KAAK,MACvC,6CAAC,QAAe,WAAU,0BACxB;AAAA,oDAAC,6BAAS,MAAK,MACb,sDAAC,QAAK,GACR;AAAA,QACA,6CAAC,SAAI,WAAU,WACb;AAAA,sDAAC,OAAE,WAAU,yCAAyC,iBAAM;AAAA,UAC5D,4CAAC,OAAE,WAAU,wDAAwD,gBAAK;AAAA,WAC5E;AAAA,WAPO,KAQT,CACD,GACH;AAAA,OACF;AAAA,IAGF,6CAAC,aAAQ,WAAU,OACjB;AAAA,kDAAC,OAAE,WAAU,iBAAiB,YAAE,cAAc,GAAE;AAAA,MAChD,4CAAC,QAAG,WAAU,kBACX,gBAAM,IAAI,CAAC,OAAO,MACjB,6CAAC,QAAe,WAAU,2BACxB;AAAA,oDAAC,6BAAS,MAAK,MAAK,WAAU,gBAC3B,cAAI,GACP;AAAA,QACA,4CAAC,UAAK,WAAU,8BAA8B,iBAAM;AAAA,WAJ7C,KAKT,CACD,GACH;AAAA,OACF;AAAA,IAEA,6CAAC,aAAQ,WAAU,0CACjB;AAAA,kDAAC,aAAU,WAAU,wCAAuC;AAAA,MAC5D,6CAAC,OAAE,WAAU,iDACX;AAAA,oDAAC,UAAK,WAAU,iCAAiC,qBAAU;AAAA,QAAO;AAAA,QAAE;AAAA,SACtE;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -11,10 +11,7 @@ interface ClaimRailProps {
|
|
|
11
11
|
trustLead: string;
|
|
12
12
|
trust: string;
|
|
13
13
|
trustIcon?: LucideIcon;
|
|
14
|
-
includedAccentClass?: string;
|
|
15
|
-
stepAccentClass?: string;
|
|
16
|
-
trustAccentClass?: string;
|
|
17
14
|
}
|
|
18
|
-
declare function ClaimRail({ included, steps, trustLead, trust, trustIcon: TrustIcon,
|
|
15
|
+
declare function ClaimRail({ included, steps, trustLead, trust, trustIcon: TrustIcon, }: ClaimRailProps): react_jsx_runtime.JSX.Element;
|
|
19
16
|
|
|
20
17
|
export { ClaimRail, type ClaimRailProps };
|
|
@@ -11,10 +11,7 @@ interface ClaimRailProps {
|
|
|
11
11
|
trustLead: string;
|
|
12
12
|
trust: string;
|
|
13
13
|
trustIcon?: LucideIcon;
|
|
14
|
-
includedAccentClass?: string;
|
|
15
|
-
stepAccentClass?: string;
|
|
16
|
-
trustAccentClass?: string;
|
|
17
14
|
}
|
|
18
|
-
declare function ClaimRail({ included, steps, trustLead, trust, trustIcon: TrustIcon,
|
|
15
|
+
declare function ClaimRail({ included, steps, trustLead, trust, trustIcon: TrustIcon, }: ClaimRailProps): react_jsx_runtime.JSX.Element;
|
|
19
16
|
|
|
20
17
|
export { ClaimRail, type ClaimRailProps };
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ShieldCheck } from "lucide-react";
|
|
4
|
-
import { cn } from "../utils/cn.js";
|
|
5
4
|
import { useT } from "../i18n/provider.js";
|
|
5
|
+
import { IconTile } from "./icon-tile.js";
|
|
6
6
|
function ClaimRail({
|
|
7
7
|
included,
|
|
8
8
|
steps,
|
|
9
9
|
trustLead,
|
|
10
10
|
trust,
|
|
11
|
-
trustIcon: TrustIcon = ShieldCheck
|
|
12
|
-
includedAccentClass = "bg-brand-blue/10 text-brand-blue",
|
|
13
|
-
stepAccentClass = "bg-brand-purple/10 text-brand-purple",
|
|
14
|
-
trustAccentClass = "text-brand-orange"
|
|
11
|
+
trustIcon: TrustIcon = ShieldCheck
|
|
15
12
|
}) {
|
|
16
13
|
const t = useT();
|
|
17
14
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl bg-muted/50 dark:bg-card divide-y divide-border/60 overflow-hidden", children: [
|
|
18
15
|
included && included.length > 0 && /* @__PURE__ */ jsxs("section", { className: "p-5", children: [
|
|
19
16
|
/* @__PURE__ */ jsx("p", { className: "section-label", children: t("What's included") }),
|
|
20
17
|
/* @__PURE__ */ jsx("ul", { className: "mt-4 space-y-4", children: included.map(({ icon: Icon, title, desc }) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-3", children: [
|
|
21
|
-
/* @__PURE__ */ jsx(
|
|
18
|
+
/* @__PURE__ */ jsx(IconTile, { size: "sm", children: /* @__PURE__ */ jsx(Icon, {}) }),
|
|
22
19
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
23
20
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-foreground", children: title }),
|
|
24
21
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground leading-relaxed mt-0.5", children: desc })
|
|
@@ -28,12 +25,12 @@ function ClaimRail({
|
|
|
28
25
|
/* @__PURE__ */ jsxs("section", { className: "p-5", children: [
|
|
29
26
|
/* @__PURE__ */ jsx("p", { className: "section-label", children: t("How it works") }),
|
|
30
27
|
/* @__PURE__ */ jsx("ol", { className: "mt-4 space-y-3", children: steps.map((label, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-3", children: [
|
|
31
|
-
/* @__PURE__ */ jsx(
|
|
28
|
+
/* @__PURE__ */ jsx(IconTile, { size: "sm", className: "tabular-nums", children: i + 1 }),
|
|
32
29
|
/* @__PURE__ */ jsx("span", { className: "text-sm text-foreground/90", children: label })
|
|
33
30
|
] }, label)) })
|
|
34
31
|
] }),
|
|
35
32
|
/* @__PURE__ */ jsxs("section", { className: "p-5 bg-muted/40 flex items-start gap-3", children: [
|
|
36
|
-
/* @__PURE__ */ jsx(TrustIcon, { className:
|
|
33
|
+
/* @__PURE__ */ jsx(TrustIcon, { className: "h-5 w-5 shrink-0 mt-0.5 text-primary" }),
|
|
37
34
|
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground leading-relaxed", children: [
|
|
38
35
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground", children: trustLead }),
|
|
39
36
|
" ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/claim-rail.tsx"],"sourcesContent":["\"use client\";\n\nimport { ShieldCheck, type LucideIcon } from \"lucide-react\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/claim-rail.tsx"],"sourcesContent":["\"use client\";\n\nimport { ShieldCheck, type LucideIcon } from \"lucide-react\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nexport interface ClaimRailProps {\n\n included?: { icon: LucideIcon; title: string; desc: string }[];\n\n steps: string[];\n\n trustLead: string;\n trust: string;\n\n trustIcon?: LucideIcon;\n}\n\nexport function ClaimRail({\n included,\n steps,\n trustLead,\n trust,\n trustIcon: TrustIcon = ShieldCheck,\n}: ClaimRailProps) {\n const t = useT();\n return (\n <div className=\"rounded-2xl bg-muted/50 dark:bg-card divide-y divide-border/60 overflow-hidden\">\n {included && included.length > 0 && (\n <section className=\"p-5\">\n <p className=\"section-label\">{t(\"What's included\")}</p>\n <ul className=\"mt-4 space-y-4\">\n {included.map(({ icon: Icon, title, desc }) => (\n <li key={title} className=\"flex items-start gap-3\">\n <IconTile size=\"sm\">\n <Icon />\n </IconTile>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold text-foreground\">{title}</p>\n <p className=\"text-sm text-muted-foreground leading-relaxed mt-0.5\">{desc}</p>\n </div>\n </li>\n ))}\n </ul>\n </section>\n )}\n\n <section className=\"p-5\">\n <p className=\"section-label\">{t(\"How it works\")}</p>\n <ol className=\"mt-4 space-y-3\">\n {steps.map((label, i) => (\n <li key={label} className=\"flex items-center gap-3\">\n <IconTile size=\"sm\" className=\"tabular-nums\">\n {i + 1}\n </IconTile>\n <span className=\"text-sm text-foreground/90\">{label}</span>\n </li>\n ))}\n </ol>\n </section>\n\n <section className=\"p-5 bg-muted/40 flex items-start gap-3\">\n <TrustIcon className=\"h-5 w-5 shrink-0 mt-0.5 text-primary\" />\n <p className=\"text-sm text-muted-foreground leading-relaxed\">\n <span className=\"font-semibold text-foreground\">{trustLead}</span> {trust}\n </p>\n </section>\n </div>\n );\n}\n"],"mappings":";AA8BU,cAOM,YAPN;AA5BV,SAAS,mBAAoC;AAC7C,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAclB,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW,YAAY;AACzB,GAAmB;AACjB,QAAM,IAAI,KAAK;AACf,SACE,qBAAC,SAAI,WAAU,kFACZ;AAAA,gBAAY,SAAS,SAAS,KAC7B,qBAAC,aAAQ,WAAU,OACjB;AAAA,0BAAC,OAAE,WAAU,iBAAiB,YAAE,iBAAiB,GAAE;AAAA,MACnD,oBAAC,QAAG,WAAU,kBACX,mBAAS,IAAI,CAAC,EAAE,MAAM,MAAM,OAAO,KAAK,MACvC,qBAAC,QAAe,WAAU,0BACxB;AAAA,4BAAC,YAAS,MAAK,MACb,8BAAC,QAAK,GACR;AAAA,QACA,qBAAC,SAAI,WAAU,WACb;AAAA,8BAAC,OAAE,WAAU,yCAAyC,iBAAM;AAAA,UAC5D,oBAAC,OAAE,WAAU,wDAAwD,gBAAK;AAAA,WAC5E;AAAA,WAPO,KAQT,CACD,GACH;AAAA,OACF;AAAA,IAGF,qBAAC,aAAQ,WAAU,OACjB;AAAA,0BAAC,OAAE,WAAU,iBAAiB,YAAE,cAAc,GAAE;AAAA,MAChD,oBAAC,QAAG,WAAU,kBACX,gBAAM,IAAI,CAAC,OAAO,MACjB,qBAAC,QAAe,WAAU,2BACxB;AAAA,4BAAC,YAAS,MAAK,MAAK,WAAU,gBAC3B,cAAI,GACP;AAAA,QACA,oBAAC,UAAK,WAAU,8BAA8B,iBAAM;AAAA,WAJ7C,KAKT,CACD,GACH;AAAA,OACF;AAAA,IAEA,qBAAC,aAAQ,WAAU,0CACjB;AAAA,0BAAC,aAAU,WAAU,wCAAuC;AAAA,MAC5D,qBAAC,OAAE,WAAU,iDACX;AAAA,4BAAC,UAAK,WAAU,iCAAiC,qBAAU;AAAA,QAAO;AAAA,QAAE;AAAA,SACtE;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -50,6 +50,7 @@ var import_use_collection_settings = require("../utils/use-collection-settings.j
|
|
|
50
50
|
var import_provider = require("../i18n/provider.js");
|
|
51
51
|
var import_translate = require("../i18n/translate.js");
|
|
52
52
|
var import_panel = require("./panel.js");
|
|
53
|
+
var import_icon_tile = require("./icon-tile.js");
|
|
53
54
|
const DESC_MAX = 500;
|
|
54
55
|
const CONTENT_TYPES = [
|
|
55
56
|
{ value: "VIDEO", label: (0, import_translate.msg)("Video"), icon: import_lucide_react.Video, hint: (0, import_translate.msg)("YouTube, Vimeo, or any video URL") },
|
|
@@ -77,7 +78,7 @@ function CollectionSettings({ contract }) {
|
|
|
77
78
|
const descLen = form.description.length;
|
|
78
79
|
if (!collectionLoading && collection && !isOwner) {
|
|
79
80
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-12 flex flex-col items-center gap-3 text-center", children: [
|
|
80
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Lock, {}) }),
|
|
81
82
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium", children: t("Owner access only") }),
|
|
82
83
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground max-w-xs", children: t("Only the collection owner can access settings. If you believe this is yours, visit your portfolio to claim it.") }),
|
|
83
84
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "soft", size: "sm", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/portfolio/collections", children: t("Go to my collections") }) })
|
|
@@ -203,8 +204,6 @@ function CollectionSettings({ contract }) {
|
|
|
203
204
|
icon: import_lucide_react.Lock,
|
|
204
205
|
title: t("Exclusive content"),
|
|
205
206
|
description: t("Reward your holders with exclusive content \u2014 only wallets that own a token from this collection can access it."),
|
|
206
|
-
iconClass: form.gatedEnabled ? "text-brand-blue" : "text-muted-foreground",
|
|
207
|
-
bgClass: form.gatedEnabled ? "bg-brand-blue/15" : "bg-muted",
|
|
208
207
|
badge: form.gatedEnabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_badge.Badge, { variant: "soft", className: "text-2xs h-4 px-1.5 gap-1 text-brand-blue border-brand-blue/30", children: [
|
|
209
208
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Unlock, { className: "h-2.5 w-2.5" }),
|
|
210
209
|
t("Active")
|