@medialane/ui 0.203.0 → 0.205.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/components/activity-row.cjs +2 -1
  2. package/dist/components/activity-row.cjs.map +1 -1
  3. package/dist/components/activity-row.js +2 -1
  4. package/dist/components/activity-row.js.map +1 -1
  5. package/dist/components/button.d.cts +1 -1
  6. package/dist/components/button.d.ts +1 -1
  7. package/dist/components/collection-filters-dialog.cjs +24 -2
  8. package/dist/components/collection-filters-dialog.cjs.map +1 -1
  9. package/dist/components/collection-filters-dialog.d.cts +4 -2
  10. package/dist/components/collection-filters-dialog.d.ts +4 -2
  11. package/dist/components/collection-filters-dialog.js +23 -2
  12. package/dist/components/collection-filters-dialog.js.map +1 -1
  13. package/dist/components/collection-filters.cjs +44 -39
  14. package/dist/components/collection-filters.cjs.map +1 -1
  15. package/dist/components/collection-filters.d.cts +3 -1
  16. package/dist/components/collection-filters.d.ts +3 -1
  17. package/dist/components/collection-filters.js +44 -39
  18. package/dist/components/collection-filters.js.map +1 -1
  19. package/dist/components/collection-header.cjs +2 -16
  20. package/dist/components/collection-header.cjs.map +1 -1
  21. package/dist/components/collection-header.d.cts +1 -2
  22. package/dist/components/collection-header.d.ts +1 -2
  23. package/dist/components/collection-header.js +2 -16
  24. package/dist/components/collection-header.js.map +1 -1
  25. package/dist/components/collection-more-menu.cjs +74 -0
  26. package/dist/components/collection-more-menu.cjs.map +1 -0
  27. package/dist/components/collection-more-menu.d.cts +9 -0
  28. package/dist/components/collection-more-menu.d.ts +9 -0
  29. package/dist/components/collection-more-menu.js +50 -0
  30. package/dist/components/collection-more-menu.js.map +1 -0
  31. package/dist/components/collection-name-claim.cjs +100 -0
  32. package/dist/components/collection-name-claim.cjs.map +1 -0
  33. package/dist/components/collection-name-claim.d.cts +5 -0
  34. package/dist/components/collection-name-claim.d.ts +5 -0
  35. package/dist/components/collection-name-claim.js +66 -0
  36. package/dist/components/collection-name-claim.js.map +1 -0
  37. package/dist/components/collection-page.cjs +46 -34
  38. package/dist/components/collection-page.cjs.map +1 -1
  39. package/dist/components/collection-page.js +48 -36
  40. package/dist/components/collection-page.js.map +1 -1
  41. package/dist/components/creators-page.cjs +218 -0
  42. package/dist/components/creators-page.cjs.map +1 -0
  43. package/dist/components/creators-page.d.cts +5 -0
  44. package/dist/components/creators-page.d.ts +5 -0
  45. package/dist/components/creators-page.js +184 -0
  46. package/dist/components/creators-page.js.map +1 -0
  47. package/dist/components/discover-community-section.cjs +171 -0
  48. package/dist/components/discover-community-section.cjs.map +1 -0
  49. package/dist/components/discover-community-section.d.cts +5 -0
  50. package/dist/components/discover-community-section.d.ts +5 -0
  51. package/dist/components/discover-community-section.js +137 -0
  52. package/dist/components/discover-community-section.js.map +1 -0
  53. package/dist/components/discover-page.cjs +96 -0
  54. package/dist/components/discover-page.cjs.map +1 -0
  55. package/dist/components/discover-page.d.cts +14 -0
  56. package/dist/components/discover-page.d.ts +14 -0
  57. package/dist/components/discover-page.js +72 -0
  58. package/dist/components/discover-page.js.map +1 -0
  59. package/dist/components/fast-mint/fast-mint.d.cts +2 -2
  60. package/dist/components/fast-mint/fast-mint.d.ts +2 -2
  61. package/dist/components/home-page.cjs +124 -0
  62. package/dist/components/home-page.cjs.map +1 -0
  63. package/dist/components/home-page.d.cts +13 -0
  64. package/dist/components/home-page.d.ts +13 -0
  65. package/dist/components/home-page.js +90 -0
  66. package/dist/components/home-page.js.map +1 -0
  67. package/dist/components/ip-type-nav.cjs +74 -0
  68. package/dist/components/ip-type-nav.cjs.map +1 -0
  69. package/dist/components/ip-type-nav.d.cts +5 -0
  70. package/dist/components/ip-type-nav.d.ts +5 -0
  71. package/dist/components/ip-type-nav.js +40 -0
  72. package/dist/components/ip-type-nav.js.map +1 -0
  73. package/dist/components/portfolio-assets.cjs +2 -5
  74. package/dist/components/portfolio-assets.cjs.map +1 -1
  75. package/dist/components/portfolio-assets.js +3 -6
  76. package/dist/components/portfolio-assets.js.map +1 -1
  77. package/dist/components/rewards/leaderboard-panel.cjs +107 -0
  78. package/dist/components/rewards/leaderboard-panel.cjs.map +1 -0
  79. package/dist/components/rewards/leaderboard-panel.d.cts +12 -0
  80. package/dist/components/rewards/leaderboard-panel.d.ts +12 -0
  81. package/dist/components/rewards/leaderboard-panel.js +73 -0
  82. package/dist/components/rewards/leaderboard-panel.js.map +1 -0
  83. package/dist/components/rewards/rewards-dashboard.cjs +341 -0
  84. package/dist/components/rewards/rewards-dashboard.cjs.map +1 -0
  85. package/dist/components/rewards/rewards-dashboard.d.cts +6 -0
  86. package/dist/components/rewards/rewards-dashboard.d.ts +6 -0
  87. package/dist/components/rewards/rewards-dashboard.js +331 -0
  88. package/dist/components/rewards/rewards-dashboard.js.map +1 -0
  89. package/dist/components/share-button.cjs +2 -8
  90. package/dist/components/share-button.cjs.map +1 -1
  91. package/dist/components/share-button.js +2 -8
  92. package/dist/components/share-button.js.map +1 -1
  93. package/dist/components/sheet.d.cts +1 -1
  94. package/dist/components/sheet.d.ts +1 -1
  95. package/dist/index.cjs +29 -0
  96. package/dist/index.cjs.map +1 -1
  97. package/dist/index.d.cts +9 -0
  98. package/dist/index.d.ts +9 -0
  99. package/dist/index.js +19 -0
  100. package/dist/index.js.map +1 -1
  101. package/dist/utils/order-usd.cjs +35 -0
  102. package/dist/utils/order-usd.cjs.map +1 -0
  103. package/dist/utils/order-usd.d.cts +8 -0
  104. package/dist/utils/order-usd.d.ts +8 -0
  105. package/dist/utils/order-usd.js +11 -0
  106. package/dist/utils/order-usd.js.map +1 -0
  107. package/dist/utils/share.cjs +42 -0
  108. package/dist/utils/share.cjs.map +1 -0
  109. package/dist/utils/share.d.cts +3 -0
  110. package/dist/utils/share.d.ts +3 -0
  111. package/dist/utils/share.js +18 -0
  112. package/dist/utils/share.js.map +1 -0
  113. package/package.json +1 -1
