@medialane/ui 0.199.0 → 0.200.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/asset-owners-panel.cjs +13 -15
- package/dist/components/asset-owners-panel.cjs.map +1 -1
- package/dist/components/asset-owners-panel.d.cts +2 -4
- package/dist/components/asset-owners-panel.d.ts +2 -4
- package/dist/components/asset-owners-panel.js +13 -15
- package/dist/components/asset-owners-panel.js.map +1 -1
- package/dist/components/asset-top-sections.cjs +70 -103
- package/dist/components/asset-top-sections.cjs.map +1 -1
- package/dist/components/asset-top-sections.d.cts +3 -14
- package/dist/components/asset-top-sections.d.ts +3 -14
- package/dist/components/asset-top-sections.js +69 -101
- 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/expandable-text.cjs +53 -0
- package/dist/components/expandable-text.cjs.map +1 -0
- package/dist/components/expandable-text.d.cts +8 -0
- package/dist/components/expandable-text.d.ts +8 -0
- package/dist/components/expandable-text.js +29 -0
- package/dist/components/expandable-text.js.map +1 -0
- 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/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import { cn } from "../utils/cn.js";
|
|
|
8
8
|
import { AddressDisplay } from "./address-display.js";
|
|
9
9
|
import { ParentAttributionBanner } from "./parent-attribution-banner.js";
|
|
10
10
|
import { IpTypeBadge } from "./ip-type-badge.js";
|
|
11
|
-
import {
|
|
11
|
+
import { ExpandableText } from "./expandable-text.js";
|
|
12
12
|
function AssetMediaColumn({
|
|
13
13
|
shouldReduce,
|
|
14
14
|
image,
|
|
@@ -18,8 +18,7 @@ function AssetMediaColumn({
|
|
|
18
18
|
fallback,
|
|
19
19
|
onZoom,
|
|
20
20
|
animationUrl,
|
|
21
|
-
live = false
|
|
22
|
-
stats
|
|
21
|
+
live = false
|
|
23
22
|
}) {
|
|
24
23
|
const [ref, isVisible] = useIntersectionActive();
|
|
25
24
|
const [loaded, setLoaded] = useState(false);
|
|
@@ -35,96 +34,80 @@ function AssetMediaColumn({
|
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
);
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
),
|
|
103
|
-
stats && stats.length > 0 ? /* @__PURE__ */ jsx("div", { className: `grid gap-3 mt-4 ${stats.length === 2 ? "grid-cols-2" : "grid-cols-1"}`, children: stats.map((stat) => /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-border bg-muted/20 p-4 text-center", children: [
|
|
104
|
-
/* @__PURE__ */ jsx("p", { className: "text-2xl font-black", children: stat.value }),
|
|
105
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-1 text-xs text-muted-foreground mt-1", children: [
|
|
106
|
-
stat.icon,
|
|
107
|
-
stat.label
|
|
108
|
-
] })
|
|
109
|
-
] }, stat.label)) }) : null
|
|
110
|
-
] });
|
|
37
|
+
return /* @__PURE__ */ jsx("div", { ref, className: "w-full lg:sticky lg:top-16", children: showLive ? /* @__PURE__ */ jsx("div", { className: "w-full overflow-hidden rounded-3xl aspect-square", children: /* @__PURE__ */ jsx(
|
|
38
|
+
"iframe",
|
|
39
|
+
{
|
|
40
|
+
src: animationUrl,
|
|
41
|
+
title: imageAlt,
|
|
42
|
+
sandbox: "allow-scripts",
|
|
43
|
+
loading: "lazy",
|
|
44
|
+
className: "w-full h-full border-0"
|
|
45
|
+
}
|
|
46
|
+
) }) : !image || imgError ? /* @__PURE__ */ jsx("div", { className: "w-full overflow-hidden rounded-3xl", children: fallback }) : onZoom ? /* @__PURE__ */ jsxs(
|
|
47
|
+
motion.button,
|
|
48
|
+
{
|
|
49
|
+
type: "button",
|
|
50
|
+
onClick: onZoom,
|
|
51
|
+
"aria-label": "View full image",
|
|
52
|
+
initial: shouldReduce ? false : { opacity: 0, scale: 0.98 },
|
|
53
|
+
animate: { opacity: 1, scale: 1 },
|
|
54
|
+
transition: { duration: 0.5 },
|
|
55
|
+
className: "group relative block w-full overflow-hidden rounded-3xl cursor-zoom-in focus:outline-none",
|
|
56
|
+
children: [
|
|
57
|
+
shimmer,
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
"img",
|
|
60
|
+
{
|
|
61
|
+
src: image,
|
|
62
|
+
alt: imageAlt,
|
|
63
|
+
crossOrigin: "anonymous",
|
|
64
|
+
onLoad: () => setLoaded(true),
|
|
65
|
+
onError: onImageError,
|
|
66
|
+
className: cn(
|
|
67
|
+
"w-full h-auto max-h-[80vh] object-contain",
|
|
68
|
+
"transition-opacity duration-300 group-hover:opacity-95 group-active:scale-[0.99]",
|
|
69
|
+
loaded ? "opacity-100" : "opacity-0"
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
) : /* @__PURE__ */ jsxs(
|
|
76
|
+
motion.div,
|
|
77
|
+
{
|
|
78
|
+
initial: shouldReduce ? false : { opacity: 0, scale: 0.98 },
|
|
79
|
+
animate: { opacity: 1, scale: 1 },
|
|
80
|
+
transition: { duration: 0.5 },
|
|
81
|
+
className: "relative block w-full overflow-hidden rounded-3xl",
|
|
82
|
+
children: [
|
|
83
|
+
shimmer,
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
"img",
|
|
86
|
+
{
|
|
87
|
+
src: image,
|
|
88
|
+
alt: imageAlt,
|
|
89
|
+
crossOrigin: "anonymous",
|
|
90
|
+
onLoad: () => setLoaded(true),
|
|
91
|
+
onError: onImageError,
|
|
92
|
+
className: cn(
|
|
93
|
+
"w-full h-auto max-h-[80vh] object-contain transition-opacity duration-300",
|
|
94
|
+
loaded ? "opacity-100" : "opacity-0"
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
) });
|
|
111
101
|
}
|
|
112
102
|
function AssetHeaderBlock({
|
|
113
103
|
name,
|
|
114
104
|
description,
|
|
115
105
|
ipType,
|
|
116
|
-
showMultiEditionBadge = false,
|
|
117
106
|
parentContract,
|
|
118
107
|
parentTokenId
|
|
119
108
|
}) {
|
|
120
109
|
return /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
121
|
-
ipType
|
|
122
|
-
ipType ? /* @__PURE__ */ jsx(IpTypeBadge, { ipType, size: "md" }) : null,
|
|
123
|
-
showMultiEditionBadge ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-2xs font-semibold px-2.5 py-1 rounded-full border border-violet-500/30 bg-violet-500/10 text-violet-500", children: [
|
|
124
|
-
/* @__PURE__ */ jsx(Layers, { className: "h-3 w-3" }),
|
|
125
|
-
"Multi-edition"
|
|
126
|
-
] }) : null
|
|
127
|
-
] }) : null,
|
|
110
|
+
ipType ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: /* @__PURE__ */ jsx(IpTypeBadge, { ipType, size: "md" }) }) : null,
|
|
128
111
|
parentContract && parentTokenId ? /* @__PURE__ */ jsx("div", { className: "mb-3", children: /* @__PURE__ */ jsx(
|
|
129
112
|
ParentAttributionBanner,
|
|
130
113
|
{
|
|
@@ -134,7 +117,7 @@ function AssetHeaderBlock({
|
|
|
134
117
|
}
|
|
135
118
|
) }) : null,
|
|
136
119
|
/* @__PURE__ */ jsx("h1", { className: "text-2xl lg:text-4xl font-bold break-words", children: name }),
|
|
137
|
-
description ? /* @__PURE__ */ jsx(
|
|
120
|
+
description ? /* @__PURE__ */ jsx(ExpandableText, { text: description, className: "mt-1" }) : null
|
|
138
121
|
] });
|
|
139
122
|
}
|
|
140
123
|
function AssetOwnerRow({ ownerAddress, ownerHref }) {
|
|
@@ -143,24 +126,9 @@ function AssetOwnerRow({ ownerAddress, ownerHref }) {
|
|
|
143
126
|
/* @__PURE__ */ jsx(Link, { href: ownerHref, className: "hover:text-primary transition-colors font-medium", children: /* @__PURE__ */ jsx(AddressDisplay, { address: ownerAddress }) })
|
|
144
127
|
] });
|
|
145
128
|
}
|
|
146
|
-
function buildEditionStats(totalEditions, uniqueOwners) {
|
|
147
|
-
return [
|
|
148
|
-
{
|
|
149
|
-
value: totalEditions.toLocaleString(),
|
|
150
|
-
label: "editions minted",
|
|
151
|
-
icon: /* @__PURE__ */ jsx(Layers, { className: "h-3 w-3" })
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
value: uniqueOwners.toLocaleString(),
|
|
155
|
-
label: "unique owners",
|
|
156
|
-
icon: /* @__PURE__ */ jsx(Users, { className: "h-3 w-3" })
|
|
157
|
-
}
|
|
158
|
-
];
|
|
159
|
-
}
|
|
160
129
|
export {
|
|
161
130
|
AssetHeaderBlock,
|
|
162
131
|
AssetMediaColumn,
|
|
163
|
-
AssetOwnerRow
|
|
164
|
-
buildEditionStats
|
|
132
|
+
AssetOwnerRow
|
|
165
133
|
};
|
|
166
134
|
//# sourceMappingURL=asset-top-sections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-top-sections.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { useEffect, useState } from \"react\";\nimport { motion } from \"framer-motion\";\nimport { useIntersectionActive } from \"../utils/use-intersection-active.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ParentAttributionBanner } from \"./parent-attribution-banner.js\";\nimport { IpTypeBadge } from \"./ip-type-badge.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-top-sections.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { useEffect, useState } from \"react\";\nimport { motion } from \"framer-motion\";\nimport { useIntersectionActive } from \"../utils/use-intersection-active.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ParentAttributionBanner } from \"./parent-attribution-banner.js\";\nimport { IpTypeBadge } from \"./ip-type-badge.js\";\nimport { ExpandableText } from \"./expandable-text.js\";\n\ninterface AssetMediaColumnProps {\n shouldReduce: boolean;\n image: string | null;\n imageAlt: string;\n imgError: boolean;\n onImageError: () => void;\n fallback: React.ReactNode;\n\n onZoom?: () => void;\n\n animationUrl?: string | null;\n\n live?: boolean;\n}\n\nexport function AssetMediaColumn({\n shouldReduce,\n image,\n imageAlt,\n imgError,\n onImageError,\n fallback,\n onZoom,\n animationUrl,\n live = false,\n}: AssetMediaColumnProps) {\n const [ref, isVisible] = useIntersectionActive<HTMLDivElement>();\n const [loaded, setLoaded] = useState(false);\n useEffect(() => setLoaded(false), [image]);\n const showLive = live && !!animationUrl && isVisible;\n\n const shimmer = !loaded && (\n <div\n className=\"absolute inset-0 min-h-80 animate-[shimmer_1.6s_ease-in-out_infinite] bg-foreground/[0.06]\"\n style={{\n backgroundImage:\n \"linear-gradient(90deg, transparent, color-mix(in srgb, var(--foreground) 8%, transparent), transparent)\",\n backgroundSize: \"200% 100%\",\n }}\n />\n );\n\n return (\n <div ref={ref} className=\"w-full lg:sticky lg:top-16\">\n {showLive ? (\n <div className=\"w-full overflow-hidden rounded-3xl aspect-square\">\n <iframe\n src={animationUrl!}\n title={imageAlt}\n sandbox=\"allow-scripts\"\n loading=\"lazy\"\n className=\"w-full h-full border-0\"\n />\n </div>\n ) : !image || imgError ? (\n <div className=\"w-full overflow-hidden rounded-3xl\">{fallback}</div>\n ) : onZoom ? (\n <motion.button\n type=\"button\"\n onClick={onZoom}\n aria-label=\"View full image\"\n initial={shouldReduce ? false : { opacity: 0, scale: 0.98 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={{ duration: 0.5 }}\n className=\"group relative block w-full overflow-hidden rounded-3xl cursor-zoom-in focus:outline-none\"\n >\n {shimmer}\n <img\n src={image}\n alt={imageAlt}\n crossOrigin=\"anonymous\"\n onLoad={() => setLoaded(true)}\n onError={onImageError}\n className={cn(\n \"w-full h-auto max-h-[80vh] object-contain\",\n \"transition-opacity duration-300 group-hover:opacity-95 group-active:scale-[0.99]\",\n loaded ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n </motion.button>\n ) : (\n <motion.div\n initial={shouldReduce ? false : { opacity: 0, scale: 0.98 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={{ duration: 0.5 }}\n className=\"relative block w-full overflow-hidden rounded-3xl\"\n >\n {shimmer}\n <img\n src={image}\n alt={imageAlt}\n crossOrigin=\"anonymous\"\n onLoad={() => setLoaded(true)}\n onError={onImageError}\n className={cn(\n \"w-full h-auto max-h-[80vh] object-contain transition-opacity duration-300\",\n loaded ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n </motion.div>\n )}\n\n </div>\n );\n}\n\ninterface AssetHeaderBlockProps {\n name: string;\n description?: string | null;\n ipType?: string | null;\n parentContract?: string | null;\n parentTokenId?: string | null;\n}\n\nexport function AssetHeaderBlock({\n name,\n description,\n ipType,\n parentContract,\n parentTokenId,\n}: AssetHeaderBlockProps) {\n return (\n <div className=\"min-w-0 flex-1\">\n {ipType ? (\n <div className=\"flex items-center gap-2 flex-wrap mb-2\">\n <IpTypeBadge ipType={ipType} size=\"md\" />\n </div>\n ) : null}\n {parentContract && parentTokenId ? (\n <div className=\"mb-3\">\n <ParentAttributionBanner\n parentContract={parentContract}\n parentTokenId={parentTokenId}\n parentName={`Token #${parentTokenId}`}\n />\n </div>\n ) : null}\n <h1 className=\"text-2xl lg:text-4xl font-bold break-words\">{name}</h1>\n {description ? <ExpandableText text={description} className=\"mt-1\" /> : null}\n </div>\n );\n}\n\nexport interface AssetOwnerRowProps {\n ownerAddress: string;\n ownerHref: string;\n}\n\nexport function AssetOwnerRow({ ownerAddress, ownerHref }: AssetOwnerRowProps) {\n return (\n <div className=\"flex items-center gap-1.5 text-xs text-muted-foreground\">\n <span>Owner</span>\n <Link href={ownerHref} className=\"hover:text-primary transition-colors font-medium\">\n <AddressDisplay address={ownerAddress} />\n </Link>\n </div>\n );\n}\n"],"mappings":"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","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?: "link" | "default" | "destructive" | "outline" | "ghost" | "secondary" | "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?: "link" | "default" | "destructive" | "outline" | "ghost" | "secondary" | "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> {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var expandable_text_exports = {};
|
|
21
|
+
__export(expandable_text_exports, {
|
|
22
|
+
ExpandableText: () => ExpandableText
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(expandable_text_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_cn = require("../utils/cn.js");
|
|
28
|
+
function ExpandableText({ text, className }) {
|
|
29
|
+
const ref = (0, import_react.useRef)(null);
|
|
30
|
+
const [expanded, setExpanded] = (0, import_react.useState)(false);
|
|
31
|
+
const [overflows, setOverflows] = (0, import_react.useState)(false);
|
|
32
|
+
(0, import_react.useEffect)(() => {
|
|
33
|
+
const el = ref.current;
|
|
34
|
+
if (el) setOverflows(el.scrollHeight > el.clientHeight);
|
|
35
|
+
}, [text]);
|
|
36
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className, children: [
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { ref, className: (0, import_cn.cn)("text-sm text-muted-foreground leading-relaxed", !expanded && "line-clamp-3"), children: text }),
|
|
38
|
+
overflows || expanded ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
type: "button",
|
|
42
|
+
onClick: () => setExpanded((e) => !e),
|
|
43
|
+
className: "mt-1 text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline",
|
|
44
|
+
children: expanded ? "Show less" : "Show more"
|
|
45
|
+
}
|
|
46
|
+
) : null
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
ExpandableText
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=expandable-text.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/expandable-text.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { cn } from \"../utils/cn.js\";\n\nexport function ExpandableText({ text, className }: { text: string; className?: string }) {\n const ref = useRef<HTMLParagraphElement>(null);\n const [expanded, setExpanded] = useState(false);\n const [overflows, setOverflows] = useState(false);\n\n useEffect(() => {\n const el = ref.current;\n if (el) setOverflows(el.scrollHeight > el.clientHeight);\n }, [text]);\n\n return (\n <div className={className}>\n <p ref={ref} className={cn(\"text-sm text-muted-foreground leading-relaxed\", !expanded && \"line-clamp-3\")}>\n {text}\n </p>\n {overflows || expanded ? (\n <button\n type=\"button\"\n onClick={() => setExpanded((e) => !e)}\n className=\"mt-1 text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline\"\n >\n {expanded ? \"Show less\" : \"Show more\"}\n </button>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBI;AAdJ,mBAA4C;AAC5C,gBAAmB;AAEZ,SAAS,eAAe,EAAE,MAAM,UAAU,GAAyC;AACxF,QAAM,UAAM,qBAA6B,IAAI;AAC7C,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,KAAK;AAC9C,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAS,KAAK;AAEhD,8BAAU,MAAM;AACd,UAAM,KAAK,IAAI;AACf,QAAI,GAAI,cAAa,GAAG,eAAe,GAAG,YAAY;AAAA,EACxD,GAAG,CAAC,IAAI,CAAC;AAET,SACE,6CAAC,SAAI,WACH;AAAA,gDAAC,OAAE,KAAU,eAAW,cAAG,iDAAiD,CAAC,YAAY,cAAc,GACpG,gBACH;AAAA,IACC,aAAa,WACZ;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;AAAA,QACpC,WAAU;AAAA,QAET,qBAAW,cAAc;AAAA;AAAA,IAC5B,IACE;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
5
|
+
function ExpandableText({ text, className }) {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const [expanded, setExpanded] = useState(false);
|
|
8
|
+
const [overflows, setOverflows] = useState(false);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const el = ref.current;
|
|
11
|
+
if (el) setOverflows(el.scrollHeight > el.clientHeight);
|
|
12
|
+
}, [text]);
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
14
|
+
/* @__PURE__ */ jsx("p", { ref, className: cn("text-sm text-muted-foreground leading-relaxed", !expanded && "line-clamp-3"), children: text }),
|
|
15
|
+
overflows || expanded ? /* @__PURE__ */ jsx(
|
|
16
|
+
"button",
|
|
17
|
+
{
|
|
18
|
+
type: "button",
|
|
19
|
+
onClick: () => setExpanded((e) => !e),
|
|
20
|
+
className: "mt-1 text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline",
|
|
21
|
+
children: expanded ? "Show less" : "Show more"
|
|
22
|
+
}
|
|
23
|
+
) : null
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
ExpandableText
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=expandable-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/expandable-text.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { cn } from \"../utils/cn.js\";\n\nexport function ExpandableText({ text, className }: { text: string; className?: string }) {\n const ref = useRef<HTMLParagraphElement>(null);\n const [expanded, setExpanded] = useState(false);\n const [overflows, setOverflows] = useState(false);\n\n useEffect(() => {\n const el = ref.current;\n if (el) setOverflows(el.scrollHeight > el.clientHeight);\n }, [text]);\n\n return (\n <div className={className}>\n <p ref={ref} className={cn(\"text-sm text-muted-foreground leading-relaxed\", !expanded && \"line-clamp-3\")}>\n {text}\n </p>\n {overflows || expanded ? (\n <button\n type=\"button\"\n onClick={() => setExpanded((e) => !e)}\n className=\"mt-1 text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline\"\n >\n {expanded ? \"Show less\" : \"Show more\"}\n </button>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AAgBI,SACE,KADF;AAdJ,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,UAAU;AAEZ,SAAS,eAAe,EAAE,MAAM,UAAU,GAAyC;AACxF,QAAM,MAAM,OAA6B,IAAI;AAC7C,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAEhD,YAAU,MAAM;AACd,UAAM,KAAK,IAAI;AACf,QAAI,GAAI,cAAa,GAAG,eAAe,GAAG,YAAY;AAAA,EACxD,GAAG,CAAC,IAAI,CAAC;AAET,SACE,qBAAC,SAAI,WACH;AAAA,wBAAC,OAAE,KAAU,WAAW,GAAG,iDAAiD,CAAC,YAAY,cAAc,GACpG,gBACH;AAAA,IACC,aAAa,WACZ;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;AAAA,QACpC,WAAU;AAAA,QAET,qBAAW,cAAc;AAAA;AAAA,IAC5B,IACE;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { FastMintProps } from './types.cjs';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '@medialane/sdk/starknet';
|
|
7
7
|
|
|
8
|
-
declare function FastMint(props: FastMintProps): string | number | bigint | boolean |
|
|
8
|
+
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { FastMintProps } from './types.js';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '@medialane/sdk/starknet';
|
|
7
7
|
|
|
8
|
-
declare function FastMint(props: FastMintProps): string | number | bigint | boolean |
|
|
8
|
+
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
10
10
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
overlayClassName?: string;
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
10
10
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
overlayClassName?: string;
|
package/dist/index.cjs
CHANGED
|
@@ -156,6 +156,7 @@ __export(index_exports, {
|
|
|
156
156
|
EmailCodeEntry: () => import_email_code_entry.EmailCodeEntry,
|
|
157
157
|
EmptyOrError: () => import_empty_or_error.EmptyOrError,
|
|
158
158
|
ExclusiveFields: () => import_exclusive_fields.ExclusiveFields,
|
|
159
|
+
ExpandableText: () => import_expandable_text.ExpandableText,
|
|
159
160
|
ExportKeySection: () => import_export_key_section.ExportKeySection,
|
|
160
161
|
FILE_UPLOAD_FAILED: () => import_ipfs_upload.FILE_UPLOAD_FAILED,
|
|
161
162
|
FadeIn: () => import_motion_primitives.FadeIn,
|
|
@@ -321,7 +322,6 @@ __export(index_exports, {
|
|
|
321
322
|
XpProgress: () => import_xp_progress.XpProgress,
|
|
322
323
|
assertCorrectNetwork: () => import_wallet_error.assertCorrectNetwork,
|
|
323
324
|
badgeVariants: () => import_badge.badgeVariants,
|
|
324
|
-
buildEditionStats: () => import_asset_top_sections.buildEditionStats,
|
|
325
325
|
buttonVariants: () => import_button.buttonVariants,
|
|
326
326
|
canResendCode: () => import_email_code.canResendCode,
|
|
327
327
|
canVerifyCode: () => import_email_code.canVerifyCode,
|
|
@@ -489,6 +489,7 @@ var import_asset_license_summary = require("./components/asset-license-summary.j
|
|
|
489
489
|
var import_asset_markets_tab = require("./components/asset-markets-tab.js");
|
|
490
490
|
var import_parent_attribution_banner = require("./components/parent-attribution-banner.js");
|
|
491
491
|
var import_asset_top_sections = require("./components/asset-top-sections.js");
|
|
492
|
+
var import_expandable_text = require("./components/expandable-text.js");
|
|
492
493
|
var import_asset_collection_bar = require("./components/asset-collection-bar.js");
|
|
493
494
|
var import_asset_utility_icons = require("./components/asset-utility-icons.js");
|
|
494
495
|
var import_asset_marketplace_panel = require("./components/asset-marketplace-panel.js");
|
|
@@ -819,6 +820,7 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
819
820
|
EmailCodeEntry,
|
|
820
821
|
EmptyOrError,
|
|
821
822
|
ExclusiveFields,
|
|
823
|
+
ExpandableText,
|
|
822
824
|
ExportKeySection,
|
|
823
825
|
FILE_UPLOAD_FAILED,
|
|
824
826
|
FadeIn,
|
|
@@ -984,7 +986,6 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
984
986
|
XpProgress,
|
|
985
987
|
assertCorrectNetwork,
|
|
986
988
|
badgeVariants,
|
|
987
|
-
buildEditionStats,
|
|
988
989
|
buttonVariants,
|
|
989
990
|
canResendCode,
|
|
990
991
|
canVerifyCode,
|