@medialane/ui 0.271.0 → 0.273.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/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/asset-page.cjs +0 -5
- package/dist/components/asset-page.cjs.map +1 -1
- package/dist/components/asset-page.js +0 -5
- package/dist/components/asset-page.js.map +1 -1
- package/dist/components/asset-publication.cjs +2 -2
- package/dist/components/asset-publication.cjs.map +1 -1
- package/dist/components/asset-publication.d.cts +1 -2
- package/dist/components/asset-publication.d.ts +1 -2
- package/dist/components/asset-publication.js +2 -2
- package/dist/components/asset-publication.js.map +1 -1
- package/dist/components/asset-top-sections.cjs +1 -30
- package/dist/components/asset-top-sections.cjs.map +1 -1
- package/dist/components/asset-top-sections.d.cts +1 -2
- package/dist/components/asset-top-sections.d.ts +1 -2
- package/dist/components/asset-top-sections.js +1 -30
- package/dist/components/asset-top-sections.js.map +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- 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/ipfs-gateway-fallback.cjs +35 -0
- package/dist/components/ipfs-gateway-fallback.cjs.map +1 -0
- package/dist/components/ipfs-gateway-fallback.d.cts +10 -0
- package/dist/components/ipfs-gateway-fallback.d.ts +10 -0
- package/dist/components/ipfs-gateway-fallback.js +11 -0
- package/dist/components/ipfs-gateway-fallback.js.map +1 -0
- package/dist/components/launchpad/edition-mint-schema.d.cts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/index.cjs +8 -3
- 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 +5 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/ipfs-gateway-fallback.cjs +47 -0
- package/dist/utils/ipfs-gateway-fallback.cjs.map +1 -0
- package/dist/utils/ipfs-gateway-fallback.d.cts +15 -0
- package/dist/utils/ipfs-gateway-fallback.d.ts +15 -0
- package/dist/utils/ipfs-gateway-fallback.js +22 -0
- package/dist/utils/ipfs-gateway-fallback.js.map +1 -0
- package/package.json +1 -1
- package/dist/components/asset-lightbox.cjs +0 -65
- package/dist/components/asset-lightbox.cjs.map +0 -1
- package/dist/components/asset-lightbox.d.cts +0 -11
- package/dist/components/asset-lightbox.d.ts +0 -11
- package/dist/components/asset-lightbox.js +0 -41
- package/dist/components/asset-lightbox.js.map +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
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_gateway_fallback_exports = {};
|
|
20
|
+
__export(ipfs_gateway_fallback_exports, {
|
|
21
|
+
gatewayFallbackSrc: () => gatewayFallbackSrc,
|
|
22
|
+
installIpfsGatewayFallback: () => installIpfsGatewayFallback
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ipfs_gateway_fallback_exports);
|
|
25
|
+
function gatewayFallbackSrc(src, primary, fallback) {
|
|
26
|
+
if (primary === fallback || !src.startsWith(primary)) return null;
|
|
27
|
+
return fallback + src.slice(primary.length).split("?")[0];
|
|
28
|
+
}
|
|
29
|
+
function installIpfsGatewayFallback(primary, fallback, root = document) {
|
|
30
|
+
const onError = (event) => {
|
|
31
|
+
const img = event.target;
|
|
32
|
+
if (!(img instanceof HTMLImageElement)) return;
|
|
33
|
+
const next = gatewayFallbackSrc(img.getAttribute("src") ?? "", primary, fallback);
|
|
34
|
+
if (!next) return;
|
|
35
|
+
event.stopPropagation();
|
|
36
|
+
img.removeAttribute("srcset");
|
|
37
|
+
img.setAttribute("src", next);
|
|
38
|
+
};
|
|
39
|
+
root.addEventListener("error", onError, true);
|
|
40
|
+
return () => root.removeEventListener("error", onError, true);
|
|
41
|
+
}
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
gatewayFallbackSrc,
|
|
45
|
+
installIpfsGatewayFallback
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=ipfs-gateway-fallback.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/ipfs-gateway-fallback.ts"],"sourcesContent":["/**\n * The same IPFS path on the fallback gateway, or null when `src` is not served by `primary`.\n * The query is dropped: resize options are specific to the primary gateway.\n */\nexport function gatewayFallbackSrc(src: string, primary: string, fallback: string): string | null {\n if (primary === fallback || !src.startsWith(primary)) return null;\n return fallback + src.slice(primary.length).split(\"?\")[0];\n}\n\n/**\n * When an image from `primary` fails to load, loads the same file from `fallback` instead.\n *\n * Listens for image errors on the whole document (they reach it in the capture phase), so it\n * covers every image whichever component renders it. The switched image's own error handlers\n * do not run; if the fallback fails as well, they do. Returns a function that uninstalls it.\n */\nexport function installIpfsGatewayFallback(primary: string, fallback: string, root: Document = document): () => void {\n const onError = (event: Event) => {\n const img = event.target;\n if (!(img instanceof HTMLImageElement)) return;\n const next = gatewayFallbackSrc(img.getAttribute(\"src\") ?? \"\", primary, fallback);\n if (!next) return;\n event.stopPropagation();\n img.removeAttribute(\"srcset\");\n img.setAttribute(\"src\", next);\n };\n root.addEventListener(\"error\", onError, true);\n return () => root.removeEventListener(\"error\", onError, true);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,SAAS,mBAAmB,KAAa,SAAiB,UAAiC;AAChG,MAAI,YAAY,YAAY,CAAC,IAAI,WAAW,OAAO,EAAG,QAAO;AAC7D,SAAO,WAAW,IAAI,MAAM,QAAQ,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC;AAC1D;AASO,SAAS,2BAA2B,SAAiB,UAAkB,OAAiB,UAAsB;AACnH,QAAM,UAAU,CAAC,UAAiB;AAChC,UAAM,MAAM,MAAM;AAClB,QAAI,EAAE,eAAe,kBAAmB;AACxC,UAAM,OAAO,mBAAmB,IAAI,aAAa,KAAK,KAAK,IAAI,SAAS,QAAQ;AAChF,QAAI,CAAC,KAAM;AACX,UAAM,gBAAgB;AACtB,QAAI,gBAAgB,QAAQ;AAC5B,QAAI,aAAa,OAAO,IAAI;AAAA,EAC9B;AACA,OAAK,iBAAiB,SAAS,SAAS,IAAI;AAC5C,SAAO,MAAM,KAAK,oBAAoB,SAAS,SAAS,IAAI;AAC9D;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The same IPFS path on the fallback gateway, or null when `src` is not served by `primary`.
|
|
3
|
+
* The query is dropped: resize options are specific to the primary gateway.
|
|
4
|
+
*/
|
|
5
|
+
declare function gatewayFallbackSrc(src: string, primary: string, fallback: string): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* When an image from `primary` fails to load, loads the same file from `fallback` instead.
|
|
8
|
+
*
|
|
9
|
+
* Listens for image errors on the whole document (they reach it in the capture phase), so it
|
|
10
|
+
* covers every image whichever component renders it. The switched image's own error handlers
|
|
11
|
+
* do not run; if the fallback fails as well, they do. Returns a function that uninstalls it.
|
|
12
|
+
*/
|
|
13
|
+
declare function installIpfsGatewayFallback(primary: string, fallback: string, root?: Document): () => void;
|
|
14
|
+
|
|
15
|
+
export { gatewayFallbackSrc, installIpfsGatewayFallback };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The same IPFS path on the fallback gateway, or null when `src` is not served by `primary`.
|
|
3
|
+
* The query is dropped: resize options are specific to the primary gateway.
|
|
4
|
+
*/
|
|
5
|
+
declare function gatewayFallbackSrc(src: string, primary: string, fallback: string): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* When an image from `primary` fails to load, loads the same file from `fallback` instead.
|
|
8
|
+
*
|
|
9
|
+
* Listens for image errors on the whole document (they reach it in the capture phase), so it
|
|
10
|
+
* covers every image whichever component renders it. The switched image's own error handlers
|
|
11
|
+
* do not run; if the fallback fails as well, they do. Returns a function that uninstalls it.
|
|
12
|
+
*/
|
|
13
|
+
declare function installIpfsGatewayFallback(primary: string, fallback: string, root?: Document): () => void;
|
|
14
|
+
|
|
15
|
+
export { gatewayFallbackSrc, installIpfsGatewayFallback };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function gatewayFallbackSrc(src, primary, fallback) {
|
|
2
|
+
if (primary === fallback || !src.startsWith(primary)) return null;
|
|
3
|
+
return fallback + src.slice(primary.length).split("?")[0];
|
|
4
|
+
}
|
|
5
|
+
function installIpfsGatewayFallback(primary, fallback, root = document) {
|
|
6
|
+
const onError = (event) => {
|
|
7
|
+
const img = event.target;
|
|
8
|
+
if (!(img instanceof HTMLImageElement)) return;
|
|
9
|
+
const next = gatewayFallbackSrc(img.getAttribute("src") ?? "", primary, fallback);
|
|
10
|
+
if (!next) return;
|
|
11
|
+
event.stopPropagation();
|
|
12
|
+
img.removeAttribute("srcset");
|
|
13
|
+
img.setAttribute("src", next);
|
|
14
|
+
};
|
|
15
|
+
root.addEventListener("error", onError, true);
|
|
16
|
+
return () => root.removeEventListener("error", onError, true);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
gatewayFallbackSrc,
|
|
20
|
+
installIpfsGatewayFallback
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=ipfs-gateway-fallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/ipfs-gateway-fallback.ts"],"sourcesContent":["/**\n * The same IPFS path on the fallback gateway, or null when `src` is not served by `primary`.\n * The query is dropped: resize options are specific to the primary gateway.\n */\nexport function gatewayFallbackSrc(src: string, primary: string, fallback: string): string | null {\n if (primary === fallback || !src.startsWith(primary)) return null;\n return fallback + src.slice(primary.length).split(\"?\")[0];\n}\n\n/**\n * When an image from `primary` fails to load, loads the same file from `fallback` instead.\n *\n * Listens for image errors on the whole document (they reach it in the capture phase), so it\n * covers every image whichever component renders it. The switched image's own error handlers\n * do not run; if the fallback fails as well, they do. Returns a function that uninstalls it.\n */\nexport function installIpfsGatewayFallback(primary: string, fallback: string, root: Document = document): () => void {\n const onError = (event: Event) => {\n const img = event.target;\n if (!(img instanceof HTMLImageElement)) return;\n const next = gatewayFallbackSrc(img.getAttribute(\"src\") ?? \"\", primary, fallback);\n if (!next) return;\n event.stopPropagation();\n img.removeAttribute(\"srcset\");\n img.setAttribute(\"src\", next);\n };\n root.addEventListener(\"error\", onError, true);\n return () => root.removeEventListener(\"error\", onError, true);\n}\n"],"mappings":"AAIO,SAAS,mBAAmB,KAAa,SAAiB,UAAiC;AAChG,MAAI,YAAY,YAAY,CAAC,IAAI,WAAW,OAAO,EAAG,QAAO;AAC7D,SAAO,WAAW,IAAI,MAAM,QAAQ,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC;AAC1D;AASO,SAAS,2BAA2B,SAAiB,UAAkB,OAAiB,UAAsB;AACnH,QAAM,UAAU,CAAC,UAAiB;AAChC,UAAM,MAAM,MAAM;AAClB,QAAI,EAAE,eAAe,kBAAmB;AACxC,UAAM,OAAO,mBAAmB,IAAI,aAAa,KAAK,KAAK,IAAI,SAAS,QAAQ;AAChF,QAAI,CAAC,KAAM;AACX,UAAM,gBAAgB;AACtB,QAAI,gBAAgB,QAAQ;AAC5B,QAAI,aAAa,OAAO,IAAI;AAAA,EAC9B;AACA,OAAK,iBAAiB,SAAS,SAAS,IAAI;AAC5C,SAAO,MAAM,KAAK,oBAAoB,SAAS,SAAS,IAAI;AAC9D;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,65 +0,0 @@
|
|
|
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 asset_lightbox_exports = {};
|
|
21
|
-
__export(asset_lightbox_exports, {
|
|
22
|
-
AssetLightbox: () => AssetLightbox
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(asset_lightbox_exports);
|
|
25
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
-
var import_lucide_react = require("lucide-react");
|
|
27
|
-
var import_dialog = require("./dialog.js");
|
|
28
|
-
function AssetLightbox({ open, onOpenChange, image, alt }) {
|
|
29
|
-
if (!image) return null;
|
|
30
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
31
|
-
import_dialog.DialogContent,
|
|
32
|
-
{
|
|
33
|
-
hideClose: true,
|
|
34
|
-
className: "max-w-[96vw] sm:max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none",
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, { className: "sr-only", children: alt }),
|
|
37
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
|
|
38
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
-
"img",
|
|
40
|
-
{
|
|
41
|
-
src: image,
|
|
42
|
-
alt,
|
|
43
|
-
style: { maxHeight: "92svh", maxWidth: "96vw" },
|
|
44
|
-
className: "block h-auto w-auto object-contain rounded-2xl"
|
|
45
|
-
}
|
|
46
|
-
),
|
|
47
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
-
"button",
|
|
49
|
-
{
|
|
50
|
-
onClick: () => onOpenChange(false),
|
|
51
|
-
"aria-label": "Close",
|
|
52
|
-
className: "absolute top-3 right-3 h-8 w-8 rounded-full bg-black/55 backdrop-blur-sm border border-white/10 flex items-center justify-center text-white/75 hover:text-white hover:bg-black/80 transition-all",
|
|
53
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-4 w-4" })
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
] })
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
) });
|
|
60
|
-
}
|
|
61
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
-
0 && (module.exports = {
|
|
63
|
-
AssetLightbox
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=asset-lightbox.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-lightbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { X } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\n\nexport interface AssetLightboxProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n image: string | null;\n alt: string;\n}\n\nexport function AssetLightbox({ open, onOpenChange, image, alt }: AssetLightboxProps) {\n if (!image) return null;\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n hideClose\n className=\"max-w-[96vw] sm:max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none\"\n >\n <DialogTitle className=\"sr-only\">{alt}</DialogTitle>\n <div className=\"relative\">\n\n <img\n src={image}\n alt={alt}\n style={{ maxHeight: \"92svh\", maxWidth: \"96vw\" }}\n className=\"block h-auto w-auto object-contain rounded-2xl\"\n />\n <button\n onClick={() => onOpenChange(false)}\n aria-label=\"Close\"\n className=\"absolute top-3 right-3 h-8 w-8 rounded-full bg-black/55 backdrop-blur-sm border border-white/10 flex items-center justify-center text-white/75 hover:text-white hover:bg-black/80 transition-all\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBQ;AAnBR,0BAAkB;AAClB,oBAAmD;AAS5C,SAAS,cAAc,EAAE,MAAM,cAAc,OAAO,IAAI,GAAuB;AACpF,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,4CAAC,wBAAO,MAAY,cAClB;AAAA,IAAC;AAAA;AAAA,MACC,WAAS;AAAA,MACT,WAAU;AAAA,MAEV;AAAA,oDAAC,6BAAY,WAAU,WAAW,eAAI;AAAA,QACtC,6CAAC,SAAI,WAAU,YAEb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL;AAAA,cACA,OAAO,EAAE,WAAW,SAAS,UAAU,OAAO;AAAA,cAC9C,WAAU;AAAA;AAAA,UACZ;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS,MAAM,aAAa,KAAK;AAAA,cACjC,cAAW;AAAA,cACX,WAAU;AAAA,cAEV,sDAAC,yBAAE,WAAU,WAAU;AAAA;AAAA,UACzB;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
interface AssetLightboxProps {
|
|
4
|
-
open: boolean;
|
|
5
|
-
onOpenChange: (open: boolean) => void;
|
|
6
|
-
image: string | null;
|
|
7
|
-
alt: string;
|
|
8
|
-
}
|
|
9
|
-
declare function AssetLightbox({ open, onOpenChange, image, alt }: AssetLightboxProps): react_jsx_runtime.JSX.Element | null;
|
|
10
|
-
|
|
11
|
-
export { AssetLightbox, type AssetLightboxProps };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
interface AssetLightboxProps {
|
|
4
|
-
open: boolean;
|
|
5
|
-
onOpenChange: (open: boolean) => void;
|
|
6
|
-
image: string | null;
|
|
7
|
-
alt: string;
|
|
8
|
-
}
|
|
9
|
-
declare function AssetLightbox({ open, onOpenChange, image, alt }: AssetLightboxProps): react_jsx_runtime.JSX.Element | null;
|
|
10
|
-
|
|
11
|
-
export { AssetLightbox, type AssetLightboxProps };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { X } from "lucide-react";
|
|
4
|
-
import { Dialog, DialogContent, DialogTitle } from "./dialog.js";
|
|
5
|
-
function AssetLightbox({ open, onOpenChange, image, alt }) {
|
|
6
|
-
if (!image) return null;
|
|
7
|
-
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(
|
|
8
|
-
DialogContent,
|
|
9
|
-
{
|
|
10
|
-
hideClose: true,
|
|
11
|
-
className: "max-w-[96vw] sm:max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none",
|
|
12
|
-
children: [
|
|
13
|
-
/* @__PURE__ */ jsx(DialogTitle, { className: "sr-only", children: alt }),
|
|
14
|
-
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
15
|
-
/* @__PURE__ */ jsx(
|
|
16
|
-
"img",
|
|
17
|
-
{
|
|
18
|
-
src: image,
|
|
19
|
-
alt,
|
|
20
|
-
style: { maxHeight: "92svh", maxWidth: "96vw" },
|
|
21
|
-
className: "block h-auto w-auto object-contain rounded-2xl"
|
|
22
|
-
}
|
|
23
|
-
),
|
|
24
|
-
/* @__PURE__ */ jsx(
|
|
25
|
-
"button",
|
|
26
|
-
{
|
|
27
|
-
onClick: () => onOpenChange(false),
|
|
28
|
-
"aria-label": "Close",
|
|
29
|
-
className: "absolute top-3 right-3 h-8 w-8 rounded-full bg-black/55 backdrop-blur-sm border border-white/10 flex items-center justify-center text-white/75 hover:text-white hover:bg-black/80 transition-all",
|
|
30
|
-
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
] })
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
) });
|
|
37
|
-
}
|
|
38
|
-
export {
|
|
39
|
-
AssetLightbox
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=asset-lightbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-lightbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { X } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\n\nexport interface AssetLightboxProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n image: string | null;\n alt: string;\n}\n\nexport function AssetLightbox({ open, onOpenChange, image, alt }: AssetLightboxProps) {\n if (!image) return null;\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n hideClose\n className=\"max-w-[96vw] sm:max-w-[96vw] w-fit max-h-none overflow-visible border-0 bg-transparent p-0 shadow-none\"\n >\n <DialogTitle className=\"sr-only\">{alt}</DialogTitle>\n <div className=\"relative\">\n\n <img\n src={image}\n alt={alt}\n style={{ maxHeight: \"92svh\", maxWidth: \"96vw\" }}\n className=\"block h-auto w-auto object-contain rounded-2xl\"\n />\n <button\n onClick={() => onOpenChange(false)}\n aria-label=\"Close\"\n className=\"absolute top-3 right-3 h-8 w-8 rounded-full bg-black/55 backdrop-blur-sm border border-white/10 flex items-center justify-center text-white/75 hover:text-white hover:bg-black/80 transition-all\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAqBQ,cACA,YADA;AAnBR,SAAS,SAAS;AAClB,SAAS,QAAQ,eAAe,mBAAmB;AAS5C,SAAS,cAAc,EAAE,MAAM,cAAc,OAAO,IAAI,GAAuB;AACpF,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,oBAAC,UAAO,MAAY,cAClB;AAAA,IAAC;AAAA;AAAA,MACC,WAAS;AAAA,MACT,WAAU;AAAA,MAEV;AAAA,4BAAC,eAAY,WAAU,WAAW,eAAI;AAAA,QACtC,qBAAC,SAAI,WAAU,YAEb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL;AAAA,cACA,OAAO,EAAE,WAAW,SAAS,UAAU,OAAO;AAAA,cAC9C,WAAU;AAAA;AAAA,UACZ;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS,MAAM,aAAa,KAAK;AAAA,cACjC,cAAW;AAAA,cACX,WAAU;AAAA,cAEV,8BAAC,KAAE,WAAU,WAAU;AAAA;AAAA,UACzB;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|