@xiping/react-components 1.0.25 → 1.0.27
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/cjs/components/comic-text/ComicText.d.ts +9 -0
- package/dist/cjs/components/comic-text/ComicText.js +4 -0
- package/dist/cjs/components/comic-text/index.d.ts +1 -0
- package/dist/cjs/components/flip-text/FlipText.d.ts +20 -0
- package/dist/cjs/components/flip-text/FlipText.js +1 -0
- package/dist/cjs/components/flip-text/index.d.ts +1 -0
- package/dist/cjs/components/image-viewer/ImageThumbnails.d.ts +7 -0
- package/dist/cjs/components/image-viewer/ImageThumbnails.js +1 -0
- package/dist/cjs/components/image-viewer/ImageViewer.js +2 -2
- package/dist/cjs/components/image-viewer/index.d.ts +1 -3
- package/dist/cjs/components/video-dialog/VideoDialog.d.ts +10 -0
- package/dist/cjs/components/video-dialog/VideoDialog.js +1 -0
- package/dist/cjs/components/video-dialog/index.d.ts +1 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/Icon.js +6 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/createLucideIcon.js +6 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/defaultAttributes.js +6 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/play.js +6 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/x.js +6 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/shared/src/utils.js +6 -0
- package/dist/cjs/react-components.css +1 -1
- package/dist/es/components/comic-text/ComicText.d.ts +9 -0
- package/dist/es/components/comic-text/ComicText.js +51 -0
- package/dist/es/components/comic-text/index.d.ts +1 -0
- package/dist/es/components/flip-text/FlipText.d.ts +20 -0
- package/dist/es/components/flip-text/FlipText.js +37 -0
- package/dist/es/components/flip-text/index.d.ts +1 -0
- package/dist/es/components/image-viewer/ImageThumbnails.d.ts +7 -0
- package/dist/es/components/image-viewer/ImageThumbnails.js +74 -0
- package/dist/es/components/image-viewer/ImageViewer.js +63 -105
- package/dist/es/components/image-viewer/index.d.ts +1 -3
- package/dist/es/components/video-dialog/VideoDialog.d.ts +10 -0
- package/dist/es/components/video-dialog/VideoDialog.js +127 -0
- package/dist/es/components/video-dialog/index.d.ts +1 -0
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.js +26 -20
- package/dist/es/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/Icon.js +41 -0
- package/dist/es/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/createLucideIcon.js +27 -0
- package/dist/es/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
- package/dist/es/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/play.js +12 -0
- package/dist/es/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/x.js +15 -0
- package/dist/es/node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/shared/src/utils.js +24 -0
- package/dist/es/react-components.css +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
type ComicTextProps = {
|
|
3
|
+
children: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
fontSize?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function ComicText({ children, className, style, fontSize, }: ComicTextProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { cn as i } from "../../utils/utils.js";
|
|
4
|
+
import { motion as p } from "motion/react";
|
|
5
|
+
function m({
|
|
6
|
+
children: t,
|
|
7
|
+
className: o,
|
|
8
|
+
style: a,
|
|
9
|
+
fontSize: r = 5
|
|
10
|
+
}) {
|
|
11
|
+
if (typeof t != "string")
|
|
12
|
+
throw new Error("children must be a string");
|
|
13
|
+
const e = "#EF4444";
|
|
14
|
+
return /* @__PURE__ */ n(
|
|
15
|
+
p.div,
|
|
16
|
+
{
|
|
17
|
+
className: i("select-none text-center", o),
|
|
18
|
+
style: {
|
|
19
|
+
fontSize: `${r}rem`,
|
|
20
|
+
fontFamily: "'Bangers', 'Comic Sans MS', 'Impact', sans-serif",
|
|
21
|
+
fontWeight: "900",
|
|
22
|
+
WebkitTextStroke: `${r * 0.35}px #000000`,
|
|
23
|
+
// Thick black outline
|
|
24
|
+
transform: "skewX(-10deg)",
|
|
25
|
+
textTransform: "uppercase",
|
|
26
|
+
filter: `
|
|
27
|
+
drop-shadow(5px 5px 0px #000000)
|
|
28
|
+
drop-shadow(3px 3px 0px ${e})
|
|
29
|
+
`,
|
|
30
|
+
backgroundColor: "#FACC15",
|
|
31
|
+
backgroundImage: `radial-gradient(circle at 1px 1px, ${e} 1px, transparent 0)`,
|
|
32
|
+
backgroundSize: "8px 8px",
|
|
33
|
+
backgroundClip: "text",
|
|
34
|
+
WebkitBackgroundClip: "text",
|
|
35
|
+
WebkitTextFillColor: "transparent",
|
|
36
|
+
...a
|
|
37
|
+
},
|
|
38
|
+
initial: { opacity: 0, scale: 0.8, rotate: -2 },
|
|
39
|
+
animate: { opacity: 1, scale: 1, rotate: 0 },
|
|
40
|
+
transition: {
|
|
41
|
+
duration: 0.6,
|
|
42
|
+
ease: [0.175, 0.885, 0.32, 1.275],
|
|
43
|
+
type: "spring"
|
|
44
|
+
},
|
|
45
|
+
children: t
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
m as ComicText
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ComicText';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Variants, MotionProps } from 'motion/react';
|
|
2
|
+
import { ElementType, default as React } from 'react';
|
|
3
|
+
interface FlipTextProps extends MotionProps {
|
|
4
|
+
/** The duration of the animation */
|
|
5
|
+
duration?: number;
|
|
6
|
+
/** The delay between each character */
|
|
7
|
+
delayMultiple?: number;
|
|
8
|
+
/** The variants of the animation */
|
|
9
|
+
framerProps?: Variants;
|
|
10
|
+
/** The class name of the component */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** The element type of the component */
|
|
13
|
+
as?: ElementType;
|
|
14
|
+
/** The children of the component */
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/** The variants of the animation */
|
|
17
|
+
variants?: Variants;
|
|
18
|
+
}
|
|
19
|
+
export declare function FlipText({ children, duration, delayMultiple, className, as: Component, variants, ...props }: FlipTextProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { motion as p, AnimatePresence as h } from "motion/react";
|
|
4
|
+
import { cn as f } from "../../utils/utils.js";
|
|
5
|
+
import x from "react";
|
|
6
|
+
const u = {
|
|
7
|
+
hidden: { rotateX: -90, opacity: 0 },
|
|
8
|
+
visible: { rotateX: 0, opacity: 1 }
|
|
9
|
+
};
|
|
10
|
+
function w({
|
|
11
|
+
children: i,
|
|
12
|
+
duration: n = 0.5,
|
|
13
|
+
delayMultiple: a = 0.08,
|
|
14
|
+
className: o,
|
|
15
|
+
as: r = "span",
|
|
16
|
+
variants: s,
|
|
17
|
+
...c
|
|
18
|
+
}) {
|
|
19
|
+
const m = p.create(r), d = x.Children.toArray(i).join("").split("");
|
|
20
|
+
return /* @__PURE__ */ t("div", { className: "flex justify-center space-x-2", children: /* @__PURE__ */ t(h, { mode: "wait", children: d.map((l, e) => /* @__PURE__ */ t(
|
|
21
|
+
m,
|
|
22
|
+
{
|
|
23
|
+
initial: "hidden",
|
|
24
|
+
animate: "visible",
|
|
25
|
+
exit: "hidden",
|
|
26
|
+
variants: s || u,
|
|
27
|
+
transition: { duration: n, delay: e * a },
|
|
28
|
+
className: f("origin-center drop-shadow-sm", o),
|
|
29
|
+
...c,
|
|
30
|
+
children: l
|
|
31
|
+
},
|
|
32
|
+
e
|
|
33
|
+
)) }) });
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
w as FlipText
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FlipText';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface ImageThumbnailsProps {
|
|
2
|
+
images: string[];
|
|
3
|
+
currentIndex: number;
|
|
4
|
+
onImageSelect: (index: number) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const ImageThumbnails: ({ images, currentIndex, onImageSelect, }: ImageThumbnailsProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ImageThumbnails;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useScroll as g, motion as h, useMotionValue as p, useMotionValueEvent as b, animate as l } from "motion/react";
|
|
3
|
+
import { cn as v } from "../../utils/utils.js";
|
|
4
|
+
import { size as w } from "lodash-es";
|
|
5
|
+
import { useRef as k } from "react";
|
|
6
|
+
const m = "0%", x = "100%", d = "20%", s = "80%", n = "#0000", e = "#000";
|
|
7
|
+
function I(r) {
|
|
8
|
+
const o = p(
|
|
9
|
+
`linear-gradient(90deg, ${e}, ${e} ${m}, ${e} ${s}, ${n})`
|
|
10
|
+
);
|
|
11
|
+
return b(r, "change", (a) => {
|
|
12
|
+
a === 0 ? l(
|
|
13
|
+
o,
|
|
14
|
+
`linear-gradient(90deg, ${e}, ${e} ${m}, ${e} ${s}, ${n})`
|
|
15
|
+
) : a === 1 ? l(
|
|
16
|
+
o,
|
|
17
|
+
`linear-gradient(90deg, ${n}, ${e} ${d}, ${e} ${x}, ${e})`
|
|
18
|
+
) : (r.getPrevious() === 0 || r.getPrevious() === 1) && l(
|
|
19
|
+
o,
|
|
20
|
+
`linear-gradient(90deg, ${n}, ${e} ${d}, ${e} ${s}, ${n})`
|
|
21
|
+
);
|
|
22
|
+
}), o;
|
|
23
|
+
}
|
|
24
|
+
const j = ({
|
|
25
|
+
images: r,
|
|
26
|
+
currentIndex: o,
|
|
27
|
+
onImageSelect: a
|
|
28
|
+
}) => {
|
|
29
|
+
const i = k(null), { scrollXProgress: $ } = g({ container: i }), u = I($);
|
|
30
|
+
return /* @__PURE__ */ t(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: v(
|
|
34
|
+
"h-24 bg-black bg-opacity-50 shrink-0 z-10 pb-safe-offset-0 pl-safe-offset-0 pr-safe-offset-0",
|
|
35
|
+
{
|
|
36
|
+
hidden: w(r) <= 1
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
children: /* @__PURE__ */ t(
|
|
40
|
+
h.div,
|
|
41
|
+
{
|
|
42
|
+
ref: i,
|
|
43
|
+
style: {
|
|
44
|
+
maskImage: u,
|
|
45
|
+
WebkitOverflowScrolling: "touch",
|
|
46
|
+
scrollbarWidth: "none",
|
|
47
|
+
msOverflowStyle: "none"
|
|
48
|
+
},
|
|
49
|
+
className: "h-24 w-screen overflow-x-auto overflow-y-hidden scrollbar-hide",
|
|
50
|
+
children: /* @__PURE__ */ t("div", { className: "flex gap-2 p-2 h-24 min-w-max", children: r.map((c, f) => /* @__PURE__ */ t(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: `h-full aspect-square flex-shrink-0 cursor-pointer border-2 transition-all ${f === o ? "border-white" : "border-transparent"}`,
|
|
54
|
+
onClick: () => a(f),
|
|
55
|
+
children: /* @__PURE__ */ t(
|
|
56
|
+
"img",
|
|
57
|
+
{
|
|
58
|
+
src: c,
|
|
59
|
+
alt: "",
|
|
60
|
+
className: "w-full h-full object-contain",
|
|
61
|
+
draggable: "false"
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
},
|
|
65
|
+
c
|
|
66
|
+
)) })
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
j as default
|
|
74
|
+
};
|
|
@@ -1,142 +1,100 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Modal as
|
|
4
|
-
import { Spinner as
|
|
5
|
-
import { IoDownloadOutline as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useState as
|
|
9
|
-
import
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
function G(o) {
|
|
14
|
-
const e = P(
|
|
15
|
-
`linear-gradient(90deg, ${n}, ${n} ${y}, ${n} ${g}, ${l})`
|
|
16
|
-
);
|
|
17
|
-
return W(o, "change", (i) => {
|
|
18
|
-
i === 0 ? h(
|
|
19
|
-
e,
|
|
20
|
-
`linear-gradient(90deg, ${n}, ${n} ${y}, ${n} ${g}, ${l})`
|
|
21
|
-
) : i === 1 ? h(
|
|
22
|
-
e,
|
|
23
|
-
`linear-gradient(90deg, ${l}, ${n} ${x}, ${n} ${F}, ${n})`
|
|
24
|
-
) : (o.getPrevious() === 0 || o.getPrevious() === 1) && h(
|
|
25
|
-
e,
|
|
26
|
-
`linear-gradient(90deg, ${l}, ${n} ${x}, ${n} ${g}, ${l})`
|
|
27
|
-
);
|
|
28
|
-
}), e;
|
|
29
|
-
}
|
|
30
|
-
const ne = (o) => {
|
|
2
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
import { Modal as N, ModalContent as L } from "@heroui/modal";
|
|
4
|
+
import { Spinner as E } from "@heroui/spinner";
|
|
5
|
+
import { IoDownloadOutline as j, IoCloseSharp as k } from "react-icons/io5";
|
|
6
|
+
import S from "../pinch-content/PinchContent.js";
|
|
7
|
+
import z from "./ImageThumbnails.js";
|
|
8
|
+
import { useState as u, useEffect as R } from "react";
|
|
9
|
+
import D from "clsx";
|
|
10
|
+
const h = (t) => {
|
|
11
|
+
t.target.closest(".image-viewer-main-content") && t.preventDefault();
|
|
12
|
+
}, _ = (t) => {
|
|
31
13
|
const {
|
|
32
|
-
isOpen:
|
|
33
|
-
onClose:
|
|
34
|
-
imgSrc:
|
|
35
|
-
canDownload:
|
|
36
|
-
wrapperClassName:
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
const
|
|
14
|
+
isOpen: o,
|
|
15
|
+
onClose: p,
|
|
16
|
+
imgSrc: r,
|
|
17
|
+
canDownload: g = !1,
|
|
18
|
+
wrapperClassName: b
|
|
19
|
+
} = t, s = Array.isArray(r) ? r : [r], [a, w] = u(0), [v, l] = u(!0), i = () => {
|
|
20
|
+
l(!0), p();
|
|
21
|
+
}, y = async () => {
|
|
22
|
+
const d = s[a];
|
|
41
23
|
try {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
} catch (
|
|
45
|
-
console.error("Error downloading image:",
|
|
24
|
+
const I = await (await fetch(d)).blob(), f = window.URL.createObjectURL(I), n = document.createElement("a");
|
|
25
|
+
n.href = f, n.download = d.split("/").pop() || "image", document.body.appendChild(n), n.click(), window.URL.revokeObjectURL(f), document.body.removeChild(n);
|
|
26
|
+
} catch (m) {
|
|
27
|
+
console.error("Error downloading image:", m);
|
|
46
28
|
}
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
29
|
+
}, C = () => {
|
|
30
|
+
l(!1);
|
|
31
|
+
}, x = () => {
|
|
32
|
+
l(!1);
|
|
51
33
|
};
|
|
52
|
-
|
|
53
|
-
if (
|
|
54
|
-
return document.addEventListener("touchmove",
|
|
34
|
+
return R(() => {
|
|
35
|
+
if (o)
|
|
36
|
+
return document.addEventListener("touchmove", h, {
|
|
55
37
|
passive: !1
|
|
56
38
|
}), () => {
|
|
57
|
-
document.removeEventListener("touchmove",
|
|
39
|
+
document.removeEventListener("touchmove", h);
|
|
58
40
|
};
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
-
return /* @__PURE__ */ t(
|
|
62
|
-
z,
|
|
41
|
+
}, [o]), /* @__PURE__ */ e(
|
|
42
|
+
N,
|
|
63
43
|
{
|
|
64
|
-
isOpen:
|
|
44
|
+
isOpen: o,
|
|
65
45
|
size: "full",
|
|
66
|
-
onClose:
|
|
46
|
+
onClose: i,
|
|
67
47
|
classNames: {
|
|
68
|
-
wrapper:
|
|
48
|
+
wrapper: D("", b)
|
|
69
49
|
},
|
|
70
50
|
className: "bg-black bg-opacity-70",
|
|
71
51
|
hideCloseButton: !0,
|
|
72
52
|
portalContainer: document.body,
|
|
73
|
-
children: /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
76
|
-
|
|
53
|
+
children: /* @__PURE__ */ e(L, { className: "overflow-hidden", children: /* @__PURE__ */ c("div", { className: "w-screen h-screen relative flex flex-col pt-safe-offset-0", children: [
|
|
54
|
+
/* @__PURE__ */ c("div", { className: "absolute top-2 right-2 flex gap-4 z-10", children: [
|
|
55
|
+
g && /* @__PURE__ */ e(
|
|
56
|
+
j,
|
|
77
57
|
{
|
|
78
58
|
size: 24,
|
|
79
59
|
className: "text-white cursor-pointer",
|
|
80
|
-
onClick:
|
|
60
|
+
onClick: y
|
|
81
61
|
}
|
|
82
62
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
63
|
+
/* @__PURE__ */ e(
|
|
64
|
+
k,
|
|
85
65
|
{
|
|
86
66
|
size: 24,
|
|
87
67
|
className: "text-white cursor-pointer",
|
|
88
|
-
onClick:
|
|
68
|
+
onClick: i
|
|
89
69
|
}
|
|
90
70
|
)
|
|
91
71
|
] }),
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-h-0 relative flex items-center justify-center image-viewer-main-content", children: [
|
|
73
|
+
/* @__PURE__ */ e(S, { canRotate: !1, className: "w-full h-full", children: /* @__PURE__ */ e(
|
|
94
74
|
"img",
|
|
95
75
|
{
|
|
96
76
|
draggable: "false",
|
|
97
|
-
src:
|
|
77
|
+
src: s[a],
|
|
98
78
|
alt: "",
|
|
99
79
|
className: "w-screen h-full object-contain pointer-events-none",
|
|
100
|
-
onLoad:
|
|
101
|
-
onError:
|
|
80
|
+
onLoad: C,
|
|
81
|
+
onError: x
|
|
102
82
|
}
|
|
103
83
|
) }),
|
|
104
|
-
|
|
84
|
+
v && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black bg-opacity-50", children: /* @__PURE__ */ e(E, { color: "white", size: "lg" }) })
|
|
105
85
|
] }),
|
|
106
|
-
|
|
107
|
-
|
|
86
|
+
/* @__PURE__ */ e(
|
|
87
|
+
z,
|
|
108
88
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
WebkitOverflowScrolling: "touch",
|
|
113
|
-
scrollbarWidth: "none",
|
|
114
|
-
msOverflowStyle: "none"
|
|
115
|
-
},
|
|
116
|
-
className: "h-24 w-screen overflow-x-auto overflow-y-hidden scrollbar-hide",
|
|
117
|
-
children: /* @__PURE__ */ t("div", { className: "flex gap-2 p-2 h-24 min-w-max", children: c.map((r, s) => /* @__PURE__ */ t(
|
|
118
|
-
"div",
|
|
119
|
-
{
|
|
120
|
-
className: `h-full aspect-square flex-shrink-0 cursor-pointer border-2 transition-all ${s === m ? "border-white" : "border-transparent"}`,
|
|
121
|
-
onClick: () => k(s),
|
|
122
|
-
children: /* @__PURE__ */ t(
|
|
123
|
-
"img",
|
|
124
|
-
{
|
|
125
|
-
src: r,
|
|
126
|
-
alt: "",
|
|
127
|
-
className: "w-full h-full object-contain",
|
|
128
|
-
draggable: "false"
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
},
|
|
132
|
-
r
|
|
133
|
-
)) })
|
|
89
|
+
images: s,
|
|
90
|
+
currentIndex: a,
|
|
91
|
+
onImageSelect: w
|
|
134
92
|
}
|
|
135
|
-
)
|
|
93
|
+
)
|
|
136
94
|
] }) })
|
|
137
95
|
}
|
|
138
96
|
);
|
|
139
|
-
},
|
|
97
|
+
}, O = `
|
|
140
98
|
.scrollbar-hide {
|
|
141
99
|
-ms-overflow-style: none;
|
|
142
100
|
scrollbar-width: none;
|
|
@@ -146,12 +104,12 @@ const ne = (o) => {
|
|
|
146
104
|
}
|
|
147
105
|
`;
|
|
148
106
|
if (typeof document < "u") {
|
|
149
|
-
const
|
|
150
|
-
if (!document.getElementById(
|
|
151
|
-
const
|
|
152
|
-
|
|
107
|
+
const t = "image-viewer-scrollbar-hide";
|
|
108
|
+
if (!document.getElementById(t)) {
|
|
109
|
+
const o = document.createElement("style");
|
|
110
|
+
o.id = t, o.textContent = O, document.head.appendChild(o);
|
|
153
111
|
}
|
|
154
112
|
}
|
|
155
113
|
export {
|
|
156
|
-
|
|
114
|
+
_ as default
|
|
157
115
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type AnimationStyle = "from-bottom" | "from-center" | "from-top" | "from-left" | "from-right" | "fade" | "top-in-bottom-out" | "left-in-right-out";
|
|
2
|
+
interface HeroVideoProps {
|
|
3
|
+
animationStyle?: AnimationStyle;
|
|
4
|
+
videoSrc: string;
|
|
5
|
+
thumbnailSrc: string;
|
|
6
|
+
thumbnailAlt?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function HeroVideoDialog({ animationStyle, videoSrc, thumbnailSrc, thumbnailAlt, className, }: HeroVideoProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useState as m } from "react";
|
|
4
|
+
import { AnimatePresence as p, motion as t } from "motion/react";
|
|
5
|
+
import { cn as u } from "../../utils/utils.js";
|
|
6
|
+
import y from "../../node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/play.js";
|
|
7
|
+
import f from "../../node_modules/.pnpm/lucide-react@0.525.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/x.js";
|
|
8
|
+
const x = {
|
|
9
|
+
"from-bottom": {
|
|
10
|
+
initial: { y: "100%", opacity: 0 },
|
|
11
|
+
animate: { y: 0, opacity: 1 },
|
|
12
|
+
exit: { y: "100%", opacity: 0 }
|
|
13
|
+
},
|
|
14
|
+
"from-center": {
|
|
15
|
+
initial: { scale: 0.5, opacity: 0 },
|
|
16
|
+
animate: { scale: 1, opacity: 1 },
|
|
17
|
+
exit: { scale: 0.5, opacity: 0 }
|
|
18
|
+
},
|
|
19
|
+
"from-top": {
|
|
20
|
+
initial: { y: "-100%", opacity: 0 },
|
|
21
|
+
animate: { y: 0, opacity: 1 },
|
|
22
|
+
exit: { y: "-100%", opacity: 0 }
|
|
23
|
+
},
|
|
24
|
+
"from-left": {
|
|
25
|
+
initial: { x: "-100%", opacity: 0 },
|
|
26
|
+
animate: { x: 0, opacity: 1 },
|
|
27
|
+
exit: { x: "-100%", opacity: 0 }
|
|
28
|
+
},
|
|
29
|
+
"from-right": {
|
|
30
|
+
initial: { x: "100%", opacity: 0 },
|
|
31
|
+
animate: { x: 0, opacity: 1 },
|
|
32
|
+
exit: { x: "100%", opacity: 0 }
|
|
33
|
+
},
|
|
34
|
+
fade: {
|
|
35
|
+
initial: { opacity: 0 },
|
|
36
|
+
animate: { opacity: 1 },
|
|
37
|
+
exit: { opacity: 0 }
|
|
38
|
+
},
|
|
39
|
+
"top-in-bottom-out": {
|
|
40
|
+
initial: { y: "-100%", opacity: 0 },
|
|
41
|
+
animate: { y: 0, opacity: 1 },
|
|
42
|
+
exit: { y: "100%", opacity: 0 }
|
|
43
|
+
},
|
|
44
|
+
"left-in-right-out": {
|
|
45
|
+
initial: { x: "-100%", opacity: 0 },
|
|
46
|
+
animate: { x: 0, opacity: 1 },
|
|
47
|
+
exit: { x: "100%", opacity: 0 }
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function k({
|
|
51
|
+
animationStyle: o = "from-center",
|
|
52
|
+
videoSrc: r,
|
|
53
|
+
thumbnailSrc: l,
|
|
54
|
+
thumbnailAlt: n = "Video thumbnail",
|
|
55
|
+
className: s
|
|
56
|
+
}) {
|
|
57
|
+
const [c, a] = m(!1), d = x[o];
|
|
58
|
+
return /* @__PURE__ */ i("div", { className: u("relative", s), children: [
|
|
59
|
+
/* @__PURE__ */ i(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: "group relative cursor-pointer",
|
|
63
|
+
onClick: () => a(!0),
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ e(
|
|
66
|
+
"img",
|
|
67
|
+
{
|
|
68
|
+
src: l,
|
|
69
|
+
alt: n,
|
|
70
|
+
width: 1920,
|
|
71
|
+
height: 1080,
|
|
72
|
+
className: "w-full rounded-md border shadow-lg transition-all duration-200 ease-out group-hover:brightness-[0.8]"
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0 flex scale-[0.9] items-center justify-center rounded-2xl transition-all duration-200 ease-out group-hover:scale-100", children: /* @__PURE__ */ e("div", { className: "flex size-28 items-center justify-center rounded-full bg-primary/10 backdrop-blur-md", children: /* @__PURE__ */ e(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: "relative flex size-20 scale-100 items-center justify-center rounded-full bg-gradient-to-b from-primary/30 to-primary shadow-md transition-all duration-200 ease-out group-hover:scale-[1.2]",
|
|
79
|
+
children: /* @__PURE__ */ e(
|
|
80
|
+
y,
|
|
81
|
+
{
|
|
82
|
+
className: "size-8 scale-100 fill-white text-white transition-transform duration-200 ease-out group-hover:scale-105",
|
|
83
|
+
style: {
|
|
84
|
+
filter: "drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06))"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
) }) })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ e(p, { children: c && /* @__PURE__ */ e(
|
|
94
|
+
t.div,
|
|
95
|
+
{
|
|
96
|
+
initial: { opacity: 0 },
|
|
97
|
+
animate: { opacity: 1 },
|
|
98
|
+
onClick: () => a(!1),
|
|
99
|
+
exit: { opacity: 0 },
|
|
100
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-md",
|
|
101
|
+
children: /* @__PURE__ */ i(
|
|
102
|
+
t.div,
|
|
103
|
+
{
|
|
104
|
+
...d,
|
|
105
|
+
transition: { type: "spring", damping: 30, stiffness: 300 },
|
|
106
|
+
className: "relative mx-4 aspect-video w-full max-w-4xl md:mx-0",
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ e(t.button, { className: "absolute -top-16 right-0 rounded-full bg-neutral-900/50 p-2 text-xl text-white ring-1 backdrop-blur-md dark:bg-neutral-100/50 dark:text-black", children: /* @__PURE__ */ e(f, { className: "size-5" }) }),
|
|
109
|
+
/* @__PURE__ */ e("div", { className: "relative isolate z-[1] size-full overflow-hidden rounded-2xl border-2 border-white", children: /* @__PURE__ */ e(
|
|
110
|
+
"iframe",
|
|
111
|
+
{
|
|
112
|
+
src: r,
|
|
113
|
+
className: "size-full rounded-2xl",
|
|
114
|
+
allowFullScreen: !0,
|
|
115
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
|
116
|
+
}
|
|
117
|
+
) })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
) })
|
|
123
|
+
] });
|
|
124
|
+
}
|
|
125
|
+
export {
|
|
126
|
+
k as HeroVideoDialog
|
|
127
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './VideoDialog';
|
package/dist/es/index.d.ts
CHANGED
|
@@ -17,3 +17,6 @@ export * from './hooks/useStayTimeReport';
|
|
|
17
17
|
export * from './components/pointer';
|
|
18
18
|
export * from './components/sparkles-text';
|
|
19
19
|
export * from './components/blur-fade';
|
|
20
|
+
export * from './components/video-dialog';
|
|
21
|
+
export * from './components/comic-text';
|
|
22
|
+
export * from './components/flip-text';
|
package/dist/es/index.js
CHANGED
|
@@ -2,45 +2,51 @@
|
|
|
2
2
|
import { Button as t } from "./components/button/Button.js";
|
|
3
3
|
import { TxtReader as f } from "./components/txt-reader/TxtReader.js";
|
|
4
4
|
import { HyperText as x } from "./components/hyper-text/index.js";
|
|
5
|
-
import { TypingAnimation as
|
|
5
|
+
import { TypingAnimation as i } from "./components/typing-animation/index.js";
|
|
6
6
|
import { QRCode as d } from "./components/qr-code/index.js";
|
|
7
|
-
import { Confetti as u, ConfettiButton as
|
|
8
|
-
import { useStayTimeReport as
|
|
7
|
+
import { Confetti as u, ConfettiButton as l } from "./components/confetti-button/index.js";
|
|
8
|
+
import { useStayTimeReport as c } from "./hooks/useStayTimeReport.js";
|
|
9
9
|
import { default as g } from "./components/pinch-content/PinchContent.js";
|
|
10
10
|
import { default as B } from "./components/image-viewer/ImageViewer.js";
|
|
11
|
-
import { ShimmerButton as
|
|
12
|
-
import { default as
|
|
13
|
-
import { TextAnimate as
|
|
14
|
-
import { Dock as
|
|
15
|
-
import { TxtEditor as
|
|
16
|
-
import { Message as
|
|
11
|
+
import { ShimmerButton as h } from "./components/shimmer-button/ShimmerButton.js";
|
|
12
|
+
import { default as F } from "./components/image-compare/ImageCompare.js";
|
|
13
|
+
import { TextAnimate as R } from "./components/text-animate/TextAnimate.js";
|
|
14
|
+
import { Dock as V, DockIcon as A, dockVariants as H } from "./components/dock/Duck.js";
|
|
15
|
+
import { TxtEditor as w } from "./components/txt-editor/TxtEditor.js";
|
|
16
|
+
import { Message as G } from "./components/message/Message.js";
|
|
17
17
|
import { default as Q } from "./node_modules/.pnpm/react-force-graph-3d@1.28.0_react@19.1.0/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js";
|
|
18
18
|
import { default as j } from "./node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js";
|
|
19
19
|
import { Pointer as v } from "./components/pointer/Pointer.js";
|
|
20
20
|
import { SparklesText as J } from "./components/sparkles-text/SparklesText.js";
|
|
21
21
|
import { BlurFade as L } from "./components/blur-fade/BlurFade.js";
|
|
22
|
+
import { HeroVideoDialog as O } from "./components/video-dialog/VideoDialog.js";
|
|
23
|
+
import { ComicText as W } from "./components/comic-text/ComicText.js";
|
|
24
|
+
import { FlipText as Y } from "./components/flip-text/FlipText.js";
|
|
22
25
|
export {
|
|
23
26
|
L as BlurFade,
|
|
24
27
|
t as Button,
|
|
28
|
+
W as ComicText,
|
|
25
29
|
u as Confetti,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
l as ConfettiButton,
|
|
31
|
+
V as Dock,
|
|
32
|
+
A as DockIcon,
|
|
33
|
+
Y as FlipText,
|
|
29
34
|
Q as ForceGraph3D,
|
|
35
|
+
O as HeroVideoDialog,
|
|
30
36
|
x as HyperText,
|
|
31
|
-
|
|
37
|
+
F as ImageCompare,
|
|
32
38
|
B as ImageViewer,
|
|
33
|
-
|
|
39
|
+
G as Message,
|
|
34
40
|
g as PinchContent,
|
|
35
41
|
v as Pointer,
|
|
36
42
|
d as QRCode,
|
|
37
|
-
|
|
43
|
+
h as ShimmerButton,
|
|
38
44
|
J as SparklesText,
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
R as TextAnimate,
|
|
46
|
+
w as TxtEditor,
|
|
41
47
|
f as TxtReader,
|
|
42
|
-
|
|
48
|
+
i as TypingAnimation,
|
|
43
49
|
j as confetti,
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
H as dockVariants,
|
|
51
|
+
c as useStayTimeReport
|
|
46
52
|
};
|