@sreedev/my3dui 0.1.2
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/LICENSE +21 -0
- package/README.md +536 -0
- package/dist/index.cjs +3717 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +506 -0
- package/dist/index.d.ts +506 -0
- package/dist/index.js +3622 -0
- package/dist/index.js.map +1 -0
- package/package.json +1 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3622 @@
|
|
|
1
|
+
// src/components/layouts/container.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
// src/lib/utils.ts
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/components/layouts/container.tsx
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var Container = React.forwardRef(
|
|
14
|
+
({ className, size = "lg", ...props }, ref) => {
|
|
15
|
+
const sizeStyles = {
|
|
16
|
+
sm: "max-w-3xl",
|
|
17
|
+
md: "max-w-5xl",
|
|
18
|
+
lg: "max-w-7xl",
|
|
19
|
+
xl: "max-w-[1400px]",
|
|
20
|
+
full: "max-w-full"
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
className: cn(
|
|
27
|
+
"w-full mx-auto px-4 md:px-6 lg:px-8",
|
|
28
|
+
sizeStyles[size],
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
Container.displayName = "Container";
|
|
37
|
+
|
|
38
|
+
// src/components/layouts/grid.tsx
|
|
39
|
+
import React2 from "react";
|
|
40
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
41
|
+
var Grid = React2.forwardRef(
|
|
42
|
+
({ className, cols = 1, gap = 4, style, ...props }, ref) => {
|
|
43
|
+
const gridStyle = typeof cols === "number" ? { gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))` } : {};
|
|
44
|
+
const responsiveClasses = typeof cols === "object" ? Object.entries(cols).map(([breakpoint, val]) => {
|
|
45
|
+
return `${breakpoint}:grid-cols-${val}`;
|
|
46
|
+
}).join(" ") : "";
|
|
47
|
+
return /* @__PURE__ */ jsx2(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref,
|
|
51
|
+
className: cn(
|
|
52
|
+
"grid",
|
|
53
|
+
typeof cols === "number" ? "" : responsiveClasses,
|
|
54
|
+
// using Tailwind's predefined grid-cols- if possible, but simplest is style override for arbitrary
|
|
55
|
+
className
|
|
56
|
+
),
|
|
57
|
+
style: {
|
|
58
|
+
gap: typeof gap === "number" ? `${gap * 0.25}rem` : gap,
|
|
59
|
+
...gridStyle,
|
|
60
|
+
...style
|
|
61
|
+
},
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
Grid.displayName = "Grid";
|
|
68
|
+
|
|
69
|
+
// src/components/layouts/stack.tsx
|
|
70
|
+
import React3 from "react";
|
|
71
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
72
|
+
var Stack = React3.forwardRef(
|
|
73
|
+
({
|
|
74
|
+
className,
|
|
75
|
+
direction = "col",
|
|
76
|
+
gap = 4,
|
|
77
|
+
align = "stretch",
|
|
78
|
+
justify = "start",
|
|
79
|
+
wrap = false,
|
|
80
|
+
style,
|
|
81
|
+
...props
|
|
82
|
+
}, ref) => {
|
|
83
|
+
return /* @__PURE__ */ jsx3(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
ref,
|
|
87
|
+
className: cn(
|
|
88
|
+
"flex",
|
|
89
|
+
direction === "col" ? "flex-col" : "flex-row",
|
|
90
|
+
wrap && "flex-wrap",
|
|
91
|
+
{
|
|
92
|
+
"items-start": align === "start",
|
|
93
|
+
"items-center": align === "center",
|
|
94
|
+
"items-end": align === "end",
|
|
95
|
+
"items-stretch": align === "stretch",
|
|
96
|
+
"justify-start": justify === "start",
|
|
97
|
+
"justify-center": justify === "center",
|
|
98
|
+
"justify-end": justify === "end",
|
|
99
|
+
"justify-between": justify === "between",
|
|
100
|
+
"justify-around": justify === "around",
|
|
101
|
+
"justify-evenly": justify === "evenly"
|
|
102
|
+
},
|
|
103
|
+
className
|
|
104
|
+
),
|
|
105
|
+
style: {
|
|
106
|
+
gap: typeof gap === "number" ? `${gap * 0.25}rem` : gap,
|
|
107
|
+
...style
|
|
108
|
+
},
|
|
109
|
+
...props
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
Stack.displayName = "Stack";
|
|
115
|
+
|
|
116
|
+
// src/components/layouts/section.tsx
|
|
117
|
+
import React4 from "react";
|
|
118
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
119
|
+
var Section = React4.forwardRef(
|
|
120
|
+
({
|
|
121
|
+
className,
|
|
122
|
+
children,
|
|
123
|
+
fullWidth = false,
|
|
124
|
+
background = "default",
|
|
125
|
+
containerSize = "lg",
|
|
126
|
+
noPadding = false,
|
|
127
|
+
...props
|
|
128
|
+
}, ref) => {
|
|
129
|
+
const backgrounds = {
|
|
130
|
+
default: "bg-background text-foreground",
|
|
131
|
+
muted: "bg-muted text-muted-foreground",
|
|
132
|
+
brand: "bg-primary text-primary-foreground",
|
|
133
|
+
glass: "bg-background/80 backdrop-blur-sm border-y border-border/50"
|
|
134
|
+
};
|
|
135
|
+
return /* @__PURE__ */ jsx4(
|
|
136
|
+
"section",
|
|
137
|
+
{
|
|
138
|
+
ref,
|
|
139
|
+
className: cn(
|
|
140
|
+
"relative w-full",
|
|
141
|
+
!noPadding && "py-12 md:py-24 lg:py-32",
|
|
142
|
+
backgrounds[background],
|
|
143
|
+
className
|
|
144
|
+
),
|
|
145
|
+
...props,
|
|
146
|
+
children: fullWidth ? children : /* @__PURE__ */ jsx4(Container, { size: containerSize, children })
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
Section.displayName = "Section";
|
|
152
|
+
|
|
153
|
+
// src/components/layouts/page-layout.tsx
|
|
154
|
+
import React5 from "react";
|
|
155
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
156
|
+
var PageLayout = React5.forwardRef(
|
|
157
|
+
({ className, header, footer, sidebar, sidebarPosition = "left", children, ...props }, ref) => {
|
|
158
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("min-h-screen flex flex-col", className), ...props, children: [
|
|
159
|
+
header && /* @__PURE__ */ jsx5("header", { className: "sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: header }),
|
|
160
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 flex", children: [
|
|
161
|
+
sidebar && sidebarPosition === "left" && /* @__PURE__ */ jsx5("aside", { className: "w-64 border-r bg-muted/40 p-4", children: sidebar }),
|
|
162
|
+
/* @__PURE__ */ jsx5("main", { className: "flex-1", children }),
|
|
163
|
+
sidebar && sidebarPosition === "right" && /* @__PURE__ */ jsx5("aside", { className: "w-64 border-l bg-muted/40 p-4", children: sidebar })
|
|
164
|
+
] }),
|
|
165
|
+
footer && /* @__PURE__ */ jsx5("footer", { className: "border-t bg-muted/40", children: footer })
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
PageLayout.displayName = "PageLayout";
|
|
170
|
+
|
|
171
|
+
// src/components/ui/button3d.tsx
|
|
172
|
+
import React6 from "react";
|
|
173
|
+
import { motion } from "framer-motion";
|
|
174
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
175
|
+
import { cva } from "class-variance-authority";
|
|
176
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
177
|
+
var buttonVariants = cva(
|
|
178
|
+
"relative inline-flex items-center justify-center whitespace-nowrap rounded-lg font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 select-none",
|
|
179
|
+
{
|
|
180
|
+
variants: {
|
|
181
|
+
variant: {
|
|
182
|
+
primary: "bg-slate-900 text-slate-50 hover:bg-slate-800 border-b-4 border-slate-950 active:border-b-0 active:translate-y-1 dark:bg-slate-50 dark:text-slate-900 dark:hover:bg-slate-200 dark:border-slate-300",
|
|
183
|
+
secondary: "bg-slate-100 text-slate-900 hover:bg-slate-200 border-b-4 border-slate-300 active:border-b-0 active:translate-y-1 dark:bg-slate-800 dark:text-slate-50 dark:hover:bg-slate-700 dark:border-slate-950",
|
|
184
|
+
accent: "bg-cyan-500 text-white hover:bg-cyan-400 border-b-4 border-cyan-700 active:border-b-0 active:translate-y-1",
|
|
185
|
+
destructive: "bg-red-500 text-white hover:bg-red-600 border-b-4 border-red-800 active:border-b-0 active:translate-y-1",
|
|
186
|
+
outline: "bg-transparent border-2 border-slate-200 hover:bg-slate-100/50 text-slate-900 border-b-4 border-slate-300 active:border-b-2 active:translate-y-[2px] dark:border-slate-700 dark:text-slate-100 dark:hover:bg-slate-800",
|
|
187
|
+
ghost: "hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-800 dark:hover:text-slate-50",
|
|
188
|
+
glass: "bg-white/10 backdrop-blur-md border border-white/20 text-white hover:bg-white/20 shadow-lg active:scale-95"
|
|
189
|
+
},
|
|
190
|
+
size: {
|
|
191
|
+
default: "h-10 px-4 py-2",
|
|
192
|
+
sm: "h-8 px-3 text-xs",
|
|
193
|
+
md: "h-10 px-4 py-2 text-sm",
|
|
194
|
+
lg: "h-12 px-8 text-base",
|
|
195
|
+
icon: "h-10 w-10 p-0"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
defaultVariants: {
|
|
199
|
+
variant: "primary",
|
|
200
|
+
size: "default"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
var Button3D = React6.forwardRef(
|
|
205
|
+
({
|
|
206
|
+
className,
|
|
207
|
+
variant = "primary",
|
|
208
|
+
size = "md",
|
|
209
|
+
asChild = false,
|
|
210
|
+
loading = false,
|
|
211
|
+
shadowColor,
|
|
212
|
+
style,
|
|
213
|
+
children,
|
|
214
|
+
...props
|
|
215
|
+
}, ref) => {
|
|
216
|
+
const baseStyles = "relative inline-flex items-center justify-center whitespace-nowrap rounded-lg font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 select-none active:scale-[0.98]";
|
|
217
|
+
const variantStyles = {
|
|
218
|
+
primary: `
|
|
219
|
+
bg-slate-900 text-slate-50
|
|
220
|
+
hover:bg-slate-800
|
|
221
|
+
border-b-4 border-slate-950
|
|
222
|
+
active:border-b-0 active:translate-y-1
|
|
223
|
+
dark:bg-slate-50 dark:text-slate-900
|
|
224
|
+
dark:hover:bg-slate-200
|
|
225
|
+
dark:border-slate-300 dark:border-b-4
|
|
226
|
+
`,
|
|
227
|
+
secondary: `
|
|
228
|
+
bg-slate-100 text-slate-900
|
|
229
|
+
hover:bg-slate-200
|
|
230
|
+
border-b-4 border-slate-300
|
|
231
|
+
active:border-b-0 active:translate-y-1
|
|
232
|
+
dark:bg-slate-800 dark:text-slate-50
|
|
233
|
+
dark:hover:bg-slate-700
|
|
234
|
+
dark:border-slate-950
|
|
235
|
+
`,
|
|
236
|
+
accent: `
|
|
237
|
+
bg-cyan-500 text-white
|
|
238
|
+
hover:bg-cyan-400
|
|
239
|
+
border-b-4 border-cyan-700
|
|
240
|
+
active:border-b-0 active:translate-y-1
|
|
241
|
+
`,
|
|
242
|
+
destructive: `
|
|
243
|
+
bg-red-500 text-white
|
|
244
|
+
hover:bg-red-600
|
|
245
|
+
border-b-4 border-red-800
|
|
246
|
+
active:border-b-0 active:translate-y-1
|
|
247
|
+
`,
|
|
248
|
+
outline: `
|
|
249
|
+
bg-transparent border-2 border-slate-200
|
|
250
|
+
hover:bg-slate-100/50 text-slate-900
|
|
251
|
+
border-b-4 border-slate-300
|
|
252
|
+
active:border-b-2 active:translate-y-[2px]
|
|
253
|
+
dark:border-slate-700 dark:text-slate-100
|
|
254
|
+
dark:border-b-4 dark:hover:bg-slate-800
|
|
255
|
+
`,
|
|
256
|
+
ghost: `
|
|
257
|
+
hover:bg-slate-100
|
|
258
|
+
hover:text-slate-900
|
|
259
|
+
dark:hover:bg-slate-800
|
|
260
|
+
dark:hover:text-slate-50
|
|
261
|
+
border-none shadow-none translate-y-0
|
|
262
|
+
`,
|
|
263
|
+
glass: `
|
|
264
|
+
bg-white/10 backdrop-blur-md
|
|
265
|
+
border border-white/20
|
|
266
|
+
text-white
|
|
267
|
+
hover:bg-white/20
|
|
268
|
+
shadow-lg
|
|
269
|
+
active:scale-95
|
|
270
|
+
`
|
|
271
|
+
};
|
|
272
|
+
const sizeStyles = {
|
|
273
|
+
default: "h-10 px-4 py-2 text-sm",
|
|
274
|
+
sm: "h-8 px-3 text-xs",
|
|
275
|
+
md: "h-10 px-4 py-2 text-sm",
|
|
276
|
+
lg: "h-12 px-8 text-base",
|
|
277
|
+
icon: "h-10 w-10 p-0"
|
|
278
|
+
};
|
|
279
|
+
const motionProps = {
|
|
280
|
+
whileTap: { scale: 0.97 },
|
|
281
|
+
transition: { type: "spring", stiffness: 400, damping: 15 }
|
|
282
|
+
};
|
|
283
|
+
const buttonContent = /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
284
|
+
loading && /* @__PURE__ */ jsxs2("svg", { className: "animate-spin -ml-1 mr-2 h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
285
|
+
/* @__PURE__ */ jsx6("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
286
|
+
/* @__PURE__ */ jsx6("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
|
|
287
|
+
] }),
|
|
288
|
+
children
|
|
289
|
+
] });
|
|
290
|
+
const buttonClassName = cn(
|
|
291
|
+
baseStyles,
|
|
292
|
+
variantStyles[variant],
|
|
293
|
+
sizeStyles[size],
|
|
294
|
+
className
|
|
295
|
+
);
|
|
296
|
+
const buttonStyle = {
|
|
297
|
+
...style,
|
|
298
|
+
...shadowColor ? { borderColor: shadowColor } : {}
|
|
299
|
+
};
|
|
300
|
+
if (asChild) {
|
|
301
|
+
return /* @__PURE__ */ jsx6(
|
|
302
|
+
Slot,
|
|
303
|
+
{
|
|
304
|
+
ref,
|
|
305
|
+
className: buttonClassName,
|
|
306
|
+
style: buttonStyle,
|
|
307
|
+
...props,
|
|
308
|
+
children
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
const {
|
|
313
|
+
onDrag,
|
|
314
|
+
onDragStart,
|
|
315
|
+
onDragEnd,
|
|
316
|
+
onAnimationStart,
|
|
317
|
+
onAnimationEnd,
|
|
318
|
+
onAnimationIteration,
|
|
319
|
+
...safeProps
|
|
320
|
+
} = props;
|
|
321
|
+
return /* @__PURE__ */ jsx6(
|
|
322
|
+
motion.button,
|
|
323
|
+
{
|
|
324
|
+
ref,
|
|
325
|
+
className: buttonClassName,
|
|
326
|
+
style: buttonStyle,
|
|
327
|
+
disabled: props.disabled || loading,
|
|
328
|
+
...safeProps,
|
|
329
|
+
...motionProps,
|
|
330
|
+
children: buttonContent
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
Button3D.displayName = "Button3D";
|
|
336
|
+
|
|
337
|
+
// src/components/ui/card3d.tsx
|
|
338
|
+
import { useRef } from "react";
|
|
339
|
+
import { motion as motion2, useMotionValue, useSpring, useTransform } from "framer-motion";
|
|
340
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
341
|
+
function Card3D({
|
|
342
|
+
children,
|
|
343
|
+
className,
|
|
344
|
+
depth = "md",
|
|
345
|
+
variant = "glass",
|
|
346
|
+
disableTilt = false,
|
|
347
|
+
...props
|
|
348
|
+
}) {
|
|
349
|
+
const ref = useRef(null);
|
|
350
|
+
const x = useMotionValue(0);
|
|
351
|
+
const y = useMotionValue(0);
|
|
352
|
+
const mouseX = useSpring(x, { stiffness: 150, damping: 15 });
|
|
353
|
+
const mouseY = useSpring(y, { stiffness: 150, damping: 15 });
|
|
354
|
+
const rotateX = useTransform(mouseY, [-0.5, 0.5], ["7deg", "-7deg"]);
|
|
355
|
+
const rotateY = useTransform(mouseX, [-0.5, 0.5], ["-7deg", "7deg"]);
|
|
356
|
+
const handleMouseMove = (e) => {
|
|
357
|
+
if (disableTilt || !ref.current) return;
|
|
358
|
+
const rect = ref.current.getBoundingClientRect();
|
|
359
|
+
const width = rect.width;
|
|
360
|
+
const height = rect.height;
|
|
361
|
+
const mouseXPos = e.clientX - rect.left;
|
|
362
|
+
const mouseYPos = e.clientY - rect.top;
|
|
363
|
+
const xPct = mouseXPos / width - 0.5;
|
|
364
|
+
const yPct = mouseYPos / height - 0.5;
|
|
365
|
+
x.set(xPct);
|
|
366
|
+
y.set(yPct);
|
|
367
|
+
};
|
|
368
|
+
const handleMouseLeave = () => {
|
|
369
|
+
if (disableTilt) return;
|
|
370
|
+
x.set(0);
|
|
371
|
+
y.set(0);
|
|
372
|
+
};
|
|
373
|
+
const getVariantStyles = () => {
|
|
374
|
+
switch (variant) {
|
|
375
|
+
case "neon":
|
|
376
|
+
return "bg-black/90 border-cyan-500/50 shadow-[0_0_30px_rgba(6,182,212,0.2)] text-cyan-50";
|
|
377
|
+
case "solid":
|
|
378
|
+
return "bg-white dark:bg-slate-900 border-slate-200 dark:border-slate-800 shadow-xl text-slate-900 dark:text-slate-100";
|
|
379
|
+
case "outline":
|
|
380
|
+
return "bg-transparent border-2 border-slate-200 dark:border-slate-700 text-slate-900 dark:text-slate-100";
|
|
381
|
+
case "glass":
|
|
382
|
+
default:
|
|
383
|
+
return "bg-white/40 dark:bg-slate-900/60 backdrop-blur-xl border-white/40 dark:border-white/10 shadow-lg shadow-black/5 dark:shadow-black/20 text-slate-800 dark:text-white";
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
const getDepthValue = () => {
|
|
387
|
+
switch (depth) {
|
|
388
|
+
case "sm":
|
|
389
|
+
return 20;
|
|
390
|
+
case "lg":
|
|
391
|
+
return 80;
|
|
392
|
+
case "md":
|
|
393
|
+
default:
|
|
394
|
+
return 40;
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
return /* @__PURE__ */ jsx7(
|
|
398
|
+
motion2.div,
|
|
399
|
+
{
|
|
400
|
+
ref,
|
|
401
|
+
onMouseMove: handleMouseMove,
|
|
402
|
+
onMouseLeave: handleMouseLeave,
|
|
403
|
+
style: {
|
|
404
|
+
perspective: 1200,
|
|
405
|
+
transformStyle: "preserve-3d"
|
|
406
|
+
},
|
|
407
|
+
className: cn("relative group cursor-pointer", className),
|
|
408
|
+
...props,
|
|
409
|
+
children: /* @__PURE__ */ jsxs3(
|
|
410
|
+
motion2.div,
|
|
411
|
+
{
|
|
412
|
+
style: {
|
|
413
|
+
rotateX: disableTilt ? 0 : rotateX,
|
|
414
|
+
rotateY: disableTilt ? 0 : rotateY,
|
|
415
|
+
transformStyle: "preserve-3d"
|
|
416
|
+
},
|
|
417
|
+
className: cn(
|
|
418
|
+
"relative h-full w-full rounded-xl border p-6 transition-colors duration-300",
|
|
419
|
+
getVariantStyles()
|
|
420
|
+
),
|
|
421
|
+
children: [
|
|
422
|
+
/* @__PURE__ */ jsx7(
|
|
423
|
+
"div",
|
|
424
|
+
{
|
|
425
|
+
className: "absolute inset-0 rounded-xl bg-black/10 dark:bg-black/40 blur-xl transition-all duration-300 -z-20",
|
|
426
|
+
style: {
|
|
427
|
+
transform: `translateZ(-${getDepthValue()}px) scale(0.95)`,
|
|
428
|
+
opacity: 0.6
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
),
|
|
432
|
+
/* @__PURE__ */ jsx7("div", { style: { transform: "translateZ(20px)" }, children }),
|
|
433
|
+
/* @__PURE__ */ jsx7(
|
|
434
|
+
"div",
|
|
435
|
+
{
|
|
436
|
+
className: "absolute inset-0 rounded-xl pointer-events-none bg-gradient-to-tr from-white/0 via-white/10 to-white/0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 will-change-transform",
|
|
437
|
+
style: { mixBlendMode: "overlay" }
|
|
438
|
+
}
|
|
439
|
+
)
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
)
|
|
443
|
+
}
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// src/components/ui/accordion3d.tsx
|
|
448
|
+
import { useState as useState2 } from "react";
|
|
449
|
+
import { motion as motion3, AnimatePresence } from "framer-motion";
|
|
450
|
+
import { ChevronDown } from "lucide-react";
|
|
451
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
452
|
+
var Accordion3D = ({
|
|
453
|
+
items,
|
|
454
|
+
className,
|
|
455
|
+
variant = "glass",
|
|
456
|
+
defaultOpenIndex = null,
|
|
457
|
+
allowMultiple = false
|
|
458
|
+
}) => {
|
|
459
|
+
const [openIndexes, setOpenIndexes] = useState2(
|
|
460
|
+
defaultOpenIndex !== null ? [defaultOpenIndex] : []
|
|
461
|
+
);
|
|
462
|
+
const toggleItem = (index) => {
|
|
463
|
+
if (allowMultiple) {
|
|
464
|
+
setOpenIndexes(
|
|
465
|
+
(prev) => prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]
|
|
466
|
+
);
|
|
467
|
+
} else {
|
|
468
|
+
setOpenIndexes(
|
|
469
|
+
(prev) => prev.includes(index) ? [] : [index]
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
const getVariantStyles = () => {
|
|
474
|
+
switch (variant) {
|
|
475
|
+
case "neon":
|
|
476
|
+
return "bg-slate-900/90 border-cyan-500/50 shadow-[0_0_15px_rgba(6,182,212,0.15)] hover:shadow-[0_0_25px_rgba(6,182,212,0.3)] text-cyan-50";
|
|
477
|
+
case "solid":
|
|
478
|
+
return "bg-white dark:bg-slate-800 border-slate-200 dark:border-slate-700 shadow-xl text-slate-900 dark:text-slate-100";
|
|
479
|
+
case "minimal":
|
|
480
|
+
return "bg-white/80 dark:bg-black/50 border-transparent shadow-sm backdrop-blur-md text-slate-800 dark:text-slate-200 hover:bg-white/95 dark:hover:bg-slate-900/80";
|
|
481
|
+
case "glass":
|
|
482
|
+
default:
|
|
483
|
+
return "bg-white/40 dark:bg-slate-900/60 backdrop-blur-xl border-white/40 dark:border-white/10 shadow-lg shadow-black/5 dark:shadow-black/20 text-slate-800 dark:text-white";
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
const getDepthLayerStyles = () => {
|
|
487
|
+
switch (variant) {
|
|
488
|
+
case "neon":
|
|
489
|
+
return "bg-cyan-900/40";
|
|
490
|
+
case "minimal":
|
|
491
|
+
return "hidden";
|
|
492
|
+
case "solid":
|
|
493
|
+
return "bg-slate-200 dark:bg-slate-900";
|
|
494
|
+
case "glass":
|
|
495
|
+
default:
|
|
496
|
+
return "bg-slate-900/10 dark:bg-black/40";
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
return /* @__PURE__ */ jsx8("div", { className: cn("flex flex-col gap-4 w-full max-w-2xl mx-auto", className), children: items.map((item, index) => {
|
|
500
|
+
const isOpen = openIndexes.includes(index);
|
|
501
|
+
return /* @__PURE__ */ jsxs4(
|
|
502
|
+
motion3.div,
|
|
503
|
+
{
|
|
504
|
+
initial: false,
|
|
505
|
+
animate: isOpen ? "open" : "closed",
|
|
506
|
+
className: "relative group perspective-[1000px] z-0",
|
|
507
|
+
children: [
|
|
508
|
+
/* @__PURE__ */ jsx8(
|
|
509
|
+
motion3.div,
|
|
510
|
+
{
|
|
511
|
+
className: cn(
|
|
512
|
+
"absolute inset-0 rounded-xl translate-y-2 translate-x-0 -z-10 transition-colors duration-300",
|
|
513
|
+
getDepthLayerStyles()
|
|
514
|
+
),
|
|
515
|
+
variants: {
|
|
516
|
+
open: {
|
|
517
|
+
translateY: 4,
|
|
518
|
+
scale: 0.99
|
|
519
|
+
},
|
|
520
|
+
closed: {
|
|
521
|
+
translateY: 8,
|
|
522
|
+
scale: 0.96
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
transition: { duration: 0.2 }
|
|
526
|
+
}
|
|
527
|
+
),
|
|
528
|
+
/* @__PURE__ */ jsxs4(
|
|
529
|
+
motion3.div,
|
|
530
|
+
{
|
|
531
|
+
className: cn(
|
|
532
|
+
"relative overflow-hidden rounded-xl border transition-all duration-300 will-change-transform z-10",
|
|
533
|
+
getVariantStyles()
|
|
534
|
+
),
|
|
535
|
+
whileHover: {
|
|
536
|
+
y: -2,
|
|
537
|
+
scale: 1.005,
|
|
538
|
+
transition: { type: "spring", stiffness: 400, damping: 25 }
|
|
539
|
+
},
|
|
540
|
+
whileTap: { scale: 0.995, y: 0 },
|
|
541
|
+
variants: {
|
|
542
|
+
open: { y: 0 },
|
|
543
|
+
closed: { y: 0 }
|
|
544
|
+
},
|
|
545
|
+
children: [
|
|
546
|
+
/* @__PURE__ */ jsxs4(
|
|
547
|
+
"button",
|
|
548
|
+
{
|
|
549
|
+
onClick: () => toggleItem(index),
|
|
550
|
+
className: "w-full flex items-center justify-between p-5 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 rounded-xl",
|
|
551
|
+
"aria-expanded": isOpen,
|
|
552
|
+
children: [
|
|
553
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-4", children: [
|
|
554
|
+
item.icon && /* @__PURE__ */ jsx8(
|
|
555
|
+
"div",
|
|
556
|
+
{
|
|
557
|
+
className: cn(
|
|
558
|
+
"flex items-center justify-center w-10 h-10 rounded-lg bg-gradient-to-br transition-all duration-500 shadow-inner",
|
|
559
|
+
variant === "neon" ? "from-cyan-500/20 to-blue-600/20 text-cyan-400" : variant === "solid" ? "from-slate-100 to-slate-200 dark:from-slate-800 dark:to-slate-900 text-slate-600 dark:text-slate-300" : "from-white/50 to-white/10 dark:from-white/10 dark:to-white/5 text-slate-700 dark:text-slate-200"
|
|
560
|
+
),
|
|
561
|
+
children: /* @__PURE__ */ jsx8("span", { className: cn("transition-transform duration-300", isOpen ? "scale-110" : "scale-100"), children: item.icon })
|
|
562
|
+
}
|
|
563
|
+
),
|
|
564
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col", children: [
|
|
565
|
+
/* @__PURE__ */ jsx8("span", { className: cn(
|
|
566
|
+
"text-lg font-semibold tracking-tight transition-colors",
|
|
567
|
+
isOpen ? "opacity-100" : "opacity-80 group-hover:opacity-100"
|
|
568
|
+
), children: item.title }),
|
|
569
|
+
isOpen && item.value && /* @__PURE__ */ jsx8("span", { className: "text-xs opacity-60 font-mono", children: item.value })
|
|
570
|
+
] })
|
|
571
|
+
] }),
|
|
572
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-3", children: [
|
|
573
|
+
/* @__PURE__ */ jsx8("div", { className: cn(
|
|
574
|
+
"w-2 h-2 rounded-full transition-all duration-500",
|
|
575
|
+
isOpen ? variant === "neon" ? "bg-cyan-400 shadow-[0_0_10px_#22d3ee]" : "bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.4)]" : "bg-slate-400/30"
|
|
576
|
+
) }),
|
|
577
|
+
/* @__PURE__ */ jsx8(
|
|
578
|
+
motion3.div,
|
|
579
|
+
{
|
|
580
|
+
variants: {
|
|
581
|
+
open: { rotate: 180 },
|
|
582
|
+
closed: { rotate: 0 }
|
|
583
|
+
},
|
|
584
|
+
transition: { type: "spring", stiffness: 200, damping: 20 },
|
|
585
|
+
className: cn(
|
|
586
|
+
"p-1 rounded-full",
|
|
587
|
+
variant === "neon" ? "text-cyan-400" : "text-slate-500 dark:text-slate-400"
|
|
588
|
+
),
|
|
589
|
+
children: /* @__PURE__ */ jsx8(ChevronDown, { className: "w-5 h-5" })
|
|
590
|
+
}
|
|
591
|
+
)
|
|
592
|
+
] })
|
|
593
|
+
]
|
|
594
|
+
}
|
|
595
|
+
),
|
|
596
|
+
/* @__PURE__ */ jsx8(AnimatePresence, { initial: false, children: isOpen && /* @__PURE__ */ jsx8(
|
|
597
|
+
motion3.div,
|
|
598
|
+
{
|
|
599
|
+
initial: "collapsed",
|
|
600
|
+
animate: "open",
|
|
601
|
+
exit: "collapsed",
|
|
602
|
+
variants: {
|
|
603
|
+
open: { opacity: 1, height: "auto" },
|
|
604
|
+
collapsed: { opacity: 0, height: 0 }
|
|
605
|
+
},
|
|
606
|
+
transition: {
|
|
607
|
+
duration: 0.4,
|
|
608
|
+
ease: [0.04, 0.62, 0.23, 0.98]
|
|
609
|
+
},
|
|
610
|
+
children: /* @__PURE__ */ jsx8("div", { className: "px-5 pb-6 pt-0", children: /* @__PURE__ */ jsxs4(
|
|
611
|
+
motion3.div,
|
|
612
|
+
{
|
|
613
|
+
initial: { opacity: 0 },
|
|
614
|
+
animate: { opacity: 1 },
|
|
615
|
+
transition: { delay: 0.1, duration: 0.3 },
|
|
616
|
+
className: "relative",
|
|
617
|
+
children: [
|
|
618
|
+
/* @__PURE__ */ jsx8("div", { className: "h-px w-full bg-gradient-to-r from-transparent via-current to-transparent opacity-10 mb-5" }),
|
|
619
|
+
/* @__PURE__ */ jsx8("div", { className: "text-base sm:text-[15px] opacity-80 leading-relaxed font-normal pl-14", children: item.content })
|
|
620
|
+
]
|
|
621
|
+
}
|
|
622
|
+
) })
|
|
623
|
+
},
|
|
624
|
+
"content"
|
|
625
|
+
) }),
|
|
626
|
+
/* @__PURE__ */ jsx8(
|
|
627
|
+
"div",
|
|
628
|
+
{
|
|
629
|
+
className: "absolute inset-0 pointer-events-none bg-gradient-to-tr from-white/0 via-white/5 to-white/0 opacity-0 group-hover:opacity-100 transition-opacity duration-700",
|
|
630
|
+
style: { mixBlendMode: "overlay" }
|
|
631
|
+
}
|
|
632
|
+
)
|
|
633
|
+
]
|
|
634
|
+
}
|
|
635
|
+
)
|
|
636
|
+
]
|
|
637
|
+
},
|
|
638
|
+
index
|
|
639
|
+
);
|
|
640
|
+
}) });
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
// src/components/ui/badge3d.tsx
|
|
644
|
+
import React9 from "react";
|
|
645
|
+
import { motion as motion4 } from "framer-motion";
|
|
646
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
647
|
+
var Badge3D = React9.forwardRef(
|
|
648
|
+
({ className, variant = "default", size = "md", pulse = false, children, ...props }, ref) => {
|
|
649
|
+
const variants = {
|
|
650
|
+
default: "bg-primary text-primary-foreground border-b-2 border-primary/80 shadow-sm",
|
|
651
|
+
secondary: "bg-secondary text-secondary-foreground border-b-2 border-secondary/80 shadow-sm",
|
|
652
|
+
success: "bg-emerald-500 text-white border-b-2 border-emerald-700 shadow-sm",
|
|
653
|
+
warning: "bg-amber-500 text-white border-b-2 border-amber-700 shadow-sm",
|
|
654
|
+
danger: "bg-red-500 text-white border-b-2 border-red-700 shadow-sm",
|
|
655
|
+
outline: "border-2 border-border bg-background text-foreground border-b-4 shadow-sm"
|
|
656
|
+
};
|
|
657
|
+
const sizes = {
|
|
658
|
+
sm: "px-2 py-0.5 text-xs",
|
|
659
|
+
md: "px-2.5 py-1 text-sm",
|
|
660
|
+
lg: "px-3 py-1.5 text-base"
|
|
661
|
+
};
|
|
662
|
+
return /* @__PURE__ */ jsx9(
|
|
663
|
+
motion4.div,
|
|
664
|
+
{
|
|
665
|
+
ref,
|
|
666
|
+
whileHover: { y: -1, scale: 1.05 },
|
|
667
|
+
whileTap: { y: 0, scale: 0.98 },
|
|
668
|
+
className: cn(
|
|
669
|
+
"inline-flex items-center rounded-md font-medium transition-all active:translate-y-[2px] active:border-b-0",
|
|
670
|
+
variants[variant],
|
|
671
|
+
sizes[size],
|
|
672
|
+
pulse && "animate-pulse",
|
|
673
|
+
className
|
|
674
|
+
),
|
|
675
|
+
...props,
|
|
676
|
+
children
|
|
677
|
+
}
|
|
678
|
+
);
|
|
679
|
+
}
|
|
680
|
+
);
|
|
681
|
+
Badge3D.displayName = "Badge3D";
|
|
682
|
+
|
|
683
|
+
// src/components/ui/input3d.tsx
|
|
684
|
+
import React10, { useState as useState3 } from "react";
|
|
685
|
+
import { motion as motion5 } from "framer-motion";
|
|
686
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
687
|
+
var Input3D = React10.forwardRef(
|
|
688
|
+
({ className, label, error, icon, type = "text", ...props }, ref) => {
|
|
689
|
+
const [isFocused, setIsFocused] = useState3(false);
|
|
690
|
+
return /* @__PURE__ */ jsxs5("div", { className: "w-full space-y-2", children: [
|
|
691
|
+
label && /* @__PURE__ */ jsx10("label", { className: "text-sm font-medium text-foreground", children: label }),
|
|
692
|
+
/* @__PURE__ */ jsxs5(
|
|
693
|
+
motion5.div,
|
|
694
|
+
{
|
|
695
|
+
animate: {
|
|
696
|
+
y: isFocused ? -2 : 0
|
|
697
|
+
},
|
|
698
|
+
transition: { type: "spring", stiffness: 300, damping: 20 },
|
|
699
|
+
className: "relative",
|
|
700
|
+
children: [
|
|
701
|
+
icon && /* @__PURE__ */ jsx10("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: icon }),
|
|
702
|
+
/* @__PURE__ */ jsx10(
|
|
703
|
+
"input",
|
|
704
|
+
{
|
|
705
|
+
ref,
|
|
706
|
+
type,
|
|
707
|
+
onFocus: () => setIsFocused(true),
|
|
708
|
+
onBlur: () => setIsFocused(false),
|
|
709
|
+
className: cn(
|
|
710
|
+
"flex h-11 w-full rounded-lg border-2 border-input bg-background px-3 py-2 text-sm ring-offset-background transition-all",
|
|
711
|
+
"file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
712
|
+
"placeholder:text-muted-foreground",
|
|
713
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:border-primary",
|
|
714
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
715
|
+
"border-b-4 border-b-slate-300 dark:border-b-slate-700",
|
|
716
|
+
"focus:border-b-primary",
|
|
717
|
+
error && "border-red-500 focus-visible:ring-red-500",
|
|
718
|
+
icon && "pl-10",
|
|
719
|
+
className
|
|
720
|
+
),
|
|
721
|
+
...props
|
|
722
|
+
}
|
|
723
|
+
)
|
|
724
|
+
]
|
|
725
|
+
}
|
|
726
|
+
),
|
|
727
|
+
error && /* @__PURE__ */ jsx10("p", { className: "text-sm text-red-500", children: error })
|
|
728
|
+
] });
|
|
729
|
+
}
|
|
730
|
+
);
|
|
731
|
+
Input3D.displayName = "Input3D";
|
|
732
|
+
|
|
733
|
+
// src/components/ui/slider3d.tsx
|
|
734
|
+
import { useState as useState4 } from "react";
|
|
735
|
+
import { motion as motion6 } from "framer-motion";
|
|
736
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
737
|
+
function Slider3D({
|
|
738
|
+
value: controlledValue,
|
|
739
|
+
defaultValue = 50,
|
|
740
|
+
min = 0,
|
|
741
|
+
max = 100,
|
|
742
|
+
step = 1,
|
|
743
|
+
onChange,
|
|
744
|
+
label,
|
|
745
|
+
showValue = true,
|
|
746
|
+
className,
|
|
747
|
+
disabled = false
|
|
748
|
+
}) {
|
|
749
|
+
const [internalValue, setInternalValue] = useState4(defaultValue);
|
|
750
|
+
const isControlled = controlledValue !== void 0;
|
|
751
|
+
const value = isControlled ? controlledValue : internalValue;
|
|
752
|
+
const handleChange = (e) => {
|
|
753
|
+
const newValue = parseFloat(e.target.value);
|
|
754
|
+
if (!isControlled) setInternalValue(newValue);
|
|
755
|
+
onChange?.(newValue);
|
|
756
|
+
};
|
|
757
|
+
const percentage = (value - min) / (max - min) * 100;
|
|
758
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn("w-full space-y-2", className), children: [
|
|
759
|
+
(label || showValue) && /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between", children: [
|
|
760
|
+
label && /* @__PURE__ */ jsx11("label", { className: "text-sm font-medium", children: label }),
|
|
761
|
+
showValue && /* @__PURE__ */ jsx11("span", { className: "text-sm font-mono text-muted-foreground", children: value })
|
|
762
|
+
] }),
|
|
763
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
764
|
+
/* @__PURE__ */ jsx11("div", { className: "h-3 w-full rounded-full bg-slate-200 dark:bg-slate-800 border-b-2 border-slate-300 dark:border-slate-900 shadow-inner" }),
|
|
765
|
+
/* @__PURE__ */ jsx11(
|
|
766
|
+
motion6.div,
|
|
767
|
+
{
|
|
768
|
+
className: "absolute top-0 left-0 h-3 rounded-full bg-primary border-b-2 border-primary/80",
|
|
769
|
+
style: { width: `${percentage}%` },
|
|
770
|
+
initial: false,
|
|
771
|
+
animate: { width: `${percentage}%` },
|
|
772
|
+
transition: { type: "spring", stiffness: 300, damping: 30 }
|
|
773
|
+
}
|
|
774
|
+
),
|
|
775
|
+
/* @__PURE__ */ jsx11(
|
|
776
|
+
"input",
|
|
777
|
+
{
|
|
778
|
+
type: "range",
|
|
779
|
+
min,
|
|
780
|
+
max,
|
|
781
|
+
step,
|
|
782
|
+
value,
|
|
783
|
+
onChange: handleChange,
|
|
784
|
+
disabled,
|
|
785
|
+
className: "absolute top-0 left-0 w-full h-3 opacity-0 cursor-pointer disabled:cursor-not-allowed"
|
|
786
|
+
}
|
|
787
|
+
),
|
|
788
|
+
/* @__PURE__ */ jsx11(
|
|
789
|
+
motion6.div,
|
|
790
|
+
{
|
|
791
|
+
className: cn(
|
|
792
|
+
"absolute top-1/2 -translate-y-1/2 w-6 h-6 rounded-full bg-white border-2 border-primary shadow-lg pointer-events-none",
|
|
793
|
+
disabled && "opacity-50"
|
|
794
|
+
),
|
|
795
|
+
style: { left: `calc(${percentage}% - 12px)` },
|
|
796
|
+
whileHover: { scale: 1.2 },
|
|
797
|
+
whileTap: { scale: 0.9 }
|
|
798
|
+
}
|
|
799
|
+
)
|
|
800
|
+
] })
|
|
801
|
+
] });
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
// src/components/ui/tabs3d.tsx
|
|
805
|
+
import { useState as useState5 } from "react";
|
|
806
|
+
import { motion as motion7, AnimatePresence as AnimatePresence2 } from "framer-motion";
|
|
807
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
808
|
+
function Tabs3D({
|
|
809
|
+
tabs,
|
|
810
|
+
defaultValue,
|
|
811
|
+
value: controlledValue,
|
|
812
|
+
onValueChange,
|
|
813
|
+
className,
|
|
814
|
+
variant = "default"
|
|
815
|
+
}) {
|
|
816
|
+
const [internalValue, setInternalValue] = useState5(defaultValue || tabs[0]?.value);
|
|
817
|
+
const isControlled = controlledValue !== void 0;
|
|
818
|
+
const activeValue = isControlled ? controlledValue : internalValue;
|
|
819
|
+
const handleTabChange = (value) => {
|
|
820
|
+
if (!isControlled) setInternalValue(value);
|
|
821
|
+
onValueChange?.(value);
|
|
822
|
+
};
|
|
823
|
+
const activeTab = tabs.find((tab) => tab.value === activeValue);
|
|
824
|
+
const activeIndex = tabs.findIndex((tab) => tab.value === activeValue);
|
|
825
|
+
return /* @__PURE__ */ jsxs7("div", { className: cn("w-full", className), children: [
|
|
826
|
+
/* @__PURE__ */ jsx12(
|
|
827
|
+
"div",
|
|
828
|
+
{
|
|
829
|
+
className: cn(
|
|
830
|
+
"flex gap-1 mb-4",
|
|
831
|
+
variant === "default" && "bg-muted p-1 rounded-lg",
|
|
832
|
+
variant === "pills" && "gap-2",
|
|
833
|
+
variant === "underline" && "border-b border-border"
|
|
834
|
+
),
|
|
835
|
+
children: tabs.map((tab, index) => {
|
|
836
|
+
const isActive = tab.value === activeValue;
|
|
837
|
+
return /* @__PURE__ */ jsxs7(
|
|
838
|
+
"button",
|
|
839
|
+
{
|
|
840
|
+
onClick: () => handleTabChange(tab.value),
|
|
841
|
+
className: cn(
|
|
842
|
+
"relative px-4 py-2 text-sm font-medium transition-all rounded-md",
|
|
843
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
844
|
+
variant === "default" && [
|
|
845
|
+
isActive ? "bg-background text-foreground shadow-sm border-b-2 border-primary" : "text-muted-foreground hover:text-foreground"
|
|
846
|
+
],
|
|
847
|
+
variant === "pills" && [
|
|
848
|
+
isActive ? "bg-primary text-primary-foreground border-b-2 border-primary/80" : "bg-muted text-muted-foreground hover:bg-muted/80"
|
|
849
|
+
],
|
|
850
|
+
variant === "underline" && [
|
|
851
|
+
"rounded-none border-b-2",
|
|
852
|
+
isActive ? "border-primary text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
853
|
+
]
|
|
854
|
+
),
|
|
855
|
+
children: [
|
|
856
|
+
/* @__PURE__ */ jsxs7("span", { className: "flex items-center gap-2", children: [
|
|
857
|
+
tab.icon,
|
|
858
|
+
tab.label
|
|
859
|
+
] }),
|
|
860
|
+
isActive && variant === "default" && /* @__PURE__ */ jsx12(
|
|
861
|
+
motion7.div,
|
|
862
|
+
{
|
|
863
|
+
layoutId: "activeTab",
|
|
864
|
+
className: "absolute inset-0 bg-background rounded-md -z-10 shadow-sm",
|
|
865
|
+
transition: { type: "spring", stiffness: 300, damping: 30 }
|
|
866
|
+
}
|
|
867
|
+
)
|
|
868
|
+
]
|
|
869
|
+
},
|
|
870
|
+
tab.value
|
|
871
|
+
);
|
|
872
|
+
})
|
|
873
|
+
}
|
|
874
|
+
),
|
|
875
|
+
/* @__PURE__ */ jsx12(AnimatePresence2, { mode: "wait", children: /* @__PURE__ */ jsx12(
|
|
876
|
+
motion7.div,
|
|
877
|
+
{
|
|
878
|
+
initial: { opacity: 0, y: 10 },
|
|
879
|
+
animate: { opacity: 1, y: 0 },
|
|
880
|
+
exit: { opacity: 0, y: -10 },
|
|
881
|
+
transition: { duration: 0.2 },
|
|
882
|
+
children: activeTab?.content
|
|
883
|
+
},
|
|
884
|
+
activeValue
|
|
885
|
+
) })
|
|
886
|
+
] });
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
// src/components/ui/toggle3d.tsx
|
|
890
|
+
import { useState as useState6 } from "react";
|
|
891
|
+
import { motion as motion8 } from "framer-motion";
|
|
892
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
893
|
+
function Toggle3D({
|
|
894
|
+
checked: controlledChecked,
|
|
895
|
+
defaultChecked = false,
|
|
896
|
+
onCheckedChange,
|
|
897
|
+
disabled = false,
|
|
898
|
+
variant = "pill",
|
|
899
|
+
label
|
|
900
|
+
}) {
|
|
901
|
+
const [internalChecked, setInternalChecked] = useState6(defaultChecked);
|
|
902
|
+
const isControlled = controlledChecked !== void 0;
|
|
903
|
+
const isChecked = isControlled ? controlledChecked : internalChecked;
|
|
904
|
+
const handleToggle = () => {
|
|
905
|
+
if (disabled) return;
|
|
906
|
+
const newChecked = !isChecked;
|
|
907
|
+
if (!isControlled) setInternalChecked(newChecked);
|
|
908
|
+
onCheckedChange?.(newChecked);
|
|
909
|
+
};
|
|
910
|
+
const getVariantStyles = () => {
|
|
911
|
+
switch (variant) {
|
|
912
|
+
case "neon":
|
|
913
|
+
return isChecked ? "bg-slate-900 border border-cyan-500/50 shadow-[0_0_15px_rgba(6,182,212,0.4)]" : "bg-slate-900 border border-slate-700";
|
|
914
|
+
case "glass":
|
|
915
|
+
return "bg-white/20 backdrop-blur-md border border-white/30 shadow-inner";
|
|
916
|
+
case "pill":
|
|
917
|
+
default:
|
|
918
|
+
return isChecked ? "bg-primary shadow-inner" : "bg-slate-200 dark:bg-slate-700 shadow-inner";
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3", children: [
|
|
922
|
+
/* @__PURE__ */ jsxs8(
|
|
923
|
+
"button",
|
|
924
|
+
{
|
|
925
|
+
onClick: handleToggle,
|
|
926
|
+
className: cn(
|
|
927
|
+
"relative h-8 w-14 rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
928
|
+
disabled && "opacity-50 cursor-not-allowed",
|
|
929
|
+
getVariantStyles()
|
|
930
|
+
),
|
|
931
|
+
role: "switch",
|
|
932
|
+
"aria-checked": isChecked,
|
|
933
|
+
children: [
|
|
934
|
+
/* @__PURE__ */ jsx13(
|
|
935
|
+
motion8.div,
|
|
936
|
+
{
|
|
937
|
+
className: cn(
|
|
938
|
+
"absolute top-1 left-1 h-6 w-6 rounded-full shadow-md z-10",
|
|
939
|
+
variant === "neon" && isChecked ? "bg-cyan-400 shadow-[0_0_10px_#22d3ee]" : "bg-white"
|
|
940
|
+
),
|
|
941
|
+
animate: {
|
|
942
|
+
x: isChecked ? 24 : 0,
|
|
943
|
+
scale: disabled ? 0.9 : 1
|
|
944
|
+
},
|
|
945
|
+
transition: {
|
|
946
|
+
type: "spring",
|
|
947
|
+
stiffness: 500,
|
|
948
|
+
damping: 30
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
),
|
|
952
|
+
variant !== "neon" && /* @__PURE__ */ jsx13(
|
|
953
|
+
"div",
|
|
954
|
+
{
|
|
955
|
+
className: cn(
|
|
956
|
+
"absolute inset-0 rounded-full border-b-[3px] border-black/5 pointer-events-none",
|
|
957
|
+
isChecked ? "border-black/10" : "border-black/5"
|
|
958
|
+
)
|
|
959
|
+
}
|
|
960
|
+
)
|
|
961
|
+
]
|
|
962
|
+
}
|
|
963
|
+
),
|
|
964
|
+
label && /* @__PURE__ */ jsx13("span", { className: "text-sm font-medium", children: label })
|
|
965
|
+
] });
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
// src/components/ui/modal3d.tsx
|
|
969
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
970
|
+
import { X } from "lucide-react";
|
|
971
|
+
import { motion as motion9, AnimatePresence as AnimatePresence3 } from "framer-motion";
|
|
972
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
973
|
+
function Modal3D({
|
|
974
|
+
open,
|
|
975
|
+
onOpenChange,
|
|
976
|
+
children,
|
|
977
|
+
trigger,
|
|
978
|
+
title,
|
|
979
|
+
description,
|
|
980
|
+
className
|
|
981
|
+
}) {
|
|
982
|
+
return /* @__PURE__ */ jsxs9(DialogPrimitive.Root, { open, onOpenChange, children: [
|
|
983
|
+
trigger && /* @__PURE__ */ jsx14(DialogPrimitive.Trigger, { asChild: true, children: trigger }),
|
|
984
|
+
/* @__PURE__ */ jsx14(AnimatePresence3, { children: open ? /* @__PURE__ */ jsxs9(DialogPrimitive.Portal, { forceMount: true, children: [
|
|
985
|
+
/* @__PURE__ */ jsx14(DialogPrimitive.Overlay, { asChild: true, children: /* @__PURE__ */ jsx14(
|
|
986
|
+
motion9.div,
|
|
987
|
+
{
|
|
988
|
+
initial: { opacity: 0 },
|
|
989
|
+
animate: { opacity: 1 },
|
|
990
|
+
exit: { opacity: 0 },
|
|
991
|
+
className: "fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"
|
|
992
|
+
}
|
|
993
|
+
) }),
|
|
994
|
+
/* @__PURE__ */ jsx14(DialogPrimitive.Content, { asChild: true, children: /* @__PURE__ */ jsxs9(
|
|
995
|
+
motion9.div,
|
|
996
|
+
{
|
|
997
|
+
initial: { opacity: 0, scale: 0.95, y: 10 },
|
|
998
|
+
animate: { opacity: 1, scale: 1, y: 0 },
|
|
999
|
+
exit: { opacity: 0, scale: 0.95, y: 10 },
|
|
1000
|
+
transition: { type: "spring", duration: 0.3 },
|
|
1001
|
+
className: cn(
|
|
1002
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 sm:rounded-lg",
|
|
1003
|
+
"bg-white/80 dark:bg-slate-900/80 backdrop-blur-xl border-white/20 shadow-2xl",
|
|
1004
|
+
className
|
|
1005
|
+
),
|
|
1006
|
+
children: [
|
|
1007
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col space-y-1.5 text-center sm:text-left", children: [
|
|
1008
|
+
title && /* @__PURE__ */ jsx14(DialogPrimitive.Title, { className: "text-lg font-semibold leading-none tracking-tight", children: title }),
|
|
1009
|
+
description && /* @__PURE__ */ jsx14(DialogPrimitive.Description, { className: "text-sm text-muted-foreground", children: description })
|
|
1010
|
+
] }),
|
|
1011
|
+
children,
|
|
1012
|
+
/* @__PURE__ */ jsxs9(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
1013
|
+
/* @__PURE__ */ jsx14(X, { className: "h-4 w-4" }),
|
|
1014
|
+
/* @__PURE__ */ jsx14("span", { className: "sr-only", children: "Close" })
|
|
1015
|
+
] })
|
|
1016
|
+
]
|
|
1017
|
+
}
|
|
1018
|
+
) })
|
|
1019
|
+
] }) : null })
|
|
1020
|
+
] });
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
// src/components/ui/menu3d.tsx
|
|
1024
|
+
import React14 from "react";
|
|
1025
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1026
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1027
|
+
var Menu3DContext = React14.createContext({});
|
|
1028
|
+
function Menu3D({ children, trigger, align = "end" }) {
|
|
1029
|
+
return /* @__PURE__ */ jsxs10(DropdownMenuPrimitive.Root, { children: [
|
|
1030
|
+
/* @__PURE__ */ jsx15(DropdownMenuPrimitive.Trigger, { asChild: true, children: trigger }),
|
|
1031
|
+
/* @__PURE__ */ jsx15(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx15(
|
|
1032
|
+
DropdownMenuPrimitive.Content,
|
|
1033
|
+
{
|
|
1034
|
+
align,
|
|
1035
|
+
className: cn(
|
|
1036
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1037
|
+
"bg-white/90 dark:bg-slate-900/90 backdrop-blur-xl border-white/20 shadow-xl"
|
|
1038
|
+
),
|
|
1039
|
+
children
|
|
1040
|
+
}
|
|
1041
|
+
) })
|
|
1042
|
+
] });
|
|
1043
|
+
}
|
|
1044
|
+
var Menu3DItem = React14.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
1045
|
+
DropdownMenuPrimitive.Item,
|
|
1046
|
+
{
|
|
1047
|
+
ref,
|
|
1048
|
+
className: cn(
|
|
1049
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1050
|
+
inset && "pl-8",
|
|
1051
|
+
className
|
|
1052
|
+
),
|
|
1053
|
+
...props
|
|
1054
|
+
}
|
|
1055
|
+
));
|
|
1056
|
+
Menu3DItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1057
|
+
var Menu3DLabel = React14.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
1058
|
+
DropdownMenuPrimitive.Label,
|
|
1059
|
+
{
|
|
1060
|
+
ref,
|
|
1061
|
+
className: cn(
|
|
1062
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
1063
|
+
inset && "pl-8",
|
|
1064
|
+
className
|
|
1065
|
+
),
|
|
1066
|
+
...props
|
|
1067
|
+
}
|
|
1068
|
+
));
|
|
1069
|
+
Menu3DLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1070
|
+
var Menu3DSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
1071
|
+
DropdownMenuPrimitive.Separator,
|
|
1072
|
+
{
|
|
1073
|
+
ref,
|
|
1074
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
1075
|
+
...props
|
|
1076
|
+
}
|
|
1077
|
+
));
|
|
1078
|
+
Menu3DSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
1079
|
+
|
|
1080
|
+
// src/components/ui/tooltip3d.tsx
|
|
1081
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
1082
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1083
|
+
function Tooltip3D({
|
|
1084
|
+
content,
|
|
1085
|
+
children,
|
|
1086
|
+
side = "top",
|
|
1087
|
+
align = "center",
|
|
1088
|
+
delayDuration = 200
|
|
1089
|
+
}) {
|
|
1090
|
+
return /* @__PURE__ */ jsx16(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs11(TooltipPrimitive.Root, { children: [
|
|
1091
|
+
/* @__PURE__ */ jsx16(TooltipPrimitive.Trigger, { asChild: true, children }),
|
|
1092
|
+
/* @__PURE__ */ jsxs11(
|
|
1093
|
+
TooltipPrimitive.Content,
|
|
1094
|
+
{
|
|
1095
|
+
side,
|
|
1096
|
+
align,
|
|
1097
|
+
className: cn(
|
|
1098
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1099
|
+
"bg-slate-900 text-white dark:bg-slate-100 dark:text-slate-900 border-none shadow-[0_10px_38px_-10px_rgba(22,23,24,0.35),0_10px_20px_-15px_rgba(22,23,24,0.2)]"
|
|
1100
|
+
),
|
|
1101
|
+
children: [
|
|
1102
|
+
content,
|
|
1103
|
+
/* @__PURE__ */ jsx16(TooltipPrimitive.Arrow, { className: "fill-slate-900 dark:fill-slate-100" })
|
|
1104
|
+
]
|
|
1105
|
+
}
|
|
1106
|
+
)
|
|
1107
|
+
] }) });
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
// src/components/ui/progress3d.tsx
|
|
1111
|
+
import { motion as motion10 } from "framer-motion";
|
|
1112
|
+
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1113
|
+
function Progress3D({
|
|
1114
|
+
value,
|
|
1115
|
+
max = 100,
|
|
1116
|
+
variant = "default",
|
|
1117
|
+
size = "md",
|
|
1118
|
+
showLabel = false,
|
|
1119
|
+
label,
|
|
1120
|
+
className,
|
|
1121
|
+
animated = true
|
|
1122
|
+
}) {
|
|
1123
|
+
const percentage = Math.min(Math.max(value / max * 100, 0), 100);
|
|
1124
|
+
const variants = {
|
|
1125
|
+
default: "bg-primary border-primary/80",
|
|
1126
|
+
success: "bg-emerald-500 border-emerald-700",
|
|
1127
|
+
warning: "bg-amber-500 border-amber-700",
|
|
1128
|
+
danger: "bg-red-500 border-red-700"
|
|
1129
|
+
};
|
|
1130
|
+
const sizes = {
|
|
1131
|
+
sm: "h-2",
|
|
1132
|
+
md: "h-3",
|
|
1133
|
+
lg: "h-4"
|
|
1134
|
+
};
|
|
1135
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn("w-full space-y-2", className), children: [
|
|
1136
|
+
(label || showLabel) && /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between text-sm", children: [
|
|
1137
|
+
label && /* @__PURE__ */ jsx17("span", { className: "font-medium", children: label }),
|
|
1138
|
+
showLabel && /* @__PURE__ */ jsxs12("span", { className: "text-muted-foreground font-mono", children: [
|
|
1139
|
+
Math.round(percentage),
|
|
1140
|
+
"%"
|
|
1141
|
+
] })
|
|
1142
|
+
] }),
|
|
1143
|
+
/* @__PURE__ */ jsx17(
|
|
1144
|
+
"div",
|
|
1145
|
+
{
|
|
1146
|
+
className: cn(
|
|
1147
|
+
"w-full rounded-full bg-slate-200 dark:bg-slate-800 overflow-hidden shadow-inner border-b-2 border-slate-300 dark:border-slate-900",
|
|
1148
|
+
sizes[size]
|
|
1149
|
+
),
|
|
1150
|
+
children: /* @__PURE__ */ jsx17(
|
|
1151
|
+
motion10.div,
|
|
1152
|
+
{
|
|
1153
|
+
className: cn(
|
|
1154
|
+
"h-full rounded-full border-b-2 shadow-sm",
|
|
1155
|
+
variants[variant],
|
|
1156
|
+
animated && "transition-all"
|
|
1157
|
+
),
|
|
1158
|
+
initial: { width: 0 },
|
|
1159
|
+
animate: { width: `${percentage}%` },
|
|
1160
|
+
transition: {
|
|
1161
|
+
duration: animated ? 0.5 : 0,
|
|
1162
|
+
ease: "easeOut"
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
)
|
|
1166
|
+
}
|
|
1167
|
+
)
|
|
1168
|
+
] });
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
// src/components/ui/select3d.tsx
|
|
1172
|
+
import { Html } from "@react-three/drei";
|
|
1173
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1174
|
+
function Select3D({
|
|
1175
|
+
options,
|
|
1176
|
+
value,
|
|
1177
|
+
onChange,
|
|
1178
|
+
width = 200
|
|
1179
|
+
}) {
|
|
1180
|
+
return /* @__PURE__ */ jsx18(Html, { transform: true, children: /* @__PURE__ */ jsx18(
|
|
1181
|
+
"select",
|
|
1182
|
+
{
|
|
1183
|
+
className: cn(
|
|
1184
|
+
"px-3 py-2 bg-background/80 backdrop-blur border rounded text-foreground outline-none focus:ring-2 focus:ring-primary"
|
|
1185
|
+
),
|
|
1186
|
+
style: { width },
|
|
1187
|
+
value,
|
|
1188
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
1189
|
+
children: options.map((opt) => /* @__PURE__ */ jsx18("option", { value: opt.value, children: opt.label }, opt.value))
|
|
1190
|
+
}
|
|
1191
|
+
) });
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
// src/components/ui/spinner3d.tsx
|
|
1195
|
+
import { useRef as useRef2 } from "react";
|
|
1196
|
+
import { useFrame } from "@react-three/fiber";
|
|
1197
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1198
|
+
function Spinner3D({
|
|
1199
|
+
size = "md",
|
|
1200
|
+
color = "#22d3ee",
|
|
1201
|
+
speed = 1
|
|
1202
|
+
}) {
|
|
1203
|
+
const ref = useRef2(null);
|
|
1204
|
+
const scale = size === "sm" ? 0.5 : size === "lg" ? 1.5 : 1;
|
|
1205
|
+
useFrame((state, delta) => {
|
|
1206
|
+
if (ref.current) {
|
|
1207
|
+
ref.current.rotation.z -= delta * speed * 3;
|
|
1208
|
+
ref.current.rotation.x -= delta * speed * 1;
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
return /* @__PURE__ */ jsxs13("group", { ref, scale: [scale, scale, scale], children: [
|
|
1212
|
+
/* @__PURE__ */ jsxs13("mesh", { rotation: [Math.PI / 4, 0, 0], children: [
|
|
1213
|
+
/* @__PURE__ */ jsx19("torusGeometry", { args: [0.5, 0.05, 16, 32] }),
|
|
1214
|
+
/* @__PURE__ */ jsx19("meshStandardMaterial", { color, emissive: color })
|
|
1215
|
+
] }),
|
|
1216
|
+
/* @__PURE__ */ jsxs13("mesh", { rotation: [-Math.PI / 4, 0, 0], children: [
|
|
1217
|
+
/* @__PURE__ */ jsx19("torusGeometry", { args: [0.4, 0.05, 16, 32] }),
|
|
1218
|
+
/* @__PURE__ */ jsx19("meshStandardMaterial", { color })
|
|
1219
|
+
] })
|
|
1220
|
+
] });
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
// src/components/ui/stepper3d.tsx
|
|
1224
|
+
import { Text, Line } from "@react-three/drei";
|
|
1225
|
+
import { Vector3 } from "three";
|
|
1226
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1227
|
+
function Stepper3D({
|
|
1228
|
+
steps,
|
|
1229
|
+
activeStep = 0,
|
|
1230
|
+
gap = 2
|
|
1231
|
+
}) {
|
|
1232
|
+
const points = steps.map((_, i) => new Vector3((i - (steps.length - 1) / 2) * gap, 0, 0));
|
|
1233
|
+
return /* @__PURE__ */ jsxs14("group", { children: [
|
|
1234
|
+
/* @__PURE__ */ jsx20(
|
|
1235
|
+
Line,
|
|
1236
|
+
{
|
|
1237
|
+
points,
|
|
1238
|
+
color: "#333",
|
|
1239
|
+
lineWidth: 2
|
|
1240
|
+
}
|
|
1241
|
+
),
|
|
1242
|
+
activeStep > 0 && /* @__PURE__ */ jsx20(
|
|
1243
|
+
Line,
|
|
1244
|
+
{
|
|
1245
|
+
points: points.slice(0, activeStep + 1),
|
|
1246
|
+
color: "#22d3ee",
|
|
1247
|
+
lineWidth: 4
|
|
1248
|
+
}
|
|
1249
|
+
),
|
|
1250
|
+
steps.map((label, i) => /* @__PURE__ */ jsxs14("group", { position: points[i], children: [
|
|
1251
|
+
/* @__PURE__ */ jsxs14("mesh", { children: [
|
|
1252
|
+
/* @__PURE__ */ jsx20("sphereGeometry", { args: [0.3, 32, 32] }),
|
|
1253
|
+
/* @__PURE__ */ jsx20("meshStandardMaterial", { color: i <= activeStep ? "#22d3ee" : "#333" })
|
|
1254
|
+
] }),
|
|
1255
|
+
/* @__PURE__ */ jsx20(
|
|
1256
|
+
Text,
|
|
1257
|
+
{
|
|
1258
|
+
position: [0, -0.6, 0],
|
|
1259
|
+
fontSize: 0.2,
|
|
1260
|
+
color: i <= activeStep ? "white" : "#666",
|
|
1261
|
+
anchorX: "center",
|
|
1262
|
+
anchorY: "top",
|
|
1263
|
+
children: label
|
|
1264
|
+
}
|
|
1265
|
+
)
|
|
1266
|
+
] }, i))
|
|
1267
|
+
] });
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// src/components/ui/navbar3d.tsx
|
|
1271
|
+
import { useState as useState7 } from "react";
|
|
1272
|
+
import { Text as Text2 } from "@react-three/drei";
|
|
1273
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1274
|
+
function NavBar3D({ items, activeHref = "/" }) {
|
|
1275
|
+
return /* @__PURE__ */ jsxs15("group", { position: [0, -2, 0], children: [
|
|
1276
|
+
/* @__PURE__ */ jsxs15("mesh", { position: [0, 0, -0.1], children: [
|
|
1277
|
+
/* @__PURE__ */ jsx21("boxGeometry", { args: [items.length * 2, 1, 0.2] }),
|
|
1278
|
+
/* @__PURE__ */ jsx21("meshStandardMaterial", { color: "#1a1a1a", transparent: true, opacity: 0.8 })
|
|
1279
|
+
] }),
|
|
1280
|
+
items.map((item, i) => {
|
|
1281
|
+
const x = (i - (items.length - 1) / 2) * 2;
|
|
1282
|
+
const isActive = activeHref === item.href;
|
|
1283
|
+
return /* @__PURE__ */ jsx21(NavBarItemMesh, { item, x, isActive }, i);
|
|
1284
|
+
})
|
|
1285
|
+
] });
|
|
1286
|
+
}
|
|
1287
|
+
function NavBarItemMesh({ item, x, isActive }) {
|
|
1288
|
+
const [hovered, setHover] = useState7(false);
|
|
1289
|
+
return /* @__PURE__ */ jsxs15("group", { position: [x, 0, 0], children: [
|
|
1290
|
+
/* @__PURE__ */ jsxs15(
|
|
1291
|
+
"mesh",
|
|
1292
|
+
{
|
|
1293
|
+
onPointerOver: () => setHover(true),
|
|
1294
|
+
onPointerOut: () => setHover(false),
|
|
1295
|
+
onClick: () => window.location.href = item.href,
|
|
1296
|
+
children: [
|
|
1297
|
+
/* @__PURE__ */ jsx21("planeGeometry", { args: [1.8, 0.8] }),
|
|
1298
|
+
/* @__PURE__ */ jsx21("meshStandardMaterial", { color: isActive ? "#22d3ee" : hovered ? "#333" : "transparent", transparent: true, opacity: isActive ? 0.3 : hovered ? 0.5 : 0 })
|
|
1299
|
+
]
|
|
1300
|
+
}
|
|
1301
|
+
),
|
|
1302
|
+
/* @__PURE__ */ jsx21(
|
|
1303
|
+
Text2,
|
|
1304
|
+
{
|
|
1305
|
+
fontSize: 0.2,
|
|
1306
|
+
color: isActive || hovered ? "white" : "#888",
|
|
1307
|
+
anchorX: "center",
|
|
1308
|
+
anchorY: "middle",
|
|
1309
|
+
children: item.label
|
|
1310
|
+
}
|
|
1311
|
+
)
|
|
1312
|
+
] });
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
// src/components/ui/timeline3d.tsx
|
|
1316
|
+
import { Line as Line2, Text as Text3 } from "@react-three/drei";
|
|
1317
|
+
import { Vector3 as Vector32 } from "three";
|
|
1318
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1319
|
+
function Timeline3D({
|
|
1320
|
+
events,
|
|
1321
|
+
orientation = "horizontal",
|
|
1322
|
+
gap = 3
|
|
1323
|
+
}) {
|
|
1324
|
+
const points = events.map((_, i) => {
|
|
1325
|
+
return orientation === "horizontal" ? new Vector32((i - (events.length - 1) / 2) * gap, 0, 0) : new Vector32(0, (i - (events.length - 1) / 2) * -gap, 0);
|
|
1326
|
+
});
|
|
1327
|
+
return /* @__PURE__ */ jsxs16("group", { children: [
|
|
1328
|
+
/* @__PURE__ */ jsx22(Line2, { points, color: "#555", lineWidth: 1 }),
|
|
1329
|
+
events.map((ev, i) => /* @__PURE__ */ jsxs16("group", { position: points[i], children: [
|
|
1330
|
+
/* @__PURE__ */ jsxs16("mesh", { children: [
|
|
1331
|
+
/* @__PURE__ */ jsx22("sphereGeometry", { args: [0.2, 16, 16] }),
|
|
1332
|
+
/* @__PURE__ */ jsx22("meshStandardMaterial", { color: "#22d3ee" })
|
|
1333
|
+
] }),
|
|
1334
|
+
/* @__PURE__ */ jsxs16("group", { position: [0, 0.5, 0], children: [
|
|
1335
|
+
/* @__PURE__ */ jsx22(
|
|
1336
|
+
Text3,
|
|
1337
|
+
{
|
|
1338
|
+
fontSize: 0.3,
|
|
1339
|
+
color: "white",
|
|
1340
|
+
anchorY: "bottom",
|
|
1341
|
+
children: ev.date
|
|
1342
|
+
}
|
|
1343
|
+
),
|
|
1344
|
+
/* @__PURE__ */ jsx22(
|
|
1345
|
+
Text3,
|
|
1346
|
+
{
|
|
1347
|
+
position: [0, -0.3, 0],
|
|
1348
|
+
fontSize: 0.25,
|
|
1349
|
+
color: "#ccc",
|
|
1350
|
+
anchorY: "top",
|
|
1351
|
+
children: ev.title
|
|
1352
|
+
}
|
|
1353
|
+
)
|
|
1354
|
+
] })
|
|
1355
|
+
] }, i))
|
|
1356
|
+
] });
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
// src/components/ui/tooltip.tsx
|
|
1360
|
+
import * as React17 from "react";
|
|
1361
|
+
import * as TooltipPrimitive2 from "@radix-ui/react-tooltip";
|
|
1362
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1363
|
+
var Tooltip = TooltipPrimitive2.Root;
|
|
1364
|
+
var TooltipContent = React17.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
1365
|
+
TooltipPrimitive2.Content,
|
|
1366
|
+
{
|
|
1367
|
+
ref,
|
|
1368
|
+
sideOffset,
|
|
1369
|
+
className: cn(
|
|
1370
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1371
|
+
className
|
|
1372
|
+
),
|
|
1373
|
+
...props
|
|
1374
|
+
}
|
|
1375
|
+
));
|
|
1376
|
+
TooltipContent.displayName = TooltipPrimitive2.Content.displayName;
|
|
1377
|
+
|
|
1378
|
+
// src/components/ui/slider.tsx
|
|
1379
|
+
import * as React18 from "react";
|
|
1380
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
1381
|
+
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1382
|
+
var Slider = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs17(
|
|
1383
|
+
SliderPrimitive.Root,
|
|
1384
|
+
{
|
|
1385
|
+
ref,
|
|
1386
|
+
className: cn("relative flex w-full touch-none select-none items-center", className),
|
|
1387
|
+
...props,
|
|
1388
|
+
children: [
|
|
1389
|
+
/* @__PURE__ */ jsx24(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ jsx24(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
1390
|
+
/* @__PURE__ */ jsx24(SliderPrimitive.Thumb, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" })
|
|
1391
|
+
]
|
|
1392
|
+
}
|
|
1393
|
+
));
|
|
1394
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
1395
|
+
|
|
1396
|
+
// src/components/ui/toggle.tsx
|
|
1397
|
+
import * as React19 from "react";
|
|
1398
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
1399
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
1400
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1401
|
+
var toggleVariants = cva2(
|
|
1402
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
1403
|
+
{
|
|
1404
|
+
variants: {
|
|
1405
|
+
variant: {
|
|
1406
|
+
default: "bg-transparent",
|
|
1407
|
+
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
1408
|
+
},
|
|
1409
|
+
size: {
|
|
1410
|
+
default: "h-10 px-3",
|
|
1411
|
+
sm: "h-9 px-2.5",
|
|
1412
|
+
lg: "h-11 px-5"
|
|
1413
|
+
}
|
|
1414
|
+
},
|
|
1415
|
+
defaultVariants: {
|
|
1416
|
+
variant: "default",
|
|
1417
|
+
size: "default"
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
);
|
|
1421
|
+
var Toggle = React19.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx25(TogglePrimitive.Root, { ref, className: cn(toggleVariants({ variant, size, className })), ...props }));
|
|
1422
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
1423
|
+
|
|
1424
|
+
// src/components/ui/badge.tsx
|
|
1425
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
1426
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1427
|
+
var badgeVariants = cva3(
|
|
1428
|
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
1429
|
+
{
|
|
1430
|
+
variants: {
|
|
1431
|
+
variant: {
|
|
1432
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
1433
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
1434
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
1435
|
+
outline: "text-foreground"
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1438
|
+
defaultVariants: {
|
|
1439
|
+
variant: "default"
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
);
|
|
1443
|
+
function Badge({ className, variant, ...props }) {
|
|
1444
|
+
return /* @__PURE__ */ jsx26("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
// src/components/ui/input.tsx
|
|
1448
|
+
import * as React20 from "react";
|
|
1449
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1450
|
+
var Input = React20.forwardRef(
|
|
1451
|
+
({ className, type, ...props }, ref) => {
|
|
1452
|
+
return /* @__PURE__ */ jsx27(
|
|
1453
|
+
"input",
|
|
1454
|
+
{
|
|
1455
|
+
type,
|
|
1456
|
+
className: cn(
|
|
1457
|
+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
1458
|
+
className
|
|
1459
|
+
),
|
|
1460
|
+
ref,
|
|
1461
|
+
...props
|
|
1462
|
+
}
|
|
1463
|
+
);
|
|
1464
|
+
}
|
|
1465
|
+
);
|
|
1466
|
+
Input.displayName = "Input";
|
|
1467
|
+
|
|
1468
|
+
// src/components/ui/select.tsx
|
|
1469
|
+
import * as React21 from "react";
|
|
1470
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1471
|
+
import { Check, ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
1472
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1473
|
+
var Select = SelectPrimitive.Root;
|
|
1474
|
+
var SelectTrigger = React21.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs18(
|
|
1475
|
+
SelectPrimitive.Trigger,
|
|
1476
|
+
{
|
|
1477
|
+
ref,
|
|
1478
|
+
className: cn(
|
|
1479
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
1480
|
+
className
|
|
1481
|
+
),
|
|
1482
|
+
...props,
|
|
1483
|
+
children: [
|
|
1484
|
+
children,
|
|
1485
|
+
/* @__PURE__ */ jsx28(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx28(ChevronDown2, { className: "h-4 w-4 opacity-50" }) })
|
|
1486
|
+
]
|
|
1487
|
+
}
|
|
1488
|
+
));
|
|
1489
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1490
|
+
var SelectScrollUpButton = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1491
|
+
SelectPrimitive.ScrollUpButton,
|
|
1492
|
+
{
|
|
1493
|
+
ref,
|
|
1494
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
1495
|
+
...props,
|
|
1496
|
+
children: /* @__PURE__ */ jsx28(ChevronUp, { className: "h-4 w-4" })
|
|
1497
|
+
}
|
|
1498
|
+
));
|
|
1499
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1500
|
+
var SelectScrollDownButton = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1501
|
+
SelectPrimitive.ScrollDownButton,
|
|
1502
|
+
{
|
|
1503
|
+
ref,
|
|
1504
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
1505
|
+
...props,
|
|
1506
|
+
children: /* @__PURE__ */ jsx28(ChevronDown2, { className: "h-4 w-4" })
|
|
1507
|
+
}
|
|
1508
|
+
));
|
|
1509
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1510
|
+
var SelectContent = React21.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx28(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs18(
|
|
1511
|
+
SelectPrimitive.Content,
|
|
1512
|
+
{
|
|
1513
|
+
ref,
|
|
1514
|
+
className: cn(
|
|
1515
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1516
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
1517
|
+
className
|
|
1518
|
+
),
|
|
1519
|
+
position,
|
|
1520
|
+
...props,
|
|
1521
|
+
children: [
|
|
1522
|
+
/* @__PURE__ */ jsx28(SelectScrollUpButton, {}),
|
|
1523
|
+
/* @__PURE__ */ jsx28(
|
|
1524
|
+
SelectPrimitive.Viewport,
|
|
1525
|
+
{
|
|
1526
|
+
className: cn(
|
|
1527
|
+
"p-1",
|
|
1528
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
1529
|
+
),
|
|
1530
|
+
children
|
|
1531
|
+
}
|
|
1532
|
+
),
|
|
1533
|
+
/* @__PURE__ */ jsx28(SelectScrollDownButton, {})
|
|
1534
|
+
]
|
|
1535
|
+
}
|
|
1536
|
+
) }));
|
|
1537
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1538
|
+
var SelectLabel = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(SelectPrimitive.Label, { ref, className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className), ...props }));
|
|
1539
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1540
|
+
var SelectItem = React21.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs18(
|
|
1541
|
+
SelectPrimitive.Item,
|
|
1542
|
+
{
|
|
1543
|
+
ref,
|
|
1544
|
+
className: cn(
|
|
1545
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
|
|
1546
|
+
className
|
|
1547
|
+
),
|
|
1548
|
+
...props,
|
|
1549
|
+
children: [
|
|
1550
|
+
/* @__PURE__ */ jsx28("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx28(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx28(Check, { className: "h-4 w-4" }) }) }),
|
|
1551
|
+
/* @__PURE__ */ jsx28(SelectPrimitive.ItemText, { children })
|
|
1552
|
+
]
|
|
1553
|
+
}
|
|
1554
|
+
));
|
|
1555
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
1556
|
+
var SelectSeparator = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(SelectPrimitive.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props }));
|
|
1557
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1558
|
+
|
|
1559
|
+
// src/components/ui/table.tsx
|
|
1560
|
+
import * as React22 from "react";
|
|
1561
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1562
|
+
var Table = React22.forwardRef(
|
|
1563
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx29("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx29("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props }) })
|
|
1564
|
+
);
|
|
1565
|
+
Table.displayName = "Table";
|
|
1566
|
+
var TableHeader = React22.forwardRef(
|
|
1567
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx29("thead", { ref, className: cn("[&_tr]:border-b", className), ...props })
|
|
1568
|
+
);
|
|
1569
|
+
TableHeader.displayName = "TableHeader";
|
|
1570
|
+
var TableBody = React22.forwardRef(
|
|
1571
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx29("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props })
|
|
1572
|
+
);
|
|
1573
|
+
TableBody.displayName = "TableBody";
|
|
1574
|
+
var TableFooter = React22.forwardRef(
|
|
1575
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx29("tfoot", { ref, className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props })
|
|
1576
|
+
);
|
|
1577
|
+
TableFooter.displayName = "TableFooter";
|
|
1578
|
+
var TableRow = React22.forwardRef(
|
|
1579
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx29(
|
|
1580
|
+
"tr",
|
|
1581
|
+
{
|
|
1582
|
+
ref,
|
|
1583
|
+
className: cn("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50", className),
|
|
1584
|
+
...props
|
|
1585
|
+
}
|
|
1586
|
+
)
|
|
1587
|
+
);
|
|
1588
|
+
TableRow.displayName = "TableRow";
|
|
1589
|
+
var TableHead = React22.forwardRef(
|
|
1590
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx29(
|
|
1591
|
+
"th",
|
|
1592
|
+
{
|
|
1593
|
+
ref,
|
|
1594
|
+
className: cn(
|
|
1595
|
+
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
1596
|
+
className
|
|
1597
|
+
),
|
|
1598
|
+
...props
|
|
1599
|
+
}
|
|
1600
|
+
)
|
|
1601
|
+
);
|
|
1602
|
+
TableHead.displayName = "TableHead";
|
|
1603
|
+
var TableCell = React22.forwardRef(
|
|
1604
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx29("td", { ref, className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className), ...props })
|
|
1605
|
+
);
|
|
1606
|
+
TableCell.displayName = "TableCell";
|
|
1607
|
+
var TableCaption = React22.forwardRef(
|
|
1608
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx29("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props })
|
|
1609
|
+
);
|
|
1610
|
+
TableCaption.displayName = "TableCaption";
|
|
1611
|
+
|
|
1612
|
+
// src/components/ui/pagination.tsx
|
|
1613
|
+
import * as React23 from "react";
|
|
1614
|
+
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
|
|
1615
|
+
import { jsx as jsx30, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1616
|
+
var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx30(
|
|
1617
|
+
"nav",
|
|
1618
|
+
{
|
|
1619
|
+
role: "navigation",
|
|
1620
|
+
"aria-label": "pagination",
|
|
1621
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
1622
|
+
...props
|
|
1623
|
+
}
|
|
1624
|
+
);
|
|
1625
|
+
Pagination.displayName = "Pagination";
|
|
1626
|
+
var PaginationContent = React23.forwardRef(
|
|
1627
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx30("ul", { ref, className: cn("flex flex-row items-center gap-1", className), ...props })
|
|
1628
|
+
);
|
|
1629
|
+
PaginationContent.displayName = "PaginationContent";
|
|
1630
|
+
var PaginationItem = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30("li", { ref, className: cn("", className), ...props }));
|
|
1631
|
+
PaginationItem.displayName = "PaginationItem";
|
|
1632
|
+
var PaginationLink = ({ className, isActive, size = "icon", ...props }) => /* @__PURE__ */ jsx30(
|
|
1633
|
+
"a",
|
|
1634
|
+
{
|
|
1635
|
+
"aria-current": isActive ? "page" : void 0,
|
|
1636
|
+
className: cn(
|
|
1637
|
+
buttonVariants({
|
|
1638
|
+
variant: isActive ? "outline" : "ghost",
|
|
1639
|
+
size
|
|
1640
|
+
}),
|
|
1641
|
+
className
|
|
1642
|
+
),
|
|
1643
|
+
...props
|
|
1644
|
+
}
|
|
1645
|
+
);
|
|
1646
|
+
PaginationLink.displayName = "PaginationLink";
|
|
1647
|
+
var PaginationPrevious = ({ className, ...props }) => /* @__PURE__ */ jsxs19(PaginationLink, { "aria-label": "Go to previous page", size: "default", className: cn("gap-1 pl-2.5", className), ...props, children: [
|
|
1648
|
+
/* @__PURE__ */ jsx30(ChevronLeft, { className: "h-4 w-4" }),
|
|
1649
|
+
/* @__PURE__ */ jsx30("span", { children: "Previous" })
|
|
1650
|
+
] });
|
|
1651
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
1652
|
+
var PaginationNext = ({ className, ...props }) => /* @__PURE__ */ jsxs19(PaginationLink, { "aria-label": "Go to next page", size: "default", className: cn("gap-1 pr-2.5", className), ...props, children: [
|
|
1653
|
+
/* @__PURE__ */ jsx30("span", { children: "Next" }),
|
|
1654
|
+
/* @__PURE__ */ jsx30(ChevronRight, { className: "h-4 w-4" })
|
|
1655
|
+
] });
|
|
1656
|
+
PaginationNext.displayName = "PaginationNext";
|
|
1657
|
+
var PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs19("span", { "aria-hidden": true, className: cn("flex h-9 w-9 items-center justify-center", className), ...props, children: [
|
|
1658
|
+
/* @__PURE__ */ jsx30(MoreHorizontal, { className: "h-4 w-4" }),
|
|
1659
|
+
/* @__PURE__ */ jsx30("span", { className: "sr-only", children: "More pages" })
|
|
1660
|
+
] });
|
|
1661
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
1662
|
+
|
|
1663
|
+
// src/components/ui/progress.tsx
|
|
1664
|
+
import * as React24 from "react";
|
|
1665
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
1666
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1667
|
+
var Progress = React24.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
1668
|
+
ProgressPrimitive.Root,
|
|
1669
|
+
{
|
|
1670
|
+
ref,
|
|
1671
|
+
className: cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className),
|
|
1672
|
+
...props,
|
|
1673
|
+
children: /* @__PURE__ */ jsx31(
|
|
1674
|
+
ProgressPrimitive.Indicator,
|
|
1675
|
+
{
|
|
1676
|
+
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
1677
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
1678
|
+
}
|
|
1679
|
+
)
|
|
1680
|
+
}
|
|
1681
|
+
));
|
|
1682
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
1683
|
+
|
|
1684
|
+
// src/components/ui/skeleton.tsx
|
|
1685
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1686
|
+
function Skeleton({ className, ...props }) {
|
|
1687
|
+
return /* @__PURE__ */ jsx32("div", { className: cn("animate-pulse rounded-md bg-muted", className), ...props });
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
// src/components/ui/toast.tsx
|
|
1691
|
+
import * as React25 from "react";
|
|
1692
|
+
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
1693
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
1694
|
+
import { X as X2 } from "lucide-react";
|
|
1695
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1696
|
+
var ToastViewport = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
1697
|
+
ToastPrimitives.Viewport,
|
|
1698
|
+
{
|
|
1699
|
+
ref,
|
|
1700
|
+
className: cn(
|
|
1701
|
+
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
|
1702
|
+
className
|
|
1703
|
+
),
|
|
1704
|
+
...props
|
|
1705
|
+
}
|
|
1706
|
+
));
|
|
1707
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
1708
|
+
var toastVariants = cva4(
|
|
1709
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
1710
|
+
{
|
|
1711
|
+
variants: {
|
|
1712
|
+
variant: {
|
|
1713
|
+
default: "border bg-background text-foreground",
|
|
1714
|
+
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
|
|
1715
|
+
}
|
|
1716
|
+
},
|
|
1717
|
+
defaultVariants: {
|
|
1718
|
+
variant: "default"
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
);
|
|
1722
|
+
var Toast = React25.forwardRef(({ className, variant, ...props }, ref) => {
|
|
1723
|
+
return /* @__PURE__ */ jsx33(ToastPrimitives.Root, { ref, className: cn(toastVariants({ variant }), className), ...props });
|
|
1724
|
+
});
|
|
1725
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
1726
|
+
var ToastAction = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
1727
|
+
ToastPrimitives.Action,
|
|
1728
|
+
{
|
|
1729
|
+
ref,
|
|
1730
|
+
className: cn(
|
|
1731
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",
|
|
1732
|
+
className
|
|
1733
|
+
),
|
|
1734
|
+
...props
|
|
1735
|
+
}
|
|
1736
|
+
));
|
|
1737
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
1738
|
+
var ToastClose = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
1739
|
+
ToastPrimitives.Close,
|
|
1740
|
+
{
|
|
1741
|
+
ref,
|
|
1742
|
+
className: cn(
|
|
1743
|
+
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
1744
|
+
className
|
|
1745
|
+
),
|
|
1746
|
+
"toast-close": "",
|
|
1747
|
+
...props,
|
|
1748
|
+
children: /* @__PURE__ */ jsx33(X2, { className: "h-4 w-4" })
|
|
1749
|
+
}
|
|
1750
|
+
));
|
|
1751
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
1752
|
+
var ToastTitle = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(ToastPrimitives.Title, { ref, className: cn("text-sm font-semibold", className), ...props }));
|
|
1753
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
1754
|
+
var ToastDescription = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(ToastPrimitives.Description, { ref, className: cn("text-sm opacity-90", className), ...props }));
|
|
1755
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
1756
|
+
|
|
1757
|
+
// src/components/ui/popover.tsx
|
|
1758
|
+
import * as React26 from "react";
|
|
1759
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1760
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1761
|
+
var Popover = PopoverPrimitive.Root;
|
|
1762
|
+
var PopoverContent = React26.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx34(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx34(
|
|
1763
|
+
PopoverPrimitive.Content,
|
|
1764
|
+
{
|
|
1765
|
+
ref,
|
|
1766
|
+
align,
|
|
1767
|
+
sideOffset,
|
|
1768
|
+
className: cn(
|
|
1769
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1770
|
+
className
|
|
1771
|
+
),
|
|
1772
|
+
...props
|
|
1773
|
+
}
|
|
1774
|
+
) }));
|
|
1775
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1776
|
+
|
|
1777
|
+
// src/components/ui/sheet.tsx
|
|
1778
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
1779
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
1780
|
+
import { X as X3 } from "lucide-react";
|
|
1781
|
+
import * as React27 from "react";
|
|
1782
|
+
import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1783
|
+
var Sheet = SheetPrimitive.Root;
|
|
1784
|
+
var SheetPortal = SheetPrimitive.Portal;
|
|
1785
|
+
var SheetOverlay = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
1786
|
+
SheetPrimitive.Overlay,
|
|
1787
|
+
{
|
|
1788
|
+
className: cn(
|
|
1789
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1790
|
+
className
|
|
1791
|
+
),
|
|
1792
|
+
...props,
|
|
1793
|
+
ref
|
|
1794
|
+
}
|
|
1795
|
+
));
|
|
1796
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
1797
|
+
var sheetVariants = cva5(
|
|
1798
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
1799
|
+
{
|
|
1800
|
+
variants: {
|
|
1801
|
+
side: {
|
|
1802
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
1803
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
1804
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
1805
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
1806
|
+
}
|
|
1807
|
+
},
|
|
1808
|
+
defaultVariants: {
|
|
1809
|
+
side: "right"
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
);
|
|
1813
|
+
var SheetContent = React27.forwardRef(
|
|
1814
|
+
({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs20(SheetPortal, { children: [
|
|
1815
|
+
/* @__PURE__ */ jsx35(SheetOverlay, {}),
|
|
1816
|
+
/* @__PURE__ */ jsxs20(SheetPrimitive.Content, { ref, className: cn(sheetVariants({ side }), className), ...props, children: [
|
|
1817
|
+
children,
|
|
1818
|
+
/* @__PURE__ */ jsxs20(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
|
|
1819
|
+
/* @__PURE__ */ jsx35(X3, { className: "h-4 w-4" }),
|
|
1820
|
+
/* @__PURE__ */ jsx35("span", { className: "sr-only", children: "Close" })
|
|
1821
|
+
] })
|
|
1822
|
+
] })
|
|
1823
|
+
] })
|
|
1824
|
+
);
|
|
1825
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
1826
|
+
var SheetHeader = ({ className, ...props }) => /* @__PURE__ */ jsx35("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props });
|
|
1827
|
+
SheetHeader.displayName = "SheetHeader";
|
|
1828
|
+
var SheetFooter = ({ className, ...props }) => /* @__PURE__ */ jsx35("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
|
|
1829
|
+
SheetFooter.displayName = "SheetFooter";
|
|
1830
|
+
var SheetTitle = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(SheetPrimitive.Title, { ref, className: cn("text-lg font-semibold text-foreground", className), ...props }));
|
|
1831
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
1832
|
+
var SheetDescription = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(SheetPrimitive.Description, { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
1833
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
1834
|
+
|
|
1835
|
+
// src/components/ui/dialog.tsx
|
|
1836
|
+
import * as React28 from "react";
|
|
1837
|
+
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
1838
|
+
import { X as X4 } from "lucide-react";
|
|
1839
|
+
import { jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1840
|
+
var Dialog = DialogPrimitive2.Root;
|
|
1841
|
+
var DialogPortal = DialogPrimitive2.Portal;
|
|
1842
|
+
var DialogOverlay = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
1843
|
+
DialogPrimitive2.Overlay,
|
|
1844
|
+
{
|
|
1845
|
+
ref,
|
|
1846
|
+
className: cn(
|
|
1847
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1848
|
+
className
|
|
1849
|
+
),
|
|
1850
|
+
...props
|
|
1851
|
+
}
|
|
1852
|
+
));
|
|
1853
|
+
DialogOverlay.displayName = DialogPrimitive2.Overlay.displayName;
|
|
1854
|
+
var DialogContent = React28.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs21(DialogPortal, { children: [
|
|
1855
|
+
/* @__PURE__ */ jsx36(DialogOverlay, {}),
|
|
1856
|
+
/* @__PURE__ */ jsxs21(
|
|
1857
|
+
DialogPrimitive2.Content,
|
|
1858
|
+
{
|
|
1859
|
+
ref,
|
|
1860
|
+
className: cn(
|
|
1861
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
1862
|
+
className
|
|
1863
|
+
),
|
|
1864
|
+
...props,
|
|
1865
|
+
children: [
|
|
1866
|
+
children,
|
|
1867
|
+
/* @__PURE__ */ jsxs21(DialogPrimitive2.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
|
|
1868
|
+
/* @__PURE__ */ jsx36(X4, { className: "h-4 w-4" }),
|
|
1869
|
+
/* @__PURE__ */ jsx36("span", { className: "sr-only", children: "Close" })
|
|
1870
|
+
] })
|
|
1871
|
+
]
|
|
1872
|
+
}
|
|
1873
|
+
)
|
|
1874
|
+
] }));
|
|
1875
|
+
DialogContent.displayName = DialogPrimitive2.Content.displayName;
|
|
1876
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx36("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
1877
|
+
DialogHeader.displayName = "DialogHeader";
|
|
1878
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx36("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
|
|
1879
|
+
DialogFooter.displayName = "DialogFooter";
|
|
1880
|
+
var DialogTitle = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
1881
|
+
DialogPrimitive2.Title,
|
|
1882
|
+
{
|
|
1883
|
+
ref,
|
|
1884
|
+
className: cn("text-lg font-semibold leading-none tracking-tight", className),
|
|
1885
|
+
...props
|
|
1886
|
+
}
|
|
1887
|
+
));
|
|
1888
|
+
DialogTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
1889
|
+
var DialogDescription = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(DialogPrimitive2.Description, { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
1890
|
+
DialogDescription.displayName = DialogPrimitive2.Description.displayName;
|
|
1891
|
+
|
|
1892
|
+
// src/components/ui/breadcrumb.tsx
|
|
1893
|
+
import * as React29 from "react";
|
|
1894
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
1895
|
+
import { ChevronRight as ChevronRight2, MoreHorizontal as MoreHorizontal2 } from "lucide-react";
|
|
1896
|
+
import { jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1897
|
+
var Breadcrumb = React29.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx37("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
1898
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
1899
|
+
var BreadcrumbList = React29.forwardRef(
|
|
1900
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
1901
|
+
"ol",
|
|
1902
|
+
{
|
|
1903
|
+
ref,
|
|
1904
|
+
className: cn(
|
|
1905
|
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
|
|
1906
|
+
className
|
|
1907
|
+
),
|
|
1908
|
+
...props
|
|
1909
|
+
}
|
|
1910
|
+
)
|
|
1911
|
+
);
|
|
1912
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
1913
|
+
var BreadcrumbItem = React29.forwardRef(
|
|
1914
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx37("li", { ref, className: cn("inline-flex items-center gap-1.5", className), ...props })
|
|
1915
|
+
);
|
|
1916
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
1917
|
+
var BreadcrumbLink = React29.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
1918
|
+
const Comp = asChild ? Slot2 : "a";
|
|
1919
|
+
return /* @__PURE__ */ jsx37(Comp, { ref, className: cn("transition-colors hover:text-foreground", className), ...props });
|
|
1920
|
+
});
|
|
1921
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
1922
|
+
var BreadcrumbPage = React29.forwardRef(
|
|
1923
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
1924
|
+
"span",
|
|
1925
|
+
{
|
|
1926
|
+
ref,
|
|
1927
|
+
role: "link",
|
|
1928
|
+
"aria-disabled": "true",
|
|
1929
|
+
"aria-current": "page",
|
|
1930
|
+
className: cn("font-normal text-foreground", className),
|
|
1931
|
+
...props
|
|
1932
|
+
}
|
|
1933
|
+
)
|
|
1934
|
+
);
|
|
1935
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
1936
|
+
var BreadcrumbSeparator = ({ children, className, ...props }) => /* @__PURE__ */ jsx37("li", { role: "presentation", "aria-hidden": "true", className: cn("[&>svg]:size-3.5", className), ...props, children: children ?? /* @__PURE__ */ jsx37(ChevronRight2, {}) });
|
|
1937
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
1938
|
+
var BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs22(
|
|
1939
|
+
"span",
|
|
1940
|
+
{
|
|
1941
|
+
role: "presentation",
|
|
1942
|
+
"aria-hidden": "true",
|
|
1943
|
+
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
1944
|
+
...props,
|
|
1945
|
+
children: [
|
|
1946
|
+
/* @__PURE__ */ jsx37(MoreHorizontal2, { className: "h-4 w-4" }),
|
|
1947
|
+
/* @__PURE__ */ jsx37("span", { className: "sr-only", children: "More" })
|
|
1948
|
+
]
|
|
1949
|
+
}
|
|
1950
|
+
);
|
|
1951
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
1952
|
+
|
|
1953
|
+
// src/components/ui/barchart3d.tsx
|
|
1954
|
+
import { useMemo, useRef as useRef3, useState as useState8 } from "react";
|
|
1955
|
+
import { useFrame as useFrame2 } from "@react-three/fiber";
|
|
1956
|
+
import { Text as Text4, Instances, Instance } from "@react-three/drei";
|
|
1957
|
+
import { jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1958
|
+
function BarChart3D({
|
|
1959
|
+
data,
|
|
1960
|
+
orientation = "vertical",
|
|
1961
|
+
barSize = 0.5,
|
|
1962
|
+
gap = 0.2,
|
|
1963
|
+
animated = true
|
|
1964
|
+
}) {
|
|
1965
|
+
const maxValue = useMemo(() => Math.max(...data.map((d) => d.value)), [data]);
|
|
1966
|
+
return /* @__PURE__ */ jsxs23("group", { children: [
|
|
1967
|
+
/* @__PURE__ */ jsx38("gridHelper", { args: [data.length * (barSize + gap) + 2, 10], position: [0, 0, 0] }),
|
|
1968
|
+
/* @__PURE__ */ jsxs23(Instances, { range: data.length, children: [
|
|
1969
|
+
/* @__PURE__ */ jsx38("boxGeometry", { args: [barSize, 1, barSize] }),
|
|
1970
|
+
/* @__PURE__ */ jsx38("meshStandardMaterial", { roughness: 0.3, metalness: 0.6 }),
|
|
1971
|
+
data.map((item, index) => {
|
|
1972
|
+
const height = item.value / maxValue * 5;
|
|
1973
|
+
const x = (index - data.length / 2) * (barSize + gap);
|
|
1974
|
+
return /* @__PURE__ */ jsxs23("group", { position: [x, 0, 0], children: [
|
|
1975
|
+
/* @__PURE__ */ jsx38(
|
|
1976
|
+
BarInstance,
|
|
1977
|
+
{
|
|
1978
|
+
height,
|
|
1979
|
+
color: item.color || "#8884d8",
|
|
1980
|
+
animated
|
|
1981
|
+
}
|
|
1982
|
+
),
|
|
1983
|
+
/* @__PURE__ */ jsx38(
|
|
1984
|
+
Text4,
|
|
1985
|
+
{
|
|
1986
|
+
position: [0, -0.5, 0],
|
|
1987
|
+
fontSize: 0.2,
|
|
1988
|
+
color: "black",
|
|
1989
|
+
anchorX: "center",
|
|
1990
|
+
anchorY: "top",
|
|
1991
|
+
children: item.label
|
|
1992
|
+
}
|
|
1993
|
+
)
|
|
1994
|
+
] }, index);
|
|
1995
|
+
})
|
|
1996
|
+
] })
|
|
1997
|
+
] });
|
|
1998
|
+
}
|
|
1999
|
+
function BarInstance({ height, color, animated }) {
|
|
2000
|
+
const ref = useRef3(null);
|
|
2001
|
+
const [hovered, setHover] = useState8(false);
|
|
2002
|
+
useFrame2((state, delta) => {
|
|
2003
|
+
if (ref.current) {
|
|
2004
|
+
const targetHeight = height;
|
|
2005
|
+
const targetY = height / 2;
|
|
2006
|
+
if (animated) {
|
|
2007
|
+
ref.current.scale.y += (targetHeight - ref.current.scale.y) * delta * 5;
|
|
2008
|
+
ref.current.position.y += (targetY - ref.current.position.y) * delta * 5;
|
|
2009
|
+
} else {
|
|
2010
|
+
ref.current.scale.y = targetHeight;
|
|
2011
|
+
ref.current.position.y = targetY;
|
|
2012
|
+
}
|
|
2013
|
+
if (hovered) {
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
});
|
|
2017
|
+
return /* @__PURE__ */ jsx38(
|
|
2018
|
+
Instance,
|
|
2019
|
+
{
|
|
2020
|
+
ref,
|
|
2021
|
+
color: hovered ? "orange" : color,
|
|
2022
|
+
onPointerOver: () => setHover(true),
|
|
2023
|
+
onPointerOut: () => setHover(false)
|
|
2024
|
+
}
|
|
2025
|
+
);
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
// src/components/ui/linechart3d.tsx
|
|
2029
|
+
import { useMemo as useMemo2 } from "react";
|
|
2030
|
+
import { Line as Line3 } from "@react-three/drei";
|
|
2031
|
+
import { Vector3 as Vector33, CatmullRomCurve3 } from "three";
|
|
2032
|
+
import { jsx as jsx39, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2033
|
+
function LineChart3D({
|
|
2034
|
+
data,
|
|
2035
|
+
smooth = true,
|
|
2036
|
+
color = "#22d3ee",
|
|
2037
|
+
lineWidth = 3,
|
|
2038
|
+
showPoints = true
|
|
2039
|
+
}) {
|
|
2040
|
+
const points = useMemo2(() => {
|
|
2041
|
+
if (data.length === 0) return [];
|
|
2042
|
+
const maxX = Math.max(...data.map((d) => d.x));
|
|
2043
|
+
const maxY = Math.max(...data.map((d) => d.y));
|
|
2044
|
+
return data.map((d) => new Vector33(
|
|
2045
|
+
d.x / (maxX || 1) * 10 - 5,
|
|
2046
|
+
// Center X
|
|
2047
|
+
d.y / (maxY || 1) * 5,
|
|
2048
|
+
// Y up
|
|
2049
|
+
0
|
|
2050
|
+
));
|
|
2051
|
+
}, [data]);
|
|
2052
|
+
const curve = useMemo2(() => {
|
|
2053
|
+
if (points.length < 2 || !smooth) return null;
|
|
2054
|
+
return new CatmullRomCurve3(points);
|
|
2055
|
+
}, [points, smooth]);
|
|
2056
|
+
return /* @__PURE__ */ jsxs24("group", { children: [
|
|
2057
|
+
smooth && curve ? (
|
|
2058
|
+
// Render curve
|
|
2059
|
+
/* @__PURE__ */ jsxs24("mesh", { children: [
|
|
2060
|
+
/* @__PURE__ */ jsx39("tubeGeometry", { args: [curve, 64, 0.05, 8, false] }),
|
|
2061
|
+
/* @__PURE__ */ jsx39("meshStandardMaterial", { color, emissive: color, emissiveIntensity: 0.5 })
|
|
2062
|
+
] })
|
|
2063
|
+
) : /* @__PURE__ */ jsx39(
|
|
2064
|
+
Line3,
|
|
2065
|
+
{
|
|
2066
|
+
points,
|
|
2067
|
+
color,
|
|
2068
|
+
lineWidth,
|
|
2069
|
+
segments: true
|
|
2070
|
+
}
|
|
2071
|
+
),
|
|
2072
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ jsxs24("mesh", { position: p, children: [
|
|
2073
|
+
/* @__PURE__ */ jsx39("sphereGeometry", { args: [0.1, 16, 16] }),
|
|
2074
|
+
/* @__PURE__ */ jsx39("meshStandardMaterial", { color: "white" })
|
|
2075
|
+
] }, i)),
|
|
2076
|
+
/* @__PURE__ */ jsx39("gridHelper", { args: [12, 12], rotation: [Math.PI / 2, 0, 0], position: [0, 2.5, -0.1] })
|
|
2077
|
+
] });
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
// src/components/ui/piechart3d.tsx
|
|
2081
|
+
import React32, { useMemo as useMemo3, useState as useState9 } from "react";
|
|
2082
|
+
import { Shape } from "three";
|
|
2083
|
+
import { useFrame as useFrame3 } from "@react-three/fiber";
|
|
2084
|
+
import { Text as Text5 } from "@react-three/drei";
|
|
2085
|
+
import { jsx as jsx40, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2086
|
+
function PieChart3D({
|
|
2087
|
+
data,
|
|
2088
|
+
radius = 5,
|
|
2089
|
+
depth = 1,
|
|
2090
|
+
explode = true,
|
|
2091
|
+
donut = false
|
|
2092
|
+
}) {
|
|
2093
|
+
const total = useMemo3(() => data.reduce((acc, cur) => acc + cur.value, 0), [data]);
|
|
2094
|
+
let startAngle = 0;
|
|
2095
|
+
return /* @__PURE__ */ jsxs25("group", { rotation: [-Math.PI / 2, 0, 0], children: [
|
|
2096
|
+
" ",
|
|
2097
|
+
data.map((item, index) => {
|
|
2098
|
+
const percent = item.value / total;
|
|
2099
|
+
const angle = percent * Math.PI * 2;
|
|
2100
|
+
const endAngle = startAngle + angle;
|
|
2101
|
+
const props = {
|
|
2102
|
+
startAngle,
|
|
2103
|
+
endAngle,
|
|
2104
|
+
radius,
|
|
2105
|
+
color: item.color || `hsl(${index / data.length * 360}, 70%, 50%)`,
|
|
2106
|
+
depth,
|
|
2107
|
+
explode,
|
|
2108
|
+
innerRadius: donut ? radius * 0.5 : 0
|
|
2109
|
+
};
|
|
2110
|
+
startAngle = endAngle;
|
|
2111
|
+
return /* @__PURE__ */ jsx40(PieSegment, { ...props, label: item.label }, index);
|
|
2112
|
+
})
|
|
2113
|
+
] });
|
|
2114
|
+
}
|
|
2115
|
+
function PieSegment({ startAngle, endAngle, radius, color, depth, explode, innerRadius, label }) {
|
|
2116
|
+
const shape = useMemo3(() => {
|
|
2117
|
+
const s = new Shape();
|
|
2118
|
+
if (innerRadius > 0) {
|
|
2119
|
+
s.moveTo(Math.cos(startAngle) * radius, Math.sin(startAngle) * radius);
|
|
2120
|
+
s.absarc(0, 0, radius, startAngle, endAngle, false);
|
|
2121
|
+
const hole = new Shape();
|
|
2122
|
+
hole.absarc(0, 0, innerRadius, startAngle, endAngle, false);
|
|
2123
|
+
s.holes.push(hole);
|
|
2124
|
+
} else {
|
|
2125
|
+
s.moveTo(0, 0);
|
|
2126
|
+
s.arc(0, 0, radius, startAngle, endAngle, false);
|
|
2127
|
+
s.lineTo(0, 0);
|
|
2128
|
+
}
|
|
2129
|
+
return s;
|
|
2130
|
+
}, [startAngle, endAngle, radius, innerRadius]);
|
|
2131
|
+
const [hovered, setHover] = useState9(false);
|
|
2132
|
+
const ref = React32.useRef(null);
|
|
2133
|
+
const midAngle = (startAngle + endAngle) / 2;
|
|
2134
|
+
const explodeDir = [Math.cos(midAngle), Math.sin(midAngle), 0];
|
|
2135
|
+
useFrame3((state, delta) => {
|
|
2136
|
+
if (ref.current && explode) {
|
|
2137
|
+
const targetDist = hovered ? 0.5 : 0;
|
|
2138
|
+
ref.current.position.x += (explodeDir[0] * targetDist - ref.current.position.x) * delta * 5;
|
|
2139
|
+
ref.current.position.y += (explodeDir[1] * targetDist - ref.current.position.y) * delta * 5;
|
|
2140
|
+
}
|
|
2141
|
+
});
|
|
2142
|
+
return /* @__PURE__ */ jsxs25("group", { ref, children: [
|
|
2143
|
+
/* @__PURE__ */ jsxs25(
|
|
2144
|
+
"mesh",
|
|
2145
|
+
{
|
|
2146
|
+
onPointerOver: () => setHover(true),
|
|
2147
|
+
onPointerOut: () => setHover(false),
|
|
2148
|
+
children: [
|
|
2149
|
+
/* @__PURE__ */ jsx40("extrudeGeometry", { args: [shape, { depth, bevelEnabled: false }] }),
|
|
2150
|
+
/* @__PURE__ */ jsx40("meshStandardMaterial", { color: hovered ? "white" : color })
|
|
2151
|
+
]
|
|
2152
|
+
}
|
|
2153
|
+
),
|
|
2154
|
+
hovered && /* @__PURE__ */ jsx40(
|
|
2155
|
+
Text5,
|
|
2156
|
+
{
|
|
2157
|
+
position: [explodeDir[0] * radius * 0.8, explodeDir[1] * radius * 0.8, depth + 0.1],
|
|
2158
|
+
fontSize: 0.5,
|
|
2159
|
+
color: "black",
|
|
2160
|
+
children: label
|
|
2161
|
+
}
|
|
2162
|
+
)
|
|
2163
|
+
] });
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
// src/components/ui/scatterplot3d.tsx
|
|
2167
|
+
import { useRef as useRef4, useState as useState10 } from "react";
|
|
2168
|
+
import { Instances as Instances2, Instance as Instance2 } from "@react-three/drei";
|
|
2169
|
+
import { Vector3 as Vector34 } from "three";
|
|
2170
|
+
import { useFrame as useFrame4 } from "@react-three/fiber";
|
|
2171
|
+
import { jsx as jsx41, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2172
|
+
function ScatterPlot3D({
|
|
2173
|
+
data,
|
|
2174
|
+
pointSize = 0.1,
|
|
2175
|
+
colorScale = ["#22d3ee", "#a78bfa"]
|
|
2176
|
+
}) {
|
|
2177
|
+
return /* @__PURE__ */ jsxs26("group", { children: [
|
|
2178
|
+
/* @__PURE__ */ jsxs26(Instances2, { range: data.length, children: [
|
|
2179
|
+
/* @__PURE__ */ jsx41("sphereGeometry", { args: [1, 16, 16] }),
|
|
2180
|
+
/* @__PURE__ */ jsx41("meshStandardMaterial", {}),
|
|
2181
|
+
data.map((point, i) => /* @__PURE__ */ jsx41(
|
|
2182
|
+
ScatterPointInstance,
|
|
2183
|
+
{
|
|
2184
|
+
position: [point.x, point.y, point.z],
|
|
2185
|
+
scale: point.size || pointSize,
|
|
2186
|
+
color: point.color || colorScale[i % colorScale.length]
|
|
2187
|
+
},
|
|
2188
|
+
i
|
|
2189
|
+
))
|
|
2190
|
+
] }),
|
|
2191
|
+
/* @__PURE__ */ jsx41("axesHelper", { args: [10] }),
|
|
2192
|
+
/* @__PURE__ */ jsx41("gridHelper", { args: [20, 20], position: [0, -5, 0] })
|
|
2193
|
+
] });
|
|
2194
|
+
}
|
|
2195
|
+
function ScatterPointInstance({ position, scale, color }) {
|
|
2196
|
+
const ref = useRef4(null);
|
|
2197
|
+
const [hovered, setHover] = useState10(false);
|
|
2198
|
+
useFrame4((state) => {
|
|
2199
|
+
if (ref.current) {
|
|
2200
|
+
const s = hovered ? scale * 1.5 : scale;
|
|
2201
|
+
const target = new Vector34(s, s, s);
|
|
2202
|
+
ref.current.scale.lerp(target, 0.1);
|
|
2203
|
+
}
|
|
2204
|
+
});
|
|
2205
|
+
return /* @__PURE__ */ jsx41(
|
|
2206
|
+
Instance2,
|
|
2207
|
+
{
|
|
2208
|
+
ref,
|
|
2209
|
+
position,
|
|
2210
|
+
scale,
|
|
2211
|
+
color: hovered ? "white" : color,
|
|
2212
|
+
onPointerOver: () => setHover(true),
|
|
2213
|
+
onPointerOut: () => setHover(false)
|
|
2214
|
+
}
|
|
2215
|
+
);
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
// src/components/ui/graph3d.tsx
|
|
2219
|
+
import { useMemo as useMemo5 } from "react";
|
|
2220
|
+
import { Line as Line4, Text as Text6 } from "@react-three/drei";
|
|
2221
|
+
import { Vector3 as Vector35 } from "three";
|
|
2222
|
+
import { jsx as jsx42, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2223
|
+
function Graph3D({ nodes, edges, physics = false }) {
|
|
2224
|
+
const positionedNodes = useMemo5(() => {
|
|
2225
|
+
return nodes.map((node, i) => ({
|
|
2226
|
+
...node,
|
|
2227
|
+
vec: new Vector35(
|
|
2228
|
+
node.x ?? (Math.random() - 0.5) * 10,
|
|
2229
|
+
node.y ?? (Math.random() - 0.5) * 10,
|
|
2230
|
+
node.z ?? (Math.random() - 0.5) * 10
|
|
2231
|
+
)
|
|
2232
|
+
}));
|
|
2233
|
+
}, [nodes]);
|
|
2234
|
+
const nodeMap = useMemo5(() => {
|
|
2235
|
+
const map = /* @__PURE__ */ new Map();
|
|
2236
|
+
positionedNodes.forEach((n) => map.set(n.id, n.vec));
|
|
2237
|
+
return map;
|
|
2238
|
+
}, [positionedNodes]);
|
|
2239
|
+
return /* @__PURE__ */ jsxs27("group", { children: [
|
|
2240
|
+
edges.map((edge, i) => {
|
|
2241
|
+
const start = nodeMap.get(edge.source);
|
|
2242
|
+
const end = nodeMap.get(edge.target);
|
|
2243
|
+
if (!start || !end) return null;
|
|
2244
|
+
return /* @__PURE__ */ jsx42(
|
|
2245
|
+
Line4,
|
|
2246
|
+
{
|
|
2247
|
+
points: [start, end],
|
|
2248
|
+
color: "#444",
|
|
2249
|
+
lineWidth: 1,
|
|
2250
|
+
transparent: true,
|
|
2251
|
+
opacity: 0.5
|
|
2252
|
+
},
|
|
2253
|
+
i
|
|
2254
|
+
);
|
|
2255
|
+
}),
|
|
2256
|
+
positionedNodes.map((node, i) => /* @__PURE__ */ jsxs27("group", { position: node.vec, children: [
|
|
2257
|
+
/* @__PURE__ */ jsxs27("mesh", { children: [
|
|
2258
|
+
/* @__PURE__ */ jsx42("sphereGeometry", { args: [0.2, 16, 16] }),
|
|
2259
|
+
/* @__PURE__ */ jsx42("meshStandardMaterial", { color: node.color || "#22d3ee" })
|
|
2260
|
+
] }),
|
|
2261
|
+
node.label && /* @__PURE__ */ jsx42(
|
|
2262
|
+
Text6,
|
|
2263
|
+
{
|
|
2264
|
+
position: [0, 0.3, 0],
|
|
2265
|
+
fontSize: 0.2,
|
|
2266
|
+
color: "white",
|
|
2267
|
+
children: node.label
|
|
2268
|
+
}
|
|
2269
|
+
)
|
|
2270
|
+
] }, i))
|
|
2271
|
+
] });
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
// src/components/ui/map3d.tsx
|
|
2275
|
+
import { useTexture } from "@react-three/drei";
|
|
2276
|
+
import { jsx as jsx43, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2277
|
+
function Map3D({
|
|
2278
|
+
markers = [],
|
|
2279
|
+
radius = 5,
|
|
2280
|
+
textureSrc = "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/textures/planets/earth_atmos_2048.jpg"
|
|
2281
|
+
}) {
|
|
2282
|
+
const texture = useTexture(textureSrc);
|
|
2283
|
+
return /* @__PURE__ */ jsxs28("group", { children: [
|
|
2284
|
+
/* @__PURE__ */ jsxs28("mesh", { children: [
|
|
2285
|
+
/* @__PURE__ */ jsx43("sphereGeometry", { args: [radius, 64, 64] }),
|
|
2286
|
+
/* @__PURE__ */ jsx43("meshStandardMaterial", { map: texture, metalness: 0.1, roughness: 0.7 })
|
|
2287
|
+
] }),
|
|
2288
|
+
markers.map((marker, i) => {
|
|
2289
|
+
const phi = (90 - marker.lat) * (Math.PI / 180);
|
|
2290
|
+
const theta = (marker.lng + 180) * (Math.PI / 180);
|
|
2291
|
+
const x = -(radius * Math.sin(phi) * Math.cos(theta));
|
|
2292
|
+
const z = radius * Math.sin(phi) * Math.sin(theta);
|
|
2293
|
+
const y = radius * Math.cos(phi);
|
|
2294
|
+
return /* @__PURE__ */ jsxs28("mesh", { position: [x, y, z], children: [
|
|
2295
|
+
/* @__PURE__ */ jsx43("sphereGeometry", { args: [0.1, 16, 16] }),
|
|
2296
|
+
/* @__PURE__ */ jsx43("meshBasicMaterial", { color: marker.color || "red" })
|
|
2297
|
+
] }, i);
|
|
2298
|
+
})
|
|
2299
|
+
] });
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
// src/components/ui/gallery3d.tsx
|
|
2303
|
+
import { useRef as useRef5 } from "react";
|
|
2304
|
+
import { useFrame as useFrame5 } from "@react-three/fiber";
|
|
2305
|
+
|
|
2306
|
+
// src/components/ui/imageplane.tsx
|
|
2307
|
+
import { Suspense } from "react";
|
|
2308
|
+
import { useTexture as useTexture2 } from "@react-three/drei";
|
|
2309
|
+
import { DoubleSide } from "three";
|
|
2310
|
+
import { jsx as jsx44, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2311
|
+
function ImagePlane({
|
|
2312
|
+
src,
|
|
2313
|
+
width = 3,
|
|
2314
|
+
height,
|
|
2315
|
+
// if undefined, will infer
|
|
2316
|
+
opacity = 1,
|
|
2317
|
+
transparent = true,
|
|
2318
|
+
parallax = false
|
|
2319
|
+
}) {
|
|
2320
|
+
return /* @__PURE__ */ jsx44(Suspense, { fallback: /* @__PURE__ */ jsxs29("mesh", { children: [
|
|
2321
|
+
/* @__PURE__ */ jsx44("planeGeometry", { args: [width, width] }),
|
|
2322
|
+
/* @__PURE__ */ jsx44("meshBasicMaterial", { wireframe: true, color: "gray" })
|
|
2323
|
+
] }), children: /* @__PURE__ */ jsx44(
|
|
2324
|
+
ImageMesh,
|
|
2325
|
+
{
|
|
2326
|
+
src,
|
|
2327
|
+
width,
|
|
2328
|
+
height,
|
|
2329
|
+
opacity,
|
|
2330
|
+
transparent,
|
|
2331
|
+
parallax
|
|
2332
|
+
}
|
|
2333
|
+
) });
|
|
2334
|
+
}
|
|
2335
|
+
function ImageMesh({ src, width = 1, height, opacity, transparent }) {
|
|
2336
|
+
const texture = useTexture2(src);
|
|
2337
|
+
const aspect = texture.image ? texture.image.width / texture.image.height : 1;
|
|
2338
|
+
const h = height || width / aspect;
|
|
2339
|
+
return /* @__PURE__ */ jsxs29("mesh", { children: [
|
|
2340
|
+
/* @__PURE__ */ jsx44("planeGeometry", { args: [width, h] }),
|
|
2341
|
+
/* @__PURE__ */ jsx44(
|
|
2342
|
+
"meshBasicMaterial",
|
|
2343
|
+
{
|
|
2344
|
+
map: texture,
|
|
2345
|
+
transparent,
|
|
2346
|
+
opacity,
|
|
2347
|
+
side: DoubleSide,
|
|
2348
|
+
toneMapped: false
|
|
2349
|
+
}
|
|
2350
|
+
)
|
|
2351
|
+
] });
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
// src/components/ui/gallery3d.tsx
|
|
2355
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2356
|
+
function Gallery3D({
|
|
2357
|
+
images,
|
|
2358
|
+
layout = "carousel",
|
|
2359
|
+
radius = 5,
|
|
2360
|
+
gap = 1.5
|
|
2361
|
+
}) {
|
|
2362
|
+
const ref = useRef5(null);
|
|
2363
|
+
useFrame5((state, delta) => {
|
|
2364
|
+
if (ref.current && layout === "carousel") {
|
|
2365
|
+
ref.current.rotation.y += delta * 0.1;
|
|
2366
|
+
}
|
|
2367
|
+
});
|
|
2368
|
+
return /* @__PURE__ */ jsx45("group", { ref, children: images.map((img, i) => {
|
|
2369
|
+
let position = [0, 0, 0];
|
|
2370
|
+
let rotation = [0, 0, 0];
|
|
2371
|
+
if (layout === "carousel") {
|
|
2372
|
+
const angle = i / images.length * Math.PI * 2;
|
|
2373
|
+
position = [
|
|
2374
|
+
Math.cos(angle) * radius,
|
|
2375
|
+
0,
|
|
2376
|
+
Math.sin(angle) * radius
|
|
2377
|
+
];
|
|
2378
|
+
rotation = [0, -angle + Math.PI / 2, 0];
|
|
2379
|
+
rotation = [0, -angle, 0];
|
|
2380
|
+
} else if (layout === "grid") {
|
|
2381
|
+
const cols = 3;
|
|
2382
|
+
const x = i % cols * (3 + gap) - cols * 3 / 2;
|
|
2383
|
+
const y = -Math.floor(i / cols) * (2 + gap);
|
|
2384
|
+
position = [x, y, 0];
|
|
2385
|
+
}
|
|
2386
|
+
return /* @__PURE__ */ jsx45("group", { position, rotation, children: /* @__PURE__ */ jsx45(ImagePlane, { src: img.src, width: 3, opacity: 0.9 }) }, i);
|
|
2387
|
+
}) });
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
// src/components/ui/modelviewer.tsx
|
|
2391
|
+
import { Suspense as Suspense2, useRef as useRef6 } from "react";
|
|
2392
|
+
import { useGLTF, Environment } from "@react-three/drei";
|
|
2393
|
+
import { useFrame as useFrame6 } from "@react-three/fiber";
|
|
2394
|
+
import { jsx as jsx46, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2395
|
+
function ModelViewer({
|
|
2396
|
+
src,
|
|
2397
|
+
autoRotate = true,
|
|
2398
|
+
scale = 1,
|
|
2399
|
+
environment = "studio",
|
|
2400
|
+
position = [0, 0, 0]
|
|
2401
|
+
}) {
|
|
2402
|
+
return /* @__PURE__ */ jsx46("group", { position, children: /* @__PURE__ */ jsxs30(Suspense2, { fallback: null, children: [
|
|
2403
|
+
/* @__PURE__ */ jsx46(Model, { src, scale, autoRotate }),
|
|
2404
|
+
/* @__PURE__ */ jsx46(Environment, { preset: environment })
|
|
2405
|
+
] }) });
|
|
2406
|
+
}
|
|
2407
|
+
function Model({ src, scale, autoRotate }) {
|
|
2408
|
+
const { scene } = useGLTF(src);
|
|
2409
|
+
const ref = useRef6(null);
|
|
2410
|
+
useFrame6((state, delta) => {
|
|
2411
|
+
if (ref.current && autoRotate) {
|
|
2412
|
+
ref.current.rotation.y += delta * 0.5;
|
|
2413
|
+
}
|
|
2414
|
+
});
|
|
2415
|
+
return /* @__PURE__ */ jsx46("primitive", { object: scene, scale, ref });
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
// src/components/ui/videoplane.tsx
|
|
2419
|
+
import { Suspense as Suspense3 } from "react";
|
|
2420
|
+
import { useVideoTexture } from "@react-three/drei";
|
|
2421
|
+
import * as THREE from "three";
|
|
2422
|
+
import { jsx as jsx47, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2423
|
+
function VideoPlane({
|
|
2424
|
+
src,
|
|
2425
|
+
width = 4,
|
|
2426
|
+
height,
|
|
2427
|
+
autoPlay = true,
|
|
2428
|
+
loop = true,
|
|
2429
|
+
muted = true,
|
|
2430
|
+
opacity = 1,
|
|
2431
|
+
side = "double"
|
|
2432
|
+
}) {
|
|
2433
|
+
return /* @__PURE__ */ jsx47(
|
|
2434
|
+
Suspense3,
|
|
2435
|
+
{
|
|
2436
|
+
fallback: /* @__PURE__ */ jsxs31("mesh", { children: [
|
|
2437
|
+
/* @__PURE__ */ jsx47("planeGeometry", { args: [width, width * 0.56] }),
|
|
2438
|
+
/* @__PURE__ */ jsx47("meshBasicMaterial", { color: "gray", wireframe: true })
|
|
2439
|
+
] }),
|
|
2440
|
+
children: /* @__PURE__ */ jsx47(
|
|
2441
|
+
VideoPlaneContent,
|
|
2442
|
+
{
|
|
2443
|
+
src,
|
|
2444
|
+
width,
|
|
2445
|
+
height,
|
|
2446
|
+
autoPlay,
|
|
2447
|
+
loop,
|
|
2448
|
+
muted,
|
|
2449
|
+
opacity,
|
|
2450
|
+
side
|
|
2451
|
+
}
|
|
2452
|
+
)
|
|
2453
|
+
}
|
|
2454
|
+
);
|
|
2455
|
+
}
|
|
2456
|
+
function VideoPlaneContent({
|
|
2457
|
+
src,
|
|
2458
|
+
width = 4,
|
|
2459
|
+
height,
|
|
2460
|
+
autoPlay = true,
|
|
2461
|
+
loop = true,
|
|
2462
|
+
muted = true,
|
|
2463
|
+
opacity = 1,
|
|
2464
|
+
side = "double"
|
|
2465
|
+
}) {
|
|
2466
|
+
const texture = useVideoTexture(src, {
|
|
2467
|
+
unsuspend: "canplay",
|
|
2468
|
+
muted,
|
|
2469
|
+
loop,
|
|
2470
|
+
start: autoPlay,
|
|
2471
|
+
crossOrigin: "anonymous"
|
|
2472
|
+
});
|
|
2473
|
+
const video = texture.image;
|
|
2474
|
+
const aspect = video && video.videoWidth > 0 && video.videoHeight > 0 ? video.videoWidth / video.videoHeight : 16 / 9;
|
|
2475
|
+
const planeHeight = height ?? width / aspect;
|
|
2476
|
+
const materialSide = side === "double" ? THREE.DoubleSide : side === "back" ? THREE.BackSide : THREE.FrontSide;
|
|
2477
|
+
return /* @__PURE__ */ jsxs31("mesh", { children: [
|
|
2478
|
+
/* @__PURE__ */ jsx47("planeGeometry", { args: [width, planeHeight] }),
|
|
2479
|
+
/* @__PURE__ */ jsx47(
|
|
2480
|
+
"meshBasicMaterial",
|
|
2481
|
+
{
|
|
2482
|
+
map: texture,
|
|
2483
|
+
toneMapped: false,
|
|
2484
|
+
transparent: opacity < 1,
|
|
2485
|
+
opacity,
|
|
2486
|
+
side: materialSide
|
|
2487
|
+
}
|
|
2488
|
+
)
|
|
2489
|
+
] });
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
// src/components/ui/audiovisualizer.tsx
|
|
2493
|
+
import { useRef as useRef7, useEffect, useState as useState12 } from "react";
|
|
2494
|
+
import { useFrame as useFrame7 } from "@react-three/fiber";
|
|
2495
|
+
import * as THREE2 from "three";
|
|
2496
|
+
import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2497
|
+
function AudioVisualizer({
|
|
2498
|
+
audioSrc,
|
|
2499
|
+
fftSize = 64,
|
|
2500
|
+
barColor = "#22d3ee",
|
|
2501
|
+
width = 10
|
|
2502
|
+
}) {
|
|
2503
|
+
const analyserRef = useRef7(null);
|
|
2504
|
+
const meshRef = useRef7(null);
|
|
2505
|
+
const [ready, setReady] = useState12(false);
|
|
2506
|
+
useEffect(() => {
|
|
2507
|
+
const listener = new THREE2.AudioListener();
|
|
2508
|
+
const sound = new THREE2.Audio(listener);
|
|
2509
|
+
const audioLoader = new THREE2.AudioLoader();
|
|
2510
|
+
audioLoader.load(audioSrc, function(buffer) {
|
|
2511
|
+
sound.setBuffer(buffer);
|
|
2512
|
+
sound.setLoop(true);
|
|
2513
|
+
sound.setVolume(0.5);
|
|
2514
|
+
const analyser = new THREE2.AudioAnalyser(sound, fftSize);
|
|
2515
|
+
analyserRef.current = analyser;
|
|
2516
|
+
setReady(true);
|
|
2517
|
+
sound.play();
|
|
2518
|
+
});
|
|
2519
|
+
return () => {
|
|
2520
|
+
if (sound.isPlaying) sound.stop();
|
|
2521
|
+
};
|
|
2522
|
+
}, [audioSrc, fftSize]);
|
|
2523
|
+
useFrame7(() => {
|
|
2524
|
+
if (analyserRef.current && meshRef.current && ready) {
|
|
2525
|
+
const data = analyserRef.current.getFrequencyData();
|
|
2526
|
+
const count = data.length;
|
|
2527
|
+
const step = width / count;
|
|
2528
|
+
const tempObj = new THREE2.Object3D();
|
|
2529
|
+
for (let i = 0; i < count; i++) {
|
|
2530
|
+
const value = data[i] / 256;
|
|
2531
|
+
const h = value * 5;
|
|
2532
|
+
const x = (i - count / 2) * step;
|
|
2533
|
+
tempObj.position.set(x, h / 2, 0);
|
|
2534
|
+
tempObj.scale.set(step * 0.8, h || 0.1, step * 0.8);
|
|
2535
|
+
tempObj.updateMatrix();
|
|
2536
|
+
meshRef.current.setMatrixAt(i, tempObj.matrix);
|
|
2537
|
+
}
|
|
2538
|
+
meshRef.current.instanceMatrix.needsUpdate = true;
|
|
2539
|
+
}
|
|
2540
|
+
});
|
|
2541
|
+
return /* @__PURE__ */ jsxs32("instancedMesh", { ref: meshRef, args: [void 0, void 0, fftSize / 2], children: [
|
|
2542
|
+
/* @__PURE__ */ jsx48("boxGeometry", { args: [1, 1, 1] }),
|
|
2543
|
+
/* @__PURE__ */ jsx48("meshStandardMaterial", { color: barColor })
|
|
2544
|
+
] });
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
// src/components/ui/particles.tsx
|
|
2548
|
+
import { useRef as useRef8, useMemo as useMemo7 } from "react";
|
|
2549
|
+
import { useFrame as useFrame8 } from "@react-three/fiber";
|
|
2550
|
+
import { AdditiveBlending } from "three";
|
|
2551
|
+
import { jsx as jsx49, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2552
|
+
function Particles({
|
|
2553
|
+
count = 1e3,
|
|
2554
|
+
size = 0.03,
|
|
2555
|
+
color = "#a78bfa",
|
|
2556
|
+
speed = 0.1
|
|
2557
|
+
}) {
|
|
2558
|
+
const points = useRef8(null);
|
|
2559
|
+
const particlesPosition = useMemo7(() => {
|
|
2560
|
+
const positions = new Float32Array(count * 3);
|
|
2561
|
+
for (let i = 0; i < count; i++) {
|
|
2562
|
+
positions[i * 3] = (Math.random() - 0.5) * 10;
|
|
2563
|
+
positions[i * 3 + 1] = (Math.random() - 0.5) * 10;
|
|
2564
|
+
positions[i * 3 + 2] = (Math.random() - 0.5) * 10;
|
|
2565
|
+
}
|
|
2566
|
+
return positions;
|
|
2567
|
+
}, [count]);
|
|
2568
|
+
useFrame8((state, delta) => {
|
|
2569
|
+
if (points.current) {
|
|
2570
|
+
points.current.rotation.y += delta * speed;
|
|
2571
|
+
}
|
|
2572
|
+
});
|
|
2573
|
+
return /* @__PURE__ */ jsxs33("points", { ref: points, children: [
|
|
2574
|
+
/* @__PURE__ */ jsx49("bufferGeometry", { children: /* @__PURE__ */ jsx49(
|
|
2575
|
+
"bufferAttribute",
|
|
2576
|
+
{
|
|
2577
|
+
attach: "attributes-position",
|
|
2578
|
+
count: particlesPosition.length / 3,
|
|
2579
|
+
array: particlesPosition,
|
|
2580
|
+
itemSize: 3
|
|
2581
|
+
}
|
|
2582
|
+
) }),
|
|
2583
|
+
/* @__PURE__ */ jsx49(
|
|
2584
|
+
"pointsMaterial",
|
|
2585
|
+
{
|
|
2586
|
+
size,
|
|
2587
|
+
color,
|
|
2588
|
+
transparent: true,
|
|
2589
|
+
depthWrite: false,
|
|
2590
|
+
blending: AdditiveBlending,
|
|
2591
|
+
sizeAttenuation: true
|
|
2592
|
+
}
|
|
2593
|
+
)
|
|
2594
|
+
] });
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
// src/components/ui/bloom.tsx
|
|
2598
|
+
import { useEffect as useEffect2, useRef as useRef9 } from "react";
|
|
2599
|
+
import { useThree, useFrame as useFrame9, extend } from "@react-three/fiber";
|
|
2600
|
+
|
|
2601
|
+
// node_modules/three-stdlib/postprocessing/ShaderPass.js
|
|
2602
|
+
import { ShaderMaterial, UniformsUtils } from "three";
|
|
2603
|
+
|
|
2604
|
+
// node_modules/three-stdlib/postprocessing/Pass.js
|
|
2605
|
+
import { OrthographicCamera, PlaneGeometry, Mesh } from "three";
|
|
2606
|
+
var __defProp = Object.defineProperty;
|
|
2607
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2608
|
+
var __publicField = (obj, key, value) => {
|
|
2609
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2610
|
+
return value;
|
|
2611
|
+
};
|
|
2612
|
+
var Pass = class {
|
|
2613
|
+
constructor() {
|
|
2614
|
+
__publicField(this, "enabled", true);
|
|
2615
|
+
__publicField(this, "needsSwap", true);
|
|
2616
|
+
__publicField(this, "clear", false);
|
|
2617
|
+
__publicField(this, "renderToScreen", false);
|
|
2618
|
+
}
|
|
2619
|
+
setSize(width, height) {
|
|
2620
|
+
}
|
|
2621
|
+
render(renderer, writeBuffer, readBuffer, deltaTime, maskActive) {
|
|
2622
|
+
console.error("THREE.Pass: .render() must be implemented in derived pass.");
|
|
2623
|
+
}
|
|
2624
|
+
dispose() {
|
|
2625
|
+
}
|
|
2626
|
+
};
|
|
2627
|
+
var FullScreenQuad = class {
|
|
2628
|
+
constructor(material) {
|
|
2629
|
+
__publicField(this, "camera", new OrthographicCamera(-1, 1, 1, -1, 0, 1));
|
|
2630
|
+
__publicField(this, "geometry", new PlaneGeometry(2, 2));
|
|
2631
|
+
__publicField(this, "mesh");
|
|
2632
|
+
this.mesh = new Mesh(this.geometry, material);
|
|
2633
|
+
}
|
|
2634
|
+
get material() {
|
|
2635
|
+
return this.mesh.material;
|
|
2636
|
+
}
|
|
2637
|
+
set material(value) {
|
|
2638
|
+
this.mesh.material = value;
|
|
2639
|
+
}
|
|
2640
|
+
dispose() {
|
|
2641
|
+
this.mesh.geometry.dispose();
|
|
2642
|
+
}
|
|
2643
|
+
render(renderer) {
|
|
2644
|
+
renderer.render(this.mesh, this.camera);
|
|
2645
|
+
}
|
|
2646
|
+
};
|
|
2647
|
+
|
|
2648
|
+
// node_modules/three-stdlib/postprocessing/ShaderPass.js
|
|
2649
|
+
var __defProp2 = Object.defineProperty;
|
|
2650
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2651
|
+
var __publicField2 = (obj, key, value) => {
|
|
2652
|
+
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2653
|
+
return value;
|
|
2654
|
+
};
|
|
2655
|
+
var ShaderPass = class extends Pass {
|
|
2656
|
+
constructor(shader, textureID = "tDiffuse") {
|
|
2657
|
+
super();
|
|
2658
|
+
__publicField2(this, "textureID");
|
|
2659
|
+
__publicField2(this, "uniforms");
|
|
2660
|
+
__publicField2(this, "material");
|
|
2661
|
+
__publicField2(this, "fsQuad");
|
|
2662
|
+
this.textureID = textureID;
|
|
2663
|
+
if (shader instanceof ShaderMaterial) {
|
|
2664
|
+
this.uniforms = shader.uniforms;
|
|
2665
|
+
this.material = shader;
|
|
2666
|
+
} else {
|
|
2667
|
+
this.uniforms = UniformsUtils.clone(shader.uniforms);
|
|
2668
|
+
this.material = new ShaderMaterial({
|
|
2669
|
+
defines: Object.assign({}, shader.defines),
|
|
2670
|
+
uniforms: this.uniforms,
|
|
2671
|
+
vertexShader: shader.vertexShader,
|
|
2672
|
+
fragmentShader: shader.fragmentShader
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
this.fsQuad = new FullScreenQuad(this.material);
|
|
2676
|
+
}
|
|
2677
|
+
render(renderer, writeBuffer, readBuffer) {
|
|
2678
|
+
if (this.uniforms[this.textureID]) {
|
|
2679
|
+
this.uniforms[this.textureID].value = readBuffer.texture;
|
|
2680
|
+
}
|
|
2681
|
+
this.fsQuad.material = this.material;
|
|
2682
|
+
if (this.renderToScreen) {
|
|
2683
|
+
renderer.setRenderTarget(null);
|
|
2684
|
+
this.fsQuad.render(renderer);
|
|
2685
|
+
} else {
|
|
2686
|
+
renderer.setRenderTarget(writeBuffer);
|
|
2687
|
+
if (this.clear)
|
|
2688
|
+
renderer.clear(renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil);
|
|
2689
|
+
this.fsQuad.render(renderer);
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
dispose() {
|
|
2693
|
+
this.fsQuad.dispose();
|
|
2694
|
+
this.material.dispose();
|
|
2695
|
+
}
|
|
2696
|
+
};
|
|
2697
|
+
|
|
2698
|
+
// node_modules/three-stdlib/shaders/CopyShader.js
|
|
2699
|
+
var CopyShader = {
|
|
2700
|
+
uniforms: {
|
|
2701
|
+
tDiffuse: { value: null },
|
|
2702
|
+
opacity: { value: 1 }
|
|
2703
|
+
},
|
|
2704
|
+
vertexShader: (
|
|
2705
|
+
/* glsl */
|
|
2706
|
+
`
|
|
2707
|
+
varying vec2 vUv;
|
|
2708
|
+
|
|
2709
|
+
void main() {
|
|
2710
|
+
|
|
2711
|
+
vUv = uv;
|
|
2712
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
2713
|
+
|
|
2714
|
+
}
|
|
2715
|
+
`
|
|
2716
|
+
),
|
|
2717
|
+
fragmentShader: (
|
|
2718
|
+
/* glsl */
|
|
2719
|
+
`
|
|
2720
|
+
uniform float opacity;
|
|
2721
|
+
|
|
2722
|
+
uniform sampler2D tDiffuse;
|
|
2723
|
+
|
|
2724
|
+
varying vec2 vUv;
|
|
2725
|
+
|
|
2726
|
+
void main() {
|
|
2727
|
+
|
|
2728
|
+
vec4 texel = texture2D( tDiffuse, vUv );
|
|
2729
|
+
gl_FragColor = opacity * texel;
|
|
2730
|
+
|
|
2731
|
+
}
|
|
2732
|
+
`
|
|
2733
|
+
)
|
|
2734
|
+
};
|
|
2735
|
+
|
|
2736
|
+
// node_modules/three-stdlib/postprocessing/UnrealBloomPass.js
|
|
2737
|
+
import { Vector2, Color as Color3, WebGLRenderTarget, HalfFloatType, UniformsUtils as UniformsUtils2, ShaderMaterial as ShaderMaterial2, Vector3 as Vector36, AdditiveBlending as AdditiveBlending2, MeshBasicMaterial } from "three";
|
|
2738
|
+
|
|
2739
|
+
// node_modules/three-stdlib/shaders/LuminosityHighPassShader.js
|
|
2740
|
+
import { Color as Color2 } from "three";
|
|
2741
|
+
var LuminosityHighPassShader = {
|
|
2742
|
+
shaderID: "luminosityHighPass",
|
|
2743
|
+
uniforms: {
|
|
2744
|
+
tDiffuse: { value: null },
|
|
2745
|
+
luminosityThreshold: { value: 1 },
|
|
2746
|
+
smoothWidth: { value: 1 },
|
|
2747
|
+
defaultColor: { value: /* @__PURE__ */ new Color2(0) },
|
|
2748
|
+
defaultOpacity: { value: 0 }
|
|
2749
|
+
},
|
|
2750
|
+
vertexShader: (
|
|
2751
|
+
/* glsl */
|
|
2752
|
+
`
|
|
2753
|
+
varying vec2 vUv;
|
|
2754
|
+
|
|
2755
|
+
void main() {
|
|
2756
|
+
|
|
2757
|
+
vUv = uv;
|
|
2758
|
+
|
|
2759
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
2760
|
+
|
|
2761
|
+
}
|
|
2762
|
+
`
|
|
2763
|
+
),
|
|
2764
|
+
fragmentShader: (
|
|
2765
|
+
/* glsl */
|
|
2766
|
+
`
|
|
2767
|
+
uniform sampler2D tDiffuse;
|
|
2768
|
+
uniform vec3 defaultColor;
|
|
2769
|
+
uniform float defaultOpacity;
|
|
2770
|
+
uniform float luminosityThreshold;
|
|
2771
|
+
uniform float smoothWidth;
|
|
2772
|
+
|
|
2773
|
+
varying vec2 vUv;
|
|
2774
|
+
|
|
2775
|
+
void main() {
|
|
2776
|
+
|
|
2777
|
+
vec4 texel = texture2D( tDiffuse, vUv );
|
|
2778
|
+
|
|
2779
|
+
vec3 luma = vec3( 0.299, 0.587, 0.114 );
|
|
2780
|
+
|
|
2781
|
+
float v = dot( texel.xyz, luma );
|
|
2782
|
+
|
|
2783
|
+
vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );
|
|
2784
|
+
|
|
2785
|
+
float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );
|
|
2786
|
+
|
|
2787
|
+
gl_FragColor = mix( outputColor, texel, alpha );
|
|
2788
|
+
|
|
2789
|
+
}
|
|
2790
|
+
`
|
|
2791
|
+
)
|
|
2792
|
+
};
|
|
2793
|
+
|
|
2794
|
+
// node_modules/three-stdlib/postprocessing/UnrealBloomPass.js
|
|
2795
|
+
var __defProp3 = Object.defineProperty;
|
|
2796
|
+
var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2797
|
+
var __publicField3 = (obj, key, value) => {
|
|
2798
|
+
__defNormalProp3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2799
|
+
return value;
|
|
2800
|
+
};
|
|
2801
|
+
var UnrealBloomPass = /* @__PURE__ */ (() => {
|
|
2802
|
+
const _UnrealBloomPass = class extends Pass {
|
|
2803
|
+
constructor(resolution, strength, radius, threshold) {
|
|
2804
|
+
super();
|
|
2805
|
+
this.strength = strength !== void 0 ? strength : 1;
|
|
2806
|
+
this.radius = radius;
|
|
2807
|
+
this.threshold = threshold;
|
|
2808
|
+
this.resolution = resolution !== void 0 ? new Vector2(resolution.x, resolution.y) : new Vector2(256, 256);
|
|
2809
|
+
this.clearColor = new Color3(0, 0, 0);
|
|
2810
|
+
this.renderTargetsHorizontal = [];
|
|
2811
|
+
this.renderTargetsVertical = [];
|
|
2812
|
+
this.nMips = 5;
|
|
2813
|
+
let resx = Math.round(this.resolution.x / 2);
|
|
2814
|
+
let resy = Math.round(this.resolution.y / 2);
|
|
2815
|
+
this.renderTargetBright = new WebGLRenderTarget(resx, resy, { type: HalfFloatType });
|
|
2816
|
+
this.renderTargetBright.texture.name = "UnrealBloomPass.bright";
|
|
2817
|
+
this.renderTargetBright.texture.generateMipmaps = false;
|
|
2818
|
+
for (let i = 0; i < this.nMips; i++) {
|
|
2819
|
+
const renderTargetHorizonal = new WebGLRenderTarget(resx, resy, { type: HalfFloatType });
|
|
2820
|
+
renderTargetHorizonal.texture.name = "UnrealBloomPass.h" + i;
|
|
2821
|
+
renderTargetHorizonal.texture.generateMipmaps = false;
|
|
2822
|
+
this.renderTargetsHorizontal.push(renderTargetHorizonal);
|
|
2823
|
+
const renderTargetVertical = new WebGLRenderTarget(resx, resy, { type: HalfFloatType });
|
|
2824
|
+
renderTargetVertical.texture.name = "UnrealBloomPass.v" + i;
|
|
2825
|
+
renderTargetVertical.texture.generateMipmaps = false;
|
|
2826
|
+
this.renderTargetsVertical.push(renderTargetVertical);
|
|
2827
|
+
resx = Math.round(resx / 2);
|
|
2828
|
+
resy = Math.round(resy / 2);
|
|
2829
|
+
}
|
|
2830
|
+
const highPassShader = LuminosityHighPassShader;
|
|
2831
|
+
this.highPassUniforms = UniformsUtils2.clone(highPassShader.uniforms);
|
|
2832
|
+
this.highPassUniforms["luminosityThreshold"].value = threshold;
|
|
2833
|
+
this.highPassUniforms["smoothWidth"].value = 0.01;
|
|
2834
|
+
this.materialHighPassFilter = new ShaderMaterial2({
|
|
2835
|
+
uniforms: this.highPassUniforms,
|
|
2836
|
+
vertexShader: highPassShader.vertexShader,
|
|
2837
|
+
fragmentShader: highPassShader.fragmentShader,
|
|
2838
|
+
defines: {}
|
|
2839
|
+
});
|
|
2840
|
+
this.separableBlurMaterials = [];
|
|
2841
|
+
const kernelSizeArray = [3, 5, 7, 9, 11];
|
|
2842
|
+
resx = Math.round(this.resolution.x / 2);
|
|
2843
|
+
resy = Math.round(this.resolution.y / 2);
|
|
2844
|
+
for (let i = 0; i < this.nMips; i++) {
|
|
2845
|
+
this.separableBlurMaterials.push(this.getSeperableBlurMaterial(kernelSizeArray[i]));
|
|
2846
|
+
this.separableBlurMaterials[i].uniforms["texSize"].value = new Vector2(resx, resy);
|
|
2847
|
+
resx = Math.round(resx / 2);
|
|
2848
|
+
resy = Math.round(resy / 2);
|
|
2849
|
+
}
|
|
2850
|
+
this.compositeMaterial = this.getCompositeMaterial(this.nMips);
|
|
2851
|
+
this.compositeMaterial.uniforms["blurTexture1"].value = this.renderTargetsVertical[0].texture;
|
|
2852
|
+
this.compositeMaterial.uniforms["blurTexture2"].value = this.renderTargetsVertical[1].texture;
|
|
2853
|
+
this.compositeMaterial.uniforms["blurTexture3"].value = this.renderTargetsVertical[2].texture;
|
|
2854
|
+
this.compositeMaterial.uniforms["blurTexture4"].value = this.renderTargetsVertical[3].texture;
|
|
2855
|
+
this.compositeMaterial.uniforms["blurTexture5"].value = this.renderTargetsVertical[4].texture;
|
|
2856
|
+
this.compositeMaterial.uniforms["bloomStrength"].value = strength;
|
|
2857
|
+
this.compositeMaterial.uniforms["bloomRadius"].value = 0.1;
|
|
2858
|
+
this.compositeMaterial.needsUpdate = true;
|
|
2859
|
+
const bloomFactors = [1, 0.8, 0.6, 0.4, 0.2];
|
|
2860
|
+
this.compositeMaterial.uniforms["bloomFactors"].value = bloomFactors;
|
|
2861
|
+
this.bloomTintColors = [
|
|
2862
|
+
new Vector36(1, 1, 1),
|
|
2863
|
+
new Vector36(1, 1, 1),
|
|
2864
|
+
new Vector36(1, 1, 1),
|
|
2865
|
+
new Vector36(1, 1, 1),
|
|
2866
|
+
new Vector36(1, 1, 1)
|
|
2867
|
+
];
|
|
2868
|
+
this.compositeMaterial.uniforms["bloomTintColors"].value = this.bloomTintColors;
|
|
2869
|
+
const copyShader = CopyShader;
|
|
2870
|
+
this.copyUniforms = UniformsUtils2.clone(copyShader.uniforms);
|
|
2871
|
+
this.copyUniforms["opacity"].value = 1;
|
|
2872
|
+
this.materialCopy = new ShaderMaterial2({
|
|
2873
|
+
uniforms: this.copyUniforms,
|
|
2874
|
+
vertexShader: copyShader.vertexShader,
|
|
2875
|
+
fragmentShader: copyShader.fragmentShader,
|
|
2876
|
+
blending: AdditiveBlending2,
|
|
2877
|
+
depthTest: false,
|
|
2878
|
+
depthWrite: false,
|
|
2879
|
+
transparent: true
|
|
2880
|
+
});
|
|
2881
|
+
this.enabled = true;
|
|
2882
|
+
this.needsSwap = false;
|
|
2883
|
+
this._oldClearColor = new Color3();
|
|
2884
|
+
this.oldClearAlpha = 1;
|
|
2885
|
+
this.basic = new MeshBasicMaterial();
|
|
2886
|
+
this.fsQuad = new FullScreenQuad(null);
|
|
2887
|
+
}
|
|
2888
|
+
dispose() {
|
|
2889
|
+
for (let i = 0; i < this.renderTargetsHorizontal.length; i++) {
|
|
2890
|
+
this.renderTargetsHorizontal[i].dispose();
|
|
2891
|
+
}
|
|
2892
|
+
for (let i = 0; i < this.renderTargetsVertical.length; i++) {
|
|
2893
|
+
this.renderTargetsVertical[i].dispose();
|
|
2894
|
+
}
|
|
2895
|
+
this.renderTargetBright.dispose();
|
|
2896
|
+
for (let i = 0; i < this.separableBlurMaterials.length; i++) {
|
|
2897
|
+
this.separableBlurMaterials[i].dispose();
|
|
2898
|
+
}
|
|
2899
|
+
this.compositeMaterial.dispose();
|
|
2900
|
+
this.materialCopy.dispose();
|
|
2901
|
+
this.basic.dispose();
|
|
2902
|
+
this.fsQuad.dispose();
|
|
2903
|
+
}
|
|
2904
|
+
setSize(width, height) {
|
|
2905
|
+
let resx = Math.round(width / 2);
|
|
2906
|
+
let resy = Math.round(height / 2);
|
|
2907
|
+
this.renderTargetBright.setSize(resx, resy);
|
|
2908
|
+
for (let i = 0; i < this.nMips; i++) {
|
|
2909
|
+
this.renderTargetsHorizontal[i].setSize(resx, resy);
|
|
2910
|
+
this.renderTargetsVertical[i].setSize(resx, resy);
|
|
2911
|
+
this.separableBlurMaterials[i].uniforms["texSize"].value = new Vector2(resx, resy);
|
|
2912
|
+
resx = Math.round(resx / 2);
|
|
2913
|
+
resy = Math.round(resy / 2);
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
render(renderer, writeBuffer, readBuffer, deltaTime, maskActive) {
|
|
2917
|
+
renderer.getClearColor(this._oldClearColor);
|
|
2918
|
+
this.oldClearAlpha = renderer.getClearAlpha();
|
|
2919
|
+
const oldAutoClear = renderer.autoClear;
|
|
2920
|
+
renderer.autoClear = false;
|
|
2921
|
+
renderer.setClearColor(this.clearColor, 0);
|
|
2922
|
+
if (maskActive)
|
|
2923
|
+
renderer.state.buffers.stencil.setTest(false);
|
|
2924
|
+
if (this.renderToScreen) {
|
|
2925
|
+
this.fsQuad.material = this.basic;
|
|
2926
|
+
this.basic.map = readBuffer.texture;
|
|
2927
|
+
renderer.setRenderTarget(null);
|
|
2928
|
+
renderer.clear();
|
|
2929
|
+
this.fsQuad.render(renderer);
|
|
2930
|
+
}
|
|
2931
|
+
this.highPassUniforms["tDiffuse"].value = readBuffer.texture;
|
|
2932
|
+
this.highPassUniforms["luminosityThreshold"].value = this.threshold;
|
|
2933
|
+
this.fsQuad.material = this.materialHighPassFilter;
|
|
2934
|
+
renderer.setRenderTarget(this.renderTargetBright);
|
|
2935
|
+
renderer.clear();
|
|
2936
|
+
this.fsQuad.render(renderer);
|
|
2937
|
+
let inputRenderTarget = this.renderTargetBright;
|
|
2938
|
+
for (let i = 0; i < this.nMips; i++) {
|
|
2939
|
+
this.fsQuad.material = this.separableBlurMaterials[i];
|
|
2940
|
+
this.separableBlurMaterials[i].uniforms["colorTexture"].value = inputRenderTarget.texture;
|
|
2941
|
+
this.separableBlurMaterials[i].uniforms["direction"].value = _UnrealBloomPass.BlurDirectionX;
|
|
2942
|
+
renderer.setRenderTarget(this.renderTargetsHorizontal[i]);
|
|
2943
|
+
renderer.clear();
|
|
2944
|
+
this.fsQuad.render(renderer);
|
|
2945
|
+
this.separableBlurMaterials[i].uniforms["colorTexture"].value = this.renderTargetsHorizontal[i].texture;
|
|
2946
|
+
this.separableBlurMaterials[i].uniforms["direction"].value = _UnrealBloomPass.BlurDirectionY;
|
|
2947
|
+
renderer.setRenderTarget(this.renderTargetsVertical[i]);
|
|
2948
|
+
renderer.clear();
|
|
2949
|
+
this.fsQuad.render(renderer);
|
|
2950
|
+
inputRenderTarget = this.renderTargetsVertical[i];
|
|
2951
|
+
}
|
|
2952
|
+
this.fsQuad.material = this.compositeMaterial;
|
|
2953
|
+
this.compositeMaterial.uniforms["bloomStrength"].value = this.strength;
|
|
2954
|
+
this.compositeMaterial.uniforms["bloomRadius"].value = this.radius;
|
|
2955
|
+
this.compositeMaterial.uniforms["bloomTintColors"].value = this.bloomTintColors;
|
|
2956
|
+
renderer.setRenderTarget(this.renderTargetsHorizontal[0]);
|
|
2957
|
+
renderer.clear();
|
|
2958
|
+
this.fsQuad.render(renderer);
|
|
2959
|
+
this.fsQuad.material = this.materialCopy;
|
|
2960
|
+
this.copyUniforms["tDiffuse"].value = this.renderTargetsHorizontal[0].texture;
|
|
2961
|
+
if (maskActive)
|
|
2962
|
+
renderer.state.buffers.stencil.setTest(true);
|
|
2963
|
+
if (this.renderToScreen) {
|
|
2964
|
+
renderer.setRenderTarget(null);
|
|
2965
|
+
this.fsQuad.render(renderer);
|
|
2966
|
+
} else {
|
|
2967
|
+
renderer.setRenderTarget(readBuffer);
|
|
2968
|
+
this.fsQuad.render(renderer);
|
|
2969
|
+
}
|
|
2970
|
+
renderer.setClearColor(this._oldClearColor, this.oldClearAlpha);
|
|
2971
|
+
renderer.autoClear = oldAutoClear;
|
|
2972
|
+
}
|
|
2973
|
+
getSeperableBlurMaterial(kernelRadius) {
|
|
2974
|
+
return new ShaderMaterial2({
|
|
2975
|
+
defines: {
|
|
2976
|
+
KERNEL_RADIUS: kernelRadius,
|
|
2977
|
+
SIGMA: kernelRadius
|
|
2978
|
+
},
|
|
2979
|
+
uniforms: {
|
|
2980
|
+
colorTexture: { value: null },
|
|
2981
|
+
texSize: { value: new Vector2(0.5, 0.5) },
|
|
2982
|
+
direction: { value: new Vector2(0.5, 0.5) }
|
|
2983
|
+
},
|
|
2984
|
+
vertexShader: `varying vec2 vUv;
|
|
2985
|
+
void main() {
|
|
2986
|
+
vUv = uv;
|
|
2987
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
2988
|
+
}`,
|
|
2989
|
+
fragmentShader: `#include <common>
|
|
2990
|
+
varying vec2 vUv;
|
|
2991
|
+
uniform sampler2D colorTexture;
|
|
2992
|
+
uniform vec2 texSize;
|
|
2993
|
+
uniform vec2 direction;
|
|
2994
|
+
|
|
2995
|
+
float gaussianPdf(in float x, in float sigma) {
|
|
2996
|
+
return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;
|
|
2997
|
+
}
|
|
2998
|
+
void main() {
|
|
2999
|
+
vec2 invSize = 1.0 / texSize;
|
|
3000
|
+
float fSigma = float(SIGMA);
|
|
3001
|
+
float weightSum = gaussianPdf(0.0, fSigma);
|
|
3002
|
+
vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;
|
|
3003
|
+
for( int i = 1; i < KERNEL_RADIUS; i ++ ) {
|
|
3004
|
+
float x = float(i);
|
|
3005
|
+
float w = gaussianPdf(x, fSigma);
|
|
3006
|
+
vec2 uvOffset = direction * invSize * x;
|
|
3007
|
+
vec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;
|
|
3008
|
+
vec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;
|
|
3009
|
+
diffuseSum += (sample1 + sample2) * w;
|
|
3010
|
+
weightSum += 2.0 * w;
|
|
3011
|
+
}
|
|
3012
|
+
gl_FragColor = vec4(diffuseSum/weightSum, 1.0);
|
|
3013
|
+
}`
|
|
3014
|
+
});
|
|
3015
|
+
}
|
|
3016
|
+
getCompositeMaterial(nMips) {
|
|
3017
|
+
return new ShaderMaterial2({
|
|
3018
|
+
defines: {
|
|
3019
|
+
NUM_MIPS: nMips
|
|
3020
|
+
},
|
|
3021
|
+
uniforms: {
|
|
3022
|
+
blurTexture1: { value: null },
|
|
3023
|
+
blurTexture2: { value: null },
|
|
3024
|
+
blurTexture3: { value: null },
|
|
3025
|
+
blurTexture4: { value: null },
|
|
3026
|
+
blurTexture5: { value: null },
|
|
3027
|
+
bloomStrength: { value: 1 },
|
|
3028
|
+
bloomFactors: { value: null },
|
|
3029
|
+
bloomTintColors: { value: null },
|
|
3030
|
+
bloomRadius: { value: 0 }
|
|
3031
|
+
},
|
|
3032
|
+
vertexShader: `varying vec2 vUv;
|
|
3033
|
+
void main() {
|
|
3034
|
+
vUv = uv;
|
|
3035
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
3036
|
+
}`,
|
|
3037
|
+
fragmentShader: `varying vec2 vUv;
|
|
3038
|
+
uniform sampler2D blurTexture1;
|
|
3039
|
+
uniform sampler2D blurTexture2;
|
|
3040
|
+
uniform sampler2D blurTexture3;
|
|
3041
|
+
uniform sampler2D blurTexture4;
|
|
3042
|
+
uniform sampler2D blurTexture5;
|
|
3043
|
+
uniform float bloomStrength;
|
|
3044
|
+
uniform float bloomRadius;
|
|
3045
|
+
uniform float bloomFactors[NUM_MIPS];
|
|
3046
|
+
uniform vec3 bloomTintColors[NUM_MIPS];
|
|
3047
|
+
|
|
3048
|
+
float lerpBloomFactor(const in float factor) {
|
|
3049
|
+
float mirrorFactor = 1.2 - factor;
|
|
3050
|
+
return mix(factor, mirrorFactor, bloomRadius);
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
void main() {
|
|
3054
|
+
gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +
|
|
3055
|
+
lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +
|
|
3056
|
+
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
|
3057
|
+
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
|
3058
|
+
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
|
3059
|
+
}`
|
|
3060
|
+
});
|
|
3061
|
+
}
|
|
3062
|
+
};
|
|
3063
|
+
let UnrealBloomPass2 = _UnrealBloomPass;
|
|
3064
|
+
__publicField3(UnrealBloomPass2, "BlurDirectionX", new Vector2(1, 0));
|
|
3065
|
+
__publicField3(UnrealBloomPass2, "BlurDirectionY", new Vector2(0, 1));
|
|
3066
|
+
return UnrealBloomPass2;
|
|
3067
|
+
})();
|
|
3068
|
+
|
|
3069
|
+
// node_modules/three-stdlib/postprocessing/MaskPass.js
|
|
3070
|
+
var __defProp4 = Object.defineProperty;
|
|
3071
|
+
var __defNormalProp4 = (obj, key, value) => key in obj ? __defProp4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3072
|
+
var __publicField4 = (obj, key, value) => {
|
|
3073
|
+
__defNormalProp4(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3074
|
+
return value;
|
|
3075
|
+
};
|
|
3076
|
+
var MaskPass = class extends Pass {
|
|
3077
|
+
constructor(scene, camera) {
|
|
3078
|
+
super();
|
|
3079
|
+
__publicField4(this, "scene");
|
|
3080
|
+
__publicField4(this, "camera");
|
|
3081
|
+
__publicField4(this, "inverse");
|
|
3082
|
+
this.scene = scene;
|
|
3083
|
+
this.camera = camera;
|
|
3084
|
+
this.clear = true;
|
|
3085
|
+
this.needsSwap = false;
|
|
3086
|
+
this.inverse = false;
|
|
3087
|
+
}
|
|
3088
|
+
render(renderer, writeBuffer, readBuffer) {
|
|
3089
|
+
const context = renderer.getContext();
|
|
3090
|
+
const state = renderer.state;
|
|
3091
|
+
state.buffers.color.setMask(false);
|
|
3092
|
+
state.buffers.depth.setMask(false);
|
|
3093
|
+
state.buffers.color.setLocked(true);
|
|
3094
|
+
state.buffers.depth.setLocked(true);
|
|
3095
|
+
let writeValue, clearValue;
|
|
3096
|
+
if (this.inverse) {
|
|
3097
|
+
writeValue = 0;
|
|
3098
|
+
clearValue = 1;
|
|
3099
|
+
} else {
|
|
3100
|
+
writeValue = 1;
|
|
3101
|
+
clearValue = 0;
|
|
3102
|
+
}
|
|
3103
|
+
state.buffers.stencil.setTest(true);
|
|
3104
|
+
state.buffers.stencil.setOp(context.REPLACE, context.REPLACE, context.REPLACE);
|
|
3105
|
+
state.buffers.stencil.setFunc(context.ALWAYS, writeValue, 4294967295);
|
|
3106
|
+
state.buffers.stencil.setClear(clearValue);
|
|
3107
|
+
state.buffers.stencil.setLocked(true);
|
|
3108
|
+
renderer.setRenderTarget(readBuffer);
|
|
3109
|
+
if (this.clear)
|
|
3110
|
+
renderer.clear();
|
|
3111
|
+
renderer.render(this.scene, this.camera);
|
|
3112
|
+
renderer.setRenderTarget(writeBuffer);
|
|
3113
|
+
if (this.clear)
|
|
3114
|
+
renderer.clear();
|
|
3115
|
+
renderer.render(this.scene, this.camera);
|
|
3116
|
+
state.buffers.color.setLocked(false);
|
|
3117
|
+
state.buffers.depth.setLocked(false);
|
|
3118
|
+
state.buffers.stencil.setLocked(false);
|
|
3119
|
+
state.buffers.stencil.setFunc(context.EQUAL, 1, 4294967295);
|
|
3120
|
+
state.buffers.stencil.setOp(context.KEEP, context.KEEP, context.KEEP);
|
|
3121
|
+
state.buffers.stencil.setLocked(true);
|
|
3122
|
+
}
|
|
3123
|
+
};
|
|
3124
|
+
var ClearMaskPass = class extends Pass {
|
|
3125
|
+
constructor() {
|
|
3126
|
+
super();
|
|
3127
|
+
this.needsSwap = false;
|
|
3128
|
+
}
|
|
3129
|
+
render(renderer) {
|
|
3130
|
+
renderer.state.buffers.stencil.setLocked(false);
|
|
3131
|
+
renderer.state.buffers.stencil.setTest(false);
|
|
3132
|
+
}
|
|
3133
|
+
};
|
|
3134
|
+
|
|
3135
|
+
// node_modules/three-stdlib/postprocessing/EffectComposer.js
|
|
3136
|
+
import { Vector2 as Vector22, WebGLRenderTarget as WebGLRenderTarget2, NoBlending, Clock, LinearFilter, RGBAFormat } from "three";
|
|
3137
|
+
var __defProp5 = Object.defineProperty;
|
|
3138
|
+
var __defNormalProp5 = (obj, key, value) => key in obj ? __defProp5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3139
|
+
var __publicField5 = (obj, key, value) => {
|
|
3140
|
+
__defNormalProp5(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3141
|
+
return value;
|
|
3142
|
+
};
|
|
3143
|
+
var EffectComposer = class {
|
|
3144
|
+
constructor(renderer, renderTarget) {
|
|
3145
|
+
__publicField5(this, "renderer");
|
|
3146
|
+
__publicField5(this, "_pixelRatio");
|
|
3147
|
+
__publicField5(this, "_width");
|
|
3148
|
+
__publicField5(this, "_height");
|
|
3149
|
+
__publicField5(this, "renderTarget1");
|
|
3150
|
+
__publicField5(this, "renderTarget2");
|
|
3151
|
+
__publicField5(this, "writeBuffer");
|
|
3152
|
+
__publicField5(this, "readBuffer");
|
|
3153
|
+
__publicField5(this, "renderToScreen");
|
|
3154
|
+
__publicField5(this, "passes", []);
|
|
3155
|
+
__publicField5(this, "copyPass");
|
|
3156
|
+
__publicField5(this, "clock");
|
|
3157
|
+
this.renderer = renderer;
|
|
3158
|
+
if (renderTarget === void 0) {
|
|
3159
|
+
const parameters = {
|
|
3160
|
+
minFilter: LinearFilter,
|
|
3161
|
+
magFilter: LinearFilter,
|
|
3162
|
+
format: RGBAFormat
|
|
3163
|
+
};
|
|
3164
|
+
const size = renderer.getSize(new Vector22());
|
|
3165
|
+
this._pixelRatio = renderer.getPixelRatio();
|
|
3166
|
+
this._width = size.width;
|
|
3167
|
+
this._height = size.height;
|
|
3168
|
+
renderTarget = new WebGLRenderTarget2(
|
|
3169
|
+
this._width * this._pixelRatio,
|
|
3170
|
+
this._height * this._pixelRatio,
|
|
3171
|
+
parameters
|
|
3172
|
+
);
|
|
3173
|
+
renderTarget.texture.name = "EffectComposer.rt1";
|
|
3174
|
+
} else {
|
|
3175
|
+
this._pixelRatio = 1;
|
|
3176
|
+
this._width = renderTarget.width;
|
|
3177
|
+
this._height = renderTarget.height;
|
|
3178
|
+
}
|
|
3179
|
+
this.renderTarget1 = renderTarget;
|
|
3180
|
+
this.renderTarget2 = renderTarget.clone();
|
|
3181
|
+
this.renderTarget2.texture.name = "EffectComposer.rt2";
|
|
3182
|
+
this.writeBuffer = this.renderTarget1;
|
|
3183
|
+
this.readBuffer = this.renderTarget2;
|
|
3184
|
+
this.renderToScreen = true;
|
|
3185
|
+
if (CopyShader === void 0) {
|
|
3186
|
+
console.error("THREE.EffectComposer relies on CopyShader");
|
|
3187
|
+
}
|
|
3188
|
+
if (ShaderPass === void 0) {
|
|
3189
|
+
console.error("THREE.EffectComposer relies on ShaderPass");
|
|
3190
|
+
}
|
|
3191
|
+
this.copyPass = new ShaderPass(CopyShader);
|
|
3192
|
+
this.copyPass.material.blending = NoBlending;
|
|
3193
|
+
this.clock = new Clock();
|
|
3194
|
+
}
|
|
3195
|
+
swapBuffers() {
|
|
3196
|
+
const tmp = this.readBuffer;
|
|
3197
|
+
this.readBuffer = this.writeBuffer;
|
|
3198
|
+
this.writeBuffer = tmp;
|
|
3199
|
+
}
|
|
3200
|
+
addPass(pass) {
|
|
3201
|
+
this.passes.push(pass);
|
|
3202
|
+
pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
3203
|
+
}
|
|
3204
|
+
insertPass(pass, index) {
|
|
3205
|
+
this.passes.splice(index, 0, pass);
|
|
3206
|
+
pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
3207
|
+
}
|
|
3208
|
+
removePass(pass) {
|
|
3209
|
+
const index = this.passes.indexOf(pass);
|
|
3210
|
+
if (index !== -1) {
|
|
3211
|
+
this.passes.splice(index, 1);
|
|
3212
|
+
}
|
|
3213
|
+
}
|
|
3214
|
+
isLastEnabledPass(passIndex) {
|
|
3215
|
+
for (let i = passIndex + 1; i < this.passes.length; i++) {
|
|
3216
|
+
if (this.passes[i].enabled) {
|
|
3217
|
+
return false;
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3220
|
+
return true;
|
|
3221
|
+
}
|
|
3222
|
+
render(deltaTime) {
|
|
3223
|
+
if (deltaTime === void 0) {
|
|
3224
|
+
deltaTime = this.clock.getDelta();
|
|
3225
|
+
}
|
|
3226
|
+
const currentRenderTarget = this.renderer.getRenderTarget();
|
|
3227
|
+
let maskActive = false;
|
|
3228
|
+
const il = this.passes.length;
|
|
3229
|
+
for (let i = 0; i < il; i++) {
|
|
3230
|
+
const pass = this.passes[i];
|
|
3231
|
+
if (pass.enabled === false)
|
|
3232
|
+
continue;
|
|
3233
|
+
pass.renderToScreen = this.renderToScreen && this.isLastEnabledPass(i);
|
|
3234
|
+
pass.render(this.renderer, this.writeBuffer, this.readBuffer, deltaTime, maskActive);
|
|
3235
|
+
if (pass.needsSwap) {
|
|
3236
|
+
if (maskActive) {
|
|
3237
|
+
const context = this.renderer.getContext();
|
|
3238
|
+
const stencil = this.renderer.state.buffers.stencil;
|
|
3239
|
+
stencil.setFunc(context.NOTEQUAL, 1, 4294967295);
|
|
3240
|
+
this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, deltaTime);
|
|
3241
|
+
stencil.setFunc(context.EQUAL, 1, 4294967295);
|
|
3242
|
+
}
|
|
3243
|
+
this.swapBuffers();
|
|
3244
|
+
}
|
|
3245
|
+
if (MaskPass !== void 0) {
|
|
3246
|
+
if (pass instanceof MaskPass) {
|
|
3247
|
+
maskActive = true;
|
|
3248
|
+
} else if (pass instanceof ClearMaskPass) {
|
|
3249
|
+
maskActive = false;
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
this.renderer.setRenderTarget(currentRenderTarget);
|
|
3254
|
+
}
|
|
3255
|
+
reset(renderTarget) {
|
|
3256
|
+
if (renderTarget === void 0) {
|
|
3257
|
+
const size = this.renderer.getSize(new Vector22());
|
|
3258
|
+
this._pixelRatio = this.renderer.getPixelRatio();
|
|
3259
|
+
this._width = size.width;
|
|
3260
|
+
this._height = size.height;
|
|
3261
|
+
renderTarget = this.renderTarget1.clone();
|
|
3262
|
+
renderTarget.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
3263
|
+
}
|
|
3264
|
+
this.renderTarget1.dispose();
|
|
3265
|
+
this.renderTarget2.dispose();
|
|
3266
|
+
this.renderTarget1 = renderTarget;
|
|
3267
|
+
this.renderTarget2 = renderTarget.clone();
|
|
3268
|
+
this.writeBuffer = this.renderTarget1;
|
|
3269
|
+
this.readBuffer = this.renderTarget2;
|
|
3270
|
+
}
|
|
3271
|
+
setSize(width, height) {
|
|
3272
|
+
this._width = width;
|
|
3273
|
+
this._height = height;
|
|
3274
|
+
const effectiveWidth = this._width * this._pixelRatio;
|
|
3275
|
+
const effectiveHeight = this._height * this._pixelRatio;
|
|
3276
|
+
this.renderTarget1.setSize(effectiveWidth, effectiveHeight);
|
|
3277
|
+
this.renderTarget2.setSize(effectiveWidth, effectiveHeight);
|
|
3278
|
+
for (let i = 0; i < this.passes.length; i++) {
|
|
3279
|
+
this.passes[i].setSize(effectiveWidth, effectiveHeight);
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
setPixelRatio(pixelRatio) {
|
|
3283
|
+
this._pixelRatio = pixelRatio;
|
|
3284
|
+
this.setSize(this._width, this._height);
|
|
3285
|
+
}
|
|
3286
|
+
dispose() {
|
|
3287
|
+
this.renderTarget1.dispose();
|
|
3288
|
+
this.renderTarget2.dispose();
|
|
3289
|
+
this.copyPass.dispose();
|
|
3290
|
+
}
|
|
3291
|
+
};
|
|
3292
|
+
|
|
3293
|
+
// node_modules/three-stdlib/postprocessing/RenderPass.js
|
|
3294
|
+
import { Color as Color4 } from "three";
|
|
3295
|
+
var __defProp6 = Object.defineProperty;
|
|
3296
|
+
var __defNormalProp6 = (obj, key, value) => key in obj ? __defProp6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3297
|
+
var __publicField6 = (obj, key, value) => {
|
|
3298
|
+
__defNormalProp6(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3299
|
+
return value;
|
|
3300
|
+
};
|
|
3301
|
+
var RenderPass = class extends Pass {
|
|
3302
|
+
constructor(scene, camera, overrideMaterial, clearColor, clearAlpha = 0) {
|
|
3303
|
+
super();
|
|
3304
|
+
__publicField6(this, "scene");
|
|
3305
|
+
__publicField6(this, "camera");
|
|
3306
|
+
__publicField6(this, "overrideMaterial");
|
|
3307
|
+
__publicField6(this, "clearColor");
|
|
3308
|
+
__publicField6(this, "clearAlpha");
|
|
3309
|
+
__publicField6(this, "clearDepth", false);
|
|
3310
|
+
__publicField6(this, "_oldClearColor", new Color4());
|
|
3311
|
+
this.scene = scene;
|
|
3312
|
+
this.camera = camera;
|
|
3313
|
+
this.overrideMaterial = overrideMaterial;
|
|
3314
|
+
this.clearColor = clearColor;
|
|
3315
|
+
this.clearAlpha = clearAlpha;
|
|
3316
|
+
this.clear = true;
|
|
3317
|
+
this.needsSwap = false;
|
|
3318
|
+
}
|
|
3319
|
+
render(renderer, writeBuffer, readBuffer) {
|
|
3320
|
+
let oldAutoClear = renderer.autoClear;
|
|
3321
|
+
renderer.autoClear = false;
|
|
3322
|
+
let oldClearAlpha;
|
|
3323
|
+
let oldOverrideMaterial = null;
|
|
3324
|
+
if (this.overrideMaterial !== void 0) {
|
|
3325
|
+
oldOverrideMaterial = this.scene.overrideMaterial;
|
|
3326
|
+
this.scene.overrideMaterial = this.overrideMaterial;
|
|
3327
|
+
}
|
|
3328
|
+
if (this.clearColor) {
|
|
3329
|
+
renderer.getClearColor(this._oldClearColor);
|
|
3330
|
+
oldClearAlpha = renderer.getClearAlpha();
|
|
3331
|
+
renderer.setClearColor(this.clearColor, this.clearAlpha);
|
|
3332
|
+
}
|
|
3333
|
+
if (this.clearDepth) {
|
|
3334
|
+
renderer.clearDepth();
|
|
3335
|
+
}
|
|
3336
|
+
renderer.setRenderTarget(this.renderToScreen ? null : readBuffer);
|
|
3337
|
+
if (this.clear)
|
|
3338
|
+
renderer.clear(renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil);
|
|
3339
|
+
renderer.render(this.scene, this.camera);
|
|
3340
|
+
if (this.clearColor) {
|
|
3341
|
+
renderer.setClearColor(this._oldClearColor, oldClearAlpha);
|
|
3342
|
+
}
|
|
3343
|
+
if (this.overrideMaterial !== void 0) {
|
|
3344
|
+
this.scene.overrideMaterial = oldOverrideMaterial;
|
|
3345
|
+
}
|
|
3346
|
+
renderer.autoClear = oldAutoClear;
|
|
3347
|
+
}
|
|
3348
|
+
};
|
|
3349
|
+
|
|
3350
|
+
// src/components/ui/bloom.tsx
|
|
3351
|
+
import { Vector2 as Vector23 } from "three";
|
|
3352
|
+
import { jsx as jsx50, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3353
|
+
extend({ EffectComposer, RenderPass, UnrealBloomPass });
|
|
3354
|
+
function Bloom({ intensity = 1, radius = 0.4, threshold = 0 }) {
|
|
3355
|
+
const { gl, scene, camera, size } = useThree();
|
|
3356
|
+
const composer = useRef9(null);
|
|
3357
|
+
useEffect2(() => {
|
|
3358
|
+
if (composer.current) {
|
|
3359
|
+
composer.current.setSize(size.width, size.height);
|
|
3360
|
+
}
|
|
3361
|
+
}, [size]);
|
|
3362
|
+
useFrame9(() => {
|
|
3363
|
+
if (composer.current) {
|
|
3364
|
+
composer.current.render();
|
|
3365
|
+
}
|
|
3366
|
+
}, 1);
|
|
3367
|
+
return /* @__PURE__ */ jsxs34("effectComposer", { ref: composer, args: [gl], children: [
|
|
3368
|
+
/* @__PURE__ */ jsx50("renderPass", { attach: "passes", args: [scene, camera] }),
|
|
3369
|
+
/* @__PURE__ */ jsx50("unrealBloomPass", { attach: "passes", args: [new Vector23(size.width, size.height), intensity, radius, threshold] })
|
|
3370
|
+
] });
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3373
|
+
// src/components/ui/reflection.tsx
|
|
3374
|
+
import { MeshReflectorMaterial } from "@react-three/drei";
|
|
3375
|
+
import { jsx as jsx51, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3376
|
+
function Reflection({
|
|
3377
|
+
blur = [300, 100],
|
|
3378
|
+
opacity = 0.5,
|
|
3379
|
+
resolution = 512,
|
|
3380
|
+
color = "#101010"
|
|
3381
|
+
}) {
|
|
3382
|
+
return /* @__PURE__ */ jsxs35("mesh", { rotation: [-Math.PI / 2, 0, 0], position: [0, -0.01, 0], children: [
|
|
3383
|
+
/* @__PURE__ */ jsx51("planeGeometry", { args: [50, 50] }),
|
|
3384
|
+
/* @__PURE__ */ jsx51(
|
|
3385
|
+
MeshReflectorMaterial,
|
|
3386
|
+
{
|
|
3387
|
+
blur,
|
|
3388
|
+
resolution,
|
|
3389
|
+
mixBlur: 1,
|
|
3390
|
+
mixStrength: opacity * 10,
|
|
3391
|
+
roughness: 1,
|
|
3392
|
+
depthScale: 1.2,
|
|
3393
|
+
minDepthThreshold: 0.4,
|
|
3394
|
+
maxDepthThreshold: 1.4,
|
|
3395
|
+
color,
|
|
3396
|
+
metalness: 0.5,
|
|
3397
|
+
mirror: 1
|
|
3398
|
+
}
|
|
3399
|
+
)
|
|
3400
|
+
] });
|
|
3401
|
+
}
|
|
3402
|
+
|
|
3403
|
+
// src/components/ui/fog.tsx
|
|
3404
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3405
|
+
function Fog({
|
|
3406
|
+
color = "#000",
|
|
3407
|
+
near = 5,
|
|
3408
|
+
far = 30,
|
|
3409
|
+
type = "linear",
|
|
3410
|
+
density = 0.02
|
|
3411
|
+
}) {
|
|
3412
|
+
if (type === "exponential") {
|
|
3413
|
+
return /* @__PURE__ */ jsx52("fogExp2", { attach: "fog", args: [color, density] });
|
|
3414
|
+
}
|
|
3415
|
+
return /* @__PURE__ */ jsx52("fog", { attach: "fog", args: [color, near, far] });
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
// src/components/ui/shadowsystem.tsx
|
|
3419
|
+
import { SoftShadows } from "@react-three/drei";
|
|
3420
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
3421
|
+
function ShadowSystem({ type = "soft", bias = -1e-4, mapSize = 1024 }) {
|
|
3422
|
+
if (type === "soft") {
|
|
3423
|
+
return /* @__PURE__ */ jsx53(SoftShadows, {});
|
|
3424
|
+
}
|
|
3425
|
+
if (type === "contact") {
|
|
3426
|
+
return null;
|
|
3427
|
+
}
|
|
3428
|
+
return null;
|
|
3429
|
+
}
|
|
3430
|
+
|
|
3431
|
+
// src/components/ui/gloweffect.tsx
|
|
3432
|
+
import React42, { Children, cloneElement } from "react";
|
|
3433
|
+
import * as THREE3 from "three";
|
|
3434
|
+
import { jsx as jsx54, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3435
|
+
function GlowEffect({
|
|
3436
|
+
children,
|
|
3437
|
+
color = "#22d3ee",
|
|
3438
|
+
intensity = 1,
|
|
3439
|
+
scale = 1.2
|
|
3440
|
+
}) {
|
|
3441
|
+
const glowMaterial = React42.useMemo(() => {
|
|
3442
|
+
return new THREE3.MeshBasicMaterial({
|
|
3443
|
+
color,
|
|
3444
|
+
transparent: true,
|
|
3445
|
+
opacity: 0.3 * intensity,
|
|
3446
|
+
blending: THREE3.AdditiveBlending,
|
|
3447
|
+
side: THREE3.BackSide
|
|
3448
|
+
// Outline effect often uses BackSide with scaled mesh
|
|
3449
|
+
});
|
|
3450
|
+
}, [color, intensity]);
|
|
3451
|
+
return /* @__PURE__ */ jsxs36("group", { children: [
|
|
3452
|
+
children,
|
|
3453
|
+
/* @__PURE__ */ jsx54("group", { scale: [scale, scale, scale], children: Children.map(children, (child) => {
|
|
3454
|
+
if (React42.isValidElement(child)) {
|
|
3455
|
+
return cloneElement(child, {
|
|
3456
|
+
material: glowMaterial
|
|
3457
|
+
});
|
|
3458
|
+
}
|
|
3459
|
+
return child;
|
|
3460
|
+
}) })
|
|
3461
|
+
] });
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3464
|
+
// src/components/ui/waveeffect.tsx
|
|
3465
|
+
import React43, { useMemo as useMemo8 } from "react";
|
|
3466
|
+
import { shaderMaterial } from "@react-three/drei";
|
|
3467
|
+
import { extend as extend2, useFrame as useFrame10 } from "@react-three/fiber";
|
|
3468
|
+
import * as THREE4 from "three";
|
|
3469
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
3470
|
+
var WaveMaterial = shaderMaterial(
|
|
3471
|
+
{ time: 0, color: new THREE4.Color(0.2, 0.5, 1) },
|
|
3472
|
+
// vertex shader
|
|
3473
|
+
`
|
|
3474
|
+
varying vec2 vUv;
|
|
3475
|
+
uniform float time;
|
|
3476
|
+
void main() {
|
|
3477
|
+
vUv = uv;
|
|
3478
|
+
vec3 pos = position;
|
|
3479
|
+
pos.y += sin(pos.x * 2.0 + time) * 0.2;
|
|
3480
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
|
|
3481
|
+
}
|
|
3482
|
+
`,
|
|
3483
|
+
// fragment shader
|
|
3484
|
+
`
|
|
3485
|
+
uniform vec3 color;
|
|
3486
|
+
varying vec2 vUv;
|
|
3487
|
+
void main() {
|
|
3488
|
+
gl_FragColor = vec4(color, 1.0);
|
|
3489
|
+
}
|
|
3490
|
+
`
|
|
3491
|
+
);
|
|
3492
|
+
extend2({ WaveMaterial });
|
|
3493
|
+
function WaveEffect({ children, amplitude = 0.3, frequency = 2, speed = 1 }) {
|
|
3494
|
+
const group = React43.useRef(null);
|
|
3495
|
+
const material = useMemo8(() => new WaveMaterial(), []);
|
|
3496
|
+
useFrame10((state, delta) => {
|
|
3497
|
+
if (material) {
|
|
3498
|
+
material.time += delta * speed;
|
|
3499
|
+
}
|
|
3500
|
+
});
|
|
3501
|
+
React43.useEffect(() => {
|
|
3502
|
+
if (group.current) {
|
|
3503
|
+
group.current.traverse((obj) => {
|
|
3504
|
+
if (obj.isMesh) {
|
|
3505
|
+
obj.material = material;
|
|
3506
|
+
}
|
|
3507
|
+
});
|
|
3508
|
+
}
|
|
3509
|
+
}, [children, material]);
|
|
3510
|
+
return /* @__PURE__ */ jsx55("group", { ref: group, children });
|
|
3511
|
+
}
|
|
3512
|
+
|
|
3513
|
+
// src/components/ui/noisefield.tsx
|
|
3514
|
+
import { useMemo as useMemo9 } from "react";
|
|
3515
|
+
import { shaderMaterial as shaderMaterial2 } from "@react-three/drei";
|
|
3516
|
+
import { extend as extend3, useFrame as useFrame11 } from "@react-three/fiber";
|
|
3517
|
+
import * as THREE5 from "three";
|
|
3518
|
+
import { jsx as jsx56, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3519
|
+
var NoiseMaterial = shaderMaterial2(
|
|
3520
|
+
{ time: 0, scale: 1, color: new THREE5.Color(0.2, 0.5, 1) },
|
|
3521
|
+
// Vertex
|
|
3522
|
+
`
|
|
3523
|
+
varying vec2 vUv;
|
|
3524
|
+
void main() {
|
|
3525
|
+
vUv = uv;
|
|
3526
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
3527
|
+
}
|
|
3528
|
+
`,
|
|
3529
|
+
// Fragment (Simple noise-like pattern via sine waves)
|
|
3530
|
+
`
|
|
3531
|
+
uniform float time;
|
|
3532
|
+
uniform float scale;
|
|
3533
|
+
uniform vec3 color;
|
|
3534
|
+
varying vec2 vUv;
|
|
3535
|
+
|
|
3536
|
+
// Pseudo-random
|
|
3537
|
+
float rand(vec2 co){
|
|
3538
|
+
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
void main() {
|
|
3542
|
+
float noise = rand(vUv * scale + time * 0.1);
|
|
3543
|
+
gl_FragColor = vec4(color * noise, 1.0);
|
|
3544
|
+
}
|
|
3545
|
+
`
|
|
3546
|
+
);
|
|
3547
|
+
extend3({ NoiseMaterial });
|
|
3548
|
+
function NoiseField({ scale = 1, speed = 0.5, mode = "color" }) {
|
|
3549
|
+
const material = useMemo9(() => new NoiseMaterial(), []);
|
|
3550
|
+
useFrame11((state, delta) => {
|
|
3551
|
+
if (material) {
|
|
3552
|
+
material.time += delta * speed;
|
|
3553
|
+
material.scale = scale;
|
|
3554
|
+
}
|
|
3555
|
+
});
|
|
3556
|
+
return /* @__PURE__ */ jsxs37("mesh", { rotation: [-Math.PI / 2, 0, 0], children: [
|
|
3557
|
+
/* @__PURE__ */ jsx56("planeGeometry", { args: [10, 10, 64, 64] }),
|
|
3558
|
+
/* @__PURE__ */ jsx56("primitive", { object: material, attach: "material" })
|
|
3559
|
+
] });
|
|
3560
|
+
}
|
|
3561
|
+
export {
|
|
3562
|
+
Accordion3D,
|
|
3563
|
+
AudioVisualizer,
|
|
3564
|
+
Badge,
|
|
3565
|
+
Badge3D,
|
|
3566
|
+
BarChart3D,
|
|
3567
|
+
Bloom,
|
|
3568
|
+
Breadcrumb,
|
|
3569
|
+
Button3D,
|
|
3570
|
+
Card3D,
|
|
3571
|
+
Container,
|
|
3572
|
+
Dialog,
|
|
3573
|
+
Fog,
|
|
3574
|
+
Gallery3D,
|
|
3575
|
+
GlowEffect,
|
|
3576
|
+
Graph3D,
|
|
3577
|
+
Grid,
|
|
3578
|
+
ImagePlane,
|
|
3579
|
+
Input,
|
|
3580
|
+
Input3D,
|
|
3581
|
+
LineChart3D,
|
|
3582
|
+
Map3D,
|
|
3583
|
+
Menu3D,
|
|
3584
|
+
Menu3DItem,
|
|
3585
|
+
Menu3DLabel,
|
|
3586
|
+
Menu3DSeparator,
|
|
3587
|
+
Modal3D,
|
|
3588
|
+
ModelViewer,
|
|
3589
|
+
NavBar3D,
|
|
3590
|
+
NoiseField,
|
|
3591
|
+
PageLayout,
|
|
3592
|
+
Pagination,
|
|
3593
|
+
Particles,
|
|
3594
|
+
PieChart3D,
|
|
3595
|
+
Popover,
|
|
3596
|
+
Progress,
|
|
3597
|
+
Progress3D,
|
|
3598
|
+
Reflection,
|
|
3599
|
+
ScatterPlot3D,
|
|
3600
|
+
Section,
|
|
3601
|
+
Select,
|
|
3602
|
+
Select3D,
|
|
3603
|
+
ShadowSystem,
|
|
3604
|
+
Sheet,
|
|
3605
|
+
Skeleton,
|
|
3606
|
+
Slider,
|
|
3607
|
+
Slider3D,
|
|
3608
|
+
Spinner3D,
|
|
3609
|
+
Stack,
|
|
3610
|
+
Stepper3D,
|
|
3611
|
+
Table,
|
|
3612
|
+
Tabs3D,
|
|
3613
|
+
Timeline3D,
|
|
3614
|
+
Toast,
|
|
3615
|
+
Toggle,
|
|
3616
|
+
Toggle3D,
|
|
3617
|
+
Tooltip,
|
|
3618
|
+
Tooltip3D,
|
|
3619
|
+
VideoPlane,
|
|
3620
|
+
WaveEffect
|
|
3621
|
+
};
|
|
3622
|
+
//# sourceMappingURL=index.js.map
|