@@ -64,50 +64,55 @@ function CollectionFiltersTrigger({
64
64
  onOpen,
65
65
  onSortReset,
66
66
  onRemoveFilter,
67
- onClearAll
67
+ onClearAll,
68
+ showButton = true,
69
+ showChips = true
68
70
  }) {
71
+ if (!showButton && (!showChips || sortIsDefault && activeEntries.length === 0)) return null;
69
72
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2 flex-wrap", children: [
70
- /* @__PURE__ */ jsxs("button", { onClick: onOpen, className: TRIGGER_BTN, children: [
73
+ showButton && /* @__PURE__ */ jsxs("button", { onClick: onOpen, className: TRIGGER_BTN, "aria-label": "Filters", children: [
71
74
  /* @__PURE__ */ jsx(SlidersHorizontal, { className: "h-3.5 w-3.5" }),
72
- "Filters",
75
+ /* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: "Filters" }),
73
76
  totalActiveCount > 0 && /* @__PURE__ */ jsx("span", { className: "h-4 min-w-4 rounded-full bg-primary text-2xs font-bold text-primary-foreground flex items-center justify-center px-1 -mr-1", children: totalActiveCount })
74
77
  ] }),
75
- !sortIsDefault && /* @__PURE__ */ jsxs(
76
- "button",
77
- {
78
- onClick: onSortReset,
79
- className: "inline-flex items-center gap-1 h-8 px-2.5 rounded-md border border-primary/40 bg-primary/10 text-xs font-medium text-foreground hover:bg-primary/20 transition-colors",
80
- children: [
81
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-2xs", children: "Sort:" }),
82
- /* @__PURE__ */ jsx("span", { children: SORT_OPTIONS.find((o) => o.value === sort)?.label }),
83
- /* @__PURE__ */ jsx(X, { className: "h-3 w-3 text-muted-foreground ml-0.5" })
84
- ]
85
- }
86
- ),
87
- activeEntries.map(({ traitType, value }) => /* @__PURE__ */ jsxs(
88
- "button",
89
- {
90
- onClick: () => onRemoveFilter(traitType, value),
91
- className: "inline-flex items-center gap-1 h-8 px-2.5 rounded-md border border-primary/40 bg-primary/10 text-xs font-medium text-foreground hover:bg-primary/20 transition-colors",
92
- children: [
93
- /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-2xs", children: [
94
- traitType,
95
- ":"
96
- ] }),
97
- /* @__PURE__ */ jsx("span", { children: value }),
98
- /* @__PURE__ */ jsx(X, { className: "h-3 w-3 text-muted-foreground ml-0.5" })
99
- ]
100
- },
101
- `${traitType}:${value}`
102
- )),
103
- totalActiveCount > 1 && /* @__PURE__ */ jsx(
104
- "button",
105
- {
106
- onClick: onClearAll,
107
- className: "text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline transition-colors",
108
- children: "Clear all"
109
- }
110
- )
78
+ showChips && /* @__PURE__ */ jsxs(Fragment, { children: [
79
+ !sortIsDefault && /* @__PURE__ */ jsxs(
80
+ "button",
81
+ {
82
+ onClick: onSortReset,
83
+ className: "inline-flex items-center gap-1 h-8 px-2.5 rounded-md border border-primary/40 bg-primary/10 text-xs font-medium text-foreground hover:bg-primary/20 transition-colors",
84
+ children: [
85
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-2xs", children: "Sort:" }),
86
+ /* @__PURE__ */ jsx("span", { children: SORT_OPTIONS.find((o) => o.value === sort)?.label }),
87
+ /* @__PURE__ */ jsx(X, { className: "h-3 w-3 text-muted-foreground ml-0.5" })
88
+ ]
89
+ }
90
+ ),
91
+ activeEntries.map(({ traitType, value }) => /* @__PURE__ */ jsxs(
92
+ "button",
93
+ {
94
+ onClick: () => onRemoveFilter(traitType, value),
95
+ className: "inline-flex items-center gap-1 h-8 px-2.5 rounded-md border border-primary/40 bg-primary/10 text-xs font-medium text-foreground hover:bg-primary/20 transition-colors",
96
+ children: [
97
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-2xs", children: [
98
+ traitType,
99
+ ":"
100
+ ] }),
101
+ /* @__PURE__ */ jsx("span", { children: value }),
102
+ /* @__PURE__ */ jsx(X, { className: "h-3 w-3 text-muted-foreground ml-0.5" })
103
+ ]
104
+ },
105
+ `${traitType}:${value}`
106
+ )),
107
+ totalActiveCount > 1 && /* @__PURE__ */ jsx(
108
+ "button",
109
+ {
110
+ onClick: onClearAll,
111
+ className: "text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline transition-colors",
112
+ children: "Clear all"
113
+ }
114
+ )
115
+ ] })
111
116
  ] });
112
117
  }
