@medialane/ui 0.345.0 → 0.346.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/asset-overview-content.cjs +81 -28
- package/dist/components/asset-overview-content.cjs.map +1 -1
- package/dist/components/asset-overview-content.js +82 -29
- package/dist/components/asset-overview-content.js.map +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.cts +4 -4
- package/dist/components/launchpad/edition-mint-schema.d.ts +4 -4
- package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as input_otp from 'input-otp';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (newValue: string) => unknown;
|
|
7
7
|
maxLength: number;
|
|
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
14
14
|
} & {
|
|
15
15
|
render: (props: input_otp.RenderProps) => React.ReactNode;
|
|
16
16
|
children?: never;
|
|
17
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as input_otp from 'input-otp';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (newValue: string) => unknown;
|
|
7
7
|
maxLength: number;
|
|
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
14
14
|
} & {
|
|
15
15
|
render: (props: input_otp.RenderProps) => React.ReactNode;
|
|
16
16
|
children?: never;
|
|
17
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -34,22 +34,48 @@ function licenseLabel(value) {
|
|
|
34
34
|
return label.split(" \u2014 ")[1] ?? label;
|
|
35
35
|
}
|
|
36
36
|
const isAddressLike = (v) => typeof v === "string" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
37
|
+
function fillSpans(units, cols) {
|
|
38
|
+
const out = units.map((unit) => Math.min(unit, cols));
|
|
39
|
+
const rest = out.reduce((sum, unit) => sum + unit, 0) % cols;
|
|
40
|
+
if (rest && out.length) out[out.length - 1] += cols - rest;
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
function bentoSpans(count) {
|
|
44
|
+
const out = [];
|
|
45
|
+
const rows = [[2, 1], [1, 2]];
|
|
46
|
+
for (let row = 0; out.length < count; row++) {
|
|
47
|
+
const left = count - out.length;
|
|
48
|
+
if (left === 1) out.push(3);
|
|
49
|
+
else out.push(...rows[row % 2]);
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
const SPAN_2 = { 1: "col-span-1", 2: "col-span-2" };
|
|
54
|
+
const SPAN_SM_4 = {
|
|
55
|
+
1: "sm:col-span-1",
|
|
56
|
+
2: "sm:col-span-2",
|
|
57
|
+
3: "sm:col-span-3",
|
|
58
|
+
4: "sm:col-span-4"
|
|
59
|
+
};
|
|
60
|
+
const SPAN_LG_3 = {
|
|
61
|
+
1: "lg:col-span-1",
|
|
62
|
+
2: "lg:col-span-2",
|
|
63
|
+
3: "lg:col-span-3"
|
|
64
|
+
};
|
|
65
|
+
const DETAIL_TINTS = [
|
|
66
|
+
"bg-brand-blue/10 [&_p]:text-brand-blue",
|
|
67
|
+
"bg-brand-rose/10 [&_p]:text-brand-rose",
|
|
68
|
+
"bg-brand-purple/10 [&_p]:text-brand-purple",
|
|
69
|
+
"bg-brand-orange/10 [&_p]:text-brand-orange"
|
|
70
|
+
];
|
|
71
|
+
function Cell({ label, value, className }) {
|
|
43
72
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
44
73
|
"div",
|
|
45
74
|
{
|
|
46
|
-
className: `flex flex-col justify-
|
|
75
|
+
className: `flex flex-col justify-end gap-1 rounded-3xl px-5 py-4 min-h-[5.5rem] ${className ?? ""}`,
|
|
47
76
|
children: [
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
50
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs font-medium text-muted-foreground truncate", title: label, children: label }),
|
|
51
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm font-bold text-foreground truncate", children: value })
|
|
52
|
-
] })
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-medium truncate", title: label, children: label }),
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-lg font-semibold leading-tight tracking-tight text-foreground break-words", children: value })
|
|
53
79
|
]
|
|
54
80
|
}
|
|
55
81
|
);
|
|
@@ -74,13 +100,18 @@ function AssetOverviewContent({
|
|
|
74
100
|
const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));
|
|
75
101
|
const licenseDescription = import_ip.LICENSE_TYPES.find((license) => license.value === licenseType)?.description;
|
|
76
102
|
const facts = [
|
|
77
|
-
{ icon:
|
|
78
|
-
{ icon:
|
|
79
|
-
{ icon:
|
|
80
|
-
{ icon:
|
|
81
|
-
{ icon:
|
|
82
|
-
{ icon:
|
|
103
|
+
{ icon: import_lucide_react.DollarSign, label: "Commercial use", value: commercialUse, tile: "bg-brand-orange text-white", pill: "bg-white/20" },
|
|
104
|
+
{ icon: import_lucide_react.GitBranch, label: "Derivatives", value: derivatives, tile: "bg-brand-rose text-white", pill: "bg-white/20" },
|
|
105
|
+
{ icon: import_lucide_react.UserCheck, label: "Attribution", value: attribution, tile: "bg-foreground text-background", pill: "bg-background/15" },
|
|
106
|
+
{ icon: import_lucide_react.Globe, label: "Territory", value: territory, tile: "bg-brand-blue text-white", pill: "bg-white/20" },
|
|
107
|
+
{ icon: import_lucide_react.Bot, label: "AI & data mining", value: aiPolicy, tile: "bg-brand-purple text-white", pill: "bg-white/20" },
|
|
108
|
+
{ icon: import_lucide_react.Percent, label: "Royalty", value: royalty, tile: "bg-brand-orange text-white", pill: "bg-white/20" }
|
|
83
109
|
].filter((row) => !!row.value);
|
|
110
|
+
const factSpans2 = fillSpans(facts.map(() => 1), 2);
|
|
111
|
+
const factSpansLg = bentoSpans(facts.length);
|
|
112
|
+
const detailUnits = displayAttributes.map((attribute) => isAddressLike(attribute.value) ? 2 : 1);
|
|
113
|
+
const detailSpans2 = fillSpans(detailUnits, 2);
|
|
114
|
+
const detailSpansSm = fillSpans(detailUnits, 4);
|
|
84
115
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-4 space-y-7", children: [
|
|
85
116
|
content ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
86
117
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Content" }),
|
|
@@ -93,24 +124,46 @@ function AssetOverviewContent({
|
|
|
93
124
|
hasTemplateData ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ip_type_display.IPTypeDisplay, { attributes }) : null,
|
|
94
125
|
hasLicenseData ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
95
126
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Rights" }),
|
|
96
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2
|
|
97
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "col-span-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 lg:grid-cols-6 gap-3", children: [
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end overflow-hidden rounded-[2rem] bg-gradient-to-br from-brand-purple via-brand-blue to-brand-blue p-6 text-white sm:p-8", children: [
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": true, className: "pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full ring-[28px] ring-white/10" }),
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": true, className: "pointer-events-none absolute right-10 top-12 h-20 w-20 rounded-full bg-brand-rose/70" }),
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative space-y-3", children: [
|
|
132
|
+
licenseType ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05]", children: licenseLabel(licenseType) }) : null,
|
|
133
|
+
licenseDescription ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "max-w-md text-sm text-white/80", children: licenseDescription }) : null,
|
|
134
|
+
summary ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "inline-block rounded-full bg-white/20 px-4 py-2 text-sm font-medium leading-snug backdrop-blur-sm", children: summary }) : null
|
|
135
|
+
] })
|
|
101
136
|
] }),
|
|
102
|
-
facts.map(({ icon, label, value }) => /* @__PURE__ */ (0, import_jsx_runtime.
|
|
103
|
-
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("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)]", children: facts.map(({ icon: Icon, label, value, tile, pill }, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
138
|
+
"div",
|
|
139
|
+
{
|
|
140
|
+
className: `relative flex flex-col justify-between gap-4 overflow-hidden rounded-[1.75rem] p-5 ${tile} ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`,
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { "aria-hidden": true, className: "pointer-events-none absolute -bottom-5 -right-4 h-28 w-28 opacity-15" }),
|
|
143
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `relative inline-flex w-fit items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium ${pill}`, children: [
|
|
144
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-3.5 w-3.5" }),
|
|
145
|
+
label
|
|
146
|
+
] }),
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "relative text-2xl sm:text-3xl font-semibold leading-none tracking-tight break-words", children: value })
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
label
|
|
151
|
+
)) }),
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-brand-rose/10 p-5 sm:p-6", children: [
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Scale, { "aria-hidden": true, className: "pointer-events-none absolute -right-4 -bottom-8 h-32 w-32 -rotate-12 text-brand-rose/15" }),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-brand-rose text-white", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Scale, { className: "h-5 w-5" }) }),
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "relative max-w-3xl text-sm leading-relaxed text-foreground/80", children: "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." })
|
|
156
|
+
] })
|
|
104
157
|
] })
|
|
105
158
|
] }) : null,
|
|
106
159
|
displayAttributes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
107
160
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Details" }),
|
|
108
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]", children: displayAttributes.map((attribute, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
109
162
|
Cell,
|
|
110
163
|
{
|
|
111
164
|
label: attribute.trait_type ?? "Trait",
|
|
112
|
-
|
|
113
|
-
value: isAddressLike(attribute.value) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: attribute.value, chars: 4, className: "text-
|
|
165
|
+
className: `${DETAIL_TINTS[index % DETAIL_TINTS.length]} ${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`,
|
|
166
|
+
value: isAddressLike(attribute.value) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: attribute.value, chars: 4, className: "text-base font-semibold" }) : attribute.value ?? "\u2014"
|
|
114
167
|
},
|
|
115
168
|
index
|
|
116
169
|
)) })
|
|
@@ -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, 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\";\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 Cell({\n icon,\n label,\n value,\n wide,\n}: {\n icon?: ReactNode;\n label: string;\n value: ReactNode;\n wide?: boolean;\n}) {\n return (\n <div\n className={`flex flex-col justify-between gap-2 rounded-xl bg-muted/25 ring-1 ring-border/40 p-3.5 ${\n wide ? \"col-span-2\" : \"\"\n }`}\n >\n {icon ? <span className=\"text-primary/70\">{icon}</span> : null}\n <div className=\"space-y-0.5\">\n <p className=\"text-2xs font-medium text-muted-foreground truncate\" title={label}>\n {label}\n </p>\n <div className=\"text-sm font-bold text-foreground truncate\">{value}</div>\n </div>\n </div>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\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 facts = [\n { icon: <DollarSign className=\"h-4 w-4\" />, label: \"Commercial use\", value: commercialUse },\n { icon: <GitBranch className=\"h-4 w-4\" />, label: \"Derivatives\", value: derivatives },\n { icon: <UserCheck className=\"h-4 w-4\" />, label: \"Attribution\", value: attribution },\n { icon: <Globe className=\"h-4 w-4\" />, label: \"Territory\", value: territory },\n { icon: <Bot className=\"h-4 w-4\" />, label: \"AI & data mining\", value: aiPolicy },\n { icon: <Percent className=\"h-4 w-4\" />, label: \"Royalty\", value: royalty },\n ].filter((row) => !!row.value);\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\">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 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\">Rights</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3\">\n <div className=\"col-span-full flex flex-col gap-2 rounded-2xl bg-gradient-to-br from-primary/10 via-primary/5 to-accent/10 ring-1 ring-primary/15 p-5\">\n {licenseType ? (\n <p className=\"text-xl sm:text-2xl font-bold leading-tight text-foreground\">{licenseLabel(licenseType)}</p>\n ) : null}\n {licenseDescription ? (\n <p className=\"text-sm text-muted-foreground\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"text-base sm:text-lg font-semibold leading-snug text-foreground\">{summary}</p>\n ) : null}\n </div>\n\n {facts.map(({ icon, label, value }) => (\n <Cell key={label} icon={icon} label={label} value={value} />\n ))}\n\n <div className=\"col-span-full rounded-xl bg-muted/25 ring-1 ring-border/40 p-3.5\">\n <p className=\"text-xs leading-relaxed text-muted-foreground\">\n 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 </div>\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\">Details</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense] auto-rows-[minmax(6rem,auto)]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? \"Trait\"}\n wide={isAddressLike(attribute.value)}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-sm font-bold\" />\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\">No additional details available.</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgDc;AA7Cd,0BAAoF;AACpF,6BAA8B;AAC9B,6BAA+B;AAC/B,2BAA6B;AAC7B,6BAA+B;AAC/B,gBAA8B;AAe9B,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,KAAK;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,0FACT,OAAO,eAAe,EACxB;AAAA,MAEC;AAAA,eAAO,4CAAC,UAAK,WAAU,mBAAmB,gBAAK,IAAU;AAAA,QAC1D,6CAAC,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AEC,OAAO,UAAU,cAAc;AAAA,UAC/B,MAAM,cAAc,UAAU,KAAK;AAAA,UACnC,OACE,cAAc,UAAU,KAAK,IAC3B,4CAAC,yCAAe,SAAS,UAAU,OAAQ,OAAO,GAAG,WAAU,qBAAoB,IAEnF,UAAU,SAAS;AAAA;AAAA,QAPlB;AAAA,MAUP,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,4CAAC,OAAE,WAAU,iCAAgC,8CAAgC,IAC3E;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\";\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\nconst DETAIL_TINTS = [\n \"bg-brand-blue/10 [&_p]:text-brand-blue\",\n \"bg-brand-rose/10 [&_p]:text-brand-rose\",\n \"bg-brand-purple/10 [&_p]:text-brand-purple\",\n \"bg-brand-orange/10 [&_p]:text-brand-orange\",\n];\n\nfunction Cell({ label, value, className }: { label: string; value: ReactNode; className?: string }) {\n return (\n <div\n className={`flex flex-col justify-end gap-1 rounded-3xl px-5 py-4 min-h-[5.5rem] ${className ?? \"\"}`}\n >\n <p className=\"text-xs font-medium truncate\" title={label}>\n {label}\n </p>\n <div className=\"text-lg font-semibold leading-tight tracking-tight text-foreground break-words\">{value}</div>\n </div>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\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 facts = [\n { icon: DollarSign, label: \"Commercial use\", value: commercialUse, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n { icon: GitBranch, label: \"Derivatives\", value: derivatives, tile: \"bg-brand-rose text-white\", pill: \"bg-white/20\" },\n { icon: UserCheck, label: \"Attribution\", value: attribution, tile: \"bg-foreground text-background\", pill: \"bg-background/15\" },\n { icon: Globe, label: \"Territory\", value: territory, tile: \"bg-brand-blue text-white\", pill: \"bg-white/20\" },\n { icon: Bot, label: \"AI & data mining\", value: aiPolicy, tile: \"bg-brand-purple text-white\", pill: \"bg-white/20\" },\n { icon: Percent, label: \"Royalty\", value: royalty, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n ].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 = fillSpans(detailUnits, 4);\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\">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 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\">Rights</h3>\n <div className=\"grid grid-cols-2 lg:grid-cols-6 gap-3\">\n <div className=\"relative col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end overflow-hidden rounded-[2rem] bg-gradient-to-br from-brand-purple via-brand-blue to-brand-blue p-6 text-white sm:p-8\">\n <span aria-hidden className=\"pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full ring-[28px] ring-white/10\" />\n <span aria-hidden className=\"pointer-events-none absolute right-10 top-12 h-20 w-20 rounded-full bg-brand-rose/70\" />\n <div className=\"relative space-y-3\">\n {licenseType ? (\n <p className=\"text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05]\">\n {licenseLabel(licenseType)}\n </p>\n ) : null}\n {licenseDescription ? (\n <p className=\"max-w-md text-sm text-white/80\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"inline-block rounded-full bg-white/20 px-4 py-2 text-sm font-medium leading-snug backdrop-blur-sm\">\n {summary}\n </p>\n ) : null}\n </div>\n </div>\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, tile, pill }, index) => (\n <div\n key={label}\n className={`relative flex flex-col justify-between gap-4 overflow-hidden rounded-[1.75rem] p-5 ${tile} ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`}\n >\n <Icon aria-hidden className=\"pointer-events-none absolute -bottom-5 -right-4 h-28 w-28 opacity-15\" />\n <span className={`relative inline-flex w-fit items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium ${pill}`}>\n <Icon className=\"h-3.5 w-3.5\" />\n {label}\n </span>\n <p className=\"relative text-2xl sm:text-3xl font-semibold leading-none tracking-tight break-words\">{value}</p>\n </div>\n ))}\n </div>\n\n <div className=\"relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-brand-rose/10 p-5 sm:p-6\">\n <Scale aria-hidden className=\"pointer-events-none absolute -right-4 -bottom-8 h-32 w-32 -rotate-12 text-brand-rose/15\" />\n <span className=\"relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-brand-rose text-white\">\n <Scale className=\"h-5 w-5\" />\n </span>\n <p className=\"relative max-w-3xl text-sm leading-relaxed text-foreground/80\">\n 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 </div>\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\">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 ?? \"Trait\"}\n className={`${DETAIL_TINTS[index % DETAIL_TINTS.length]} ${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\">No additional details available.</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuEI;AApEJ,0BAA2F;AAC3F,6BAA8B;AAC9B,6BAA+B;AAC/B,2BAA6B;AAC7B,6BAA+B;AAC/B,gBAA8B;AAe9B,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,IA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AA,UARrG;AAAA,QASP,CACD,GACH;AAAA,QAEA,6CAAC,SAAI,WAAU,wHACb;AAAA,sDAAC,6BAAM,eAAW,MAAC,WAAU,2FAA0F;AAAA,UACvH,4CAAC,UAAK,WAAU,sGACd,sDAAC,6BAAM,WAAU,WAAU,GAC7B;AAAA,UACA,4CAAC,OAAE,WAAU,iEAAgE,0OAE7E;AAAA,WACF;AAAA,SACF;AAAA,OACF,IACE;AAAA,IAEH,kBAAkB,SAAS,IAC1B,6CAAC,aAAQ,WAAU,aACjB;AAAA,kDAAC,QAAG,WAAU,+CAA8C,qBAAO;AAAA,MACnE,4CAAC,SAAI,WAAU,gEACZ,4BAAkB,IAAI,CAAC,WAAW,UACjC;AAAA,QAAC;AAAA;AAAA,UAEC,OAAO,UAAU,cAAc;AAAA,UAC/B,WAAW,GAAG,aAAa,QAAQ,aAAa,MAAM,CAAC,IAAI,OAAO,aAAa,KAAK,CAAC,CAAC,IAAI,UAAU,cAAc,KAAK,CAAC,CAAC;AAAA,UACzH,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,iCAAgC,8CAAgC,IAC3E;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Bot, DollarSign, ExternalLink, GitBranch, Globe, Percent, UserCheck } from "lucide-react";
|
|
3
|
+
import { Bot, DollarSign, ExternalLink, GitBranch, Globe, Percent, Scale, UserCheck } from "lucide-react";
|
|
4
4
|
import { IPTypeDisplay } from "./ip-type-display.js";
|
|
5
5
|
import { AddressDisplay } from "./address-display.js";
|
|
6
6
|
import { MarkdownText } from "./markdown-text.js";
|
|
@@ -11,22 +11,48 @@ function licenseLabel(value) {
|
|
|
11
11
|
return label.split(" \u2014 ")[1] ?? label;
|
|
12
12
|
}
|
|
13
13
|
const isAddressLike = (v) => typeof v === "string" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
14
|
+
function fillSpans(units, cols) {
|
|
15
|
+
const out = units.map((unit) => Math.min(unit, cols));
|
|
16
|
+
const rest = out.reduce((sum, unit) => sum + unit, 0) % cols;
|
|
17
|
+
if (rest && out.length) out[out.length - 1] += cols - rest;
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
20
|
+
function bentoSpans(count) {
|
|
21
|
+
const out = [];
|
|
22
|
+
const rows = [[2, 1], [1, 2]];
|
|
23
|
+
for (let row = 0; out.length < count; row++) {
|
|
24
|
+
const left = count - out.length;
|
|
25
|
+
if (left === 1) out.push(3);
|
|
26
|
+
else out.push(...rows[row % 2]);
|
|
27
|
+
}
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
30
|
+
const SPAN_2 = { 1: "col-span-1", 2: "col-span-2" };
|
|
31
|
+
const SPAN_SM_4 = {
|
|
32
|
+
1: "sm:col-span-1",
|
|
33
|
+
2: "sm:col-span-2",
|
|
34
|
+
3: "sm:col-span-3",
|
|
35
|
+
4: "sm:col-span-4"
|
|
36
|
+
};
|
|
37
|
+
const SPAN_LG_3 = {
|
|
38
|
+
1: "lg:col-span-1",
|
|
39
|
+
2: "lg:col-span-2",
|
|
40
|
+
3: "lg:col-span-3"
|
|
41
|
+
};
|
|
42
|
+
const DETAIL_TINTS = [
|
|
43
|
+
"bg-brand-blue/10 [&_p]:text-brand-blue",
|
|
44
|
+
"bg-brand-rose/10 [&_p]:text-brand-rose",
|
|
45
|
+
"bg-brand-purple/10 [&_p]:text-brand-purple",
|
|
46
|
+
"bg-brand-orange/10 [&_p]:text-brand-orange"
|
|
47
|
+
];
|
|
48
|
+
function Cell({ label, value, className }) {
|
|
20
49
|
return /* @__PURE__ */ jsxs(
|
|
21
50
|
"div",
|
|
22
51
|
{
|
|
23
|
-
className: `flex flex-col justify-
|
|
52
|
+
className: `flex flex-col justify-end gap-1 rounded-3xl px-5 py-4 min-h-[5.5rem] ${className ?? ""}`,
|
|
24
53
|
children: [
|
|
25
|
-
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */ jsx("p", { className: "text-2xs font-medium text-muted-foreground truncate", title: label, children: label }),
|
|
28
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm font-bold text-foreground truncate", children: value })
|
|
29
|
-
] })
|
|
54
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium truncate", title: label, children: label }),
|
|
55
|
+
/* @__PURE__ */ jsx("div", { className: "text-lg font-semibold leading-tight tracking-tight text-foreground break-words", children: value })
|
|
30
56
|
]
|
|
31
57
|
}
|
|
32
58
|
);
|
|
@@ -51,13 +77,18 @@ function AssetOverviewContent({
|
|
|
51
77
|
const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));
|
|
52
78
|
const licenseDescription = LICENSE_TYPES.find((license) => license.value === licenseType)?.description;
|
|
53
79
|
const facts = [
|
|
54
|
-
{ icon:
|
|
55
|
-
{ icon:
|
|
56
|
-
{ icon:
|
|
57
|
-
{ icon:
|
|
58
|
-
{ icon:
|
|
59
|
-
{ icon:
|
|
80
|
+
{ icon: DollarSign, label: "Commercial use", value: commercialUse, tile: "bg-brand-orange text-white", pill: "bg-white/20" },
|
|
81
|
+
{ icon: GitBranch, label: "Derivatives", value: derivatives, tile: "bg-brand-rose text-white", pill: "bg-white/20" },
|
|
82
|
+
{ icon: UserCheck, label: "Attribution", value: attribution, tile: "bg-foreground text-background", pill: "bg-background/15" },
|
|
83
|
+
{ icon: Globe, label: "Territory", value: territory, tile: "bg-brand-blue text-white", pill: "bg-white/20" },
|
|
84
|
+
{ icon: Bot, label: "AI & data mining", value: aiPolicy, tile: "bg-brand-purple text-white", pill: "bg-white/20" },
|
|
85
|
+
{ icon: Percent, label: "Royalty", value: royalty, tile: "bg-brand-orange text-white", pill: "bg-white/20" }
|
|
60
86
|
].filter((row) => !!row.value);
|
|
87
|
+
const factSpans2 = fillSpans(facts.map(() => 1), 2);
|
|
88
|
+
const factSpansLg = bentoSpans(facts.length);
|
|
89
|
+
const detailUnits = displayAttributes.map((attribute) => isAddressLike(attribute.value) ? 2 : 1);
|
|
90
|
+
const detailSpans2 = fillSpans(detailUnits, 2);
|
|
91
|
+
const detailSpansSm = fillSpans(detailUnits, 4);
|
|
61
92
|
return /* @__PURE__ */ jsxs("div", { className: "mt-4 space-y-7", children: [
|
|
62
93
|
content ? /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
63
94
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Content" }),
|
|
@@ -70,24 +101,46 @@ function AssetOverviewContent({
|
|
|
70
101
|
hasTemplateData ? /* @__PURE__ */ jsx(IPTypeDisplay, { attributes }) : null,
|
|
71
102
|
hasLicenseData ? /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
72
103
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Rights" }),
|
|
73
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2
|
|
74
|
-
/* @__PURE__ */ jsxs("div", { className: "col-span-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
104
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 lg:grid-cols-6 gap-3", children: [
|
|
105
|
+
/* @__PURE__ */ jsxs("div", { className: "relative col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end overflow-hidden rounded-[2rem] bg-gradient-to-br from-brand-purple via-brand-blue to-brand-blue p-6 text-white sm:p-8", children: [
|
|
106
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full ring-[28px] ring-white/10" }),
|
|
107
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute right-10 top-12 h-20 w-20 rounded-full bg-brand-rose/70" }),
|
|
108
|
+
/* @__PURE__ */ jsxs("div", { className: "relative space-y-3", children: [
|
|
109
|
+
licenseType ? /* @__PURE__ */ jsx("p", { className: "text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05]", children: licenseLabel(licenseType) }) : null,
|
|
110
|
+
licenseDescription ? /* @__PURE__ */ jsx("p", { className: "max-w-md text-sm text-white/80", children: licenseDescription }) : null,
|
|
111
|
+
summary ? /* @__PURE__ */ jsx("p", { className: "inline-block rounded-full bg-white/20 px-4 py-2 text-sm font-medium leading-snug backdrop-blur-sm", children: summary }) : null
|
|
112
|
+
] })
|
|
78
113
|
] }),
|
|
79
|
-
facts.map(({ icon, label, value }) => /* @__PURE__ */
|
|
80
|
-
|
|
114
|
+
/* @__PURE__ */ jsx("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)]", children: facts.map(({ icon: Icon, label, value, tile, pill }, index) => /* @__PURE__ */ jsxs(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
className: `relative flex flex-col justify-between gap-4 overflow-hidden rounded-[1.75rem] p-5 ${tile} ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`,
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ jsx(Icon, { "aria-hidden": true, className: "pointer-events-none absolute -bottom-5 -right-4 h-28 w-28 opacity-15" }),
|
|
120
|
+
/* @__PURE__ */ jsxs("span", { className: `relative inline-flex w-fit items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium ${pill}`, children: [
|
|
121
|
+
/* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5" }),
|
|
122
|
+
label
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsx("p", { className: "relative text-2xl sm:text-3xl font-semibold leading-none tracking-tight break-words", children: value })
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
label
|
|
128
|
+
)) }),
|
|
129
|
+
/* @__PURE__ */ jsxs("div", { className: "relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-brand-rose/10 p-5 sm:p-6", children: [
|
|
130
|
+
/* @__PURE__ */ jsx(Scale, { "aria-hidden": true, className: "pointer-events-none absolute -right-4 -bottom-8 h-32 w-32 -rotate-12 text-brand-rose/15" }),
|
|
131
|
+
/* @__PURE__ */ jsx("span", { className: "relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-brand-rose text-white", children: /* @__PURE__ */ jsx(Scale, { className: "h-5 w-5" }) }),
|
|
132
|
+
/* @__PURE__ */ jsx("p", { className: "relative max-w-3xl text-sm leading-relaxed text-foreground/80", children: "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." })
|
|
133
|
+
] })
|
|
81
134
|
] })
|
|
82
135
|
] }) : null,
|
|
83
136
|
displayAttributes.length > 0 ? /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
84
137
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Details" }),
|
|
85
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]
|
|
138
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]", children: displayAttributes.map((attribute, index) => /* @__PURE__ */ jsx(
|
|
86
139
|
Cell,
|
|
87
140
|
{
|
|
88
141
|
label: attribute.trait_type ?? "Trait",
|
|
89
|
-
|
|
90
|
-
value: isAddressLike(attribute.value) ? /* @__PURE__ */ jsx(AddressDisplay, { address: attribute.value, chars: 4, className: "text-
|
|
142
|
+
className: `${DETAIL_TINTS[index % DETAIL_TINTS.length]} ${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`,
|
|
143
|
+
value: isAddressLike(attribute.value) ? /* @__PURE__ */ jsx(AddressDisplay, { address: attribute.value, chars: 4, className: "text-base font-semibold" }) : attribute.value ?? "\u2014"
|
|
91
144
|
},
|
|
92
145
|
index
|
|
93
146
|
)) })
|
|
@@ -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, 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\";\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 Cell({\n icon,\n label,\n value,\n wide,\n}: {\n icon?: ReactNode;\n label: string;\n value: ReactNode;\n wide?: boolean;\n}) {\n return (\n <div\n className={`flex flex-col justify-between gap-2 rounded-xl bg-muted/25 ring-1 ring-border/40 p-3.5 ${\n wide ? \"col-span-2\" : \"\"\n }`}\n >\n {icon ? <span className=\"text-primary/70\">{icon}</span> : null}\n <div className=\"space-y-0.5\">\n <p className=\"text-2xs font-medium text-muted-foreground truncate\" title={label}>\n {label}\n </p>\n <div className=\"text-sm font-bold text-foreground truncate\">{value}</div>\n </div>\n </div>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\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 facts = [\n { icon: <DollarSign className=\"h-4 w-4\" />, label: \"Commercial use\", value: commercialUse },\n { icon: <GitBranch className=\"h-4 w-4\" />, label: \"Derivatives\", value: derivatives },\n { icon: <UserCheck className=\"h-4 w-4\" />, label: \"Attribution\", value: attribution },\n { icon: <Globe className=\"h-4 w-4\" />, label: \"Territory\", value: territory },\n { icon: <Bot className=\"h-4 w-4\" />, label: \"AI & data mining\", value: aiPolicy },\n { icon: <Percent className=\"h-4 w-4\" />, label: \"Royalty\", value: royalty },\n ].filter((row) => !!row.value);\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\">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 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\">Rights</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3\">\n <div className=\"col-span-full flex flex-col gap-2 rounded-2xl bg-gradient-to-br from-primary/10 via-primary/5 to-accent/10 ring-1 ring-primary/15 p-5\">\n {licenseType ? (\n <p className=\"text-xl sm:text-2xl font-bold leading-tight text-foreground\">{licenseLabel(licenseType)}</p>\n ) : null}\n {licenseDescription ? (\n <p className=\"text-sm text-muted-foreground\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"text-base sm:text-lg font-semibold leading-snug text-foreground\">{summary}</p>\n ) : null}\n </div>\n\n {facts.map(({ icon, label, value }) => (\n <Cell key={label} icon={icon} label={label} value={value} />\n ))}\n\n <div className=\"col-span-full rounded-xl bg-muted/25 ring-1 ring-border/40 p-3.5\">\n <p className=\"text-xs leading-relaxed text-muted-foreground\">\n 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 </div>\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\">Details</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense] auto-rows-[minmax(6rem,auto)]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? \"Trait\"}\n wide={isAddressLike(attribute.value)}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-sm font-bold\" />\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\">No additional details available.</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AAgDc,cACR,YADQ;AA7Cd,SAAS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yIACZ;AAAA,wBACC,oBAAC,OAAE,WAAU,+DAA+D,uBAAa,WAAW,GAAE,IACpG;AAAA,UACH,qBACC,oBAAC,OAAE,WAAU,iCAAiC,8BAAmB,IAC/D;AAAA,UACH,UACC,oBAAC,OAAE,WAAU,mEAAmE,mBAAQ,IACtF;AAAA,WACN;AAAA,QAEC,MAAM,IAAI,CAAC,EAAE,MAAM,OAAO,MAAM,MAC/B,oBAAC,QAAiB,MAAY,OAAc,SAAjC,KAA+C,CAC3D;AAAA,QAED,oBAAC,SAAI,WAAU,oEACb,8BAAC,OAAE,WAAU,iDAAgD,0OAE7D,GACF;AAAA,SACF;AAAA,OACF,IACE;AAAA,IAEH,kBAAkB,SAAS,IAC1B,qBAAC,aAAQ,WAAU,aACjB;AAAA,0BAAC,QAAG,WAAU,+CAA8C,qBAAO;AAAA,MACnE,oBAAC,SAAI,WAAU,8FACZ,4BAAkB,IAAI,CAAC,WAAW,UACjC;AAAA,QAAC;AAAA;AAAA,UAEC,OAAO,UAAU,cAAc;AAAA,UAC/B,MAAM,cAAc,UAAU,KAAK;AAAA,UACnC,OACE,cAAc,UAAU,KAAK,IAC3B,oBAAC,kBAAe,SAAS,UAAU,OAAQ,OAAO,GAAG,WAAU,qBAAoB,IAEnF,UAAU,SAAS;AAAA;AAAA,QAPlB;AAAA,MAUP,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,oBAAC,OAAE,WAAU,iCAAgC,8CAAgC,IAC3E;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\";\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\nconst DETAIL_TINTS = [\n \"bg-brand-blue/10 [&_p]:text-brand-blue\",\n \"bg-brand-rose/10 [&_p]:text-brand-rose\",\n \"bg-brand-purple/10 [&_p]:text-brand-purple\",\n \"bg-brand-orange/10 [&_p]:text-brand-orange\",\n];\n\nfunction Cell({ label, value, className }: { label: string; value: ReactNode; className?: string }) {\n return (\n <div\n className={`flex flex-col justify-end gap-1 rounded-3xl px-5 py-4 min-h-[5.5rem] ${className ?? \"\"}`}\n >\n <p className=\"text-xs font-medium truncate\" title={label}>\n {label}\n </p>\n <div className=\"text-lg font-semibold leading-tight tracking-tight text-foreground break-words\">{value}</div>\n </div>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\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 facts = [\n { icon: DollarSign, label: \"Commercial use\", value: commercialUse, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n { icon: GitBranch, label: \"Derivatives\", value: derivatives, tile: \"bg-brand-rose text-white\", pill: \"bg-white/20\" },\n { icon: UserCheck, label: \"Attribution\", value: attribution, tile: \"bg-foreground text-background\", pill: \"bg-background/15\" },\n { icon: Globe, label: \"Territory\", value: territory, tile: \"bg-brand-blue text-white\", pill: \"bg-white/20\" },\n { icon: Bot, label: \"AI & data mining\", value: aiPolicy, tile: \"bg-brand-purple text-white\", pill: \"bg-white/20\" },\n { icon: Percent, label: \"Royalty\", value: royalty, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n ].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 = fillSpans(detailUnits, 4);\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\">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 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\">Rights</h3>\n <div className=\"grid grid-cols-2 lg:grid-cols-6 gap-3\">\n <div className=\"relative col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end overflow-hidden rounded-[2rem] bg-gradient-to-br from-brand-purple via-brand-blue to-brand-blue p-6 text-white sm:p-8\">\n <span aria-hidden className=\"pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full ring-[28px] ring-white/10\" />\n <span aria-hidden className=\"pointer-events-none absolute right-10 top-12 h-20 w-20 rounded-full bg-brand-rose/70\" />\n <div className=\"relative space-y-3\">\n {licenseType ? (\n <p className=\"text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05]\">\n {licenseLabel(licenseType)}\n </p>\n ) : null}\n {licenseDescription ? (\n <p className=\"max-w-md text-sm text-white/80\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"inline-block rounded-full bg-white/20 px-4 py-2 text-sm font-medium leading-snug backdrop-blur-sm\">\n {summary}\n </p>\n ) : null}\n </div>\n </div>\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, tile, pill }, index) => (\n <div\n key={label}\n className={`relative flex flex-col justify-between gap-4 overflow-hidden rounded-[1.75rem] p-5 ${tile} ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`}\n >\n <Icon aria-hidden className=\"pointer-events-none absolute -bottom-5 -right-4 h-28 w-28 opacity-15\" />\n <span className={`relative inline-flex w-fit items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium ${pill}`}>\n <Icon className=\"h-3.5 w-3.5\" />\n {label}\n </span>\n <p className=\"relative text-2xl sm:text-3xl font-semibold leading-none tracking-tight break-words\">{value}</p>\n </div>\n ))}\n </div>\n\n <div className=\"relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-brand-rose/10 p-5 sm:p-6\">\n <Scale aria-hidden className=\"pointer-events-none absolute -right-4 -bottom-8 h-32 w-32 -rotate-12 text-brand-rose/15\" />\n <span className=\"relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-brand-rose text-white\">\n <Scale className=\"h-5 w-5\" />\n </span>\n <p className=\"relative max-w-3xl text-sm leading-relaxed text-foreground/80\">\n 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 </div>\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\">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 ?? \"Trait\"}\n className={`${DETAIL_TINTS[index % DETAIL_TINTS.length]} ${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\">No additional details available.</p>\n ) : null}\n </div>\n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AAc,KAAK,CAAC,CAAC;AAAA,UACzH,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,iCAAgC,8CAAgC,IAC3E;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -3,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
7
|
-
size?: "
|
|
6
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
|
+
size?: "icon" | "default" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -3,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
7
|
-
size?: "
|
|
6
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
|
+
size?: "icon" | "default" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -19,13 +19,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
19
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
20
20
|
licenseType: string;
|
|
21
21
|
commercialUse: "Yes" | "No";
|
|
22
|
+
value: string;
|
|
23
|
+
recipient: string;
|
|
22
24
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
23
25
|
attribution: "Required" | "Not Required";
|
|
24
26
|
geographicScope: string;
|
|
25
27
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
26
28
|
royalty: number;
|
|
27
|
-
value: string;
|
|
28
|
-
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
@@ -33,13 +33,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
33
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
34
34
|
licenseType: string;
|
|
35
35
|
commercialUse: "Yes" | "No";
|
|
36
|
+
value: string;
|
|
37
|
+
recipient: string;
|
|
36
38
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
37
39
|
attribution: "Required" | "Not Required";
|
|
38
40
|
geographicScope: string;
|
|
39
41
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
40
42
|
royalty: number;
|
|
41
|
-
value: string;
|
|
42
|
-
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
45
45
|
}>;
|
|
@@ -19,13 +19,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
19
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
20
20
|
licenseType: string;
|
|
21
21
|
commercialUse: "Yes" | "No";
|
|
22
|
+
value: string;
|
|
23
|
+
recipient: string;
|
|
22
24
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
23
25
|
attribution: "Required" | "Not Required";
|
|
24
26
|
geographicScope: string;
|
|
25
27
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
26
28
|
royalty: number;
|
|
27
|
-
value: string;
|
|
28
|
-
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
@@ -33,13 +33,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
33
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
34
34
|
licenseType: string;
|
|
35
35
|
commercialUse: "Yes" | "No";
|
|
36
|
+
value: string;
|
|
37
|
+
recipient: string;
|
|
36
38
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
37
39
|
attribution: "Required" | "Not Required";
|
|
38
40
|
geographicScope: string;
|
|
39
41
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
40
42
|
royalty: number;
|
|
41
|
-
value: string;
|
|
42
|
-
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
45
45
|
}>;
|
|
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
|
|
|
7
7
|
rawBalance: bigint | null;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
error: any;
|
|
10
|
-
decimals:
|
|
10
|
+
decimals: 6 | 8 | 18;
|
|
11
11
|
};
|
|
12
12
|
declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
|
|
|
7
7
|
rawBalance: bigint | null;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
error: any;
|
|
10
|
-
decimals:
|
|
10
|
+
decimals: 6 | 8 | 18;
|
|
11
11
|
};
|
|
12
12
|
declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
|
|
13
13
|
|