@medialane/ui 0.1.1 → 0.1.3
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/brand-icon.cjs +69 -0
- package/dist/components/brand-icon.cjs.map +1 -0
- package/dist/components/brand-icon.d.cts +10 -0
- package/dist/components/brand-icon.d.ts +10 -0
- package/dist/components/brand-icon.js +35 -0
- package/dist/components/brand-icon.js.map +1 -0
- package/dist/components/brand-logo.cjs +85 -0
- package/dist/components/brand-logo.cjs.map +1 -0
- package/dist/components/brand-logo.d.cts +11 -0
- package/dist/components/brand-logo.d.ts +11 -0
- package/dist/components/brand-logo.js +51 -0
- package/dist/components/brand-logo.js.map +1 -0
- package/dist/components/currency-icon.cjs +79 -0
- package/dist/components/currency-icon.cjs.map +1 -0
- package/dist/components/currency-icon.d.cts +25 -0
- package/dist/components/currency-icon.d.ts +25 -0
- package/dist/components/currency-icon.js +44 -0
- package/dist/components/currency-icon.js.map +1 -0
- package/dist/components/ip-type-badge.cjs +89 -0
- package/dist/components/ip-type-badge.cjs.map +1 -0
- package/dist/components/ip-type-badge.d.cts +21 -0
- package/dist/components/ip-type-badge.d.ts +21 -0
- package/dist/components/ip-type-badge.js +74 -0
- package/dist/components/ip-type-badge.js.map +1 -0
- package/dist/data/ip-types.cjs +47 -0
- package/dist/data/ip-types.cjs.map +1 -0
- package/dist/data/ip-types.d.cts +13 -0
- package/dist/data/ip-types.d.ts +13 -0
- package/dist/data/ip-types.js +22 -0
- package/dist/data/ip-types.js.map +1 -0
- package/dist/index.cjs +51 -199
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -62
- package/dist/index.d.ts +9 -62
- package/dist/index.js +18 -185
- package/dist/index.js.map +1 -1
- package/dist/preset/tailwind.cjs +23 -4
- package/dist/preset/tailwind.cjs.map +1 -1
- package/dist/preset/tailwind.js +3 -3
- package/dist/preset/tailwind.js.map +1 -1
- package/dist/utils/cn.cjs +33 -0
- package/dist/utils/cn.cjs.map +1 -0
- package/dist/utils/cn.d.cts +5 -0
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.js +9 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/format.cjs +49 -0
- package/dist/utils/format.cjs.map +1 -0
- package/dist/utils/format.d.cts +7 -0
- package/dist/utils/format.d.ts +7 -0
- package/dist/utils/format.js +25 -0
- package/dist/utils/format.js.map +1 -0
- package/package.json +1 -1
- package/dist/preset/tailwind.d.cts +0 -5
- package/dist/preset/tailwind.d.ts +0 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,62 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
declare function formatDisplayPrice(price: string | number | null | undefined): string;
|
|
11
|
-
|
|
12
|
-
interface CurrencyIconProps {
|
|
13
|
-
symbol: string | null | undefined;
|
|
14
|
-
size?: number;
|
|
15
|
-
className?: string;
|
|
16
|
-
}
|
|
17
|
-
declare function CurrencyIcon({ symbol, size, className }: CurrencyIconProps): react_jsx_runtime.JSX.Element | null;
|
|
18
|
-
interface CurrencyAmountProps {
|
|
19
|
-
amount: string;
|
|
20
|
-
symbol: string | null | undefined;
|
|
21
|
-
amountClassName?: string;
|
|
22
|
-
iconSize?: number;
|
|
23
|
-
className?: string;
|
|
24
|
-
}
|
|
25
|
-
declare function CurrencyAmount({ amount, symbol, amountClassName, iconSize, className, }: CurrencyAmountProps): react_jsx_runtime.JSX.Element;
|
|
26
|
-
|
|
27
|
-
interface IpTypeConfig {
|
|
28
|
-
slug: string;
|
|
29
|
-
label: string;
|
|
30
|
-
icon: React.ElementType;
|
|
31
|
-
colorClass: string;
|
|
32
|
-
bgClass: string;
|
|
33
|
-
/** API ipType value — null means "nft" special case */
|
|
34
|
-
apiValue: string | null;
|
|
35
|
-
}
|
|
36
|
-
declare const IP_TYPE_CONFIG: IpTypeConfig[];
|
|
37
|
-
declare const IP_TYPE_MAP: Record<string, IpTypeConfig>;
|
|
38
|
-
interface IpTypeBadgeProps {
|
|
39
|
-
ipType: string;
|
|
40
|
-
size?: "sm" | "md";
|
|
41
|
-
className?: string;
|
|
42
|
-
/** Base URL for IP type pages. Default: "" (relative). Example: "https://medialane.io" */
|
|
43
|
-
baseUrl?: string;
|
|
44
|
-
}
|
|
45
|
-
declare function IpTypeBadge({ ipType, size, className, baseUrl }: IpTypeBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
46
|
-
|
|
47
|
-
interface MedialaneIconProps {
|
|
48
|
-
size?: number;
|
|
49
|
-
href?: string;
|
|
50
|
-
className?: string;
|
|
51
|
-
}
|
|
52
|
-
declare function MedialaneIcon({ size, href, className }: MedialaneIconProps): react_jsx_runtime.JSX.Element;
|
|
53
|
-
|
|
54
|
-
interface MedialaneLogoFullProps {
|
|
55
|
-
width?: number;
|
|
56
|
-
height?: number;
|
|
57
|
-
href?: string;
|
|
58
|
-
className?: string;
|
|
59
|
-
}
|
|
60
|
-
declare function MedialaneLogoFull({ width, height, href, className, }: MedialaneLogoFullProps): react_jsx_runtime.JSX.Element;
|
|
61
|
-
|
|
62
|
-
export { CurrencyAmount, type CurrencyAmountProps, CurrencyIcon, type CurrencyIconProps, IP_TYPE_CONFIG, IP_TYPE_MAP, IpTypeBadge, type IpTypeBadgeProps, type IpTypeConfig, MedialaneIcon, type MedialaneIconProps, MedialaneLogoFull, type MedialaneLogoFullProps, cn, formatDisplayPrice };
|
|
1
|
+
export { cn } from './utils/cn.js';
|
|
2
|
+
export { formatDisplayPrice } from './utils/format.js';
|
|
3
|
+
export { CurrencyAmount, CurrencyAmountProps, CurrencyIcon, CurrencyIconProps } from './components/currency-icon.js';
|
|
4
|
+
export { IP_TYPE_CONFIG, IP_TYPE_MAP, IpTypeBadge, IpTypeBadgeProps, IpTypeConfig } from './components/ip-type-badge.js';
|
|
5
|
+
export { MedialaneIcon, MedialaneIconProps } from './components/brand-icon.js';
|
|
6
|
+
export { MedialaneLogoFull, MedialaneLogoFullProps } from './components/brand-logo.js';
|
|
7
|
+
export { IP_TYPE_DATA, IP_TYPE_DATA_MAP, IpTypeData } from './data/ip-types.js';
|
|
8
|
+
import 'clsx';
|
|
9
|
+
import 'react/jsx-runtime';
|
package/dist/index.js
CHANGED
|
@@ -1,187 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const leadingZeros = Math.floor(-Math.log10(Math.abs(num)));
|
|
20
|
-
return leadingZeros + 2;
|
|
21
|
-
}
|
|
22
|
-
function formatDisplayPrice(price) {
|
|
23
|
-
if (price === null || price === void 0) return "";
|
|
24
|
-
const priceStr = String(price);
|
|
25
|
-
const parts = priceStr.split(" ");
|
|
26
|
-
const numericPart = parts[0];
|
|
27
|
-
const currencyPart = parts.length > 1 ? parts.slice(1).join(" ") : "";
|
|
28
|
-
const num = Number(numericPart);
|
|
29
|
-
if (isNaN(num)) return priceStr;
|
|
30
|
-
const maxDecimals = adaptiveDecimals(num);
|
|
31
|
-
const formatted = num.toLocaleString(void 0, {
|
|
32
|
-
minimumFractionDigits: Math.min(2, maxDecimals),
|
|
33
|
-
maximumFractionDigits: maxDecimals
|
|
34
|
-
});
|
|
35
|
-
return currencyPart ? `${formatted} ${currencyPart}` : formatted;
|
|
36
|
-
}
|
|
37
|
-
var CURRENCY_ICONS = {
|
|
38
|
-
USDC: "/usdc.svg",
|
|
39
|
-
USDT: "/usdt.svg",
|
|
40
|
-
ETH: "/eth.svg",
|
|
41
|
-
STRK: "/strk.svg",
|
|
42
|
-
WBTC: "/btc.svg"
|
|
1
|
+
import { cn } from "./utils/cn.js";
|
|
2
|
+
import { formatDisplayPrice } from "./utils/format.js";
|
|
3
|
+
import { CurrencyIcon, CurrencyAmount } from "./components/currency-icon.js";
|
|
4
|
+
import { IpTypeBadge, IP_TYPE_CONFIG, IP_TYPE_MAP, IP_TYPE_DATA, IP_TYPE_DATA_MAP } from "./components/ip-type-badge.js";
|
|
5
|
+
import { MedialaneIcon } from "./components/brand-icon.js";
|
|
6
|
+
import { MedialaneLogoFull } from "./components/brand-logo.js";
|
|
7
|
+
export {
|
|
8
|
+
CurrencyAmount,
|
|
9
|
+
CurrencyIcon,
|
|
10
|
+
IP_TYPE_CONFIG,
|
|
11
|
+
IP_TYPE_DATA,
|
|
12
|
+
IP_TYPE_DATA_MAP,
|
|
13
|
+
IP_TYPE_MAP,
|
|
14
|
+
IpTypeBadge,
|
|
15
|
+
MedialaneIcon,
|
|
16
|
+
MedialaneLogoFull,
|
|
17
|
+
cn,
|
|
18
|
+
formatDisplayPrice
|
|
43
19
|
};
|
|
44
|
-
function CurrencyIcon({ symbol, size = 16, className }) {
|
|
45
|
-
const src = symbol ? CURRENCY_ICONS[symbol] : void 0;
|
|
46
|
-
if (!src) return null;
|
|
47
|
-
return /* @__PURE__ */ jsx(
|
|
48
|
-
Image3,
|
|
49
|
-
{
|
|
50
|
-
src,
|
|
51
|
-
alt: symbol ?? "",
|
|
52
|
-
width: size,
|
|
53
|
-
height: size,
|
|
54
|
-
className: cn("inline-block shrink-0", className),
|
|
55
|
-
unoptimized: true
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
function CurrencyAmount({
|
|
60
|
-
amount,
|
|
61
|
-
symbol,
|
|
62
|
-
amountClassName,
|
|
63
|
-
iconSize = 14,
|
|
64
|
-
className
|
|
65
|
-
}) {
|
|
66
|
-
return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-1", className), children: [
|
|
67
|
-
/* @__PURE__ */ jsx(CurrencyIcon, { symbol, size: iconSize }),
|
|
68
|
-
/* @__PURE__ */ jsx("span", { className: amountClassName, children: amount })
|
|
69
|
-
] });
|
|
70
|
-
}
|
|
71
|
-
var IP_TYPE_CONFIG = [
|
|
72
|
-
{ slug: "audio", label: "Audio", icon: Music, colorClass: "text-violet-400", bgClass: "bg-violet-500/10", apiValue: "Audio" },
|
|
73
|
-
{ slug: "video", label: "Video", icon: Film, colorClass: "text-red-400", bgClass: "bg-red-500/10", apiValue: "Video" },
|
|
74
|
-
{ slug: "art", label: "Art", icon: Palette, colorClass: "text-pink-400", bgClass: "bg-pink-500/10", apiValue: "Art" },
|
|
75
|
-
{ slug: "photography", label: "Photography", icon: Camera, colorClass: "text-amber-400", bgClass: "bg-amber-500/10", apiValue: "Photography" },
|
|
76
|
-
{ slug: "nft", label: "NFT", icon: Gem, colorClass: "text-blue-400", bgClass: "bg-blue-500/10", apiValue: null },
|
|
77
|
-
{ slug: "software", label: "Software", icon: Code, colorClass: "text-cyan-400", bgClass: "bg-cyan-500/10", apiValue: "Software" },
|
|
78
|
-
{ slug: "rwa", label: "RWA", icon: Building, colorClass: "text-lime-400", bgClass: "bg-lime-500/10", apiValue: "RWA" },
|
|
79
|
-
{ slug: "patents", label: "Patents", icon: Award, colorClass: "text-emerald-400", bgClass: "bg-emerald-500/10", apiValue: "Patents" },
|
|
80
|
-
{ slug: "posts", label: "Posts", icon: FileText, colorClass: "text-orange-400", bgClass: "bg-orange-500/10", apiValue: "Posts" },
|
|
81
|
-
{ slug: "publications", label: "Publications", icon: BookOpen, colorClass: "text-teal-400", bgClass: "bg-teal-500/10", apiValue: "Publications" },
|
|
82
|
-
{ slug: "documents", label: "Documents", icon: File, colorClass: "text-slate-400", bgClass: "bg-slate-500/10", apiValue: "Documents" },
|
|
83
|
-
{ slug: "custom", label: "Custom", icon: Layers, colorClass: "text-indigo-400", bgClass: "bg-indigo-500/10", apiValue: "Custom" }
|
|
84
|
-
];
|
|
85
|
-
var IP_TYPE_MAP = Object.fromEntries(
|
|
86
|
-
IP_TYPE_CONFIG.map((c) => [c.slug, c])
|
|
87
|
-
);
|
|
88
|
-
var SIZE = {
|
|
89
|
-
sm: { container: "h-6 w-6", icon: "h-3 w-3" },
|
|
90
|
-
md: { container: "h-8 w-8", icon: "h-4 w-4" }
|
|
91
|
-
};
|
|
92
|
-
function IpTypeBadge({ ipType, size = "sm", className, baseUrl = "" }) {
|
|
93
|
-
const config = IP_TYPE_CONFIG.find(
|
|
94
|
-
(c) => c.label === ipType || c.apiValue === ipType
|
|
95
|
-
);
|
|
96
|
-
if (!config) return null;
|
|
97
|
-
const { icon: Icon, colorClass, bgClass, slug, label } = config;
|
|
98
|
-
const { container, icon } = SIZE[size];
|
|
99
|
-
return /* @__PURE__ */ jsx(
|
|
100
|
-
"a",
|
|
101
|
-
{
|
|
102
|
-
href: `${baseUrl}/${slug}`,
|
|
103
|
-
title: label,
|
|
104
|
-
className: cn(
|
|
105
|
-
"inline-flex items-center justify-center rounded-full",
|
|
106
|
-
"transition-opacity hover:opacity-80",
|
|
107
|
-
bgClass,
|
|
108
|
-
container,
|
|
109
|
-
className
|
|
110
|
-
),
|
|
111
|
-
onClick: (e) => e.stopPropagation(),
|
|
112
|
-
children: /* @__PURE__ */ jsx(Icon, { className: cn(colorClass, icon) })
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
function MedialaneIcon({ size = 256, href = "/", className }) {
|
|
117
|
-
const { resolvedTheme } = useTheme();
|
|
118
|
-
const [mounted, setMounted] = useState(false);
|
|
119
|
-
useEffect(() => {
|
|
120
|
-
setMounted(true);
|
|
121
|
-
}, []);
|
|
122
|
-
if (!mounted) {
|
|
123
|
-
return /* @__PURE__ */ jsx(Link, { href, className, children: /* @__PURE__ */ jsx("div", { style: { width: size, height: size } }) });
|
|
124
|
-
}
|
|
125
|
-
return /* @__PURE__ */ jsx(
|
|
126
|
-
Link,
|
|
127
|
-
{
|
|
128
|
-
href,
|
|
129
|
-
className: `transition-opacity hover:opacity-80 drop-shadow-md ${className ?? ""}`,
|
|
130
|
-
children: /* @__PURE__ */ jsx(
|
|
131
|
-
Image3,
|
|
132
|
-
{
|
|
133
|
-
src: resolvedTheme === "dark" ? "/icon.png" : "/icon.png",
|
|
134
|
-
alt: "Medialane",
|
|
135
|
-
width: size,
|
|
136
|
-
height: size,
|
|
137
|
-
priority: true
|
|
138
|
-
}
|
|
139
|
-
)
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
function MedialaneLogoFull({
|
|
144
|
-
width = 196,
|
|
145
|
-
height = 34,
|
|
146
|
-
href = "/",
|
|
147
|
-
className
|
|
148
|
-
}) {
|
|
149
|
-
const { resolvedTheme } = useTheme();
|
|
150
|
-
const [mounted, setMounted] = useState(false);
|
|
151
|
-
useEffect(() => {
|
|
152
|
-
setMounted(true);
|
|
153
|
-
}, []);
|
|
154
|
-
if (!mounted) {
|
|
155
|
-
return /* @__PURE__ */ jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ jsx(Link, { href, className, children: /* @__PURE__ */ jsx("div", { style: { width, height } }) }) });
|
|
156
|
-
}
|
|
157
|
-
return /* @__PURE__ */ jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ jsx(
|
|
158
|
-
Link,
|
|
159
|
-
{
|
|
160
|
-
href,
|
|
161
|
-
className: `transition-opacity hover:opacity-80 drop-shadow-md ${className ?? ""}`,
|
|
162
|
-
children: resolvedTheme === "dark" ? /* @__PURE__ */ jsx(
|
|
163
|
-
Image3,
|
|
164
|
-
{
|
|
165
|
-
src: "/medialane-light-logo.png",
|
|
166
|
-
alt: "Medialane",
|
|
167
|
-
width,
|
|
168
|
-
height,
|
|
169
|
-
priority: true
|
|
170
|
-
}
|
|
171
|
-
) : /* @__PURE__ */ jsx(
|
|
172
|
-
Image3,
|
|
173
|
-
{
|
|
174
|
-
src: "/medialane-dark-logo.png",
|
|
175
|
-
alt: "Medialane",
|
|
176
|
-
width,
|
|
177
|
-
height,
|
|
178
|
-
priority: true
|
|
179
|
-
}
|
|
180
|
-
)
|
|
181
|
-
}
|
|
182
|
-
) });
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export { CurrencyAmount, CurrencyIcon, IP_TYPE_CONFIG, IP_TYPE_MAP, IpTypeBadge, MedialaneIcon, MedialaneLogoFull, cn, formatDisplayPrice };
|
|
186
|
-
//# sourceMappingURL=index.js.map
|
|
187
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/cn.ts","../src/utils/format.ts","../src/components/currency-icon.tsx","../src/components/ip-type-badge.tsx","../src/components/brand-icon.tsx","../src/components/brand-logo.tsx"],"names":["Image","jsx","useTheme","useState","useEffect","Link"],"mappings":";;;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;;;ACLA,SAAS,iBAAiB,GAAA,EAAqB;AAC7C,EAAA,IAAI,GAAA,KAAQ,CAAA,IAAK,GAAA,IAAO,CAAA,EAAG,OAAO,CAAA;AAClC,EAAA,IAAI,GAAA,IAAO,MAAM,OAAO,CAAA;AACxB,EAAA,MAAM,YAAA,GAAe,IAAA,CAAK,KAAA,CAAM,CAAC,IAAA,CAAK,MAAM,IAAA,CAAK,GAAA,CAAI,GAAG,CAAC,CAAC,CAAA;AAC1D,EAAA,OAAO,YAAA,GAAe,CAAA;AACxB;AAMO,SAAS,mBAAmB,KAAA,EAAmD;AACpF,EAAA,IAAI,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,MAAA,EAAW,OAAO,EAAA;AAClD,EAAA,MAAM,QAAA,GAAW,OAAO,KAAK,CAAA;AAC7B,EAAA,MAAM,KAAA,GAAQ,QAAA,CAAS,KAAA,CAAM,GAAG,CAAA;AAChC,EAAA,MAAM,WAAA,GAAc,MAAM,CAAC,CAAA;AAC3B,EAAA,MAAM,YA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EAAS;AACnC,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAIC,SAAS,KAAK,CAAA;AAE5C,EAAAC,UAAU,MAAM;AACd,IAAA,UAAA,CAAW,IAAI,CAAA;AAAA,EACjB,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,uBACEH,IAAC,KAAA,EAAA,EAAI,SAAA,EAAU,+BACb,QAAA,kBAAAA,GAAAA,CAACI,MAAA,EAAK,IAAA,EAAY,WAChB,QAAA,kBAAAJ,GAAAA,CAAC,SAAI,KAAA,EAAO,EAAE,OAAO,MAAA,EAAO,EAAG,GACjC,CAAA,EACF,CAAA;AAAA,EAEJ;AAEA,EAAA,uBACEA,GAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,+BACb,QAAA,kBAAAA,GAAAA;AAAA,IAACI,IAAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,SAAA,EAAW,CAAA,mDAAA,EAAsD,SAAA,IAAa,EAAE,CAAA,CAAA;AAAA,MAE/E,QAAA,EAAA,aAAA,KAAkB,yBACjBJ,GAAAA;AAAA,QAACD,MAAAA;AAAA,QAAA;AAAA,UACC,GAAA,EAAI,2BAAA;AAAA,UACJ,GAAA,EAAI,WAAA;AAAA,UACJ,KAAA;AAAA,UACA,MAAA;AAAA,UACA,QAAA,EAAQ;AAAA;AAAA,0BAGVC,GAAAA;AAAA,QAACD,MAAAA;AAAA,QAAA;AAAA,UACC,GAAA,EAAI,0BAAA;AAAA,UACJ,GAAA,EAAI,WAAA;AAAA,UACJ,KAAA;AAAA,UACA,MAAA;AAAA,UACA,QAAA,EAAQ;AAAA;AAAA;AACV;AAAA,GAEJ,EACF,CAAA;AAEJ","file":"index.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","function adaptiveDecimals(num: number): number {\n if (num === 0 || num >= 1) return 2;\n if (num >= 0.01) return 4;\n const leadingZeros = Math.floor(-Math.log10(Math.abs(num)));\n return leadingZeros + 2;\n}\n\n/**\n * Format a display price string with adaptive decimal places.\n * Handles \"1.234 USDC\" format — reformats the numeric part, preserves the symbol.\n */\nexport function formatDisplayPrice(price: string | number | null | undefined): string {\n if (price === null || price === undefined) return \"\";\n const priceStr = String(price);\n const parts = priceStr.split(\" \");\n const numericPart = parts[0];\n const currencyPart = parts.length > 1 ? parts.slice(1).join(\" \") : \"\";\n const num = Number(numericPart);\n if (isNaN(num)) return priceStr;\n const maxDecimals = adaptiveDecimals(num);\n const formatted = num.toLocaleString(undefined, {\n minimumFractionDigits: Math.min(2, maxDecimals),\n maximumFractionDigits: maxDecimals,\n });\n return currencyPart ? `${formatted} ${currencyPart}` : formatted;\n}\n","\"use client\";\n\nimport Image from \"next/image\";\nimport { cn } from \"../utils/cn.js\";\n\nconst CURRENCY_ICONS: Record<string, string> = {\n USDC: \"/usdc.svg\",\n USDT: \"/usdt.svg\",\n ETH: \"/eth.svg\",\n STRK: \"/strk.svg\",\n WBTC: \"/btc.svg\",\n};\n\nexport interface CurrencyIconProps {\n symbol: string | null | undefined;\n size?: number;\n className?: string;\n}\n\nexport function CurrencyIcon({ symbol, size = 16, className }: CurrencyIconProps) {\n const src = symbol ? CURRENCY_ICONS[symbol] : undefined;\n if (!src) return null;\n return (\n <Image\n src={src}\n alt={symbol ?? \"\"}\n width={size}\n height={size}\n className={cn(\"inline-block shrink-0\", className)}\n unoptimized\n />\n );\n}\n\nexport interface CurrencyAmountProps {\n amount: string;\n symbol: string | null | undefined;\n amountClassName?: string;\n iconSize?: number;\n className?: string;\n}\n\nexport function CurrencyAmount({\n amount,\n symbol,\n amountClassName,\n iconSize = 14,\n className,\n}: CurrencyAmountProps) {\n return (\n <span className={cn(\"inline-flex items-center gap-1\", className)}>\n <CurrencyIcon symbol={symbol} size={iconSize} />\n <span className={amountClassName}>{amount}</span>\n </span>\n );\n}\n","\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem, Award,\n FileText, BookOpen, File, Building, Code, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\n\nexport interface IpTypeConfig {\n slug: string;\n label: string;\n icon: React.ElementType;\n colorClass: string;\n bgClass: string;\n /** API ipType value — null means \"nft\" special case */\n apiValue: string | null;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = [\n { slug: \"audio\", label: \"Audio\", icon: Music, colorClass: \"text-violet-400\", bgClass: \"bg-violet-500/10\", apiValue: \"Audio\" },\n { slug: \"video\", label: \"Video\", icon: Film, colorClass: \"text-red-400\", bgClass: \"bg-red-500/10\", apiValue: \"Video\" },\n { slug: \"art\", label: \"Art\", icon: Palette, colorClass: \"text-pink-400\", bgClass: \"bg-pink-500/10\", apiValue: \"Art\" },\n { slug: \"photography\", label: \"Photography\", icon: Camera, colorClass: \"text-amber-400\", bgClass: \"bg-amber-500/10\", apiValue: \"Photography\" },\n { slug: \"nft\", label: \"NFT\", icon: Gem, colorClass: \"text-blue-400\", bgClass: \"bg-blue-500/10\", apiValue: null },\n { slug: \"software\", label: \"Software\", icon: Code, colorClass: \"text-cyan-400\", bgClass: \"bg-cyan-500/10\", apiValue: \"Software\" },\n { slug: \"rwa\", label: \"RWA\", icon: Building, colorClass: \"text-lime-400\", bgClass: \"bg-lime-500/10\", apiValue: \"RWA\" },\n { slug: \"patents\", label: \"Patents\", icon: Award, colorClass: \"text-emerald-400\", bgClass: \"bg-emerald-500/10\", apiValue: \"Patents\" },\n { slug: \"posts\", label: \"Posts\", icon: FileText, colorClass: \"text-orange-400\", bgClass: \"bg-orange-500/10\", apiValue: \"Posts\" },\n { slug: \"publications\", label: \"Publications\", icon: BookOpen, colorClass: \"text-teal-400\", bgClass: \"bg-teal-500/10\", apiValue: \"Publications\" },\n { slug: \"documents\", label: \"Documents\", icon: File, colorClass: \"text-slate-400\", bgClass: \"bg-slate-500/10\", apiValue: \"Documents\" },\n { slug: \"custom\", label: \"Custom\", icon: Layers, colorClass: \"text-indigo-400\", bgClass: \"bg-indigo-500/10\", apiValue: \"Custom\" },\n];\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n className?: string;\n /** Base URL for IP type pages. Default: \"\" (relative). Example: \"https://medialane.io\" */\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, bgClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={label}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"transition-opacity hover:opacity-80\",\n bgClass,\n container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n </a>\n );\n}\n","\"use client\";\n\nimport Image from \"next/image\";\nimport Link from \"next/link\";\nimport { useTheme } from \"next-themes\";\nimport { useEffect, useState } from \"react\";\n\nexport interface MedialaneIconProps {\n size?: number;\n href?: string;\n className?: string;\n}\n\nexport function MedialaneIcon({ size = 256, href = \"/\", className }: MedialaneIconProps) {\n const { resolvedTheme } = useTheme();\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) {\n return (\n <Link href={href} className={className}>\n <div style={{ width: size, height: size }} />\n </Link>\n );\n }\n\n return (\n <Link\n href={href}\n className={`transition-opacity hover:opacity-80 drop-shadow-md ${className ?? \"\"}`}\n >\n <Image\n src={resolvedTheme === \"dark\" ? \"/icon.png\" : \"/icon.png\"}\n alt=\"Medialane\"\n width={size}\n height={size}\n priority\n />\n </Link>\n );\n}\n","\"use client\";\n\nimport Link from \"next/link\";\nimport Image from \"next/image\";\nimport { useTheme } from \"next-themes\";\nimport { useEffect, useState } from \"react\";\n\nexport interface MedialaneLogoFullProps {\n width?: number;\n height?: number;\n href?: string;\n className?: string;\n}\n\nexport function MedialaneLogoFull({\n width = 196,\n height = 34,\n href = \"/\",\n className,\n}: MedialaneLogoFullProps) {\n const { resolvedTheme } = useTheme();\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) {\n return (\n <div className=\"flex items-center space-x-2\">\n <Link href={href} className={className}>\n <div style={{ width, height }} />\n </Link>\n </div>\n );\n }\n\n return (\n <div className=\"flex items-center space-x-2\">\n <Link\n href={href}\n className={`transition-opacity hover:opacity-80 drop-shadow-md ${className ?? \"\"}`}\n >\n {resolvedTheme === \"dark\" ? (\n <Image\n src=\"/medialane-light-logo.png\"\n alt=\"Medialane\"\n width={width}\n height={height}\n priority\n />\n ) : (\n <Image\n src=\"/medialane-dark-logo.png\"\n alt=\"Medialane\"\n width={width}\n height={height}\n priority\n />\n )}\n </Link>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { cn } from \"./utils/cn.js\";\nexport { formatDisplayPrice } from \"./utils/format.js\";\n\nexport { CurrencyIcon, CurrencyAmount } from \"./components/currency-icon.js\";\nexport type { CurrencyIconProps, CurrencyAmountProps } from \"./components/currency-icon.js\";\n\nexport { IpTypeBadge, IP_TYPE_CONFIG, IP_TYPE_MAP, IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"./components/ip-type-badge.js\";\nexport type { IpTypeBadgeProps, IpTypeConfig, IpTypeData } from \"./components/ip-type-badge.js\";\n\nexport { MedialaneIcon } from \"./components/brand-icon.js\";\nexport type { MedialaneIconProps } from \"./components/brand-icon.js\";\nexport { MedialaneLogoFull } from \"./components/brand-logo.js\";\nexport type { MedialaneLogoFullProps } from \"./components/brand-logo.js\";\n"],"mappings":"AAAA,SAAS,UAAU;AACnB,SAAS,0BAA0B;AAEnC,SAAS,cAAc,sBAAsB;AAG7C,SAAS,aAAa,gBAAgB,aAAa,cAAc,wBAAwB;AAGzF,SAAS,qBAAqB;AAE9B,SAAS,yBAAyB;","names":[]}
|
package/dist/preset/tailwind.cjs
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
2
19
|
|
|
3
20
|
// src/preset/tailwind.ts
|
|
21
|
+
var tailwind_exports = {};
|
|
22
|
+
__export(tailwind_exports, {
|
|
23
|
+
default: () => tailwind_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(tailwind_exports);
|
|
4
26
|
var medialanePreset = {
|
|
5
27
|
theme: {
|
|
6
28
|
extend: {
|
|
@@ -18,7 +40,4 @@ var medialanePreset = {
|
|
|
18
40
|
}
|
|
19
41
|
};
|
|
20
42
|
var tailwind_default = medialanePreset;
|
|
21
|
-
|
|
22
|
-
module.exports = tailwind_default;
|
|
23
|
-
//# sourceMappingURL=tailwind.cjs.map
|
|
24
43
|
//# sourceMappingURL=tailwind.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/preset/tailwind.ts"],"
|
|
1
|
+
{"version":3,"sources":["../../src/preset/tailwind.ts"],"sourcesContent":["import type { Config } from \"tailwindcss\";\n\nconst medialanePreset: Partial<Config> = {\n theme: {\n extend: {\n colors: {\n \"brand-blue\": \"#2563eb\",\n \"brand-navy\": \"#172554\",\n \"brand-rose\": \"#f43f5e\",\n \"brand-purple\": \"#9333ea\",\n \"brand-orange\": \"#ea580c\",\n },\n borderRadius: {\n brand: \"11px\",\n },\n },\n },\n};\n\nexport default medialanePreset;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAM,kBAAmC;AAAA,EACvC,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,QAAQ;AAAA,QACN,cAAc;AAAA,QACd,cAAc;AAAA,QACd,cAAc;AAAA,QACd,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,MAClB;AAAA,MACA,cAAc;AAAA,QACZ,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,mBAAQ;","names":[]}
|
package/dist/preset/tailwind.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/preset/tailwind.ts"],"
|
|
1
|
+
{"version":3,"sources":["../../src/preset/tailwind.ts"],"sourcesContent":["import type { Config } from \"tailwindcss\";\n\nconst medialanePreset: Partial<Config> = {\n theme: {\n extend: {\n colors: {\n \"brand-blue\": \"#2563eb\",\n \"brand-navy\": \"#172554\",\n \"brand-rose\": \"#f43f5e\",\n \"brand-purple\": \"#9333ea\",\n \"brand-orange\": \"#ea580c\",\n },\n borderRadius: {\n brand: \"11px\",\n },\n },\n },\n};\n\nexport default medialanePreset;\n"],"mappings":";AAEA,IAAM,kBAAmC;AAAA,EACvC,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,QAAQ;AAAA,QACN,cAAc;AAAA,QACd,cAAc;AAAA,QACd,cAAc;AAAA,QACd,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,MAClB;AAAA,MACA,cAAc;AAAA,QACZ,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,mBAAQ;","names":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var cn_exports = {};
|
|
20
|
+
__export(cn_exports, {
|
|
21
|
+
cn: () => cn
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(cn_exports);
|
|
24
|
+
var import_clsx = require("clsx");
|
|
25
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
26
|
+
function cn(...inputs) {
|
|
27
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
28
|
+
}
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
cn
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=cn.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/cn.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;","names":[]}
|
package/dist/utils/cn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/cn.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"AAAA,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;","names":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var format_exports = {};
|
|
20
|
+
__export(format_exports, {
|
|
21
|
+
formatDisplayPrice: () => formatDisplayPrice
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(format_exports);
|
|
24
|
+
function adaptiveDecimals(num) {
|
|
25
|
+
if (num === 0 || num >= 1) return 2;
|
|
26
|
+
if (num >= 0.01) return 4;
|
|
27
|
+
const leadingZeros = Math.floor(-Math.log10(Math.abs(num)));
|
|
28
|
+
return leadingZeros + 2;
|
|
29
|
+
}
|
|
30
|
+
function formatDisplayPrice(price) {
|
|
31
|
+
if (price === null || price === void 0) return "";
|
|
32
|
+
const priceStr = String(price);
|
|
33
|
+
const parts = priceStr.split(" ");
|
|
34
|
+
const numericPart = parts[0];
|
|
35
|
+
const currencyPart = parts.length > 1 ? parts.slice(1).join(" ") : "";
|
|
36
|
+
const num = Number(numericPart);
|
|
37
|
+
if (isNaN(num)) return priceStr;
|
|
38
|
+
const maxDecimals = adaptiveDecimals(num);
|
|
39
|
+
const formatted = num.toLocaleString(void 0, {
|
|
40
|
+
minimumFractionDigits: Math.min(2, maxDecimals),
|
|
41
|
+
maximumFractionDigits: maxDecimals
|
|
42
|
+
});
|
|
43
|
+
return currencyPart ? `${formatted} ${currencyPart}` : formatted;
|
|
44
|
+
}
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
formatDisplayPrice
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=format.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/format.ts"],"sourcesContent":["function adaptiveDecimals(num: number): number {\n if (num === 0 || num >= 1) return 2;\n if (num >= 0.01) return 4;\n const leadingZeros = Math.floor(-Math.log10(Math.abs(num)));\n return leadingZeros + 2;\n}\n\n/**\n * Format a display price string with adaptive decimal places.\n * Handles \"1.234 USDC\" format — reformats the numeric part, preserves the symbol.\n */\nexport function formatDisplayPrice(price: string | number | null | undefined): string {\n if (price === null || price === undefined) return \"\";\n const priceStr = String(price);\n const parts = priceStr.split(\" \");\n const numericPart = parts[0];\n const currencyPart = parts.length > 1 ? parts.slice(1).join(\" \") : \"\";\n const num = Number(numericPart);\n if (isNaN(num)) return priceStr;\n const maxDecimals = adaptiveDecimals(num);\n const formatted = num.toLocaleString(undefined, {\n minimumFractionDigits: Math.min(2, maxDecimals),\n maximumFractionDigits: maxDecimals,\n });\n return currencyPart ? `${formatted} ${currencyPart}` : formatted;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,iBAAiB,KAAqB;AAC7C,MAAI,QAAQ,KAAK,OAAO,EAAG,QAAO;AAClC,MAAI,OAAO,KAAM,QAAO;AACxB,QAAM,eAAe,KAAK,MAAM,CAAC,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,CAAC;AAC1D,SAAO,eAAe;AACxB;AAMO,SAAS,mBAAmB,OAAmD;AACpF,MAAI,UAAU,QAAQ,UAAU,OAAW,QAAO;AAClD,QAAM,WAAW,OAAO,KAAK;AAC7B,QAAM,QAAQ,SAAS,MAAM,GAAG;AAChC,QAAM,cAAc,MAAM,CAAC;AAC3B,QAAM,eAAe,MAAM,SAAS,IAAI,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,IAAI;AACnE,QAAM,MAAM,OAAO,WAAW;AAC9B,MAAI,MAAM,GAAG,EAAG,QAAO;AACvB,QAAM,cAAc,iBAAiB,GAAG;AACxC,QAAM,YAAY,IAAI,eAAe,QAAW;AAAA,IAC9C,uBAAuB,KAAK,IAAI,GAAG,WAAW;AAAA,IAC9C,uBAAuB;AAAA,EACzB,CAAC;AACD,SAAO,eAAe,GAAG,SAAS,IAAI,YAAY,KAAK;AACzD;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a display price string with adaptive decimal places.
|
|
3
|
+
* Handles "1.234 USDC" format — reformats the numeric part, preserves the symbol.
|
|
4
|
+
*/
|
|
5
|
+
declare function formatDisplayPrice(price: string | number | null | undefined): string;
|
|
6
|
+
|
|
7
|
+
export { formatDisplayPrice };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a display price string with adaptive decimal places.
|
|
3
|
+
* Handles "1.234 USDC" format — reformats the numeric part, preserves the symbol.
|
|
4
|
+
*/
|
|
5
|
+
declare function formatDisplayPrice(price: string | number | null | undefined): string;
|
|
6
|
+
|
|
7
|
+
export { formatDisplayPrice };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function adaptiveDecimals(num) {
|
|
2
|
+
if (num === 0 || num >= 1) return 2;
|
|
3
|
+
if (num >= 0.01) return 4;
|
|
4
|
+
const leadingZeros = Math.floor(-Math.log10(Math.abs(num)));
|
|
5
|
+
return leadingZeros + 2;
|
|
6
|
+
}
|
|
7
|
+
function formatDisplayPrice(price) {
|
|
8
|
+
if (price === null || price === void 0) return "";
|
|
9
|
+
const priceStr = String(price);
|
|
10
|
+
const parts = priceStr.split(" ");
|
|
11
|
+
const numericPart = parts[0];
|
|
12
|
+
const currencyPart = parts.length > 1 ? parts.slice(1).join(" ") : "";
|
|
13
|
+
const num = Number(numericPart);
|
|
14
|
+
if (isNaN(num)) return priceStr;
|
|
15
|
+
const maxDecimals = adaptiveDecimals(num);
|
|
16
|
+
const formatted = num.toLocaleString(void 0, {
|
|
17
|
+
minimumFractionDigits: Math.min(2, maxDecimals),
|
|
18
|
+
maximumFractionDigits: maxDecimals
|
|
19
|
+
});
|
|
20
|
+
return currencyPart ? `${formatted} ${currencyPart}` : formatted;
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
formatDisplayPrice
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/format.ts"],"sourcesContent":["function adaptiveDecimals(num: number): number {\n if (num === 0 || num >= 1) return 2;\n if (num >= 0.01) return 4;\n const leadingZeros = Math.floor(-Math.log10(Math.abs(num)));\n return leadingZeros + 2;\n}\n\n/**\n * Format a display price string with adaptive decimal places.\n * Handles \"1.234 USDC\" format — reformats the numeric part, preserves the symbol.\n */\nexport function formatDisplayPrice(price: string | number | null | undefined): string {\n if (price === null || price === undefined) return \"\";\n const priceStr = String(price);\n const parts = priceStr.split(\" \");\n const numericPart = parts[0];\n const currencyPart = parts.length > 1 ? parts.slice(1).join(\" \") : \"\";\n const num = Number(numericPart);\n if (isNaN(num)) return priceStr;\n const maxDecimals = adaptiveDecimals(num);\n const formatted = num.toLocaleString(undefined, {\n minimumFractionDigits: Math.min(2, maxDecimals),\n maximumFractionDigits: maxDecimals,\n });\n return currencyPart ? `${formatted} ${currencyPart}` : formatted;\n}\n"],"mappings":"AAAA,SAAS,iBAAiB,KAAqB;AAC7C,MAAI,QAAQ,KAAK,OAAO,EAAG,QAAO;AAClC,MAAI,OAAO,KAAM,QAAO;AACxB,QAAM,eAAe,KAAK,MAAM,CAAC,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,CAAC;AAC1D,SAAO,eAAe;AACxB;AAMO,SAAS,mBAAmB,OAAmD;AACpF,MAAI,UAAU,QAAQ,UAAU,OAAW,QAAO;AAClD,QAAM,WAAW,OAAO,KAAK;AAC7B,QAAM,QAAQ,SAAS,MAAM,GAAG;AAChC,QAAM,cAAc,MAAM,CAAC;AAC3B,QAAM,eAAe,MAAM,SAAS,IAAI,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,IAAI;AACnE,QAAM,MAAM,OAAO,WAAW;AAC9B,MAAI,MAAM,GAAG,EAAG,QAAO;AACvB,QAAM,cAAc,iBAAiB,GAAG;AACxC,QAAM,YAAY,IAAI,eAAe,QAAW;AAAA,IAC9C,uBAAuB,KAAK,IAAI,GAAG,WAAW;AAAA,IAC9C,uBAAuB;AAAA,EACzB,CAAC;AACD,SAAO,eAAe,GAAG,SAAS,IAAI,YAAY,KAAK;AACzD;","names":[]}
|
package/package.json
CHANGED