113
118
  const PILL_BASE = "inline-flex items-center gap-1 h-7 px-2.5 rounded-full border text-xs font-medium transition-colors";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/collection-filters.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\nimport { SlidersHorizontal, X, Check } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport type { ApiToken, CollectionTokensSort } from \"@medialane/sdk\";\n\nconst EXCLUDED_TRAIT_TYPES = new Set([\"registration\"]);\n\nexport const SORT_OPTIONS: { value: CollectionTokensSort; label: string }[] = [\n { value: \"recent\", label: \"Recent\" },\n { value: \"oldest\", label: \"Oldest\" },\n { value: \"name\", label: \"Name\" },\n { value: \"price\", label: \"Price\" },\n];\n\nexport interface TraitSection {\n traitType: string;\n values: { value: string; count: number }[];\n}\n\nexport function useCollectionFilters(\n tokens: ApiToken[],\n selected: Record<string, string[]>,\n onChange: (filters: Record<string, string[]>) => void,\n sort: CollectionTokensSort,\n onSortChange: (sort: CollectionTokensSort) => void,\n) {\n\n const traitSections: TraitSection[] = useMemo(() => {\n const map = new Map<string, Map<string, number>>();\n for (const token of tokens) {\n const attrs = Array.isArray(token.metadata?.attributes)\n ? (token.metadata.attributes as { trait_type?: string; value?: string }[])\n : [];\n for (const attr of attrs) {\n if (!attr.trait_type || attr.value == null) continue;\n if (EXCLUDED_TRAIT_TYPES.has(attr.trait_type.toLowerCase())) continue;\n if (!map.has(attr.trait_type)) map.set(attr.trait_type, new Map());\n const counts = map.get(attr.trait_type)!;\n const v = String(attr.value);\n counts.set(v, (counts.get(v) ?? 0) + 1);\n }\n }\n return Array.from(map.entries())\n .map(([traitType, counts]) => ({\n traitType,\n values: Array.from(counts.entries())\n .map(([value, count]) => ({ value, count }))\n .sort((a, b) => b.count - a.count || a.value.localeCompare(b.value)),\n }))\n .filter((section) => section.values.length >= 2);\n }, [tokens]);\n\n const activeEntries = Object.entries(selected).flatMap(([traitType, values]) =>\n values.map((value) => ({ traitType, value }))\n );\n const traitActiveCount = activeEntries.length;\n const sortIsDefault = sort === \"recent\";\n const totalActiveCount = traitActiveCount + (sortIsDefault ? 0 : 1);\n\n function toggleValue(traitType: string, value: string) {\n const current = selected[traitType] ?? [];\n const next = current.includes(value)\n ? current.filter((v) => v !== value)\n : [...current, value];\n const nextSelected = { ...selected };\n if (next.length === 0) {\n delete nextSelected[traitType];\n } else {\n nextSelected[traitType] = next;\n }\n onChange(nextSelected);\n }\n\n function clearAll() {\n onChange({});\n onSortChange(\"recent\");\n }\n\n function removeFilter(traitType: string, value: string) {\n toggleValue(traitType, value);\n }\n\n return { traitSections, activeEntries, totalActiveCount, sortIsDefault, toggleValue, clearAll, removeFilter };\n}\n\nconst TRIGGER_BTN = \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md border border-input bg-background text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-8 px-3 shrink-0\";\n\nexport interface CollectionFiltersTriggerProps {\n totalActiveCount: number;\n sortIsDefault: boolean;\n sort: CollectionTokensSort;\n activeEntries: { traitType: string; value: string }[];\n onOpen: () => void;\n onSortReset: () => void;\n onRemoveFilter: (traitType: string, value: string) => void;\n onClearAll: () => void;\n}\n\nexport function CollectionFiltersTrigger({\n totalActiveCount,\n sortIsDefault,\n sort,\n activeEntries,\n onOpen,\n onSortReset,\n onRemoveFilter,\n onClearAll,\n}: CollectionFiltersTriggerProps) {\n return (\n <div className=\"flex items-center justify-end gap-2 flex-wrap\">\n <button onClick={onOpen} className={TRIGGER_BTN}>\n <SlidersHorizontal className=\"h-3.5 w-3.5\" />\n Filters\n {totalActiveCount > 0 && (\n <span className=\"h-4 min-w-4 rounded-full bg-primary text-2xs font-bold text-primary-foreground flex items-center justify-center px-1 -mr-1\">\n {totalActiveCount}\n </span>\n )}\n </button>\n\n {!sortIsDefault && (\n <button\n onClick={onSortReset}\n className=\"inline-flex items-center gap-1 h-8 px-2.5 rounded-md border border-primary/40 bg-primary/10 text-xs font-medium text-foreground hover:bg-primary/20 transition-colors\"\n >\n <span className=\"text-muted-foreground text-2xs\">Sort:</span>\n <span>{SORT_OPTIONS.find((o) => o.value === sort)?.label}</span>\n <X className=\"h-3 w-3 text-muted-foreground ml-0.5\" />\n </button>\n )}\n\n {activeEntries.map(({ traitType, value }) => (\n <button\n key={`${traitType}:${value}`}\n onClick={() => onRemoveFilter(traitType, value)}\n className=\"inline-flex items-center gap-1 h-8 px-2.5 rounded-md border border-primary/40 bg-primary/10 text-xs font-medium text-foreground hover:bg-primary/20 transition-colors\"\n >\n <span className=\"text-muted-foreground text-2xs\">{traitType}:</span>\n <span>{value}</span>\n <X className=\"h-3 w-3 text-muted-foreground ml-0.5\" />\n </button>\n ))}\n\n {totalActiveCount > 1 && (\n <button\n onClick={onClearAll}\n className=\"text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline transition-colors\"\n >\n Clear all\n </button>\n )}\n </div>\n );\n}\n\nexport interface CollectionFiltersBodyProps {\n sort: CollectionTokensSort;\n onSortChange: (sort: CollectionTokensSort) => void;\n traitSections: TraitSection[];\n selected: Record<string, string[]>;\n onToggleValue: (traitType: string, value: string) => void;\n}\n\nconst PILL_BASE = \"inline-flex items-center gap-1 h-7 px-2.5 rounded-full border text-xs font-medium transition-colors\";\nconst PILL_ON = \"border-primary bg-primary text-primary-foreground\";\nconst PILL_OFF = \"border-border bg-transparent text-muted-foreground hover:text-foreground hover:border-foreground/30\";\n\nexport function CollectionFiltersBody({\n sort,\n onSortChange,\n traitSections,\n selected,\n onToggleValue,\n}: CollectionFiltersBodyProps) {\n return (\n <div className=\"flex-1 overflow-y-auto px-5 py-3 space-y-4\">\n\n <div>\n <div className=\"mb-2\">\n <span className=\"text-sm font-medium\">Sort by</span>\n </div>\n <div className=\"flex flex-wrap gap-1.5\">\n {SORT_OPTIONS.map(({ value, label }) => {\n const isSelected = sort === value;\n return (\n <button\n key={value}\n onClick={() => onSortChange(value)}\n className={cn(PILL_BASE, isSelected ? PILL_ON : PILL_OFF)}\n >\n {isSelected && <Check className=\"h-3 w-3\" />}\n <span>{label}</span>\n </button>\n );\n })}\n </div>\n </div>\n\n {traitSections.length > 0 && (\n <>\n <div className=\"h-px w-full bg-border\" />\n {traitSections.map((section, i) => {\n const activeValues = selected[section.traitType] ?? [];\n return (\n <div key={section.traitType}>\n {i > 0 && <div className=\"h-px w-full bg-border mb-4\" />}\n <div className=\"flex items-center justify-between mb-2\">\n <span className=\"text-sm font-medium\">{section.traitType}</span>\n <span className=\"text-2xs text-muted-foreground\">\n {section.values.length} values\n </span>\n </div>\n <div className=\"flex flex-wrap gap-1.5\">\n {section.values.map(({ value, count }) => {\n const isSelected = activeValues.includes(value);\n return (\n <button\n key={value}\n onClick={() => onToggleValue(section.traitType, value)}\n className={cn(PILL_BASE, isSelected ? PILL_ON : PILL_OFF)}\n >\n {isSelected && <Check className=\"h-3 w-3\" />}\n <span>{value}</span>\n <span className={isSelected ? \"opacity-80\" : \"opacity-60\"}>\n {count}\n </span>\n </button>\n );\n })}\n </div>\n </div>\n );\n })}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";AAgHM,SAyFE,UAxFA,KADF;AA9GN,SAAS,eAAe;AACxB,SAAS,mBAAmB,GAAG,aAAa;AAC5C,SAAS,UAAU;AAGnB,MAAM,uBAAuB,oBAAI,IAAI,CAAC,cAAc,CAAC;AAE9C,MAAM,eAAiE;AAAA,EAC5E,EAAE,OAAO,UAAU,OAAO,SAAS;AAAA,EACnC,EAAE,OAAO,UAAU,OAAO,SAAS;AAAA,EACnC,EAAE,OAAO,QAAQ,OAAO,OAAO;AAAA,EAC/B,EAAE,OAAO,SAAS,OAAO,QAAQ;AACnC;AAOO,SAAS,qBACd,QACA,UACA,UACA,MACA,cACA;AAEA,QAAM,gBAAgC,QAAQ,MAAM;AAClD,UAAM,MAAM,oBAAI,IAAiC;AACjD,eAAW,SAAS,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U,0CACb;AAAA,gCAAC,UAAK,WAAU,uBAAuB,kBAAQ,WAAU;AAAA,YACzD,qBAAC,UAAK,WAAU,kCACb;AAAA,sBAAQ,OAAO;AAAA,cAAO;AAAA,eACzB;AAAA,aACF;AAAA,UACA,oBAAC,SAAI,WAAU,0BACZ,kBAAQ,OAAO,IAAI,CAAC,EAAE,OAAO,MAAM,MAAM;AACxC,kBAAM,aAAa,aAAa,SAAS,KAAK;AAC9C,mBACE;AAAA,cAAC;AAAA;AAAA,gBAEC,SAAS,MAAM,cAAc,QAAQ,WAAW,KAAK;AAAA,gBACrD,WAAW,GAAG,WAAW,aAAa,UAAU,QAAQ;AAAA,gBAEvD;AAAA,gCAAc,oBAAC,SAAM,WAAU,WAAU;AAAA,kBAC1C,oBAAC,UAAM,iBAAM;AAAA,kBACb,oBAAC,UAAK,WAAW,aAAa,eAAe,cAC1C,iBACH;AAAA;AAAA;AAAA,cARK;AAAA,YASP;AAAA,UAEJ,CAAC,GACH;AAAA,aAzBQ,QAAQ,SA0BlB;AAAA,MAEJ,CAAC;AAAA,OACH;AAAA,KAEJ;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/collection-filters.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\nimport { SlidersHorizontal, X, Check } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport type { ApiToken, CollectionTokensSort } from \"@medialane/sdk\";\n\nconst EXCLUDED_TRAIT_TYPES = new Set([\"registration\"]);\n\nexport const SORT_OPTIONS: { value: CollectionTokensSort; label: string }[] = [\n { value: \"recent\", label: \"Recent\" },\n { value: \"oldest\", label: \"Oldest\" },\n { value: \"name\", label: \"Name\" },\n { value: \"price\", label: \"Price\" },\n];\n\nexport interface TraitSection {\n traitType: string;\n values: { value: string; count: number }[];\n}\n\nexport function useCollectionFilters(\n tokens: ApiToken[],\n selected: Record<string, string[]>,\n onChange: (filters: Record<string, string[]>) => void,\n sort: CollectionTokensSort,\n onSortChange: (sort: CollectionTokensSort) => void,\n) {\n\n const traitSections: TraitSection[] = useMemo(() => {\n const map = new Map<string, Map<string, number>>();\n for (const token of tokens) {\n const attrs = Array.isArray(token.metadata?.attributes)\n ? (token.metadata.attributes as { trait_type?: string; value?: string }[])\n : [];\n for (const attr of attrs) {\n if (!attr.trait_type || attr.value == null) continue;\n if (EXCLUDED_TRAIT_TYPES.has(attr.trait_type.toLowerCase())) continue;\n if (!map.has(attr.trait_type)) map.set(attr.trait_type, new Map());\n const counts = map.get(attr.trait_type)!;\n const v = String(attr.value);\n counts.set(v, (counts.get(v) ?? 0) + 1);\n }\n }\n return Array.from(map.entries())\n .map(([traitType, counts]) => ({\n traitType,\n values: Array.from(counts.entries())\n .map(([value, count]) => ({ value, count }))\n .sort((a, b) => b.count - a.count || a.value.localeCompare(b.value)),\n }))\n .filter((section) => section.values.length >= 2);\n }, [tokens]);\n\n const activeEntries = Object.entries(selected).flatMap(([traitType, values]) =>\n values.map((value) => ({ traitType, value }))\n );\n const traitActiveCount = activeEntries.length;\n const sortIsDefault = sort === \"recent\";\n const totalActiveCount = traitActiveCount + (sortIsDefault ? 0 : 1);\n\n function toggleValue(traitType: string, value: string) {\n const current = selected[traitType] ?? [];\n const next = current.includes(value)\n ? current.filter((v) => v !== value)\n : [...current, value];\n const nextSelected = { ...selected };\n if (next.length === 0) {\n delete nextSelected[traitType];\n } else {\n nextSelected[traitType] = next;\n }\n onChange(nextSelected);\n }\n\n function clearAll() {\n onChange({});\n onSortChange(\"recent\");\n }\n\n function removeFilter(traitType: string, value: string) {\n toggleValue(traitType, value);\n }\n\n return { traitSections, activeEntries, totalActiveCount, sortIsDefault, toggleValue, clearAll, removeFilter };\n}\n\nconst TRIGGER_BTN = \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md border border-input bg-background text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-8 px-3 shrink-0\";\n\nexport interface CollectionFiltersTriggerProps {\n totalActiveCount: number;\n sortIsDefault: boolean;\n sort: CollectionTokensSort;\n activeEntries: { traitType: string; value: string }[];\n onOpen: () => void;\n onSortReset: () => void;\n onRemoveFilter: (traitType: string, value: string) => void;\n onClearAll: () => void;\n showButton?: boolean;\n showChips?: boolean;\n}\n\nexport function CollectionFiltersTrigger({\n totalActiveCount,\n sortIsDefault,\n sort,\n activeEntries,\n onOpen,\n onSortReset,\n onRemoveFilter,\n onClearAll,\n showButton = true,\n showChips = true,\n}: CollectionFiltersTriggerProps) {\n if (!showButton && (!showChips || (sortIsDefault && activeEntries.length === 0))) return null;\n return (\n <div className=\"flex items-center justify-end gap-2 flex-wrap\">\n {showButton && (\n <button onClick={onOpen} className={TRIGGER_BTN} aria-label=\"Filters\">\n <SlidersHorizontal className=\"h-3.5 w-3.5\" />\n <span className=\"hidden sm:inline\">Filters</span>\n {totalActiveCount > 0 && (\n <span className=\"h-4 min-w-4 rounded-full bg-primary text-2xs font-bold text-primary-foreground flex items-center justify-center px-1 -mr-1\">\n {totalActiveCount}\n </span>\n )}\n </button>\n )}\n {showChips && (\n <>\n\n {!sortIsDefault && (\n <button\n onClick={onSortReset}\n className=\"inline-flex items-center gap-1 h-8 px-2.5 rounded-md border border-primary/40 bg-primary/10 text-xs font-medium text-foreground hover:bg-primary/20 transition-colors\"\n >\n <span className=\"text-muted-foreground text-2xs\">Sort:</span>\n <span>{SORT_OPTIONS.find((o) => o.value === sort)?.label}</span>\n <X className=\"h-3 w-3 text-muted-foreground ml-0.5\" />\n </button>\n )}\n\n {activeEntries.map(({ traitType, value }) => (\n <button\n key={`${traitType}:${value}`}\n onClick={() => onRemoveFilter(traitType, value)}\n className=\"inline-flex items-center gap-1 h-8 px-2.5 rounded-md border border-primary/40 bg-primary/10 text-xs font-medium text-foreground hover:bg-primary/20 transition-colors\"\n >\n <span className=\"text-muted-foreground text-2xs\">{traitType}:</span>\n <span>{value}</span>\n <X className=\"h-3 w-3 text-muted-foreground ml-0.5\" />\n </button>\n ))}\n\n {totalActiveCount > 1 && (\n <button\n onClick={onClearAll}\n className=\"text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline transition-colors\"\n >\n Clear all\n </button>\n )}\n </>\n )}\n </div>\n );\n}\n\nexport interface CollectionFiltersBodyProps {\n sort: CollectionTokensSort;\n onSortChange: (sort: CollectionTokensSort) => void;\n traitSections: TraitSection[];\n selected: Record<string, string[]>;\n onToggleValue: (traitType: string, value: string) => void;\n}\n\nconst PILL_BASE = \"inline-flex items-center gap-1 h-7 px-2.5 rounded-full border text-xs font-medium transition-colors\";\nconst PILL_ON = \"border-primary bg-primary text-primary-foreground\";\nconst PILL_OFF = \"border-border bg-transparent text-muted-foreground hover:text-foreground hover:border-foreground/30\";\n\nexport function CollectionFiltersBody({\n sort,\n onSortChange,\n traitSections,\n selected,\n onToggleValue,\n}: CollectionFiltersBodyProps) {\n return (\n <div className=\"flex-1 overflow-y-auto px-5 py-3 space-y-4\">\n\n <div>\n <div className=\"mb-2\">\n <span className=\"text-sm font-medium\">Sort by</span>\n </div>\n <div className=\"flex flex-wrap gap-1.5\">\n {SORT_OPTIONS.map(({ value, label }) => {\n const isSelected = sort === value;\n return (\n <button\n key={value}\n onClick={() => onSortChange(value)}\n className={cn(PILL_BASE, isSelected ? PILL_ON : PILL_OFF)}\n >\n {isSelected && <Check className=\"h-3 w-3\" />}\n <span>{label}</span>\n </button>\n );\n })}\n </div>\n </div>\n\n {traitSections.length > 0 && (\n <>\n <div className=\"h-px w-full bg-border\" />\n {traitSections.map((section, i) => {\n const activeValues = selected[section.traitType] ?? [];\n return (\n <div key={section.traitType}>\n {i > 0 && <div className=\"h-px w-full bg-border mb-4\" />}\n <div className=\"flex items-center justify-between mb-2\">\n <span className=\"text-sm font-medium\">{section.traitType}</span>\n <span className=\"text-2xs text-muted-foreground\">\n {section.values.length} values\n </span>\n </div>\n <div className=\"flex flex-wrap gap-1.5\">\n {section.values.map(({ value, count }) => {\n const isSelected = activeValues.includes(value);\n return (\n <button\n key={value}\n onClick={() => onToggleValue(section.traitType, value)}\n className={cn(PILL_BASE, isSelected ? PILL_ON : PILL_OFF)}\n >\n {isSelected && <Check className=\"h-3 w-3\" />}\n <span>{value}</span>\n <span className={isSelected ? \"opacity-80\" : \"opacity-60\"}>\n {count}\n </span>\n </button>\n );\n })}\n </div>\n </div>\n );\n })}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";AAsHQ,SAWA,UAVE,KADF;AApHR,SAAS,eAAe;AACxB,SAAS,mBAAmB,GAAG,aAAa;AAC5C,SAAS,UAAU;AAGnB,MAAM,uBAAuB,oBAAI,IAAI,CAAC,cAAc,CAAC;AAE9C,MAAM,eAAiE;AAAA,EAC5E,EAAE,OAAO,UAAU,OAAO,SAAS;AAAA,EACnC,EAAE,OAAO,UAAU,OAAO,SAAS;AAAA,EACnC,EAAE,OAAO,QAAQ,OAAO,OAAO;AAAA,EAC/B,EAAE,OAAO,SAAS,OAAO,QAAQ;AACnC;AAOO,SAAS,qBACd,QACA,UACA,UACA,MACA,cACA;AAEA,QAAM,gBAAgC,QAAQ,MAAM;AAClD,UAAM,MAAM,oBAAI,IAAiC;AACjD,eAAW,SAAS,QAAQ;AAC1B,YAAM,QAAQ,MAAM,QAAQ,MAAM,UAAU,UAAU,IACjD,MAAM,SAAS,aAChB,CAAC;AACL,iBAAW,QAAQ,OAAO;AACxB,YAAI,CAAC,KAAK,cAAc,KAAK,SAAS,KAAM;AAC5C,YAAI,qBAAqB,IAAI,KAAK,WAAW,YAAY,CAAC,EAAG;AAC7D,YAAI,CAAC,IAAI,IAAI,KAAK,UAAU,EAAG,KAAI,IAAI,KAAK,YAAY,oBAAI,IAAI,CAAC;AACjE,cAAM,SAAS,IAAI,IAAI,KAAK,UAAU;AACtC,cAAM,IAAI,OAAO,KAAK,KAAK;AAC3B,eAAO,IAAI,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,CAAC;AAAA,MACxC;AAAA,IACF;AACA,WAAO,MAAM,KAAK,IAAI,QAAQ,CAAC,EAC5B,IAAI,CAAC,C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AAK;AAAA,gBACrD,WAAW,GAAG,WAAW,aAAa,UAAU,QAAQ;AAAA,gBAEvD;AAAA,gCAAc,oBAAC,SAAM,WAAU,WAAU;AAAA,kBAC1C,oBAAC,UAAM,iBAAM;AAAA,kBACb,oBAAC,UAAK,WAAW,aAAa,eAAe,cAC1C,iBACH;AAAA;AAAA;AAAA,cARK;AAAA,YASP;AAAA,UAEJ,CAAC,GACH;AAAA,aAzBQ,QAAQ,SA0BlB;AAAA,MAEJ,CAAC;AAAA,OACH;AAAA,KAEJ;AAEJ;","names":[]}
