@medialane/ui 0.1.3 → 0.1.5

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.
@@ -0,0 +1,67 @@
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 address_display_exports = {};
21
+ __export(address_display_exports, {
22
+ AddressDisplay: () => AddressDisplay
23
+ });
24
+ module.exports = __toCommonJS(address_display_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
27
+ var import_lucide_react = require("lucide-react");
28
+ var import_cn = require("../utils/cn.js");
29
+ var import_address = require("../utils/address.js");
30
+ function AddressDisplay({
31
+ address,
32
+ className,
33
+ chars = 4,
34
+ showCopy = true
35
+ }) {
36
+ const [copied, setCopied] = (0, import_react.useState)(false);
37
+ const handleCopy = async () => {
38
+ await navigator.clipboard.writeText(address);
39
+ setCopied(true);
40
+ setTimeout(() => setCopied(false), 2e3);
41
+ };
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
43
+ "span",
44
+ {
45
+ className: (0, import_cn.cn)("inline-flex items-center gap-1 font-mono text-sm", className),
46
+ title: address,
47
+ "aria-label": address,
48
+ children: [
49
+ (0, import_address.shortenAddress)(address, chars),
50
+ showCopy && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
+ "button",
52
+ {
53
+ onClick: handleCopy,
54
+ className: "opacity-60 hover:opacity-100 transition-opacity",
55
+ "aria-label": "Copy address",
56
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-3 w-3 text-emerald-500" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Copy, { className: "h-3 w-3" })
57
+ }
58
+ )
59
+ ]
60
+ }
61
+ );
62
+ }
63
+ // Annotate the CommonJS export names for ESM import in node:
64
+ 0 && (module.exports = {
65
+ AddressDisplay
66
+ });
67
+ //# sourceMappingURL=address-display.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/address-display.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Copy, Check } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { shortenAddress } from \"../utils/address.js\";\n\nexport interface AddressDisplayProps {\n address: string;\n className?: string;\n /** Number of chars to show at start and end. Default: 4 */\n chars?: number;\n showCopy?: boolean;\n}\n\nexport function AddressDisplay({\n address,\n className,\n chars = 4,\n showCopy = true,\n}: AddressDisplayProps) {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async () => {\n await navigator.clipboard.writeText(address);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n return (\n <span\n className={cn(\"inline-flex items-center gap-1 font-mono text-sm\", className)}\n title={address}\n aria-label={address}\n >\n {shortenAddress(address, chars)}\n {showCopy && (\n <button\n onClick={handleCopy}\n className=\"opacity-60 hover:opacity-100 transition-opacity\"\n aria-label=\"Copy address\"\n >\n {copied\n ? <Check className=\"h-3 w-3 text-emerald-500\" />\n : <Copy className=\"h-3 w-3\" />}\n </button>\n )}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BI;AA5BJ,mBAAyB;AACzB,0BAA4B;AAC5B,gBAAmB;AACnB,qBAA+B;AAUxB,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,WAAW;AACb,GAAwB;AACtB,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KAAK;AAE1C,QAAM,aAAa,YAAY;AAC7B,UAAM,UAAU,UAAU,UAAU,OAAO;AAC3C,cAAU,IAAI;AACd,eAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,EACzC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,cAAG,oDAAoD,SAAS;AAAA,MAC3E,OAAO;AAAA,MACP,cAAY;AAAA,MAEX;AAAA,2CAAe,SAAS,KAAK;AAAA,QAC7B,YACC;AAAA,UAAC;AAAA;AAAA,YACC,SAAS;AAAA,YACT,WAAU;AAAA,YACV,cAAW;AAAA,YAEV,mBACG,4CAAC,6BAAM,WAAU,4BAA2B,IAC5C,4CAAC,4BAAK,WAAU,WAAU;AAAA;AAAA,QAChC;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface AddressDisplayProps {
4
+ address: string;
5
+ className?: string;
6
+ /** Number of chars to show at start and end. Default: 4 */
7
+ chars?: number;
8
+ showCopy?: boolean;
9
+ }
10
+ declare function AddressDisplay({ address, className, chars, showCopy, }: AddressDisplayProps): react_jsx_runtime.JSX.Element;
11
+
12
+ export { AddressDisplay, type AddressDisplayProps };
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface AddressDisplayProps {
4
+ address: string;
5
+ className?: string;
6
+ /** Number of chars to show at start and end. Default: 4 */
7
+ chars?: number;
8
+ showCopy?: boolean;
9
+ }
10
+ declare function AddressDisplay({ address, className, chars, showCopy, }: AddressDisplayProps): react_jsx_runtime.JSX.Element;
11
+
12
+ export { AddressDisplay, type AddressDisplayProps };
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { Copy, Check } from "lucide-react";
5
+ import { cn } from "../utils/cn.js";
6
+ import { shortenAddress } from "../utils/address.js";
7
+ function AddressDisplay({
8
+ address,
9
+ className,
10
+ chars = 4,
11
+ showCopy = true
12
+ }) {
13
+ const [copied, setCopied] = useState(false);
14
+ const handleCopy = async () => {
15
+ await navigator.clipboard.writeText(address);
16
+ setCopied(true);
17
+ setTimeout(() => setCopied(false), 2e3);
18
+ };
19
+ return /* @__PURE__ */ jsxs(
20
+ "span",
21
+ {
22
+ className: cn("inline-flex items-center gap-1 font-mono text-sm", className),
23
+ title: address,
24
+ "aria-label": address,
25
+ children: [
26
+ shortenAddress(address, chars),
27
+ showCopy && /* @__PURE__ */ jsx(
28
+ "button",
29
+ {
30
+ onClick: handleCopy,
31
+ className: "opacity-60 hover:opacity-100 transition-opacity",
32
+ "aria-label": "Copy address",
33
+ children: copied ? /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 text-emerald-500" }) : /* @__PURE__ */ jsx(Copy, { className: "h-3 w-3" })
34
+ }
35
+ )
36
+ ]
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ AddressDisplay
42
+ };
43
+ //# sourceMappingURL=address-display.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/address-display.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Copy, Check } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { shortenAddress } from \"../utils/address.js\";\n\nexport interface AddressDisplayProps {\n address: string;\n className?: string;\n /** Number of chars to show at start and end. Default: 4 */\n chars?: number;\n showCopy?: boolean;\n}\n\nexport function AddressDisplay({\n address,\n className,\n chars = 4,\n showCopy = true,\n}: AddressDisplayProps) {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async () => {\n await navigator.clipboard.writeText(address);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n return (\n <span\n className={cn(\"inline-flex items-center gap-1 font-mono text-sm\", className)}\n title={address}\n aria-label={address}\n >\n {shortenAddress(address, chars)}\n {showCopy && (\n <button\n onClick={handleCopy}\n className=\"opacity-60 hover:opacity-100 transition-opacity\"\n aria-label=\"Copy address\"\n >\n {copied\n ? <Check className=\"h-3 w-3 text-emerald-500\" />\n : <Copy className=\"h-3 w-3\" />}\n </button>\n )}\n </span>\n );\n}\n"],"mappings":";AA8BI,SAaU,KAbV;AA5BJ,SAAS,gBAAgB;AACzB,SAAS,MAAM,aAAa;AAC5B,SAAS,UAAU;AACnB,SAAS,sBAAsB;AAUxB,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,WAAW;AACb,GAAwB;AACtB,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAE1C,QAAM,aAAa,YAAY;AAC7B,UAAM,UAAU,UAAU,UAAU,OAAO;AAC3C,cAAU,IAAI;AACd,eAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,EACzC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,oDAAoD,SAAS;AAAA,MAC3E,OAAO;AAAA,MACP,cAAY;AAAA,MAEX;AAAA,uBAAe,SAAS,KAAK;AAAA,QAC7B,YACC;AAAA,UAAC;AAAA;AAAA,YACC,SAAS;AAAA,YACT,WAAU;AAAA,YACV,cAAW;AAAA,YAEV,mBACG,oBAAC,SAAM,WAAU,4BAA2B,IAC5C,oBAAC,QAAK,WAAU,WAAU;AAAA;AAAA,QAChC;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
@@ -0,0 +1,64 @@
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 brand_exports = {};
20
+ __export(brand_exports, {
21
+ BRAND: () => BRAND
22
+ });
23
+ module.exports = __toCommonJS(brand_exports);
24
+ const BRAND = {
25
+ purple: {
26
+ text: "text-brand-purple",
27
+ bg: "bg-brand-purple/10",
28
+ bgSolid: "bg-brand-purple/15",
29
+ from: "from-brand-purple/20",
30
+ to: "to-brand-purple/20"
31
+ },
32
+ blue: {
33
+ text: "text-brand-blue",
34
+ bg: "bg-brand-blue/10",
35
+ bgSolid: "bg-brand-blue/15",
36
+ from: "from-brand-blue/20",
37
+ to: "to-brand-blue/20"
38
+ },
39
+ rose: {
40
+ text: "text-brand-rose",
41
+ bg: "bg-brand-rose/10",
42
+ bgSolid: "bg-brand-rose/15",
43
+ from: "from-brand-rose/20",
44
+ to: "to-brand-rose/20"
45
+ },
46
+ orange: {
47
+ text: "text-brand-orange",
48
+ bg: "bg-brand-orange/10",
49
+ bgSolid: "bg-brand-orange/15",
50
+ from: "from-brand-orange/20",
51
+ to: "to-brand-orange/20"
52
+ },
53
+ navy: {
54
+ text: "text-brand-navy",
55
+ bg: "bg-brand-navy/10",
56
+ from: "from-brand-navy/10",
57
+ to: "to-brand-navy/10"
58
+ }
59
+ };
60
+ // Annotate the CommonJS export names for ESM import in node:
61
+ 0 && (module.exports = {
62
+ BRAND
63
+ });
64
+ //# sourceMappingURL=brand.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/data/brand.ts"],"sourcesContent":["/**\n * Typed Tailwind class constants for Medialane brand colors.\n * Mirrors the brand color extensions defined in the Tailwind preset.\n * Keeping these as string literals ensures JIT picks them up via the\n * consumer's content scan of node_modules/@medialane/ui/dist.\n */\nexport const BRAND = {\n purple: {\n text: \"text-brand-purple\",\n bg: \"bg-brand-purple/10\",\n bgSolid: \"bg-brand-purple/15\",\n from: \"from-brand-purple/20\",\n to: \"to-brand-purple/20\",\n },\n blue: {\n text: \"text-brand-blue\",\n bg: \"bg-brand-blue/10\",\n bgSolid: \"bg-brand-blue/15\",\n from: \"from-brand-blue/20\",\n to: \"to-brand-blue/20\",\n },\n rose: {\n text: \"text-brand-rose\",\n bg: \"bg-brand-rose/10\",\n bgSolid: \"bg-brand-rose/15\",\n from: \"from-brand-rose/20\",\n to: \"to-brand-rose/20\",\n },\n orange: {\n text: \"text-brand-orange\",\n bg: \"bg-brand-orange/10\",\n bgSolid: \"bg-brand-orange/15\",\n from: \"from-brand-orange/20\",\n to: \"to-brand-orange/20\",\n },\n navy: {\n text: \"text-brand-navy\",\n bg: \"bg-brand-navy/10\",\n from: \"from-brand-navy/10\",\n to: \"to-brand-navy/10\",\n },\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,MAAM,QAAQ;AAAA,EACnB,QAAQ;AAAA,IACN,MAAS;AAAA,IACT,IAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAS;AAAA,IACT,IAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,MAAS;AAAA,IACT,IAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAS;AAAA,IACT,IAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,MAAS;AAAA,IACT,IAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAS;AAAA,IACT,IAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACN,MAAS;AAAA,IACT,IAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAS;AAAA,IACT,IAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,MAAS;AAAA,IACT,IAAS;AAAA,IACT,MAAS;AAAA,IACT,IAAS;AAAA,EACX;AACF;","names":[]}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Typed Tailwind class constants for Medialane brand colors.
3
+ * Mirrors the brand color extensions defined in the Tailwind preset.
4
+ * Keeping these as string literals ensures JIT picks them up via the
5
+ * consumer's content scan of node_modules/@medialane/ui/dist.
6
+ */
7
+ declare const BRAND: {
8
+ readonly purple: {
9
+ readonly text: "text-brand-purple";
10
+ readonly bg: "bg-brand-purple/10";
11
+ readonly bgSolid: "bg-brand-purple/15";
12
+ readonly from: "from-brand-purple/20";
13
+ readonly to: "to-brand-purple/20";
14
+ };
15
+ readonly blue: {
16
+ readonly text: "text-brand-blue";
17
+ readonly bg: "bg-brand-blue/10";
18
+ readonly bgSolid: "bg-brand-blue/15";
19
+ readonly from: "from-brand-blue/20";
20
+ readonly to: "to-brand-blue/20";
21
+ };
22
+ readonly rose: {
23
+ readonly text: "text-brand-rose";
24
+ readonly bg: "bg-brand-rose/10";
25
+ readonly bgSolid: "bg-brand-rose/15";
26
+ readonly from: "from-brand-rose/20";
27
+ readonly to: "to-brand-rose/20";
28
+ };
29
+ readonly orange: {
30
+ readonly text: "text-brand-orange";
31
+ readonly bg: "bg-brand-orange/10";
32
+ readonly bgSolid: "bg-brand-orange/15";
33
+ readonly from: "from-brand-orange/20";
34
+ readonly to: "to-brand-orange/20";
35
+ };
36
+ readonly navy: {
37
+ readonly text: "text-brand-navy";
38
+ readonly bg: "bg-brand-navy/10";
39
+ readonly from: "from-brand-navy/10";
40
+ readonly to: "to-brand-navy/10";
41
+ };
42
+ };
43
+
44
+ export { BRAND };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Typed Tailwind class constants for Medialane brand colors.
3
+ * Mirrors the brand color extensions defined in the Tailwind preset.
4
+ * Keeping these as string literals ensures JIT picks them up via the
5
+ * consumer's content scan of node_modules/@medialane/ui/dist.
6
+ */
7
+ declare const BRAND: {
8
+ readonly purple: {
9
+ readonly text: "text-brand-purple";
10
+ readonly bg: "bg-brand-purple/10";
11
+ readonly bgSolid: "bg-brand-purple/15";
12
+ readonly from: "from-brand-purple/20";
13
+ readonly to: "to-brand-purple/20";
14
+ };
15
+ readonly blue: {
16
+ readonly text: "text-brand-blue";
17
+ readonly bg: "bg-brand-blue/10";
18
+ readonly bgSolid: "bg-brand-blue/15";
19
+ readonly from: "from-brand-blue/20";
20
+ readonly to: "to-brand-blue/20";
21
+ };
22
+ readonly rose: {
23
+ readonly text: "text-brand-rose";
24
+ readonly bg: "bg-brand-rose/10";
25
+ readonly bgSolid: "bg-brand-rose/15";
26
+ readonly from: "from-brand-rose/20";
27
+ readonly to: "to-brand-rose/20";
28
+ };
29
+ readonly orange: {
30
+ readonly text: "text-brand-orange";
31
+ readonly bg: "bg-brand-orange/10";
32
+ readonly bgSolid: "bg-brand-orange/15";
33
+ readonly from: "from-brand-orange/20";
34
+ readonly to: "to-brand-orange/20";
35
+ };
36
+ readonly navy: {
37
+ readonly text: "text-brand-navy";
38
+ readonly bg: "bg-brand-navy/10";
39
+ readonly from: "from-brand-navy/10";
40
+ readonly to: "to-brand-navy/10";
41
+ };
42
+ };
43
+
44
+ export { BRAND };
@@ -0,0 +1,40 @@
1
+ const BRAND = {
2
+ purple: {
3
+ text: "text-brand-purple",
4
+ bg: "bg-brand-purple/10",
5
+ bgSolid: "bg-brand-purple/15",
6
+ from: "from-brand-purple/20",
7
+ to: "to-brand-purple/20"
8
+ },
9
+ blue: {
10
+ text: "text-brand-blue",
11
+ bg: "bg-brand-blue/10",
12
+ bgSolid: "bg-brand-blue/15",
13
+ from: "from-brand-blue/20",
14
+ to: "to-brand-blue/20"
15
+ },
16
+ rose: {
17
+ text: "text-brand-rose",
18
+ bg: "bg-brand-rose/10",
19
+ bgSolid: "bg-brand-rose/15",
20
+ from: "from-brand-rose/20",
21
+ to: "to-brand-rose/20"
22
+ },
23
+ orange: {
24
+ text: "text-brand-orange",
25
+ bg: "bg-brand-orange/10",
26
+ bgSolid: "bg-brand-orange/15",
27
+ from: "from-brand-orange/20",
28
+ to: "to-brand-orange/20"
29
+ },
30
+ navy: {
31
+ text: "text-brand-navy",
32
+ bg: "bg-brand-navy/10",
33
+ from: "from-brand-navy/10",
34
+ to: "to-brand-navy/10"
35
+ }
36
+ };
37
+ export {
38
+ BRAND
39
+ };
40
+ //# sourceMappingURL=brand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/data/brand.ts"],"sourcesContent":["/**\n * Typed Tailwind class constants for Medialane brand colors.\n * Mirrors the brand color extensions defined in the Tailwind preset.\n * Keeping these as string literals ensures JIT picks them up via the\n * consumer's content scan of node_modules/@medialane/ui/dist.\n */\nexport const BRAND = {\n purple: {\n text: \"text-brand-purple\",\n bg: \"bg-brand-purple/10\",\n bgSolid: \"bg-brand-purple/15\",\n from: \"from-brand-purple/20\",\n to: \"to-brand-purple/20\",\n },\n blue: {\n text: \"text-brand-blue\",\n bg: \"bg-brand-blue/10\",\n bgSolid: \"bg-brand-blue/15\",\n from: \"from-brand-blue/20\",\n to: \"to-brand-blue/20\",\n },\n rose: {\n text: \"text-brand-rose\",\n bg: \"bg-brand-rose/10\",\n bgSolid: \"bg-brand-rose/15\",\n from: \"from-brand-rose/20\",\n to: \"to-brand-rose/20\",\n },\n orange: {\n text: \"text-brand-orange\",\n bg: \"bg-brand-orange/10\",\n bgSolid: \"bg-brand-orange/15\",\n from: \"from-brand-orange/20\",\n to: \"to-brand-orange/20\",\n },\n navy: {\n text: \"text-brand-navy\",\n bg: \"bg-brand-navy/10\",\n from: \"from-brand-navy/10\",\n to: \"to-brand-navy/10\",\n },\n} as const;\n"],"mappings":"AAMO,MAAM,QAAQ;AAAA,EACnB,QAAQ;AAAA,IACN,MAAS;AAAA,IACT,IAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAS;AAAA,IACT,IAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,MAAS;AAAA,IACT,IAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAS;AAAA,IACT,IAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,MAAS;AAAA,IACT,IAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAS;AAAA,IACT,IAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACN,MAAS;AAAA,IACT,IAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAS;AAAA,IACT,IAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,MAAS;AAAA,IACT,IAAS;AAAA,IACT,MAAS;AAAA,IACT,IAAS;AAAA,EACX;AACF;","names":[]}
package/dist/index.cjs CHANGED
@@ -18,27 +18,38 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var index_exports = {};
20
20
  __export(index_exports, {
21
+ AddressDisplay: () => import_address_display.AddressDisplay,
22
+ BRAND: () => import_brand.BRAND,
21
23
  CurrencyAmount: () => import_currency_icon.CurrencyAmount,
22
24
  CurrencyIcon: () => import_currency_icon.CurrencyIcon,
23
25
  IP_TYPE_CONFIG: () => import_ip_type_badge.IP_TYPE_CONFIG,
24
- IP_TYPE_DATA: () => import_ip_type_badge.IP_TYPE_DATA,
25
- IP_TYPE_DATA_MAP: () => import_ip_type_badge.IP_TYPE_DATA_MAP,
26
+ IP_TYPE_DATA: () => import_ip_types.IP_TYPE_DATA,
27
+ IP_TYPE_DATA_MAP: () => import_ip_types.IP_TYPE_DATA_MAP,
26
28
  IP_TYPE_MAP: () => import_ip_type_badge.IP_TYPE_MAP,
27
29
  IpTypeBadge: () => import_ip_type_badge.IpTypeBadge,
28
30
  MedialaneIcon: () => import_brand_icon.MedialaneIcon,
29
31
  MedialaneLogoFull: () => import_brand_logo.MedialaneLogoFull,
30
32
  cn: () => import_cn.cn,
31
- formatDisplayPrice: () => import_format.formatDisplayPrice
33
+ formatDisplayPrice: () => import_format.formatDisplayPrice,
34
+ ipfsToHttp: () => import_ipfs.ipfsToHttp,
35
+ shortenAddress: () => import_address.shortenAddress
32
36
  });
33
37
  module.exports = __toCommonJS(index_exports);
34
38
  var import_cn = require("./utils/cn.js");
35
39
  var import_format = require("./utils/format.js");
40
+ var import_address = require("./utils/address.js");
41
+ var import_ipfs = require("./utils/ipfs.js");
42
+ var import_ip_types = require("./data/ip-types.js");
43
+ var import_brand = require("./data/brand.js");
36
44
  var import_currency_icon = require("./components/currency-icon.js");
37
45
  var import_ip_type_badge = require("./components/ip-type-badge.js");
46
+ var import_address_display = require("./components/address-display.js");
38
47
  var import_brand_icon = require("./components/brand-icon.js");
39
48
  var import_brand_logo = require("./components/brand-logo.js");
40
49
  // Annotate the CommonJS export names for ESM import in node:
41
50
  0 && (module.exports = {
51
+ AddressDisplay,
52
+ BRAND,
42
53
  CurrencyAmount,
43
54
  CurrencyIcon,
44
55
  IP_TYPE_CONFIG,
@@ -49,6 +60,8 @@ var import_brand_logo = require("./components/brand-logo.js");
49
60
  MedialaneIcon,
50
61
  MedialaneLogoFull,
51
62
  cn,
52
- formatDisplayPrice
63
+ formatDisplayPrice,
64
+ ipfsToHttp,
65
+ shortenAddress
53
66
  });
54
67
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAmB;AACnB,oBAAmC;AAEnC,2BAA6C;AAG7C,2BAAyF;AAGzF,wBAA8B;AAE9B,wBAAkC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// ── Utils ─────────────────────────────────────────────────────────────────────\nexport { cn } from \"./utils/cn.js\";\nexport { formatDisplayPrice } from \"./utils/format.js\";\nexport { shortenAddress } from \"./utils/address.js\";\nexport { ipfsToHttp } from \"./utils/ipfs.js\";\n\n// ── Data (server-safe — no React, safe in Server Components) ──────────────────\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"./data/ip-types.js\";\nexport type { IpTypeData } from \"./data/ip-types.js\";\nexport { BRAND } from \"./data/brand.js\";\n\n// ── Components (client-only — all have \"use client\") ─────────────────────────\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 } from \"./components/ip-type-badge.js\";\nexport type { IpTypeBadgeProps, IpTypeConfig } from \"./components/ip-type-badge.js\";\n\nexport { AddressDisplay } from \"./components/address-display.js\";\nexport type { AddressDisplayProps } from \"./components/address-display.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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,gBAAmB;AACnB,oBAAmC;AACnC,qBAA+B;AAC/B,kBAA2B;AAG3B,sBAA+C;AAE/C,mBAAsB;AAGtB,2BAA6C;AAG7C,2BAAyD;AAGzD,6BAA+B;AAG/B,wBAA8B;AAE9B,wBAAkC;","names":[]}
package/dist/index.d.cts CHANGED
@@ -1,9 +1,13 @@
1
1
  export { cn } from './utils/cn.cjs';
2
2
  export { formatDisplayPrice } from './utils/format.cjs';
3
+ export { shortenAddress } from './utils/address.cjs';
4
+ export { ipfsToHttp } from './utils/ipfs.cjs';
5
+ export { IP_TYPE_DATA, IP_TYPE_DATA_MAP, IpTypeData } from './data/ip-types.cjs';
6
+ export { BRAND } from './data/brand.cjs';
3
7
  export { CurrencyAmount, CurrencyAmountProps, CurrencyIcon, CurrencyIconProps } from './components/currency-icon.cjs';
4
8
  export { IP_TYPE_CONFIG, IP_TYPE_MAP, IpTypeBadge, IpTypeBadgeProps, IpTypeConfig } from './components/ip-type-badge.cjs';
9
+ export { AddressDisplay, AddressDisplayProps } from './components/address-display.cjs';
5
10
  export { MedialaneIcon, MedialaneIconProps } from './components/brand-icon.cjs';
6
11
  export { MedialaneLogoFull, MedialaneLogoFullProps } from './components/brand-logo.cjs';
7
- export { IP_TYPE_DATA, IP_TYPE_DATA_MAP, IpTypeData } from './data/ip-types.cjs';
8
12
  import 'clsx';
9
13
  import 'react/jsx-runtime';
package/dist/index.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  export { cn } from './utils/cn.js';
2
2
  export { formatDisplayPrice } from './utils/format.js';
3
+ export { shortenAddress } from './utils/address.js';
4
+ export { ipfsToHttp } from './utils/ipfs.js';
5
+ export { IP_TYPE_DATA, IP_TYPE_DATA_MAP, IpTypeData } from './data/ip-types.js';
6
+ export { BRAND } from './data/brand.js';
3
7
  export { CurrencyAmount, CurrencyAmountProps, CurrencyIcon, CurrencyIconProps } from './components/currency-icon.js';
4
8
  export { IP_TYPE_CONFIG, IP_TYPE_MAP, IpTypeBadge, IpTypeBadgeProps, IpTypeConfig } from './components/ip-type-badge.js';
9
+ export { AddressDisplay, AddressDisplayProps } from './components/address-display.js';
5
10
  export { MedialaneIcon, MedialaneIconProps } from './components/brand-icon.js';
6
11
  export { MedialaneLogoFull, MedialaneLogoFullProps } from './components/brand-logo.js';
7
- export { IP_TYPE_DATA, IP_TYPE_DATA_MAP, IpTypeData } from './data/ip-types.js';
8
12
  import 'clsx';
9
13
  import 'react/jsx-runtime';
package/dist/index.js CHANGED
@@ -1,10 +1,17 @@
1
1
  import { cn } from "./utils/cn.js";
2
2
  import { formatDisplayPrice } from "./utils/format.js";
3
+ import { shortenAddress } from "./utils/address.js";
4
+ import { ipfsToHttp } from "./utils/ipfs.js";
5
+ import { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from "./data/ip-types.js";
6
+ import { BRAND } from "./data/brand.js";
3
7
  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";
8
+ import { IpTypeBadge, IP_TYPE_CONFIG, IP_TYPE_MAP } from "./components/ip-type-badge.js";
9
+ import { AddressDisplay } from "./components/address-display.js";
5
10
  import { MedialaneIcon } from "./components/brand-icon.js";
6
11
  import { MedialaneLogoFull } from "./components/brand-logo.js";
7
12
  export {
13
+ AddressDisplay,
14
+ BRAND,
8
15
  CurrencyAmount,
9
16
  CurrencyIcon,
10
17
  IP_TYPE_CONFIG,
@@ -15,6 +22,8 @@ export {
15
22
  MedialaneIcon,
16
23
  MedialaneLogoFull,
17
24
  cn,
18
- formatDisplayPrice
25
+ formatDisplayPrice,
26
+ ipfsToHttp,
27
+ shortenAddress
19
28
  };
20
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// ── Utils ─────────────────────────────────────────────────────────────────────\nexport { cn } from \"./utils/cn.js\";\nexport { formatDisplayPrice } from \"./utils/format.js\";\nexport { shortenAddress } from \"./utils/address.js\";\nexport { ipfsToHttp } from \"./utils/ipfs.js\";\n\n// ── Data (server-safe — no React, safe in Server Components) ──────────────────\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"./data/ip-types.js\";\nexport type { IpTypeData } from \"./data/ip-types.js\";\nexport { BRAND } from \"./data/brand.js\";\n\n// ── Components (client-only — all have \"use client\") ─────────────────────────\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 } from \"./components/ip-type-badge.js\";\nexport type { IpTypeBadgeProps, IpTypeConfig } from \"./components/ip-type-badge.js\";\n\nexport { AddressDisplay } from \"./components/address-display.js\";\nexport type { AddressDisplayProps } from \"./components/address-display.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":"AACA,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAG3B,SAAS,cAAc,wBAAwB;AAE/C,SAAS,aAAa;AAGtB,SAAS,cAAc,sBAAsB;AAG7C,SAAS,aAAa,gBAAgB,mBAAmB;AAGzD,SAAS,sBAAsB;AAG/B,SAAS,qBAAqB;AAE9B,SAAS,yBAAyB;","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 address_exports = {};
20
+ __export(address_exports, {
21
+ shortenAddress: () => shortenAddress
22
+ });
23
+ module.exports = __toCommonJS(address_exports);
24
+ function shortenAddress(address, chars = 4) {
25
+ if (!address) return "";
26
+ if (address.length <= chars * 2 + 2) return address;
27
+ return `${address.slice(0, chars + 2)}\u2026${address.slice(-chars)}`;
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ shortenAddress
32
+ });
33
+ //# sourceMappingURL=address.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/address.ts"],"sourcesContent":["/**\n * Shorten a hex address to a prefix…suffix format.\n * Example: \"0x1234567890abcdef\" → \"0x1234…cdef\"\n */\nexport function shortenAddress(address: string, chars = 4): string {\n if (!address) return \"\";\n if (address.length <= chars * 2 + 2) return address;\n return `${address.slice(0, chars + 2)}…${address.slice(-chars)}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,SAAS,eAAe,SAAiB,QAAQ,GAAW;AACjE,MAAI,CAAC,QAAS,QAAO;AACrB,MAAI,QAAQ,UAAU,QAAQ,IAAI,EAAG,QAAO;AAC5C,SAAO,GAAG,QAAQ,MAAM,GAAG,QAAQ,CAAC,CAAC,SAAI,QAAQ,MAAM,CAAC,KAAK,CAAC;AAChE;","names":[]}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shorten a hex address to a prefix…suffix format.
3
+ * Example: "0x1234567890abcdef" → "0x1234…cdef"
4
+ */
5
+ declare function shortenAddress(address: string, chars?: number): string;
6
+
7
+ export { shortenAddress };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shorten a hex address to a prefix…suffix format.
3
+ * Example: "0x1234567890abcdef" → "0x1234…cdef"
4
+ */
5
+ declare function shortenAddress(address: string, chars?: number): string;
6
+
7
+ export { shortenAddress };
@@ -0,0 +1,9 @@
1
+ function shortenAddress(address, chars = 4) {
2
+ if (!address) return "";
3
+ if (address.length <= chars * 2 + 2) return address;
4
+ return `${address.slice(0, chars + 2)}\u2026${address.slice(-chars)}`;
5
+ }
6
+ export {
7
+ shortenAddress
8
+ };
9
+ //# sourceMappingURL=address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/address.ts"],"sourcesContent":["/**\n * Shorten a hex address to a prefix…suffix format.\n * Example: \"0x1234567890abcdef\" → \"0x1234…cdef\"\n */\nexport function shortenAddress(address: string, chars = 4): string {\n if (!address) return \"\";\n if (address.length <= chars * 2 + 2) return address;\n return `${address.slice(0, chars + 2)}…${address.slice(-chars)}`;\n}\n"],"mappings":"AAIO,SAAS,eAAe,SAAiB,QAAQ,GAAW;AACjE,MAAI,CAAC,QAAS,QAAO;AACrB,MAAI,QAAQ,UAAU,QAAQ,IAAI,EAAG,QAAO;AAC5C,SAAO,GAAG,QAAQ,MAAM,GAAG,QAAQ,CAAC,CAAC,SAAI,QAAQ,MAAM,CAAC,KAAK,CAAC;AAChE;","names":[]}
@@ -0,0 +1,36 @@
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 ipfs_exports = {};
20
+ __export(ipfs_exports, {
21
+ ipfsToHttp: () => ipfsToHttp
22
+ });
23
+ module.exports = __toCommonJS(ipfs_exports);
24
+ const DEFAULT_GATEWAY = "https://ipfs.io/ipfs/";
25
+ function ipfsToHttp(uri, gateway = DEFAULT_GATEWAY) {
26
+ if (!uri) return "";
27
+ if (uri.startsWith("ipfs://")) {
28
+ return uri.replace("ipfs://", gateway);
29
+ }
30
+ return uri;
31
+ }
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ ipfsToHttp
35
+ });
36
+ //# sourceMappingURL=ipfs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/ipfs.ts"],"sourcesContent":["const DEFAULT_GATEWAY = \"https://ipfs.io/ipfs/\";\n\n/**\n * Convert an IPFS URI to an HTTP URL.\n * Accepts ipfs://<cid>, ipfs://<cid>/<path>, or plain HTTP URLs (returned as-is).\n *\n * @param uri - The IPFS URI or HTTP URL to convert.\n * @param gateway - Gateway base URL (default: ipfs.io). Should end without a trailing slash.\n */\nexport function ipfsToHttp(\n uri: string | null | undefined,\n gateway = DEFAULT_GATEWAY\n): string {\n if (!uri) return \"\";\n if (uri.startsWith(\"ipfs://\")) {\n return uri.replace(\"ipfs://\", gateway);\n }\n return uri;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,kBAAkB;AASjB,SAAS,WACd,KACA,UAAU,iBACF;AACR,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI,IAAI,WAAW,SAAS,GAAG;AAC7B,WAAO,IAAI,QAAQ,WAAW,OAAO;AAAA,EACvC;AACA,SAAO;AACT;","names":[]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Convert an IPFS URI to an HTTP URL.
3
+ * Accepts ipfs://<cid>, ipfs://<cid>/<path>, or plain HTTP URLs (returned as-is).
4
+ *
5
+ * @param uri - The IPFS URI or HTTP URL to convert.
6
+ * @param gateway - Gateway base URL (default: ipfs.io). Should end without a trailing slash.
7
+ */
8
+ declare function ipfsToHttp(uri: string | null | undefined, gateway?: string): string;
9
+
10
+ export { ipfsToHttp };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Convert an IPFS URI to an HTTP URL.
3
+ * Accepts ipfs://<cid>, ipfs://<cid>/<path>, or plain HTTP URLs (returned as-is).
4
+ *
5
+ * @param uri - The IPFS URI or HTTP URL to convert.
6
+ * @param gateway - Gateway base URL (default: ipfs.io). Should end without a trailing slash.
7
+ */
8
+ declare function ipfsToHttp(uri: string | null | undefined, gateway?: string): string;
9
+
10
+ export { ipfsToHttp };
@@ -0,0 +1,12 @@
1
+ const DEFAULT_GATEWAY = "https://ipfs.io/ipfs/";
2
+ function ipfsToHttp(uri, gateway = DEFAULT_GATEWAY) {
3
+ if (!uri) return "";
4
+ if (uri.startsWith("ipfs://")) {
5
+ return uri.replace("ipfs://", gateway);
6
+ }
7
+ return uri;
8
+ }
9
+ export {
10
+ ipfsToHttp
11
+ };
12
+ //# sourceMappingURL=ipfs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/ipfs.ts"],"sourcesContent":["const DEFAULT_GATEWAY = \"https://ipfs.io/ipfs/\";\n\n/**\n * Convert an IPFS URI to an HTTP URL.\n * Accepts ipfs://<cid>, ipfs://<cid>/<path>, or plain HTTP URLs (returned as-is).\n *\n * @param uri - The IPFS URI or HTTP URL to convert.\n * @param gateway - Gateway base URL (default: ipfs.io). Should end without a trailing slash.\n */\nexport function ipfsToHttp(\n uri: string | null | undefined,\n gateway = DEFAULT_GATEWAY\n): string {\n if (!uri) return \"\";\n if (uri.startsWith(\"ipfs://\")) {\n return uri.replace(\"ipfs://\", gateway);\n }\n return uri;\n}\n"],"mappings":"AAAA,MAAM,kBAAkB;AASjB,SAAS,WACd,KACA,UAAU,iBACF;AACR,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI,IAAI,WAAW,SAAS,GAAG;AAC7B,WAAO,IAAI,QAAQ,WAAW,OAAO;AAAA,EACvC;AACA,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medialane/ui",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Shared UI components for Medialane apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",