@medialane/ui 0.260.0 → 0.261.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/action-button.cjs +7 -2
- package/dist/components/action-button.cjs.map +1 -1
- package/dist/components/action-button.d.cts +2 -1
- package/dist/components/action-button.d.ts +2 -1
- package/dist/components/action-button.js +7 -2
- package/dist/components/action-button.js.map +1 -1
- package/dist/components/asset-access-cards.cjs +21 -33
- package/dist/components/asset-access-cards.cjs.map +1 -1
- package/dist/components/asset-access-cards.d.cts +3 -3
- package/dist/components/asset-access-cards.d.ts +3 -3
- package/dist/components/asset-access-cards.js +20 -32
- package/dist/components/asset-access-cards.js.map +1 -1
- package/dist/components/asset-marketplace-panel.cjs +44 -41
- package/dist/components/asset-marketplace-panel.cjs.map +1 -1
- package/dist/components/asset-marketplace-panel.js +45 -42
- package/dist/components/asset-marketplace-panel.js.map +1 -1
- package/dist/components/asset-overview-content.cjs +12 -1
- package/dist/components/asset-overview-content.cjs.map +1 -1
- package/dist/components/asset-overview-content.d.cts +3 -1
- package/dist/components/asset-overview-content.d.ts +3 -1
- package/dist/components/asset-overview-content.js +13 -2
- package/dist/components/asset-overview-content.js.map +1 -1
- package/dist/components/asset-page.cjs +8 -6
- package/dist/components/asset-page.cjs.map +1 -1
- package/dist/components/asset-page.js +8 -6
- package/dist/components/asset-page.js.map +1 -1
- package/dist/components/asset-top-sections.cjs +1 -9
- package/dist/components/asset-top-sections.cjs.map +1 -1
- package/dist/components/asset-top-sections.d.cts +1 -2
- package/dist/components/asset-top-sections.d.ts +1 -2
- package/dist/components/asset-top-sections.js +1 -9
- package/dist/components/asset-top-sections.js.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/markdown-text.cjs +53 -0
- package/dist/components/markdown-text.cjs.map +1 -0
- package/dist/components/markdown-text.d.cts +7 -0
- package/dist/components/markdown-text.d.ts +7 -0
- package/dist/components/markdown-text.js +19 -0
- package/dist/components/markdown-text.js.map +1 -0
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/package.json +3 -1
|
@@ -59,6 +59,7 @@ function ActionButton({
|
|
|
59
59
|
icon,
|
|
60
60
|
big,
|
|
61
61
|
ghost,
|
|
62
|
+
href,
|
|
62
63
|
helpContent,
|
|
63
64
|
disabled,
|
|
64
65
|
children,
|
|
@@ -66,12 +67,15 @@ function ActionButton({
|
|
|
66
67
|
style,
|
|
67
68
|
...rest
|
|
68
69
|
}) {
|
|
70
|
+
const Tag = href ? "a" : "button";
|
|
71
|
+
const linkProps = href ? { href, target: "_blank", rel: "noopener noreferrer" } : {};
|
|
69
72
|
const sizeClass = big ? "h-[54px] px-5 rounded-[13px] text-base" : "h-[46px] px-5 rounded-[13px] text-sm";
|
|
70
73
|
if (ghost) {
|
|
71
74
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
72
|
-
|
|
75
|
+
Tag,
|
|
73
76
|
{
|
|
74
77
|
...rest,
|
|
78
|
+
...linkProps,
|
|
75
79
|
disabled,
|
|
76
80
|
className: (0, import_cn.cn)(
|
|
77
81
|
"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap",
|
|
@@ -92,9 +96,10 @@ function ActionButton({
|
|
|
92
96
|
const fg = action ? ACTION_FOREGROUNDS[action] : tone ? TONE_FOREGROUNDS[tone] : ACTION_FOREGROUNDS.buy;
|
|
93
97
|
const grad = `linear-gradient(115deg, ${gradColors.join(",")})`;
|
|
94
98
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
95
|
-
|
|
99
|
+
Tag,
|
|
96
100
|
{
|
|
97
101
|
...rest,
|
|
102
|
+
...linkProps,
|
|
98
103
|
disabled,
|
|
99
104
|
className: (0, import_cn.cn)(
|
|
100
105
|
"ml-gbtn inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\n\nconst ACTION_GRADIENTS: Record<string, [string, string, string]> = {\n buy: ['#3b7bff', '#8a5cf6', '#3b7bff'],\n submit: ['#d6359a', '#5b4ce6', '#d6359a'],\n offer: ['#f6608f', '#fb8b46', '#f6608f'],\n remix: ['#8a5cf6', '#f6608f', '#8a5cf6'],\n license: ['#3b7bff', '#5b4ce6', '#3b7bff'],\n};\n\nconst ACTION_FOREGROUNDS: Record<string, string> = {\n buy: '#3b7bff',\n submit: '#5b4ce6',\n offer: '#fb7a32',\n remix: '#8a3ff0',\n license: '#3b7bff',\n};\n\nconst TONE_GRADIENTS: Record<string, [string, string, string]> = {\n blue: ['#3b7bff', '#5b4ce6', '#3b7bff'],\n purple: ['#8a5cf6', '#f6608f', '#8a5cf6'],\n orange: ['#fb8b46', '#f6608f', '#fb8b46'],\n red: ['#ef5a5a', '#f6608f', '#ef5a5a'],\n rose: ['#f6608f', '#fb8b46', '#f6608f'],\n};\n\nconst TONE_FOREGROUNDS: Record<string, string> = {\n blue: '#2f6bff',\n purple: '#8a3ff0',\n orange: '#fb7a32',\n red: '#ef5a5a',\n rose: '#f6608f',\n};\n\nexport type ActionKey = keyof typeof ACTION_GRADIENTS;\nexport type ToneKey = keyof typeof TONE_GRADIENTS;\n\nexport interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\n action?: ActionKey;\n\n tone?: ToneKey;\n icon?: React.ReactNode;\n\n big?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n ghost,\n helpContent,\n disabled,\n children,\n className,\n style,\n ...rest\n}: ActionButtonProps) {\n const sizeClass = big\n ? \"h-[54px] px-5 rounded-[13px] text-base\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\n\nconst ACTION_GRADIENTS: Record<string, [string, string, string]> = {\n buy: ['#3b7bff', '#8a5cf6', '#3b7bff'],\n submit: ['#d6359a', '#5b4ce6', '#d6359a'],\n offer: ['#f6608f', '#fb8b46', '#f6608f'],\n remix: ['#8a5cf6', '#f6608f', '#8a5cf6'],\n license: ['#3b7bff', '#5b4ce6', '#3b7bff'],\n};\n\nconst ACTION_FOREGROUNDS: Record<string, string> = {\n buy: '#3b7bff',\n submit: '#5b4ce6',\n offer: '#fb7a32',\n remix: '#8a3ff0',\n license: '#3b7bff',\n};\n\nconst TONE_GRADIENTS: Record<string, [string, string, string]> = {\n blue: ['#3b7bff', '#5b4ce6', '#3b7bff'],\n purple: ['#8a5cf6', '#f6608f', '#8a5cf6'],\n orange: ['#fb8b46', '#f6608f', '#fb8b46'],\n red: ['#ef5a5a', '#f6608f', '#ef5a5a'],\n rose: ['#f6608f', '#fb8b46', '#f6608f'],\n};\n\nconst TONE_FOREGROUNDS: Record<string, string> = {\n blue: '#2f6bff',\n purple: '#8a3ff0',\n orange: '#fb7a32',\n red: '#ef5a5a',\n rose: '#f6608f',\n};\n\nexport type ActionKey = keyof typeof ACTION_GRADIENTS;\nexport type ToneKey = keyof typeof TONE_GRADIENTS;\n\nexport interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\n href?: string;\n\n action?: ActionKey;\n\n tone?: ToneKey;\n icon?: React.ReactNode;\n\n big?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n ghost,\n href,\n helpContent,\n disabled,\n children,\n className,\n style,\n ...rest\n}: ActionButtonProps) {\n const Tag = (href ? \"a\" : \"button\") as React.ElementType;\n const linkProps = href ? { href, target: \"_blank\", rel: \"noopener noreferrer\" } : {};\n\n const sizeClass = big\n ? \"h-[54px] px-5 rounded-[13px] text-base\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <Tag\n {...rest}\n {...linkProps}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"bg-muted text-foreground border-none disabled:opacity-50 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={style}\n >\n {icon}{children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </Tag>\n );\n }\n\n const gradColors =\n action ? ACTION_GRADIENTS[action] :\n tone ? TONE_GRADIENTS[tone] :\n ACTION_GRADIENTS.buy;\n\n const fg =\n action ? ACTION_FOREGROUNDS[action] :\n tone ? TONE_FOREGROUNDS[tone] :\n ACTION_FOREGROUNDS.buy;\n\n const grad = `linear-gradient(115deg, ${gradColors.join(',')})`;\n\n return (\n <Tag\n {...rest}\n {...linkProps}\n disabled={disabled}\n className={cn(\n \"ml-gbtn inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"bg-transparent text-foreground border-none relative disabled:opacity-40 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={{ '--ml-grad': grad, ...style } as React.CSSProperties}\n >\n {icon && <span className=\"inline-flex\" style={{ color: fg }}>{icon}</span>}\n {children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </Tag>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+EM;AA7EN,gBAAmB;AACnB,uBAAyB;AAEzB,MAAM,mBAA6D;AAAA,EACjE,KAAS,CAAC,WAAW,WAAW,SAAS;AAAA,EACzC,QAAS,CAAC,WAAW,WAAW,SAAS;AAAA,EACzC,OAAS,CAAC,WAAW,WAAW,SAAS;AAAA,EACzC,OAAS,CAAC,WAAW,WAAW,SAAS;AAAA,EACzC,SAAS,CAAC,WAAW,WAAW,SAAS;AAC3C;AAEA,MAAM,qBAA6C;AAAA,EACjD,KAAS;AAAA,EACT,QAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AAAA,EACT,SAAS;AACX;AAEA,MAAM,iBAA2D;AAAA,EAC/D,MAAQ,CAAC,WAAW,WAAW,SAAS;AAAA,EACxC,QAAQ,CAAC,WAAW,WAAW,SAAS;AAAA,EACxC,QAAQ,CAAC,WAAW,WAAW,SAAS;AAAA,EACxC,KAAQ,CAAC,WAAW,WAAW,SAAS;AAAA,EACxC,MAAQ,CAAC,WAAW,WAAW,SAAS;AAC1C;AAEA,MAAM,mBAA2C;AAAA,EAC/C,MAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAQ;AAAA,EACR,MAAQ;AACV;AAqBO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,MAAO,OAAO,MAAM;AAC1B,QAAM,YAAY,OAAO,EAAE,MAAM,QAAQ,UAAU,KAAK,sBAAsB,IAAI,CAAC;AAEnF,QAAM,YAAY,MACd,2CACA;AAEJ,MAAI,OAAO;AACT,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACH,GAAG;AAAA,QACJ;AAAA,QACA,eAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UAAM;AAAA,UACN,cAAc,4CAAC,6BAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,IACtD;AAAA,EAEJ;AAEA,QAAM,aACJ,SAAS,iBAAiB,MAAM,IAChC,OAAS,eAAe,IAAI,IAC5B,iBAAiB;AAEnB,QAAM,KACJ,SAAS,mBAAmB,MAAM,IAClC,OAAS,iBAAiB,IAAI,IAC9B,mBAAmB;AAErB,QAAM,OAAO,2BAA2B,WAAW,KAAK,GAAG,CAAC;AAE5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,aAAa,MAAM,GAAG,MAAM;AAAA,MAEpC;AAAA,gBAAQ,4CAAC,UAAK,WAAU,eAAc,OAAO,EAAE,OAAO,GAAG,GAAI,gBAAK;AAAA,QAClE;AAAA,QACA,cAAc,4CAAC,6BAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,EACtD;AAEJ;","names":[]}
|
|
@@ -5,6 +5,7 @@ declare const TONE_GRADIENTS: Record<string, [string, string, string]>;
|
|
|
5
5
|
type ActionKey = keyof typeof ACTION_GRADIENTS;
|
|
6
6
|
type ToneKey = keyof typeof TONE_GRADIENTS;
|
|
7
7
|
interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
|
+
href?: string;
|
|
8
9
|
action?: ActionKey;
|
|
9
10
|
tone?: ToneKey;
|
|
10
11
|
icon?: React.ReactNode;
|
|
@@ -12,6 +13,6 @@ interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement
|
|
|
12
13
|
ghost?: boolean;
|
|
13
14
|
helpContent?: string;
|
|
14
15
|
}
|
|
15
|
-
declare function ActionButton({ action, tone, icon, big, ghost, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function ActionButton({ action, tone, icon, big, ghost, href, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
16
17
|
|
|
17
18
|
export { ActionButton, type ActionButtonProps, type ActionKey, type ToneKey };
|
|
@@ -5,6 +5,7 @@ declare const TONE_GRADIENTS: Record<string, [string, string, string]>;
|
|
|
5
5
|
type ActionKey = keyof typeof ACTION_GRADIENTS;
|
|
6
6
|
type ToneKey = keyof typeof TONE_GRADIENTS;
|
|
7
7
|
interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
|
+
href?: string;
|
|
8
9
|
action?: ActionKey;
|
|
9
10
|
tone?: ToneKey;
|
|
10
11
|
icon?: React.ReactNode;
|
|
@@ -12,6 +13,6 @@ interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement
|
|
|
12
13
|
ghost?: boolean;
|
|
13
14
|
helpContent?: string;
|
|
14
15
|
}
|
|
15
|
-
declare function ActionButton({ action, tone, icon, big, ghost, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function ActionButton({ action, tone, icon, big, ghost, href, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
16
17
|
|
|
17
18
|
export { ActionButton, type ActionButtonProps, type ActionKey, type ToneKey };
|
|
@@ -36,6 +36,7 @@ function ActionButton({
|
|
|
36
36
|
icon,
|
|
37
37
|
big,
|
|
38
38
|
ghost,
|
|
39
|
+
href,
|
|
39
40
|
helpContent,
|
|
40
41
|
disabled,
|
|
41
42
|
children,
|
|
@@ -43,12 +44,15 @@ function ActionButton({
|
|
|
43
44
|
style,
|
|
44
45
|
...rest
|
|
45
46
|
}) {
|
|
47
|
+
const Tag = href ? "a" : "button";
|
|
48
|
+
const linkProps = href ? { href, target: "_blank", rel: "noopener noreferrer" } : {};
|
|
46
49
|
const sizeClass = big ? "h-[54px] px-5 rounded-[13px] text-base" : "h-[46px] px-5 rounded-[13px] text-sm";
|
|
47
50
|
if (ghost) {
|
|
48
51
|
return /* @__PURE__ */ jsxs(
|
|
49
|
-
|
|
52
|
+
Tag,
|
|
50
53
|
{
|
|
51
54
|
...rest,
|
|
55
|
+
...linkProps,
|
|
52
56
|
disabled,
|
|
53
57
|
className: cn(
|
|
54
58
|
"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap",
|
|
@@ -69,9 +73,10 @@ function ActionButton({
|
|
|
69
73
|
const fg = action ? ACTION_FOREGROUNDS[action] : tone ? TONE_FOREGROUNDS[tone] : ACTION_FOREGROUNDS.buy;
|
|
70
74
|
const grad = `linear-gradient(115deg, ${gradColors.join(",")})`;
|
|
71
75
|
return /* @__PURE__ */ jsxs(
|
|
72
|
-
|
|
76
|
+
Tag,
|
|
73
77
|
{
|
|
74
78
|
...rest,
|
|
79
|
+
...linkProps,
|
|
75
80
|
disabled,
|
|
76
81
|
className: cn(
|
|
77
82
|
"ml-gbtn inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\n\nconst ACTION_GRADIENTS: Record<string, [string, string, string]> = {\n buy: ['#3b7bff', '#8a5cf6', '#3b7bff'],\n submit: ['#d6359a', '#5b4ce6', '#d6359a'],\n offer: ['#f6608f', '#fb8b46', '#f6608f'],\n remix: ['#8a5cf6', '#f6608f', '#8a5cf6'],\n license: ['#3b7bff', '#5b4ce6', '#3b7bff'],\n};\n\nconst ACTION_FOREGROUNDS: Record<string, string> = {\n buy: '#3b7bff',\n submit: '#5b4ce6',\n offer: '#fb7a32',\n remix: '#8a3ff0',\n license: '#3b7bff',\n};\n\nconst TONE_GRADIENTS: Record<string, [string, string, string]> = {\n blue: ['#3b7bff', '#5b4ce6', '#3b7bff'],\n purple: ['#8a5cf6', '#f6608f', '#8a5cf6'],\n orange: ['#fb8b46', '#f6608f', '#fb8b46'],\n red: ['#ef5a5a', '#f6608f', '#ef5a5a'],\n rose: ['#f6608f', '#fb8b46', '#f6608f'],\n};\n\nconst TONE_FOREGROUNDS: Record<string, string> = {\n blue: '#2f6bff',\n purple: '#8a3ff0',\n orange: '#fb7a32',\n red: '#ef5a5a',\n rose: '#f6608f',\n};\n\nexport type ActionKey = keyof typeof ACTION_GRADIENTS;\nexport type ToneKey = keyof typeof TONE_GRADIENTS;\n\nexport interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\n action?: ActionKey;\n\n tone?: ToneKey;\n icon?: React.ReactNode;\n\n big?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n ghost,\n helpContent,\n disabled,\n children,\n className,\n style,\n ...rest\n}: ActionButtonProps) {\n const sizeClass = big\n ? \"h-[54px] px-5 rounded-[13px] text-base\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\n\nconst ACTION_GRADIENTS: Record<string, [string, string, string]> = {\n buy: ['#3b7bff', '#8a5cf6', '#3b7bff'],\n submit: ['#d6359a', '#5b4ce6', '#d6359a'],\n offer: ['#f6608f', '#fb8b46', '#f6608f'],\n remix: ['#8a5cf6', '#f6608f', '#8a5cf6'],\n license: ['#3b7bff', '#5b4ce6', '#3b7bff'],\n};\n\nconst ACTION_FOREGROUNDS: Record<string, string> = {\n buy: '#3b7bff',\n submit: '#5b4ce6',\n offer: '#fb7a32',\n remix: '#8a3ff0',\n license: '#3b7bff',\n};\n\nconst TONE_GRADIENTS: Record<string, [string, string, string]> = {\n blue: ['#3b7bff', '#5b4ce6', '#3b7bff'],\n purple: ['#8a5cf6', '#f6608f', '#8a5cf6'],\n orange: ['#fb8b46', '#f6608f', '#fb8b46'],\n red: ['#ef5a5a', '#f6608f', '#ef5a5a'],\n rose: ['#f6608f', '#fb8b46', '#f6608f'],\n};\n\nconst TONE_FOREGROUNDS: Record<string, string> = {\n blue: '#2f6bff',\n purple: '#8a3ff0',\n orange: '#fb7a32',\n red: '#ef5a5a',\n rose: '#f6608f',\n};\n\nexport type ActionKey = keyof typeof ACTION_GRADIENTS;\nexport type ToneKey = keyof typeof TONE_GRADIENTS;\n\nexport interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\n href?: string;\n\n action?: ActionKey;\n\n tone?: ToneKey;\n icon?: React.ReactNode;\n\n big?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n ghost,\n href,\n helpContent,\n disabled,\n children,\n className,\n style,\n ...rest\n}: ActionButtonProps) {\n const Tag = (href ? \"a\" : \"button\") as React.ElementType;\n const linkProps = href ? { href, target: \"_blank\", rel: \"noopener noreferrer\" } : {};\n\n const sizeClass = big\n ? \"h-[54px] px-5 rounded-[13px] text-base\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <Tag\n {...rest}\n {...linkProps}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"bg-muted text-foreground border-none disabled:opacity-50 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={style}\n >\n {icon}{children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </Tag>\n );\n }\n\n const gradColors =\n action ? ACTION_GRADIENTS[action] :\n tone ? TONE_GRADIENTS[tone] :\n ACTION_GRADIENTS.buy;\n\n const fg =\n action ? ACTION_FOREGROUNDS[action] :\n tone ? TONE_FOREGROUNDS[tone] :\n ACTION_FOREGROUNDS.buy;\n\n const grad = `linear-gradient(115deg, ${gradColors.join(',')})`;\n\n return (\n <Tag\n {...rest}\n {...linkProps}\n disabled={disabled}\n className={cn(\n \"ml-gbtn inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"bg-transparent text-foreground border-none relative disabled:opacity-40 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={{ '--ml-grad': grad, ...style } as React.CSSProperties}\n >\n {icon && <span className=\"inline-flex\" style={{ color: fg }}>{icon}</span>}\n {children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </Tag>\n );\n}\n"],"mappings":";AA+EM,SAaiB,KAbjB;AA7EN,SAAS,UAAU;AACnB,SAAS,gBAAgB;AAEzB,MAAM,mBAA6D;AAAA,EACjE,KAAS,CAAC,WAAW,WAAW,SAAS;AAAA,EACzC,QAAS,CAAC,WAAW,WAAW,SAAS;AAAA,EACzC,OAAS,CAAC,WAAW,WAAW,SAAS;AAAA,EACzC,OAAS,CAAC,WAAW,WAAW,SAAS;AAAA,EACzC,SAAS,CAAC,WAAW,WAAW,SAAS;AAC3C;AAEA,MAAM,qBAA6C;AAAA,EACjD,KAAS;AAAA,EACT,QAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AAAA,EACT,SAAS;AACX;AAEA,MAAM,iBAA2D;AAAA,EAC/D,MAAQ,CAAC,WAAW,WAAW,SAAS;AAAA,EACxC,QAAQ,CAAC,WAAW,WAAW,SAAS;AAAA,EACxC,QAAQ,CAAC,WAAW,WAAW,SAAS;AAAA,EACxC,KAAQ,CAAC,WAAW,WAAW,SAAS;AAAA,EACxC,MAAQ,CAAC,WAAW,WAAW,SAAS;AAC1C;AAEA,MAAM,mBAA2C;AAAA,EAC/C,MAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAQ;AAAA,EACR,MAAQ;AACV;AAqBO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,MAAO,OAAO,MAAM;AAC1B,QAAM,YAAY,OAAO,EAAE,MAAM,QAAQ,UAAU,KAAK,sBAAsB,IAAI,CAAC;AAEnF,QAAM,YAAY,MACd,2CACA;AAEJ,MAAI,OAAO;AACT,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACH,GAAG;AAAA,QACJ;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UAAM;AAAA,UACN,cAAc,oBAAC,YAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,IACtD;AAAA,EAEJ;AAEA,QAAM,aACJ,SAAS,iBAAiB,MAAM,IAChC,OAAS,eAAe,IAAI,IAC5B,iBAAiB;AAEnB,QAAM,KACJ,SAAS,mBAAmB,MAAM,IAClC,OAAS,iBAAiB,IAAI,IAC9B,mBAAmB;AAErB,QAAM,OAAO,2BAA2B,WAAW,KAAK,GAAG,CAAC;AAE5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,aAAa,MAAM,GAAG,MAAM;AAAA,MAEpC;AAAA,gBAAQ,oBAAC,UAAK,WAAU,eAAc,OAAO,EAAE,OAAO,GAAG,GAAI,gBAAK;AAAA,QAClE;AAAA,QACA,cAAc,oBAAC,YAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,EACtD;AAEJ;","names":[]}
|
|
@@ -19,57 +19,45 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var asset_access_cards_exports = {};
|
|
21
21
|
__export(asset_access_cards_exports, {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
AssetAccessButtons: () => AssetAccessButtons,
|
|
23
|
+
CompanionAppButton: () => CompanionAppButton
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(asset_access_cards_exports);
|
|
26
26
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
-
var import_lucide_react = require("lucide-react");
|
|
28
27
|
var import_sdk = require("@medialane/sdk");
|
|
28
|
+
var import_lucide_react = require("lucide-react");
|
|
29
29
|
var import_medialane_app = require("./medialane-app.js");
|
|
30
|
+
var import_action_button = require("./action-button.js");
|
|
30
31
|
var import_cn = require("../utils/cn.js");
|
|
31
|
-
|
|
32
|
-
function CardBody({ icon: Icon, iconClassName, title, description }) {
|
|
33
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
34
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br text-white", iconClassName), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-[18px] w-[18px]" }) }),
|
|
35
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
36
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-bold leading-snug", children: title }),
|
|
37
|
-
description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-0.5 text-xs leading-relaxed text-muted-foreground", children: description }) : null
|
|
38
|
-
] })
|
|
39
|
-
] });
|
|
40
|
-
}
|
|
41
|
-
function CompanionAppCard({ asset }) {
|
|
32
|
+
function CompanionAppButton({ asset }) {
|
|
42
33
|
const { companion } = (0, import_medialane_app.useMedialaneApp)();
|
|
43
34
|
if (!companion) return null;
|
|
35
|
+
const Icon = companion.icon;
|
|
44
36
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
-
|
|
37
|
+
import_action_button.ActionButton,
|
|
46
38
|
{
|
|
39
|
+
action: "offer",
|
|
40
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-4 w-4" }),
|
|
47
41
|
href: `${companion.origin}${(0, import_sdk.assetHref)(asset.chain.toUpperCase(), asset.contractAddress, asset.tokenId)}`,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardBody, { icon: companion.icon, iconClassName: "from-brand-rose to-brand-orange", title: companion.title, description: companion.description })
|
|
42
|
+
title: companion.description,
|
|
43
|
+
className: "w-full",
|
|
44
|
+
children: companion.title
|
|
52
45
|
}
|
|
53
46
|
);
|
|
54
47
|
}
|
|
55
|
-
function
|
|
48
|
+
function AssetAccessButtons({ asset, stacked = false }) {
|
|
56
49
|
const { onRequireWallet, connectLabel = "Sign in", connectDescription, companion } = (0, import_medialane_app.useMedialaneApp)();
|
|
57
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className:
|
|
58
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
59
|
-
"
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
className: (0, import_cn.cn)(CARD, "bg-gradient-to-br from-brand-blue/15 via-brand-purple/10 to-transparent hover:border-brand-purple/30"),
|
|
64
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardBody, { icon: import_lucide_react.Wallet, iconClassName: "from-brand-blue to-brand-purple", title: connectLabel, description: connectDescription })
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompanionAppCard, { asset })
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("grid grid-cols-1 gap-2", companion && !stacked && "sm:grid-cols-2"), children: [
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { action: "buy", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Wallet, { className: "h-4 w-4" }), onClick: onRequireWallet, className: "w-full", children: connectLabel }),
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompanionAppButton, { asset })
|
|
54
|
+
] }),
|
|
55
|
+
connectDescription ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: connectDescription }) : null
|
|
68
56
|
] });
|
|
69
57
|
}
|
|
70
58
|
// Annotate the CommonJS export names for ESM import in node:
|
|
71
59
|
0 && (module.exports = {
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
AssetAccessButtons,
|
|
61
|
+
CompanionAppButton
|
|
74
62
|
});
|
|
75
63
|
//# sourceMappingURL=asset-access-cards.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-access-cards.tsx"],"sourcesContent":["\"use client\";\n\nimport type
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-access-cards.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, type Chain } from \"@medialane/sdk\";\nimport { Wallet } from \"lucide-react\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { cn } from \"../utils/cn.js\";\n\nexport function CompanionAppButton({ asset }: { asset: AssetRef }) {\n const { companion } = useMedialaneApp();\n if (!companion) return null;\n const Icon = companion.icon;\n return (\n <ActionButton\n action=\"offer\"\n icon={<Icon className=\"h-4 w-4\" />}\n href={`${companion.origin}${assetHref(asset.chain.toUpperCase() as Chain, asset.contractAddress, asset.tokenId)}`}\n title={companion.description}\n className=\"w-full\"\n >\n {companion.title}\n </ActionButton>\n );\n}\n\nexport function AssetAccessButtons({ asset, stacked = false }: { asset: AssetRef; stacked?: boolean }) {\n const { onRequireWallet, connectLabel = \"Sign in\", connectDescription, companion } = useMedialaneApp();\n return (\n <div className=\"space-y-2\">\n <div className={cn(\"grid grid-cols-1 gap-2\", companion && !stacked && \"sm:grid-cols-2\")}>\n <ActionButton action=\"buy\" icon={<Wallet className=\"h-4 w-4\" />} onClick={onRequireWallet} className=\"w-full\">\n {connectLabel}\n </ActionButton>\n <CompanionAppButton asset={asset} />\n </div>\n {connectDescription ? <p className=\"text-xs text-muted-foreground\">{connectDescription}</p> : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeY;AAbZ,iBAAsC;AACtC,0BAAuB;AACvB,2BAA+C;AAC/C,2BAA6B;AAC7B,gBAAmB;AAEZ,SAAS,mBAAmB,EAAE,MAAM,GAAwB;AACjE,QAAM,EAAE,UAAU,QAAI,sCAAgB;AACtC,MAAI,CAAC,UAAW,QAAO;AACvB,QAAM,OAAO,UAAU;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,MAAM,4CAAC,QAAK,WAAU,WAAU;AAAA,MAChC,MAAM,GAAG,UAAU,MAAM,OAAG,sBAAU,MAAM,MAAM,YAAY,GAAY,MAAM,iBAAiB,MAAM,OAAO,CAAC;AAAA,MAC/G,OAAO,UAAU;AAAA,MACjB,WAAU;AAAA,MAET,oBAAU;AAAA;AAAA,EACb;AAEJ;AAEO,SAAS,mBAAmB,EAAE,OAAO,UAAU,MAAM,GAA2C;AACrG,QAAM,EAAE,iBAAiB,eAAe,WAAW,oBAAoB,UAAU,QAAI,sCAAgB;AACrG,SACE,6CAAC,SAAI,WAAU,aACb;AAAA,iDAAC,SAAI,eAAW,cAAG,0BAA0B,aAAa,CAAC,WAAW,gBAAgB,GACpF;AAAA,kDAAC,qCAAa,QAAO,OAAM,MAAM,4CAAC,8BAAO,WAAU,WAAU,GAAI,SAAS,iBAAiB,WAAU,UAClG,wBACH;AAAA,MACA,4CAAC,sBAAmB,OAAc;AAAA,OACpC;AAAA,IACC,qBAAqB,4CAAC,OAAE,WAAU,iCAAiC,8BAAmB,IAAO;AAAA,KAChG;AAEJ;","names":[]}
|
|
@@ -7,12 +7,12 @@ import 'starknet';
|
|
|
7
7
|
import '@medialane/sdk';
|
|
8
8
|
import '../utils/ipfs.cjs';
|
|
9
9
|
|
|
10
|
-
declare function
|
|
10
|
+
declare function CompanionAppButton({ asset }: {
|
|
11
11
|
asset: AssetRef;
|
|
12
12
|
}): react_jsx_runtime.JSX.Element | null;
|
|
13
|
-
declare function
|
|
13
|
+
declare function AssetAccessButtons({ asset, stacked }: {
|
|
14
14
|
asset: AssetRef;
|
|
15
15
|
stacked?: boolean;
|
|
16
16
|
}): react_jsx_runtime.JSX.Element;
|
|
17
17
|
|
|
18
|
-
export {
|
|
18
|
+
export { AssetAccessButtons, CompanionAppButton };
|
|
@@ -7,12 +7,12 @@ import 'starknet';
|
|
|
7
7
|
import '@medialane/sdk';
|
|
8
8
|
import '../utils/ipfs.js';
|
|
9
9
|
|
|
10
|
-
declare function
|
|
10
|
+
declare function CompanionAppButton({ asset }: {
|
|
11
11
|
asset: AssetRef;
|
|
12
12
|
}): react_jsx_runtime.JSX.Element | null;
|
|
13
|
-
declare function
|
|
13
|
+
declare function AssetAccessButtons({ asset, stacked }: {
|
|
14
14
|
asset: AssetRef;
|
|
15
15
|
stacked?: boolean;
|
|
16
16
|
}): react_jsx_runtime.JSX.Element;
|
|
17
17
|
|
|
18
|
-
export {
|
|
18
|
+
export { AssetAccessButtons, CompanionAppButton };
|
|
@@ -1,50 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { Wallet } from "lucide-react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { assetHref } from "@medialane/sdk";
|
|
4
|
+
import { Wallet } from "lucide-react";
|
|
5
5
|
import { useMedialaneApp } from "./medialane-app.js";
|
|
6
|
+
import { ActionButton } from "./action-button.js";
|
|
6
7
|
import { cn } from "../utils/cn.js";
|
|
7
|
-
|
|
8
|
-
function CardBody({ icon: Icon, iconClassName, title, description }) {
|
|
9
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10
|
-
/* @__PURE__ */ jsx("div", { className: cn("mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br text-white", iconClassName), children: /* @__PURE__ */ jsx(Icon, { className: "h-[18px] w-[18px]" }) }),
|
|
11
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
12
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm font-bold leading-snug", children: title }),
|
|
13
|
-
description ? /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs leading-relaxed text-muted-foreground", children: description }) : null
|
|
14
|
-
] })
|
|
15
|
-
] });
|
|
16
|
-
}
|
|
17
|
-
function CompanionAppCard({ asset }) {
|
|
8
|
+
function CompanionAppButton({ asset }) {
|
|
18
9
|
const { companion } = useMedialaneApp();
|
|
19
10
|
if (!companion) return null;
|
|
11
|
+
const Icon = companion.icon;
|
|
20
12
|
return /* @__PURE__ */ jsx(
|
|
21
|
-
|
|
13
|
+
ActionButton,
|
|
22
14
|
{
|
|
15
|
+
action: "offer",
|
|
16
|
+
icon: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" }),
|
|
23
17
|
href: `${companion.origin}${assetHref(asset.chain.toUpperCase(), asset.contractAddress, asset.tokenId)}`,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
children: /* @__PURE__ */ jsx(CardBody, { icon: companion.icon, iconClassName: "from-brand-rose to-brand-orange", title: companion.title, description: companion.description })
|
|
18
|
+
title: companion.description,
|
|
19
|
+
className: "w-full",
|
|
20
|
+
children: companion.title
|
|
28
21
|
}
|
|
29
22
|
);
|
|
30
23
|
}
|
|
31
|
-
function
|
|
24
|
+
function AssetAccessButtons({ asset, stacked = false }) {
|
|
32
25
|
const { onRequireWallet, connectLabel = "Sign in", connectDescription, companion } = useMedialaneApp();
|
|
33
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
"
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
className: cn(CARD, "bg-gradient-to-br from-brand-blue/15 via-brand-purple/10 to-transparent hover:border-brand-purple/30"),
|
|
40
|
-
children: /* @__PURE__ */ jsx(CardBody, { icon: Wallet, iconClassName: "from-brand-blue to-brand-purple", title: connectLabel, description: connectDescription })
|
|
41
|
-
}
|
|
42
|
-
),
|
|
43
|
-
/* @__PURE__ */ jsx(CompanionAppCard, { asset })
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
27
|
+
/* @__PURE__ */ jsxs("div", { className: cn("grid grid-cols-1 gap-2", companion && !stacked && "sm:grid-cols-2"), children: [
|
|
28
|
+
/* @__PURE__ */ jsx(ActionButton, { action: "buy", icon: /* @__PURE__ */ jsx(Wallet, { className: "h-4 w-4" }), onClick: onRequireWallet, className: "w-full", children: connectLabel }),
|
|
29
|
+
/* @__PURE__ */ jsx(CompanionAppButton, { asset })
|
|
30
|
+
] }),
|
|
31
|
+
connectDescription ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: connectDescription }) : null
|
|
44
32
|
] });
|
|
45
33
|
}
|
|
46
34
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
AssetAccessButtons,
|
|
36
|
+
CompanionAppButton
|
|
49
37
|
};
|
|
50
38
|
//# sourceMappingURL=asset-access-cards.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-access-cards.tsx"],"sourcesContent":["\"use client\";\n\nimport type
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-access-cards.tsx"],"sourcesContent":["\"use client\";\n\nimport { assetHref, type Chain } from \"@medialane/sdk\";\nimport { Wallet } from \"lucide-react\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { cn } from \"../utils/cn.js\";\n\nexport function CompanionAppButton({ asset }: { asset: AssetRef }) {\n const { companion } = useMedialaneApp();\n if (!companion) return null;\n const Icon = companion.icon;\n return (\n <ActionButton\n action=\"offer\"\n icon={<Icon className=\"h-4 w-4\" />}\n href={`${companion.origin}${assetHref(asset.chain.toUpperCase() as Chain, asset.contractAddress, asset.tokenId)}`}\n title={companion.description}\n className=\"w-full\"\n >\n {companion.title}\n </ActionButton>\n );\n}\n\nexport function AssetAccessButtons({ asset, stacked = false }: { asset: AssetRef; stacked?: boolean }) {\n const { onRequireWallet, connectLabel = \"Sign in\", connectDescription, companion } = useMedialaneApp();\n return (\n <div className=\"space-y-2\">\n <div className={cn(\"grid grid-cols-1 gap-2\", companion && !stacked && \"sm:grid-cols-2\")}>\n <ActionButton action=\"buy\" icon={<Wallet className=\"h-4 w-4\" />} onClick={onRequireWallet} className=\"w-full\">\n {connectLabel}\n </ActionButton>\n <CompanionAppButton asset={asset} />\n </div>\n {connectDescription ? <p className=\"text-xs text-muted-foreground\">{connectDescription}</p> : null}\n </div>\n );\n}\n"],"mappings":";AAeY,cAcN,YAdM;AAbZ,SAAS,iBAA6B;AACtC,SAAS,cAAc;AACvB,SAAS,uBAAsC;AAC/C,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AAEZ,SAAS,mBAAmB,EAAE,MAAM,GAAwB;AACjE,QAAM,EAAE,UAAU,IAAI,gBAAgB;AACtC,MAAI,CAAC,UAAW,QAAO;AACvB,QAAM,OAAO,UAAU;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,MAAM,oBAAC,QAAK,WAAU,WAAU;AAAA,MAChC,MAAM,GAAG,UAAU,MAAM,GAAG,UAAU,MAAM,MAAM,YAAY,GAAY,MAAM,iBAAiB,MAAM,OAAO,CAAC;AAAA,MAC/G,OAAO,UAAU;AAAA,MACjB,WAAU;AAAA,MAET,oBAAU;AAAA;AAAA,EACb;AAEJ;AAEO,SAAS,mBAAmB,EAAE,OAAO,UAAU,MAAM,GAA2C;AACrG,QAAM,EAAE,iBAAiB,eAAe,WAAW,oBAAoB,UAAU,IAAI,gBAAgB;AACrG,SACE,qBAAC,SAAI,WAAU,aACb;AAAA,yBAAC,SAAI,WAAW,GAAG,0BAA0B,aAAa,CAAC,WAAW,gBAAgB,GACpF;AAAA,0BAAC,gBAAa,QAAO,OAAM,MAAM,oBAAC,UAAO,WAAU,WAAU,GAAI,SAAS,iBAAiB,WAAU,UAClG,wBACH;AAAA,MACA,oBAAC,sBAAmB,OAAc;AAAA,OACpC;AAAA,IACC,qBAAqB,oBAAC,OAAE,WAAU,iCAAiC,8BAAmB,IAAO;AAAA,KAChG;AAEJ;","names":[]}
|
|
@@ -34,21 +34,22 @@ var import_same_address = require("../utils/same-address.js");
|
|
|
34
34
|
var import_cn = require("../utils/cn.js");
|
|
35
35
|
var import_asset_access_cards = require("./asset-access-cards.js");
|
|
36
36
|
var import_medialane_app = require("./medialane-app.js");
|
|
37
|
-
var import_help_icon = require("./help-icon.js");
|
|
38
37
|
function ActionRow({ children }) {
|
|
39
38
|
const odd = import_react.Children.toArray(children).length % 2 === 1;
|
|
40
39
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("grid grid-cols-2 gap-2", odd && "[&>*:first-child]:col-span-2"), children });
|
|
41
40
|
}
|
|
42
|
-
function
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "
|
|
44
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
45
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
function PriceBlock({ order, usdValue }) {
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: "Buy for" }),
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: (0, import_format.formatDisplayPrice)(order.price.formatted), symbol: order.price.currency ?? "", iconSize: 26, amountClassName: "text-3xl font-bold text-foreground tabular-nums" }),
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-lg font-semibold text-foreground", children: order.price.currency }),
|
|
47
|
+
usdValue ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm tabular-nums text-muted-foreground", children: usdValue }) : null
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
50
|
+
"Expires ",
|
|
51
|
+
(0, import_time.timeUntil)(order.endTime)
|
|
52
|
+
] })
|
|
52
53
|
] });
|
|
53
54
|
}
|
|
54
55
|
function AssetMarketplacePanel({
|
|
@@ -102,17 +103,16 @@ function AssetMarketplacePanel({
|
|
|
102
103
|
}
|
|
103
104
|
) : null;
|
|
104
105
|
const offerButton = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { action: "offer", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.HandCoins, { className: "h-4 w-4" }), onClick: onOpenOffer, children: "Make offer" });
|
|
105
|
-
const buyButton = liveCheapest && (!isOwner || canBuyMore) ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_action_button.ActionButton, { action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: [
|
|
106
|
+
const buyButton = liveCheapest && (!isOwner || canBuyMore) ? isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_action_button.ActionButton, { action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: [
|
|
106
107
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Buy" }),
|
|
107
108
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: (0, import_format.formatDisplayPrice)(liveCheapest.price.formatted), symbol: liveCheapest.price.currency ?? "", iconSize: 14, amountClassName: "tabular-nums" }),
|
|
108
109
|
usdValue ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "font-normal text-muted-foreground tabular-nums", children: [
|
|
109
110
|
"\xB7 ",
|
|
110
111
|
usdValue
|
|
111
112
|
] }) : null
|
|
112
|
-
] }) : null;
|
|
113
|
-
const listedPrice = !isOwner &&
|
|
113
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: "Buy now" }) : null;
|
|
114
|
+
const listedPrice = !isOwner && liveCheapest ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PriceBlock, { order: liveCheapest, usdValue }) : null;
|
|
114
115
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative space-y-4", children: [
|
|
115
|
-
listedPrice,
|
|
116
116
|
isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-3", children: [
|
|
117
117
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ActionRow, { children: [
|
|
118
118
|
liveMyListing ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -148,31 +148,34 @@ function AssetMarketplacePanel({
|
|
|
148
148
|
) : null
|
|
149
149
|
] }),
|
|
150
150
|
buyButton ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, { children: buyButton }) : null
|
|
151
|
-
] }) :
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
151
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
|
|
152
|
+
listedPrice,
|
|
153
|
+
isSignedIn ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ActionRow, { children: [
|
|
154
|
+
buyButton,
|
|
155
|
+
offerButton,
|
|
156
|
+
remixButton,
|
|
157
|
+
showDealOption && onProposeDeal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
158
|
+
import_action_button.ActionButton,
|
|
159
|
+
{
|
|
160
|
+
action: "license",
|
|
161
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.HandCoins, { className: "h-4 w-4" }),
|
|
162
|
+
onClick: onProposeDeal,
|
|
163
|
+
helpContent: "Propose a license deal to the creator to use this work.",
|
|
164
|
+
children: "License"
|
|
165
|
+
}
|
|
166
|
+
) : null,
|
|
167
|
+
showSponsorOption && onOpenSponsorProposal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
168
|
+
import_action_button.ActionButton,
|
|
169
|
+
{
|
|
170
|
+
tone: "blue",
|
|
171
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Handshake, { className: "h-4 w-4" }),
|
|
172
|
+
onClick: onOpenSponsorProposal,
|
|
173
|
+
helpContent: "Propose to sponsor this creator's work \u2014 pay them directly for a license, no escrow.",
|
|
174
|
+
children: "Sponsor"
|
|
175
|
+
}
|
|
176
|
+
) : null
|
|
177
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_asset_access_cards.AssetAccessButtons, { asset, stacked: compact })
|
|
178
|
+
] }),
|
|
176
179
|
myBid ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3", children: [
|
|
177
180
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex items-center gap-2.5", children: [
|
|
178
181
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.HandCoins, { className: "h-4 w-4 text-amber-500 shrink-0" }),
|
|
@@ -236,7 +239,7 @@ function AssetMarketplacePanel({
|
|
|
236
239
|
)
|
|
237
240
|
] }, bid.orderHash)) })
|
|
238
241
|
] }) : null,
|
|
239
|
-
isSignedIn ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_asset_access_cards.
|
|
242
|
+
isSignedIn ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_asset_access_cards.CompanionAppButton, { asset }) : null
|
|
240
243
|
] }) });
|
|
241
244
|
}
|
|
242
245
|
// Annotate the CommonJS export names for ESM import in node:
|