@@ -26,12 +26,9 @@ var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import_lucide_react = require("lucide-react");
27
27
  var import_asset_top_sections = require("./asset-top-sections.js");
28
28
  var import_media_header = require("./media-header.js");
29
- var import_asset_utility_icons = require("./asset-utility-icons.js");
30
- var import_address_display = require("./address-display.js");
31
29
  var import_creator_chip = require("./creator-chip.js");
32
30
  var import_currency_icon = require("./currency-icon.js");
33
31
  var import_format = require("../utils/format.js");
34
- var import_explorer_url = require("../utils/explorer-url.js");
35
32
  var import_use_image_url = require("../utils/use-image-url.js");
36
33
  const CHIP = "text-2xs font-semibold px-2.5 py-1 rounded-full bg-muted text-muted-foreground";
37
34
  function PriceStat({ label, raw }) {
@@ -39,7 +36,7 @@ function PriceStat({ label, raw }) {
39
36
  if (!symbol || numStr === "\u2014") return null;
40
37
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_media_header.HeaderStat, { label, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: numStr, symbol, iconSize: 12 }) });
41
38
  }
42
- function CollectionHeader({ collection, loading = false, onReportClick, children }) {
39
+ function CollectionHeader({ collection, loading = false, children }) {
43
40
  const resolveImage = (0, import_use_image_url.useImageUrl)();
44
41
  const image = resolveImage(collection?.image);
45
42
  const name = collection?.name ?? "Unnamed Collection";
@@ -61,18 +58,7 @@ function CollectionHeader({ collection, loading = false, onReportClick, children
61
58
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PriceStat, { label: "Floor", raw: collection.floorPrice }),
62
59
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PriceStat, { label: "Volume", raw: collection.totalVolume })
63
60
  ] }),
64
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
65
- collection.owner ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_creator_chip.CreatorChip, { address: collection.owner }) : null,
66
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: collection.contractAddress, chars: 6, className: "text-xs text-muted-foreground" })
67
- ] }),
68
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "-ml-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
- import_asset_utility_icons.AssetUtilityIcons,
70
- {
71
- contractExplorerHref: `${import_explorer_url.EXPLORER_URL}/contract/${collection.contractAddress}`,
72
- shareTitle: name,
73
- onReportClick
74
- }
75
- ) }),
61
+ collection.owner ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_creator_chip.CreatorChip, { address: collection.owner }) : null,
76
62
  children
77
63
  ] }) : null });
