@medialane/ui 0.376.0 → 0.378.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 +5 -3
- package/dist/components/action-button.cjs.map +1 -1
- package/dist/components/action-button.d.cts +3 -1
- package/dist/components/action-button.d.ts +3 -1
- package/dist/components/action-button.js +5 -3
- package/dist/components/action-button.js.map +1 -1
- package/dist/components/asset-marketplace-panel.cjs +1 -1
- package/dist/components/asset-marketplace-panel.cjs.map +1 -1
- package/dist/components/asset-marketplace-panel.js +1 -1
- package/dist/components/asset-marketplace-panel.js.map +1 -1
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/discover-feed-section.cjs +2 -52
- package/dist/components/discover-feed-section.cjs.map +1 -1
- package/dist/components/discover-feed-section.d.cts +2 -15
- package/dist/components/discover-feed-section.d.ts +2 -15
- package/dist/components/discover-feed-section.js +2 -51
- package/dist/components/discover-feed-section.js.map +1 -1
- package/dist/components/ip-type-badge.cjs +2 -3
- package/dist/components/ip-type-badge.cjs.map +1 -1
- package/dist/components/ip-type-badge.js +2 -3
- package/dist/components/ip-type-badge.js.map +1 -1
- package/dist/components/panel.cjs +2 -2
- package/dist/components/panel.cjs.map +1 -1
- package/dist/components/panel.js +2 -2
- package/dist/components/panel.js.map +1 -1
- package/dist/components/sheet.cjs +1 -1
- package/dist/components/sheet.cjs.map +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/i18n/catalog/pt.cjs +0 -4
- package/dist/i18n/catalog/pt.cjs.map +1 -1
- package/dist/i18n/catalog/pt.js +0 -4
- package/dist/i18n/catalog/pt.js.map +1 -1
- package/dist/index.cjs +0 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -10
- package/dist/index.d.ts +1 -10
- package/dist/index.js +1 -22
- package/dist/index.js.map +1 -1
- package/dist/medialane.css +15 -112
- package/dist/preset/tailwind.cjs +0 -10
- package/dist/preset/tailwind.cjs.map +1 -1
- package/dist/preset/tailwind.js +0 -10
- package/dist/preset/tailwind.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/activity-feed-shell.cjs +0 -93
- package/dist/components/activity-feed-shell.cjs.map +0 -1
- package/dist/components/activity-feed-shell.d.cts +0 -13
- package/dist/components/activity-feed-shell.d.ts +0 -13
- package/dist/components/activity-feed-shell.js +0 -59
- package/dist/components/activity-feed-shell.js.map +0 -1
- package/dist/components/cta-card-grid.cjs +0 -69
- package/dist/components/cta-card-grid.cjs.map +0 -1
- package/dist/components/cta-card-grid.d.cts +0 -21
- package/dist/components/cta-card-grid.d.ts +0 -21
- package/dist/components/cta-card-grid.js +0 -35
- package/dist/components/cta-card-grid.js.map +0 -1
- package/dist/components/featured-carousel.cjs +0 -171
- package/dist/components/featured-carousel.cjs.map +0 -1
- package/dist/components/featured-carousel.d.cts +0 -13
- package/dist/components/featured-carousel.d.ts +0 -13
- package/dist/components/featured-carousel.js +0 -146
- package/dist/components/featured-carousel.js.map +0 -1
- package/dist/components/launchpad-cta-banner.cjs +0 -85
- package/dist/components/launchpad-cta-banner.cjs.map +0 -1
- package/dist/components/launchpad-cta-banner.d.cts +0 -15
- package/dist/components/launchpad-cta-banner.d.ts +0 -15
- package/dist/components/launchpad-cta-banner.js +0 -51
- package/dist/components/launchpad-cta-banner.js.map +0 -1
- package/dist/components/portfolio-section.cjs +0 -90
- package/dist/components/portfolio-section.cjs.map +0 -1
- package/dist/components/portfolio-section.d.cts +0 -14
- package/dist/components/portfolio-section.d.ts +0 -14
- package/dist/components/portfolio-section.js +0 -56
- package/dist/components/portfolio-section.js.map +0 -1
- package/dist/components/rewards/journey-path.cjs +0 -77
- package/dist/components/rewards/journey-path.cjs.map +0 -1
- package/dist/components/rewards/journey-path.d.cts +0 -17
- package/dist/components/rewards/journey-path.d.ts +0 -17
- package/dist/components/rewards/journey-path.js +0 -53
- package/dist/components/rewards/journey-path.js.map +0 -1
- package/dist/components/rewards/score-summary-card.cjs +0 -73
- package/dist/components/rewards/score-summary-card.cjs.map +0 -1
- package/dist/components/rewards/score-summary-card.d.cts +0 -21
- package/dist/components/rewards/score-summary-card.d.ts +0 -21
- package/dist/components/rewards/score-summary-card.js +0 -49
- package/dist/components/rewards/score-summary-card.js.map +0 -1
- package/dist/components/step-nav.cjs +0 -82
- package/dist/components/step-nav.cjs.map +0 -1
- package/dist/components/step-nav.d.cts +0 -17
- package/dist/components/step-nav.d.ts +0 -17
- package/dist/components/step-nav.js +0 -58
- package/dist/components/step-nav.js.map +0 -1
- package/dist/components/token-glyph.cjs +0 -92
- package/dist/components/token-glyph.cjs.map +0 -1
- package/dist/components/token-glyph.d.cts +0 -19
- package/dist/components/token-glyph.d.ts +0 -19
- package/dist/components/token-glyph.js +0 -67
- package/dist/components/token-glyph.js.map +0 -1
|
@@ -32,6 +32,7 @@ function ActionButton({
|
|
|
32
32
|
icon,
|
|
33
33
|
big,
|
|
34
34
|
small,
|
|
35
|
+
solid,
|
|
35
36
|
ghost,
|
|
36
37
|
helpContent,
|
|
37
38
|
disabled,
|
|
@@ -71,13 +72,14 @@ function ActionButton({
|
|
|
71
72
|
disabled,
|
|
72
73
|
className: (0, import_cn.cn)(
|
|
73
74
|
"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap",
|
|
74
|
-
"text-
|
|
75
|
+
solid ? "text-white" : "text-foreground",
|
|
76
|
+
"border-none transition-[filter] hover:brightness-110 disabled:opacity-40 disabled:pointer-events-none",
|
|
75
77
|
sizeClass,
|
|
76
78
|
className
|
|
77
79
|
),
|
|
78
|
-
style: { backgroundImage: `linear-gradient(115deg, ${(0, import_brand.brandTint)(from, 0.28)}, ${(0, import_brand.brandTint)(to, 0.16)})`, ...style },
|
|
80
|
+
style: { backgroundImage: `linear-gradient(115deg, ${(0, import_brand.brandTint)(from, solid ? 1 : 0.28)}, ${(0, import_brand.brandTint)(to, solid ? 1 : 0.16)})`, ...style },
|
|
79
81
|
children: [
|
|
80
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "inline-flex", style: { color: fg }, children: icon }),
|
|
82
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "inline-flex", style: solid ? void 0 : { color: fg }, children: icon }),
|
|
81
83
|
children,
|
|
82
84
|
helpContent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_help_icon.HelpIcon, { content: helpContent }) : null
|
|
83
85
|
]
|
|
@@ -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\";\nimport { ACTION_FOREGROUNDS, ACTION_PAIRS, TONE_FOREGROUNDS, TONE_PAIRS, brandTint } from \"../data/brand.js\";\n\nexport type ActionKey = keyof typeof ACTION_PAIRS;\nexport type ToneKey = keyof typeof TONE_PAIRS;\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 /** Compact size for actions inside list rows. */\n small?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n small,\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 : small\n ? \"h-9 px-3 rounded-xl text-xs\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <button\n {...rest}\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 </button>\n );\n }\n\n const [from, to] =\n action ? ACTION_PAIRS[action] :\n tone ? TONE_PAIRS[tone] :\n ACTION_PAIRS.buy;\n\n const fg =\n action ? ACTION_FOREGROUNDS[action] :\n tone ? TONE_FOREGROUNDS[tone] :\n ACTION_FOREGROUNDS.buy;\n\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"text-foreground
|
|
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\";\nimport { ACTION_FOREGROUNDS, ACTION_PAIRS, TONE_FOREGROUNDS, TONE_PAIRS, brandTint } from \"../data/brand.js\";\n\nexport type ActionKey = keyof typeof ACTION_PAIRS;\nexport type ToneKey = keyof typeof TONE_PAIRS;\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 /** Compact size for actions inside list rows. */\n small?: boolean;\n\n /** Full-strength gradient for the one primary action on a surface. */\n solid?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n small,\n solid,\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 : small\n ? \"h-9 px-3 rounded-xl text-xs\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <button\n {...rest}\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 </button>\n );\n }\n\n const [from, to] =\n action ? ACTION_PAIRS[action] :\n tone ? TONE_PAIRS[tone] :\n ACTION_PAIRS.buy;\n\n const fg =\n action ? ACTION_FOREGROUNDS[action] :\n tone ? TONE_FOREGROUNDS[tone] :\n ACTION_FOREGROUNDS.buy;\n\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n solid ? \"text-white\" : \"text-foreground\",\n \"border-none transition-[filter] hover:brightness-110 disabled:opacity-40 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={{ backgroundImage: `linear-gradient(115deg, ${brandTint(from, solid ? 1 : 0.28)}, ${brandTint(to, solid ? 1 : 0.16)})`, ...style }}\n >\n {icon && <span className=\"inline-flex\" style={solid ? undefined : { color: fg }}>{icon}</span>}\n {children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoDM;AAlDN,gBAAmB;AACnB,uBAAyB;AACzB,mBAA0F;AAyBnF,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;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,YAAY,MACd,2CACA,QACA,gCACA;AAEJ,MAAI,OAAO;AACT,WACE;AAAA,MAAC;AAAA;AAAA,QACE,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,CAAC,MAAM,EAAE,IACb,SAAS,0BAAa,MAAM,IAC5B,OAAS,wBAAW,IAAI,IACxB,0BAAa;AAEf,QAAM,KACJ,SAAS,gCAAmB,MAAM,IAClC,OAAS,8BAAiB,IAAI,IAC9B,gCAAmB;AAErB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA,QAAQ,eAAe;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,iBAAiB,+BAA2B,wBAAU,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAK,wBAAU,IAAI,QAAQ,IAAI,IAAI,CAAC,KAAK,GAAG,MAAM;AAAA,MAEvI;AAAA,gBAAQ,4CAAC,UAAK,WAAU,eAAc,OAAO,QAAQ,SAAY,EAAE,OAAO,GAAG,GAAI,gBAAK;AAAA,QACtF;AAAA,QACA,cAAc,4CAAC,6BAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,EACtD;AAEJ;","names":[]}
|
|
@@ -10,9 +10,11 @@ interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement
|
|
|
10
10
|
big?: boolean;
|
|
11
11
|
/** Compact size for actions inside list rows. */
|
|
12
12
|
small?: boolean;
|
|
13
|
+
/** Full-strength gradient for the one primary action on a surface. */
|
|
14
|
+
solid?: boolean;
|
|
13
15
|
ghost?: boolean;
|
|
14
16
|
helpContent?: string;
|
|
15
17
|
}
|
|
16
|
-
declare function ActionButton({ action, tone, icon, big, small, ghost, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function ActionButton({ action, tone, icon, big, small, solid, ghost, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
17
19
|
|
|
18
20
|
export { ActionButton, type ActionButtonProps, type ActionKey, type ToneKey };
|
|
@@ -10,9 +10,11 @@ interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement
|
|
|
10
10
|
big?: boolean;
|
|
11
11
|
/** Compact size for actions inside list rows. */
|
|
12
12
|
small?: boolean;
|
|
13
|
+
/** Full-strength gradient for the one primary action on a surface. */
|
|
14
|
+
solid?: boolean;
|
|
13
15
|
ghost?: boolean;
|
|
14
16
|
helpContent?: string;
|
|
15
17
|
}
|
|
16
|
-
declare function ActionButton({ action, tone, icon, big, small, ghost, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function ActionButton({ action, tone, icon, big, small, solid, ghost, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
|
|
17
19
|
|
|
18
20
|
export { ActionButton, type ActionButtonProps, type ActionKey, type ToneKey };
|
|
@@ -9,6 +9,7 @@ function ActionButton({
|
|
|
9
9
|
icon,
|
|
10
10
|
big,
|
|
11
11
|
small,
|
|
12
|
+
solid,
|
|
12
13
|
ghost,
|
|
13
14
|
helpContent,
|
|
14
15
|
disabled,
|
|
@@ -48,13 +49,14 @@ function ActionButton({
|
|
|
48
49
|
disabled,
|
|
49
50
|
className: cn(
|
|
50
51
|
"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap",
|
|
51
|
-
"text-
|
|
52
|
+
solid ? "text-white" : "text-foreground",
|
|
53
|
+
"border-none transition-[filter] hover:brightness-110 disabled:opacity-40 disabled:pointer-events-none",
|
|
52
54
|
sizeClass,
|
|
53
55
|
className
|
|
54
56
|
),
|
|
55
|
-
style: { backgroundImage: `linear-gradient(115deg, ${brandTint(from, 0.28)}, ${brandTint(to, 0.16)})`, ...style },
|
|
57
|
+
style: { backgroundImage: `linear-gradient(115deg, ${brandTint(from, solid ? 1 : 0.28)}, ${brandTint(to, solid ? 1 : 0.16)})`, ...style },
|
|
56
58
|
children: [
|
|
57
|
-
icon && /* @__PURE__ */ jsx("span", { className: "inline-flex", style: { color: fg }, children: icon }),
|
|
59
|
+
icon && /* @__PURE__ */ jsx("span", { className: "inline-flex", style: solid ? void 0 : { color: fg }, children: icon }),
|
|
58
60
|
children,
|
|
59
61
|
helpContent ? /* @__PURE__ */ jsx(HelpIcon, { content: helpContent }) : null
|
|
60
62
|
]
|
|
@@ -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\";\nimport { ACTION_FOREGROUNDS, ACTION_PAIRS, TONE_FOREGROUNDS, TONE_PAIRS, brandTint } from \"../data/brand.js\";\n\nexport type ActionKey = keyof typeof ACTION_PAIRS;\nexport type ToneKey = keyof typeof TONE_PAIRS;\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 /** Compact size for actions inside list rows. */\n small?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n small,\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 : small\n ? \"h-9 px-3 rounded-xl text-xs\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <button\n {...rest}\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 </button>\n );\n }\n\n const [from, to] =\n action ? ACTION_PAIRS[action] :\n tone ? TONE_PAIRS[tone] :\n ACTION_PAIRS.buy;\n\n const fg =\n action ? ACTION_FOREGROUNDS[action] :\n tone ? TONE_FOREGROUNDS[tone] :\n ACTION_FOREGROUNDS.buy;\n\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"text-foreground
|
|
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\";\nimport { ACTION_FOREGROUNDS, ACTION_PAIRS, TONE_FOREGROUNDS, TONE_PAIRS, brandTint } from \"../data/brand.js\";\n\nexport type ActionKey = keyof typeof ACTION_PAIRS;\nexport type ToneKey = keyof typeof TONE_PAIRS;\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 /** Compact size for actions inside list rows. */\n small?: boolean;\n\n /** Full-strength gradient for the one primary action on a surface. */\n solid?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n small,\n solid,\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 : small\n ? \"h-9 px-3 rounded-xl text-xs\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <button\n {...rest}\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 </button>\n );\n }\n\n const [from, to] =\n action ? ACTION_PAIRS[action] :\n tone ? TONE_PAIRS[tone] :\n ACTION_PAIRS.buy;\n\n const fg =\n action ? ACTION_FOREGROUNDS[action] :\n tone ? TONE_FOREGROUNDS[tone] :\n ACTION_FOREGROUNDS.buy;\n\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n solid ? \"text-white\" : \"text-foreground\",\n \"border-none transition-[filter] hover:brightness-110 disabled:opacity-40 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={{ backgroundImage: `linear-gradient(115deg, ${brandTint(from, solid ? 1 : 0.28)}, ${brandTint(to, solid ? 1 : 0.16)})`, ...style }}\n >\n {icon && <span className=\"inline-flex\" style={solid ? undefined : { color: fg }}>{icon}</span>}\n {children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </button>\n );\n}\n"],"mappings":";AAoDM,SAYiB,KAZjB;AAlDN,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB,SAAS,oBAAoB,cAAc,kBAAkB,YAAY,iBAAiB;AAyBnF,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;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,YAAY,MACd,2CACA,QACA,gCACA;AAEJ,MAAI,OAAO;AACT,WACE;AAAA,MAAC;AAAA;AAAA,QACE,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,CAAC,MAAM,EAAE,IACb,SAAS,aAAa,MAAM,IAC5B,OAAS,WAAW,IAAI,IACxB,aAAa;AAEf,QAAM,KACJ,SAAS,mBAAmB,MAAM,IAClC,OAAS,iBAAiB,IAAI,IAC9B,mBAAmB;AAErB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,QAAQ,eAAe;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,iBAAiB,2BAA2B,UAAU,MAAM,QAAQ,IAAI,IAAI,CAAC,KAAK,UAAU,IAAI,QAAQ,IAAI,IAAI,CAAC,KAAK,GAAG,MAAM;AAAA,MAEvI;AAAA,gBAAQ,oBAAC,UAAK,WAAU,eAAc,OAAO,QAAQ,SAAY,EAAE,OAAO,GAAG,GAAI,gBAAK;AAAA,QACtF;AAAA,QACA,cAAc,oBAAC,YAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,EACtD;AAEJ;","names":[]}
|
|
@@ -104,7 +104,7 @@ function AssetMarketplacePanel({
|
|
|
104
104
|
}
|
|
105
105
|
) : null;
|
|
106
106
|
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: t("Make offer") });
|
|
107
|
-
const buyButton = liveCheapest && (!isOwner || canBuyMore) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: t("Buy now") }) : null;
|
|
107
|
+
const buyButton = liveCheapest && (!isOwner || canBuyMore) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { solid: true, action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: t("Buy now") }) : null;
|
|
108
108
|
const listedPrice = !isOwner && liveCheapest ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PriceBlock, { order: liveCheapest, usdValue }) : null;
|
|
109
109
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative space-y-4", children: [
|
|
110
110
|
isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n Tag, X,\n} from \"lucide-react\";\nimport { PriceDisplay } from \"./price-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { AssetAccessButtons, CompanionAppButton } from \"./asset-access-cards.js\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel } from \"./panel.js\";\n\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n asset: AssetRef;\n compact?: boolean;\n cheapest?: T;\n isOwner: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n\n}\n\nfunction ActionRow({ children }: { children: ReactNode }) {\n const odd = Children.toArray(children).length % 2 === 1;\n return <div className={cn(\"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:[&>*]:min-w-36\", odd && \"[&>*:first-child]:col-span-2\")}>{children}</div>;\n}\n\nfunction PriceBlock({ order, usdValue }: { order: ApiOrderLike; usdValue?: string | null }) {\n return (\n <PriceDisplay\n amountFormatted={order.price.formatted}\n currency={order.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={<HelpIcon content={`Expires ${timeUntil(order.endTime)}`} />}\n />\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n asset,\n compact = false,\n cheapest,\n isOwner,\n isProcessing,\n isERC1155,\n canListMoreEditions,\n isMarketLoading = false,\n myListing,\n activeBids,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n usdValue,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const isSignedIn = !!walletAddress;\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n const remixButton = remixEnabled && onOpenRemix ? (\n <ActionButton\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n >\n {t(\"Remix\")}\n </ActionButton>\n ) : null;\n\n const offerButton = (\n <ActionButton action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer}>\n {t(\"Make offer\")}\n </ActionButton>\n );\n\n const buyButton = liveCheapest && (!isOwner || canBuyMore) ? (\n <ActionButton action=\"buy\" onClick={() => onOpenPurchase(liveCheapest)}>\n {t(\"Buy now\")}\n </ActionButton>\n ) : null;\n\n const listedPrice = !isOwner && liveCheapest ? <PriceBlock order={liveCheapest} usdValue={usdValue} /> : null;\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {isOwner ? (\n <div className=\"space-y-4\">\n {liveMyListing ? (\n <PriceBlock\n order={liveMyListing}\n usdValue={liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null}\n />\n ) : null}\n <ActionRow>\n {liveMyListing ? (\n <ActionButton\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n helpContent={`Expires ${timeUntil(liveMyListing.endTime)}`}\n >\n {t(\"Cancel listing\")}\n </ActionButton>\n ) : null}\n {!liveMyListing || (isERC1155 && canListMoreEditions !== false) ? (\n <ActionButton tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing}>\n {liveMyListing ? t(\"Sell more\") : t(\"Sell\")}\n </ActionButton>\n ) : null}\n <ActionButton tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer}>{t(\"Transfer\")}</ActionButton>\n {remixButton}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n >\n {t(\"Open for sponsorship\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n {buyButton && liveCheapest ? (\n <div className=\"space-y-4\">\n <PriceBlock order={liveCheapest} usdValue={usdValue} />\n <ActionRow>{buyButton}</ActionRow>\n </div>\n ) : null}\n </div>\n ) : (\n <div className=\"space-y-4\">\n {listedPrice}\n {isSignedIn ? (\n <ActionRow>\n {buyButton}\n {offerButton}\n {remixButton}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n action=\"license\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n >\n {t(\"License\")}\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n >\n {t(\"Sponsor\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n ) : (\n <AssetAccessButtons asset={asset} stacked={compact} />\n )}\n </div>\n )}\n\n {myBid ? (\n <Panel tone={[\"orange\", \"rose\"]} className=\"px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-brand-orange shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-brand-orange\">{t(\"Your active offer\")}</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <PriceDisplay amountFormatted={myBid.price.formatted} currency={myBid.price.currency} scale=\"row\" />\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-brand-rose hover:opacity-80 transition-opacity flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n {t(\"Cancel\")}\n </button>\n </Panel>\n ) : null}\n\n {isOwner && liveBids.length > 0 ? (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">{t(\"Incoming offers ({count})\", { count: liveBids.length })}</p>\n <div className=\"divide-y divide-border/40\">\n {liveBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <PriceDisplay amountFormatted={bid.price.formatted} currency={bid.price.currency} scale=\"row\" />\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <ActionButton small action=\"buy\" icon={<CheckCircle className=\"h-3.5 w-3.5\" />} disabled={isProcessing} onClick={() => onAcceptBid(bid)}>\n {t(\"Accept\")}\n </ActionButton>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n\n {isSignedIn ? <CompanionAppButton asset={asset} variant=\"link\" /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DS;AA5DT,mBAAyC;AACzC,0BAGO;AACP,2BAA6B;AAC7B,6BAA+B;AAC/B,2BAA6B;AAC7B,k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OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,YAC3G,4CAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,YACjD,6CAAC,SAAI,WAAU,yDACb;AAAA,0DAAC,6BAAM,WAAU,WAAU;AAAA,kBAC1B,uBAAU,IAAI,OAAO;AAAA,eACxB;AAAA,aACF;AAAA,WACF;AAAA,QACA,4CAAC,qCAAa,OAAK,MAAC,QAAO,OAAM,MAAM,4CAAC,mCAAY,WAAU,eAAc,GAAI,UAAU,cAAc,SAAS,MAAM,YAAY,GAAG,GACnI,YAAE,QAAQ,GACb;AAAA,WAhBQ,IAAI,SAiBd,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,aAAa,4CAAC,gDAAmB,OAAc,SAAQ,QAAO,IAAK;AAAA,KACtE,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n Tag, X,\n} from \"lucide-react\";\nimport { PriceDisplay } from \"./price-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { AssetAccessButtons, CompanionAppButton } from \"./asset-access-cards.js\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel } from \"./panel.js\";\n\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n asset: AssetRef;\n compact?: boolean;\n cheapest?: T;\n isOwner: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n\n}\n\nfunction ActionRow({ children }: { children: ReactNode }) {\n const odd = Children.toArray(children).length % 2 === 1;\n return <div className={cn(\"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:[&>*]:min-w-36\", odd && \"[&>*:first-child]:col-span-2\")}>{children}</div>;\n}\n\nfunction PriceBlock({ order, usdValue }: { order: ApiOrderLike; usdValue?: string | null }) {\n return (\n <PriceDisplay\n amountFormatted={order.price.formatted}\n currency={order.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={<HelpIcon content={`Expires ${timeUntil(order.endTime)}`} />}\n />\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n asset,\n compact = false,\n cheapest,\n isOwner,\n isProcessing,\n isERC1155,\n canListMoreEditions,\n isMarketLoading = false,\n myListing,\n activeBids,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n usdValue,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const isSignedIn = !!walletAddress;\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n const remixButton = remixEnabled && onOpenRemix ? (\n <ActionButton\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n >\n {t(\"Remix\")}\n </ActionButton>\n ) : null;\n\n const offerButton = (\n <ActionButton action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer}>\n {t(\"Make offer\")}\n </ActionButton>\n );\n\n const buyButton = liveCheapest && (!isOwner || canBuyMore) ? (\n <ActionButton solid action=\"buy\" onClick={() => onOpenPurchase(liveCheapest)}>\n {t(\"Buy now\")}\n </ActionButton>\n ) : null;\n\n const listedPrice = !isOwner && liveCheapest ? <PriceBlock order={liveCheapest} usdValue={usdValue} /> : null;\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {isOwner ? (\n <div className=\"space-y-4\">\n {liveMyListing ? (\n <PriceBlock\n order={liveMyListing}\n usdValue={liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null}\n />\n ) : null}\n <ActionRow>\n {liveMyListing ? (\n <ActionButton\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n helpContent={`Expires ${timeUntil(liveMyListing.endTime)}`}\n >\n {t(\"Cancel listing\")}\n </ActionButton>\n ) : null}\n {!liveMyListing || (isERC1155 && canListMoreEditions !== false) ? (\n <ActionButton tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing}>\n {liveMyListing ? t(\"Sell more\") : t(\"Sell\")}\n </ActionButton>\n ) : null}\n <ActionButton tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer}>{t(\"Transfer\")}</ActionButton>\n {remixButton}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n >\n {t(\"Open for sponsorship\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n {buyButton && liveCheapest ? (\n <div className=\"space-y-4\">\n <PriceBlock order={liveCheapest} usdValue={usdValue} />\n <ActionRow>{buyButton}</ActionRow>\n </div>\n ) : null}\n </div>\n ) : (\n <div className=\"space-y-4\">\n {listedPrice}\n {isSignedIn ? (\n <ActionRow>\n {buyButton}\n {offerButton}\n {remixButton}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n action=\"license\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n >\n {t(\"License\")}\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n >\n {t(\"Sponsor\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n ) : (\n <AssetAccessButtons asset={asset} stacked={compact} />\n )}\n </div>\n )}\n\n {myBid ? (\n <Panel tone={[\"orange\", \"rose\"]} className=\"px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-brand-orange shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-brand-orange\">{t(\"Your active offer\")}</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <PriceDisplay amountFormatted={myBid.price.formatted} currency={myBid.price.currency} scale=\"row\" />\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-brand-rose hover:opacity-80 transition-opacity flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n {t(\"Cancel\")}\n </button>\n </Panel>\n ) : null}\n\n {isOwner && liveBids.length > 0 ? (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">{t(\"Incoming offers ({count})\", { count: liveBids.length })}</p>\n <div className=\"divide-y divide-border/40\">\n {liveBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <PriceDisplay amountFormatted={bid.price.formatted} currency={bid.price.currency} scale=\"row\" />\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <ActionButton small action=\"buy\" icon={<CheckCircle className=\"h-3.5 w-3.5\" />} disabled={isProcessing} onClick={() => onAcceptBid(bid)}>\n {t(\"Accept\")}\n </ActionButton>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n\n {isSignedIn ? <CompanionAppButton asset={asset} variant=\"link\" /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;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AAiB,IAAI,MAAM,WAAW,UAAU,IAAI,MAAM,UAAU,OAAM,OAAM,GAChG;AAAA,UACA,6CAAC,SAAI,WAAU,kCACb;AAAA,wDAAC,yCAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,YAC3G,4CAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,YACjD,6CAAC,SAAI,WAAU,yDACb;AAAA,0DAAC,6BAAM,WAAU,WAAU;AAAA,kBAC1B,uBAAU,IAAI,OAAO;AAAA,eACxB;AAAA,aACF;AAAA,WACF;AAAA,QACA,4CAAC,qCAAa,OAAK,MAAC,QAAO,OAAM,MAAM,4CAAC,mCAAY,WAAU,eAAc,GAAI,UAAU,cAAc,SAAS,MAAM,YAAY,GAAG,GACnI,YAAE,QAAQ,GACb;AAAA,WAhBQ,IAAI,SAiBd,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,aAAa,4CAAC,gDAAmB,OAAc,SAAQ,QAAO,IAAK;AAAA,KACtE,GACF;AAEJ;","names":[]}
|
|
@@ -91,7 +91,7 @@ function AssetMarketplacePanel({
|
|
|
91
91
|
}
|
|
92
92
|
) : null;
|
|
93
93
|
const offerButton = /* @__PURE__ */ jsx(ActionButton, { action: "offer", icon: /* @__PURE__ */ jsx(HandCoins, { className: "h-4 w-4" }), onClick: onOpenOffer, children: t("Make offer") });
|
|
94
|
-
const buyButton = liveCheapest && (!isOwner || canBuyMore) ? /* @__PURE__ */ jsx(ActionButton, { action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: t("Buy now") }) : null;
|
|
94
|
+
const buyButton = liveCheapest && (!isOwner || canBuyMore) ? /* @__PURE__ */ jsx(ActionButton, { solid: true, action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: t("Buy now") }) : null;
|
|
95
95
|
const listedPrice = !isOwner && liveCheapest ? /* @__PURE__ */ jsx(PriceBlock, { order: liveCheapest, usdValue }) : null;
|
|
96
96
|
return /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsxs("div", { className: "relative space-y-4", children: [
|
|
97
97
|
isOwner ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n Tag, X,\n} from \"lucide-react\";\nimport { PriceDisplay } from \"./price-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { AssetAccessButtons, CompanionAppButton } from \"./asset-access-cards.js\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel } from \"./panel.js\";\n\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n asset: AssetRef;\n compact?: boolean;\n cheapest?: T;\n isOwner: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n\n}\n\nfunction ActionRow({ children }: { children: ReactNode }) {\n const odd = Children.toArray(children).length % 2 === 1;\n return <div className={cn(\"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:[&>*]:min-w-36\", odd && \"[&>*:first-child]:col-span-2\")}>{children}</div>;\n}\n\nfunction PriceBlock({ order, usdValue }: { order: ApiOrderLike; usdValue?: string | null }) {\n return (\n <PriceDisplay\n amountFormatted={order.price.formatted}\n currency={order.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={<HelpIcon content={`Expires ${timeUntil(order.endTime)}`} />}\n />\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n asset,\n compact = false,\n cheapest,\n isOwner,\n isProcessing,\n isERC1155,\n canListMoreEditions,\n isMarketLoading = false,\n myListing,\n activeBids,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n usdValue,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const isSignedIn = !!walletAddress;\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n const remixButton = remixEnabled && onOpenRemix ? (\n <ActionButton\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n >\n {t(\"Remix\")}\n </ActionButton>\n ) : null;\n\n const offerButton = (\n <ActionButton action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer}>\n {t(\"Make offer\")}\n </ActionButton>\n );\n\n const buyButton = liveCheapest && (!isOwner || canBuyMore) ? (\n <ActionButton action=\"buy\" onClick={() => onOpenPurchase(liveCheapest)}>\n {t(\"Buy now\")}\n </ActionButton>\n ) : null;\n\n const listedPrice = !isOwner && liveCheapest ? <PriceBlock order={liveCheapest} usdValue={usdValue} /> : null;\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {isOwner ? (\n <div className=\"space-y-4\">\n {liveMyListing ? (\n <PriceBlock\n order={liveMyListing}\n usdValue={liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null}\n />\n ) : null}\n <ActionRow>\n {liveMyListing ? (\n <ActionButton\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n helpContent={`Expires ${timeUntil(liveMyListing.endTime)}`}\n >\n {t(\"Cancel listing\")}\n </ActionButton>\n ) : null}\n {!liveMyListing || (isERC1155 && canListMoreEditions !== false) ? (\n <ActionButton tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing}>\n {liveMyListing ? t(\"Sell more\") : t(\"Sell\")}\n </ActionButton>\n ) : null}\n <ActionButton tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer}>{t(\"Transfer\")}</ActionButton>\n {remixButton}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n >\n {t(\"Open for sponsorship\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n {buyButton && liveCheapest ? (\n <div className=\"space-y-4\">\n <PriceBlock order={liveCheapest} usdValue={usdValue} />\n <ActionRow>{buyButton}</ActionRow>\n </div>\n ) : null}\n </div>\n ) : (\n <div className=\"space-y-4\">\n {listedPrice}\n {isSignedIn ? (\n <ActionRow>\n {buyButton}\n {offerButton}\n {remixButton}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n action=\"license\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n >\n {t(\"License\")}\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n >\n {t(\"Sponsor\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n ) : (\n <AssetAccessButtons asset={asset} stacked={compact} />\n )}\n </div>\n )}\n\n {myBid ? (\n <Panel tone={[\"orange\", \"rose\"]} className=\"px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-brand-orange shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-brand-orange\">{t(\"Your active offer\")}</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <PriceDisplay amountFormatted={myBid.price.formatted} currency={myBid.price.currency} scale=\"row\" />\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-brand-rose hover:opacity-80 transition-opacity flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n {t(\"Cancel\")}\n </button>\n </Panel>\n ) : null}\n\n {isOwner && liveBids.length > 0 ? (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">{t(\"Incoming offers ({count})\", { count: liveBids.length })}</p>\n <div className=\"divide-y divide-border/40\">\n {liveBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <PriceDisplay amountFormatted={bid.price.formatted} currency={bid.price.currency} scale=\"row\" />\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <ActionButton small action=\"buy\" icon={<CheckCircle className=\"h-3.5 w-3.5\" />} disabled={isProcessing} onClick={() => onAcceptBid(bid)}>\n {t(\"Accept\")}\n </ActionButton>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n\n {isSignedIn ? <CompanionAppButton asset={asset} variant=\"link\" /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";AA8DS,cA2DH,YA3DG;AA5DT,SAAS,gBAAgC;AACzC;AAAA,EACE;AAAA,EAAgB;AAAA,EAAa;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EACrE;AAAA,EAAK;AAAA,OACA;AACP,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,WAAW,iBAAiB;AACrC,SAAS,qBAAqB;AAC9B,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB,SAAS,oBAAoB,0BAA0B;AACvD,SAAS,uBAAsC;AAC/C,SAAS,YAAY;AACrB,S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,kCAAC,SAAM,WAAU,WAAU;AAAA,cAC1B,UAAU,IAAI,OAAO;AAAA,eACxB;AAAA,aACF;AAAA,WACF;AAAA,QACA,oBAAC,gBAAa,OAAK,MAAC,QAAO,OAAM,MAAM,oBAAC,eAAY,WAAU,eAAc,GAAI,UAAU,cAAc,SAAS,MAAM,YAAY,GAAG,GACnI,YAAE,QAAQ,GACb;AAAA,WAhBQ,IAAI,SAiBd,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,aAAa,oBAAC,sBAAmB,OAAc,SAAQ,QAAO,IAAK;AAAA,KACtE,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n Tag, X,\n} from \"lucide-react\";\nimport { PriceDisplay } from \"./price-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { AssetAccessButtons, CompanionAppButton } from \"./asset-access-cards.js\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel } from \"./panel.js\";\n\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n asset: AssetRef;\n compact?: boolean;\n cheapest?: T;\n isOwner: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n\n}\n\nfunction ActionRow({ children }: { children: ReactNode }) {\n const odd = Children.toArray(children).length % 2 === 1;\n return <div className={cn(\"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:[&>*]:min-w-36\", odd && \"[&>*:first-child]:col-span-2\")}>{children}</div>;\n}\n\nfunction PriceBlock({ order, usdValue }: { order: ApiOrderLike; usdValue?: string | null }) {\n return (\n <PriceDisplay\n amountFormatted={order.price.formatted}\n currency={order.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={<HelpIcon content={`Expires ${timeUntil(order.endTime)}`} />}\n />\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n asset,\n compact = false,\n cheapest,\n isOwner,\n isProcessing,\n isERC1155,\n canListMoreEditions,\n isMarketLoading = false,\n myListing,\n activeBids,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n usdValue,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const isSignedIn = !!walletAddress;\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n const remixButton = remixEnabled && onOpenRemix ? (\n <ActionButton\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n >\n {t(\"Remix\")}\n </ActionButton>\n ) : null;\n\n const offerButton = (\n <ActionButton action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer}>\n {t(\"Make offer\")}\n </ActionButton>\n );\n\n const buyButton = liveCheapest && (!isOwner || canBuyMore) ? (\n <ActionButton solid action=\"buy\" onClick={() => onOpenPurchase(liveCheapest)}>\n {t(\"Buy now\")}\n </ActionButton>\n ) : null;\n\n const listedPrice = !isOwner && liveCheapest ? <PriceBlock order={liveCheapest} usdValue={usdValue} /> : null;\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {isOwner ? (\n <div className=\"space-y-4\">\n {liveMyListing ? (\n <PriceBlock\n order={liveMyListing}\n usdValue={liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null}\n />\n ) : null}\n <ActionRow>\n {liveMyListing ? (\n <ActionButton\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n helpContent={`Expires ${timeUntil(liveMyListing.endTime)}`}\n >\n {t(\"Cancel listing\")}\n </ActionButton>\n ) : null}\n {!liveMyListing || (isERC1155 && canListMoreEditions !== false) ? (\n <ActionButton tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing}>\n {liveMyListing ? t(\"Sell more\") : t(\"Sell\")}\n </ActionButton>\n ) : null}\n <ActionButton tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer}>{t(\"Transfer\")}</ActionButton>\n {remixButton}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n >\n {t(\"Open for sponsorship\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n {buyButton && liveCheapest ? (\n <div className=\"space-y-4\">\n <PriceBlock order={liveCheapest} usdValue={usdValue} />\n <ActionRow>{buyButton}</ActionRow>\n </div>\n ) : null}\n </div>\n ) : (\n <div className=\"space-y-4\">\n {listedPrice}\n {isSignedIn ? (\n <ActionRow>\n {buyButton}\n {offerButton}\n {remixButton}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n action=\"license\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n >\n {t(\"License\")}\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n >\n {t(\"Sponsor\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n ) : (\n <AssetAccessButtons asset={asset} stacked={compact} />\n )}\n </div>\n )}\n\n {myBid ? (\n <Panel tone={[\"orange\", \"rose\"]} className=\"px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-brand-orange shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-brand-orange\">{t(\"Your active offer\")}</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <PriceDisplay amountFormatted={myBid.price.formatted} currency={myBid.price.currency} scale=\"row\" />\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-brand-rose hover:opacity-80 transition-opacity flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n {t(\"Cancel\")}\n </button>\n </Panel>\n ) : null}\n\n {isOwner && liveBids.length > 0 ? (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">{t(\"Incoming offers ({count})\", { count: liveBids.length })}</p>\n <div className=\"divide-y divide-border/40\">\n {liveBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <PriceDisplay amountFormatted={bid.price.formatted} currency={bid.price.currency} scale=\"row\" />\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <ActionButton small action=\"buy\" icon={<CheckCircle className=\"h-3.5 w-3.5\" />} disabled={isProcessing} onClick={() => onAcceptBid(bid)}>\n {t(\"Accept\")}\n </ActionButton>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n\n {isSignedIn ? <CompanionAppButton asset={asset} variant=\"link\" /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";AA8DS,cA2DH,YA3DG;AA5DT,SAAS,gBAAgC;AACzC;AAAA,EACE;AAAA,EAAgB;AAAA,EAAa;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EACrE;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AI,MAAM,WAAW,UAAU,IAAI,MAAM,UAAU,OAAM,OAAM,GAChG;AAAA,UACA,qBAAC,SAAI,WAAU,kCACb;AAAA,gCAAC,kBAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,YAC3G,oBAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,YACjD,qBAAC,SAAI,WAAU,yDACb;AAAA,kCAAC,SAAM,WAAU,WAAU;AAAA,cAC1B,UAAU,IAAI,OAAO;AAAA,eACxB;AAAA,aACF;AAAA,WACF;AAAA,QACA,oBAAC,gBAAa,OAAK,MAAC,QAAO,OAAM,MAAM,oBAAC,eAAY,WAAU,eAAc,GAAI,UAAU,cAAc,SAAS,MAAM,YAAY,GAAG,GACnI,YAAE,QAAQ,GACb;AAAA,WAhBQ,IAAI,SAiBd,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,aAAa,oBAAC,sBAAmB,OAAc,SAAQ,QAAO,IAAK;AAAA,KACtE,GACF;AAEJ;","names":[]}
|
|
@@ -31,7 +31,7 @@ const badgeVariants = (0, import_class_variance_authority.cva)(
|
|
|
31
31
|
variants: {
|
|
32
32
|
variant: {
|
|
33
33
|
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
34
|
-
secondary: "border-transparent bg-secondary text-secondary
|
|
34
|
+
secondary: "border-transparent bg-secondary/15 text-secondary hover:bg-secondary/25",
|
|
35
35
|
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
36
36
|
outline: "text-foreground"
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/badge.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils/cn.js\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary: \"border-transparent bg-secondary text-secondary
|
|
1
|
+
{"version":3,"sources":["../../src/components/badge.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils/cn.js\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary: \"border-transparent bg-secondary/15 text-secondary hover:bg-secondary/25\",\n destructive: \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\n outline: \"text-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return <div className={cn(badgeVariants({ variant }), className)} {...props} />;\n}\n\nexport { Badge, badgeVariants };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BS;AAzBT,sCAAuC;AACvC,gBAAmB;AAEnB,MAAM,oBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,WAAW;AAAA,QACX,aAAa;AAAA,QACb,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAMA,SAAS,MAAM,EAAE,WAAW,SAAS,GAAG,MAAM,GAAe;AAC3D,SAAO,4CAAC,SAAI,eAAW,cAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS,GAAI,GAAG,OAAO;AAC/E;","names":[]}
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "default" | "
|
|
7
|
+
variant?: "default" | "secondary" | "outline" | "destructive" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
10
10
|
}
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "default" | "
|
|
7
|
+
variant?: "default" | "secondary" | "outline" | "destructive" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
10
10
|
}
|
package/dist/components/badge.js
CHANGED
|
@@ -7,7 +7,7 @@ const badgeVariants = cva(
|
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
9
|
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
10
|
-
secondary: "border-transparent bg-secondary text-secondary
|
|
10
|
+
secondary: "border-transparent bg-secondary/15 text-secondary hover:bg-secondary/25",
|
|
11
11
|
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
12
12
|
outline: "text-foreground"
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/badge.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils/cn.js\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary: \"border-transparent bg-secondary text-secondary
|
|
1
|
+
{"version":3,"sources":["../../src/components/badge.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils/cn.js\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary: \"border-transparent bg-secondary/15 text-secondary hover:bg-secondary/25\",\n destructive: \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\n outline: \"text-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return <div className={cn(badgeVariants({ variant }), className)} {...props} />;\n}\n\nexport { Badge, badgeVariants };\n"],"mappings":"AA0BS;AAzBT,SAAS,WAA8B;AACvC,SAAS,UAAU;AAEnB,MAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,WAAW;AAAA,QACX,aAAa;AAAA,QACb,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAMA,SAAS,MAAM,EAAE,WAAW,SAAS,GAAG,MAAM,GAAe;AAC3D,SAAO,oBAAC,SAAI,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS,GAAI,GAAG,OAAO;AAC/E;","names":[]}
|
|
@@ -45,7 +45,7 @@ const buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
45
45
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
46
46
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
47
47
|
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
48
|
-
secondary: "bg-secondary text-secondary
|
|
48
|
+
secondary: "bg-secondary/15 text-secondary hover:bg-secondary/25",
|
|
49
49
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
50
50
|
link: "text-primary underline-offset-4 hover:underline",
|
|
51
51
|
premium: "bg-gradient-to-r from-primary to-primary/80 text-primary-foreground hover:from-primary/90 hover:to-primary/70 shadow-md",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../utils/cn.js\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary
|
|
1
|
+
{"version":3,"sources":["../../src/components/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../utils/cn.js\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary/15 text-secondary hover:bg-secondary/25\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n premium: \"bg-gradient-to-r from-primary to-primary/80 text-primary-foreground hover:from-primary/90 hover:to-primary/70 shadow-md\",\n tonal: \"bg-primary/10 text-primary hover:bg-primary/20\",\n \"gradient-border\": \"border border-border bg-transparent hover:bg-accent/50 text-foreground\",\n \"gradient-fill\": \"border border-border bg-transparent hover:bg-accent/50 text-foreground\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n }\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiDM;AAjDN,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AAEvC,gBAAmB;AAEnB,MAAM,qBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,OAAO;AAAA,QACP,mBAAmB;AAAA,QACnB,iBAAiB;AAAA,MACnB;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,MAAM,SAAS,MAAM;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,yBAAO;AAC9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,cAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,QAC1D;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;","names":[]}
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "default" | "secondary" | "outline" | "link" | "destructive" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
7
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "default" | "secondary" | "outline" | "link" | "destructive" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
7
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -11,7 +11,7 @@ const buttonVariants = cva(
|
|
|
11
11
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
12
12
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
13
13
|
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
14
|
-
secondary: "bg-secondary text-secondary
|
|
14
|
+
secondary: "bg-secondary/15 text-secondary hover:bg-secondary/25",
|
|
15
15
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
16
16
|
link: "text-primary underline-offset-4 hover:underline",
|
|
17
17
|
premium: "bg-gradient-to-r from-primary to-primary/80 text-primary-foreground hover:from-primary/90 hover:to-primary/70 shadow-md",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../utils/cn.js\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary
|
|
1
|
+
{"version":3,"sources":["../../src/components/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../utils/cn.js\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary/15 text-secondary hover:bg-secondary/25\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n premium: \"bg-gradient-to-r from-primary to-primary/80 text-primary-foreground hover:from-primary/90 hover:to-primary/70 shadow-md\",\n tonal: \"bg-primary/10 text-primary hover:bg-primary/20\",\n \"gradient-border\": \"border border-border bg-transparent hover:bg-accent/50 text-foreground\",\n \"gradient-fill\": \"border border-border bg-transparent hover:bg-accent/50 text-foreground\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n }\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n"],"mappings":"AAiDM;AAjDN,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AAEvC,SAAS,UAAU;AAEnB,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,OAAO;AAAA,QACP,mBAAmB;AAAA,QACnB,iBAAiB;AAAA,MACnB;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,MAAM,SAAS,MAAM;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,QAC1D;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;","names":[]}
|
|
@@ -19,8 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var discover_feed_section_exports = {};
|
|
21
21
|
__export(discover_feed_section_exports, {
|
|
22
|
-
DiscoverActivityStrip: () => DiscoverActivityStrip
|
|
23
|
-
DiscoverFeedSection: () => DiscoverFeedSection
|
|
22
|
+
DiscoverActivityStrip: () => DiscoverActivityStrip
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(discover_feed_section_exports);
|
|
26
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -28,9 +27,6 @@ var import_lucide_react = require("lucide-react");
|
|
|
28
27
|
var import_section_heading = require("./section-heading.js");
|
|
29
28
|
var import_motion_primitives = require("./motion-primitives.js");
|
|
30
29
|
var import_listing_card = require("./listing-card.js");
|
|
31
|
-
var import_activity_card = require("./activity-card.js");
|
|
32
|
-
var import_time = require("../utils/time.js");
|
|
33
|
-
var import_empty_messages = require("../utils/empty-messages.js");
|
|
34
30
|
var import_provider = require("../i18n/provider.js");
|
|
35
31
|
var import_translate = require("../i18n/translate.js");
|
|
36
32
|
function StripShell({
|
|
@@ -70,54 +66,8 @@ function DiscoverActivityStrip({
|
|
|
70
66
|
}
|
|
71
67
|
) });
|
|
72
68
|
}
|
|
73
|
-
function DiscoverFeedSection({
|
|
74
|
-
orders,
|
|
75
|
-
isLoading,
|
|
76
|
-
activities,
|
|
77
|
-
activitiesLoading,
|
|
78
|
-
lastUpdated,
|
|
79
|
-
marketplaceHref = "/marketplace",
|
|
80
|
-
activitiesHref = "/activities",
|
|
81
|
-
onBuyOrder,
|
|
82
|
-
isOwnOrder
|
|
83
|
-
}) {
|
|
84
|
-
const t = (0, import_provider.useT)();
|
|
85
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-14 sm:space-y-20", children: [
|
|
86
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
-
DiscoverActivityStrip,
|
|
88
|
-
{
|
|
89
|
-
orders,
|
|
90
|
-
isLoading,
|
|
91
|
-
marketplaceHref,
|
|
92
|
-
onBuyOrder,
|
|
93
|
-
isOwnOrder
|
|
94
|
-
}
|
|
95
|
-
),
|
|
96
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { delay: 0.08, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
97
|
-
StripShell,
|
|
98
|
-
{
|
|
99
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Activity, { className: "h-4 w-4" }),
|
|
100
|
-
title: t("Community"),
|
|
101
|
-
subtitle: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
102
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.RefreshCw, { className: "h-2.5 w-2.5" }),
|
|
103
|
-
t("Updated {timeAgo}", { timeAgo: (0, import_time.timeAgo)(lastUpdated) })
|
|
104
|
-
] }),
|
|
105
|
-
href: activitiesHref,
|
|
106
|
-
linkLabel: (0, import_translate.msg)("Activities"),
|
|
107
|
-
children: activitiesLoading ? Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-56 sm:w-64 snap-start shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_card.ActivityCardSkeleton, {}) }, i)) : activities.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-4", children: [
|
|
108
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium", children: t(import_empty_messages.emptyMessages.activity.title) }),
|
|
109
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: t(import_empty_messages.emptyMessages.activity.description) })
|
|
110
|
-
] }) : activities.map((act, i) => {
|
|
111
|
-
const key = act.txHash ? `${act.txHash}-${act.type}-${act.nftTokenId ?? ""}` : `activity-${i}`;
|
|
112
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-56 sm:w-64 snap-start shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_card.ActivityCard, { activity: act }) }, key);
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
) })
|
|
116
|
-
] });
|
|
117
|
-
}
|
|
118
69
|
// Annotate the CommonJS export names for ESM import in node:
|
|
119
70
|
0 && (module.exports = {
|
|
120
|
-
DiscoverActivityStrip
|
|
121
|
-
DiscoverFeedSection
|
|
71
|
+
DiscoverActivityStrip
|
|
122
72
|
});
|
|
123
73
|
//# sourceMappingURL=discover-feed-section.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/discover-feed-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { Tag
|
|
1
|
+
{"version":3,"sources":["../../src/components/discover-feed-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { Tag } from \"lucide-react\";\nimport { SectionHeading, type SectionHeadingProps } from \"./section-heading.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { ListingCard, ListingCardSkeleton } from \"./listing-card.js\";\nimport type { ApiOrder } from \"@medialane/sdk\";\nimport { useT } from \"../i18n/provider.js\";\n\nimport { msg } from \"../i18n/translate.js\";\nfunction StripShell({\n children,\n ...heading\n}: SectionHeadingProps & { children: React.ReactNode }) {\n return (\n <section className=\"space-y-4\">\n <SectionHeading {...heading} />\n\n <div className=\"w-full overflow-x-auto scrollbar-hide\">\n <div className=\"flex gap-5 sm:gap-6 snap-x snap-mandatory pb-2\" style={{ width: \"max-content\" }}>\n {children}\n </div>\n </div>\n </section>\n );\n}\n\nexport interface DiscoverActivityStripProps {\n orders: ApiOrder[];\n isLoading: boolean;\n marketplaceHref?: string;\n onBuyOrder?: (order: ApiOrder) => void;\n isOwnOrder?: (order: ApiOrder) => boolean;\n}\n\nexport function DiscoverActivityStrip({\n orders,\n isLoading,\n marketplaceHref = \"/marketplace\",\n onBuyOrder,\n isOwnOrder,\n}: DiscoverActivityStripProps) {\n const t = useT();\n return (\n <FadeIn>\n <StripShell\n icon={<Tag className=\"h-4 w-4\" />}\n title={t(\"Activity\")}\n href={marketplaceHref}\n linkLabel={msg(\"View all\")}\n >\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <ListingCardSkeleton />\n </div>\n ))\n : orders.length === 0\n ? (\n <p className=\"text-sm text-muted-foreground py-4\">{t(\"No active listings yet.\")}</p>\n )\n : orders.map((order) => {\n const own = isOwnOrder?.(order) ?? false;\n return (\n <div key={order.orderHash} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <ListingCard\n order={order}\n onBuy={onBuyOrder && !own ? () => onBuyOrder(order) : undefined}\n />\n </div>\n );\n })}\n </StripShell>\n </FadeIn>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeI;AAbJ,0BAAoB;AACpB,6BAAyD;AACzD,+BAAuB;AACvB,0BAAiD;AAEjD,sBAAqB;AAErB,uBAAoB;AACpB,SAAS,WAAW;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAwD;AACtD,SACE,6CAAC,aAAQ,WAAU,aACjB;AAAA,gDAAC,yCAAgB,GAAG,SAAS;AAAA,IAE7B,4CAAC,SAAI,WAAU,yCACb,sDAAC,SAAI,WAAU,kDAAiD,OAAO,EAAE,OAAO,cAAc,GAC3F,UACH,GACF;AAAA,KACF;AAEJ;AAUO,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA;AACF,GAA+B;AAC7B,QAAM,QAAI,sBAAK;AACf,SACE,4CAAC,mCACC;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,4CAAC,2BAAI,WAAU,WAAU;AAAA,MAC/B,OAAO,EAAE,UAAU;AAAA,MACnB,MAAM;AAAA,MACN,eAAW,sBAAI,UAAU;AAAA,MAExB,sBACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAChC,4CAAC,SAAY,WAAU,oCACrB,sDAAC,2CAAoB,KADb,CAEV,CACD,IAC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