@facter/ds-core 1.1.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1050 -19
- package/dist/index.d.ts +1050 -19
- package/dist/index.js +3137 -228
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3060 -231
- package/dist/index.mjs.map +1 -1
- package/dist/themes/index.d.mts +17 -1
- package/dist/themes/index.d.ts +17 -1
- package/dist/themes/index.js +14 -3
- package/dist/themes/index.js.map +1 -1
- package/dist/themes/index.mjs +14 -3
- package/dist/themes/index.mjs.map +1 -1
- package/package.json +23 -16
- package/src/themes/default.css +59 -0
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React48 from 'react';
|
|
3
|
+
import { createContext, useCallback, Children, isValidElement, useState, useMemo, useContext } from 'react';
|
|
2
4
|
import { cva } from 'class-variance-authority';
|
|
3
5
|
import { clsx } from 'clsx';
|
|
4
6
|
import { twMerge } from 'tailwind-merge';
|
|
5
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
import { ChevronDown, Check, Inbox, ChevronsLeft, ChevronLeft, ChevronRight, ChevronsRight, X, Circle, PinOff, Pin, ArrowDown, ArrowUp, ChevronsUpDown, FileText, FileSpreadsheet, Download, Rows4, Rows3, LayoutList, SlidersHorizontal, Info, AlertTriangle, XCircle, CheckCircle2, Building2, Star, ArrowRight, Search, User, LogOut, Menu, AlertCircle, TrendingUp, TrendingDown, Sun, Moon, Bell, MoreHorizontal, Settings } from 'lucide-react';
|
|
9
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
6
10
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
7
|
-
import { ChevronDown, Check, Inbox, ChevronsLeft, ChevronLeft, ChevronRight, ChevronsRight, X, ArrowDown, ArrowUp, ChevronsUpDown, FileText, FileSpreadsheet, Download, Rows4, Rows3, LayoutList, SlidersHorizontal, Info, AlertTriangle, XCircle, CheckCircle2, Circle, Building2, Star, ArrowRight, Search, User, LogOut, Menu, PinOff, Pin } from 'lucide-react';
|
|
8
11
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
9
|
-
import { AnimatePresence, motion } from 'framer-motion';
|
|
10
12
|
import { flexRender, useReactTable, getSortedRowModel, getPaginationRowModel, getFilteredRowModel, getCoreRowModel } from '@tanstack/react-table';
|
|
11
13
|
export { flexRender } from '@tanstack/react-table';
|
|
12
14
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
13
15
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
14
16
|
import { toast as toast$1, Toaster as Toaster$1 } from 'sonner';
|
|
15
17
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
16
|
-
import { Controller } from 'react-hook-form';
|
|
18
|
+
import { Controller, FormProvider as FormProvider$1 } from 'react-hook-form';
|
|
17
19
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
20
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
21
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
22
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
23
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
24
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
25
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
18
26
|
|
|
19
27
|
// src/components/Button/Button.tsx
|
|
20
28
|
function cn(...inputs) {
|
|
@@ -28,7 +36,7 @@ var buttonVariants = cva(
|
|
|
28
36
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
29
37
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
30
38
|
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
31
|
-
secondary: "bg-
|
|
39
|
+
secondary: "bg-primary/15 text-primary hover:bg-primary/25",
|
|
32
40
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
33
41
|
link: "text-primary underline-offset-4 hover:underline"
|
|
34
42
|
},
|
|
@@ -46,7 +54,7 @@ var buttonVariants = cva(
|
|
|
46
54
|
}
|
|
47
55
|
}
|
|
48
56
|
);
|
|
49
|
-
var Button =
|
|
57
|
+
var Button = React48.forwardRef(
|
|
50
58
|
({ className, variant, size, ...props }, ref) => {
|
|
51
59
|
return /* @__PURE__ */ jsx(
|
|
52
60
|
"button",
|
|
@@ -59,6 +67,66 @@ var Button = React36.forwardRef(
|
|
|
59
67
|
}
|
|
60
68
|
);
|
|
61
69
|
Button.displayName = "Button";
|
|
70
|
+
function Card({ className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: cn(
|
|
75
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
76
|
+
className
|
|
77
|
+
),
|
|
78
|
+
...props
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
Card.displayName = "Card";
|
|
83
|
+
function CardHeader({ className, ...props }) {
|
|
84
|
+
return /* @__PURE__ */ jsx(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
88
|
+
...props
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
CardHeader.displayName = "CardHeader";
|
|
93
|
+
function CardTitle({ className, ...props }) {
|
|
94
|
+
return /* @__PURE__ */ jsx(
|
|
95
|
+
"h3",
|
|
96
|
+
{
|
|
97
|
+
className: cn(
|
|
98
|
+
"text-2xl font-semibold leading-none tracking-tight",
|
|
99
|
+
className
|
|
100
|
+
),
|
|
101
|
+
...props
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
CardTitle.displayName = "CardTitle";
|
|
106
|
+
function CardDescription({ className, ...props }) {
|
|
107
|
+
return /* @__PURE__ */ jsx(
|
|
108
|
+
"p",
|
|
109
|
+
{
|
|
110
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
111
|
+
...props
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
CardDescription.displayName = "CardDescription";
|
|
116
|
+
function CardContent({ className, ...props }) {
|
|
117
|
+
return /* @__PURE__ */ jsx("div", { className: cn("p-6 pt-0", className), ...props });
|
|
118
|
+
}
|
|
119
|
+
CardContent.displayName = "CardContent";
|
|
120
|
+
function CardFooter({ className, ...props }) {
|
|
121
|
+
return /* @__PURE__ */ jsx(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
125
|
+
...props
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
CardFooter.displayName = "CardFooter";
|
|
62
130
|
var inputVariants = cva(
|
|
63
131
|
"w-full h-12 px-3 pt-4 pb-2 text-sm bg-background rounded-md border-2 transition-colors focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50",
|
|
64
132
|
{
|
|
@@ -79,7 +147,7 @@ var inputVariants = cva(
|
|
|
79
147
|
}
|
|
80
148
|
}
|
|
81
149
|
);
|
|
82
|
-
var Input =
|
|
150
|
+
var Input = React48.forwardRef(
|
|
83
151
|
({
|
|
84
152
|
className,
|
|
85
153
|
variant,
|
|
@@ -93,13 +161,13 @@ var Input = React36.forwardRef(
|
|
|
93
161
|
labelClassName,
|
|
94
162
|
...props
|
|
95
163
|
}, ref) => {
|
|
96
|
-
const inputRef =
|
|
97
|
-
const [showPassword, setShowPassword] =
|
|
98
|
-
|
|
99
|
-
const focusInput =
|
|
164
|
+
const inputRef = React48.useRef(null);
|
|
165
|
+
const [showPassword, setShowPassword] = React48.useState(false);
|
|
166
|
+
React48.useImperativeHandle(ref, () => inputRef.current, []);
|
|
167
|
+
const focusInput = React48.useCallback(() => {
|
|
100
168
|
inputRef.current?.focus();
|
|
101
169
|
}, []);
|
|
102
|
-
const togglePasswordVisibility =
|
|
170
|
+
const togglePasswordVisibility = React48.useCallback(() => {
|
|
103
171
|
setShowPassword((prev) => !prev);
|
|
104
172
|
}, []);
|
|
105
173
|
const inputType = type === "password" ? showPassword ? "text" : "password" : type;
|
|
@@ -208,13 +276,13 @@ var badgeVariants = cva(
|
|
|
208
276
|
{
|
|
209
277
|
variants: {
|
|
210
278
|
variant: {
|
|
211
|
-
default: "border-transparent bg-primary text-primary
|
|
279
|
+
default: "border-transparent bg-primary/15 text-primary hover:bg-primary/25",
|
|
212
280
|
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
213
|
-
success: "border-transparent bg-green-500 text-
|
|
214
|
-
warning: "border-transparent bg-yellow-500 text-
|
|
215
|
-
error: "border-transparent bg-red-500 text-
|
|
216
|
-
info: "border-transparent bg-blue-500 text-
|
|
217
|
-
outline: "border-
|
|
281
|
+
success: "border-transparent bg-green-500/15 text-green-600 dark:text-green-400 hover:bg-green-500/25",
|
|
282
|
+
warning: "border-transparent bg-yellow-500/15 text-yellow-600 dark:text-yellow-400 hover:bg-yellow-500/25",
|
|
283
|
+
error: "border-transparent bg-red-500/15 text-red-600 dark:text-red-400 hover:bg-red-500/25",
|
|
284
|
+
info: "border-transparent bg-blue-500/15 text-blue-600 dark:text-blue-400 hover:bg-blue-500/25",
|
|
285
|
+
outline: "border-border text-foreground hover:bg-muted"
|
|
218
286
|
},
|
|
219
287
|
size: {
|
|
220
288
|
default: "px-2.5 py-0.5 text-xs",
|
|
@@ -232,6 +300,239 @@ function Badge({ className, variant, size, ...props }) {
|
|
|
232
300
|
return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant, size }), className), ...props });
|
|
233
301
|
}
|
|
234
302
|
Badge.displayName = "Badge";
|
|
303
|
+
var colorClasses = {
|
|
304
|
+
"chart-1": "text-chart-1",
|
|
305
|
+
"chart-2": "text-chart-2",
|
|
306
|
+
"chart-3": "text-chart-3",
|
|
307
|
+
"chart-4": "text-chart-4",
|
|
308
|
+
"chart-5": "text-chart-5"
|
|
309
|
+
};
|
|
310
|
+
function generateSmoothPath(points) {
|
|
311
|
+
if (points.length < 2) return "";
|
|
312
|
+
if (points.length === 2) {
|
|
313
|
+
return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;
|
|
314
|
+
}
|
|
315
|
+
let path = `M ${points[0].x.toFixed(2)} ${points[0].y.toFixed(2)}`;
|
|
316
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
317
|
+
const p0 = points[Math.max(0, i - 1)];
|
|
318
|
+
const p1 = points[i];
|
|
319
|
+
const p2 = points[i + 1];
|
|
320
|
+
const p3 = points[Math.min(points.length - 1, i + 2)];
|
|
321
|
+
const tension = 0.3;
|
|
322
|
+
const cp1x = p1.x + (p2.x - p0.x) * tension;
|
|
323
|
+
const cp1y = p1.y + (p2.y - p0.y) * tension;
|
|
324
|
+
const cp2x = p2.x - (p3.x - p1.x) * tension;
|
|
325
|
+
const cp2y = p2.y - (p3.y - p1.y) * tension;
|
|
326
|
+
path += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${p2.x.toFixed(2)} ${p2.y.toFixed(2)}`;
|
|
327
|
+
}
|
|
328
|
+
return path;
|
|
329
|
+
}
|
|
330
|
+
function Sparkline({
|
|
331
|
+
data,
|
|
332
|
+
color = "chart-1",
|
|
333
|
+
animate = true,
|
|
334
|
+
className,
|
|
335
|
+
show = true
|
|
336
|
+
}) {
|
|
337
|
+
const gradientId = React48.useId();
|
|
338
|
+
const { linePath, areaPath } = React48.useMemo(() => {
|
|
339
|
+
if (data.length < 2) {
|
|
340
|
+
return { linePath: "", areaPath: "" };
|
|
341
|
+
}
|
|
342
|
+
const max = Math.max(...data);
|
|
343
|
+
const min = Math.min(...data);
|
|
344
|
+
const range = max - min || 1;
|
|
345
|
+
const points = data.map((value, index) => ({
|
|
346
|
+
x: index / (data.length - 1) * 100,
|
|
347
|
+
y: 100 - (value - min) / range * 70 - 15
|
|
348
|
+
// 15% padding top, 15% bottom
|
|
349
|
+
}));
|
|
350
|
+
const line = generateSmoothPath(points);
|
|
351
|
+
const area = `${line} L 100 100 L 0 100 Z`;
|
|
352
|
+
return { linePath: line, areaPath: area };
|
|
353
|
+
}, [data]);
|
|
354
|
+
if (!show || data.length < 2) {
|
|
355
|
+
return null;
|
|
356
|
+
}
|
|
357
|
+
return /* @__PURE__ */ jsxs(
|
|
358
|
+
"svg",
|
|
359
|
+
{
|
|
360
|
+
viewBox: "0 0 100 100",
|
|
361
|
+
preserveAspectRatio: "none",
|
|
362
|
+
className: cn("w-full h-16", colorClasses[color], className),
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
365
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "currentColor", stopOpacity: "0.3" }),
|
|
366
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "currentColor", stopOpacity: "0" })
|
|
367
|
+
] }) }),
|
|
368
|
+
/* @__PURE__ */ jsx(
|
|
369
|
+
motion.path,
|
|
370
|
+
{
|
|
371
|
+
d: areaPath,
|
|
372
|
+
fill: `url(#${gradientId})`,
|
|
373
|
+
initial: animate ? { opacity: 0 } : void 0,
|
|
374
|
+
animate: { opacity: 1 },
|
|
375
|
+
transition: { duration: 0.5, delay: 0.3 }
|
|
376
|
+
}
|
|
377
|
+
),
|
|
378
|
+
/* @__PURE__ */ jsx(
|
|
379
|
+
motion.path,
|
|
380
|
+
{
|
|
381
|
+
d: linePath,
|
|
382
|
+
fill: "none",
|
|
383
|
+
stroke: "currentColor",
|
|
384
|
+
strokeWidth: "2",
|
|
385
|
+
strokeLinecap: "round",
|
|
386
|
+
strokeLinejoin: "round",
|
|
387
|
+
vectorEffect: "non-scaling-stroke",
|
|
388
|
+
initial: animate ? { pathLength: 0 } : void 0,
|
|
389
|
+
animate: { pathLength: 1 },
|
|
390
|
+
transition: { duration: 0.8, ease: "easeOut" }
|
|
391
|
+
}
|
|
392
|
+
)
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
Sparkline.displayName = "BigNumberCard.Sparkline";
|
|
398
|
+
var rootVariants = cva(
|
|
399
|
+
"relative overflow-hidden rounded-xl border border-border bg-card shadow-sm min-h-[140px]",
|
|
400
|
+
{
|
|
401
|
+
variants: {
|
|
402
|
+
size: {
|
|
403
|
+
default: "p-5 pb-14",
|
|
404
|
+
sm: "p-4 pb-12",
|
|
405
|
+
lg: "p-6 pb-16"
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
defaultVariants: {
|
|
409
|
+
size: "default"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
function BigNumberCardRoot({ children, className, size }) {
|
|
414
|
+
return /* @__PURE__ */ jsx("div", { className: cn(rootVariants({ size }), className), children });
|
|
415
|
+
}
|
|
416
|
+
BigNumberCardRoot.displayName = "BigNumberCard.Root";
|
|
417
|
+
function BigNumberCardHeader({ children, className }) {
|
|
418
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-between", className), children });
|
|
419
|
+
}
|
|
420
|
+
BigNumberCardHeader.displayName = "BigNumberCard.Header";
|
|
421
|
+
function BigNumberCardTitle({ children, className }) {
|
|
422
|
+
return /* @__PURE__ */ jsx("span", { className: cn("text-sm font-medium text-muted-foreground", className), children });
|
|
423
|
+
}
|
|
424
|
+
BigNumberCardTitle.displayName = "BigNumberCard.Title";
|
|
425
|
+
function BigNumberCardLink({ children, href, onClick, className }) {
|
|
426
|
+
const handleClick = (e) => {
|
|
427
|
+
if (onClick) {
|
|
428
|
+
e.preventDefault();
|
|
429
|
+
onClick();
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
return /* @__PURE__ */ jsx(
|
|
433
|
+
"a",
|
|
434
|
+
{
|
|
435
|
+
href: href ?? "#",
|
|
436
|
+
onClick: handleClick,
|
|
437
|
+
className: cn(
|
|
438
|
+
"text-xs font-medium text-primary hover:text-primary/80 hover:underline transition-colors",
|
|
439
|
+
className
|
|
440
|
+
),
|
|
441
|
+
children
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
BigNumberCardLink.displayName = "BigNumberCard.Link";
|
|
446
|
+
function BigNumberCardContent({ children, className }) {
|
|
447
|
+
return /* @__PURE__ */ jsx("div", { className: cn("mt-3 space-y-1", className), children });
|
|
448
|
+
}
|
|
449
|
+
BigNumberCardContent.displayName = "BigNumberCard.Content";
|
|
450
|
+
function BigNumberCardValue({ children, prefix, suffix, className }) {
|
|
451
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("mt-3 text-3xl font-bold tracking-tight text-foreground", className), children: [
|
|
452
|
+
prefix && /* @__PURE__ */ jsx("span", { className: "text-2xl", children: prefix }),
|
|
453
|
+
children,
|
|
454
|
+
suffix && /* @__PURE__ */ jsx("span", { className: "text-2xl ml-0.5", children: suffix })
|
|
455
|
+
] });
|
|
456
|
+
}
|
|
457
|
+
BigNumberCardValue.displayName = "BigNumberCard.Value";
|
|
458
|
+
function BigNumberCardTrend({ value, direction, children, className, show = true }) {
|
|
459
|
+
if (!show) {
|
|
460
|
+
return null;
|
|
461
|
+
}
|
|
462
|
+
const isUp = direction === "up";
|
|
463
|
+
const Icon2 = isUp ? TrendingUp : TrendingDown;
|
|
464
|
+
return /* @__PURE__ */ jsxs(
|
|
465
|
+
"div",
|
|
466
|
+
{
|
|
467
|
+
className: cn(
|
|
468
|
+
"mt-2 flex items-center gap-1.5 text-sm",
|
|
469
|
+
isUp ? "text-emerald-600 dark:text-emerald-400" : "text-red-600 dark:text-red-400",
|
|
470
|
+
className
|
|
471
|
+
),
|
|
472
|
+
children: [
|
|
473
|
+
/* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 flex-shrink-0" }),
|
|
474
|
+
/* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
|
|
475
|
+
isUp ? "+" : "",
|
|
476
|
+
value.toFixed(1),
|
|
477
|
+
"%"
|
|
478
|
+
] }),
|
|
479
|
+
children && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-normal", children })
|
|
480
|
+
]
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
BigNumberCardTrend.displayName = "BigNumberCard.Trend";
|
|
485
|
+
function BigNumberCardDescription({ children, className, show = true }) {
|
|
486
|
+
if (!show) {
|
|
487
|
+
return null;
|
|
488
|
+
}
|
|
489
|
+
return /* @__PURE__ */ jsx("p", { className: cn("mt-1 text-xs text-muted-foreground", className), children });
|
|
490
|
+
}
|
|
491
|
+
BigNumberCardDescription.displayName = "BigNumberCard.Description";
|
|
492
|
+
function BigNumberCardSparklineWrapper(props) {
|
|
493
|
+
const { show = true, ...rest } = props;
|
|
494
|
+
if (!show) {
|
|
495
|
+
return null;
|
|
496
|
+
}
|
|
497
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 h-16 opacity-80", children: /* @__PURE__ */ jsx(Sparkline, { ...rest, show }) });
|
|
498
|
+
}
|
|
499
|
+
BigNumberCardSparklineWrapper.displayName = "BigNumberCard.Sparkline";
|
|
500
|
+
var BigNumberCard = {
|
|
501
|
+
Root: BigNumberCardRoot,
|
|
502
|
+
Header: BigNumberCardHeader,
|
|
503
|
+
Title: BigNumberCardTitle,
|
|
504
|
+
Link: BigNumberCardLink,
|
|
505
|
+
Content: BigNumberCardContent,
|
|
506
|
+
Value: BigNumberCardValue,
|
|
507
|
+
Trend: BigNumberCardTrend,
|
|
508
|
+
Description: BigNumberCardDescription,
|
|
509
|
+
Sparkline: BigNumberCardSparklineWrapper
|
|
510
|
+
};
|
|
511
|
+
function Skeleton({
|
|
512
|
+
className,
|
|
513
|
+
variant = "default",
|
|
514
|
+
animation = "pulse",
|
|
515
|
+
...props
|
|
516
|
+
}) {
|
|
517
|
+
return /* @__PURE__ */ jsx(
|
|
518
|
+
"div",
|
|
519
|
+
{
|
|
520
|
+
className: cn(
|
|
521
|
+
"bg-muted",
|
|
522
|
+
{
|
|
523
|
+
"rounded-md": variant === "default",
|
|
524
|
+
"rounded-full": variant === "circular",
|
|
525
|
+
"rounded h-4": variant === "text",
|
|
526
|
+
"animate-pulse": animation === "pulse",
|
|
527
|
+
"animate-shimmer": animation === "wave"
|
|
528
|
+
},
|
|
529
|
+
className
|
|
530
|
+
),
|
|
531
|
+
...props
|
|
532
|
+
}
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
Skeleton.displayName = "Skeleton";
|
|
235
536
|
var selectVariants = cva(
|
|
236
537
|
"w-full h-12 px-3 pt-4 pb-2 text-sm bg-background rounded-md border-2 transition-colors focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50",
|
|
237
538
|
{
|
|
@@ -252,7 +553,7 @@ var selectVariants = cva(
|
|
|
252
553
|
}
|
|
253
554
|
}
|
|
254
555
|
);
|
|
255
|
-
var Select =
|
|
556
|
+
var Select = React48.forwardRef(
|
|
256
557
|
({
|
|
257
558
|
className,
|
|
258
559
|
variant,
|
|
@@ -321,7 +622,7 @@ var Select = React36.forwardRef(
|
|
|
321
622
|
}
|
|
322
623
|
);
|
|
323
624
|
Select.displayName = "Select";
|
|
324
|
-
var SelectItem =
|
|
625
|
+
var SelectItem = React48.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
325
626
|
SelectPrimitive.Item,
|
|
326
627
|
{
|
|
327
628
|
ref,
|
|
@@ -340,7 +641,7 @@ var SelectItem = React36.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
340
641
|
));
|
|
341
642
|
SelectItem.displayName = "SelectItem";
|
|
342
643
|
var SelectGroup = SelectPrimitive.Group;
|
|
343
|
-
var SelectLabel =
|
|
644
|
+
var SelectLabel = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
344
645
|
SelectPrimitive.Label,
|
|
345
646
|
{
|
|
346
647
|
ref,
|
|
@@ -349,7 +650,7 @@ var SelectLabel = React36.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
349
650
|
}
|
|
350
651
|
));
|
|
351
652
|
SelectLabel.displayName = "SelectLabel";
|
|
352
|
-
var SelectSeparator =
|
|
653
|
+
var SelectSeparator = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
353
654
|
SelectPrimitive.Separator,
|
|
354
655
|
{
|
|
355
656
|
ref,
|
|
@@ -359,7 +660,7 @@ var SelectSeparator = React36.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
359
660
|
));
|
|
360
661
|
SelectSeparator.displayName = "SelectSeparator";
|
|
361
662
|
var Tabs = TabsPrimitive.Root;
|
|
362
|
-
var TabsList =
|
|
663
|
+
var TabsList = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
363
664
|
TabsPrimitive.List,
|
|
364
665
|
{
|
|
365
666
|
ref,
|
|
@@ -371,7 +672,7 @@ var TabsList = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
371
672
|
}
|
|
372
673
|
));
|
|
373
674
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
374
|
-
var TabsTrigger =
|
|
675
|
+
var TabsTrigger = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
375
676
|
TabsPrimitive.Trigger,
|
|
376
677
|
{
|
|
377
678
|
ref,
|
|
@@ -383,7 +684,7 @@ var TabsTrigger = React36.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
383
684
|
}
|
|
384
685
|
));
|
|
385
686
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
386
|
-
var TabsContent =
|
|
687
|
+
var TabsContent = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
387
688
|
TabsPrimitive.Content,
|
|
388
689
|
{
|
|
389
690
|
ref,
|
|
@@ -492,7 +793,7 @@ function BarsLoader() {
|
|
|
492
793
|
i
|
|
493
794
|
)) });
|
|
494
795
|
}
|
|
495
|
-
var Loader =
|
|
796
|
+
var Loader = React48.forwardRef(
|
|
496
797
|
({
|
|
497
798
|
variant = "default",
|
|
498
799
|
message,
|
|
@@ -542,21 +843,21 @@ var Loader = React36.forwardRef(
|
|
|
542
843
|
}
|
|
543
844
|
);
|
|
544
845
|
Loader.displayName = "Loader";
|
|
545
|
-
var LoaderContext =
|
|
846
|
+
var LoaderContext = React48.createContext(
|
|
546
847
|
void 0
|
|
547
848
|
);
|
|
548
849
|
function LoaderProvider({ children }) {
|
|
549
|
-
const [isLoading, setIsLoading] =
|
|
550
|
-
const [loaderOptions, setLoaderOptions] =
|
|
551
|
-
const show =
|
|
850
|
+
const [isLoading, setIsLoading] = React48.useState(false);
|
|
851
|
+
const [loaderOptions, setLoaderOptions] = React48.useState({});
|
|
852
|
+
const show = React48.useCallback((options = {}) => {
|
|
552
853
|
setLoaderOptions(options);
|
|
553
854
|
setIsLoading(true);
|
|
554
855
|
}, []);
|
|
555
|
-
const hide =
|
|
856
|
+
const hide = React48.useCallback(() => {
|
|
556
857
|
setIsLoading(false);
|
|
557
858
|
setTimeout(() => setLoaderOptions({}), 300);
|
|
558
859
|
}, []);
|
|
559
|
-
const value =
|
|
860
|
+
const value = React48.useMemo(
|
|
560
861
|
() => ({ show, hide, isLoading }),
|
|
561
862
|
[show, hide, isLoading]
|
|
562
863
|
);
|
|
@@ -575,7 +876,7 @@ function LoaderProvider({ children }) {
|
|
|
575
876
|
] });
|
|
576
877
|
}
|
|
577
878
|
function useLoader() {
|
|
578
|
-
const context =
|
|
879
|
+
const context = React48.useContext(LoaderContext);
|
|
579
880
|
if (context === void 0) {
|
|
580
881
|
throw new Error("useLoader must be used within a LoaderProvider");
|
|
581
882
|
}
|
|
@@ -607,7 +908,7 @@ var loader = {
|
|
|
607
908
|
};
|
|
608
909
|
function GlobalLoaderController() {
|
|
609
910
|
const loaderController = useLoader();
|
|
610
|
-
|
|
911
|
+
React48.useEffect(() => {
|
|
611
912
|
setGlobalLoader(loaderController);
|
|
612
913
|
return () => {
|
|
613
914
|
setGlobalLoader(null);
|
|
@@ -693,7 +994,7 @@ var iconAnimation = {
|
|
|
693
994
|
whileHover: { scale: 1.1 },
|
|
694
995
|
whileTap: { scale: 0.9 }
|
|
695
996
|
};
|
|
696
|
-
var EmptyStateContent =
|
|
997
|
+
var EmptyStateContent = React48.memo(
|
|
697
998
|
({
|
|
698
999
|
message = "Nenhum item encontrado",
|
|
699
1000
|
description,
|
|
@@ -705,7 +1006,7 @@ var EmptyStateContent = React36.memo(
|
|
|
705
1006
|
layout = "vertical",
|
|
706
1007
|
className
|
|
707
1008
|
}) => {
|
|
708
|
-
const handleAction =
|
|
1009
|
+
const handleAction = React48.useCallback(() => {
|
|
709
1010
|
if (onAction) {
|
|
710
1011
|
onAction();
|
|
711
1012
|
}
|
|
@@ -735,7 +1036,7 @@ var EmptyStateContent = React36.memo(
|
|
|
735
1036
|
}
|
|
736
1037
|
);
|
|
737
1038
|
EmptyStateContent.displayName = "EmptyStateContent";
|
|
738
|
-
var AnimatedEmptyState =
|
|
1039
|
+
var AnimatedEmptyState = React48.memo((props) => {
|
|
739
1040
|
const {
|
|
740
1041
|
message = "Nenhum item encontrado",
|
|
741
1042
|
description,
|
|
@@ -747,7 +1048,7 @@ var AnimatedEmptyState = React36.memo((props) => {
|
|
|
747
1048
|
layout = "vertical",
|
|
748
1049
|
className
|
|
749
1050
|
} = props;
|
|
750
|
-
const handleAction =
|
|
1051
|
+
const handleAction = React48.useCallback(() => {
|
|
751
1052
|
if (onAction) {
|
|
752
1053
|
onAction();
|
|
753
1054
|
}
|
|
@@ -790,7 +1091,7 @@ var AnimatedEmptyState = React36.memo((props) => {
|
|
|
790
1091
|
);
|
|
791
1092
|
});
|
|
792
1093
|
AnimatedEmptyState.displayName = "AnimatedEmptyState";
|
|
793
|
-
var EmptyState =
|
|
1094
|
+
var EmptyState = React48.memo(
|
|
794
1095
|
({ animated = true, ...props }) => {
|
|
795
1096
|
if (!animated) {
|
|
796
1097
|
return /* @__PURE__ */ jsx(EmptyStateContent, { ...props });
|
|
@@ -804,13 +1105,13 @@ function useDataTableInternal({
|
|
|
804
1105
|
columns,
|
|
805
1106
|
getRowId
|
|
806
1107
|
}) {
|
|
807
|
-
const [rowSelection, setRowSelection] =
|
|
808
|
-
const [columnVisibility, setColumnVisibility] =
|
|
809
|
-
const [columnFilters, setColumnFilters] =
|
|
810
|
-
const [sorting, setSorting] =
|
|
811
|
-
const [globalFilter, setGlobalFilter] =
|
|
812
|
-
const [density, setDensity] =
|
|
813
|
-
const [pagination, setPagination] =
|
|
1108
|
+
const [rowSelection, setRowSelection] = React48.useState({});
|
|
1109
|
+
const [columnVisibility, setColumnVisibility] = React48.useState({});
|
|
1110
|
+
const [columnFilters, setColumnFilters] = React48.useState([]);
|
|
1111
|
+
const [sorting, setSorting] = React48.useState([]);
|
|
1112
|
+
const [globalFilter, setGlobalFilter] = React48.useState("");
|
|
1113
|
+
const [density, setDensity] = React48.useState("default");
|
|
1114
|
+
const [pagination, setPagination] = React48.useState({
|
|
814
1115
|
pageIndex: 0,
|
|
815
1116
|
pageSize: 10
|
|
816
1117
|
});
|
|
@@ -844,7 +1145,7 @@ function useDataTableInternal({
|
|
|
844
1145
|
getPaginationRowModel: getPaginationRowModel(),
|
|
845
1146
|
getSortedRowModel: getSortedRowModel()
|
|
846
1147
|
});
|
|
847
|
-
const meta =
|
|
1148
|
+
const meta = React48.useMemo(
|
|
848
1149
|
() => ({
|
|
849
1150
|
isLoading: false,
|
|
850
1151
|
// Loading é controlado externamente via DataTable.Loading
|
|
@@ -862,11 +1163,11 @@ function useDataTableInternal({
|
|
|
862
1163
|
setDensity
|
|
863
1164
|
};
|
|
864
1165
|
}
|
|
865
|
-
var DataTableInstanceContext =
|
|
1166
|
+
var DataTableInstanceContext = React48.createContext(null);
|
|
866
1167
|
DataTableInstanceContext.displayName = "DataTableInstanceContext";
|
|
867
|
-
var DataTableMetaContext =
|
|
1168
|
+
var DataTableMetaContext = React48.createContext(null);
|
|
868
1169
|
DataTableMetaContext.displayName = "DataTableMetaContext";
|
|
869
|
-
var DataTableDensityContext =
|
|
1170
|
+
var DataTableDensityContext = React48.createContext(null);
|
|
870
1171
|
DataTableDensityContext.displayName = "DataTableDensityContext";
|
|
871
1172
|
function DataTableProvider({
|
|
872
1173
|
children,
|
|
@@ -875,11 +1176,11 @@ function DataTableProvider({
|
|
|
875
1176
|
density,
|
|
876
1177
|
setDensity
|
|
877
1178
|
}) {
|
|
878
|
-
const metaValue =
|
|
1179
|
+
const metaValue = React48.useMemo(
|
|
879
1180
|
() => meta,
|
|
880
1181
|
[meta.isLoading, meta.isEmpty, meta.selectedRowCount, meta.totalRows, meta.density]
|
|
881
1182
|
);
|
|
882
|
-
const densityValue =
|
|
1183
|
+
const densityValue = React48.useMemo(
|
|
883
1184
|
() => ({ density, setDensity }),
|
|
884
1185
|
[density, setDensity]
|
|
885
1186
|
);
|
|
@@ -887,7 +1188,7 @@ function DataTableProvider({
|
|
|
887
1188
|
return /* @__PURE__ */ jsx(DataTableInstanceContext.Provider, { value: tableValue, children: /* @__PURE__ */ jsx(DataTableMetaContext.Provider, { value: metaValue, children: /* @__PURE__ */ jsx(DataTableDensityContext.Provider, { value: densityValue, children }) }) });
|
|
888
1189
|
}
|
|
889
1190
|
function useDataTable() {
|
|
890
|
-
const context =
|
|
1191
|
+
const context = React48.useContext(DataTableInstanceContext);
|
|
891
1192
|
if (!context) {
|
|
892
1193
|
throw new Error(
|
|
893
1194
|
"useDataTable must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -896,7 +1197,7 @@ function useDataTable() {
|
|
|
896
1197
|
return context;
|
|
897
1198
|
}
|
|
898
1199
|
function useDataTableMeta() {
|
|
899
|
-
const context =
|
|
1200
|
+
const context = React48.useContext(DataTableMetaContext);
|
|
900
1201
|
if (!context) {
|
|
901
1202
|
throw new Error(
|
|
902
1203
|
"useDataTableMeta must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -914,12 +1215,12 @@ function useDataTableEmpty() {
|
|
|
914
1215
|
}
|
|
915
1216
|
function useDataTableSelection() {
|
|
916
1217
|
const table = useDataTable();
|
|
917
|
-
return
|
|
1218
|
+
return React48.useMemo(() => {
|
|
918
1219
|
return table.getSelectedRowModel().rows.map((row) => row.original);
|
|
919
1220
|
}, [table.getSelectedRowModel().rows]);
|
|
920
1221
|
}
|
|
921
1222
|
function useDataTableDensity() {
|
|
922
|
-
const context =
|
|
1223
|
+
const context = React48.useContext(DataTableDensityContext);
|
|
923
1224
|
if (!context) {
|
|
924
1225
|
throw new Error(
|
|
925
1226
|
"useDataTableDensity must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -930,7 +1231,7 @@ function useDataTableDensity() {
|
|
|
930
1231
|
function useDataTablePagination() {
|
|
931
1232
|
const table = useDataTable();
|
|
932
1233
|
const { pageIndex, pageSize } = table.getState().pagination;
|
|
933
|
-
return
|
|
1234
|
+
return React48.useMemo(() => {
|
|
934
1235
|
const pageCount = table.getPageCount();
|
|
935
1236
|
return {
|
|
936
1237
|
pageIndex,
|
|
@@ -950,7 +1251,7 @@ function useDataTablePagination() {
|
|
|
950
1251
|
function useDataTableSorting() {
|
|
951
1252
|
const table = useDataTable();
|
|
952
1253
|
const sorting = table.getState().sorting;
|
|
953
|
-
return
|
|
1254
|
+
return React48.useMemo(() => ({
|
|
954
1255
|
sorting,
|
|
955
1256
|
setSorting: table.setSorting,
|
|
956
1257
|
clearSorting: () => table.resetSorting(),
|
|
@@ -963,7 +1264,7 @@ function useDataTableSorting() {
|
|
|
963
1264
|
function useDataTableColumnVisibility() {
|
|
964
1265
|
const table = useDataTable();
|
|
965
1266
|
const columnVisibility = table.getState().columnVisibility;
|
|
966
|
-
return
|
|
1267
|
+
return React48.useMemo(() => ({
|
|
967
1268
|
columnVisibility,
|
|
968
1269
|
setColumnVisibility: table.setColumnVisibility,
|
|
969
1270
|
toggleColumn: (columnId) => {
|
|
@@ -1025,7 +1326,7 @@ var DENSITY_CONFIG = {
|
|
|
1025
1326
|
padding: "py-3 px-4"
|
|
1026
1327
|
}
|
|
1027
1328
|
};
|
|
1028
|
-
var Table =
|
|
1329
|
+
var Table = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
|
|
1029
1330
|
"table",
|
|
1030
1331
|
{
|
|
1031
1332
|
ref,
|
|
@@ -1034,9 +1335,9 @@ var Table = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1034
1335
|
}
|
|
1035
1336
|
) }));
|
|
1036
1337
|
Table.displayName = "Table";
|
|
1037
|
-
var TableHeader =
|
|
1338
|
+
var TableHeader = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1038
1339
|
TableHeader.displayName = "TableHeader";
|
|
1039
|
-
var TableBody =
|
|
1340
|
+
var TableBody = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1040
1341
|
"tbody",
|
|
1041
1342
|
{
|
|
1042
1343
|
ref,
|
|
@@ -1045,7 +1346,7 @@ var TableBody = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1045
1346
|
}
|
|
1046
1347
|
));
|
|
1047
1348
|
TableBody.displayName = "TableBody";
|
|
1048
|
-
var TableFooter =
|
|
1349
|
+
var TableFooter = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1049
1350
|
"tfoot",
|
|
1050
1351
|
{
|
|
1051
1352
|
ref,
|
|
@@ -1057,8 +1358,8 @@ var TableFooter = React36.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1057
1358
|
}
|
|
1058
1359
|
));
|
|
1059
1360
|
TableFooter.displayName = "TableFooter";
|
|
1060
|
-
var TableRow =
|
|
1061
|
-
|
|
1361
|
+
var TableRow = React48.memo(
|
|
1362
|
+
React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1062
1363
|
"tr",
|
|
1063
1364
|
{
|
|
1064
1365
|
ref,
|
|
@@ -1071,7 +1372,7 @@ var TableRow = React36.memo(
|
|
|
1071
1372
|
))
|
|
1072
1373
|
);
|
|
1073
1374
|
TableRow.displayName = "TableRow";
|
|
1074
|
-
var TableHead =
|
|
1375
|
+
var TableHead = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1075
1376
|
"th",
|
|
1076
1377
|
{
|
|
1077
1378
|
ref,
|
|
@@ -1083,8 +1384,8 @@ var TableHead = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1083
1384
|
}
|
|
1084
1385
|
));
|
|
1085
1386
|
TableHead.displayName = "TableHead";
|
|
1086
|
-
var TableCell =
|
|
1087
|
-
|
|
1387
|
+
var TableCell = React48.memo(
|
|
1388
|
+
React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1088
1389
|
"td",
|
|
1089
1390
|
{
|
|
1090
1391
|
ref,
|
|
@@ -1094,7 +1395,7 @@ var TableCell = React36.memo(
|
|
|
1094
1395
|
))
|
|
1095
1396
|
);
|
|
1096
1397
|
TableCell.displayName = "TableCell";
|
|
1097
|
-
var TableCaption =
|
|
1398
|
+
var TableCaption = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1098
1399
|
"caption",
|
|
1099
1400
|
{
|
|
1100
1401
|
ref,
|
|
@@ -1103,7 +1404,7 @@ var TableCaption = React36.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1103
1404
|
}
|
|
1104
1405
|
));
|
|
1105
1406
|
TableCaption.displayName = "TableCaption";
|
|
1106
|
-
var DataTableContent =
|
|
1407
|
+
var DataTableContent = React48.memo(function DataTableContent2({
|
|
1107
1408
|
stickyHeader = false,
|
|
1108
1409
|
stripedRows = false,
|
|
1109
1410
|
highlightOnHover = true,
|
|
@@ -1149,15 +1450,15 @@ var DataTableContent = React36.memo(function DataTableContent2({
|
|
|
1149
1450
|
] }) });
|
|
1150
1451
|
});
|
|
1151
1452
|
DataTableContent.displayName = "DataTable.Content";
|
|
1152
|
-
var DataTableToolbar =
|
|
1453
|
+
var DataTableToolbar = React48.memo(function DataTableToolbar2({
|
|
1153
1454
|
className,
|
|
1154
1455
|
children
|
|
1155
1456
|
}) {
|
|
1156
1457
|
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-between gap-2", className), children });
|
|
1157
1458
|
});
|
|
1158
1459
|
function useDebounce(value, delay = 300) {
|
|
1159
|
-
const [debouncedValue, setDebouncedValue] =
|
|
1160
|
-
|
|
1460
|
+
const [debouncedValue, setDebouncedValue] = React48.useState(value);
|
|
1461
|
+
React48.useEffect(() => {
|
|
1161
1462
|
const handler = setTimeout(() => {
|
|
1162
1463
|
setDebouncedValue(value);
|
|
1163
1464
|
}, delay);
|
|
@@ -1168,12 +1469,12 @@ function useDebounce(value, delay = 300) {
|
|
|
1168
1469
|
return debouncedValue;
|
|
1169
1470
|
}
|
|
1170
1471
|
function useDebouncedCallback(callback, delay = 300) {
|
|
1171
|
-
const callbackRef =
|
|
1172
|
-
const timeoutRef =
|
|
1173
|
-
|
|
1472
|
+
const callbackRef = React48.useRef(callback);
|
|
1473
|
+
const timeoutRef = React48.useRef(null);
|
|
1474
|
+
React48.useEffect(() => {
|
|
1174
1475
|
callbackRef.current = callback;
|
|
1175
1476
|
}, [callback]);
|
|
1176
|
-
return
|
|
1477
|
+
return React48.useCallback(
|
|
1177
1478
|
(...args) => {
|
|
1178
1479
|
if (timeoutRef.current) {
|
|
1179
1480
|
clearTimeout(timeoutRef.current);
|
|
@@ -1185,7 +1486,7 @@ function useDebouncedCallback(callback, delay = 300) {
|
|
|
1185
1486
|
[delay]
|
|
1186
1487
|
);
|
|
1187
1488
|
}
|
|
1188
|
-
var DataTableSearch =
|
|
1489
|
+
var DataTableSearch = React48.memo(function DataTableSearch2({
|
|
1189
1490
|
column,
|
|
1190
1491
|
placeholder = "Buscar...",
|
|
1191
1492
|
debounce = 300,
|
|
@@ -1194,17 +1495,17 @@ var DataTableSearch = React36.memo(function DataTableSearch2({
|
|
|
1194
1495
|
}) {
|
|
1195
1496
|
const table = useDataTableInstance();
|
|
1196
1497
|
const columnInstance = table.getColumn(column);
|
|
1197
|
-
const [value, setValue] =
|
|
1498
|
+
const [value, setValue] = React48.useState(
|
|
1198
1499
|
columnInstance?.getFilterValue() ?? ""
|
|
1199
1500
|
);
|
|
1200
1501
|
const debouncedValue = useDebounce(value, debounce);
|
|
1201
|
-
|
|
1502
|
+
React48.useEffect(() => {
|
|
1202
1503
|
columnInstance?.setFilterValue(debouncedValue);
|
|
1203
1504
|
if (onSearch) {
|
|
1204
1505
|
onSearch(debouncedValue);
|
|
1205
1506
|
}
|
|
1206
1507
|
}, [debouncedValue, columnInstance, onSearch]);
|
|
1207
|
-
|
|
1508
|
+
React48.useEffect(() => {
|
|
1208
1509
|
const filterValue = columnInstance?.getFilterValue() ?? "";
|
|
1209
1510
|
if (filterValue !== value) {
|
|
1210
1511
|
setValue(filterValue);
|
|
@@ -1220,15 +1521,15 @@ var DataTableSearch = React36.memo(function DataTableSearch2({
|
|
|
1220
1521
|
}
|
|
1221
1522
|
);
|
|
1222
1523
|
});
|
|
1223
|
-
var DataTableFilters =
|
|
1524
|
+
var DataTableFilters = React48.memo(function DataTableFilters2({
|
|
1224
1525
|
onChange,
|
|
1225
1526
|
className,
|
|
1226
1527
|
children
|
|
1227
1528
|
}) {
|
|
1228
1529
|
const table = useDataTableInstance();
|
|
1229
1530
|
const filters = table.getState().columnFilters;
|
|
1230
|
-
const filtersRef =
|
|
1231
|
-
|
|
1531
|
+
const filtersRef = React48.useRef(filters);
|
|
1532
|
+
React48.useEffect(() => {
|
|
1232
1533
|
if (onChange && JSON.stringify(filters) !== JSON.stringify(filtersRef.current)) {
|
|
1233
1534
|
filtersRef.current = filters;
|
|
1234
1535
|
onChange(filters);
|
|
@@ -1236,7 +1537,7 @@ var DataTableFilters = React36.memo(function DataTableFilters2({
|
|
|
1236
1537
|
}, [filters, onChange]);
|
|
1237
1538
|
return /* @__PURE__ */ jsx("div", { className: cn("flex gap-2", className), children });
|
|
1238
1539
|
});
|
|
1239
|
-
var DataTableFilter =
|
|
1540
|
+
var DataTableFilter = React48.memo(function DataTableFilter2({
|
|
1240
1541
|
column: columnId,
|
|
1241
1542
|
title,
|
|
1242
1543
|
options,
|
|
@@ -1246,7 +1547,7 @@ var DataTableFilter = React36.memo(function DataTableFilter2({
|
|
|
1246
1547
|
const column = table.getColumn(columnId);
|
|
1247
1548
|
const filterValue = column?.getFilterValue() ?? [];
|
|
1248
1549
|
const currentValue = filterValue.length > 0 ? filterValue[0] : "all";
|
|
1249
|
-
const handleValueChange =
|
|
1550
|
+
const handleValueChange = React48.useCallback(
|
|
1250
1551
|
(value) => {
|
|
1251
1552
|
if (value === "all") {
|
|
1252
1553
|
column?.setFilterValue(void 0);
|
|
@@ -1271,7 +1572,7 @@ var DataTableFilter = React36.memo(function DataTableFilter2({
|
|
|
1271
1572
|
}
|
|
1272
1573
|
);
|
|
1273
1574
|
});
|
|
1274
|
-
var DataTablePagination =
|
|
1575
|
+
var DataTablePagination = React48.memo(function DataTablePagination2({
|
|
1275
1576
|
mode = "client",
|
|
1276
1577
|
pageCount: externalPageCount,
|
|
1277
1578
|
pageSizes = [10, 20, 30, 50],
|
|
@@ -1298,7 +1599,7 @@ var DataTablePagination = React36.memo(function DataTablePagination2({
|
|
|
1298
1599
|
const pageCount = mode === "server" && externalPageCount !== void 0 ? externalPageCount : internalPageCount;
|
|
1299
1600
|
const canGoPrevious = pageIndex > 0;
|
|
1300
1601
|
const canGoNext = pageIndex < pageCount - 1;
|
|
1301
|
-
const handlePageSizeChange =
|
|
1602
|
+
const handlePageSizeChange = React48.useCallback(
|
|
1302
1603
|
(value) => {
|
|
1303
1604
|
setPageSize(Number(value));
|
|
1304
1605
|
},
|
|
@@ -1397,7 +1698,7 @@ var DataTablePagination = React36.memo(function DataTablePagination2({
|
|
|
1397
1698
|
);
|
|
1398
1699
|
});
|
|
1399
1700
|
DataTablePagination.displayName = "DataTable.Pagination";
|
|
1400
|
-
var DataTableEmptyState =
|
|
1701
|
+
var DataTableEmptyState = React48.memo(function DataTableEmptyState2({
|
|
1401
1702
|
message = "Nenhum resultado encontrado.",
|
|
1402
1703
|
description,
|
|
1403
1704
|
icon,
|
|
@@ -1521,8 +1822,8 @@ var iconSizeMap = {
|
|
|
1521
1822
|
md: "h-4 w-4",
|
|
1522
1823
|
lg: "h-5 w-5"
|
|
1523
1824
|
};
|
|
1524
|
-
var Checkbox =
|
|
1525
|
-
|
|
1825
|
+
var Checkbox = React48.memo(
|
|
1826
|
+
React48.forwardRef(({ className, variant, size = "md", ...props }, ref) => {
|
|
1526
1827
|
const iconSize = iconSizeMap[size || "md"];
|
|
1527
1828
|
return /* @__PURE__ */ jsx(
|
|
1528
1829
|
CheckboxPrimitive.Root,
|
|
@@ -1546,9 +1847,9 @@ function DataTableColumnVisibility({
|
|
|
1546
1847
|
className
|
|
1547
1848
|
}) {
|
|
1548
1849
|
const table = useDataTable();
|
|
1549
|
-
const [open, setOpen] =
|
|
1550
|
-
const dropdownRef =
|
|
1551
|
-
|
|
1850
|
+
const [open, setOpen] = React48.useState(false);
|
|
1851
|
+
const dropdownRef = React48.useRef(null);
|
|
1852
|
+
React48.useEffect(() => {
|
|
1552
1853
|
function handleClickOutside(event) {
|
|
1553
1854
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1554
1855
|
setOpen(false);
|
|
@@ -1627,9 +1928,9 @@ function DataTableDensityToggle({
|
|
|
1627
1928
|
className
|
|
1628
1929
|
}) {
|
|
1629
1930
|
const { density, setDensity } = useDataTableDensity();
|
|
1630
|
-
const [open, setOpen] =
|
|
1631
|
-
const dropdownRef =
|
|
1632
|
-
|
|
1931
|
+
const [open, setOpen] = React48.useState(false);
|
|
1932
|
+
const dropdownRef = React48.useRef(null);
|
|
1933
|
+
React48.useEffect(() => {
|
|
1633
1934
|
function handleClickOutside(event) {
|
|
1634
1935
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1635
1936
|
setOpen(false);
|
|
@@ -1808,9 +2109,9 @@ function DataTableExport({
|
|
|
1808
2109
|
className
|
|
1809
2110
|
}) {
|
|
1810
2111
|
const table = useDataTable();
|
|
1811
|
-
const [open, setOpen] =
|
|
1812
|
-
const dropdownRef =
|
|
1813
|
-
|
|
2112
|
+
const [open, setOpen] = React48.useState(false);
|
|
2113
|
+
const dropdownRef = React48.useRef(null);
|
|
2114
|
+
React48.useEffect(() => {
|
|
1814
2115
|
function handleClickOutside(event) {
|
|
1815
2116
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1816
2117
|
setOpen(false);
|
|
@@ -1821,7 +2122,7 @@ function DataTableExport({
|
|
|
1821
2122
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1822
2123
|
}
|
|
1823
2124
|
}, [open]);
|
|
1824
|
-
const handleExport =
|
|
2125
|
+
const handleExport = React48.useCallback((format) => {
|
|
1825
2126
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
1826
2127
|
const rows = table.getFilteredRowModel().rows;
|
|
1827
2128
|
const headers = [];
|
|
@@ -1924,7 +2225,7 @@ function DataTableTabs({
|
|
|
1924
2225
|
onValueChange,
|
|
1925
2226
|
className
|
|
1926
2227
|
}) {
|
|
1927
|
-
const [internalValue, setInternalValue] =
|
|
2228
|
+
const [internalValue, setInternalValue] = React48.useState(defaultValue ?? tabs[0]?.value);
|
|
1928
2229
|
const activeValue = value ?? internalValue;
|
|
1929
2230
|
const handleTabClick = (tabValue) => {
|
|
1930
2231
|
if (value === void 0) {
|
|
@@ -2011,8 +2312,8 @@ var Dialog = DialogPrimitive.Root;
|
|
|
2011
2312
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
2012
2313
|
var DialogPortal = DialogPrimitive.Portal;
|
|
2013
2314
|
var DialogClose = DialogPrimitive.Close;
|
|
2014
|
-
var DialogOverlay =
|
|
2015
|
-
|
|
2315
|
+
var DialogOverlay = React48.memo(
|
|
2316
|
+
React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2016
2317
|
DialogPrimitive.Overlay,
|
|
2017
2318
|
{
|
|
2018
2319
|
ref,
|
|
@@ -2059,8 +2360,8 @@ var dialogContentVariants = cva(
|
|
|
2059
2360
|
}
|
|
2060
2361
|
}
|
|
2061
2362
|
);
|
|
2062
|
-
var DialogContent =
|
|
2063
|
-
|
|
2363
|
+
var DialogContent = React48.memo(
|
|
2364
|
+
React48.forwardRef(({ className, children, showCloseButton = true, size, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
2064
2365
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
2065
2366
|
/* @__PURE__ */ jsxs(
|
|
2066
2367
|
DialogPrimitive.Content,
|
|
@@ -2080,7 +2381,7 @@ var DialogContent = React36.memo(
|
|
|
2080
2381
|
] }))
|
|
2081
2382
|
);
|
|
2082
2383
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
2083
|
-
var DialogHeader =
|
|
2384
|
+
var DialogHeader = React48.memo(
|
|
2084
2385
|
({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
2085
2386
|
"div",
|
|
2086
2387
|
{
|
|
@@ -2093,7 +2394,7 @@ var DialogHeader = React36.memo(
|
|
|
2093
2394
|
)
|
|
2094
2395
|
);
|
|
2095
2396
|
DialogHeader.displayName = "DialogHeader";
|
|
2096
|
-
var DialogFooter =
|
|
2397
|
+
var DialogFooter = React48.memo(
|
|
2097
2398
|
({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
2098
2399
|
"div",
|
|
2099
2400
|
{
|
|
@@ -2106,8 +2407,8 @@ var DialogFooter = React36.memo(
|
|
|
2106
2407
|
)
|
|
2107
2408
|
);
|
|
2108
2409
|
DialogFooter.displayName = "DialogFooter";
|
|
2109
|
-
var DialogTitle =
|
|
2110
|
-
|
|
2410
|
+
var DialogTitle = React48.memo(
|
|
2411
|
+
React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2111
2412
|
DialogPrimitive.Title,
|
|
2112
2413
|
{
|
|
2113
2414
|
ref,
|
|
@@ -2120,8 +2421,8 @@ var DialogTitle = React36.memo(
|
|
|
2120
2421
|
))
|
|
2121
2422
|
);
|
|
2122
2423
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2123
|
-
var DialogDescription =
|
|
2124
|
-
|
|
2424
|
+
var DialogDescription = React48.memo(
|
|
2425
|
+
React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2125
2426
|
DialogPrimitive.Description,
|
|
2126
2427
|
{
|
|
2127
2428
|
ref,
|
|
@@ -2131,7 +2432,7 @@ var DialogDescription = React36.memo(
|
|
|
2131
2432
|
))
|
|
2132
2433
|
);
|
|
2133
2434
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
2134
|
-
var DialogBody =
|
|
2435
|
+
var DialogBody = React48.memo(
|
|
2135
2436
|
({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-y-auto py-2", className), ...props })
|
|
2136
2437
|
);
|
|
2137
2438
|
DialogBody.displayName = "DialogBody";
|
|
@@ -2162,7 +2463,7 @@ var COLOR_MAP = {
|
|
|
2162
2463
|
accent: "border-accent",
|
|
2163
2464
|
muted: "border-muted"
|
|
2164
2465
|
};
|
|
2165
|
-
var RippleRing =
|
|
2466
|
+
var RippleRing = React48.memo(({ size, color, opacity }) => {
|
|
2166
2467
|
const borderColorClass = COLOR_MAP[color] || COLOR_MAP.primary;
|
|
2167
2468
|
return /* @__PURE__ */ jsx(
|
|
2168
2469
|
"div",
|
|
@@ -2181,7 +2482,7 @@ var RippleRing = React36.memo(({ size, color, opacity }) => {
|
|
|
2181
2482
|
);
|
|
2182
2483
|
});
|
|
2183
2484
|
RippleRing.displayName = "RippleRing";
|
|
2184
|
-
var RippleEffect =
|
|
2485
|
+
var RippleEffect = React48.memo(
|
|
2185
2486
|
({
|
|
2186
2487
|
size = "md",
|
|
2187
2488
|
color = "primary",
|
|
@@ -2193,7 +2494,7 @@ var RippleEffect = React36.memo(
|
|
|
2193
2494
|
const { base, increment } = SIZE_CONFIG[size];
|
|
2194
2495
|
const opacities = INTENSITY_CONFIG[intensity];
|
|
2195
2496
|
const positionClasses = POSITION_CONFIG[position];
|
|
2196
|
-
const rippleRings =
|
|
2497
|
+
const rippleRings = React48.useMemo(
|
|
2197
2498
|
() => Array.from({ length: rings }).map((_, index) => {
|
|
2198
2499
|
const ringSize = base + increment * (rings - index - 1);
|
|
2199
2500
|
const opacity = opacities[index] || opacities[opacities.length - 1];
|
|
@@ -2223,7 +2524,7 @@ var RippleEffect = React36.memo(
|
|
|
2223
2524
|
}
|
|
2224
2525
|
);
|
|
2225
2526
|
RippleEffect.displayName = "RippleEffect";
|
|
2226
|
-
var RippleWrapper =
|
|
2527
|
+
var RippleWrapper = React48.memo(
|
|
2227
2528
|
({ children, rippleProps, className }) => {
|
|
2228
2529
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
2229
2530
|
rippleProps && /* @__PURE__ */ jsx(RippleEffect, { ...rippleProps }),
|
|
@@ -2232,7 +2533,7 @@ var RippleWrapper = React36.memo(
|
|
|
2232
2533
|
}
|
|
2233
2534
|
);
|
|
2234
2535
|
RippleWrapper.displayName = "RippleWrapper";
|
|
2235
|
-
var RippleBackground =
|
|
2536
|
+
var RippleBackground = React48.memo(
|
|
2236
2537
|
({ containerClassName, ...rippleProps }) => {
|
|
2237
2538
|
return /* @__PURE__ */ jsx(
|
|
2238
2539
|
"div",
|
|
@@ -2298,7 +2599,7 @@ var statusIndicatorVariants = cva(
|
|
|
2298
2599
|
}
|
|
2299
2600
|
}
|
|
2300
2601
|
);
|
|
2301
|
-
var DialogWrapper =
|
|
2602
|
+
var DialogWrapper = React48.memo(
|
|
2302
2603
|
({
|
|
2303
2604
|
children,
|
|
2304
2605
|
className,
|
|
@@ -2311,7 +2612,7 @@ var DialogWrapper = React36.memo(
|
|
|
2311
2612
|
rippleProps,
|
|
2312
2613
|
...props
|
|
2313
2614
|
}) => {
|
|
2314
|
-
const defaultRippleProps =
|
|
2615
|
+
const defaultRippleProps = React48.useMemo(
|
|
2315
2616
|
() => ({
|
|
2316
2617
|
size: size === "sm" ? "md" : size === "lg" ? "xl" : "lg",
|
|
2317
2618
|
color: variant === "secondary" ? "secondary" : variant === "accent" ? "accent" : "primary",
|
|
@@ -2321,7 +2622,7 @@ var DialogWrapper = React36.memo(
|
|
|
2321
2622
|
}),
|
|
2322
2623
|
[size, variant, rippleProps]
|
|
2323
2624
|
);
|
|
2324
|
-
const backgroundRippleProps =
|
|
2625
|
+
const backgroundRippleProps = React48.useMemo(
|
|
2325
2626
|
() => ({
|
|
2326
2627
|
position: "top-right",
|
|
2327
2628
|
size: "xl",
|
|
@@ -2424,7 +2725,7 @@ var Toaster = ({ ...props }) => {
|
|
|
2424
2725
|
}
|
|
2425
2726
|
);
|
|
2426
2727
|
};
|
|
2427
|
-
var CustomToast =
|
|
2728
|
+
var CustomToast = React48.memo(
|
|
2428
2729
|
({ title, description, variant = "default", action, onClose }) => {
|
|
2429
2730
|
const variantStyles = toastVariants[variant];
|
|
2430
2731
|
return /* @__PURE__ */ jsxs(
|
|
@@ -2560,8 +2861,8 @@ var thumbVariants = cva(
|
|
|
2560
2861
|
}
|
|
2561
2862
|
}
|
|
2562
2863
|
);
|
|
2563
|
-
var Switch =
|
|
2564
|
-
|
|
2864
|
+
var Switch = React48.memo(
|
|
2865
|
+
React48.forwardRef(({ className, variant, size = "md", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2565
2866
|
SwitchPrimitives.Root,
|
|
2566
2867
|
{
|
|
2567
2868
|
className: cn(switchVariants({ variant, size, className })),
|
|
@@ -2592,8 +2893,8 @@ var textareaVariants = cva(
|
|
|
2592
2893
|
}
|
|
2593
2894
|
}
|
|
2594
2895
|
);
|
|
2595
|
-
var Textarea =
|
|
2596
|
-
|
|
2896
|
+
var Textarea = React48.memo(
|
|
2897
|
+
React48.forwardRef(
|
|
2597
2898
|
({
|
|
2598
2899
|
className,
|
|
2599
2900
|
variant,
|
|
@@ -2608,12 +2909,12 @@ var Textarea = React36.memo(
|
|
|
2608
2909
|
onChange,
|
|
2609
2910
|
...props
|
|
2610
2911
|
}, ref) => {
|
|
2611
|
-
const textareaRef =
|
|
2612
|
-
|
|
2613
|
-
const focusTextarea =
|
|
2912
|
+
const textareaRef = React48.useRef(null);
|
|
2913
|
+
React48.useImperativeHandle(ref, () => textareaRef.current, []);
|
|
2914
|
+
const focusTextarea = React48.useCallback(() => {
|
|
2614
2915
|
textareaRef.current?.focus();
|
|
2615
2916
|
}, []);
|
|
2616
|
-
const handleChange =
|
|
2917
|
+
const handleChange = React48.useCallback(
|
|
2617
2918
|
(e) => {
|
|
2618
2919
|
if (autoResize && textareaRef.current) {
|
|
2619
2920
|
textareaRef.current.style.height = "auto";
|
|
@@ -2623,7 +2924,7 @@ var Textarea = React36.memo(
|
|
|
2623
2924
|
},
|
|
2624
2925
|
[autoResize, onChange]
|
|
2625
2926
|
);
|
|
2626
|
-
|
|
2927
|
+
React48.useEffect(() => {
|
|
2627
2928
|
if (autoResize && textareaRef.current) {
|
|
2628
2929
|
textareaRef.current.style.height = "auto";
|
|
2629
2930
|
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
|
|
@@ -2674,9 +2975,9 @@ var Textarea = React36.memo(
|
|
|
2674
2975
|
)
|
|
2675
2976
|
);
|
|
2676
2977
|
Textarea.displayName = "Textarea";
|
|
2677
|
-
var FormContext =
|
|
2978
|
+
var FormContext = React48.createContext(null);
|
|
2678
2979
|
function useFormContext() {
|
|
2679
|
-
const context =
|
|
2980
|
+
const context = React48.useContext(FormContext);
|
|
2680
2981
|
if (!context) {
|
|
2681
2982
|
throw new Error("useFormContext must be used within a Form provider");
|
|
2682
2983
|
}
|
|
@@ -2686,27 +2987,27 @@ function FormProvider({
|
|
|
2686
2987
|
form,
|
|
2687
2988
|
children
|
|
2688
2989
|
}) {
|
|
2689
|
-
const value =
|
|
2990
|
+
const value = React48.useMemo(() => ({ form }), [form]);
|
|
2690
2991
|
return /* @__PURE__ */ jsx(FormContext.Provider, { value, children });
|
|
2691
2992
|
}
|
|
2692
|
-
var FormFieldContext =
|
|
2993
|
+
var FormFieldContext = React48.createContext(null);
|
|
2693
2994
|
function useFormFieldContext() {
|
|
2694
|
-
const context =
|
|
2995
|
+
const context = React48.useContext(FormFieldContext);
|
|
2695
2996
|
if (!context) {
|
|
2696
2997
|
throw new Error("useFormFieldContext must be used within a Form.Field");
|
|
2697
2998
|
}
|
|
2698
2999
|
return context;
|
|
2699
3000
|
}
|
|
2700
3001
|
function useFormFieldContextOptional() {
|
|
2701
|
-
return
|
|
3002
|
+
return React48.useContext(FormFieldContext);
|
|
2702
3003
|
}
|
|
2703
3004
|
function FormFieldProvider({ name, children }) {
|
|
2704
3005
|
const form = useFormContext();
|
|
2705
|
-
const id =
|
|
3006
|
+
const id = React48.useId();
|
|
2706
3007
|
const fieldState = form.getFieldState(name, form.formState);
|
|
2707
3008
|
const error = fieldState.error?.message;
|
|
2708
3009
|
const isRequired = false;
|
|
2709
|
-
const value =
|
|
3010
|
+
const value = React48.useMemo(
|
|
2710
3011
|
() => ({
|
|
2711
3012
|
name,
|
|
2712
3013
|
id,
|
|
@@ -2814,7 +3115,7 @@ function FormInput({
|
|
|
2814
3115
|
const form = useFormContext();
|
|
2815
3116
|
const fieldState = form.getFieldState(name, form.formState);
|
|
2816
3117
|
const error = fieldState.error?.message;
|
|
2817
|
-
const getInputType =
|
|
3118
|
+
const getInputType = React48.useCallback(() => {
|
|
2818
3119
|
if (["money", "percent", "phone", "cpf", "cnpj", "cep"].includes(mask || "")) {
|
|
2819
3120
|
return "tel";
|
|
2820
3121
|
}
|
|
@@ -3010,7 +3311,7 @@ function FormCheckbox({
|
|
|
3010
3311
|
const form = useFormContext();
|
|
3011
3312
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3012
3313
|
const error = fieldState.error?.message;
|
|
3013
|
-
const id =
|
|
3314
|
+
const id = React48.useId();
|
|
3014
3315
|
return /* @__PURE__ */ jsx(FormFieldProvider, { name, children: /* @__PURE__ */ jsx(
|
|
3015
3316
|
Controller,
|
|
3016
3317
|
{
|
|
@@ -3065,7 +3366,7 @@ function FormSwitch({
|
|
|
3065
3366
|
const form = useFormContext();
|
|
3066
3367
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3067
3368
|
const error = fieldState.error?.message;
|
|
3068
|
-
const id =
|
|
3369
|
+
const id = React48.useId();
|
|
3069
3370
|
return /* @__PURE__ */ jsx(FormFieldProvider, { name, children: /* @__PURE__ */ jsx(
|
|
3070
3371
|
Controller,
|
|
3071
3372
|
{
|
|
@@ -3203,7 +3504,7 @@ function FormRadioGroup({
|
|
|
3203
3504
|
) });
|
|
3204
3505
|
}
|
|
3205
3506
|
FormRadioGroup.displayName = "Form.RadioGroup";
|
|
3206
|
-
var FormLabel =
|
|
3507
|
+
var FormLabel = React48.forwardRef(
|
|
3207
3508
|
({ className, required, children, ...props }, ref) => {
|
|
3208
3509
|
const fieldContext = useFormFieldContextOptional();
|
|
3209
3510
|
return /* @__PURE__ */ jsxs(
|
|
@@ -3226,7 +3527,7 @@ var FormLabel = React36.forwardRef(
|
|
|
3226
3527
|
}
|
|
3227
3528
|
);
|
|
3228
3529
|
FormLabel.displayName = "Form.Label";
|
|
3229
|
-
var FormDescription =
|
|
3530
|
+
var FormDescription = React48.forwardRef(({ className, ...props }, ref) => {
|
|
3230
3531
|
const fieldContext = useFormFieldContextOptional();
|
|
3231
3532
|
if (fieldContext?.error) {
|
|
3232
3533
|
return null;
|
|
@@ -3241,7 +3542,7 @@ var FormDescription = React36.forwardRef(({ className, ...props }, ref) => {
|
|
|
3241
3542
|
);
|
|
3242
3543
|
});
|
|
3243
3544
|
FormDescription.displayName = "Form.Description";
|
|
3244
|
-
var FormError =
|
|
3545
|
+
var FormError = React48.forwardRef(
|
|
3245
3546
|
({ className, message, children, ...props }, ref) => {
|
|
3246
3547
|
const fieldContext = useFormFieldContextOptional();
|
|
3247
3548
|
const errorMessage = message ?? fieldContext?.error;
|
|
@@ -3260,7 +3561,7 @@ var FormError = React36.forwardRef(
|
|
|
3260
3561
|
}
|
|
3261
3562
|
);
|
|
3262
3563
|
FormError.displayName = "Form.Error";
|
|
3263
|
-
var FormFieldWrapper =
|
|
3564
|
+
var FormFieldWrapper = React48.forwardRef(({ className, label, description, required, error, children, ...props }, ref) => {
|
|
3264
3565
|
return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-1", className), ...props, children: [
|
|
3265
3566
|
label && /* @__PURE__ */ jsx(FormLabel, { required, children: label }),
|
|
3266
3567
|
children,
|
|
@@ -3303,14 +3604,192 @@ var Form = Object.assign(FormRoot, {
|
|
|
3303
3604
|
FieldWrapper: FormFieldWrapper,
|
|
3304
3605
|
Field: FormFieldProvider
|
|
3305
3606
|
});
|
|
3306
|
-
var
|
|
3607
|
+
var Avatar = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3608
|
+
AvatarPrimitive.Root,
|
|
3609
|
+
{
|
|
3610
|
+
ref,
|
|
3611
|
+
className: cn(
|
|
3612
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
3613
|
+
className
|
|
3614
|
+
),
|
|
3615
|
+
...props
|
|
3616
|
+
}
|
|
3617
|
+
));
|
|
3618
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
3619
|
+
var AvatarImage = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3620
|
+
AvatarPrimitive.Image,
|
|
3621
|
+
{
|
|
3622
|
+
ref,
|
|
3623
|
+
className: cn("aspect-square h-full w-full", className),
|
|
3624
|
+
...props
|
|
3625
|
+
}
|
|
3626
|
+
));
|
|
3627
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
3628
|
+
var AvatarFallback = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3629
|
+
AvatarPrimitive.Fallback,
|
|
3630
|
+
{
|
|
3631
|
+
ref,
|
|
3632
|
+
className: cn(
|
|
3633
|
+
"flex h-full w-full items-center justify-center rounded-full bg-primary/10 text-primary font-semibold",
|
|
3634
|
+
className
|
|
3635
|
+
),
|
|
3636
|
+
...props
|
|
3637
|
+
}
|
|
3638
|
+
));
|
|
3639
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
3640
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
3641
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
3642
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
3643
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
3644
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
3645
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
3646
|
+
var DropdownMenuSubTrigger = React48.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3647
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
3648
|
+
{
|
|
3649
|
+
ref,
|
|
3650
|
+
className: cn(
|
|
3651
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
3652
|
+
inset && "pl-8",
|
|
3653
|
+
className
|
|
3654
|
+
),
|
|
3655
|
+
...props,
|
|
3656
|
+
children: [
|
|
3657
|
+
children,
|
|
3658
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
3659
|
+
]
|
|
3660
|
+
}
|
|
3661
|
+
));
|
|
3662
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3663
|
+
var DropdownMenuSubContent = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3664
|
+
DropdownMenuPrimitive.SubContent,
|
|
3665
|
+
{
|
|
3666
|
+
ref,
|
|
3667
|
+
className: cn(
|
|
3668
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
|
|
3669
|
+
className
|
|
3670
|
+
),
|
|
3671
|
+
...props
|
|
3672
|
+
}
|
|
3673
|
+
));
|
|
3674
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3675
|
+
var DropdownMenuContent = React48.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
3676
|
+
DropdownMenuPrimitive.Content,
|
|
3677
|
+
{
|
|
3678
|
+
ref,
|
|
3679
|
+
sideOffset,
|
|
3680
|
+
className: cn(
|
|
3681
|
+
"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",
|
|
3682
|
+
className
|
|
3683
|
+
),
|
|
3684
|
+
...props
|
|
3685
|
+
}
|
|
3686
|
+
) }));
|
|
3687
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3688
|
+
var DropdownMenuItem = React48.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3689
|
+
DropdownMenuPrimitive.Item,
|
|
3690
|
+
{
|
|
3691
|
+
ref,
|
|
3692
|
+
className: cn(
|
|
3693
|
+
"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",
|
|
3694
|
+
inset && "pl-8",
|
|
3695
|
+
className
|
|
3696
|
+
),
|
|
3697
|
+
...props
|
|
3698
|
+
}
|
|
3699
|
+
));
|
|
3700
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3701
|
+
var DropdownMenuCheckboxItem = React48.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3702
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
3703
|
+
{
|
|
3704
|
+
ref,
|
|
3705
|
+
className: cn(
|
|
3706
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3707
|
+
className
|
|
3708
|
+
),
|
|
3709
|
+
checked,
|
|
3710
|
+
...props,
|
|
3711
|
+
children: [
|
|
3712
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
3713
|
+
children
|
|
3714
|
+
]
|
|
3715
|
+
}
|
|
3716
|
+
));
|
|
3717
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3718
|
+
var DropdownMenuRadioItem = React48.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3719
|
+
DropdownMenuPrimitive.RadioItem,
|
|
3720
|
+
{
|
|
3721
|
+
ref,
|
|
3722
|
+
className: cn(
|
|
3723
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3724
|
+
className
|
|
3725
|
+
),
|
|
3726
|
+
...props,
|
|
3727
|
+
children: [
|
|
3728
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
3729
|
+
children
|
|
3730
|
+
]
|
|
3731
|
+
}
|
|
3732
|
+
));
|
|
3733
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3734
|
+
var DropdownMenuLabel = React48.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3735
|
+
DropdownMenuPrimitive.Label,
|
|
3736
|
+
{
|
|
3737
|
+
ref,
|
|
3738
|
+
className: cn(
|
|
3739
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
3740
|
+
inset && "pl-8",
|
|
3741
|
+
className
|
|
3742
|
+
),
|
|
3743
|
+
...props
|
|
3744
|
+
}
|
|
3745
|
+
));
|
|
3746
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3747
|
+
var DropdownMenuSeparator = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3748
|
+
DropdownMenuPrimitive.Separator,
|
|
3749
|
+
{
|
|
3750
|
+
ref,
|
|
3751
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
3752
|
+
...props
|
|
3753
|
+
}
|
|
3754
|
+
));
|
|
3755
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
3756
|
+
var DropdownMenuShortcut = ({
|
|
3757
|
+
className,
|
|
3758
|
+
...props
|
|
3759
|
+
}) => {
|
|
3760
|
+
return /* @__PURE__ */ jsx(
|
|
3761
|
+
"span",
|
|
3762
|
+
{
|
|
3763
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
3764
|
+
...props
|
|
3765
|
+
}
|
|
3766
|
+
);
|
|
3767
|
+
};
|
|
3768
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3769
|
+
var Popover = PopoverPrimitive.Root;
|
|
3770
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
3771
|
+
var PopoverContent = React48.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
3772
|
+
PopoverPrimitive.Content,
|
|
3773
|
+
{
|
|
3774
|
+
ref,
|
|
3775
|
+
align,
|
|
3776
|
+
sideOffset,
|
|
3777
|
+
className: cn(
|
|
3778
|
+
"z-50 w-auto rounded-md border bg-popover p-4 text-popover-foreground shadow-lg 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",
|
|
3779
|
+
className
|
|
3780
|
+
),
|
|
3781
|
+
...props
|
|
3782
|
+
}
|
|
3783
|
+
) }));
|
|
3784
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
3785
|
+
var AuthLayoutContext = React48.createContext({
|
|
3307
3786
|
imagePosition: "left"
|
|
3308
3787
|
});
|
|
3309
3788
|
function AuthLayoutRoot({ children, className }) {
|
|
3310
|
-
const [imagePosition, setImagePosition] =
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
if (
|
|
3789
|
+
const [imagePosition, setImagePosition] = React48.useState("left");
|
|
3790
|
+
React48.useEffect(() => {
|
|
3791
|
+
React48.Children.forEach(children, (child) => {
|
|
3792
|
+
if (React48.isValidElement(child) && child.type === AuthLayoutImage) {
|
|
3314
3793
|
setImagePosition(child.props.position || "left");
|
|
3315
3794
|
}
|
|
3316
3795
|
});
|
|
@@ -3332,31 +3811,89 @@ function AuthLayoutImage({
|
|
|
3332
3811
|
alt,
|
|
3333
3812
|
position: _position = "left",
|
|
3334
3813
|
className,
|
|
3335
|
-
priority = true
|
|
3814
|
+
priority = true,
|
|
3815
|
+
showPattern = false
|
|
3336
3816
|
}) {
|
|
3337
|
-
return /* @__PURE__ */
|
|
3817
|
+
return /* @__PURE__ */ jsxs(
|
|
3338
3818
|
"div",
|
|
3339
3819
|
{
|
|
3340
3820
|
className: cn(
|
|
3341
|
-
"hidden xl:block relative w-full xl:w-3/6 h-64 xl:h-screen overflow-hidden",
|
|
3821
|
+
"hidden xl:block relative w-full xl:w-3/6 h-64 xl:h-screen overflow-hidden bg-muted",
|
|
3342
3822
|
className
|
|
3343
3823
|
),
|
|
3344
|
-
children:
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3824
|
+
children: [
|
|
3825
|
+
src ? /* @__PURE__ */ jsx(
|
|
3826
|
+
"img",
|
|
3827
|
+
{
|
|
3828
|
+
src,
|
|
3829
|
+
alt,
|
|
3830
|
+
className: "absolute inset-0 w-full h-full object-cover object-top",
|
|
3831
|
+
loading: priority ? "eager" : "lazy"
|
|
3832
|
+
}
|
|
3833
|
+
) : null,
|
|
3834
|
+
showPattern && /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 flex items-center justify-center", children: [
|
|
3835
|
+
/* @__PURE__ */ jsxs(
|
|
3836
|
+
"svg",
|
|
3837
|
+
{
|
|
3838
|
+
className: "absolute inset-0 w-full h-full opacity-10",
|
|
3839
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3840
|
+
children: [
|
|
3841
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
3842
|
+
"pattern",
|
|
3843
|
+
{
|
|
3844
|
+
id: "auth-grid",
|
|
3845
|
+
width: "40",
|
|
3846
|
+
height: "40",
|
|
3847
|
+
patternUnits: "userSpaceOnUse",
|
|
3848
|
+
children: /* @__PURE__ */ jsx(
|
|
3849
|
+
"path",
|
|
3850
|
+
{
|
|
3851
|
+
d: "M 40 0 L 0 0 0 40",
|
|
3852
|
+
fill: "none",
|
|
3853
|
+
stroke: "currentColor",
|
|
3854
|
+
strokeWidth: "0.5"
|
|
3855
|
+
}
|
|
3856
|
+
)
|
|
3857
|
+
}
|
|
3858
|
+
) }),
|
|
3859
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#auth-grid)" })
|
|
3860
|
+
]
|
|
3861
|
+
}
|
|
3862
|
+
),
|
|
3863
|
+
/* @__PURE__ */ jsxs("div", { className: "relative z-10", children: [
|
|
3864
|
+
/* @__PURE__ */ jsx("div", { className: "w-64 h-64 rounded-full border border-muted-foreground/20" }),
|
|
3865
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-24 h-24 rounded-full border border-muted-foreground/30 flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
3866
|
+
"svg",
|
|
3867
|
+
{
|
|
3868
|
+
className: "w-10 h-10 text-muted-foreground/40",
|
|
3869
|
+
fill: "none",
|
|
3870
|
+
stroke: "currentColor",
|
|
3871
|
+
viewBox: "0 0 24 24",
|
|
3872
|
+
children: /* @__PURE__ */ jsx(
|
|
3873
|
+
"path",
|
|
3874
|
+
{
|
|
3875
|
+
strokeLinecap: "round",
|
|
3876
|
+
strokeLinejoin: "round",
|
|
3877
|
+
strokeWidth: 1,
|
|
3878
|
+
d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"
|
|
3879
|
+
}
|
|
3880
|
+
)
|
|
3881
|
+
}
|
|
3882
|
+
) }),
|
|
3883
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-1/2 left-full ml-4 w-32 h-px bg-gradient-to-r from-muted-foreground/20 to-transparent" }),
|
|
3884
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-1/2 right-full mr-4 w-32 h-px bg-gradient-to-l from-muted-foreground/20 to-transparent" }),
|
|
3885
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 mt-4 w-px h-32 bg-gradient-to-b from-muted-foreground/20 to-transparent" }),
|
|
3886
|
+
/* @__PURE__ */ jsx("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-4 w-px h-32 bg-gradient-to-t from-muted-foreground/20 to-transparent" })
|
|
3887
|
+
] })
|
|
3888
|
+
] })
|
|
3889
|
+
]
|
|
3890
|
+
}
|
|
3891
|
+
);
|
|
3892
|
+
}
|
|
3893
|
+
function AuthLayoutContent({
|
|
3894
|
+
children,
|
|
3895
|
+
className,
|
|
3896
|
+
maxWidth = "md"
|
|
3360
3897
|
}) {
|
|
3361
3898
|
const maxWidthClasses = {
|
|
3362
3899
|
sm: "max-w-sm",
|
|
@@ -3367,7 +3904,7 @@ function AuthLayoutContent({
|
|
|
3367
3904
|
"div",
|
|
3368
3905
|
{
|
|
3369
3906
|
className: cn(
|
|
3370
|
-
"w-full lg:w-3/6 flex items-center justify-center p-6
|
|
3907
|
+
"relative w-full lg:w-3/6 flex items-center justify-center p-6 lg:p-12 bg-background",
|
|
3371
3908
|
className
|
|
3372
3909
|
),
|
|
3373
3910
|
children: /* @__PURE__ */ jsx("div", { className: cn("w-full space-y-8", maxWidthClasses[maxWidth]), children })
|
|
@@ -3380,8 +3917,15 @@ function AuthLayoutHeader({
|
|
|
3380
3917
|
logo,
|
|
3381
3918
|
title,
|
|
3382
3919
|
description,
|
|
3383
|
-
centered = true
|
|
3920
|
+
centered = true,
|
|
3921
|
+
position = "top-right"
|
|
3384
3922
|
}) {
|
|
3923
|
+
if (position === "top-left" && logo) {
|
|
3924
|
+
return /* @__PURE__ */ jsx("div", { className: cn("absolute top-6 left-6 lg:top-8 lg:left-8", className), children: logo });
|
|
3925
|
+
}
|
|
3926
|
+
if (position === "top-right" && logo) {
|
|
3927
|
+
return /* @__PURE__ */ jsx("div", { className: cn("absolute top-6 right-6 lg:top-8 lg:right-8", className), children: logo });
|
|
3928
|
+
}
|
|
3385
3929
|
if (children) {
|
|
3386
3930
|
return /* @__PURE__ */ jsx("div", { className: cn("space-y-2", centered && "text-center", className), children });
|
|
3387
3931
|
}
|
|
@@ -3443,7 +3987,7 @@ var AuthLayout = Object.assign(AuthLayoutRoot, {
|
|
|
3443
3987
|
Link: AuthLayoutLink,
|
|
3444
3988
|
Divider: AuthLayoutDivider
|
|
3445
3989
|
});
|
|
3446
|
-
var TabsContext =
|
|
3990
|
+
var TabsContext = React48.createContext(null);
|
|
3447
3991
|
function SelectionLayoutRoot({ children, className }) {
|
|
3448
3992
|
return /* @__PURE__ */ jsx("div", { className: cn("min-h-screen bg-muted/30 flex flex-col lg:flex-row", className), children });
|
|
3449
3993
|
}
|
|
@@ -3554,7 +4098,7 @@ function SelectionLayoutTab({
|
|
|
3554
4098
|
badge,
|
|
3555
4099
|
className
|
|
3556
4100
|
}) {
|
|
3557
|
-
const context =
|
|
4101
|
+
const context = React48.useContext(TabsContext);
|
|
3558
4102
|
if (!context) {
|
|
3559
4103
|
throw new Error("SelectionLayout.Tab must be used within SelectionLayout.Tabs");
|
|
3560
4104
|
}
|
|
@@ -3699,17 +4243,17 @@ var SelectionLayout = Object.assign(SelectionLayoutRoot, {
|
|
|
3699
4243
|
Card: SelectionLayoutCard,
|
|
3700
4244
|
Empty: SelectionLayoutEmpty
|
|
3701
4245
|
});
|
|
3702
|
-
var DashboardLayoutContext =
|
|
4246
|
+
var DashboardLayoutContext = React48.createContext(null);
|
|
3703
4247
|
function useDashboardLayout() {
|
|
3704
|
-
const context =
|
|
4248
|
+
const context = React48.useContext(DashboardLayoutContext);
|
|
3705
4249
|
if (!context) {
|
|
3706
4250
|
throw new Error("useDashboardLayout must be used within DashboardLayout");
|
|
3707
4251
|
}
|
|
3708
4252
|
return context;
|
|
3709
4253
|
}
|
|
3710
4254
|
function useMediaQuery(query) {
|
|
3711
|
-
const [matches, setMatches] =
|
|
3712
|
-
|
|
4255
|
+
const [matches, setMatches] = React48.useState(false);
|
|
4256
|
+
React48.useEffect(() => {
|
|
3713
4257
|
const media = window.matchMedia(query);
|
|
3714
4258
|
if (media.matches !== matches) {
|
|
3715
4259
|
setMatches(media.matches);
|
|
@@ -3726,11 +4270,11 @@ function DashboardLayoutRoot({
|
|
|
3726
4270
|
defaultExpanded = false,
|
|
3727
4271
|
defaultPinned = false
|
|
3728
4272
|
}) {
|
|
3729
|
-
const [sidebarExpanded, setSidebarExpanded] =
|
|
3730
|
-
const [sidebarPinned, setSidebarPinned] =
|
|
3731
|
-
const [mobileMenuOpen, setMobileMenuOpen] =
|
|
4273
|
+
const [sidebarExpanded, setSidebarExpanded] = React48.useState(defaultExpanded || defaultPinned);
|
|
4274
|
+
const [sidebarPinned, setSidebarPinned] = React48.useState(defaultPinned);
|
|
4275
|
+
const [mobileMenuOpen, setMobileMenuOpen] = React48.useState(false);
|
|
3732
4276
|
const isMobile = useMediaQuery("(max-width: 1024px)");
|
|
3733
|
-
|
|
4277
|
+
React48.useEffect(() => {
|
|
3734
4278
|
if (!isMobile) {
|
|
3735
4279
|
setMobileMenuOpen(false);
|
|
3736
4280
|
}
|
|
@@ -3869,9 +4413,9 @@ function DashboardLayoutSidebarNavItem({
|
|
|
3869
4413
|
primary: "bg-primary/10 text-primary",
|
|
3870
4414
|
destructive: "bg-destructive/10 text-destructive"
|
|
3871
4415
|
};
|
|
3872
|
-
const
|
|
4416
|
+
const renderIcon4 = () => {
|
|
3873
4417
|
if (!icon) return null;
|
|
3874
|
-
if (
|
|
4418
|
+
if (React48.isValidElement(icon)) {
|
|
3875
4419
|
return icon;
|
|
3876
4420
|
}
|
|
3877
4421
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
@@ -3892,7 +4436,7 @@ function DashboardLayoutSidebarNavItem({
|
|
|
3892
4436
|
),
|
|
3893
4437
|
onClick: disabled ? void 0 : onClick,
|
|
3894
4438
|
children: [
|
|
3895
|
-
|
|
4439
|
+
renderIcon4(),
|
|
3896
4440
|
sidebarExpanded && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3897
4441
|
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-sm", children: label }),
|
|
3898
4442
|
badge !== void 0 && /* @__PURE__ */ jsx(
|
|
@@ -3926,15 +4470,15 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
3926
4470
|
className
|
|
3927
4471
|
}) {
|
|
3928
4472
|
const { sidebarExpanded } = useDashboardLayout();
|
|
3929
|
-
const [isOpen, setIsOpen] =
|
|
4473
|
+
const [isOpen, setIsOpen] = React48.useState(defaultOpen);
|
|
3930
4474
|
const badgeColors = {
|
|
3931
4475
|
default: "bg-muted text-muted-foreground",
|
|
3932
4476
|
primary: "bg-primary/10 text-primary",
|
|
3933
4477
|
destructive: "bg-destructive/10 text-destructive"
|
|
3934
4478
|
};
|
|
3935
|
-
const
|
|
4479
|
+
const renderIcon4 = () => {
|
|
3936
4480
|
if (!icon) return null;
|
|
3937
|
-
if (
|
|
4481
|
+
if (React48.isValidElement(icon)) {
|
|
3938
4482
|
return icon;
|
|
3939
4483
|
}
|
|
3940
4484
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
@@ -3943,7 +4487,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
3943
4487
|
}
|
|
3944
4488
|
return null;
|
|
3945
4489
|
};
|
|
3946
|
-
|
|
4490
|
+
React48.useEffect(() => {
|
|
3947
4491
|
if (isActive && sidebarExpanded) {
|
|
3948
4492
|
setIsOpen(true);
|
|
3949
4493
|
}
|
|
@@ -3959,7 +4503,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
3959
4503
|
isActive && "text-primary"
|
|
3960
4504
|
),
|
|
3961
4505
|
children: [
|
|
3962
|
-
|
|
4506
|
+
renderIcon4(),
|
|
3963
4507
|
sidebarExpanded && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3964
4508
|
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-sm", children: label }),
|
|
3965
4509
|
badge !== void 0 && /* @__PURE__ */ jsx(
|
|
@@ -4047,7 +4591,7 @@ function DashboardLayoutHeaderUser({
|
|
|
4047
4591
|
children,
|
|
4048
4592
|
onLogout
|
|
4049
4593
|
}) {
|
|
4050
|
-
const [isOpen, setIsOpen] =
|
|
4594
|
+
const [isOpen, setIsOpen] = React48.useState(false);
|
|
4051
4595
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
4052
4596
|
/* @__PURE__ */ jsxs(
|
|
4053
4597
|
"button",
|
|
@@ -4128,7 +4672,7 @@ function DashboardLayoutBreadcrumbs({
|
|
|
4128
4672
|
return /* @__PURE__ */ jsx("nav", { className: cn("flex items-center gap-1 text-sm", className), children: items.map((item, index) => {
|
|
4129
4673
|
const Icon2 = item.icon;
|
|
4130
4674
|
const isLast = index === items.length - 1;
|
|
4131
|
-
return /* @__PURE__ */ jsxs(
|
|
4675
|
+
return /* @__PURE__ */ jsxs(React48.Fragment, { children: [
|
|
4132
4676
|
item.href && !isLast ? /* @__PURE__ */ jsxs(
|
|
4133
4677
|
"a",
|
|
4134
4678
|
{
|
|
@@ -4231,52 +4775,2337 @@ var DashboardLayout = Object.assign(DashboardLayoutRoot, {
|
|
|
4231
4775
|
MobileNav: DashboardLayoutMobileNav,
|
|
4232
4776
|
MobileNavItem: DashboardLayoutMobileNavItem
|
|
4233
4777
|
});
|
|
4234
|
-
var
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4778
|
+
var SidebarContext = React48.createContext(null);
|
|
4779
|
+
function useSidebar() {
|
|
4780
|
+
const context = React48.useContext(SidebarContext);
|
|
4781
|
+
if (!context) {
|
|
4782
|
+
throw new Error("useSidebar must be used within a Sidebar component");
|
|
4783
|
+
}
|
|
4784
|
+
return context;
|
|
4785
|
+
}
|
|
4786
|
+
function useSidebarOptional() {
|
|
4787
|
+
return React48.useContext(SidebarContext);
|
|
4788
|
+
}
|
|
4789
|
+
function SidebarProvider({ children, value }) {
|
|
4790
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value, children });
|
|
4791
|
+
}
|
|
4792
|
+
function useMediaQuery2(query) {
|
|
4793
|
+
const [matches, setMatches] = React48.useState(false);
|
|
4794
|
+
React48.useEffect(() => {
|
|
4795
|
+
if (typeof window === "undefined") return;
|
|
4796
|
+
const mediaQuery = window.matchMedia(query);
|
|
4797
|
+
setMatches(mediaQuery.matches);
|
|
4798
|
+
const handler = (event) => {
|
|
4799
|
+
setMatches(event.matches);
|
|
4800
|
+
};
|
|
4801
|
+
mediaQuery.addEventListener("change", handler);
|
|
4802
|
+
return () => mediaQuery.removeEventListener("change", handler);
|
|
4803
|
+
}, [query]);
|
|
4804
|
+
return matches;
|
|
4805
|
+
}
|
|
4806
|
+
var SidebarHeader = React48.memo(function SidebarHeader2({
|
|
4807
|
+
logo,
|
|
4808
|
+
collapsedLogo,
|
|
4809
|
+
title,
|
|
4810
|
+
showPinButton = true,
|
|
4811
|
+
className
|
|
4244
4812
|
}) {
|
|
4245
|
-
const
|
|
4246
|
-
|
|
4813
|
+
const { expanded, pinned, setPinned } = useSidebar();
|
|
4814
|
+
const handleTogglePin = React48.useCallback(() => {
|
|
4815
|
+
setPinned(!pinned);
|
|
4816
|
+
}, [pinned, setPinned]);
|
|
4817
|
+
return /* @__PURE__ */ jsxs(
|
|
4818
|
+
"div",
|
|
4819
|
+
{
|
|
4820
|
+
className: cn(
|
|
4821
|
+
"flex items-center justify-between h-[60px] border-b border-border bg-primary px-3",
|
|
4822
|
+
className
|
|
4823
|
+
),
|
|
4824
|
+
children: [
|
|
4825
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 overflow-hidden", children: [
|
|
4826
|
+
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: !expanded && collapsedLogo && /* @__PURE__ */ jsx(
|
|
4827
|
+
motion.div,
|
|
4828
|
+
{
|
|
4829
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
4830
|
+
animate: { opacity: 1, scale: 1 },
|
|
4831
|
+
exit: { opacity: 0, scale: 0.8 },
|
|
4832
|
+
transition: { duration: 0.15 },
|
|
4833
|
+
className: "flex items-center justify-center",
|
|
4834
|
+
children: collapsedLogo
|
|
4835
|
+
},
|
|
4836
|
+
"collapsed-logo"
|
|
4837
|
+
) }),
|
|
4838
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: expanded && /* @__PURE__ */ jsxs(
|
|
4839
|
+
motion.div,
|
|
4840
|
+
{
|
|
4841
|
+
initial: { opacity: 0, x: -10 },
|
|
4842
|
+
animate: { opacity: 1, x: 0 },
|
|
4843
|
+
exit: { opacity: 0, x: -10 },
|
|
4844
|
+
transition: { duration: 0.2 },
|
|
4845
|
+
className: "flex items-center gap-2",
|
|
4846
|
+
children: [
|
|
4847
|
+
logo && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: logo }),
|
|
4848
|
+
title && /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-primary-foreground whitespace-nowrap", children: title })
|
|
4849
|
+
]
|
|
4850
|
+
}
|
|
4851
|
+
) }),
|
|
4852
|
+
expanded && !logo && collapsedLogo && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4853
|
+
collapsedLogo,
|
|
4854
|
+
title && /* @__PURE__ */ jsx(
|
|
4855
|
+
motion.span,
|
|
4856
|
+
{
|
|
4857
|
+
initial: { opacity: 0, x: -10 },
|
|
4858
|
+
animate: { opacity: 1, x: 0 },
|
|
4859
|
+
exit: { opacity: 0, x: -10 },
|
|
4860
|
+
transition: { duration: 0.2 },
|
|
4861
|
+
className: "text-sm font-semibold text-primary-foreground whitespace-nowrap",
|
|
4862
|
+
children: title
|
|
4863
|
+
}
|
|
4864
|
+
)
|
|
4865
|
+
] })
|
|
4866
|
+
] }),
|
|
4867
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: showPinButton && expanded && /* @__PURE__ */ jsx(
|
|
4868
|
+
motion.button,
|
|
4869
|
+
{
|
|
4870
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
4871
|
+
animate: { opacity: 1, scale: 1 },
|
|
4872
|
+
exit: { opacity: 0, scale: 0.8 },
|
|
4873
|
+
transition: { duration: 0.15 },
|
|
4874
|
+
onClick: handleTogglePin,
|
|
4875
|
+
className: cn(
|
|
4876
|
+
"flex h-6 w-6 items-center justify-center rounded-md transition-colors",
|
|
4877
|
+
"hover:bg-primary-foreground/10"
|
|
4878
|
+
// pinned ? '' : 'text-primary-foreground/60'
|
|
4879
|
+
),
|
|
4880
|
+
title: pinned ? "Unpin sidebar" : "Pin sidebar",
|
|
4881
|
+
children: pinned ? /* @__PURE__ */ jsx(PinOff, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx(Pin, { className: "h-3.5 w-3.5" })
|
|
4882
|
+
}
|
|
4883
|
+
) })
|
|
4884
|
+
]
|
|
4885
|
+
}
|
|
4247
4886
|
);
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4887
|
+
});
|
|
4888
|
+
SidebarHeader.displayName = "Sidebar.Header";
|
|
4889
|
+
var SidebarNav = React48.memo(function SidebarNav2({
|
|
4890
|
+
children,
|
|
4891
|
+
className
|
|
4892
|
+
}) {
|
|
4893
|
+
return /* @__PURE__ */ jsx(
|
|
4894
|
+
"nav",
|
|
4895
|
+
{
|
|
4896
|
+
className: cn(
|
|
4897
|
+
"flex-1 overflow-y-auto overflow-x-hidden py-1 custom-scrollbar",
|
|
4898
|
+
className
|
|
4899
|
+
),
|
|
4900
|
+
children: /* @__PURE__ */ jsx("div", { className: "space-y-0.5 px-2", children })
|
|
4257
4901
|
}
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4902
|
+
);
|
|
4903
|
+
});
|
|
4904
|
+
SidebarNav.displayName = "Sidebar.Nav";
|
|
4905
|
+
var SidebarSection = React48.memo(function SidebarSection2({
|
|
4906
|
+
title,
|
|
4907
|
+
children,
|
|
4908
|
+
className
|
|
4909
|
+
}) {
|
|
4910
|
+
const { expanded } = useSidebar();
|
|
4911
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-0.5", className), children: [
|
|
4912
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: title && expanded && /* @__PURE__ */ jsx(
|
|
4913
|
+
motion.div,
|
|
4914
|
+
{
|
|
4915
|
+
initial: { opacity: 0, height: 0 },
|
|
4916
|
+
animate: { opacity: 1, height: "auto" },
|
|
4917
|
+
exit: { opacity: 0, height: 0 },
|
|
4918
|
+
transition: { duration: 0.2 },
|
|
4919
|
+
className: "mb-1 px-2 py-1",
|
|
4920
|
+
children: /* @__PURE__ */ jsx("p", { className: "text-[10px] font-medium uppercase tracking-wider text-muted-foreground", children: title })
|
|
4267
4921
|
}
|
|
4268
|
-
}),
|
|
4269
|
-
|
|
4922
|
+
) }),
|
|
4923
|
+
children
|
|
4924
|
+
] });
|
|
4925
|
+
});
|
|
4926
|
+
SidebarSection.displayName = "Sidebar.Section";
|
|
4927
|
+
function renderIcon(icon, className) {
|
|
4928
|
+
if (!icon) return null;
|
|
4929
|
+
if (React48.isValidElement(icon)) {
|
|
4930
|
+
return React48.cloneElement(icon, { className });
|
|
4931
|
+
}
|
|
4932
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
4933
|
+
const IconComponent = icon;
|
|
4934
|
+
return /* @__PURE__ */ jsx(IconComponent, { className });
|
|
4935
|
+
}
|
|
4936
|
+
return null;
|
|
4937
|
+
}
|
|
4938
|
+
var badgeVariantStyles = {
|
|
4939
|
+
default: "bg-primary/10 text-primary",
|
|
4940
|
+
notification: "bg-destructive/20 text-destructive",
|
|
4941
|
+
success: "bg-green-100 text-green-600",
|
|
4942
|
+
warning: "bg-amber-100 text-amber-600"
|
|
4943
|
+
};
|
|
4944
|
+
var SidebarNavItem = React48.memo(function SidebarNavItem2({
|
|
4945
|
+
icon,
|
|
4946
|
+
label,
|
|
4947
|
+
href,
|
|
4948
|
+
onClick,
|
|
4949
|
+
isActive = false,
|
|
4950
|
+
badge,
|
|
4951
|
+
badgeVariant = "default",
|
|
4952
|
+
disabled = false,
|
|
4953
|
+
className
|
|
4954
|
+
}) {
|
|
4955
|
+
const { expanded } = useSidebar();
|
|
4956
|
+
const handleClick = React48.useCallback(() => {
|
|
4957
|
+
if (disabled) return;
|
|
4958
|
+
if (onClick) {
|
|
4959
|
+
onClick();
|
|
4960
|
+
} else if (href && typeof window !== "undefined") {
|
|
4961
|
+
window.location.href = href;
|
|
4962
|
+
}
|
|
4963
|
+
}, [disabled, onClick, href]);
|
|
4964
|
+
const iconSize = expanded ? "h-3.5 w-3.5" : "h-4 w-4";
|
|
4965
|
+
return /* @__PURE__ */ jsxs(
|
|
4966
|
+
"button",
|
|
4967
|
+
{
|
|
4968
|
+
onClick: handleClick,
|
|
4969
|
+
disabled,
|
|
4970
|
+
className: cn(
|
|
4971
|
+
"group relative flex w-full items-center rounded-md px-2 py-1.5 transition-all duration-200",
|
|
4972
|
+
isActive ? "bg-primary/10 text-primary" : "hover:bg-primary/5 hover:text-primary",
|
|
4973
|
+
disabled && "opacity-50 cursor-not-allowed",
|
|
4974
|
+
className
|
|
4975
|
+
),
|
|
4976
|
+
children: [
|
|
4977
|
+
isActive && /* @__PURE__ */ jsx(
|
|
4978
|
+
motion.div,
|
|
4979
|
+
{
|
|
4980
|
+
layoutId: "sidebarActiveIndicator",
|
|
4981
|
+
className: "absolute left-0 top-0 bottom-0 w-0.5 rounded-r-full bg-primary",
|
|
4982
|
+
transition: { type: "spring", stiffness: 300, damping: 30 }
|
|
4983
|
+
}
|
|
4984
|
+
),
|
|
4985
|
+
/* @__PURE__ */ jsx(
|
|
4986
|
+
"div",
|
|
4987
|
+
{
|
|
4988
|
+
className: cn(
|
|
4989
|
+
"flex h-6 w-6 items-center justify-center rounded-md transition-all duration-200",
|
|
4990
|
+
isActive ? "text-primary bg-primary/10 group-hover:bg-primary/20" : "text-muted-foreground group-hover:text-foreground"
|
|
4991
|
+
),
|
|
4992
|
+
children: renderIcon(icon, iconSize)
|
|
4993
|
+
}
|
|
4994
|
+
),
|
|
4995
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: expanded && /* @__PURE__ */ jsx(
|
|
4996
|
+
motion.span,
|
|
4997
|
+
{
|
|
4998
|
+
initial: { opacity: 0, x: -10 },
|
|
4999
|
+
animate: { opacity: 1, x: 0 },
|
|
5000
|
+
exit: { opacity: 0, x: -10 },
|
|
5001
|
+
transition: { duration: 0.2 },
|
|
5002
|
+
className: "ml-2 flex-1 text-left text-xs font-medium truncate",
|
|
5003
|
+
children: label
|
|
5004
|
+
}
|
|
5005
|
+
) }),
|
|
5006
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: badge !== void 0 && expanded && /* @__PURE__ */ jsx(
|
|
5007
|
+
motion.div,
|
|
5008
|
+
{
|
|
5009
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
5010
|
+
animate: { opacity: 1, scale: 1 },
|
|
5011
|
+
exit: { opacity: 0, scale: 0.8 },
|
|
5012
|
+
transition: { duration: 0.2 },
|
|
5013
|
+
className: cn(
|
|
5014
|
+
"ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full px-1 text-[10px] font-medium",
|
|
5015
|
+
badgeVariantStyles[badgeVariant]
|
|
5016
|
+
),
|
|
5017
|
+
children: badge
|
|
5018
|
+
}
|
|
5019
|
+
) }),
|
|
5020
|
+
badge !== void 0 && !expanded && /* @__PURE__ */ jsx(
|
|
5021
|
+
"div",
|
|
5022
|
+
{
|
|
5023
|
+
className: cn(
|
|
5024
|
+
"absolute top-1 right-1 h-2 w-2 rounded-full",
|
|
5025
|
+
badgeVariant === "notification" && "bg-destructive",
|
|
5026
|
+
badgeVariant === "success" && "bg-green-500",
|
|
5027
|
+
badgeVariant === "warning" && "bg-amber-500",
|
|
5028
|
+
badgeVariant === "default" && "bg-primary"
|
|
5029
|
+
)
|
|
5030
|
+
}
|
|
5031
|
+
)
|
|
5032
|
+
]
|
|
5033
|
+
}
|
|
4270
5034
|
);
|
|
4271
|
-
|
|
5035
|
+
});
|
|
5036
|
+
SidebarNavItem.displayName = "Sidebar.NavItem";
|
|
5037
|
+
function renderIcon2(icon, className) {
|
|
5038
|
+
if (!icon) return null;
|
|
5039
|
+
if (React48.isValidElement(icon)) {
|
|
5040
|
+
return React48.cloneElement(icon, { className });
|
|
5041
|
+
}
|
|
5042
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5043
|
+
const IconComponent = icon;
|
|
5044
|
+
return /* @__PURE__ */ jsx(IconComponent, { className });
|
|
5045
|
+
}
|
|
5046
|
+
return null;
|
|
4272
5047
|
}
|
|
4273
|
-
var
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
5048
|
+
var badgeVariantStyles2 = {
|
|
5049
|
+
default: "bg-primary/10 text-primary",
|
|
5050
|
+
notification: "bg-destructive/20 text-destructive",
|
|
5051
|
+
success: "bg-green-100 text-green-600",
|
|
5052
|
+
warning: "bg-amber-100 text-amber-600"
|
|
5053
|
+
};
|
|
5054
|
+
var SidebarNavGroup = React48.memo(function SidebarNavGroup2({
|
|
5055
|
+
icon,
|
|
5056
|
+
label,
|
|
5057
|
+
children,
|
|
5058
|
+
id,
|
|
5059
|
+
defaultOpen = false,
|
|
5060
|
+
isActive = false,
|
|
5061
|
+
badge,
|
|
5062
|
+
badgeVariant = "default",
|
|
5063
|
+
className
|
|
5064
|
+
}) {
|
|
5065
|
+
const { expanded, activeSection, setActiveSection } = useSidebar();
|
|
5066
|
+
const [isOpen, setIsOpen] = React48.useState(defaultOpen);
|
|
5067
|
+
const groupId = id || label.toLowerCase().replace(/\s+/g, "-");
|
|
5068
|
+
const isExpanded = expanded && (activeSection === groupId || isOpen);
|
|
5069
|
+
const handleClick = React48.useCallback(() => {
|
|
5070
|
+
if (activeSection === groupId) {
|
|
5071
|
+
setActiveSection(null);
|
|
5072
|
+
setIsOpen(false);
|
|
5073
|
+
} else {
|
|
5074
|
+
setActiveSection(groupId);
|
|
5075
|
+
setIsOpen(true);
|
|
5076
|
+
}
|
|
5077
|
+
}, [activeSection, groupId, setActiveSection]);
|
|
5078
|
+
React48.useEffect(() => {
|
|
5079
|
+
if (expanded && isActive && !isOpen) {
|
|
5080
|
+
setIsOpen(true);
|
|
5081
|
+
setActiveSection(groupId);
|
|
5082
|
+
}
|
|
5083
|
+
}, [expanded, isActive, isOpen, setActiveSection, groupId]);
|
|
5084
|
+
const iconSize = expanded ? "h-3.5 w-3.5" : "h-4 w-4";
|
|
5085
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
5086
|
+
/* @__PURE__ */ jsxs(
|
|
5087
|
+
"button",
|
|
5088
|
+
{
|
|
5089
|
+
onClick: handleClick,
|
|
5090
|
+
className: cn(
|
|
5091
|
+
"group relative flex w-full items-center rounded-md px-2 py-1.5 transition-all duration-200",
|
|
5092
|
+
isActive ? "bg-primary/10 text-primary" : "hover:bg-primary/5 hover:text-primary"
|
|
5093
|
+
),
|
|
5094
|
+
children: [
|
|
5095
|
+
isActive && /* @__PURE__ */ jsx(
|
|
5096
|
+
motion.div,
|
|
5097
|
+
{
|
|
5098
|
+
layoutId: "sidebarGroupActiveIndicator",
|
|
5099
|
+
className: "absolute left-0 top-0 bottom-0 w-0.5 rounded-r-full bg-primary",
|
|
5100
|
+
transition: { type: "spring", stiffness: 300, damping: 30 }
|
|
5101
|
+
}
|
|
5102
|
+
),
|
|
5103
|
+
/* @__PURE__ */ jsx(
|
|
5104
|
+
"div",
|
|
5105
|
+
{
|
|
5106
|
+
className: cn(
|
|
5107
|
+
"flex h-6 w-6 items-center justify-center rounded-md transition-all duration-200",
|
|
5108
|
+
isActive ? "text-primary bg-primary/10 group-hover:bg-primary/20" : "text-muted-foreground group-hover:text-foreground"
|
|
5109
|
+
),
|
|
5110
|
+
children: renderIcon2(icon, iconSize)
|
|
5111
|
+
}
|
|
5112
|
+
),
|
|
5113
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: expanded && /* @__PURE__ */ jsx(
|
|
5114
|
+
motion.span,
|
|
5115
|
+
{
|
|
5116
|
+
initial: { opacity: 0, x: -10 },
|
|
5117
|
+
animate: { opacity: 1, x: 0 },
|
|
5118
|
+
exit: { opacity: 0, x: -10 },
|
|
5119
|
+
transition: { duration: 0.2 },
|
|
5120
|
+
className: "ml-2 flex-1 text-left text-xs font-medium truncate",
|
|
5121
|
+
children: label
|
|
5122
|
+
}
|
|
5123
|
+
) }),
|
|
5124
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: badge !== void 0 && expanded && /* @__PURE__ */ jsx(
|
|
5125
|
+
motion.div,
|
|
5126
|
+
{
|
|
5127
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
5128
|
+
animate: { opacity: 1, scale: 1 },
|
|
5129
|
+
exit: { opacity: 0, scale: 0.8 },
|
|
5130
|
+
transition: { duration: 0.2 },
|
|
5131
|
+
className: cn(
|
|
5132
|
+
"ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full px-1 text-[10px] font-medium",
|
|
5133
|
+
badgeVariantStyles2[badgeVariant]
|
|
5134
|
+
),
|
|
5135
|
+
children: badge
|
|
5136
|
+
}
|
|
5137
|
+
) }),
|
|
5138
|
+
expanded && /* @__PURE__ */ jsx(
|
|
5139
|
+
motion.div,
|
|
5140
|
+
{
|
|
5141
|
+
animate: { rotate: isExpanded ? 90 : 0 },
|
|
5142
|
+
transition: { duration: 0.2 },
|
|
5143
|
+
className: "ml-1",
|
|
5144
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-3 w-3 text-muted-foreground" })
|
|
5145
|
+
}
|
|
5146
|
+
),
|
|
5147
|
+
badge !== void 0 && !expanded && /* @__PURE__ */ jsx(
|
|
5148
|
+
"div",
|
|
5149
|
+
{
|
|
5150
|
+
className: cn(
|
|
5151
|
+
"absolute top-1 right-1 h-2 w-2 rounded-full",
|
|
5152
|
+
badgeVariant === "notification" && "bg-destructive",
|
|
5153
|
+
badgeVariant === "success" && "bg-green-500",
|
|
5154
|
+
badgeVariant === "warning" && "bg-amber-500",
|
|
5155
|
+
badgeVariant === "default" && "bg-primary"
|
|
5156
|
+
)
|
|
5157
|
+
}
|
|
5158
|
+
)
|
|
5159
|
+
]
|
|
5160
|
+
}
|
|
5161
|
+
),
|
|
5162
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: isExpanded && /* @__PURE__ */ jsx(
|
|
5163
|
+
motion.div,
|
|
5164
|
+
{
|
|
5165
|
+
initial: { height: 0, opacity: 0 },
|
|
5166
|
+
animate: { height: "auto", opacity: 1 },
|
|
5167
|
+
exit: { height: 0, opacity: 0 },
|
|
5168
|
+
transition: { duration: 0.2, ease: "easeInOut" },
|
|
5169
|
+
className: "overflow-hidden",
|
|
5170
|
+
children: /* @__PURE__ */ jsx("div", { className: "mt-0.5 space-y-0.5 pl-4 pr-2", children })
|
|
5171
|
+
}
|
|
5172
|
+
) })
|
|
5173
|
+
] });
|
|
5174
|
+
});
|
|
5175
|
+
SidebarNavGroup.displayName = "Sidebar.NavGroup";
|
|
5176
|
+
function isLucideIcon(icon) {
|
|
5177
|
+
return typeof icon === "function";
|
|
5178
|
+
}
|
|
5179
|
+
function getInitials(name) {
|
|
5180
|
+
return name.split(" ").map((part) => part.charAt(0)).slice(0, 2).join("").toUpperCase();
|
|
5181
|
+
}
|
|
5182
|
+
var SidebarFooter = React48.memo(function SidebarFooter2({
|
|
5183
|
+
user,
|
|
5184
|
+
menuItems,
|
|
5185
|
+
children,
|
|
5186
|
+
className
|
|
5187
|
+
}) {
|
|
5188
|
+
const { expanded } = useSidebar();
|
|
5189
|
+
const [menuOpen, setMenuOpen] = React48.useState(false);
|
|
5190
|
+
const handleToggleMenu = React48.useCallback(() => {
|
|
5191
|
+
setMenuOpen((prev) => !prev);
|
|
5192
|
+
}, []);
|
|
5193
|
+
React48.useEffect(() => {
|
|
5194
|
+
if (!menuOpen) return;
|
|
5195
|
+
const handleClickOutside = (event) => {
|
|
5196
|
+
const target = event.target;
|
|
5197
|
+
if (!target.closest("[data-sidebar-footer]")) {
|
|
5198
|
+
setMenuOpen(false);
|
|
5199
|
+
}
|
|
5200
|
+
};
|
|
5201
|
+
document.addEventListener("click", handleClickOutside);
|
|
5202
|
+
return () => document.removeEventListener("click", handleClickOutside);
|
|
5203
|
+
}, [menuOpen]);
|
|
5204
|
+
if (children) {
|
|
5205
|
+
return /* @__PURE__ */ jsx("div", { className: cn("border-t border-border p-2", className), children });
|
|
5206
|
+
}
|
|
5207
|
+
if (!user) return null;
|
|
5208
|
+
return /* @__PURE__ */ jsx(
|
|
5209
|
+
"div",
|
|
5210
|
+
{
|
|
5211
|
+
"data-sidebar-footer": true,
|
|
5212
|
+
className: cn("group cursor-pointer border-t border-border p-2", className),
|
|
5213
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
5214
|
+
/* @__PURE__ */ jsxs(
|
|
5215
|
+
"button",
|
|
5216
|
+
{
|
|
5217
|
+
onClick: handleToggleMenu,
|
|
5218
|
+
className: cn(
|
|
5219
|
+
"flex w-full items-center gap-2 rounded-md p-1.5 transition-all",
|
|
5220
|
+
"hover:bg-muted",
|
|
5221
|
+
menuOpen && "bg-muted"
|
|
5222
|
+
),
|
|
5223
|
+
children: [
|
|
5224
|
+
/* @__PURE__ */ jsx("div", { className: "relative flex-shrink-0", children: user.avatar ? /* @__PURE__ */ jsx(
|
|
5225
|
+
"img",
|
|
5226
|
+
{
|
|
5227
|
+
src: user.avatar,
|
|
5228
|
+
alt: user.name,
|
|
5229
|
+
className: "h-8 w-8 rounded-full object-cover"
|
|
5230
|
+
}
|
|
5231
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-primary/10 text-xs font-medium text-primary", children: getInitials(user.name) }) }),
|
|
5232
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: expanded && /* @__PURE__ */ jsxs(
|
|
5233
|
+
motion.div,
|
|
5234
|
+
{
|
|
5235
|
+
initial: { opacity: 0, x: -10 },
|
|
5236
|
+
animate: { opacity: 1, x: 0 },
|
|
5237
|
+
exit: { opacity: 0, x: -10 },
|
|
5238
|
+
transition: { duration: 0.2 },
|
|
5239
|
+
className: "flex flex-1 items-center justify-between",
|
|
5240
|
+
children: [
|
|
5241
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start", children: [
|
|
5242
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium truncate max-w-[120px]", children: user.name }),
|
|
5243
|
+
user.email && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground truncate max-w-[120px]", children: user.email })
|
|
5244
|
+
] }),
|
|
5245
|
+
/* @__PURE__ */ jsx(
|
|
5246
|
+
ChevronDown,
|
|
5247
|
+
{
|
|
5248
|
+
className: cn(
|
|
5249
|
+
"h-3 w-3 text-muted-foreground transition-transform",
|
|
5250
|
+
menuOpen && "rotate-180"
|
|
5251
|
+
)
|
|
5252
|
+
}
|
|
5253
|
+
)
|
|
5254
|
+
]
|
|
5255
|
+
}
|
|
5256
|
+
) })
|
|
5257
|
+
]
|
|
5258
|
+
}
|
|
5259
|
+
),
|
|
5260
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: menuOpen && expanded && menuItems && menuItems.length > 0 && /* @__PURE__ */ jsx(
|
|
5261
|
+
motion.div,
|
|
5262
|
+
{
|
|
5263
|
+
initial: { opacity: 0, y: -10 },
|
|
5264
|
+
animate: { opacity: 1, y: 0 },
|
|
5265
|
+
exit: { opacity: 0, y: -10 },
|
|
5266
|
+
transition: { duration: 0.15 },
|
|
5267
|
+
className: "absolute bottom-full left-0 right-0 mb-1 overflow-hidden rounded-md border border-border bg-card shadow-lg",
|
|
5268
|
+
children: /* @__PURE__ */ jsx("div", { className: "py-1", children: menuItems.map((item, index) => {
|
|
5269
|
+
const IconComponent = item.icon && isLucideIcon(item.icon) ? item.icon : null;
|
|
5270
|
+
const isDestructive = item.variant === "destructive";
|
|
5271
|
+
return /* @__PURE__ */ jsxs(React48.Fragment, { children: [
|
|
5272
|
+
isDestructive && index > 0 && /* @__PURE__ */ jsx("div", { className: "my-1 border-t border-border" }),
|
|
5273
|
+
/* @__PURE__ */ jsxs(
|
|
5274
|
+
"button",
|
|
5275
|
+
{
|
|
5276
|
+
onClick: () => {
|
|
5277
|
+
item.onClick();
|
|
5278
|
+
setMenuOpen(false);
|
|
5279
|
+
},
|
|
5280
|
+
className: cn(
|
|
5281
|
+
"flex w-full items-center gap-2 px-3 py-1.5 text-xs transition-colors",
|
|
5282
|
+
isDestructive ? "text-destructive hover:bg-destructive/10" : "text-foreground hover:bg-muted"
|
|
5283
|
+
),
|
|
5284
|
+
children: [
|
|
5285
|
+
IconComponent && /* @__PURE__ */ jsx(IconComponent, { className: "h-3 w-3" }),
|
|
5286
|
+
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
5287
|
+
]
|
|
5288
|
+
}
|
|
5289
|
+
)
|
|
5290
|
+
] }, item.label);
|
|
5291
|
+
}) })
|
|
5292
|
+
}
|
|
5293
|
+
) })
|
|
5294
|
+
] })
|
|
5295
|
+
}
|
|
5296
|
+
);
|
|
5297
|
+
});
|
|
5298
|
+
SidebarFooter.displayName = "Sidebar.Footer";
|
|
5299
|
+
var COLLAPSED_WIDTH = 60;
|
|
5300
|
+
var EXPANDED_WIDTH = 250;
|
|
5301
|
+
function SidebarRoot({
|
|
5302
|
+
children,
|
|
5303
|
+
defaultExpanded = false,
|
|
5304
|
+
defaultPinned = false,
|
|
5305
|
+
collapsedWidth = COLLAPSED_WIDTH,
|
|
5306
|
+
expandedWidth = EXPANDED_WIDTH
|
|
5307
|
+
}) {
|
|
5308
|
+
const [expanded, setExpanded] = React48.useState(defaultExpanded || defaultPinned);
|
|
5309
|
+
const [pinned, setPinned] = React48.useState(defaultPinned);
|
|
5310
|
+
const [activeSection, setActiveSection] = React48.useState(null);
|
|
5311
|
+
const isMobile = useMediaQuery2("(max-width: 768px)");
|
|
5312
|
+
const handleSetPinned = React48.useCallback((value) => {
|
|
5313
|
+
setPinned(value);
|
|
5314
|
+
if (value) {
|
|
5315
|
+
setExpanded(true);
|
|
5316
|
+
}
|
|
5317
|
+
}, []);
|
|
5318
|
+
const contextValue = React48.useMemo(
|
|
5319
|
+
() => ({
|
|
5320
|
+
expanded,
|
|
5321
|
+
setExpanded,
|
|
5322
|
+
pinned,
|
|
5323
|
+
setPinned: handleSetPinned,
|
|
5324
|
+
activeSection,
|
|
5325
|
+
setActiveSection,
|
|
5326
|
+
isMobile,
|
|
5327
|
+
collapsedWidth,
|
|
5328
|
+
expandedWidth
|
|
5329
|
+
}),
|
|
5330
|
+
[expanded, pinned, handleSetPinned, activeSection, isMobile, collapsedWidth, expandedWidth]
|
|
5331
|
+
);
|
|
5332
|
+
return /* @__PURE__ */ jsx(SidebarProvider, { value: contextValue, children });
|
|
5333
|
+
}
|
|
5334
|
+
SidebarRoot.displayName = "SidebarRoot";
|
|
5335
|
+
function SidebarAside({ children, className }) {
|
|
5336
|
+
const { expanded, pinned, setExpanded, isMobile, collapsedWidth, expandedWidth } = useSidebar();
|
|
5337
|
+
const sidebarRef = React48.useRef(null);
|
|
5338
|
+
const handleMouseEnter = React48.useCallback(() => {
|
|
5339
|
+
if (!pinned && !isMobile) {
|
|
5340
|
+
setExpanded(true);
|
|
5341
|
+
}
|
|
5342
|
+
}, [pinned, isMobile, setExpanded]);
|
|
5343
|
+
const handleMouseLeave = React48.useCallback(() => {
|
|
5344
|
+
if (!pinned && !isMobile) {
|
|
5345
|
+
setExpanded(false);
|
|
5346
|
+
}
|
|
5347
|
+
}, [pinned, isMobile, setExpanded]);
|
|
5348
|
+
if (isMobile) {
|
|
5349
|
+
return null;
|
|
5350
|
+
}
|
|
5351
|
+
return /* @__PURE__ */ jsx(
|
|
5352
|
+
motion.aside,
|
|
5353
|
+
{
|
|
5354
|
+
ref: sidebarRef,
|
|
5355
|
+
onMouseEnter: handleMouseEnter,
|
|
5356
|
+
onMouseLeave: handleMouseLeave,
|
|
5357
|
+
initial: { width: collapsedWidth },
|
|
5358
|
+
animate: { width: expanded ? expandedWidth : collapsedWidth },
|
|
5359
|
+
transition: {
|
|
5360
|
+
type: "spring",
|
|
5361
|
+
stiffness: 300,
|
|
5362
|
+
damping: 30,
|
|
5363
|
+
mass: 1
|
|
5364
|
+
},
|
|
5365
|
+
className: cn(
|
|
5366
|
+
"relative flex h-screen flex-col bg-card",
|
|
5367
|
+
"shadow-[0_0_20px_rgba(0,0,0,0.06)]",
|
|
5368
|
+
"fixed top-0 left-0 z-50",
|
|
5369
|
+
className
|
|
5370
|
+
),
|
|
5371
|
+
children
|
|
5372
|
+
}
|
|
5373
|
+
);
|
|
5374
|
+
}
|
|
5375
|
+
SidebarAside.displayName = "SidebarAside";
|
|
5376
|
+
function SidebarContent({ children, className }) {
|
|
5377
|
+
const sidebar = useSidebarOptional();
|
|
5378
|
+
if (!sidebar) {
|
|
5379
|
+
return /* @__PURE__ */ jsx("div", { className, children });
|
|
5380
|
+
}
|
|
5381
|
+
const { expanded, pinned, isMobile, collapsedWidth, expandedWidth } = sidebar;
|
|
5382
|
+
if (isMobile) {
|
|
5383
|
+
return /* @__PURE__ */ jsx("div", { className, children });
|
|
5384
|
+
}
|
|
5385
|
+
const marginLeft = pinned && expanded ? expandedWidth : collapsedWidth;
|
|
5386
|
+
return /* @__PURE__ */ jsx(
|
|
5387
|
+
motion.div,
|
|
5388
|
+
{
|
|
5389
|
+
initial: { marginLeft: collapsedWidth },
|
|
5390
|
+
animate: { marginLeft },
|
|
5391
|
+
transition: {
|
|
5392
|
+
type: "spring",
|
|
5393
|
+
stiffness: 300,
|
|
5394
|
+
damping: 30,
|
|
5395
|
+
mass: 1
|
|
5396
|
+
},
|
|
5397
|
+
className: cn("min-h-screen flex flex-col", className),
|
|
5398
|
+
children
|
|
5399
|
+
}
|
|
5400
|
+
);
|
|
5401
|
+
}
|
|
5402
|
+
SidebarContent.displayName = "SidebarContent";
|
|
5403
|
+
function LegacySidebar({
|
|
5404
|
+
children,
|
|
5405
|
+
defaultExpanded = false,
|
|
5406
|
+
defaultPinned = false,
|
|
5407
|
+
collapsedWidth = COLLAPSED_WIDTH,
|
|
5408
|
+
expandedWidth = EXPANDED_WIDTH,
|
|
5409
|
+
className
|
|
5410
|
+
}) {
|
|
5411
|
+
const [expanded, setExpanded] = React48.useState(defaultExpanded || defaultPinned);
|
|
5412
|
+
const [pinned, setPinned] = React48.useState(defaultPinned);
|
|
5413
|
+
const [activeSection, setActiveSection] = React48.useState(null);
|
|
5414
|
+
const isMobile = useMediaQuery2("(max-width: 768px)");
|
|
5415
|
+
const sidebarRef = React48.useRef(null);
|
|
5416
|
+
const handleMouseEnter = React48.useCallback(() => {
|
|
5417
|
+
if (!pinned && !isMobile) {
|
|
5418
|
+
setExpanded(true);
|
|
5419
|
+
}
|
|
5420
|
+
}, [pinned, isMobile]);
|
|
5421
|
+
const handleMouseLeave = React48.useCallback(() => {
|
|
5422
|
+
if (!pinned && !isMobile) {
|
|
5423
|
+
setExpanded(false);
|
|
5424
|
+
}
|
|
5425
|
+
}, [pinned, isMobile]);
|
|
5426
|
+
const handleSetPinned = React48.useCallback((value) => {
|
|
5427
|
+
setPinned(value);
|
|
5428
|
+
if (value) {
|
|
5429
|
+
setExpanded(true);
|
|
5430
|
+
}
|
|
5431
|
+
}, []);
|
|
5432
|
+
const contextValue = React48.useMemo(
|
|
5433
|
+
() => ({
|
|
5434
|
+
expanded,
|
|
5435
|
+
setExpanded,
|
|
5436
|
+
pinned,
|
|
5437
|
+
setPinned: handleSetPinned,
|
|
5438
|
+
activeSection,
|
|
5439
|
+
setActiveSection,
|
|
5440
|
+
isMobile,
|
|
5441
|
+
collapsedWidth,
|
|
5442
|
+
expandedWidth
|
|
5443
|
+
}),
|
|
5444
|
+
[expanded, pinned, handleSetPinned, activeSection, isMobile, collapsedWidth, expandedWidth]
|
|
5445
|
+
);
|
|
5446
|
+
if (isMobile) {
|
|
5447
|
+
return /* @__PURE__ */ jsx(SidebarProvider, { value: contextValue, children });
|
|
5448
|
+
}
|
|
5449
|
+
return /* @__PURE__ */ jsx(SidebarProvider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
5450
|
+
motion.aside,
|
|
5451
|
+
{
|
|
5452
|
+
ref: sidebarRef,
|
|
5453
|
+
onMouseEnter: handleMouseEnter,
|
|
5454
|
+
onMouseLeave: handleMouseLeave,
|
|
5455
|
+
initial: { width: collapsedWidth },
|
|
5456
|
+
animate: { width: expanded ? expandedWidth : collapsedWidth },
|
|
5457
|
+
transition: {
|
|
5458
|
+
type: "spring",
|
|
5459
|
+
stiffness: 300,
|
|
5460
|
+
damping: 30,
|
|
5461
|
+
mass: 1
|
|
5462
|
+
},
|
|
5463
|
+
className: cn(
|
|
5464
|
+
"relative flex h-screen flex-col bg-card",
|
|
5465
|
+
"shadow-[0_0_20px_rgba(0,0,0,0.06)]",
|
|
5466
|
+
"fixed top-0 left-0 z-50",
|
|
5467
|
+
className
|
|
5468
|
+
),
|
|
5469
|
+
children
|
|
5470
|
+
}
|
|
5471
|
+
) });
|
|
5472
|
+
}
|
|
5473
|
+
LegacySidebar.displayName = "Sidebar";
|
|
5474
|
+
var Sidebar = Object.assign(LegacySidebar, {
|
|
5475
|
+
// Layout components
|
|
5476
|
+
Root: SidebarRoot,
|
|
5477
|
+
Aside: SidebarAside,
|
|
5478
|
+
Content: SidebarContent,
|
|
5479
|
+
// Sidebar content components
|
|
5480
|
+
Header: SidebarHeader,
|
|
5481
|
+
Nav: SidebarNav,
|
|
5482
|
+
Section: SidebarSection,
|
|
5483
|
+
NavItem: SidebarNavItem,
|
|
5484
|
+
NavGroup: SidebarNavGroup,
|
|
5485
|
+
Footer: SidebarFooter
|
|
5486
|
+
});
|
|
5487
|
+
function renderIcon3(icon, className) {
|
|
5488
|
+
if (!icon) return null;
|
|
5489
|
+
if (React48.isValidElement(icon)) {
|
|
5490
|
+
return React48.cloneElement(icon, { className });
|
|
5491
|
+
}
|
|
5492
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5493
|
+
const IconComponent = icon;
|
|
5494
|
+
return /* @__PURE__ */ jsx(IconComponent, { className });
|
|
5495
|
+
}
|
|
5496
|
+
return null;
|
|
5497
|
+
}
|
|
5498
|
+
var MobileNavItem = React48.memo(function MobileNavItem2({
|
|
5499
|
+
icon,
|
|
5500
|
+
label,
|
|
5501
|
+
isActive = false,
|
|
5502
|
+
onClick
|
|
5503
|
+
}) {
|
|
5504
|
+
return /* @__PURE__ */ jsxs("button", { onClick, className: "group flex flex-col items-center", children: [
|
|
5505
|
+
/* @__PURE__ */ jsx(
|
|
5506
|
+
"div",
|
|
5507
|
+
{
|
|
5508
|
+
className: cn(
|
|
5509
|
+
"flex items-center justify-center rounded-full p-1.5 transition-colors",
|
|
5510
|
+
isActive ? "text-primary" : "text-muted-foreground group-hover:text-foreground"
|
|
5511
|
+
),
|
|
5512
|
+
children: renderIcon3(icon, "h-5 w-5")
|
|
5513
|
+
}
|
|
5514
|
+
),
|
|
5515
|
+
/* @__PURE__ */ jsx(
|
|
5516
|
+
"span",
|
|
5517
|
+
{
|
|
5518
|
+
className: cn(
|
|
5519
|
+
"mt-0.5 text-[10px] font-medium",
|
|
5520
|
+
isActive ? "text-primary" : "text-muted-foreground group-hover:text-foreground"
|
|
5521
|
+
),
|
|
5522
|
+
children: label
|
|
5523
|
+
}
|
|
5524
|
+
),
|
|
5525
|
+
isActive && /* @__PURE__ */ jsx(
|
|
5526
|
+
motion.div,
|
|
5527
|
+
{
|
|
5528
|
+
layoutId: "mobileNavActiveIndicator",
|
|
5529
|
+
className: "mt-1 h-1 w-8 rounded-full bg-primary",
|
|
5530
|
+
transition: { type: "spring", stiffness: 500, damping: 30 }
|
|
5531
|
+
}
|
|
5532
|
+
)
|
|
5533
|
+
] });
|
|
5534
|
+
});
|
|
5535
|
+
MobileNavItem.displayName = "MobileNavItem";
|
|
5536
|
+
var MobileNav = React48.memo(function MobileNav2({
|
|
5537
|
+
items,
|
|
5538
|
+
fabAction,
|
|
5539
|
+
className
|
|
5540
|
+
}) {
|
|
5541
|
+
const leftItems = fabAction ? items.slice(0, Math.ceil(items.length / 2)) : items;
|
|
5542
|
+
const rightItems = fabAction ? items.slice(Math.ceil(items.length / 2)) : [];
|
|
5543
|
+
return /* @__PURE__ */ jsx(
|
|
5544
|
+
"div",
|
|
5545
|
+
{
|
|
5546
|
+
className: cn(
|
|
5547
|
+
"fixed bottom-0 left-0 right-0 z-50 bg-card px-2 pb-2 pt-1.5 md:hidden",
|
|
5548
|
+
"border-t border-border",
|
|
5549
|
+
className
|
|
5550
|
+
),
|
|
5551
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-around", children: [
|
|
5552
|
+
leftItems.map((item, index) => /* @__PURE__ */ jsx(
|
|
5553
|
+
MobileNavItem,
|
|
5554
|
+
{
|
|
5555
|
+
icon: item.icon,
|
|
5556
|
+
label: item.label,
|
|
5557
|
+
isActive: item.isActive,
|
|
5558
|
+
onClick: () => {
|
|
5559
|
+
if (item.onClick) {
|
|
5560
|
+
item.onClick();
|
|
5561
|
+
} else if (item.href && typeof window !== "undefined") {
|
|
5562
|
+
window.location.href = item.href;
|
|
5563
|
+
}
|
|
5564
|
+
}
|
|
5565
|
+
},
|
|
5566
|
+
`left-${index}-${item.label}`
|
|
5567
|
+
)),
|
|
5568
|
+
fabAction && /* @__PURE__ */ jsxs("div", { className: "relative -mt-5", children: [
|
|
5569
|
+
/* @__PURE__ */ jsx(
|
|
5570
|
+
"button",
|
|
5571
|
+
{
|
|
5572
|
+
onClick: fabAction.onClick,
|
|
5573
|
+
className: cn(
|
|
5574
|
+
"flex h-14 w-14 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg",
|
|
5575
|
+
"transition-transform hover:bg-primary/90 active:scale-95"
|
|
5576
|
+
),
|
|
5577
|
+
"aria-label": fabAction.label,
|
|
5578
|
+
children: fabAction.icon
|
|
5579
|
+
}
|
|
5580
|
+
),
|
|
5581
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 block text-center text-[10px] font-medium text-muted-foreground", children: fabAction.label })
|
|
5582
|
+
] }),
|
|
5583
|
+
rightItems.map((item, index) => /* @__PURE__ */ jsx(
|
|
5584
|
+
MobileNavItem,
|
|
5585
|
+
{
|
|
5586
|
+
icon: item.icon,
|
|
5587
|
+
label: item.label,
|
|
5588
|
+
isActive: item.isActive,
|
|
5589
|
+
onClick: () => {
|
|
5590
|
+
if (item.onClick) {
|
|
5591
|
+
item.onClick();
|
|
5592
|
+
} else if (item.href && typeof window !== "undefined") {
|
|
5593
|
+
window.location.href = item.href;
|
|
5594
|
+
}
|
|
5595
|
+
}
|
|
5596
|
+
},
|
|
5597
|
+
`right-${index}-${item.label}`
|
|
5598
|
+
))
|
|
5599
|
+
] })
|
|
5600
|
+
}
|
|
5601
|
+
);
|
|
5602
|
+
});
|
|
5603
|
+
MobileNav.displayName = "MobileNav";
|
|
5604
|
+
var Navbar = React48.memo(function Navbar2({
|
|
5605
|
+
children,
|
|
5606
|
+
className,
|
|
5607
|
+
style
|
|
5608
|
+
}) {
|
|
5609
|
+
return /* @__PURE__ */ jsx(
|
|
5610
|
+
"nav",
|
|
5611
|
+
{
|
|
5612
|
+
className: cn(
|
|
5613
|
+
"fixed top-0 right-0 bg-card border-b/50 h-16 z-40 w-full shadow-sm",
|
|
5614
|
+
className
|
|
5615
|
+
),
|
|
5616
|
+
style,
|
|
5617
|
+
children: /* @__PURE__ */ jsx("div", { className: "h-full px-4 sm:px-6 lg:pr-8 lg:pl-20", children: /* @__PURE__ */ jsx("div", { className: "flex justify-between items-center h-full", children }) })
|
|
5618
|
+
}
|
|
5619
|
+
);
|
|
5620
|
+
});
|
|
5621
|
+
Navbar.displayName = "Navbar";
|
|
5622
|
+
function ThemeToggle({ className }) {
|
|
5623
|
+
const [isDark, setIsDark] = React48.useState(false);
|
|
5624
|
+
React48.useEffect(() => {
|
|
5625
|
+
const isDarkMode = document.documentElement.classList.contains("dark");
|
|
5626
|
+
setIsDark(isDarkMode);
|
|
5627
|
+
}, []);
|
|
5628
|
+
const toggleTheme = () => {
|
|
5629
|
+
setIsDark(!isDark);
|
|
5630
|
+
if (isDark) {
|
|
5631
|
+
document.documentElement.classList.remove("dark");
|
|
5632
|
+
document.documentElement.style.colorScheme = "light";
|
|
5633
|
+
} else {
|
|
5634
|
+
document.documentElement.classList.add("dark");
|
|
5635
|
+
document.documentElement.style.colorScheme = "dark";
|
|
5636
|
+
}
|
|
5637
|
+
};
|
|
5638
|
+
return /* @__PURE__ */ jsxs(
|
|
5639
|
+
Button,
|
|
5640
|
+
{
|
|
5641
|
+
variant: "ghost",
|
|
5642
|
+
size: "icon",
|
|
5643
|
+
onClick: toggleTheme,
|
|
5644
|
+
"aria-label": "Alternar tema",
|
|
5645
|
+
className,
|
|
5646
|
+
children: [
|
|
5647
|
+
isDark ? /* @__PURE__ */ jsx(Sun, { className: "h-[1.2rem] w-[1.2rem] text-muted-foreground transition-all" }) : /* @__PURE__ */ jsx(Moon, { className: "h-[1.2rem] w-[1.2rem] text-muted-foreground transition-all" }),
|
|
5648
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Alternar tema" })
|
|
5649
|
+
]
|
|
5650
|
+
}
|
|
5651
|
+
);
|
|
5652
|
+
}
|
|
5653
|
+
ThemeToggle.displayName = "ThemeToggle";
|
|
5654
|
+
function NavbarNotification({
|
|
5655
|
+
notifications = [],
|
|
5656
|
+
onMarkAllAsRead,
|
|
5657
|
+
onViewAll
|
|
5658
|
+
}) {
|
|
5659
|
+
const hasNotifications = notifications.length > 0;
|
|
5660
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
5661
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "icon", className: "rounded-full relative", children: [
|
|
5662
|
+
/* @__PURE__ */ jsx(Bell, { className: "h-5 w-5 text-muted-foreground" }),
|
|
5663
|
+
hasNotifications && /* @__PURE__ */ jsx("span", { className: "absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500" }),
|
|
5664
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Abrir notifica\xE7\xF5es" })
|
|
5665
|
+
] }) }),
|
|
5666
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "w-[400px] p-0", align: "end", children: /* @__PURE__ */ jsxs(Card, { className: "border-0 shadow-none", children: [
|
|
5667
|
+
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
5668
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-xl font-bold", children: "Notifica\xE7\xF5es" }),
|
|
5669
|
+
onMarkAllAsRead && /* @__PURE__ */ jsx(
|
|
5670
|
+
Button,
|
|
5671
|
+
{
|
|
5672
|
+
variant: "link",
|
|
5673
|
+
className: "text-primary hover:text-primary/80",
|
|
5674
|
+
onClick: onMarkAllAsRead,
|
|
5675
|
+
children: "Marcar todas como lidas"
|
|
5676
|
+
}
|
|
5677
|
+
)
|
|
5678
|
+
] }),
|
|
5679
|
+
/* @__PURE__ */ jsx(CardContent, { className: "px-0", children: notifications.length === 0 ? /* @__PURE__ */ jsx("div", { className: "py-8 text-center text-muted-foreground", children: "Nenhuma notifica\xE7\xE3o" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5680
|
+
/* @__PURE__ */ jsx("div", { className: "bg-background/30 px-6 py-2 text-sm font-medium text-gray-500", children: "Hoje" }),
|
|
5681
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4 px-6 py-3", children: notifications.map((notification) => /* @__PURE__ */ jsxs(
|
|
5682
|
+
"div",
|
|
5683
|
+
{
|
|
5684
|
+
className: `flex items-start space-x-4 ${notification.isHighlighted ? "rounded-lg bg-primary/5 p-3" : ""}`,
|
|
5685
|
+
children: [
|
|
5686
|
+
notification.icon && /* @__PURE__ */ jsx(
|
|
5687
|
+
"div",
|
|
5688
|
+
{
|
|
5689
|
+
className: `mt-1 rounded-full p-2 ${notification.isHighlighted ? "bg-primary/25" : "bg-gray-500/20"}`,
|
|
5690
|
+
children: notification.icon
|
|
5691
|
+
}
|
|
5692
|
+
),
|
|
5693
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
5694
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: notification.title }),
|
|
5695
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: notification.description }),
|
|
5696
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-gray-400", children: notification.time })
|
|
5697
|
+
] })
|
|
5698
|
+
]
|
|
5699
|
+
},
|
|
5700
|
+
notification.id
|
|
5701
|
+
)) })
|
|
5702
|
+
] }) }),
|
|
5703
|
+
onViewAll && /* @__PURE__ */ jsx(CardFooter, { className: "justify-center", children: /* @__PURE__ */ jsx(
|
|
5704
|
+
Button,
|
|
5705
|
+
{
|
|
5706
|
+
variant: "link",
|
|
5707
|
+
className: "text-primary hover:text-primary/80",
|
|
5708
|
+
onClick: onViewAll,
|
|
5709
|
+
children: "Ver todas notifica\xE7\xF5es"
|
|
5710
|
+
}
|
|
5711
|
+
) })
|
|
5712
|
+
] }) })
|
|
5713
|
+
] });
|
|
5714
|
+
}
|
|
5715
|
+
NavbarNotification.displayName = "NavbarNotification";
|
|
5716
|
+
var ScrollArea = React48.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
5717
|
+
ScrollAreaPrimitive.Root,
|
|
5718
|
+
{
|
|
5719
|
+
ref,
|
|
5720
|
+
className: cn("relative overflow-hidden", className),
|
|
5721
|
+
...props,
|
|
5722
|
+
children: [
|
|
5723
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
5724
|
+
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
5725
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
5726
|
+
]
|
|
5727
|
+
}
|
|
5728
|
+
));
|
|
5729
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
5730
|
+
var ScrollBar = React48.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5731
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
5732
|
+
{
|
|
5733
|
+
ref,
|
|
5734
|
+
orientation,
|
|
5735
|
+
className: cn(
|
|
5736
|
+
"flex touch-none select-none transition-colors",
|
|
5737
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
5738
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
5739
|
+
className
|
|
5740
|
+
),
|
|
5741
|
+
...props,
|
|
5742
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
5743
|
+
}
|
|
5744
|
+
));
|
|
5745
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
5746
|
+
var Separator3 = React48.forwardRef(
|
|
5747
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5748
|
+
SeparatorPrimitive.Root,
|
|
5749
|
+
{
|
|
5750
|
+
ref,
|
|
5751
|
+
decorative,
|
|
5752
|
+
orientation,
|
|
5753
|
+
className: cn(
|
|
5754
|
+
"shrink-0 bg-border",
|
|
5755
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
5756
|
+
className
|
|
5757
|
+
),
|
|
5758
|
+
...props
|
|
5759
|
+
}
|
|
5760
|
+
)
|
|
5761
|
+
);
|
|
5762
|
+
Separator3.displayName = SeparatorPrimitive.Root.displayName;
|
|
5763
|
+
function getInitials2(name) {
|
|
5764
|
+
return name.slice(0, 2).toUpperCase();
|
|
5765
|
+
}
|
|
5766
|
+
function defaultFormatCnpj(cnpj) {
|
|
5767
|
+
return cnpj.replace(/\D/g, "").replace(/^(\d{2})(\d)/, "$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/, "$1.$2.$3").replace(/\.(\d{3})(\d)/, ".$1/$2").replace(/(\d{4})(\d)/, "$1-$2").slice(0, 18);
|
|
5768
|
+
}
|
|
5769
|
+
function NavbarCompanyProfile({
|
|
5770
|
+
companies,
|
|
5771
|
+
activeCompanyId,
|
|
5772
|
+
onCompanySelect,
|
|
5773
|
+
isLoading = false,
|
|
5774
|
+
formatCnpj = defaultFormatCnpj
|
|
5775
|
+
}) {
|
|
5776
|
+
const currentCompany = companies.find(
|
|
5777
|
+
(company) => company.id === activeCompanyId
|
|
5778
|
+
);
|
|
5779
|
+
if (!currentCompany) {
|
|
5780
|
+
return isLoading ? /* @__PURE__ */ jsx(Loader, { variant: "dots" }) : null;
|
|
5781
|
+
}
|
|
5782
|
+
const handleCompanyClick = (companyId) => {
|
|
5783
|
+
if (onCompanySelect) {
|
|
5784
|
+
onCompanySelect(companyId);
|
|
5785
|
+
}
|
|
5786
|
+
};
|
|
5787
|
+
return /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-3 bg-primary/5 text-primary px-2 py-1 rounded-md", children: [
|
|
5788
|
+
/* @__PURE__ */ jsx(Avatar, { className: "h-10 w-10 bg-primary/20", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "font-semibold", children: getInitials2(currentCompany.name) }) }),
|
|
5789
|
+
/* @__PURE__ */ jsxs("div", { className: "hidden sm:flex sm:flex-col sm:flex-grow", children: [
|
|
5790
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm", children: currentCompany.name }),
|
|
5791
|
+
currentCompany.cnpj && /* @__PURE__ */ jsx("p", { className: "text-xs text-primary/70", children: formatCnpj(currentCompany.cnpj) })
|
|
5792
|
+
] }),
|
|
5793
|
+
/* @__PURE__ */ jsxs(Popover, { children: [
|
|
5794
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
5795
|
+
Button,
|
|
5796
|
+
{
|
|
5797
|
+
variant: "ghost",
|
|
5798
|
+
size: "sm",
|
|
5799
|
+
className: "h-8 px-2 text-primary hover:bg-primary/20",
|
|
5800
|
+
children: [
|
|
5801
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Abrir menu de empresas" }),
|
|
5802
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
5803
|
+
]
|
|
5804
|
+
}
|
|
5805
|
+
) }),
|
|
5806
|
+
/* @__PURE__ */ jsxs(PopoverContent, { className: "w-80 p-0", align: "end", children: [
|
|
5807
|
+
/* @__PURE__ */ jsxs("div", { className: "bg-primary/5 p-4 rounded-t-lg", children: [
|
|
5808
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-sm mb-1", children: "Empresas Vinculadas" }),
|
|
5809
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Selecione para mudar de empresa" })
|
|
5810
|
+
] }),
|
|
5811
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "h-64", children: /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
|
|
5812
|
+
isLoading && /* @__PURE__ */ jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ jsx(Loader, { variant: "spinner" }) }),
|
|
5813
|
+
!isLoading && companies.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-center text-muted-foreground", children: "Nenhuma empresa encontrada." }),
|
|
5814
|
+
companies.map((company, index) => /* @__PURE__ */ jsxs(React48.Fragment, { children: [
|
|
5815
|
+
/* @__PURE__ */ jsx(
|
|
5816
|
+
Button,
|
|
5817
|
+
{
|
|
5818
|
+
variant: "ghost",
|
|
5819
|
+
className: "w-full justify-start text-sm mb-1 hover:bg-primary/10",
|
|
5820
|
+
onClick: () => handleCompanyClick(company.id),
|
|
5821
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center w-full", children: [
|
|
5822
|
+
/* @__PURE__ */ jsx(Avatar, { className: "h-8 w-8 mr-3", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "bg-primary/20 text-primary text-xs", children: getInitials2(company.name) }) }),
|
|
5823
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-grow text-left", children: [
|
|
5824
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium", children: company.name }),
|
|
5825
|
+
company.cnpj && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: formatCnpj(company.cnpj) })
|
|
5826
|
+
] }),
|
|
5827
|
+
company.id === activeCompanyId && /* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4 text-primary ml-2" })
|
|
5828
|
+
] })
|
|
5829
|
+
}
|
|
5830
|
+
),
|
|
5831
|
+
index < companies.length - 1 && /* @__PURE__ */ jsx(Separator3, { className: "my-2" })
|
|
5832
|
+
] }, company.id))
|
|
5833
|
+
] }) })
|
|
5834
|
+
] })
|
|
5835
|
+
] })
|
|
5836
|
+
] }) });
|
|
5837
|
+
}
|
|
5838
|
+
NavbarCompanyProfile.displayName = "NavbarCompanyProfile";
|
|
5839
|
+
function getInitials3(name) {
|
|
5840
|
+
return name.split(" ").map((part) => part[0]).join("").toUpperCase().slice(0, 2);
|
|
5841
|
+
}
|
|
5842
|
+
var defaultMenuItems = [
|
|
5843
|
+
{ icon: /* @__PURE__ */ jsx(User, { className: "h-4 w-4" }), label: "Ver Perfil" },
|
|
5844
|
+
{ icon: /* @__PURE__ */ jsx(Settings, { className: "h-4 w-4" }), label: "Configura\xE7\xF5es" },
|
|
5845
|
+
{ icon: /* @__PURE__ */ jsx(Bell, { className: "h-4 w-4" }), label: "Atualiza\xE7\xF5es" },
|
|
5846
|
+
{ icon: /* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }), label: "Sair", variant: "destructive" }
|
|
5847
|
+
];
|
|
5848
|
+
function NavbarUserMenu({
|
|
5849
|
+
name,
|
|
5850
|
+
email,
|
|
5851
|
+
avatarUrl,
|
|
5852
|
+
isCollapsed = false,
|
|
5853
|
+
menuItems = defaultMenuItems,
|
|
5854
|
+
children
|
|
5855
|
+
}) {
|
|
5856
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
5857
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", className: "w-full justify-start p-2", children: [
|
|
5858
|
+
/* @__PURE__ */ jsxs(Avatar, { className: "h-8 w-8", children: [
|
|
5859
|
+
avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: avatarUrl, alt: name }),
|
|
5860
|
+
/* @__PURE__ */ jsx(AvatarFallback, { children: getInitials3(name) })
|
|
5861
|
+
] }),
|
|
5862
|
+
!isCollapsed && /* @__PURE__ */ jsxs("div", { className: "ml-2 text-left", children: [
|
|
5863
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: name }),
|
|
5864
|
+
email && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: email })
|
|
5865
|
+
] })
|
|
5866
|
+
] }) }),
|
|
5867
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "w-56 p-2", align: "end", children: children ? children : /* @__PURE__ */ jsx("div", { className: "space-y-1", children: menuItems.map((item, index) => {
|
|
5868
|
+
const content = /* @__PURE__ */ jsxs(
|
|
5869
|
+
Button,
|
|
5870
|
+
{
|
|
5871
|
+
variant: "ghost",
|
|
5872
|
+
className: `w-full justify-start text-sm ${item.variant === "destructive" ? "text-red-500" : ""}`,
|
|
5873
|
+
onClick: item.onClick,
|
|
5874
|
+
children: [
|
|
5875
|
+
item.icon && /* @__PURE__ */ jsx("span", { className: "mr-2", children: item.icon }),
|
|
5876
|
+
item.label
|
|
5877
|
+
]
|
|
5878
|
+
},
|
|
5879
|
+
index
|
|
5880
|
+
);
|
|
5881
|
+
if (item.href) {
|
|
5882
|
+
return /* @__PURE__ */ jsx(
|
|
5883
|
+
"a",
|
|
5884
|
+
{
|
|
5885
|
+
href: item.href,
|
|
5886
|
+
className: "flex flex-col items-center text-center",
|
|
5887
|
+
children: content
|
|
5888
|
+
},
|
|
5889
|
+
index
|
|
5890
|
+
);
|
|
5891
|
+
}
|
|
5892
|
+
return content;
|
|
5893
|
+
}) }) })
|
|
5894
|
+
] });
|
|
5895
|
+
}
|
|
5896
|
+
NavbarUserMenu.displayName = "NavbarUserMenu";
|
|
5897
|
+
var Breadcrumb = React48.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
5898
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
5899
|
+
var BreadcrumbList = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5900
|
+
"ol",
|
|
5901
|
+
{
|
|
5902
|
+
ref,
|
|
5903
|
+
className: cn(
|
|
5904
|
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
|
|
5905
|
+
className
|
|
5906
|
+
),
|
|
5907
|
+
...props
|
|
5908
|
+
}
|
|
5909
|
+
));
|
|
5910
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
5911
|
+
var BreadcrumbItem = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5912
|
+
"li",
|
|
5913
|
+
{
|
|
5914
|
+
ref,
|
|
5915
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
5916
|
+
...props
|
|
5917
|
+
}
|
|
5918
|
+
));
|
|
5919
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
5920
|
+
var BreadcrumbLink = React48.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
5921
|
+
const Comp = asChild ? Slot : "a";
|
|
5922
|
+
return /* @__PURE__ */ jsx(
|
|
5923
|
+
Comp,
|
|
5924
|
+
{
|
|
5925
|
+
ref,
|
|
5926
|
+
className: cn("transition-colors hover:text-foreground", className),
|
|
5927
|
+
...props
|
|
5928
|
+
}
|
|
5929
|
+
);
|
|
5930
|
+
});
|
|
5931
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
5932
|
+
var BreadcrumbPage = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5933
|
+
"span",
|
|
5934
|
+
{
|
|
5935
|
+
ref,
|
|
5936
|
+
role: "link",
|
|
5937
|
+
"aria-disabled": "true",
|
|
5938
|
+
"aria-current": "page",
|
|
5939
|
+
className: cn("font-semibold text-primary", className),
|
|
5940
|
+
...props
|
|
5941
|
+
}
|
|
5942
|
+
));
|
|
5943
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
5944
|
+
var BreadcrumbSeparator = ({
|
|
5945
|
+
children,
|
|
5946
|
+
className,
|
|
5947
|
+
...props
|
|
5948
|
+
}) => /* @__PURE__ */ jsx(
|
|
5949
|
+
"li",
|
|
5950
|
+
{
|
|
5951
|
+
role: "presentation",
|
|
5952
|
+
"aria-hidden": "true",
|
|
5953
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
5954
|
+
...props,
|
|
5955
|
+
children: children ?? /* @__PURE__ */ jsx(ChevronRight, {})
|
|
5956
|
+
}
|
|
5957
|
+
);
|
|
5958
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
5959
|
+
var BreadcrumbEllipsis = ({
|
|
5960
|
+
className,
|
|
5961
|
+
...props
|
|
5962
|
+
}) => /* @__PURE__ */ jsxs(
|
|
5963
|
+
"span",
|
|
5964
|
+
{
|
|
5965
|
+
role: "presentation",
|
|
5966
|
+
"aria-hidden": "true",
|
|
5967
|
+
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
5968
|
+
...props,
|
|
5969
|
+
children: [
|
|
5970
|
+
/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }),
|
|
5971
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More" })
|
|
5972
|
+
]
|
|
5973
|
+
}
|
|
5974
|
+
);
|
|
5975
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
5976
|
+
function SectionHeaderRoot({
|
|
5977
|
+
children,
|
|
5978
|
+
className,
|
|
5979
|
+
gradient = true,
|
|
5980
|
+
bordered = true,
|
|
5981
|
+
...props
|
|
5982
|
+
}) {
|
|
5983
|
+
return /* @__PURE__ */ jsx(
|
|
5984
|
+
"div",
|
|
5985
|
+
{
|
|
5986
|
+
className: cn(
|
|
5987
|
+
"px-6 py-4",
|
|
5988
|
+
gradient && "bg-gradient-to-r from-primary/5 to-transparent",
|
|
5989
|
+
bordered && "border-b border-border/50",
|
|
5990
|
+
className
|
|
5991
|
+
),
|
|
5992
|
+
...props,
|
|
5993
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between gap-4", children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 min-w-0 flex-1", children }) })
|
|
5994
|
+
}
|
|
5995
|
+
);
|
|
5996
|
+
}
|
|
5997
|
+
SectionHeaderRoot.displayName = "SectionHeader";
|
|
5998
|
+
function SectionHeaderIcon({ icon: Icon2, className }) {
|
|
5999
|
+
return /* @__PURE__ */ jsx("div", { className: cn("p-2.5 rounded-xl bg-primary/10 shrink-0", className), children: /* @__PURE__ */ jsx(Icon2, { className: "h-5 w-5 text-primary" }) });
|
|
6000
|
+
}
|
|
6001
|
+
SectionHeaderIcon.displayName = "SectionHeader.Icon";
|
|
6002
|
+
function SectionHeaderContent({ children, className, ...props }) {
|
|
6003
|
+
return /* @__PURE__ */ jsx("div", { className: cn("min-w-0 flex-1", className), ...props, children });
|
|
6004
|
+
}
|
|
6005
|
+
SectionHeaderContent.displayName = "SectionHeader.Content";
|
|
6006
|
+
function SectionHeaderTitle({ children, className, ...props }) {
|
|
6007
|
+
return /* @__PURE__ */ jsx(
|
|
6008
|
+
"h3",
|
|
6009
|
+
{
|
|
6010
|
+
className: cn("font-semibold text-foreground truncate", className),
|
|
6011
|
+
...props,
|
|
6012
|
+
children
|
|
6013
|
+
}
|
|
6014
|
+
);
|
|
6015
|
+
}
|
|
6016
|
+
SectionHeaderTitle.displayName = "SectionHeader.Title";
|
|
6017
|
+
function SectionHeaderSubtitle({ children, className, ...props }) {
|
|
6018
|
+
return /* @__PURE__ */ jsx(
|
|
6019
|
+
"p",
|
|
6020
|
+
{
|
|
6021
|
+
className: cn("text-sm text-muted-foreground truncate", className),
|
|
6022
|
+
...props,
|
|
6023
|
+
children
|
|
6024
|
+
}
|
|
6025
|
+
);
|
|
6026
|
+
}
|
|
6027
|
+
SectionHeaderSubtitle.displayName = "SectionHeader.Subtitle";
|
|
6028
|
+
function SectionHeaderActions({ children, className, ...props }) {
|
|
6029
|
+
return /* @__PURE__ */ jsx(
|
|
6030
|
+
"div",
|
|
6031
|
+
{
|
|
6032
|
+
className: cn("flex items-center gap-2 shrink-0 ml-auto", className),
|
|
6033
|
+
...props,
|
|
6034
|
+
children
|
|
6035
|
+
}
|
|
6036
|
+
);
|
|
6037
|
+
}
|
|
6038
|
+
SectionHeaderActions.displayName = "SectionHeader.Actions";
|
|
6039
|
+
function SectionHeaderBadge({
|
|
6040
|
+
children,
|
|
6041
|
+
className,
|
|
6042
|
+
variant = "muted",
|
|
6043
|
+
...props
|
|
6044
|
+
}) {
|
|
6045
|
+
return /* @__PURE__ */ jsx(
|
|
6046
|
+
"span",
|
|
6047
|
+
{
|
|
6048
|
+
className: cn(
|
|
6049
|
+
"text-xs px-2 py-1 rounded-full shrink-0",
|
|
6050
|
+
variant === "muted" && "bg-muted text-muted-foreground",
|
|
6051
|
+
variant === "default" && "bg-primary/10 text-primary",
|
|
6052
|
+
className
|
|
6053
|
+
),
|
|
6054
|
+
...props,
|
|
6055
|
+
children
|
|
6056
|
+
}
|
|
6057
|
+
);
|
|
6058
|
+
}
|
|
6059
|
+
SectionHeaderBadge.displayName = "SectionHeader.Badge";
|
|
6060
|
+
var SectionHeader = Object.assign(SectionHeaderRoot, {
|
|
6061
|
+
Icon: SectionHeaderIcon,
|
|
6062
|
+
Content: SectionHeaderContent,
|
|
6063
|
+
Title: SectionHeaderTitle,
|
|
6064
|
+
Subtitle: SectionHeaderSubtitle,
|
|
6065
|
+
Actions: SectionHeaderActions,
|
|
6066
|
+
Badge: SectionHeaderBadge
|
|
6067
|
+
});
|
|
6068
|
+
var KanbanContext = React48.createContext(null);
|
|
6069
|
+
function useKanban() {
|
|
6070
|
+
const context = React48.useContext(KanbanContext);
|
|
6071
|
+
if (!context) {
|
|
6072
|
+
throw new Error("useKanban must be used within a Kanban.Board component");
|
|
6073
|
+
}
|
|
6074
|
+
return context;
|
|
6075
|
+
}
|
|
6076
|
+
function useKanbanOptional() {
|
|
6077
|
+
return React48.useContext(KanbanContext);
|
|
6078
|
+
}
|
|
6079
|
+
function KanbanProvider({ children, value }) {
|
|
6080
|
+
return /* @__PURE__ */ jsx(KanbanContext.Provider, { value, children });
|
|
6081
|
+
}
|
|
6082
|
+
function KanbanBoard({
|
|
6083
|
+
children,
|
|
6084
|
+
onDragEnd,
|
|
6085
|
+
onDragStart,
|
|
6086
|
+
className
|
|
6087
|
+
}) {
|
|
6088
|
+
const [isDragging, setIsDragging] = React48.useState(false);
|
|
6089
|
+
const [draggedItemId, setDraggedItemId] = React48.useState(null);
|
|
6090
|
+
const [sourceColumnId, setSourceColumnId] = React48.useState(null);
|
|
6091
|
+
const [hoveredColumnId, setHoveredColumnId] = React48.useState(null);
|
|
6092
|
+
const dropValidatorsRef = React48.useRef(/* @__PURE__ */ new Map());
|
|
6093
|
+
const registerDropValidator = React48.useCallback((columnId, validator) => {
|
|
6094
|
+
dropValidatorsRef.current.set(columnId, validator);
|
|
6095
|
+
}, []);
|
|
6096
|
+
const unregisterDropValidator = React48.useCallback((columnId) => {
|
|
6097
|
+
dropValidatorsRef.current.delete(columnId);
|
|
6098
|
+
}, []);
|
|
6099
|
+
const canDropInColumn = React48.useCallback((columnId) => {
|
|
6100
|
+
if (!draggedItemId || !sourceColumnId) return false;
|
|
6101
|
+
if (columnId === sourceColumnId) return false;
|
|
6102
|
+
const validator = dropValidatorsRef.current.get(columnId);
|
|
6103
|
+
if (validator) {
|
|
6104
|
+
return validator(draggedItemId, sourceColumnId);
|
|
6105
|
+
}
|
|
6106
|
+
return true;
|
|
6107
|
+
}, [draggedItemId, sourceColumnId]);
|
|
6108
|
+
const handleDragStart = React48.useCallback((itemId, colId) => {
|
|
6109
|
+
setIsDragging(true);
|
|
6110
|
+
setDraggedItemId(itemId);
|
|
6111
|
+
setSourceColumnId(colId);
|
|
6112
|
+
onDragStart?.(itemId, colId);
|
|
6113
|
+
}, [onDragStart]);
|
|
6114
|
+
const handleDrop = React48.useCallback((destinationColumnId) => {
|
|
6115
|
+
if (draggedItemId && sourceColumnId && destinationColumnId !== sourceColumnId) {
|
|
6116
|
+
if (canDropInColumn(destinationColumnId)) {
|
|
6117
|
+
const result = {
|
|
6118
|
+
itemId: draggedItemId,
|
|
6119
|
+
sourceColumnId,
|
|
6120
|
+
destinationColumnId
|
|
6121
|
+
};
|
|
6122
|
+
onDragEnd?.(result);
|
|
6123
|
+
}
|
|
6124
|
+
}
|
|
6125
|
+
setIsDragging(false);
|
|
6126
|
+
setDraggedItemId(null);
|
|
6127
|
+
setSourceColumnId(null);
|
|
6128
|
+
setHoveredColumnId(null);
|
|
6129
|
+
}, [draggedItemId, sourceColumnId, canDropInColumn, onDragEnd]);
|
|
6130
|
+
const handleDragEnd = React48.useCallback(() => {
|
|
6131
|
+
setIsDragging(false);
|
|
6132
|
+
setDraggedItemId(null);
|
|
6133
|
+
setSourceColumnId(null);
|
|
6134
|
+
setHoveredColumnId(null);
|
|
6135
|
+
}, []);
|
|
6136
|
+
const contextValue = React48.useMemo(() => ({
|
|
6137
|
+
isDragging,
|
|
6138
|
+
draggedItemId,
|
|
6139
|
+
sourceColumnId,
|
|
6140
|
+
hoveredColumnId,
|
|
6141
|
+
setHoveredColumnId,
|
|
6142
|
+
canDropInColumn,
|
|
6143
|
+
registerDropValidator,
|
|
6144
|
+
unregisterDropValidator
|
|
6145
|
+
}), [isDragging, draggedItemId, sourceColumnId, hoveredColumnId, canDropInColumn, registerDropValidator, unregisterDropValidator]);
|
|
6146
|
+
return /* @__PURE__ */ jsx(KanbanProvider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
6147
|
+
"div",
|
|
6148
|
+
{
|
|
6149
|
+
className: cn(
|
|
6150
|
+
"flex gap-4 overflow-x-auto pb-4",
|
|
6151
|
+
className
|
|
6152
|
+
),
|
|
6153
|
+
onDragEnd: handleDragEnd,
|
|
6154
|
+
"data-kanban-board": true,
|
|
6155
|
+
"data-onstart": handleDragStart.toString(),
|
|
6156
|
+
"data-ondrop": handleDrop.toString(),
|
|
6157
|
+
children: /* @__PURE__ */ jsx(KanbanBoardInternalContext.Provider, { value: { handleDragStart, handleDrop }, children })
|
|
6158
|
+
}
|
|
6159
|
+
) });
|
|
6160
|
+
}
|
|
6161
|
+
var KanbanBoardInternalContext = React48.createContext(null);
|
|
6162
|
+
function useKanbanBoard() {
|
|
6163
|
+
const context = React48.useContext(KanbanBoardInternalContext);
|
|
6164
|
+
if (!context) {
|
|
6165
|
+
throw new Error("useKanbanBoard must be used within a Kanban.Board component");
|
|
6166
|
+
}
|
|
6167
|
+
return context;
|
|
6168
|
+
}
|
|
6169
|
+
KanbanBoard.displayName = "KanbanBoard";
|
|
6170
|
+
function KanbanColumn({
|
|
6171
|
+
id,
|
|
6172
|
+
title,
|
|
6173
|
+
count,
|
|
6174
|
+
children,
|
|
6175
|
+
className,
|
|
6176
|
+
headerClassName,
|
|
6177
|
+
emptyMessage = "Nenhum item",
|
|
6178
|
+
footer,
|
|
6179
|
+
canDrop
|
|
6180
|
+
}) {
|
|
6181
|
+
const { isDragging, sourceColumnId, hoveredColumnId, setHoveredColumnId, canDropInColumn, registerDropValidator, unregisterDropValidator } = useKanban();
|
|
6182
|
+
const { handleDrop } = useKanbanBoard();
|
|
6183
|
+
React48.useEffect(() => {
|
|
6184
|
+
if (canDrop) {
|
|
6185
|
+
registerDropValidator(id, canDrop);
|
|
6186
|
+
return () => unregisterDropValidator(id);
|
|
6187
|
+
}
|
|
6188
|
+
}, [id, canDrop, registerDropValidator, unregisterDropValidator]);
|
|
6189
|
+
const isValidDropTarget = isDragging && sourceColumnId !== id && canDropInColumn(id);
|
|
6190
|
+
const isInvalidDropTarget = isDragging && sourceColumnId !== id && !canDropInColumn(id);
|
|
6191
|
+
const isHovered = hoveredColumnId === id;
|
|
6192
|
+
const handleDragOver = React48.useCallback((e) => {
|
|
6193
|
+
e.preventDefault();
|
|
6194
|
+
if (isValidDropTarget) {
|
|
6195
|
+
e.dataTransfer.dropEffect = "move";
|
|
6196
|
+
setHoveredColumnId(id);
|
|
6197
|
+
} else {
|
|
6198
|
+
e.dataTransfer.dropEffect = "none";
|
|
6199
|
+
}
|
|
6200
|
+
}, [isValidDropTarget, setHoveredColumnId, id]);
|
|
6201
|
+
const handleDragLeave = React48.useCallback((e) => {
|
|
6202
|
+
if (e.currentTarget === e.target || !e.currentTarget.contains(e.relatedTarget)) {
|
|
6203
|
+
setHoveredColumnId(null);
|
|
6204
|
+
}
|
|
6205
|
+
}, [setHoveredColumnId]);
|
|
6206
|
+
const handleDropEvent = React48.useCallback((e) => {
|
|
6207
|
+
e.preventDefault();
|
|
6208
|
+
if (isValidDropTarget) {
|
|
6209
|
+
handleDrop(id);
|
|
6210
|
+
}
|
|
6211
|
+
}, [isValidDropTarget, handleDrop, id]);
|
|
6212
|
+
const childCount = React48.Children.count(children);
|
|
6213
|
+
const displayCount = count ?? childCount;
|
|
6214
|
+
return /* @__PURE__ */ jsxs(
|
|
6215
|
+
"div",
|
|
6216
|
+
{
|
|
6217
|
+
className: cn(
|
|
6218
|
+
"flex flex-col min-w-[300px] max-w-[340px] rounded-2xl",
|
|
6219
|
+
"bg-muted/20 dark:bg-muted/10",
|
|
6220
|
+
"transition-all duration-200",
|
|
6221
|
+
isValidDropTarget && "ring-2 ring-primary/40 bg-primary/5",
|
|
6222
|
+
isInvalidDropTarget && "opacity-40",
|
|
6223
|
+
isHovered && isValidDropTarget && "ring-primary/60 bg-primary/10 scale-[1.01]",
|
|
6224
|
+
className
|
|
6225
|
+
),
|
|
6226
|
+
onDragOver: handleDragOver,
|
|
6227
|
+
onDragLeave: handleDragLeave,
|
|
6228
|
+
onDrop: handleDropEvent,
|
|
6229
|
+
"data-kanban-column": id,
|
|
6230
|
+
children: [
|
|
6231
|
+
/* @__PURE__ */ jsxs(
|
|
6232
|
+
"div",
|
|
6233
|
+
{
|
|
6234
|
+
className: cn(
|
|
6235
|
+
"flex items-center gap-2 px-4 py-3",
|
|
6236
|
+
headerClassName
|
|
6237
|
+
),
|
|
6238
|
+
children: [
|
|
6239
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u21BB" }),
|
|
6240
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-foreground flex-1", children: title }),
|
|
6241
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: displayCount }),
|
|
6242
|
+
/* @__PURE__ */ jsx("button", { className: "p-1 rounded-md hover:bg-muted/50 text-muted-foreground transition-colors", children: /* @__PURE__ */ jsx("span", { className: "text-sm", children: "\u22EF" }) }),
|
|
6243
|
+
/* @__PURE__ */ jsx("button", { className: "p-1 rounded-md hover:bg-muted/50 text-muted-foreground transition-colors", children: /* @__PURE__ */ jsx("span", { className: "text-sm", children: "+" }) })
|
|
6244
|
+
]
|
|
6245
|
+
}
|
|
6246
|
+
),
|
|
6247
|
+
/* @__PURE__ */ jsx(
|
|
6248
|
+
"div",
|
|
6249
|
+
{
|
|
6250
|
+
className: cn(
|
|
6251
|
+
"flex-1 px-2 pb-2 space-y-3 min-h-[200px] max-h-[calc(100vh-200px)] overflow-y-auto",
|
|
6252
|
+
isHovered && isValidDropTarget && "bg-primary/5"
|
|
6253
|
+
),
|
|
6254
|
+
children: childCount === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-32 text-sm text-muted-foreground/60", children: emptyMessage }) : children
|
|
6255
|
+
}
|
|
6256
|
+
),
|
|
6257
|
+
footer && /* @__PURE__ */ jsx("div", { className: "px-2 pb-3", children: footer })
|
|
6258
|
+
]
|
|
6259
|
+
}
|
|
6260
|
+
);
|
|
6261
|
+
}
|
|
6262
|
+
KanbanColumn.displayName = "KanbanColumn";
|
|
6263
|
+
function KanbanCard({
|
|
6264
|
+
id,
|
|
6265
|
+
columnId,
|
|
6266
|
+
children,
|
|
6267
|
+
className,
|
|
6268
|
+
disabled = false
|
|
6269
|
+
}) {
|
|
6270
|
+
const { draggedItemId } = useKanban();
|
|
6271
|
+
const { handleDragStart } = useKanbanBoard();
|
|
6272
|
+
const isThisCardDragging = draggedItemId === id;
|
|
6273
|
+
const handleDragStartEvent = React48.useCallback((e) => {
|
|
6274
|
+
if (disabled) {
|
|
6275
|
+
e.preventDefault();
|
|
6276
|
+
return;
|
|
6277
|
+
}
|
|
6278
|
+
e.dataTransfer.effectAllowed = "move";
|
|
6279
|
+
e.dataTransfer.setData("text/plain", id);
|
|
6280
|
+
setTimeout(() => {
|
|
6281
|
+
handleDragStart(id, columnId);
|
|
6282
|
+
}, 0);
|
|
6283
|
+
}, [id, columnId, handleDragStart, disabled]);
|
|
6284
|
+
return /* @__PURE__ */ jsx(
|
|
6285
|
+
"div",
|
|
6286
|
+
{
|
|
6287
|
+
draggable: !disabled,
|
|
6288
|
+
onDragStart: handleDragStartEvent,
|
|
6289
|
+
className: cn(
|
|
6290
|
+
"group relative rounded-2xl border border-border/60 bg-card p-4",
|
|
6291
|
+
"shadow-[0_2px_8px_-2px_rgba(0,0,0,0.08),0_4px_16px_-4px_rgba(0,0,0,0.04)]",
|
|
6292
|
+
"transition-all duration-200",
|
|
6293
|
+
!disabled && "cursor-grab hover:shadow-[0_4px_16px_-4px_rgba(0,0,0,0.12),0_8px_24px_-8px_rgba(0,0,0,0.08)] hover:border-border",
|
|
6294
|
+
!disabled && "active:cursor-grabbing active:scale-[0.98]",
|
|
6295
|
+
isThisCardDragging && "opacity-50 scale-[0.96] shadow-xl border-primary ring-2 ring-primary/20",
|
|
6296
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
6297
|
+
className
|
|
6298
|
+
),
|
|
6299
|
+
"data-kanban-card": id,
|
|
6300
|
+
"data-column": columnId,
|
|
6301
|
+
children
|
|
6302
|
+
}
|
|
6303
|
+
);
|
|
6304
|
+
}
|
|
6305
|
+
KanbanCard.displayName = "KanbanCard";
|
|
6306
|
+
|
|
6307
|
+
// src/components/Kanban/Kanban.tsx
|
|
6308
|
+
var Kanban = {
|
|
6309
|
+
Board: KanbanBoard,
|
|
6310
|
+
Column: KanbanColumn,
|
|
6311
|
+
Card: KanbanCard
|
|
6312
|
+
};
|
|
6313
|
+
var WizardContext = createContext(void 0);
|
|
6314
|
+
function useWizardContext() {
|
|
6315
|
+
const context = useContext(WizardContext);
|
|
6316
|
+
if (context === void 0) {
|
|
6317
|
+
throw new Error("useWizardContext must be used within a Wizard component");
|
|
6318
|
+
}
|
|
6319
|
+
return context;
|
|
6320
|
+
}
|
|
6321
|
+
function useWizardContextOptional() {
|
|
6322
|
+
return useContext(WizardContext);
|
|
6323
|
+
}
|
|
6324
|
+
function WizardProvider({
|
|
6325
|
+
children,
|
|
6326
|
+
form,
|
|
6327
|
+
steps,
|
|
6328
|
+
initialStep = 0,
|
|
6329
|
+
onStepChange,
|
|
6330
|
+
validateOnNext = true,
|
|
6331
|
+
allowJumpToStep = false
|
|
6332
|
+
}) {
|
|
6333
|
+
const [completedSteps, setCompletedSteps] = useState(/* @__PURE__ */ new Set());
|
|
6334
|
+
const activeSteps = useMemo(() => {
|
|
6335
|
+
const formValues = form.getValues();
|
|
6336
|
+
return steps.filter((step) => {
|
|
6337
|
+
if (typeof step.isHidden === "function") {
|
|
6338
|
+
return !step.isHidden(formValues);
|
|
6339
|
+
}
|
|
6340
|
+
return !step.isHidden;
|
|
6341
|
+
});
|
|
6342
|
+
}, [steps, form]);
|
|
6343
|
+
const [currentStep, setCurrentStep] = useState(() => {
|
|
6344
|
+
return Math.min(Math.max(0, initialStep), activeSteps.length - 1);
|
|
6345
|
+
});
|
|
6346
|
+
const totalSteps = activeSteps.length;
|
|
6347
|
+
const isFirstStep = currentStep === 0;
|
|
6348
|
+
const isLastStep = currentStep === totalSteps - 1;
|
|
6349
|
+
const progress = totalSteps > 0 ? Math.round((currentStep + 1) / totalSteps * 100) : 0;
|
|
6350
|
+
const currentStepConfig = activeSteps[currentStep];
|
|
6351
|
+
const getStepConfig = useCallback(
|
|
6352
|
+
(index) => activeSteps[index],
|
|
6353
|
+
[activeSteps]
|
|
6354
|
+
);
|
|
6355
|
+
const getStepByName = useCallback(
|
|
6356
|
+
(name) => activeSteps.find((step) => step.name === name || step.id === name),
|
|
6357
|
+
[activeSteps]
|
|
6358
|
+
);
|
|
6359
|
+
const getStepIndexByName = useCallback(
|
|
6360
|
+
(name) => activeSteps.findIndex((step) => step.name === name || step.id === name),
|
|
6361
|
+
[activeSteps]
|
|
6362
|
+
);
|
|
6363
|
+
const isStepCompleted = useCallback(
|
|
6364
|
+
(index) => completedSteps.has(index),
|
|
6365
|
+
[completedSteps]
|
|
6366
|
+
);
|
|
6367
|
+
const hasStepErrors = useCallback(
|
|
6368
|
+
(index) => {
|
|
6369
|
+
const stepConfig = activeSteps[index];
|
|
6370
|
+
if (!stepConfig?.fields) return false;
|
|
6371
|
+
const errors = form.formState.errors;
|
|
6372
|
+
return stepConfig.fields.some((field) => {
|
|
6373
|
+
const fieldPath = field;
|
|
6374
|
+
return fieldPath in errors;
|
|
6375
|
+
});
|
|
6376
|
+
},
|
|
6377
|
+
[activeSteps, form.formState.errors]
|
|
6378
|
+
);
|
|
6379
|
+
const validateCurrentStep = useCallback(async () => {
|
|
6380
|
+
const stepConfig = currentStepConfig;
|
|
6381
|
+
if (!stepConfig?.validationSchema) {
|
|
6382
|
+
return true;
|
|
6383
|
+
}
|
|
6384
|
+
const formValues = form.getValues();
|
|
6385
|
+
const result = await stepConfig.validationSchema.safeParseAsync(formValues);
|
|
6386
|
+
if (!result.success) {
|
|
6387
|
+
if (stepConfig.fields) {
|
|
6388
|
+
await Promise.all(
|
|
6389
|
+
stepConfig.fields.map((field) => form.trigger(field))
|
|
6390
|
+
);
|
|
6391
|
+
}
|
|
6392
|
+
return false;
|
|
6393
|
+
}
|
|
6394
|
+
if (stepConfig.fields) {
|
|
6395
|
+
stepConfig.fields.forEach((field) => {
|
|
6396
|
+
form.clearErrors(field);
|
|
6397
|
+
});
|
|
6398
|
+
}
|
|
6399
|
+
return true;
|
|
6400
|
+
}, [currentStepConfig, form]);
|
|
6401
|
+
const goToNextStep = useCallback(async () => {
|
|
6402
|
+
if (isLastStep) {
|
|
6403
|
+
return false;
|
|
6404
|
+
}
|
|
6405
|
+
if (validateOnNext) {
|
|
6406
|
+
const isValid = await validateCurrentStep();
|
|
6407
|
+
if (!isValid) {
|
|
6408
|
+
return false;
|
|
6409
|
+
}
|
|
6410
|
+
}
|
|
6411
|
+
setCompletedSteps((prev) => /* @__PURE__ */ new Set([...prev, currentStep]));
|
|
6412
|
+
const nextStep = currentStep + 1;
|
|
6413
|
+
setCurrentStep(nextStep);
|
|
6414
|
+
onStepChange?.(nextStep, "next");
|
|
6415
|
+
return true;
|
|
6416
|
+
}, [isLastStep, validateOnNext, validateCurrentStep, currentStep, onStepChange]);
|
|
6417
|
+
const goToPrevStep = useCallback(() => {
|
|
6418
|
+
if (isFirstStep) {
|
|
6419
|
+
return;
|
|
6420
|
+
}
|
|
6421
|
+
const prevStep = currentStep - 1;
|
|
6422
|
+
setCurrentStep(prevStep);
|
|
6423
|
+
onStepChange?.(prevStep, "prev");
|
|
6424
|
+
}, [isFirstStep, currentStep, onStepChange]);
|
|
6425
|
+
const goToStep = useCallback(
|
|
6426
|
+
async (targetStep) => {
|
|
6427
|
+
if (targetStep < 0 || targetStep >= totalSteps) {
|
|
6428
|
+
return false;
|
|
6429
|
+
}
|
|
6430
|
+
if (!allowJumpToStep && targetStep > currentStep) {
|
|
6431
|
+
for (let i = currentStep; i < targetStep; i++) {
|
|
6432
|
+
if (!completedSteps.has(i)) {
|
|
6433
|
+
return false;
|
|
6434
|
+
}
|
|
6435
|
+
}
|
|
6436
|
+
}
|
|
6437
|
+
if (targetStep < currentStep) {
|
|
6438
|
+
setCurrentStep(targetStep);
|
|
6439
|
+
onStepChange?.(targetStep, "jump");
|
|
6440
|
+
return true;
|
|
6441
|
+
}
|
|
6442
|
+
if (validateOnNext && targetStep > currentStep) {
|
|
6443
|
+
const isValid = await validateCurrentStep();
|
|
6444
|
+
if (!isValid) {
|
|
6445
|
+
return false;
|
|
6446
|
+
}
|
|
6447
|
+
setCompletedSteps((prev) => /* @__PURE__ */ new Set([...prev, currentStep]));
|
|
6448
|
+
}
|
|
6449
|
+
setCurrentStep(targetStep);
|
|
6450
|
+
onStepChange?.(targetStep, "jump");
|
|
6451
|
+
return true;
|
|
6452
|
+
},
|
|
6453
|
+
[totalSteps, allowJumpToStep, currentStep, completedSteps, validateOnNext, validateCurrentStep, onStepChange]
|
|
6454
|
+
);
|
|
6455
|
+
const reset = useCallback(() => {
|
|
6456
|
+
setCurrentStep(Math.min(Math.max(0, initialStep), activeSteps.length - 1));
|
|
6457
|
+
setCompletedSteps(/* @__PURE__ */ new Set());
|
|
6458
|
+
form.reset();
|
|
6459
|
+
}, [initialStep, activeSteps.length, form]);
|
|
6460
|
+
const contextValue = useMemo(
|
|
6461
|
+
() => ({
|
|
6462
|
+
// State
|
|
6463
|
+
currentStep,
|
|
6464
|
+
totalSteps,
|
|
6465
|
+
activeSteps,
|
|
6466
|
+
allSteps: steps,
|
|
6467
|
+
// Computed
|
|
6468
|
+
isFirstStep,
|
|
6469
|
+
isLastStep,
|
|
6470
|
+
progress,
|
|
6471
|
+
// Navigation
|
|
6472
|
+
goToNextStep,
|
|
6473
|
+
goToPrevStep,
|
|
6474
|
+
goToStep,
|
|
6475
|
+
reset,
|
|
6476
|
+
// Validation
|
|
6477
|
+
validateCurrentStep,
|
|
6478
|
+
isStepCompleted,
|
|
6479
|
+
hasStepErrors,
|
|
6480
|
+
// Form
|
|
6481
|
+
form,
|
|
6482
|
+
// Step info
|
|
6483
|
+
currentStepConfig,
|
|
6484
|
+
getStepConfig,
|
|
6485
|
+
getStepByName,
|
|
6486
|
+
getStepIndexByName,
|
|
6487
|
+
// Settings
|
|
6488
|
+
allowJumpToStep
|
|
6489
|
+
}),
|
|
6490
|
+
[
|
|
6491
|
+
currentStep,
|
|
6492
|
+
totalSteps,
|
|
6493
|
+
activeSteps,
|
|
6494
|
+
steps,
|
|
6495
|
+
isFirstStep,
|
|
6496
|
+
isLastStep,
|
|
6497
|
+
progress,
|
|
6498
|
+
goToNextStep,
|
|
6499
|
+
goToPrevStep,
|
|
6500
|
+
goToStep,
|
|
6501
|
+
reset,
|
|
6502
|
+
validateCurrentStep,
|
|
6503
|
+
isStepCompleted,
|
|
6504
|
+
hasStepErrors,
|
|
6505
|
+
form,
|
|
6506
|
+
currentStepConfig,
|
|
6507
|
+
getStepConfig,
|
|
6508
|
+
getStepByName,
|
|
6509
|
+
getStepIndexByName,
|
|
6510
|
+
allowJumpToStep
|
|
6511
|
+
]
|
|
6512
|
+
);
|
|
6513
|
+
return /* @__PURE__ */ jsx(WizardContext.Provider, { value: contextValue, children });
|
|
6514
|
+
}
|
|
6515
|
+
var sizeConfig = {
|
|
6516
|
+
sm: {
|
|
6517
|
+
circle: "h-7 w-7 text-xs",
|
|
6518
|
+
icon: "h-3.5 w-3.5",
|
|
6519
|
+
label: "text-xs",
|
|
6520
|
+
description: "text-xs",
|
|
6521
|
+
gap: "gap-1.5"
|
|
6522
|
+
},
|
|
6523
|
+
md: {
|
|
6524
|
+
circle: "h-9 w-9 text-sm",
|
|
6525
|
+
icon: "h-4 w-4",
|
|
6526
|
+
label: "text-sm",
|
|
6527
|
+
description: "text-xs",
|
|
6528
|
+
gap: "gap-2"
|
|
6529
|
+
},
|
|
6530
|
+
lg: {
|
|
6531
|
+
circle: "h-11 w-11 text-base",
|
|
6532
|
+
icon: "h-5 w-5",
|
|
6533
|
+
label: "text-base",
|
|
6534
|
+
description: "text-sm",
|
|
6535
|
+
gap: "gap-2.5"
|
|
6536
|
+
}
|
|
6537
|
+
};
|
|
6538
|
+
var stateStyles = {
|
|
6539
|
+
completed: {
|
|
6540
|
+
circle: "bg-green-500 text-white border-green-500",
|
|
6541
|
+
label: "text-green-600 dark:text-green-400",
|
|
6542
|
+
description: "text-muted-foreground"
|
|
6543
|
+
},
|
|
6544
|
+
current: {
|
|
6545
|
+
circle: "bg-primary text-primary-foreground border-primary ring-4 ring-primary/20",
|
|
6546
|
+
label: "text-primary font-semibold",
|
|
6547
|
+
description: "text-muted-foreground"
|
|
6548
|
+
},
|
|
6549
|
+
pending: {
|
|
6550
|
+
circle: "bg-background text-muted-foreground border-muted-foreground/30",
|
|
6551
|
+
label: "text-muted-foreground",
|
|
6552
|
+
description: "text-muted-foreground/60"
|
|
6553
|
+
},
|
|
6554
|
+
error: {
|
|
6555
|
+
circle: "bg-destructive text-destructive-foreground border-destructive",
|
|
6556
|
+
label: "text-destructive",
|
|
6557
|
+
description: "text-destructive/60"
|
|
6558
|
+
},
|
|
6559
|
+
disabled: {
|
|
6560
|
+
circle: "bg-muted text-muted-foreground/50 border-muted cursor-not-allowed",
|
|
6561
|
+
label: "text-muted-foreground/50",
|
|
6562
|
+
description: "text-muted-foreground/30"
|
|
6563
|
+
}
|
|
6564
|
+
};
|
|
6565
|
+
function WizardStepIndicator({
|
|
6566
|
+
step,
|
|
6567
|
+
index,
|
|
6568
|
+
state,
|
|
6569
|
+
showNumber = false,
|
|
6570
|
+
showDescription = false,
|
|
6571
|
+
size = "md",
|
|
6572
|
+
isClickable = false,
|
|
6573
|
+
onClick
|
|
6574
|
+
}) {
|
|
6575
|
+
const config = sizeConfig[size];
|
|
6576
|
+
const styles = stateStyles[state];
|
|
6577
|
+
const Icon2 = step.icon;
|
|
6578
|
+
const renderCircleContent = () => {
|
|
6579
|
+
if (state === "completed") {
|
|
6580
|
+
return /* @__PURE__ */ jsx(Check, { className: config.icon, strokeWidth: 3 });
|
|
6581
|
+
}
|
|
6582
|
+
if (state === "error") {
|
|
6583
|
+
return /* @__PURE__ */ jsx(AlertCircle, { className: config.icon });
|
|
6584
|
+
}
|
|
6585
|
+
if (Icon2 && !showNumber) {
|
|
6586
|
+
return /* @__PURE__ */ jsx(Icon2, { className: config.icon });
|
|
6587
|
+
}
|
|
6588
|
+
return /* @__PURE__ */ jsx("span", { children: index + 1 });
|
|
6589
|
+
};
|
|
6590
|
+
return /* @__PURE__ */ jsxs(
|
|
6591
|
+
"div",
|
|
6592
|
+
{
|
|
6593
|
+
className: cn(
|
|
6594
|
+
"flex flex-col items-center",
|
|
6595
|
+
config.gap,
|
|
6596
|
+
isClickable && "cursor-pointer group"
|
|
6597
|
+
),
|
|
6598
|
+
onClick: isClickable ? onClick : void 0,
|
|
6599
|
+
role: isClickable ? "button" : void 0,
|
|
6600
|
+
tabIndex: isClickable ? 0 : void 0,
|
|
6601
|
+
onKeyDown: isClickable ? (e) => {
|
|
6602
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
6603
|
+
e.preventDefault();
|
|
6604
|
+
onClick?.();
|
|
6605
|
+
}
|
|
6606
|
+
} : void 0,
|
|
6607
|
+
"aria-current": state === "current" ? "step" : void 0,
|
|
6608
|
+
children: [
|
|
6609
|
+
/* @__PURE__ */ jsx(
|
|
6610
|
+
"div",
|
|
6611
|
+
{
|
|
6612
|
+
className: cn(
|
|
6613
|
+
"flex items-center justify-center rounded-full border-2 transition-all duration-200",
|
|
6614
|
+
config.circle,
|
|
6615
|
+
styles.circle,
|
|
6616
|
+
isClickable && "group-hover:ring-4 group-hover:ring-primary/10"
|
|
6617
|
+
),
|
|
6618
|
+
children: renderCircleContent()
|
|
6619
|
+
}
|
|
6620
|
+
),
|
|
6621
|
+
(step.label || showDescription) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center text-center max-w-[120px]", children: [
|
|
6622
|
+
step.label && /* @__PURE__ */ jsx(
|
|
6623
|
+
"span",
|
|
6624
|
+
{
|
|
6625
|
+
className: cn(
|
|
6626
|
+
"leading-tight transition-colors duration-200",
|
|
6627
|
+
config.label,
|
|
6628
|
+
styles.label
|
|
6629
|
+
),
|
|
6630
|
+
children: step.label
|
|
6631
|
+
}
|
|
6632
|
+
),
|
|
6633
|
+
showDescription && step.description && /* @__PURE__ */ jsx(
|
|
6634
|
+
"span",
|
|
6635
|
+
{
|
|
6636
|
+
className: cn(
|
|
6637
|
+
"leading-tight mt-0.5",
|
|
6638
|
+
config.description,
|
|
6639
|
+
styles.description
|
|
6640
|
+
),
|
|
6641
|
+
children: step.description
|
|
6642
|
+
}
|
|
6643
|
+
)
|
|
6644
|
+
] })
|
|
6645
|
+
]
|
|
6646
|
+
}
|
|
6647
|
+
);
|
|
6648
|
+
}
|
|
6649
|
+
function WizardStepConnector({
|
|
6650
|
+
isCompleted = false,
|
|
6651
|
+
variant = "horizontal",
|
|
6652
|
+
className
|
|
6653
|
+
}) {
|
|
6654
|
+
const isHorizontal = variant === "horizontal";
|
|
6655
|
+
return /* @__PURE__ */ jsx(
|
|
6656
|
+
"div",
|
|
6657
|
+
{
|
|
6658
|
+
className: cn(
|
|
6659
|
+
"transition-colors duration-300",
|
|
6660
|
+
isHorizontal ? "flex-1 h-0.5 min-w-[24px] mx-2" : "w-0.5 min-h-[24px] my-2 ml-[18px]",
|
|
6661
|
+
isCompleted ? "bg-green-500" : "bg-muted-foreground/20",
|
|
6662
|
+
className
|
|
6663
|
+
),
|
|
6664
|
+
"aria-hidden": "true"
|
|
6665
|
+
}
|
|
6666
|
+
);
|
|
6667
|
+
}
|
|
6668
|
+
function WizardSteps({
|
|
6669
|
+
variant = "horizontal",
|
|
6670
|
+
showDescription = false,
|
|
6671
|
+
showNumbers = false,
|
|
6672
|
+
size = "md",
|
|
6673
|
+
className
|
|
6674
|
+
}) {
|
|
6675
|
+
const {
|
|
6676
|
+
activeSteps,
|
|
6677
|
+
currentStep,
|
|
6678
|
+
isStepCompleted,
|
|
6679
|
+
hasStepErrors,
|
|
6680
|
+
goToStep,
|
|
6681
|
+
allowJumpToStep
|
|
6682
|
+
} = useWizardContext();
|
|
6683
|
+
const getStepState = (index) => {
|
|
6684
|
+
const step = activeSteps[index];
|
|
6685
|
+
if (step.isDisabled) {
|
|
6686
|
+
return "disabled";
|
|
6687
|
+
}
|
|
6688
|
+
if (index === currentStep) {
|
|
6689
|
+
return hasStepErrors(index) ? "error" : "current";
|
|
6690
|
+
}
|
|
6691
|
+
if (isStepCompleted(index)) {
|
|
6692
|
+
return hasStepErrors(index) ? "error" : "completed";
|
|
6693
|
+
}
|
|
6694
|
+
return "pending";
|
|
6695
|
+
};
|
|
6696
|
+
const isStepClickable = (index) => {
|
|
6697
|
+
if (index === currentStep) return false;
|
|
6698
|
+
const step = activeSteps[index];
|
|
6699
|
+
if (step.isDisabled) return false;
|
|
6700
|
+
if (index < currentStep) return true;
|
|
6701
|
+
if (allowJumpToStep && index > currentStep) {
|
|
6702
|
+
for (let i = currentStep; i < index; i++) {
|
|
6703
|
+
if (!isStepCompleted(i)) return false;
|
|
6704
|
+
}
|
|
6705
|
+
return true;
|
|
6706
|
+
}
|
|
6707
|
+
return false;
|
|
6708
|
+
};
|
|
6709
|
+
const handleStepClick = async (index) => {
|
|
6710
|
+
if (isStepClickable(index)) {
|
|
6711
|
+
await goToStep(index);
|
|
6712
|
+
}
|
|
6713
|
+
};
|
|
6714
|
+
const isHorizontal = variant === "horizontal";
|
|
6715
|
+
return /* @__PURE__ */ jsx(
|
|
6716
|
+
"nav",
|
|
6717
|
+
{
|
|
6718
|
+
"aria-label": "Progresso do formul\xE1rio",
|
|
6719
|
+
className: cn(
|
|
6720
|
+
"flex",
|
|
6721
|
+
isHorizontal ? "flex-row items-center justify-center" : "flex-col items-start",
|
|
6722
|
+
className
|
|
6723
|
+
),
|
|
6724
|
+
children: activeSteps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
6725
|
+
"div",
|
|
6726
|
+
{
|
|
6727
|
+
className: cn(
|
|
6728
|
+
"flex",
|
|
6729
|
+
isHorizontal ? "flex-row items-center" : "flex-col",
|
|
6730
|
+
index !== activeSteps.length - 1 && isHorizontal && "flex-1"
|
|
6731
|
+
),
|
|
6732
|
+
children: [
|
|
6733
|
+
/* @__PURE__ */ jsx(
|
|
6734
|
+
WizardStepIndicator,
|
|
6735
|
+
{
|
|
6736
|
+
step,
|
|
6737
|
+
index,
|
|
6738
|
+
state: getStepState(index),
|
|
6739
|
+
showNumber: showNumbers,
|
|
6740
|
+
showDescription,
|
|
6741
|
+
size,
|
|
6742
|
+
isClickable: isStepClickable(index),
|
|
6743
|
+
onClick: () => handleStepClick(index)
|
|
6744
|
+
}
|
|
6745
|
+
),
|
|
6746
|
+
index !== activeSteps.length - 1 && /* @__PURE__ */ jsx(
|
|
6747
|
+
WizardStepConnector,
|
|
6748
|
+
{
|
|
6749
|
+
isCompleted: isStepCompleted(index),
|
|
6750
|
+
variant
|
|
6751
|
+
}
|
|
6752
|
+
)
|
|
6753
|
+
]
|
|
6754
|
+
},
|
|
6755
|
+
step.id
|
|
6756
|
+
))
|
|
6757
|
+
}
|
|
6758
|
+
);
|
|
6759
|
+
}
|
|
6760
|
+
function WizardContent({ children, className }) {
|
|
6761
|
+
const { currentStepConfig } = useWizardContext();
|
|
6762
|
+
let activePanel = null;
|
|
6763
|
+
Children.forEach(children, (child) => {
|
|
6764
|
+
if (!isValidElement(child)) return;
|
|
6765
|
+
const panelProps = child.props;
|
|
6766
|
+
if (panelProps.name === currentStepConfig?.name || panelProps.name === currentStepConfig?.id) {
|
|
6767
|
+
activePanel = child;
|
|
6768
|
+
}
|
|
6769
|
+
});
|
|
6770
|
+
return /* @__PURE__ */ jsx(
|
|
6771
|
+
"div",
|
|
6772
|
+
{
|
|
6773
|
+
className: cn("flex-1", className),
|
|
6774
|
+
role: "tabpanel",
|
|
6775
|
+
"aria-label": currentStepConfig?.label || currentStepConfig?.name,
|
|
6776
|
+
children: activePanel
|
|
6777
|
+
}
|
|
6778
|
+
);
|
|
6779
|
+
}
|
|
6780
|
+
function WizardPanel({ name, children, className }) {
|
|
6781
|
+
return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), "data-wizard-panel": name, children });
|
|
6782
|
+
}
|
|
6783
|
+
function WizardNavigation({
|
|
6784
|
+
cancelLabel = "Cancelar",
|
|
6785
|
+
prevLabel = "Voltar",
|
|
6786
|
+
nextLabel = "Continuar",
|
|
6787
|
+
submitLabel = "Finalizar",
|
|
6788
|
+
loadingLabel = "Processando...",
|
|
6789
|
+
onCancel,
|
|
6790
|
+
showCancel,
|
|
6791
|
+
submitDisabled = false,
|
|
6792
|
+
className
|
|
6793
|
+
}) {
|
|
6794
|
+
const {
|
|
6795
|
+
isFirstStep,
|
|
6796
|
+
isLastStep,
|
|
6797
|
+
goToNextStep,
|
|
6798
|
+
goToPrevStep,
|
|
6799
|
+
form
|
|
6800
|
+
} = useWizardContext();
|
|
6801
|
+
const isSubmitting = form.formState.isSubmitting;
|
|
6802
|
+
const shouldShowCancel = showCancel ?? isFirstStep;
|
|
6803
|
+
const handleNext = useCallback(async () => {
|
|
6804
|
+
await goToNextStep();
|
|
6805
|
+
}, [goToNextStep]);
|
|
6806
|
+
const handlePrev = useCallback(() => {
|
|
6807
|
+
goToPrevStep();
|
|
6808
|
+
}, [goToPrevStep]);
|
|
6809
|
+
const handleCancel = useCallback(() => {
|
|
6810
|
+
onCancel?.();
|
|
6811
|
+
}, [onCancel]);
|
|
6812
|
+
return /* @__PURE__ */ jsxs(
|
|
6813
|
+
"div",
|
|
6814
|
+
{
|
|
6815
|
+
className: cn(
|
|
6816
|
+
"flex items-center justify-between gap-3 pt-4 border-t border-border",
|
|
6817
|
+
className
|
|
6818
|
+
),
|
|
6819
|
+
children: [
|
|
6820
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: shouldShowCancel && onCancel ? /* @__PURE__ */ jsx(
|
|
6821
|
+
Button,
|
|
6822
|
+
{
|
|
6823
|
+
type: "button",
|
|
6824
|
+
variant: "outline",
|
|
6825
|
+
onClick: handleCancel,
|
|
6826
|
+
disabled: isSubmitting,
|
|
6827
|
+
className: "w-full sm:w-auto",
|
|
6828
|
+
children: cancelLabel
|
|
6829
|
+
}
|
|
6830
|
+
) : !isFirstStep ? /* @__PURE__ */ jsx(
|
|
6831
|
+
Button,
|
|
6832
|
+
{
|
|
6833
|
+
type: "button",
|
|
6834
|
+
variant: "outline",
|
|
6835
|
+
onClick: handlePrev,
|
|
6836
|
+
disabled: isSubmitting,
|
|
6837
|
+
className: "w-full sm:w-auto",
|
|
6838
|
+
children: prevLabel
|
|
6839
|
+
}
|
|
6840
|
+
) : /* @__PURE__ */ jsx("div", {}) }),
|
|
6841
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6842
|
+
!isFirstStep && shouldShowCancel && /* @__PURE__ */ jsx(
|
|
6843
|
+
Button,
|
|
6844
|
+
{
|
|
6845
|
+
type: "button",
|
|
6846
|
+
variant: "outline",
|
|
6847
|
+
onClick: handlePrev,
|
|
6848
|
+
disabled: isSubmitting,
|
|
6849
|
+
children: prevLabel
|
|
6850
|
+
}
|
|
6851
|
+
),
|
|
6852
|
+
isLastStep ? /* @__PURE__ */ jsx(
|
|
6853
|
+
Button,
|
|
6854
|
+
{
|
|
6855
|
+
type: "submit",
|
|
6856
|
+
disabled: submitDisabled || isSubmitting,
|
|
6857
|
+
className: "min-w-[120px]",
|
|
6858
|
+
children: isSubmitting ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
6859
|
+
/* @__PURE__ */ jsx(Loader, { variant: "spinner" }),
|
|
6860
|
+
loadingLabel
|
|
6861
|
+
] }) : submitLabel
|
|
6862
|
+
}
|
|
6863
|
+
) : /* @__PURE__ */ jsx(
|
|
6864
|
+
Button,
|
|
6865
|
+
{
|
|
6866
|
+
type: "button",
|
|
6867
|
+
onClick: handleNext,
|
|
6868
|
+
disabled: isSubmitting,
|
|
6869
|
+
className: "min-w-[120px]",
|
|
6870
|
+
children: nextLabel
|
|
6871
|
+
}
|
|
6872
|
+
)
|
|
6873
|
+
] })
|
|
6874
|
+
]
|
|
6875
|
+
}
|
|
6876
|
+
);
|
|
6877
|
+
}
|
|
6878
|
+
function WizardProgress({
|
|
6879
|
+
showPercentage = false,
|
|
6880
|
+
showStepCount = false,
|
|
6881
|
+
className
|
|
6882
|
+
}) {
|
|
6883
|
+
const { progress, currentStep, totalSteps } = useWizardContext();
|
|
6884
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
|
|
6885
|
+
(showPercentage || showStepCount) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2 text-sm text-muted-foreground", children: [
|
|
6886
|
+
showStepCount && /* @__PURE__ */ jsxs("span", { children: [
|
|
6887
|
+
"Etapa ",
|
|
6888
|
+
currentStep + 1,
|
|
6889
|
+
" de ",
|
|
6890
|
+
totalSteps
|
|
6891
|
+
] }),
|
|
6892
|
+
showPercentage && /* @__PURE__ */ jsxs("span", { className: !showStepCount ? "ml-auto" : "", children: [
|
|
6893
|
+
progress,
|
|
6894
|
+
"%"
|
|
6895
|
+
] })
|
|
6896
|
+
] }),
|
|
6897
|
+
/* @__PURE__ */ jsx(
|
|
6898
|
+
"div",
|
|
6899
|
+
{
|
|
6900
|
+
className: "h-2 w-full bg-muted rounded-full overflow-hidden",
|
|
6901
|
+
role: "progressbar",
|
|
6902
|
+
"aria-valuenow": progress,
|
|
6903
|
+
"aria-valuemin": 0,
|
|
6904
|
+
"aria-valuemax": 100,
|
|
6905
|
+
"aria-label": `Progresso: ${progress}%`,
|
|
6906
|
+
children: /* @__PURE__ */ jsx(
|
|
6907
|
+
"div",
|
|
6908
|
+
{
|
|
6909
|
+
className: "h-full bg-primary transition-all duration-300 ease-out rounded-full",
|
|
6910
|
+
style: { width: `${progress}%` }
|
|
6911
|
+
}
|
|
6912
|
+
)
|
|
6913
|
+
}
|
|
6914
|
+
)
|
|
6915
|
+
] });
|
|
6916
|
+
}
|
|
6917
|
+
function WizardRoot({
|
|
6918
|
+
children,
|
|
6919
|
+
form,
|
|
6920
|
+
steps,
|
|
6921
|
+
initialStep,
|
|
6922
|
+
onStepChange,
|
|
6923
|
+
onComplete,
|
|
6924
|
+
validateOnNext = true,
|
|
6925
|
+
allowJumpToStep = false,
|
|
6926
|
+
className
|
|
6927
|
+
}) {
|
|
6928
|
+
const handleSubmit = async (data) => {
|
|
6929
|
+
if (onComplete) {
|
|
6930
|
+
await onComplete(data);
|
|
6931
|
+
}
|
|
6932
|
+
};
|
|
6933
|
+
return /* @__PURE__ */ jsx(
|
|
6934
|
+
WizardProvider,
|
|
6935
|
+
{
|
|
6936
|
+
form,
|
|
6937
|
+
steps,
|
|
6938
|
+
initialStep,
|
|
6939
|
+
onStepChange,
|
|
6940
|
+
onComplete,
|
|
6941
|
+
validateOnNext,
|
|
6942
|
+
allowJumpToStep,
|
|
6943
|
+
children: /* @__PURE__ */ jsx(FormProvider$1, { ...form, children: /* @__PURE__ */ jsx(
|
|
6944
|
+
"form",
|
|
6945
|
+
{
|
|
6946
|
+
onSubmit: form.handleSubmit(handleSubmit),
|
|
6947
|
+
className: cn("flex flex-col", className),
|
|
6948
|
+
noValidate: true,
|
|
6949
|
+
children
|
|
6950
|
+
}
|
|
6951
|
+
) })
|
|
6952
|
+
}
|
|
6953
|
+
);
|
|
6954
|
+
}
|
|
6955
|
+
var Wizard = Object.assign(WizardRoot, {
|
|
6956
|
+
/** Visual step indicators */
|
|
6957
|
+
Steps: WizardSteps,
|
|
6958
|
+
/** Container for step panels */
|
|
6959
|
+
Content: WizardContent,
|
|
6960
|
+
/** Individual step content panel */
|
|
6961
|
+
Panel: WizardPanel,
|
|
6962
|
+
/** Navigation buttons (prev, next, submit) */
|
|
6963
|
+
Navigation: WizardNavigation,
|
|
6964
|
+
/** Progress bar indicator */
|
|
6965
|
+
Progress: WizardProgress
|
|
6966
|
+
});
|
|
6967
|
+
function Logo({
|
|
6968
|
+
width = 100,
|
|
6969
|
+
color = "currentColor",
|
|
6970
|
+
className = "text-primary"
|
|
6971
|
+
}) {
|
|
6972
|
+
const originalWidth = 207;
|
|
6973
|
+
const originalHeight = 304;
|
|
6974
|
+
let calculatedHeight = originalHeight;
|
|
6975
|
+
if (typeof width === "number") {
|
|
6976
|
+
calculatedHeight = Math.round(width * (originalHeight / originalWidth));
|
|
6977
|
+
} else if (typeof width === "string" && width.endsWith("%")) {
|
|
6978
|
+
calculatedHeight = "auto";
|
|
6979
|
+
} else if (typeof width === "string") {
|
|
6980
|
+
const numWidth = parseFloat(width);
|
|
6981
|
+
if (!isNaN(numWidth)) {
|
|
6982
|
+
calculatedHeight = `${Math.round(
|
|
6983
|
+
numWidth * (originalHeight / originalWidth)
|
|
6984
|
+
)}${width.match(/[a-zA-Z%]+$/)?.[0] || ""}`;
|
|
6985
|
+
} else {
|
|
6986
|
+
calculatedHeight = originalHeight;
|
|
6987
|
+
}
|
|
6988
|
+
}
|
|
6989
|
+
return /* @__PURE__ */ jsxs(
|
|
6990
|
+
"svg",
|
|
6991
|
+
{
|
|
6992
|
+
width,
|
|
6993
|
+
height: calculatedHeight,
|
|
6994
|
+
viewBox: "0 0 207 304",
|
|
6995
|
+
fill: "none",
|
|
6996
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6997
|
+
className: cn(className),
|
|
6998
|
+
style: color !== "currentColor" ? { fill: color } : void 0,
|
|
6999
|
+
"aria-label": "Facter Logo",
|
|
7000
|
+
role: "img",
|
|
7001
|
+
children: [
|
|
7002
|
+
/* @__PURE__ */ jsx(
|
|
7003
|
+
"mask",
|
|
7004
|
+
{
|
|
7005
|
+
id: "facter-logo-mask",
|
|
7006
|
+
maskUnits: "userSpaceOnUse",
|
|
7007
|
+
x: "0",
|
|
7008
|
+
y: "0",
|
|
7009
|
+
width: "207",
|
|
7010
|
+
height: "304",
|
|
7011
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0 0.15625H206.26V304H0V0.15625Z", fill: "white" })
|
|
7012
|
+
}
|
|
7013
|
+
),
|
|
7014
|
+
/* @__PURE__ */ jsx("g", { mask: "url(#facter-logo-mask)", children: /* @__PURE__ */ jsx(
|
|
7015
|
+
"path",
|
|
7016
|
+
{
|
|
7017
|
+
d: "M25.8384 196.911L15.4739 183.729C-10.7189 150.411 0.44781 101.422 38.4895 82.7344L206.266 0.307297V34.2396C206.266 60.1875 191.448 83.8698 168.12 95.2396L56.578 149.594C48.4634 153.547 41.3489 159.344 35.9791 166.609C30.5936 173.901 25.9582 183.906 26.3176 196.526C29.9947 193.609 34.0624 191.026 38.4843 188.854L206.26 106.432V140.359C206.26 166.313 191.437 189.995 168.109 201.365L56.578 255.708C48.4634 259.667 41.3489 265.464 35.9791 272.724C30.4426 280.224 25.6978 290.578 26.3593 303.693L15.4739 289.854C-7.54698 260.568 -1.72407 219.193 25.8384 196.911ZM134.818 266.526L206.208 303.724L206.187 210.802L134.953 246.661C126.828 250.755 126.755 262.323 134.818 266.526Z",
|
|
7018
|
+
fill: color === "currentColor" ? "currentColor" : color
|
|
7019
|
+
}
|
|
7020
|
+
) })
|
|
7021
|
+
]
|
|
7022
|
+
}
|
|
7023
|
+
);
|
|
7024
|
+
}
|
|
7025
|
+
var initialState = {
|
|
7026
|
+
theme: "system",
|
|
7027
|
+
setTheme: () => null
|
|
7028
|
+
};
|
|
7029
|
+
var ThemeProviderContext = React48.createContext(initialState);
|
|
7030
|
+
function ThemeProvider({
|
|
7031
|
+
children,
|
|
7032
|
+
defaultTheme = "system",
|
|
7033
|
+
storageKey = "facter-ds-theme",
|
|
7034
|
+
...props
|
|
7035
|
+
}) {
|
|
7036
|
+
const [theme, setTheme] = React48.useState(
|
|
7037
|
+
() => localStorage.getItem(storageKey) || defaultTheme
|
|
7038
|
+
);
|
|
7039
|
+
const [resolvedTheme, setResolvedTheme] = React48.useState("light");
|
|
7040
|
+
React48.useEffect(() => {
|
|
7041
|
+
const root = window.document.documentElement;
|
|
7042
|
+
root.classList.remove("light", "dark");
|
|
7043
|
+
if (theme === "system") {
|
|
7044
|
+
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
7045
|
+
root.classList.add(systemTheme);
|
|
7046
|
+
setResolvedTheme(systemTheme);
|
|
7047
|
+
return;
|
|
7048
|
+
}
|
|
7049
|
+
root.classList.add(theme);
|
|
7050
|
+
setResolvedTheme(theme);
|
|
7051
|
+
}, [theme]);
|
|
7052
|
+
const value = React48.useMemo(
|
|
7053
|
+
() => ({
|
|
7054
|
+
theme,
|
|
7055
|
+
setTheme: (theme2) => {
|
|
7056
|
+
localStorage.setItem(storageKey, theme2);
|
|
7057
|
+
setTheme(theme2);
|
|
7058
|
+
}
|
|
7059
|
+
}),
|
|
7060
|
+
[theme, storageKey]
|
|
7061
|
+
);
|
|
7062
|
+
return /* @__PURE__ */ jsx(ThemeProviderContext.Provider, { ...props, value, children: /* @__PURE__ */ jsx("div", { className: resolvedTheme, style: { minHeight: "100vh" }, children }) });
|
|
7063
|
+
}
|
|
7064
|
+
var useTheme = () => {
|
|
7065
|
+
const context = React48.useContext(ThemeProviderContext);
|
|
7066
|
+
if (context === void 0)
|
|
7067
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
7068
|
+
return context;
|
|
7069
|
+
};
|
|
7070
|
+
|
|
7071
|
+
// src/themes/index.ts
|
|
7072
|
+
var FACTER_THEMES = {
|
|
7073
|
+
default: "default",
|
|
7074
|
+
truck: "truck",
|
|
7075
|
+
vagas: "vagas",
|
|
7076
|
+
techcare: "techcare"
|
|
7077
|
+
};
|
|
7078
|
+
var THEME_INFO = {
|
|
7079
|
+
default: {
|
|
7080
|
+
name: "Default",
|
|
7081
|
+
primaryColor: "#18181B",
|
|
7082
|
+
primaryHsl: "240 5.9% 10%",
|
|
7083
|
+
ringHsl: "240 5.9% 10%",
|
|
7084
|
+
description: "Tema neutro padr\xE3o"
|
|
7085
|
+
},
|
|
7086
|
+
truck: {
|
|
7087
|
+
name: "Facter Truck",
|
|
7088
|
+
primaryColor: "#3B5BDB",
|
|
7089
|
+
primaryHsl: "233 65% 55%",
|
|
7090
|
+
ringHsl: "233 65% 55%",
|
|
7091
|
+
description: "Sistema de gest\xE3o de frotas"
|
|
7092
|
+
},
|
|
7093
|
+
vagas: {
|
|
7094
|
+
name: "Facter Vagas",
|
|
7095
|
+
primaryColor: "#8B5CF6",
|
|
7096
|
+
primaryHsl: "262 83% 58%",
|
|
7097
|
+
ringHsl: "262 83% 58%",
|
|
7098
|
+
description: "Plataforma de vagas de emprego"
|
|
7099
|
+
},
|
|
7100
|
+
techcare: {
|
|
7101
|
+
name: "Facter TechCare",
|
|
7102
|
+
primaryColor: "#16A34A",
|
|
7103
|
+
primaryHsl: "142 76% 36%",
|
|
7104
|
+
ringHsl: "142 76% 36%",
|
|
7105
|
+
description: "Sistema de assist\xEAncia t\xE9cnica"
|
|
7106
|
+
}
|
|
4278
7107
|
};
|
|
4279
7108
|
|
|
4280
|
-
export { AuthLayout, Badge, Button, Checkbox, DENSITY_CONFIG, DashboardLayout, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, EmptyState, Form, FormCheckbox, FormDescription, FormError, FormFieldProvider, FormFieldWrapper, FormInput, FormLabel, FormProvider, FormRadioGroup, FormSelect, FormSwitch, FormTextarea, GlobalLoaderController, Input, Loader, LoaderProvider, RippleBackground, RippleEffect, RippleWrapper, Select, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectionLayout, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toaster, cn, loader, toast, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormContext, useFormFieldContext, useLoader, useTheme };
|
|
7109
|
+
export { AuthLayout, Avatar, AvatarFallback, AvatarImage, Badge, BigNumberCard, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DENSITY_CONFIG, DashboardLayout, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FACTER_THEMES, Form, FormCheckbox, FormDescription, FormError, FormFieldProvider, FormFieldWrapper, FormInput, FormLabel, FormProvider, FormRadioGroup, FormSelect, FormSwitch, FormTextarea, GlobalLoaderController, Input, Kanban, Loader, LoaderProvider, Logo, MobileNav, MobileNavItem, Navbar, NavbarCompanyProfile, NavbarNotification, NavbarUserMenu, Popover, PopoverContent, PopoverTrigger, RippleBackground, RippleEffect, RippleWrapper, ScrollArea, ScrollBar, SectionHeader, SectionHeaderActions, SectionHeaderBadge, SectionHeaderContent, SectionHeaderIcon, SectionHeaderRoot, SectionHeaderSubtitle, SectionHeaderTitle, Select, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectionLayout, Separator3 as Separator, Sidebar, Skeleton, Sparkline, Switch, THEME_INFO, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, ThemeToggle, Toaster, Wizard, WizardContent, WizardNavigation, WizardPanel, WizardProgress, WizardProvider, WizardStepConnector, WizardStepIndicator, WizardSteps, cn, loader, toast, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormContext, useFormFieldContext, useKanban, useKanbanOptional, useLoader, useMediaQuery2 as useMediaQuery, useSidebar, useSidebarOptional, useTheme, useWizardContext, useWizardContextOptional };
|
|
4281
7110
|
//# sourceMappingURL=index.mjs.map
|
|
4282
7111
|
//# sourceMappingURL=index.mjs.map
|