78
64
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/collection-header.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Layers } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { AssetHeaderBlock } from \"./asset-top-sections.js\";\nimport { MediaHeader, HeaderStats, HeaderStat } from \"./media-header.js\";\nimport { AssetUtilityIcons } from \"./asset-utility-icons.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CreatorChip } from \"./creator-chip.js\";\nimport { CurrencyAmount } from \"./currency-icon.js\";\nimport { parsePriceDisplay } from \"../utils/format.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nconst CHIP = \"text-2xs font-semibold px-2.5 py-1 rounded-full bg-muted text-muted-foreground\";\n\nexport interface CollectionHeaderProps {\n collection: ApiCollection | null | undefined;\n loading?: boolean;\n onReportClick: () => void;\n children?: ReactNode;\n}\n\nfunction PriceStat({ label, raw }: { label: string; raw: string | null }) {\n const { numStr, symbol } = parsePriceDisplay(raw);\n if (!symbol || numStr === \"—\") return null;\n return (\n <HeaderStat label={label}>\n <CurrencyAmount amount={numStr} symbol={symbol} iconSize={12} />\n </HeaderStat>\n );\n}\n\nexport function CollectionHeader({ collection, loading = false, onReportClick, children }: CollectionHeaderProps) {\n const resolveImage = useImageUrl();\n const image = resolveImage(collection?.image);\n const name = collection?.name ?? \"Unnamed Collection\";\n\n return (\n <MediaHeader image={image} imageAlt={name} fallbackIcon={Layers} loading={loading || !collection}>\n {collection ? (\n <>\n <AssetHeaderBlock\n name={name}\n description={collection.description}\n badges={(\n <>\n <span className={CHIP}>{collection.standard === \"ERC1155\" ? \"Multi-edition\" : \"Single NFT\"}</span>\n {collection.symbol ? <span className={CHIP}>{collection.symbol}</span> : null}\n </>\n )}\n />\n\n <HeaderStats>\n {collection.totalSupply != null ? <HeaderStat label=\"Items\">{collection.totalSupply.toLocaleString()}</HeaderStat> : null}\n {collection.holderCount != null ? <HeaderStat label=\"Holders\">{collection.holderCount.toLocaleString()}</HeaderStat> : null}\n <PriceStat label=\"Floor\" raw={collection.floorPrice} />\n <PriceStat label=\"Volume\" raw={collection.totalVolume} />\n </HeaderStats>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n {collection.owner ? <CreatorChip address={collection.owner} /> : null}\n <AddressDisplay address={collection.contractAddress} chars={6} className=\"text-xs text-muted-foreground\" />\n </div>\n\n <div className=\"-ml-3\">\n <AssetUtilityIcons\n contractExplorerHref={`${EXPLORER_URL}/contract/${collection.contractAddress}`}\n shareTitle={name}\n onReportClick={onReportClick}\n />\n </div>\n\n {children}\n </>\n ) : null}\n </MediaHeader>\n );\n}\n"],"mappings":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AC,aAAU,OAAM,UAAS,KAAK,WAAW,aAAa;AAAA,OACzD;AAAA,IAEA,6CAAC,SAAI,WAAU,qCACZ;AAAA,iBAAW,QAAQ,4CAAC,mCAAY,SAAS,WAAW,OAAO,IAAK;AAAA,MACjE,4CAAC,yCAAe,SAAS,WAAW,iBAAiB,OAAO,GAAG,WAAU,iCAAgC;AAAA,OAC3G;AAAA,IAEA,4CAAC,SAAI,WAAU,SACb;AAAA,MAAC;AAAA;AAAA,QACC,sBAAsB,GAAG,gCAAY,aAAa,WAAW,eAAe;AAAA,QAC5E,YAAY;AAAA,QACZ;AAAA;AAAA,IACF,GACF;AAAA,IAEC;AAAA,KACH,IACE,MACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/collection-header.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Layers } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { AssetHeaderBlock } from \"./asset-top-sections.js\";\nimport { MediaHeader, HeaderStats, HeaderStat } from \"./media-header.js\";\nimport { CreatorChip } from \"./creator-chip.js\";\nimport { CurrencyAmount } from \"./currency-icon.js\";\nimport { parsePriceDisplay } from \"../utils/format.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nconst CHIP = \"text-2xs font-semibold px-2.5 py-1 rounded-full bg-muted text-muted-foreground\";\n\nexport interface CollectionHeaderProps {\n collection: ApiCollection | null | undefined;\n loading?: boolean;\n children?: ReactNode;\n}\n\nfunction PriceStat({ label, raw }: { label: string; raw: string | null }) {\n const { numStr, symbol } = parsePriceDisplay(raw);\n if (!symbol || numStr === \"—\") return null;\n return (\n <HeaderStat label={label}>\n <CurrencyAmount amount={numStr} symbol={symbol} iconSize={12} />\n </HeaderStat>\n );\n}\n\nexport function CollectionHeader({ collection, loading = false, children }: CollectionHeaderProps) {\n const resolveImage = useImageUrl();\n const image = resolveImage(collection?.image);\n const name = collection?.name ?? \"Unnamed Collection\";\n\n return (\n <MediaHeader image={image} imageAlt={name} fallbackIcon={Layers} loading={loading || !collection}>\n {collection ? (\n <>\n <AssetHeaderBlock\n name={name}\n description={collection.description}\n badges={(\n <>\n <span className={CHIP}>{collection.standard === \"ERC1155\" ? \"Multi-edition\" : \"Single NFT\"}</span>\n {collection.symbol ? <span className={CHIP}>{collection.symbol}</span> : null}\n </>\n )}\n />\n\n <HeaderStats>\n {collection.totalSupply != null ? <HeaderStat label=\"Items\">{collection.totalSupply.toLocaleString()}</HeaderStat> : null}\n {collection.holderCount != null ? <HeaderStat label=\"Holders\">{collection.holderCount.toLocaleString()}</HeaderStat> : null}\n <PriceStat label=\"Floor\" raw={collection.floorPrice} />\n <PriceStat label=\"Volume\" raw={collection.totalVolume} />\n </HeaderStats>\n\n {collection.owner ? <CreatorChip address={collection.owner} /> : null}\n\n {children}\n </>\n ) : null}\n </MediaHeader>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBM;AAtBN,0BAAuB;AAEvB,gCAAiC;AACjC,0BAAqD;AACrD,0BAA4B;AAC5B,2BAA+B;AAC/B,oBAAkC;AAClC,2BAA4B;AAE5B,MAAM,OAAO;AAQb,SAAS,UAAU,EAAE,OAAO,IAAI,GAA0C;AACxE,QAAM,EAAE,QAAQ,OAAO,QAAI,iCAAkB,GAAG;AAChD,MAAI,CAAC,UAAU,WAAW,SAAK,QAAO;AACtC,SACE,4CAAC,kCAAW,OACV,sDAAC,uCAAe,QAAQ,QAAQ,QAAgB,UAAU,IAAI,GAChE;AAEJ;AAEO,SAAS,iBAAiB,EAAE,YAAY,UAAU,OAAO,SAAS,GAA0B;AACjG,QAAM,mBAAe,kCAAY;AACjC,QAAM,QAAQ,aAAa,YAAY,KAAK;AAC5C,QAAM,OAAO,YAAY,QAAQ;AAEjC,SACE,4CAAC,mCAAY,OAAc,UAAU,MAAM,cAAc,4BAAQ,SAAS,WAAW,CAAC,YACnF,uBACC,4EACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,aAAa,WAAW;AAAA,QACxB,QACE,4EACE;AAAA,sDAAC,UAAK,WAAW,MAAO,qBAAW,aAAa,YAAY,kBAAkB,cAAa;AAAA,UAC1F,WAAW,SAAS,4CAAC,UAAK,WAAW,MAAO,qBAAW,QAAO,IAAU;AAAA,WAC3E;AAAA;AAAA,IAEJ;AAAA,IAEA,6CAAC,mCACE;AAAA,iBAAW,eAAe,OAAO,4CAAC,kCAAW,OAAM,SAAS,qBAAW,YAAY,eAAe,GAAE,IAAgB;AAAA,MACpH,WAAW,eAAe,OAAO,4CAAC,kCAAW,OAAM,WAAW,qBAAW,YAAY,eAAe,GAAE,IAAgB;AAAA,MACvH,4CAAC,aAAU,OAAM,SAAQ,KAAK,WAAW,YAAY;AAAA,MACrD,4CAAC,aAAU,OAAM,UAAS,KAAK,WAAW,aAAa;AAAA,OACzD;AAAA,IAEC,WAAW,QAAQ,4CAAC,mCAAY,SAAS,WAAW,OAAO,IAAK;AAAA,IAEhE;AAAA,KACH,IACE,MACN;AAEJ;","names":[]}
@@ -5,9 +5,8 @@ import { ApiCollection } from '@medialane/sdk';
5
5
  interface CollectionHeaderProps {
6
6
  collection: ApiCollection | null | undefined;
7
7
  loading?: boolean;
8
- onReportClick: () => void;
9
8
  children?: ReactNode;
10
9
  }
11
- declare function CollectionHeader({ collection, loading, onReportClick, children }: CollectionHeaderProps): react_jsx_runtime.JSX.Element;
10
+ declare function CollectionHeader({ collection, loading, children }: CollectionHeaderProps): react_jsx_runtime.JSX.Element;
12
11
 
13
12
  export { CollectionHeader, type CollectionHeaderProps };
@@ -5,9 +5,8 @@ import { ApiCollection } from '@medialane/sdk';
5
5
  interface CollectionHeaderProps {
6
6
  collection: ApiCollection | null | undefined;
7
7
  loading?: boolean;
8
- onReportClick: () => void;
9
8
  children?: ReactNode;
10
9
  }
11
- declare function CollectionHeader({ collection, loading, onReportClick, children }: CollectionHeaderProps): react_jsx_runtime.JSX.Element;
10
+ declare function CollectionHeader({ collection, loading, children }: CollectionHeaderProps): react_jsx_runtime.JSX.Element;
12
11
 
13
12
  export { CollectionHeader, type CollectionHeaderProps };
@@ -3,12 +3,9 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Layers } from "lucide-react";
4
4
  import { AssetHeaderBlock } from "./asset-top-sections.js";
5
5
  import { MediaHeader, HeaderStats, HeaderStat } from "./media-header.js";
6
- import { AssetUtilityIcons } from "./asset-utility-icons.js";
7
- import { AddressDisplay } from "./address-display.js";
8
6
  import { CreatorChip } from "./creator-chip.js";
9
7
  import { CurrencyAmount } from "./currency-icon.js";
10
8
  import { parsePriceDisplay } from "../utils/format.js";
11
- import { EXPLORER_URL } from "../utils/explorer-url.js";
12
9
  import { useImageUrl } from "../utils/use-image-url.js";
13
10
  const CHIP = "text-2xs font-semibold px-2.5 py-1 rounded-full bg-muted text-muted-foreground";
14
11
  function PriceStat({ label, raw }) {
@@ -16,7 +13,7 @@ function PriceStat({ label, raw }) {
16
13
  if (!symbol || numStr === "\u2014") return null;
17
14
  return /* @__PURE__ */ jsx(HeaderStat, { label, children: /* @__PURE__ */ jsx(CurrencyAmount, { amount: numStr, symbol, iconSize: 12 }) });
18
15
  }
19
- function CollectionHeader({ collection, loading = false, onReportClick, children }) {
16
+ function CollectionHeader({ collection, loading = false, children }) {
20
17
  const resolveImage = useImageUrl();
21
18
  const image = resolveImage(collection?.image);
22
19
  const name = collection?.name ?? "Unnamed Collection";
@@ -38,18 +35,7 @@ function CollectionHeader({ collection, loading = false, onReportClick, children
38
35
  /* @__PURE__ */ jsx(PriceStat, { label: "Floor", raw: collection.floorPrice }),
39
36
  /* @__PURE__ */ jsx(PriceStat, { label: "Volume", raw: collection.totalVolume })
40
37
  ] }),
41
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
42
- collection.owner ? /* @__PURE__ */ jsx(CreatorChip, { address: collection.owner }) : null,
43
- /* @__PURE__ */ jsx(AddressDisplay, { address: collection.contractAddress, chars: 6, className: "text-xs text-muted-foreground" })
44
- ] }),
45
- /* @__PURE__ */ jsx("div", { className: "-ml-3", children: /* @__PURE__ */ jsx(
46
- AssetUtilityIcons,
47
- {
48
- contractExplorerHref: `${EXPLORER_URL}/contract/${collection.contractAddress}`,
49
- shareTitle: name,
50
- onReportClick
51
- }
52
- ) }),
38
+ collection.owner ? /* @__PURE__ */ jsx(CreatorChip, { address: collection.owner }) : null,
53
39
  children
54
40
  ] }) : null });
55
41
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/collection-header.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Layers } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { AssetHeaderBlock } from \"./asset-top-sections.js\";\nimport { MediaHeader, HeaderStats, HeaderStat } from \"./media-header.js\";\nimport { AssetUtilityIcons } from \"./asset-utility-icons.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CreatorChip } from \"./creator-chip.js\";\nimport { CurrencyAmount } from \"./currency-icon.js\";\nimport { parsePriceDisplay } from \"../utils/format.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nconst CHIP = \"text-2xs font-semibold px-2.5 py-1 rounded-full bg-muted text-muted-foreground\";\n\nexport interface CollectionHeaderProps {\n collection: ApiCollection | null | undefined;\n loading?: boolean;\n onReportClick: () => void;\n children?: ReactNode;\n}\n\nfunction PriceStat({ label, raw }: { label: string; raw: string | null }) {\n const { numStr, symbol } = parsePriceDisplay(raw);\n if (!symbol || numStr === \"—\") return null;\n return (\n <HeaderStat label={label}>\n <CurrencyAmount amount={numStr} symbol={symbol} iconSize={12} />\n </HeaderStat>\n );\n}\n\nexport function CollectionHeader({ collection, loading = false, onReportClick, children }: CollectionHeaderProps) {\n const resolveImage = useImageUrl();\n const image = resolveImage(collection?.image);\n const name = collection?.name ?? \"Unnamed Collection\";\n\n return (\n <MediaHeader image={image} imageAlt={name} fallbackIcon={Layers} loading={loading || !collection}>\n {collection ? (\n <>\n <AssetHeaderBlock\n name={name}\n description={collection.description}\n badges={(\n <>\n <span className={CHIP}>{collection.standard === \"ERC1155\" ? \"Multi-edition\" : \"Single NFT\"}</span>\n {collection.symbol ? <span className={CHIP}>{collection.symbol}</span> : null}\n </>\n )}\n />\n\n <HeaderStats>\n {collection.totalSupply != null ? <HeaderStat label=\"Items\">{collection.totalSupply.toLocaleString()}</HeaderStat> : null}\n {collection.holderCount != null ? <HeaderStat label=\"Holders\">{collection.holderCount.toLocaleString()}</HeaderStat> : null}\n <PriceStat label=\"Floor\" raw={collection.floorPrice} />\n <PriceStat label=\"Volume\" raw={collection.totalVolume} />\n </HeaderStats>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n {collection.owner ? <CreatorChip address={collection.owner} /> : null}\n <AddressDisplay address={collection.contractAddress} chars={6} className=\"text-xs text-muted-foreground\" />\n </div>\n\n <div className=\"-ml-3\">\n <AssetUtilityIcons\n contractExplorerHref={`${EXPLORER_URL}/contract/${collection.contractAddress}`}\n shareTitle={name}\n onReportClick={onReportClick}\n />\n </div>\n\n {children}\n </>\n ) : null}\n </MediaHeader>\n );\n}\n"],"mappings":";AA6BM,SAkBQ,UAlBR,KAkBQ,YAlBR;AA1BN,SAAS,cAAc;AAEvB,SAAS,wBAAwB;AACjC,SAAS,aAAa,aAAa,kBAAkB;AACrD,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAE5B,MAAM,OAAO;AASb,SAAS,UAAU,EAAE,OAAO,IAAI,GAA0C;AACxE,QAAM,EAAE,QAAQ,OAAO,IAAI,kBAAkB,GAAG;AAChD,MAAI,CAAC,UAAU,WAAW,SAAK,QAAO;AACtC,SACE,oBAAC,cAAW,OACV,8BAAC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H,IACE,MACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/collection-header.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Layers } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { AssetHeaderBlock } from \"./asset-top-sections.js\";\nimport { MediaHeader, HeaderStats, HeaderStat } from \"./media-header.js\";\nimport { CreatorChip } from \"./creator-chip.js\";\nimport { CurrencyAmount } from \"./currency-icon.js\";\nimport { parsePriceDisplay } from \"../utils/format.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nconst CHIP = \"text-2xs font-semibold px-2.5 py-1 rounded-full bg-muted text-muted-foreground\";\n\nexport interface CollectionHeaderProps {\n collection: ApiCollection | null | undefined;\n loading?: boolean;\n children?: ReactNode;\n}\n\nfunction PriceStat({ label, raw }: { label: string; raw: string | null }) {\n const { numStr, symbol } = parsePriceDisplay(raw);\n if (!symbol || numStr === \"—\") return null;\n return (\n <HeaderStat label={label}>\n <CurrencyAmount amount={numStr} symbol={symbol} iconSize={12} />\n </HeaderStat>\n );\n}\n\nexport function CollectionHeader({ collection, loading = false, children }: CollectionHeaderProps) {\n const resolveImage = useImageUrl();\n const image = resolveImage(collection?.image);\n const name = collection?.name ?? \"Unnamed Collection\";\n\n return (\n <MediaHeader image={image} imageAlt={name} fallbackIcon={Layers} loading={loading || !collection}>\n {collection ? (\n <>\n <AssetHeaderBlock\n name={name}\n description={collection.description}\n badges={(\n <>\n <span className={CHIP}>{collection.standard === \"ERC1155\" ? \"Multi-edition\" : \"Single NFT\"}</span>\n {collection.symbol ? <span className={CHIP}>{collection.symbol}</span> : null}\n </>\n )}\n />\n\n <HeaderStats>\n {collection.totalSupply != null ? <HeaderStat label=\"Items\">{collection.totalSupply.toLocaleString()}</HeaderStat> : null}\n {collection.holderCount != null ? <HeaderStat label=\"Holders\">{collection.holderCount.toLocaleString()}</HeaderStat> : null}\n <PriceStat label=\"Floor\" raw={collection.floorPrice} />\n <PriceStat label=\"Volume\" raw={collection.totalVolume} />\n </HeaderStats>\n\n {collection.owner ? <CreatorChip address={collection.owner} /> : null}\n\n {children}\n </>\n ) : null}\n </MediaHeader>\n );\n}\n"],"mappings":";AAyBM,SAkBQ,UAlBR,KAkBQ,YAlBR;AAtBN,SAAS,cAAc;AAEvB,SAAS,wBAAwB;AACjC,SAAS,aAAa,aAAa,kBAAkB;AACrD,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAE5B,MAAM,OAAO;AAQb,SAAS,UAAU,EAAE,OAAO,IAAI,GAA0C;AACxE,QAAM,EAAE,QAAQ,OAAO,IAAI,kBAAkB,GAAG;AAChD,MAAI,CAAC,UAAU,WAAW,SAAK,QAAO;AACtC,SACE,oBAAC,cAAW,OACV,8BAAC,kBAAe,QAAQ,QAAQ,QAAgB,UAAU,IAAI,GAChE;AAEJ;AAEO,SAAS,iBAAiB,EAAE,YAAY,UAAU,OAAO,SAAS,GAA0B;AACjG,QAAM,eAAe,YAAY;AACjC,QAAM,QAAQ,aAAa,YAAY,KAAK;AAC5C,QAAM,OAAO,YAAY,QAAQ;AAEjC,SACE,oBAAC,eAAY,OAAc,UAAU,MAAM,cAAc,QAAQ,SAAS,WAAW,CAAC,YACnF,uBACC,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,aAAa,WAAW;AAAA,QACxB,QACE,iCACE;AAAA,8BAAC,UAAK,WAAW,MAAO,qBAAW,aAAa,YAAY,kBAAkB,cAAa;AAAA,UAC1F,WAAW,SAAS,oBAAC,UAAK,WAAW,MAAO,qBAAW,QAAO,IAAU;AAAA,WAC3E;AAAA;AAAA,IAEJ;AAAA,IAEA,qBAAC,eACE;AAAA,iBAAW,eAAe,OAAO,oBAAC,cAAW,OAAM,SAAS,qBAAW,YAAY,eAAe,GAAE,IAAgB;AAAA,MACpH,WAAW,eAAe,OAAO,oBAAC,cAAW,OAAM,WAAW,qBAAW,YAAY,eAAe,GAAE,IAAgB;AAAA,MACvH,oBAAC,aAAU,OAAM,SAAQ,KAAK,WAAW,YAAY;AAAA,MACrD,oBAAC,aAAU,OAAM,UAAS,KAAK,WAAW,aAAa;AAAA,OACzD;AAAA,IAEC,WAAW,QAAQ,oBAAC,eAAY,SAAS,WAAW,OAAO,IAAK;AAAA,IAEhE;AAAA,KACH,IACE,MACN;AAEJ;","names":[]}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var collection_more_menu_exports = {};
21
+ __export(collection_more_menu_exports, {
22
+ CollectionMoreMenu: () => CollectionMoreMenu
23
+ });
24
+ module.exports = __toCommonJS(collection_more_menu_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
27
+ var import_lucide_react = require("lucide-react");
28
+ var import_dropdown_menu = require("./dropdown-menu.js");
29
+ var import_share = require("../utils/share.js");
30
+ function CollectionMoreMenu({ explorerHref, shareTitle, onReport }) {
31
+ const [copied, setCopied] = (0, import_react.useState)(false);
32
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dropdown_menu.DropdownMenu, { children: [
33
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
34
+ import_dropdown_menu.DropdownMenuTrigger,
35
+ {
36
+ "aria-label": "More options",
37
+ className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-input bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
38
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.MoreHorizontal, { className: "h-4 w-4" })
39
+ }
40
+ ),
41
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dropdown_menu.DropdownMenuContent, { align: "end", children: [
42
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dropdown_menu.DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("a", { href: explorerHref, target: "_blank", rel: "noopener noreferrer", children: [
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ExternalLink, {}),
44
+ "View on explorer"
45
+ ] }) }),
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
47
+ import_dropdown_menu.DropdownMenuItem,
48
+ {
49
+ onSelect: (e) => {
50
+ e.preventDefault();
51
+ void (0, import_share.shareOrCopy)(shareTitle).then((result) => {
52
+ if (result !== "copied") return;
53
+ setCopied(true);
54
+ setTimeout(() => setCopied(false), 2e3);
55
+ });
56
+ },
57
+ children: [
58
+ copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "text-emerald-500" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Share2, {}),
59
+ copied ? "Link copied" : "Share"
60
+ ]
61
+ }
62
+ ),
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dropdown_menu.DropdownMenuItem, { onSelect: onReport, children: [
64
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Flag, {}),
65
+ "Report"
66
+ ] })
67
+ ] })
68
+ ] });
69
+ }
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ CollectionMoreMenu
73
+ });
74
+ //# sourceMappingURL=collection-more-menu.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/collection-more-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Check, ExternalLink, Flag, MoreHorizontal, Share2 } from \"lucide-react\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"./dropdown-menu.js\";\nimport { shareOrCopy } from \"../utils/share.js\";\n\nexport function CollectionMoreMenu({ explorerHref, shareTitle, onReport }: { explorerHref: string; shareTitle: string; onReport: () => void }) {\n const [copied, setCopied] = useState(false);\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-label=\"More options\"\n className=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-input bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem asChild>\n <a href={explorerHref} target=\"_blank\" rel=\"noopener noreferrer\">\n <ExternalLink />\n View on explorer\n </a>\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={(e) => {\n e.preventDefault();\n void shareOrCopy(shareTitle).then((result) => {\n if (result !== \"copied\") return;\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n });\n }}\n >\n {copied ? <Check className=\"text-emerald-500\" /> : <Share2 />}\n {copied ? \"Link copied\" : \"Share\"}\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={onReport}>\n <Flag />\n Report\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeQ;AAbR,mBAAyB;AACzB,0BAAkE;AAClE,2BAAyF;AACzF,mBAA4B;AAErB,SAAS,mBAAmB,EAAE,cAAc,YAAY,SAAS,GAAuE;AAC7I,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KAAK;AAC1C,SACE,6CAAC,qCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,WAAU;AAAA,QAEV,sDAAC,sCAAe,WAAU,WAAU;AAAA;AAAA,IACtC;AAAA,IACA,6CAAC,4CAAoB,OAAM,OACzB;AAAA,kDAAC,yCAAiB,SAAO,MACvB,uDAAC,OAAE,MAAM,cAAc,QAAO,UAAS,KAAI,uBACzC;AAAA,oDAAC,oCAAa;AAAA,QAAE;AAAA,SAElB,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,CAAC,MAAM;AACf,cAAE,eAAe;AACjB,qBAAK,0BAAY,UAAU,EAAE,KAAK,CAAC,WAAW;AAC5C,kBAAI,WAAW,SAAU;AACzB,wBAAU,IAAI;AACd,yBAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,YACzC,CAAC;AAAA,UACH;AAAA,UAEC;AAAA,qBAAS,4CAAC,6BAAM,WAAU,oBAAmB,IAAK,4CAAC,8BAAO;AAAA,YAC1D,SAAS,gBAAgB;AAAA;AAAA;AAAA,MAC5B;AAAA,MACA,6CAAC,yCAAiB,UAAU,UAC1B;AAAA,oDAAC,4BAAK;AAAA,QAAE;AAAA,SAEV;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function CollectionMoreMenu({ explorerHref, shareTitle, onReport }: {
4
+ explorerHref: string;
5
+ shareTitle: string;
6
+ onReport: () => void;
7
+ }): react_jsx_runtime.JSX.Element;
8
+
9
+ export { CollectionMoreMenu };
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function CollectionMoreMenu({ explorerHref, shareTitle, onReport }: {
4
+ explorerHref: string;
5
+ shareTitle: string;
6
+ onReport: () => void;
7
+ }): react_jsx_runtime.JSX.Element;
8
+
9
+ export { CollectionMoreMenu };
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { Check, ExternalLink, Flag, MoreHorizontal, Share2 } from "lucide-react";
5
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./dropdown-menu.js";
6
+ import { shareOrCopy } from "../utils/share.js";
7
+ function CollectionMoreMenu({ explorerHref, shareTitle, onReport }) {
8
+ const [copied, setCopied] = useState(false);
9
+ return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
10
+ /* @__PURE__ */ jsx(
11
+ DropdownMenuTrigger,
12
+ {
13
+ "aria-label": "More options",
14
+ className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-input bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
15
+ children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" })
16
+ }
17
+ ),
18
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", children: [
19
+ /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs("a", { href: explorerHref, target: "_blank", rel: "noopener noreferrer", children: [
20
+ /* @__PURE__ */ jsx(ExternalLink, {}),
21
+ "View on explorer"
22
+ ] }) }),
23
+ /* @__PURE__ */ jsxs(
24
+ DropdownMenuItem,
25
+ {
26
+ onSelect: (e) => {
27
+ e.preventDefault();
28
+ void shareOrCopy(shareTitle).then((result) => {
29
+ if (result !== "copied") return;
30
+ setCopied(true);
31
+ setTimeout(() => setCopied(false), 2e3);
32
+ });
33
+ },
34
+ children: [
35
+ copied ? /* @__PURE__ */ jsx(Check, { className: "text-emerald-500" }) : /* @__PURE__ */ jsx(Share2, {}),
36
+ copied ? "Link copied" : "Share"
37
+ ]
38
+ }
39
+ ),
40
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { onSelect: onReport, children: [
41
+ /* @__PURE__ */ jsx(Flag, {}),
42
+ "Report"
43
+ ] })
44
+ ] })
45
+ ] });
46
+ }
47
+ export {
48
+ CollectionMoreMenu
49
+ };
50
+ //# sourceMappingURL=collection-more-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/collection-more-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Check, ExternalLink, Flag, MoreHorizontal, Share2 } from \"lucide-react\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"./dropdown-menu.js\";\nimport { shareOrCopy } from \"../utils/share.js\";\n\nexport function CollectionMoreMenu({ explorerHref, shareTitle, onReport }: { explorerHref: string; shareTitle: string; onReport: () => void }) {\n const [copied, setCopied] = useState(false);\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-label=\"More options\"\n className=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-input bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem asChild>\n <a href={explorerHref} target=\"_blank\" rel=\"noopener noreferrer\">\n <ExternalLink />\n View on explorer\n </a>\n </DropdownMenuItem>\n <DropdownMenuItem\n onSelect={(e) => {\n e.preventDefault();\n void shareOrCopy(shareTitle).then((result) => {\n if (result !== \"copied\") return;\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n });\n }}\n >\n {copied ? <Check className=\"text-emerald-500\" /> : <Share2 />}\n {copied ? \"Link copied\" : \"Share\"}\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={onReport}>\n <Flag />\n Report\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"mappings":";AAeQ,cAIE,YAJF;AAbR,SAAS,gBAAgB;AACzB,SAAS,OAAO,cAAc,MAAM,gBAAgB,cAAc;AAClE,SAAS,cAAc,qBAAqB,kBAAkB,2BAA2B;AACzF,SAAS,mBAAmB;AAErB,SAAS,mBAAmB,EAAE,cAAc,YAAY,SAAS,GAAuE;AAC7I,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,SACE,qBAAC,gBACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,WAAU;AAAA,QAEV,8BAAC,kBAAe,WAAU,WAAU;AAAA;AAAA,IACtC;AAAA,IACA,qBAAC,uBAAoB,OAAM,OACzB;AAAA,0BAAC,oBAAiB,SAAO,MACvB,+BAAC,OAAE,MAAM,cAAc,QAAO,UAAS,KAAI,uBACzC;AAAA,4BAAC,gBAAa;AAAA,QAAE;AAAA,SAElB,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,CAAC,MAAM;AACf,cAAE,eAAe;AACjB,iBAAK,YAAY,UAAU,EAAE,KAAK,CAAC,WAAW;AAC5C,kBAAI,WAAW,SAAU;AACzB,wBAAU,IAAI;AACd,yBAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,YACzC,CAAC;AAAA,UACH;AAAA,UAEC;AAAA,qBAAS,oBAAC,SAAM,WAAU,oBAAmB,IAAK,oBAAC,UAAO;AAAA,YAC1D,SAAS,gBAAgB;AAAA;AAAA;AAAA,MAC5B;AAAA,MACA,qBAAC,oBAAiB,UAAU,UAC1B;AAAA,4BAAC,QAAK;AAAA,QAAE;AAAA,SAEV;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var collection_name_claim_exports = {};
31
+ __export(collection_name_claim_exports, {
32
+ CollectionNameClaim: () => CollectionNameClaim
33
+ });
34
+ module.exports = __toCommonJS(collection_name_claim_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_link = __toESM(require("./link.js"), 1);
37
+ var import_image = __toESM(require("./image.js"), 1);
38
+ var import_medialane_app = require("./medialane-app.js");
39
+ var import_use_collections = require("../utils/use-collections.js");
40
+ var import_use_image_url = require("../utils/use-image-url.js");
41
+ var import_button = require("./button.js");
42
+ var import_empty_or_error = require("./empty-or-error.js");
43
+ var import_lucide_react = require("lucide-react");
44
+ function CollectionNameClaim() {
45
+ const { walletAddress } = (0, import_medialane_app.useMedialaneApp)();
46
+ const resolveImage = (0, import_use_image_url.useImageUrl)();
47
+ const { collections, isLoading, error, mutate } = (0, import_use_collections.useCollectionsByOwner)(walletAddress);
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-3", children: [
49
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
50
+ import_empty_or_error.EmptyOrError,
51
+ {
52
+ isLoading,
53
+ error,
54
+ isEmpty: collections.length === 0,
55
+ onRetry: mutate,
56
+ emptyTitle: "No collections to name yet",
57
+ emptyDescription: "Create a collection first \u2014 then give it a clean, memorable URL.",
58
+ emptyCta: { label: "Create a collection", href: "/launchpad/single-editions/collection" }
59
+ }
60
+ ),
61
+ collections.map((c) => {
62
+ const slug = c.profile?.slug;
63
+ const img = resolveImage(c.image, { width: 96 });
64
+ const settingsHref = `/portfolio/collections/${c.contractAddress}/settings`;
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
66
+ "div",
67
+ {
68
+ className: "flex items-center gap-4 rounded-2xl border border-border bg-card p-4",
69
+ children: [
70
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-12 w-12 rounded-xl overflow-hidden bg-muted shrink-0 flex items-center justify-center", children: img ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: img, alt: c.name ?? "Collection", width: 48, height: 48, className: "h-full w-full object-cover", unoptimized: true }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ImageIcon, { className: "h-5 w-5 text-muted-foreground" }) }),
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
72
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold truncate", children: c.name ?? "Untitled collection" }),
73
+ slug ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-emerald-600 dark:text-emerald-400 flex items-center gap-1 mt-0.5", children: [
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CheckCircle2, { className: "h-3 w-3 shrink-0" }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "tabular-nums truncate", children: [
76
+ "medialane.io/collection/",
77
+ slug
78
+ ] })
79
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground mt-0.5", children: "No custom name yet" })
80
+ ] }),
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: slug ? "outline" : "default", size: "sm", asChild: true, className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: settingsHref, children: [
82
+ slug ? "Edit name" : "Set name",
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-3.5 w-3.5 ml-1" })
84
+ ] }) })
85
+ ]
86
+ },
87
+ c.id
88
+ );
89
+ }),
90
+ collections.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "ghost", size: "sm", asChild: true, className: "text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: "/launchpad/single-editions/collection", children: [
91
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Plus, { className: "h-3.5 w-3.5 mr-1.5" }),
92
+ "Create another collection"
93
+ ] }) })
94
+ ] });
95
+ }
96
+ // Annotate the CommonJS export names for ESM import in node:
97
+ 0 && (module.exports = {
98
+ CollectionNameClaim
99
+ });
100
+ //# sourceMappingURL=collection-name-claim.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/collection-name-claim.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useCollectionsByOwner } from \"../utils/use-collections.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nimport { Button } from \"./button.js\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { CheckCircle2, ImageIcon, Plus, ArrowRight } from \"lucide-react\";\n\nexport function CollectionNameClaim() {\n const { walletAddress } = useMedialaneApp();\n const resolveImage = useImageUrl();\n const { collections, isLoading, error, mutate } = useCollectionsByOwner(walletAddress);\n\n return (\n <div className=\"space-y-3\">\n <EmptyOrError\n isLoading={isLoading}\n error={error}\n isEmpty={collections.length === 0}\n onRetry={mutate}\n emptyTitle=\"No collections to name yet\"\n emptyDescription=\"Create a collection first — then give it a clean, memorable URL.\"\n emptyCta={{ label: \"Create a collection\", href: \"/launchpad/single-editions/collection\" }}\n />\n\n {collections.map((c) => {\n const slug = c.profile?.slug;\n const img = resolveImage(c.image, { width: 96 });\n const settingsHref = `/portfolio/collections/${c.contractAddress}/settings`;\n return (\n <div\n key={c.id}\n className=\"flex items-center gap-4 rounded-2xl border border-border bg-card p-4\"\n >\n <div className=\"h-12 w-12 rounded-xl overflow-hidden bg-muted shrink-0 flex items-center justify-center\">\n {img ? (\n <Image src={img} alt={c.name ?? \"Collection\"} width={48} height={48} className=\"h-full w-full object-cover\" unoptimized />\n ) : (\n <ImageIcon className=\"h-5 w-5 text-muted-foreground\" />\n )}\n </div>\n\n <div className=\"min-w-0 flex-1\">\n <p className=\"font-semibold truncate\">{c.name ?? \"Untitled collection\"}</p>\n {slug ? (\n <p className=\"text-xs text-emerald-600 dark:text-emerald-400 flex items-center gap-1 mt-0.5\">\n <CheckCircle2 className=\"h-3 w-3 shrink-0\" />\n <span className=\"tabular-nums truncate\">medialane.io/collection/{slug}</span>\n </p>\n ) : (\n <p className=\"text-xs text-muted-foreground mt-0.5\">No custom name yet</p>\n )}\n </div>\n\n <Button variant={slug ? \"outline\" : \"default\"} size=\"sm\" asChild className=\"shrink-0\">\n <Link href={settingsHref}>\n {slug ? \"Edit name\" : \"Set name\"}\n <ArrowRight className=\"h-3.5 w-3.5 ml-1\" />\n </Link>\n </Button>\n </div>\n );\n })}\n\n {collections.length > 0 && (\n <Button variant=\"ghost\" size=\"sm\" asChild className=\"text-muted-foreground\">\n <Link href=\"/launchpad/single-editions/collection\">\n <Plus className=\"h-3.5 w-3.5 mr-1.5\" />\n Create another collection\n </Link>\n </Button>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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AAuC,gCAAkB;AAAA,eAE1E;AAAA,YAEA,4CAAC,wBAAO,SAAS,OAAO,YAAY,WAAW,MAAK,MAAK,SAAO,MAAC,WAAU,YACzE,uDAAC,YAAAC,SAAA,EAAK,MAAM,cACT;AAAA,qBAAO,cAAc;AAAA,cACtB,4CAAC,kCAAW,WAAU,oBAAmB;AAAA,eAC3C,GACF;AAAA;AAAA;AAAA,QA5BK,EAAE;AAAA,MA6BT;AAAA,IAEJ,CAAC;AAAA,IAEA,YAAY,SAAS,KACpB,4CAAC,wBAAO,SAAQ,SAAQ,MAAK,MAAK,SAAO,MAAC,WAAU,yBAClD,uDAAC,YAAAA,SAAA,EAAK,MAAK,yCACT;AAAA,kDAAC,4BAAK,WAAU,sBAAqB;AAAA,MAAE;AAAA,OAEzC,GACF;AAAA,KAEJ;AAEJ;","names":["Image","Link"]}
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function CollectionNameClaim(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { CollectionNameClaim };